-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Needing to write
use Rb\Specification\Doctrine\Condition\Equals;
use Rb\Specification\Doctrine\Condition\IsNull;
use Rb\Specification\Doctrine\Condition\LessThan;
use Rb\Specification\Doctrine\Logic\AndX;
use Rb\Specification\Doctrine\Logic\OrX;
...is tedious AND bloated (even with PHP7 syntax) a factory instead would be an improvement and let you choose whichever method you like
use Rb\Specification\Doctrine\SpecificationFactory as Factory;
use Rb\Specification\Doctrine\Specification;
$spec = new Specification([
Factory::Equals('ended', 0),
Factory::OrX(
Factory::LessThan('endDate', new \DateTime()),
Factory::AndX(
Factory::IsNull('endDate'),
Factory::LessThan('startDate', new \DateTime('-4weeks'))
)
)
]);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels