public function createReference() { $documentId = $this->getId(); if (null === $documentId) { throw new Exception('Document must be stored to get DBRef'); } return $this->getCollection()->getMongoCollection()->createDBRef($documentId); }
/** * Push reference to list * * @param string $name * @param Document $document * @return Document */ public function pushReference($name, Document $document) { return $this->push($name, $document->createReference()); }