Doctrine\ODM\MongoDB\DocumentManager::getMetadataFactory PHP Method

getMetadataFactory() public method

Gets the metadata factory used to gather the metadata of classes.
public getMetadataFactory ( ) : ClassMetadataFactory
return Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory
    public function getMetadataFactory()
    {
        return $this->metadataFactory;
    }

Usage Example

Example #1
0
 /**
  * Initializes a new instance of the <tt>ProxyFactory</tt> class that is
  * connected to the given <tt>DocumentManager</tt>.
  *
  * @param \Doctrine\ODM\MongoDB\DocumentManager $documentManager The DocumentManager the new factory works for.
  * @param string                                $proxyDir        The directory to use for the proxy classes. It
  *                                                               must exist.
  * @param string                                $proxyNamespace  The namespace to use for the proxy classes.
  * @param integer                               $autoGenerate    Whether to automatically generate proxy classes.
  */
 public function __construct(DocumentManager $documentManager, $proxyDir, $proxyNamespace, $autoGenerate = AbstractProxyFactory::AUTOGENERATE_NEVER)
 {
     $this->metadataFactory = $documentManager->getMetadataFactory();
     $this->uow = $documentManager->getUnitOfWork();
     $this->proxyNamespace = $proxyNamespace;
     $proxyGenerator = new ProxyGenerator($proxyDir, $proxyNamespace);
     $proxyGenerator->setPlaceholder('baseProxyInterface', 'Doctrine\\ODM\\MongoDB\\Proxy\\Proxy');
     parent::__construct($proxyGenerator, $this->metadataFactory, $autoGenerate);
 }
All Usage Examples Of Doctrine\ODM\MongoDB\DocumentManager::getMetadataFactory