Example #1
0
 public function __construct(SessionInterface $session, Configuration $config = null, EventManager $evm = null)
 {
     $this->session = $session;
     $this->config = $config ?: new Configuration();
     $this->evm = $evm ?: new EventManager();
     $this->metadataFactory = new ClassMetadataFactory($this);
     $this->unitOfWork = new UnitOfWork($this);
     $this->proxyFactory = new ProxyFactory($this, $this->config->getProxyDir(), $this->config->getProxyNamespace(), $this->config->getAutoGenerateProxyClasses());
     // initialize default translation strategies
     $this->translationStrategy = array('attribute' => new AttributeTranslationStrategy(), 'child' => new ChildTranslationStrategy());
 }