This class regardless the constructor will always be iteratable, so in worse case scenario there will be no results inside, but your controllers will still work. It's not recommended to use it on development environment due to eventual problems with debugging.
Автор: Krzysztof Gzocha (krzysztof@propertyfinder.ae)
Наследование: extends KGzocha\Searcher\AbstractCollection, implements KGzocha\Searcher\Result\ResultCollectionInterface
Пример #1
0
 /**
  * Will perform multiple sub-searches.
  * Results from first search will be transformed and passed as CriteriaCollection
  * to another sub-search.
  * Whole process will return collection of results from each sub-search.
  *
  * @param CriteriaCollectionInterface $criteriaCollection
  *
  * @return ResultCollection
  */
 public function search(CriteriaCollectionInterface $criteriaCollection)
 {
     $previousCriteria = $criteriaCollection;
     $previousResults = null;
     $result = new ResultCollection();
     /** @var CellInterface $cell */
     foreach ($this->cellCollection as $name => $cell) {
         if ($cell->getTransformer()->skip($previousResults)) {
             continue;
         }
         $previousResults = $cell->getSearcher()->search($previousCriteria);
         $previousCriteria = $this->getNewCriteria($cell, $previousCriteria, $previousResults);
         $result->addNamedItem($name, $previousResults);
     }
     return $result;
 }