Example #1
0
 /**
  * {@inheritdoc}
  */
 public function getCurrentPageResults()
 {
     $results = parent::getCurrentPageResults();
     if ($this->built === null) {
         foreach ($results as $key => $data) {
             $entity = $this->builder->getEntity();
             $this->builder->createFromDatabaseValues($data, $entity);
             $results[$key] = $entity;
         }
         $this->setCurrentPageResults($results);
         $this->built = true;
     }
     return $results;
 }
Example #2
0
 /**
  * Get an entity builder instance for a given class.
  *
  * @param string        $className
  * @param ClassMetadata $classMetadata
  *
  * @return Entity\Builder
  */
 public function getEntityBuilder($className = null, ClassMetadata $classMetadata = null)
 {
     $builder = new Builder($this->getMapper(), $this->getFieldManager());
     if ($className !== null) {
         $builder->setClass($className);
     }
     if ($classMetadata !== null) {
         $builder->setClassMetadata($classMetadata);
     }
     return $builder;
 }