Наследование: implements Doctrine\Common\Persistence\ObjectManager
Пример #1
0
 /**
  * Initializes a new instance of the <tt>ProxyFactory</tt> class that is
  * connected to the given <tt>DocumentManager</tt>.
  *
  * @param \Doctrine\ODM\OrientDB\Manager $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(Manager $manager, $proxyDir, $proxyNamespace, $autoGenerate = AbstractProxyFactory::AUTOGENERATE_NEVER)
 {
     $this->metadataFactory = $manager->getMetadataFactory();
     $this->uow = $manager->getUnitOfWork();
     $this->proxyNamespace = $proxyNamespace;
     $proxyGenerator = new ProxyGenerator($proxyDir, $proxyNamespace);
     $proxyGenerator->setPlaceholder('baseProxyInterface', 'Doctrine\\ODM\\OrientDB\\Proxy\\Proxy');
     parent::__construct($proxyGenerator, $this->metadataFactory, $autoGenerate);
 }
Пример #2
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\OrientDB\Binding\HttpBinding;
use Doctrine\OrientDB\Binding\BindingParameters;
use Doctrine\ODM\OrientDB as ODM;
require __DIR__ . '/../autoload.php';
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Domain' => __DIR__ . '/../examples/'));
$loader->register();
$parameters = BindingParameters::create('http://*****:*****@127.0.0.1:2480/menu');
$binding = new HttpBinding($parameters);
$configuration = new ODM\Configuration(array('document_dirs' => array(__DIR__ . '/../examples/' => 'Domain'), 'proxy_dir' => __DIR__ . '/../examples/proxies'));
$manager = new ODM\Manager($binding, $configuration);
$menus = $manager->getRepository('Domain\\Menu');
foreach ($menus->findAll() as $menu) {
    echo "Menu: ", $menu->getTitle(), "\n";
    foreach ($menu->getLinks() as $link) {
        // object inheriting from Link
        echo "Link \"{$link->getTitle()}\" ====>>> {$link->getLink()}\n";
    }
}