当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityRepository::__construct方法代码示例

本文整理汇总了PHP中Doctrine\ORM\EntityRepository::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityRepository::__construct方法的具体用法?PHP EntityRepository::__construct怎么用?PHP EntityRepository::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\ORM\EntityRepository的用法示例。


在下文中一共展示了EntityRepository::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     if ($class->getReflectionClass()->isSubclassOf('Gedmo\\Translatable\\Entity\\MappedSuperclass\\AbstractPersonalTranslation')) {
         throw new \Gedmo\Exception\UnexpectedValueException('This repository is useless for personal translations');
     }
     parent::__construct($em, $class);
 }
开发者ID:n1c01a5,项目名称:DoctrineExtensions,代码行数:10,代码来源:TranslationRepository.php

示例2: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     if (isset($this->getClassMetadata()->associationMappings['translations']) && !empty($this->getClassMetadata()->associationMappings['translations'])) {
         $this->_entityTranslationName = $this->getClassMetadata()->associationMappings['translations']['targetEntity'];
     }
 }
开发者ID:pigroupe,项目名称:SfynxCoreBundle,代码行数:10,代码来源:TranslationRepository.php

示例3: __construct

 /**
  * ActivityRepositoryAbstract constructor.
  *
  * @inheritdoc
  */
 public function __construct($em, \Doctrine\ORM\Mapping\ClassMetadata $class)
 {
     $this->dayListResolver = new OptionsResolver();
     $this->dayListResolver->setRequired(array('date_day', 'school'));
     $this->configureDayListOptions($this->dayListResolver);
     parent::__construct($em, $class);
 }
开发者ID:WildCodeSchool,项目名称:projet-gesty,代码行数:12,代码来源:ActivityRepositoryAbstract.php

示例4: __construct

 /**
  * Class constructor.
  *
  * @param type          $em
  * @param ClassMetadata $class
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $this->table = $this->getClassMetadata()->table['name'];
     $this->name = $this->getClassMetadata()->fieldMappings['_name']['columnName'];
     $this->value = $this->getClassMetadata()->fieldMappings['_value']['columnName'];
 }
开发者ID:mickaelsteinberg,项目名称:BackBee,代码行数:13,代码来源:Sequencer.php

示例5: __construct

 public function __construct(Application $app)
 {
     $this->app = $app;
     $entityManager = $app[$this->entityManager];
     $clazz = new ClassMetadata($this->modelName);
     parent::__construct($entityManager, $clazz);
 }
开发者ID:rikniitt,项目名称:legacy-php-boilerplate,代码行数:7,代码来源:Repository.php

示例6: __construct

 public function __construct($em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $this->className = $this->getClassName();
     $this->entityName = $this->getEntityName();
     $this->tableName = $class->getTableName();
 }
开发者ID:kidaa,项目名称:evedata,代码行数:7,代码来源:BaseRepository.php

示例7: __construct

 public function __construct(\Doctrine\ORM\EntityManager $em, \Doctrine\ORM\Mapping\ClassMetadata $class)
 {
     $this->resolverGetEleves = new OptionsResolver();
     $this->resolverGetEleves->setDefined(array('school_id', 'date_day', 'activity_type'));
     $this->resolverGetEleves->setAllowedTypes('date_day', \DateTimeInterface::class);
     $this->resolverGetEleves->setDefaults(array('school_id' => 0));
     parent::__construct($em, $class);
 }
开发者ID:WildCodeSchool,项目名称:projet-gesty,代码行数:8,代码来源:EleveRepository.php

示例8: __construct

 public function __construct()
 {
     if (empty($this->entityName)) {
         throw new LoSo_Exception('EntityName must be defined when extending LoSo GenericRepository.');
     }
     $em = Zend_Registry::get(LoSo_Zend_Application_Bootstrap_SymfonyContainerBootstrap::getRegistryIndex())->em;
     $metadata = $em->getClassMetadata($this->entityName);
     parent::__construct($em, $metadata);
 }
开发者ID:nuxwin,项目名称:losolib,代码行数:9,代码来源:GenericRepository.php

示例9: array

 function __construct($em, $class)
 {
     parent::__construct($em, $class);
     $evm = $em->getEventManager();
     //$evm->addEventListener(Events::prePersist, $this);
     $this->className = $class->getReflectionClass()->getName();
     $this->cachedMinOrder = array();
     $this->cachedMaxOrder = array();
 }
开发者ID:brunoreis,项目名称:DoctrineLearning,代码行数:9,代码来源:OrderedRepository.class.php

示例10: __construct

 /**
  * @param EntityManager $em
  * @param Mapping\ClassMetadata $class
  */
 public function __construct(EntityManager $em, Mapping\ClassMetadata $class)
 {
     $className = $class->getName();
     if ($className != 'Supra\\Package\\Cms\\Entity\\Abstraction\\File') {
         throw new LogicException("File repository should be called for file abstraction entity only, requested for '{$className}'");
     }
     parent::__construct($em, $class);
     $this->nestedSetRepository = new DoctrineRepository($em, $class);
 }
