3
현재 embeded 문서로 작업하고 있으며 URL을 생성하기 위해 부모 문서에서 계정 정보를 가져와야합니다. 임베디드 문서의 getter에서 부모 문서에 어떻게 액세스합니까?Doctrine ODM 임베드 된 문서 부모 참조
/** @Document */ class User { // ... /** @EmbedOne(targetDocument="Image") */ private $image; /** @ReferenceOne(targetDocument="Account") */ private $account; // ... } /** @EmbeddedDocument */ class Image { private $url; public function getUrl(){ // sudo code. How do I do this? return $this->getParent()->getAccount()->getDomain().$this->url; } }
감사합니다, 코리