vendor/doctrine/orm/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php line 58

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\ORM\Decorator;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Doctrine\ORM\EntityRepository;
  6. use Doctrine\ORM\Query\ResultSetMapping;
  7. use Doctrine\Persistence\ObjectManagerDecorator;
  8. use function func_get_arg;
  9. use function func_num_args;
  10. use function get_debug_type;
  11. use function method_exists;
  12. use function sprintf;
  13. use function trigger_error;
  14. use const E_USER_NOTICE;
  15. /**
  16.  * Base class for EntityManager decorators
  17.  *
  18.  * @extends ObjectManagerDecorator<EntityManagerInterface>
  19.  */
  20. abstract class EntityManagerDecorator extends ObjectManagerDecorator implements EntityManagerInterface
  21. {
  22.     public function __construct(EntityManagerInterface $wrapped)
  23.     {
  24.         $this->wrapped $wrapped;
  25.     }
  26.     /**
  27.      * {@inheritDoc}
  28.      */
  29.     public function getConnection()
  30.     {
  31.         return $this->wrapped->getConnection();
  32.     }
  33.     /**
  34.      * {@inheritDoc}
  35.      */
  36.     public function getExpressionBuilder()
  37.     {
  38.         return $this->wrapped->getExpressionBuilder();
  39.     }
  40.     /**
  41.      * {@inheritDoc}
  42.      *
  43.      * @psalm-param class-string<T> $className
  44.      *
  45.      * @psalm-return EntityRepository<T>
  46.      *
  47.      * @template T of object
  48.      */
  49.     public function getRepository($className)
  50.     {
  51.         return $this->wrapped->getRepository($className);
  52.     }
  53.     /**
  54.      * {@inheritDoc}
  55.      */
  56.     public function getClassMetadata($className)
  57.     {
  58.         return $this->wrapped->getClassMetadata($className);
  59.     }
  60.     /**
  61.      * {@inheritDoc}
  62.      */
  63.     public function beginTransaction()
  64.     {
  65.         $this->wrapped->beginTransaction();
  66.     }
  67.     /**
  68.      * {@inheritDoc}
  69.      */
  70.     public function transactional($func)
  71.     {
  72.         return $this->wrapped->transactional($func);
  73.     }
  74.     /**
  75.      * {@inheritDoc}
  76.      */
  77.     public function wrapInTransaction(callable $func)
  78.     {
  79.         if (! method_exists($this->wrapped'wrapInTransaction')) {
  80.             trigger_error(
  81.                 sprintf('Calling `transactional()` instead of `wrapInTransaction()` which is not implemented on %s'get_debug_type($this->wrapped)),
  82.                 E_USER_NOTICE
  83.             );
  84.             return $this->wrapped->transactional($func);
  85.         }
  86.         return $this->wrapped->wrapInTransaction($func);
  87.     }
  88.     /**
  89.      * {@inheritDoc}
  90.      */
  91.     public function commit()
  92.     {
  93.         $this->wrapped->commit();
  94.     }
  95.     /**
  96.      * {@inheritDoc}
  97.      */
  98.     public function rollback()
  99.     {
  100.         $this->wrapped->rollback();
  101.     }
  102.     /**
  103.      * {@inheritDoc}
  104.      */
  105.     public function createQuery($dql '')
  106.     {
  107.         return $this->wrapped->createQuery($dql);
  108.     }
  109.     /**
  110.      * {@inheritDoc}
  111.      */
  112.     public function createNamedQuery($name)
  113.     {
  114.         return $this->wrapped->createNamedQuery($name);
  115.     }
  116.     /**
  117.      * {@inheritDoc}
  118.      */
  119.     public function createNativeQuery($sqlResultSetMapping $rsm)
  120.     {
  121.         return $this->wrapped->createNativeQuery($sql$rsm);
  122.     }
  123.     /**
  124.      * {@inheritDoc}
  125.      */
  126.     public function createNamedNativeQuery($name)
  127.     {
  128.         return $this->wrapped->createNamedNativeQuery($name);
  129.     }
  130.     /**
  131.      * {@inheritDoc}
  132.      */
  133.     public function createQueryBuilder()
  134.     {
  135.         return $this->wrapped->createQueryBuilder();
  136.     }
  137.     /**
  138.      * {@inheritDoc}
  139.      */
  140.     public function getReference($entityName$id)
  141.     {
  142.         return $this->wrapped->getReference($entityName$id);
  143.     }
  144.     /**
  145.      * {@inheritDoc}
  146.      */
  147.     public function getPartialReference($entityName$identifier)
  148.     {
  149.         return $this->wrapped->getPartialReference($entityName$identifier);
  150.     }
  151.     /**
  152.      * {@inheritDoc}
  153.      */
  154.     public function close()
  155.     {
  156.         $this->wrapped->close();
  157.     }
  158.     /**
  159.      * {@inheritDoc}
  160.      */
  161.     public function copy($entity$deep false)
  162.     {
  163.         return $this->wrapped->copy($entity$deep);
  164.     }
  165.     /**
  166.      * {@inheritDoc}
  167.      */
  168.     public function lock($entity$lockMode$lockVersion null)
  169.     {
  170.         $this->wrapped->lock($entity$lockMode$lockVersion);
  171.     }
  172.     /**
  173.      * {@inheritDoc}
  174.      */
  175.     public function find($className$id$lockMode null$lockVersion null)
  176.     {
  177.         return $this->wrapped->find($className$id$lockMode$lockVersion);
  178.     }
  179.     /**
  180.      * {@inheritDoc}
  181.      */
  182.     public function flush($entity null)
  183.     {
  184.         $this->wrapped->flush($entity);
  185.     }
  186.     /**
  187.      * {@inheritDoc}
  188.      */
  189.     public function refresh($object)
  190.     {
  191.         $lockMode null;
  192.         if (func_num_args() > 1) {
  193.             $lockMode func_get_arg(1);
  194.         }
  195.         $this->wrapped->refresh($object$lockMode);
  196.     }
  197.     /**
  198.      * {@inheritDoc}
  199.      */
  200.     public function getEventManager()
  201.     {
  202.         return $this->wrapped->getEventManager();
  203.     }
  204.     /**
  205.      * {@inheritDoc}
  206.      */
  207.     public function getConfiguration()
  208.     {
  209.         return $this->wrapped->getConfiguration();
  210.     }
  211.     /**
  212.      * {@inheritDoc}
  213.      */
  214.     public function isOpen()
  215.     {
  216.         return $this->wrapped->isOpen();
  217.     }
  218.     /**
  219.      * {@inheritDoc}
  220.      */
  221.     public function getUnitOfWork()
  222.     {
  223.         return $this->wrapped->getUnitOfWork();
  224.     }
  225.     /**
  226.      * {@inheritDoc}
  227.      */
  228.     public function getHydrator($hydrationMode)
  229.     {
  230.         return $this->wrapped->getHydrator($hydrationMode);
  231.     }
  232.     /**
  233.      * {@inheritDoc}
  234.      */
  235.     public function newHydrator($hydrationMode)
  236.     {
  237.         return $this->wrapped->newHydrator($hydrationMode);
  238.     }
  239.     /**
  240.      * {@inheritDoc}
  241.      */
  242.     public function getProxyFactory()
  243.     {
  244.         return $this->wrapped->getProxyFactory();
  245.     }
  246.     /**
  247.      * {@inheritDoc}
  248.      */
  249.     public function getFilters()
  250.     {
  251.         return $this->wrapped->getFilters();
  252.     }
  253.     /**
  254.      * {@inheritDoc}
  255.      */
  256.     public function isFiltersStateClean()
  257.     {
  258.         return $this->wrapped->isFiltersStateClean();
  259.     }
  260.     /**
  261.      * {@inheritDoc}
  262.      */
  263.     public function hasFilters()
  264.     {
  265.         return $this->wrapped->hasFilters();
  266.     }
  267.     /**
  268.      * {@inheritDoc}
  269.      */
  270.     public function getCache()
  271.     {
  272.         return $this->wrapped->getCache();
  273.     }
  274. }