/**
  * {@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);
 }
 /**
  * {@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'];
     }
 }
 /**
  * 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);
 }
Example #4
0
 /**
  * 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'];
 }
 public function __construct(Application $app)
 {
     $this->app = $app;
     $entityManager = $app[$this->entityManager];
     $clazz = new ClassMetadata($this->modelName);
     parent::__construct($entityManager, $clazz);
 }
Example #6
0
 public function __construct($em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $this->className = $this->getClassName();
     $this->entityName = $this->getEntityName();
     $this->tableName = $class->getTableName();
 }
 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);
 }
Example #8
0
 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);
 }
 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();
 }
 /**
  * @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);
 }
Example #11
0
 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);
     }
 }
 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');
 }
Example #13
0
 /**
  *
  */
 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));
 }
Example #14
0
 /**
  * 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;
 }
 /**
  * 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;
 }
Example #16
0
 /**
  * Sets up an EntityRepository for xEntity, which has custom functionality for TableViews.
  * 
  * Dont forget to provide a value for $entityName before calling parent::__construct().
  * 
  * @param \Doctrine\ORM\EntityManager $em
  */
 public function __construct(EntityManager $em)
 {
     /* Get the Class metadata for the Entity Repository that is inheriting from this class
      * _entityName should be setup in the constructor of the child class
      * 
      * Like:
      * 
      * public function __construct(EntityManager $em)
      * {
      *      $this->originalEntityName = Education::getRepoName();
      *      parent::__construct($em);
      * }
      */
     $entityClassMetaData = $em->getClassMetadata('Corvus\\AdminBundle\\Entity\\' . $this->originalEntityName);
     // Construct the parent, fixes the problem with a child class inheriting from this class.
     parent::__construct($em, $entityClassMetaData);
 }
    /**
     * {@inheritdoc}
     */
    public function __construct(EntityManager $em, ClassMetadata $class)
    {
        parent::__construct($em, $class);
        $histListener = null;
        foreach ($em->getEventManager()->getListeners() as $event => $listeners) {
            foreach ($listeners as $hash => $listener) {
                if ($listener instanceof \Nacmartin\Historyable\HistoryableListener) {
                    $histListener = $listener;
                    break;
                }
            }
            if ($histListener) {
                break;
            }
        }

        if (is_null($histListener)) {
            throw new \Nacmartin\Exception\InvalidMappingException('This repository can be attached only to ORM historyable listener');
        }

        $this->listener = $histListener;
    }
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $sortableListener = null;
     foreach ($em->getEventManager()->getListeners() as $event => $listeners) {
         foreach ($listeners as $hash => $listener) {
             if ($listener instanceof SortableListener) {
                 $sortableListener = $listener;
                 break;
             }
         }
         if ($sortableListener) {
             break;
         }
     }
     if (is_null($sortableListener)) {
         throw new \Gedmo\Exception\InvalidMappingException('This repository can be attached only to ORM sortable listener');
     }
     $this->listener = $sortableListener;
     $this->meta = $this->getClassMetadata();
     $this->config = $this->listener->getConfiguration($this->_em, $this->meta->name);
 }
 /**
  * {@inheritdoc}
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $treeListener = null;
     foreach ($em->getEventManager()->getListeners() as $event => $listeners) {
         foreach ($listeners as $hash => $listener) {
             if ($listener instanceof \Gedmo\Tree\TreeListener) {
                 $treeListener = $listener;
                 break;
             }
         }
         if ($treeListener) {
             break;
         }
     }
     if (is_null($treeListener)) {
         throw new \Gedmo\Exception\InvalidMappingException('This repository can be attached only to ORM tree listener');
     }
     $this->listener = $treeListener;
     if (!$this->validates()) {
         throw new \Gedmo\Exception\InvalidMappingException('This repository cannot be used for tree type: ' . $treeListener->getStrategy($em, $class->name)->getName());
     }
 }
 /**
  * {@inheritdoc}
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $treeListener = null;
     foreach ($em->getEventManager()->getListeners() as $listeners) {
         foreach ($listeners as $listener) {
             if ($listener instanceof \Gedmo\Tree\TreeListener) {
                 $treeListener = $listener;
                 break;
             }
         }
         if ($treeListener) {
             break;
         }
     }
     if (is_null($treeListener)) {
         throw new \Gedmo\Exception\InvalidMappingException('Tree listener was not found on your entity manager, it must be hooked into the event manager');
     }
     $this->listener = $treeListener;
     if (!$this->validate()) {
         throw new \Gedmo\Exception\InvalidMappingException('This repository cannot be used for tree type: ' . $treeListener->getStrategy($em, $class->name)->getName());
     }
 }
 /**
  * @param EntityManager $em
  * @param Mapping\ClassMetadata $class
  */
 public function __construct(EntityManager $em, Mapping\ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $this->nestedSetRepository = new DoctrineRepository($em, $class);
 }
 /**
  * @param EntityManager $entityManager
  */
 public function __construct(EntityManager $entityManager)
 {
     parent::__construct($entityManager, $entityManager->getClassMetadata($this->entityName()));
     $this->ipThrottles = new Collection();
     $this->userThrottles = new Collection();
 }
 /**
  * {@inheritdoc}
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $this->initializeTreeRepository($em, $class);
 }
 /**
  * @param \Doctrine\ORM\EntityManager $em
  * @param \Doctrine\ORM\Mapping\ClassMetadata $md
  */
 public function __construct($em, $md)
 {
     parent::__construct($em, $md);
 }
 /**
  * @param EntityManager $entityManager
  */
 public function __construct(EntityManager $entityManager)
 {
     parent::__construct($entityManager, $entityManager->getClassMetadata($this->entityName()));
 }
 /**
  * Initializes a new EntityRepository.
  *
  * @param \Doctrine\ORM\EntityManager         $em    The EntityManager to use.
  * @param \Doctrine\ORM\Mapping\ClassMetadata $class The class descriptor.
  */
 public function __construct($em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     $this->replaceSupported = DriverFeatures::replaceSupported($em->getConnection()->getDriver());
     $this->multiValuesSupported = DriverFeatures::multiValuesSupported($em->getConnection()->getDriver());
 }
 public function __construct(EntityManager $em, $entityClassName)
 {
     $this->em = $em;
     parent::__construct($em, new ClassMetadata($entityClassName));
 }
Example #28
0
 /**
  * {@inheritdoc}
  */
 public function __construct($em, ClassMetadata $class)
 {
     $this->filter = null;
     parent::__construct($em, $class);
 }
Example #29
0
 /**
  * @param ObjectManager  $em
  * @param ClassMetadata  $class
  * @param ListRestHelper $helper
  */
 public function __construct(ObjectManager $em, ClassMetadata $class, ListRestHelper $helper)
 {
     parent::__construct($em, $class);
     $this->helper = $helper;
 }
 /**
  * @param EntityManager    $entityManager The EntityManager to use.
  * @param SessionInterface $session
  * @param CookieInterface  $cookie
  */
 public function __construct(EntityManager $entityManager, SessionInterface $session, CookieInterface $cookie)
 {
     parent::__construct($entityManager, $entityManager->getClassMetadata($this->entityName()));
     $this->session = $session;
     $this->cookie = $cookie;
 }