You are here

class LogFileManager in File Log 8

Same name in this branch
  1. 8 src/LogFileManager.php \Drupal\filelog\LogFileManager
  2. 8 src/ProxyClass/LogFileManager.php \Drupal\filelog\ProxyClass\LogFileManager
Same name and namespace in other branches
  1. 2.0.x src/ProxyClass/LogFileManager.php \Drupal\filelog\ProxyClass\LogFileManager

Provides a proxy class for \Drupal\filelog\LogFileManager.

Hierarchy

Expanded class hierarchy of LogFileManager

See also

\Drupal\Component\ProxyBuilder\ProxyBuilder

File

src/ProxyClass/LogFileManager.php, line 14

Namespace

Drupal\filelog\ProxyClass
View source
class LogFileManager implements LogFileManagerInterface {
  use DependencySerializationTrait;

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

  /**
   * The real service, after it was lazy loaded.
   *
   * @var \Drupal\filelog\LogFileManager
   */
  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(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 ensurePath() : bool {
    return $this
      ->lazyLoadItself()
      ->ensurePath();
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
LogFileManager::$container protected property The service container.
LogFileManager::$drupalProxyOriginalServiceId protected property The id of the original service.
LogFileManager::$service protected property The real service, after it was lazy loaded.
LogFileManager::ensurePath public function Ensure that the log directory exists. Overrides LogFileManagerInterface::ensurePath
LogFileManager::getFileName public function Get the complete filename of the log. Overrides LogFileManagerInterface::getFileName
LogFileManager::lazyLoadItself protected function Lazy loads the real service from the container.
LogFileManager::__construct public function Constructs a ProxyClass Drupal proxy object.