I am new to Symfony/Doctrine. I created 2 entities for managing some comments and documents attached to them: Here is comment entity, and here comment document entity. Now the question is when fetch data from db like this:
$comment = $em->getRepository('PathToBundle:Comment')->findOneBy( array('ordernumber' => '123456') ); and, let's say I wan't to debug it so I
print_r($comment); It print's out something like this:
Path\ToBundle\Entity\Comment Object ( [id:Path\ToBundle\Entity\Comment:private] => 1 [ordernumber:Path\ToBundle\Entity\Comment:private] => 123456 [category:Path\ToBundle\Entity\Comment:private] => cat1 [comment:Path\ToBundle\Entity\Comment:private] => com1 [user:Path\ToBundle\Entity\Comment:private] => usr1 [version:Path\ToBundle\Entity\Comment:private] => 0 [documents:Path\ToBundle\Entity\Comment:private] => Doctrine\ORM\PersistentCollection Object ( [snapshot:Doctrine\ORM\PersistentCollection:private] => Array ( ) [owner:Doctrine\ORM\PersistentCollection:private] => Path\ToBundle\Entity\Comment Object *RECURSION* [association:Doctrine\ORM\PersistentCollection:private] => Array ( [fieldName] => documents [mappedBy] => comment [targetEntity] => Path\ToBundle\Entity\CommentDocument [cascade] => Array ( ) [orphanRemoval] => [fetch] => 2 [type] => 4 [inversedBy] => [isOwningSide] => [sourceEntity] => Path\ToBundle\Entity\Comment [isCascadeRemove] => [isCascadePersist] => [isCascadeRefresh] => [isCascadeMerge] => [isCascadeDetach] => ) And it's just beginning, it goes on and on until browser crashes. But if try to access single property like
print_r($input->getComment()); It works ok.
So is this behavior normal, or I done something wrong? And how can I access associated documents table values?