I am working with an embbeded document currently, and I need to get the account information from the parent document to generate an URL. How can I access the parent document from a getter on the embedded document?
/** @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; } }
Thanks, Cory