5
$posts = $em->find('Application\BlogBundle\Entity\Post',1);
print_r ($posts);
爲什麼我得到它?Symfony2,Doctrine 2:getResult Object
Barii\BlogBundle\Entity\Post Object ([id:Barii\BlogBundle\Entity\Post:private] => 1 [title:Application\BlogBundle\Entity\Post:private] => something [body:Application\BlogBundle\Entity\Post:private] => content )
,而不是一個簡單的數組是這樣的:
array ([id] => 1,
[title] => "something",
[body] => "content" )
我用它來與Symfony的2
令人失望的是,Sf2/Doctrine沒有預料到這種非常常見的用例。 – Acyra 2011-11-27 20:28:24