public function getReference() { $collection = collection::forClass($this->_className)->select(); if (null != $this->_model) { $this->_model->save(); } $id = $this->getId(); return \MongoDBRef::create($collection->getName(), $id, (string) $collection->db); }
public function makeRef() { $className = \get_called_class(); //$ref = \MongoDBRef::create($this->collectionName(), $this->getId(), $this->dbName()); return collection::forClass($className)->select()->createDBRef($this->_data); //->createReference($this->getId()); }