symfony - Query builder and entity inheritance -


i have entities:

abstract class abstractentity {     private $somefield; }  /**  * ...  * @orm\entity(repositoryclass="concreteentityrepository")  */ class concreteentity extends abstractentity {     private $otherfield; }  class concreteentityrepository extends entityrepository {     public function getsomething()     {         $qb = $this->getentitymanager()->createquerybuilder()             ->select('t')             ->from('mybundle:concreteentity', 't');          $result = $query->getresult();     } } 

result correct count of fields values of parent class null. how can correctly fields?

and when try use:

->select('t.somefield') // error  ->select('t.otherfield') // 

my guess can't use private properties in abstract class. try using protected ones.

the documentation same: http://docs.doctrine-project.org/en/latest/reference/inheritance-mapping.html.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -