PHP code example of aternovtsii / search-bundle

1. Go to this page and download the library: Download aternovtsii/search-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/ */

    

aternovtsii / search-bundle example snippets




return [
    // ...
    ATSearchBundle\ATSearchBundle::class => ['all' => true],
];



namespace App\Entity;

use ATSearchBundle\Annotation as ATSearch;
use Doctrine\ORM\Mapping as ORM;

#[ATSearch\Index]
#[ORM\Entity]
class User
{
    #[ATSearch\FieldId]
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    public ?int $id = null;

    #[ATSearch\FieldString]
    #[ORM\Column(length: 128)]
    public ?string $firstName = null;

    #[ATSearch\FieldMultiString(subFields: 'email')]
    #[ORM\OneToMany(mappedBy: 'user', targetEntity: Email::class)]
    public Collection $emails;