class ReferenceViewController in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_entity/src/Controller/ReferenceViewController.php \Drupal\bibcite_entity\Controller\ReferenceViewController
Class ReferenceViewController.
@package Drupal\bibcite_entity\Controller
Hierarchy
- class \Drupal\Core\Entity\Controller\EntityViewController implements ContainerInjectionInterface, TrustedCallbackInterface uses DeprecatedServicePropertyTrait
- class \Drupal\bibcite_entity\Controller\ReferenceViewController
Expanded class hierarchy of ReferenceViewController
File
- modules/
bibcite_entity/ src/ Controller/ ReferenceViewController.php, line 17
Namespace
Drupal\bibcite_entity\ControllerView source
class ReferenceViewController extends EntityViewController {
/**
* Reference config.
*
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $config;
/**
* {@inheritdoc}
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, ImmutableConfig $config) {
parent::__construct($entity_type_manager, $renderer);
$this->config = $config;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager */
$entity_manager = $container
->get('entity_type.manager');
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $container
->get('renderer');
/** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
$config_factory = $container
->get('config.factory');
$config = $config_factory
->get('bibcite_entity.reference.settings');
return new static($entity_manager, $renderer, $config);
}
/**
* {@inheritdoc}
*/
public function view(EntityInterface $bibcite_reference, $view_mode = 'full') {
$view_mode = $this->config
->get('display_override.reference_page_view_mode');
return parent::view($bibcite_reference, $view_mode);
}
/**
* {@inheritdoc}
*/
public function viewRevision(EntityInterface $_entity_revision, $view_mode = 'full') {
$view_mode = $this->config
->get('display_override.reference_page_view_mode');
return parent::viewRevision($_entity_revision, $view_mode);
}
/**
* Page title callback for a reference revision.
*
* @param \Drupal\Core\Entity\EntityInterface $bibcite_reference_revision
* The reference revision.
*
* @return string
* The page title.
*/
public function revisionTitle(EntityInterface $bibcite_reference_revision = NULL) {
return $bibcite_reference_revision
->label();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
EntityViewController:: |
protected | property | ||
EntityViewController:: |
protected | property | The entity type manager. | |
EntityViewController:: |
protected | property | The renderer service. | |
EntityViewController:: |
public | function | Pre-render callback to build the page title. | |
EntityViewController:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
ReferenceViewController:: |
protected | property | Reference config. | |
ReferenceViewController:: |
public static | function |
Instantiates a new instance of this class. Overrides EntityViewController:: |
|
ReferenceViewController:: |
public | function | Page title callback for a reference revision. | |
ReferenceViewController:: |
public | function |
Provides a page to render a single entity. Overrides EntityViewController:: |
|
ReferenceViewController:: |
public | function |
Provides a page to render a single entity revision. Overrides EntityViewController:: |
|
ReferenceViewController:: |
public | function |
Creates an EntityViewController object. Overrides EntityViewController:: |
|
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. |