Base.php in Field Permissions 8
File
src/Plugin/FieldPermissionType/Base.php
View source
<?php
namespace Drupal\field_permissions\Plugin\FieldPermissionType;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase;
use Drupal\Core\Session\AccountInterface;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\field_permissions\Plugin\FieldPermissionTypeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class Base extends PluginBase implements FieldPermissionTypeInterface, ContainerFactoryPluginInterface {
protected $fieldStorage;
public function __construct(array $configuration, $plugin_id, $plugin_definition, FieldStorageConfigInterface $field_storage) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->fieldStorage = $field_storage;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, FieldStorageConfigInterface $field_storage = NULL) {
return new static($configuration, $plugin_id, $plugin_definition, $field_storage);
}
public function getLabel() {
return $this->pluginDefinition['title'];
}
public function getDescription() {
return $this->pluginDefinition['description'];
}
public function hasFieldViewAccessForEveryEntity(AccountInterface $account) {
return FALSE;
}
}
Classes
Name |
Description |
Base |
An abstract implementation of FieldPermissionTypeInterface. |