Khandaker Toihidul Islam
Software Engineer
Backend : PHP | Mysql | Symfony | CakePhp | Wordpress | Drupal
Frontend : Node js | Vue js | React Js | Javascript | HTML | CSS | Bootstrap
Tools , Server : Nginx | Apache | Git | Jenkins | Jira | Asana | Silenium | Spira

Query builder in Easy Admin

Add uqury builder in easy_admin.yaml

{ property: ‘grade’, type: ‘entity’, type_options: { class: ‘App\Entity\Grade’, required: true, multiple: false, query_builder: [‘App\Repository\GradeRepository’, ‘available’] }, css_class: ‘col-sm-6’ }

Add static function in repogitory

    public static function available(GradeRepository $r): QueryBuilder
    {
        
        return $r->createQueryBuilder('g')
           ->innerJoin('g.school', 's')
           ->where('s.id = :school')
           ->setParameter('school', 2)
           ->orderBy('g.id', 'DESC');

     }

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *