andrii-mz/doctrine-qb-filter

Doctrine query builder filter without repositories.

Installs: 108

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

0.0.4 2020-10-03 08:35 UTC

This package is auto-updated.

Last update: 2024-11-06 00:57:47 UTC


README

Query Filter Bundle

Query Filter Bundle gives an ability to user array filters instead of building query builder every time.

For example, you have an entity:

class User {
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     */
    public $id;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Task")
     */
    public $task;
} 

If you need to extract users with task you can write simple lines instead of building queryBuilder:

    $filter = new FilterRequest();
    $filter->filter['task']['is_not_null'] = true;
    $result = $queryFilter->getResults(User::class, $filter);
    $users = $result->items;