开发者ID:sitesupra,项目名称:sitesupra,代码行数:13,代码来源:FileNestedSetRepository.php

示例11: __construct

 public function __construct(EntityManager $em, ClassMetadata $class, ContainerInterface $container)
 {
     parent::__construct($em, $class);
     if ($container instanceof Container) {
         $this->container = $container;
     } else {
         $this->container = new Container($container);
     }
 }
开发者ID:sinergi,项目名称:users,代码行数:9,代码来源:GroupRepository.php

示例12: __construct

 public function __construct($em, \Doctrine\ORM\Mapping\ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $conf = $this->getEntityManager()->getConfiguration();
     $conf->addCustomNumericFunction('ACOS', 'DoctrineExtensions\\Query\\Mysql\\Acos');
     $conf->addCustomNumericFunction('COS', 'DoctrineExtensions\\Query\\Mysql\\Cos');
     //Comments the following line during the validation of the pull-request for PI() function
     //$conf->addCustomNumericFunction('PI', 'DoctrineExtensions\Query\Mysql\Pi');
     $conf->addCustomNumericFunction('SIN', 'DoctrineExtensions\\Query\\Mysql\\Sin');
 }
开发者ID:creakiwi,项目名称:gearloose-bundle,代码行数:10,代码来源:GeoDataRepository.php

示例13: __construct

 /**
  *
  */
 public function __construct(EntityManager $entity_manager)
 {
     $metadata_factory = $entity_manager->getMetaDataFactory();
     foreach ($metadata_factory->getAllMetaData() as $class => $metadata) {
         if ($metadata->customRepositoryClassName == get_class($this)) {
             $this->model = $metadata->getName();
         }
     }
     parent::__construct($entity_manager, $entity_manager->getclassMetaData($this->model));
 }
开发者ID:dotink,项目名称:inkwell-doctrine,代码行数:13,代码来源:Repository.php

示例14: __construct

 /**
  * Initializes a new Repository.
  *
  * @param \Doctrine\Common\Persistence\ObjectManager $entityManager The EntityManager to use.
  * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata The class descriptor.
  */
 public function __construct(\Doctrine\Common\Persistence\ObjectManager $entityManager, \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata = NULL)
 {
     if ($classMetadata === NULL) {
         if (static::ENTITY_CLASSNAME === NULL) {
             $this->objectType = str_replace(array('\\Repository\\', 'Repository'), array('\\Model\\', ''), get_class($this));
         } else {
             $this->objectType = static::ENTITY_CLASSNAME;
         }
         $classMetadata = $entityManager->getClassMetadata($this->objectType);
     }
     parent::__construct($entityManager, $classMetadata);
     $this->entityManager = $this->_em;
 }
开发者ID:nxpthx,项目名称:FLOW3,代码行数:19,代码来源:Repository.php

示例15: __construct

 /**
  * Initializes a new Repository.
  *
  * @param \Doctrine\Common\Persistence\ObjectManager $entityManager The EntityManager to use.
  * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata The class descriptor.
  */
 public function __construct(\Doctrine\Common\Persistence\ObjectManager $entityManager, \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata = null)
 {
     if ($classMetadata === null) {
         if (defined('static::ENTITY_CLASSNAME') === false) {
             $this->objectType = preg_replace(['/\\\\Repository\\\\/', '/Repository$/'], ['\\Model\\', ''], get_class($this));
         } else {
             $this->objectType = static::ENTITY_CLASSNAME;
         }
         $classMetadata = $entityManager->getClassMetadata($this->objectType);
     }
     parent::__construct($entityManager, $classMetadata);
     $this->entityManager = $this->_em;
 }
开发者ID:mkeitsch,项目名称:flow-development-collection,代码行数:19,代码来源:Repository.php


注:本文中的Doctrine\ORM\EntityRepository::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。