예제 #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();
     $metadataFactoryClassName = $this->config->getClassMetadataFactoryName();
     $this->metadataFactory = new $metadataFactoryClassName($this);
     $this->unitOfWork = new UnitOfWork($this);
     $this->valueConverter = new ValueConverter();
     $this->proxyFactory = new ProxyFactory($this, $this->config->getProxyDir(), $this->config->getProxyNamespace(), $this->config->getAutoGenerateProxyClasses());
     $this->repositoryFactory = $this->config->getRepositoryFactory();
     // initialize default translation strategies
     $this->translationStrategy = array('attribute' => new AttributeTranslationStrategy($this), 'child' => new ChildTranslationStrategy($this));
 }