Example #1
0
 /**
  * {@inheritdoc}
  */
 public function setQueryComponent($dqlAlias, array $queryComponent)
 {
     $requiredKeys = array('metadata', 'parent', 'relation', 'map', 'nestingLevel', 'token');
     if (array_diff($requiredKeys, array_keys($queryComponent))) {
         throw QueryException::invalidQueryComponent($dqlAlias);
     }
     $this->queryComponents[$dqlAlias] = $queryComponent;
 }
Example #2
0
 /**
  * Add query components which will add to query hints
  *
  * @param array $queryComponents
  * @throws QueryException
  */
 protected function addQueryComponents(array $queryComponents)
 {
     $requiredKeys = array('metadata', 'parent', 'relation', 'map', 'nestingLevel', 'token');
     foreach ($queryComponents as $dqlAlias => $queryComponent) {
         if (array_diff($requiredKeys, array_keys($queryComponent))) {
             throw QueryException::invalidQueryComponent($dqlAlias);
         }
         $this->queryComponents[$dqlAlias] = $queryComponent;
     }
 }