ContentAccessUserRulesActionBase.php in Content Access 8
File
src/Plugin/RulesAction/ContentAccessUserRulesActionBase.php
View source
<?php
namespace Drupal\content_access\Plugin\RulesAction;
use Drupal\Core\Database\Connection;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\rules\Core\RulesActionBase;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class ContentAccessUserRulesActionBase extends RulesActionBase implements ContainerFactoryPluginInterface {
protected $database;
protected $logger;
public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerChannelFactoryInterface $logger, Connection $database) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->logger = $logger;
$this->database = $database;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('logger.factory'), $container
->get('database'));
}
}