php - ManyToMany doctrine relation with FOSUserBundle -
i make relationship manytomany 2 entity:
- user (used fosuserbundle)
- categorie
for moment, i'm doing in "mynamespace/userbundle/entity/user.php" :
/** * @orm\manytomany(targetentity="\mynamespace\websitebundle\entity\categorie", inversedby="users") * @orm\jointable(name="user_has_categories") */ private $categories; public function __construct() { parent::__construct(); $this->categories = new \doctrine\common\collections\arraycollection(); }
and in "mynamespace/websitebundle/entity/categorie.php" :
/** * @orm\manytomany(targetentity="\mynamespace\userbundle\entity\user", mappedby="categories") */ private $users; public function __construct() { $this->users = new \doctrine\common\collections\arraycollection(); }
when run doctrine command create table reationship, ok.
but when var_dump($this->getuser());
in default controller (for exemple), have infinite loop crashes browser. effect no longer appears when delete relationship in user entity ...
that have idea problem may be?
i turn php 5.4.9 on ubuntu
thank's :)
use
doctrine\common\util\debug::dump()
instead of var_dump
-updated-
why debug::dump() works var_dump doesn't:
doctrine\common\util\debug::dump() accept second parameter maxdepth default value = 2 limit nested reference 2 level. can pass value like.
Comments
Post a Comment