class DataEntityRow

Same name in other branches
  1. 9 core/modules/rest/src/Plugin/views/row/DataEntityRow.php \Drupal\rest\Plugin\views\row\DataEntityRow
  2. 8.9.x core/modules/rest/src/Plugin/views/row/DataEntityRow.php \Drupal\rest\Plugin\views\row\DataEntityRow
  3. 11.x core/modules/rest/src/Plugin/views/row/DataEntityRow.php \Drupal\rest\Plugin\views\row\DataEntityRow

Plugin which displays entities as raw data.

Hierarchy

Expanded class hierarchy of DataEntityRow

Related topics

File

core/modules/rest/src/Plugin/views/row/DataEntityRow.php, line 19

Namespace

Drupal\rest\Plugin\views\row
View source
class DataEntityRow extends RowPluginBase {
    use EntityTranslationRenderTrait;
    
    /**
     * {@inheritdoc}
     */
    protected $usesOptions = FALSE;
    
    /**
     * Contains the entity type of this row plugin instance.
     *
     * @var \Drupal\Core\Entity\EntityTypeInterface
     */
    protected $entityType;
    
    /**
     * The entity type manager.
     *
     * @var \Drupal\Core\Entity\EntityTypeManagerInterface
     */
    protected $entityTypeManager;
    
    /**
     * The entity repository service.
     *
     * @var \Drupal\Core\Entity\EntityRepositoryInterface
     */
    protected $entityRepository;
    
    /**
     * The entity display repository.
     *
     * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface
     */
    protected $entityDisplayRepository;
    
    /**
     * The language manager.
     *
     * @var \Drupal\Core\Language\LanguageManagerInterface
     */
    protected $languageManager;
    
