Ejemplo n.º 1
0
 /**
  * Loads the objects this QueryResult is supposed to hold
  *
  * @return void
  */
 protected function initialize()
 {
     if (!is_array($this->queryResult)) {
         $this->queryResult = $this->dataMapper->map($this->query->getType(), $this->persistenceManager->getObjectDataByQuery($this->query));
     }
 }
Ejemplo n.º 2
0
 /**
  * @param QueryInterface $query
  * @return array
  */
 protected function addOptionsFromResults(QueryInterface $query)
 {
     $items = array();
     $results = $query->execute();
     $type = $query->getType();
     $table = strtolower(str_replace('\\', '_', $type));
     $propertyName = $this->getLabelPropertyName($table, $type);
     foreach ($results as $result) {
         $uid = $result->getUid();
         array_push($items, array(ObjectAccess::getProperty($result, $propertyName), $uid));
     }
     return $items;
 }