var/cache/dev/jms_diextra/doctrine/EntityManager_66f5f61681ec2.php line 222

Open in your IDE?
  1. <?php
  2. namespace EntityManager66f5f61681ec2_546a8d27f194334ee012bfe64f629947b07e4919\__CG__\Doctrine\ORM;
  3. /**
  4.  * CG library enhanced proxy class.
  5.  *
  6.  * This code was generated automatically by the CG library, manual changes to it
  7.  * will be lost upon next generation.
  8.  */
  9. class EntityManager extends \Doctrine\ORM\EntityManager
  10. {
  11.     private $delegate;
  12.     private $container;
  13.     /**
  14.      * {@inheritDoc}
  15.      */
  16.     public function transactional($func)
  17.     {
  18.         return $this->delegate->transactional($func);
  19.     }
  20.     /**
  21.      * {@inheritDoc}
  22.      */
  23.     public function rollback()
  24.     {
  25.         return $this->delegate->rollback();
  26.     }
  27.     /**
  28.      * Removes an entity instance.
  29.      *
  30.      * A removed entity will be removed from the database at or before transaction commit
  31.      * or as a result of the flush operation.
  32.      *
  33.      * @param object $entity The entity instance to remove.
  34.      *
  35.      * @return void
  36.      *
  37.      * @throws ORMInvalidArgumentException
  38.      * @throws ORMException
  39.      */
  40.     public function remove($entity)
  41.     {
  42.         return $this->delegate->remove($entity);
  43.     }
  44.     /**
  45.      * Refreshes the persistent state of an entity from the database,
  46.      * overriding any local changes that have not yet been persisted.
  47.      *
  48.      * @param object $entity The entity to refresh.
  49.      *
  50.      * @return void
  51.      *
  52.      * @throws ORMInvalidArgumentException
  53.      * @throws ORMException
  54.      */
  55.     public function refresh($entity)
  56.     {
  57.         return $this->delegate->refresh($entity);
  58.     }
  59.     /**
  60.      * Tells the EntityManager to make an instance managed and persistent.
  61.      *
  62.      * The entity will be entered into the database at or before transaction
  63.      * commit or as a result of the flush operation.
  64.      *
  65.      * NOTE: The persist operation always considers entities that are not yet known to
  66.      * this EntityManager as NEW. Do not pass detached entities to the persist operation.
  67.      *
  68.      * @param object $entity The instance to make managed and persistent.
  69.      *
  70.      * @return void
  71.      *
  72.      * @throws ORMInvalidArgumentException
  73.      * @throws ORMException
  74.      */
  75.     public function persist($entity)
  76.     {
  77.         return $this->delegate->persist($entity);
  78.     }
  79.     /**
  80.      * {@inheritDoc}
  81.      */
  82.     public function newHydrator($hydrationMode)
  83.     {
  84.         return $this->delegate->newHydrator($hydrationMode);
  85.     }
  86.     /**
  87.      * Merges the state of a detached entity into the persistence context
  88.      * of this EntityManager and returns the managed copy of the entity.
  89.      * The entity passed to merge will not become associated/managed with this EntityManager.
  90.      *
  91.      * @param object $entity The detached entity to merge into the persistence context.
  92.      *
  93.      * @return object The managed copy of the entity.
  94.      *
  95.      * @throws ORMInvalidArgumentException
  96.      * @throws ORMException
  97.      *
  98.      * @deprecated 2.7 This method is being removed from the ORM and won't have any replacement
  99.      */
  100.     public function merge($entity)
  101.     {
  102.         return $this->delegate->merge($entity);
  103.     }
  104.     /**
  105.      * {@inheritDoc}
  106.      */
  107.     public function lock($entity$lockMode$lockVersion NULL)
  108.     {
  109.         return $this->delegate->lock($entity$lockMode$lockVersion);
  110.     }
  111.     /**
  112.      * {@inheritDoc}
  113.      */
  114.     public function isOpen()
  115.     {
  116.         return $this->delegate->isOpen();
  117.     }
  118.     /**
  119.      * {@inheritDoc}
  120.      */
  121.     public function isFiltersStateClean()
  122.     {
  123.         return $this->delegate->isFiltersStateClean();
  124.     }
  125.     /**
  126.      * {@inheritDoc}
  127.      */
  128.     public function initializeObject($obj)
  129.     {
  130.         return $this->delegate->initializeObject($obj);
  131.     }
  132.     /**
  133.      * {@inheritDoc}
  134.      */
  135.     public function hasFilters()
  136.     {
  137.         return $this->delegate->hasFilters();
  138.     }
  139.     /**
  140.      * {@inheritDoc}
  141.      */
  142.     public function getUnitOfWork()
  143.     {
  144.         return $this->delegate->getUnitOfWork();
  145.     }
  146.     /**
  147.      * Gets the repository for an entity class.
  148.      *
  149.      * @param string $entityName The name of the entity.
  150.      *
  151.      * @return ObjectRepository|EntityRepository The repository class.
  152.      */
  153.     public function getRepository($className)
  154.     {
  155.         $repository $this->delegate->getRepository($className);
  156.         if ($repository instanceof \Symfony\Component\DependencyInjection\ContainerAwareInterface) {
  157.             $repository->setContainer($this->container);
  158.             return $repository;
  159.         }
  160.         if (null !== $metadata $this->container->get("jms_di_extra.metadata.metadata_factory")->getMetadataForClass(get_class($repository))) {
  161.             foreach ($metadata->classMetadata as $classMetadata) {
  162.                 foreach ($classMetadata->methodCalls as $call) {
  163.                     list($method$arguments) = $call;
  164.                     call_user_func_array(array($repository$method), $this->prepareArguments($arguments));
  165.                 }
  166.             }
  167.         }
  168.         return $repository;
  169.     }
  170.     /**
  171.      * {@inheritDoc}
  172.      */
  173.     public function getReference($entityName$id)
  174.     {
  175.         return $this->delegate->getReference($entityName$id);
  176.     }
  177.     /**
  178.      * {@inheritDoc}
  179.      */
  180.     public function getProxyFactory()
  181.     {
  182.         return $this->delegate->getProxyFactory();
  183.     }
  184.     /**
  185.      * {@inheritDoc}
  186.      */
  187.     public function getPartialReference($entityName$identifier)
  188.     {
  189.         return $this->delegate->getPartialReference($entityName$identifier);
  190.     }
  191.     /**
  192.      * Gets the metadata factory used to gather the metadata of classes.
  193.      *
  194.      * @return \Doctrine\ORM\Mapping\ClassMetadataFactory
  195.      */
  196.     public function getMetadataFactory()
  197.     {
  198.         return $this->delegate->getMetadataFactory();
  199.     }
  200.     /**
  201.      * {@inheritDoc}
  202.      */
  203.     public function getHydrator($hydrationMode)
  204.     {
  205.         return $this->delegate->getHydrator($hydrationMode);
  206.     }
  207.     /**
  208.      * {@inheritDoc}
  209.      */
  210.     public function getFilters()
  211.     {
  212.         return $this->delegate->getFilters();
  213.     }
  214.     /**
  215.      * {@inheritDoc}
  216.      */
  217.     public function getExpressionBuilder()
  218.     {
  219.         return $this->delegate->getExpressionBuilder();
  220.     }
  221.     /**
  222.      * {@inheritDoc}
  223.      */
  224.     public function getEventManager()
  225.     {
  226.         return $this->delegate->getEventManager();
  227.     }
  228.     /**
  229.      * {@inheritDoc}
  230.      */
  231.     public function getConnection()
  232.     {
  233.         return $this->delegate->getConnection();
  234.     }
  235.     /**
  236.      * {@inheritDoc}
  237.      */
  238.     public function getConfiguration()
  239.     {
  240.         return $this->delegate->getConfiguration();
  241.     }
  242.     /**
  243.      * Returns the ORM metadata descriptor for a class.
  244.      *
  245.      * The class name must be the fully-qualified class name without a leading backslash
  246.      * (as it is returned by get_class($obj)) or an aliased class name.
  247.      *
  248.      * Examples:
  249.      * MyProject\Domain\User
  250.      * sales:PriceRequest
  251.      *
  252.      * Internal note: Performance-sensitive method.
  253.      *
  254.      * @param string $className
  255.      *
  256.      * @return \Doctrine\ORM\Mapping\ClassMetadata
  257.      */
  258.     public function getClassMetadata($className)
  259.     {
  260.         return $this->delegate->getClassMetadata($className);
  261.     }
  262.     /**
  263.      * {@inheritDoc}
  264.      */
  265.     public function getCache()
  266.     {
  267.         return $this->delegate->getCache();
  268.     }
  269.     /**
  270.      * Flushes all changes to objects that have been queued up to now to the database.
  271.      * This effectively synchronizes the in-memory state of managed objects with the
  272.      * database.
  273.      *
  274.      * If an entity is explicitly passed to this method only this entity and
  275.      * the cascade-persist semantics + scheduled inserts/removals are synchronized.
  276.      *
  277.      * @param null|object|array $entity
  278.      *
  279.      * @return void
  280.      *
  281.      * @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that
  282.      *         makes use of optimistic locking fails.
  283.      * @throws ORMException
  284.      */
  285.     public function flush($entity NULL)
  286.     {
  287.         return $this->delegate->flush($entity);
  288.     }
  289.     /**
  290.      * Finds an Entity by its identifier.
  291.      *
  292.      * @param string       $entityName  The class name of the entity to find.
  293.      * @param mixed        $id          The identity of the entity to find.
  294.      * @param integer|null $lockMode    One of the \Doctrine\DBAL\LockMode::* constants
  295.      *                                  or NULL if no specific lock mode should be used
  296.      *                                  during the search.
  297.      * @param integer|null $lockVersion The version of the entity to find when using
  298.      *                                  optimistic locking.
  299.      *
  300.      * @return object|null The entity instance or NULL if the entity can not be found.
  301.      *
  302.      * @throws OptimisticLockException
  303.      * @throws ORMInvalidArgumentException
  304.      * @throws TransactionRequiredException
  305.      * @throws ORMException
  306.      */
  307.     public function find($entityName$id$lockMode NULL$lockVersion NULL)
  308.     {
  309.         return $this->delegate->find($entityName$id$lockMode$lockVersion);
  310.     }
  311.     /**
  312.      * Detaches an entity from the EntityManager, causing a managed entity to
  313.      * become detached.  Unflushed changes made to the entity if any
  314.      * (including removal of the entity), will not be synchronized to the database.
  315.      * Entities which previously referenced the detached entity will continue to
  316.      * reference it.
  317.      *
  318.      * @param object $entity The entity to detach.
  319.      *
  320.      * @return void
  321.      *
  322.      * @throws ORMInvalidArgumentException
  323.      *
  324.      * @deprecated 2.7 This method is being removed from the ORM and won't have any replacement
  325.      */
  326.     public function detach($entity)
  327.     {
  328.         return $this->delegate->detach($entity);
  329.     }
  330.     /**
  331.      * {@inheritDoc}
  332.      */
  333.     public function createQueryBuilder()
  334.     {
  335.         return $this->delegate->createQueryBuilder();
  336.     }
  337.     /**
  338.      * {@inheritDoc}
  339.      */
  340.     public function createQuery($dql '')
  341.     {
  342.         return $this->delegate->createQuery($dql);
  343.     }
  344.     /**
  345.      * {@inheritDoc}
  346.      */
  347.     public function createNativeQuery($sql, \Doctrine\ORM\Query\ResultSetMapping $rsm)
  348.     {
  349.         return $this->delegate->createNativeQuery($sql$rsm);
  350.     }
  351.     /**
  352.      * {@inheritDoc}
  353.      */
  354.     public function createNamedQuery($name)
  355.     {
  356.         return $this->delegate->createNamedQuery($name);
  357.     }
  358.     /**
  359.      * {@inheritDoc}
  360.      */
  361.     public function createNamedNativeQuery($name)
  362.     {
  363.         return $this->delegate->createNamedNativeQuery($name);
  364.     }
  365.     /**
  366.      * {@inheritDoc}
  367.      */
  368.     public function copy($entity$deep false)
  369.     {
  370.         return $this->delegate->copy($entity$deep);
  371.     }
  372.     /**
  373.      * Determines whether an entity instance is managed in this EntityManager.
  374.      *
  375.      * @param object $entity
  376.      *
  377.      * @return boolean TRUE if this EntityManager currently manages the given entity, FALSE otherwise.
  378.      */
  379.     public function contains($entity)
  380.     {
  381.         return $this->delegate->contains($entity);
  382.     }
  383.     /**
  384.      * {@inheritDoc}
  385.      */
  386.     public function commit()
  387.     {
  388.         return $this->delegate->commit();
  389.     }
  390.     /**
  391.      * {@inheritDoc}
  392.      */
  393.     public function close()
  394.     {
  395.         return $this->delegate->close();
  396.     }
  397.     /**
  398.      * Clears the EntityManager. All entities that are currently managed
  399.      * by this EntityManager become detached.
  400.      *
  401.      * @param string|null $entityName if given, only entities of this type will get detached
  402.      *
  403.      * @return void
  404.      *
  405.      * @throws ORMInvalidArgumentException If a non-null non-string value is given.
  406.      * @throws MappingException            If a $entityName is given, but that entity is not
  407.      *                                     found in the mappings.
  408.      */
  409.     public function clear($entityName NULL)
  410.     {
  411.         return $this->delegate->clear($entityName);
  412.     }
  413.     /**
  414.      * {@inheritDoc}
  415.      */
  416.     public function beginTransaction()
  417.     {
  418.         return $this->delegate->beginTransaction();
  419.     }
  420.     public function __construct($objectManager, \Symfony\Component\DependencyInjection\ContainerInterface $container)
  421.     {
  422.         $this->delegate $objectManager;
  423.         $this->container $container;
  424.     }
  425.     private function prepareArguments(array $arguments)
  426.     {
  427.         $processed = array();
  428.         foreach ($arguments as $arg) {
  429.             if ($arg instanceof \Symfony\Component\DependencyInjection\Reference) {
  430.                 $processed[] = $this->container->get((string) $arg$arg->getInvalidBehavior());
  431.             } else if ($arg instanceof \Symfony\Component\DependencyInjection\Parameter) {
  432.                 $processed[] = $this->container->getParameter((string) $arg);
  433.             } else {
  434.                 $processed[] = $arg;
  435.             }
  436.         }
  437.         return $processed;
  438.     }
  439. }