Example #1
0
 /**
  * @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;
 }
Example #2
0
 /**
  * @param SpecificationInterface $specification
  *
  * @return \Cubiche\Core\Specification\SpecificationInterface
  */
 public static function not(SpecificationInterface $specification)
 {
     return $specification->not();
 }
Example #3
0
 /**
  * @param SpecificationInterface $criteria
  *
  * @return $this
  */
 public function addSearchCriteria(SpecificationInterface $criteria)
 {
     $criteria->accept($this->specificationVisitorFactory->create($this));
     return $this;
 }