    /**
     * Constructs a new DataEntityRow object.
     *
     * @param array $configuration
     *   A configuration array containing information about the plugin instance.
     * @param string $plugin_id
     *   The plugin ID for the plugin instance.
     * @param array $plugin_definition
     *   The plugin implementation definition.
     * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
     *   The entity type manager.
     * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
     *   The language manager.
     * @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository
     *   The entity repository.
     */
    public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, EntityRepositoryInterface $entity_repository) {
        parent::__construct($configuration, $plugin_id, $plugin_definition);
        $this->entityTypeManager = $entity_type_manager;
        $this->languageManager = $language_manager;
        $this->entityRepository = $entity_repository;
    }
    
    /**
     * {@inheritdoc}
     */
    public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
        return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity_type.manager'), $container->get('language_manager'), $container->get('entity.repository'));
    }
    
    /**
     * {@inheritdoc}
     */
    public function render($row) {
        return $this->getEntityTranslationByRelationship($row->_entity, $row);
    }
    
    /**
     * {@inheritdoc}
     */
    public function getEntityTypeId() {
        return $this->view
            ->getBaseEntityType()
            ->id();
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getEntityTypeManager() {
        return $this->entityTypeManager;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getEntityRepository() {
        return $this->entityRepository;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getLanguageManager() {
        return $this->languageManager;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getView() {
        return $this->view;
    }
    
    /**
     * {@inheritdoc}
     */
    public function query() {
        parent::query();
        $this->getEntityTranslationRenderer()
            ->query($this->view
            ->getQuery());
    }

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Overriden Title Overrides
DataEntityRow::$entityDisplayRepository protected property The entity display repository.
DataEntityRow::$entityRepository protected property The entity repository service.
DataEntityRow::$entityType protected property Contains the entity type of this row plugin instance.
DataEntityRow::$entityTypeManager protected property The entity type manager.
DataEntityRow::$languageManager protected property The language manager.
DataEntityRow::$usesOptions protected property Denotes whether the plugin has an additional options form. Overrides RowPluginBase::$usesOptions
DataEntityRow::create public static function Creates an instance of the plugin. Overrides PluginBase::create
DataEntityRow::getEntityRepository protected function
DataEntityRow::getEntityTypeId public function Returns the entity type identifier. Overrides EntityTranslationRenderTrait::getEntityTypeId
DataEntityRow::getEntityTypeManager protected function
DataEntityRow::getLanguageManager protected function Returns the language manager. Overrides EntityTranslationRenderTrait::getLanguageManager
DataEntityRow::getView protected function Returns the top object of a view. Overrides EntityTranslationRenderTrait::getView
DataEntityRow::query public function Add anything to the query that we might need to. Overrides RowPluginBase::query
DataEntityRow::render public function Renders a row object. Overrides RowPluginBase::render
DataEntityRow::__construct public function Constructs a new DataEntityRow object. Overrides PluginBase::__construct
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
EntityTranslationRenderTrait::$entityTranslationRenderer protected property The renderer to be used to render the entity row.
EntityTranslationRenderTrait::getEntityTranslation Deprecated public function Returns the entity translation matching the configured row language.
EntityTranslationRenderTrait::getEntityTranslationByRelationship public function Returns the entity translation matching the configured row language.
EntityTranslationRenderTrait::getEntityTranslationRenderer protected function Returns the current renderer.
PluginBase::$definition public property Plugins' definition.
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$position public property The handler position.
PluginBase::$renderer protected property Stores the render API renderer. 3
PluginBase::$view public property The top object of a view. 1
PluginBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides DependentPluginInterface::calculateDependencies 14
PluginBase::destroy public function Clears a plugin. Overrides ViewsPluginInterface::destroy 2
PluginBase::doFilterByDefinedOptions protected function Do the work to filter out stored options depending on the defined options.
PluginBase::filterByDefinedOptions public function Filter out stored options depending on the defined options. Overrides ViewsPluginInterface::filterByDefinedOptions
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements. Overrides ViewsPluginInterface::getAvailableGlobalTokens
PluginBase::getProvider public function Returns the plugin provider. Overrides ViewsPluginInterface::getProvider
PluginBase::getRenderer protected function Returns the render API renderer. 1
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form. Overrides ViewsPluginInterface::globalTokenForm
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced. Overrides ViewsPluginInterface::globalTokenReplace
PluginBase::INCLUDE_ENTITY constant Include entity row languages when listing languages.
PluginBase::INCLUDE_NEGOTIATED constant Include negotiated languages when listing languages.
PluginBase::init public function Initialize the plugin. Overrides ViewsPluginInterface::init 6
PluginBase::listLanguages protected function Makes an array of languages, optionally including special languages.
PluginBase::pluginTitle public function Return the human readable name of the display. Overrides ViewsPluginInterface::pluginTitle
PluginBase::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface::preRenderAddFieldsetMarkup
PluginBase::preRenderFlattenData public static function Flattens the structure of form elements. Overrides ViewsPluginInterface::preRenderFlattenData
PluginBase::queryLanguageSubstitutions public static function Returns substitutions for Views queries for languages.
PluginBase::setOptionDefaults protected function Fills up the options of the plugin with defaults.
PluginBase::summaryTitle public function Returns the summary of the settings in the display. Overrides ViewsPluginInterface::summaryTitle 6
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. Overrides ViewsPluginInterface::themeFunctions 1
PluginBase::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface::trustedCallbacks 6
PluginBase::unpackOptions public function Unpacks options over our existing defaults. Overrides ViewsPluginInterface::unpackOptions
PluginBase::usesOptions public function Returns the usesOptions property. Overrides ViewsPluginInterface::usesOptions 8
PluginBase::validate public function Validate that the plugin is correct and can be saved. Overrides ViewsPluginInterface::validate 6
PluginBase::viewsTokenReplace protected function Replaces Views' tokens in a given string. 1
PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT constant Query string to indicate the site default language.
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin ID of the plugin instance. 2
RowPluginBase::$base_field public property 2
RowPluginBase::$field_alias public property 1
RowPluginBase::$usesFields protected property Does the row plugin support to add fields to its output. 4
RowPluginBase::buildOptionsForm public function Provide a form for setting options. Overrides PluginBase::buildOptionsForm 8
RowPluginBase::defineOptions protected function Information about options for all kinds of purposes will be held here. Overrides PluginBase::defineOptions 8
RowPluginBase::preRender public function Allow the style to do stuff before each row is rendered. 4
RowPluginBase::submitOptionsForm public function Perform any necessary changes to the form values prior to storage. Overrides PluginBase::submitOptionsForm 1
RowPluginBase::usesFields public function Returns the usesFields property. 4
RowPluginBase::validateOptionsForm public function Validate the options form. Overrides PluginBase::validateOptionsForm 1
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING Deprecated constant Untrusted callbacks trigger E_USER_WARNING errors.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.