Пример #1
0
 /**
  * Finds content objects for the given query.
  *
  * @todo define structs for the field filters
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if Query criterion is not applicable to its target
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Query $query
  * @param array $fieldFilters - a map of filters for the returned fields.
  *        Currently supported: <code>array("languages" => array(<language1>,..))</code>.
  *
  * @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult
  */
 public function findContent(Query $query, array $fieldFilters = array())
 {
     $query->filter = $query->filter ?: new Criterion\MatchAll();
     $query->query = $query->query ?: new Criterion\MatchAll();
     $data = $this->gateway->find($query, "content", $fieldFilters);
     return $this->extractor->extract($data);
 }
Пример #2
0
 /**
  * Finds Locations for the given $query
  *
  * @param \eZ\Publish\API\Repository\Values\Content\LocationQuery $query
  *
  * @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult
  */
 public function findLocations(LocationQuery $query)
 {
     $query->filter = $query->filter ?: new Criterion\MatchAll();
     $query->query = $query->query ?: new Criterion\MatchAll();
     $data = $this->gateway->find($query, "location");
     return $this->extractor->extract($data);
 }