/** * @param SpecificationInterface $criteria * * @return $this */ public function thatMatchToCriteria(SpecificationInterface $criteria) { $collection = $this->valueAsCollection(); foreach ($collection as $item) { if (!$this->checkMatchResult($criteria->evaluate($item))) { return $this; } } $this->pass(); return $this; }
/** * @param SpecificationInterface $specification * * @return \Cubiche\Core\Specification\SpecificationInterface */ public static function not(SpecificationInterface $specification) { return $specification->not(); }
/** * @param SpecificationInterface $criteria * * @return $this */ public function addSearchCriteria(SpecificationInterface $criteria) { $criteria->accept($this->specificationVisitorFactory->create($this)); return $this; }