PHP code example of tourze / doctrine-indexed-bundle
1. Go to this page and download the library: Download tourze/doctrine-indexed-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Tourze\DoctrineIndexedBundle\Attribute\IndexColumn;
use Tourze\DoctrineIndexedBundle\Attribute\FulltextColumn;
use Tourze\DoctrineIndexedBundle\Attribute\UniqueColumn;
class YourEntity
{
#[ORM\Column]
#[IndexColumn] // Regular index
private string $name;
#[ORM\Column(type: 'text')]
#[FulltextColumn] // Fulltext index
private string $description;
#[ORM\Column]
#[UniqueColumn] // Unique index
private string $email;
}