BatchStorage.php 2.86 KB
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\Core\ProxyClass\Batch\BatchStorage.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
 */

/**
 * This file was generated via php core/scripts/generate-proxy-class.php 'Drupal\Core\Batch\BatchStorage' "core/lib/Drupal/Core".
 */

namespace Drupal\Core\ProxyClass\Batch {

    /**
     * Provides a proxy class for \Drupal\Core\Batch\BatchStorage.
     *
     * @see \Drupal\Component\ProxyBuilder
     */
    class BatchStorage implements \Drupal\Core\Batch\BatchStorageInterface
    {

        use \Drupal\Core\DependencyInjection\DependencySerializationTrait;

        /**
         * The id of the original proxied service.
         *
         * @var string
         */
        protected $drupalProxyOriginalServiceId;

        /**
         * The real proxied service, after it was lazy loaded.
         *
         * @var \Drupal\Core\Batch\BatchStorage
         */
        protected $service;

        /**
         * The service container.
         *
         * @var \Symfony\Component\DependencyInjection\ContainerInterface
         */
        protected $container;

        /**
         * Constructs a ProxyClass Drupal proxy object.
         *
         * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
         *   The container.
         * @param string $drupal_proxy_original_service_id
         *   The service ID of the original service.
         */
        public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container, $drupal_proxy_original_service_id)
        {
            $this->container = $container;
            $this->drupalProxyOriginalServiceId = $drupal_proxy_original_service_id;
        }

        /**
         * Lazy loads the real service from the container.
         *
         * @return object
         *   Returns the constructed real service.
         */
        protected function lazyLoadItself()
        {
            if (!isset($this->service)) {
                $this->service = $this->container->get($this->drupalProxyOriginalServiceId);
            }

            return $this->service;
        }

        /**
         * {@inheritdoc}
         */
        public function load($id)
        {
            return $this->lazyLoadItself()->load($id);
        }

        /**
         * {@inheritdoc}
         */
        public function delete($id)
        {
            return $this->lazyLoadItself()->delete($id);
        }

        /**
         * {@inheritdoc}
         */
        public function update(array $batch)
        {
            return $this->lazyLoadItself()->update($batch);
        }

        /**
         * {@inheritdoc}
         */
        public function cleanup()
        {
            return $this->lazyLoadItself()->cleanup();
        }

        /**
         * {@inheritdoc}
         */
        public function create(array $batch)
        {
            return $this->lazyLoadItself()->create($batch);
        }

    }

}