EntityPublishedActionDeriver.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityPublishedActionDeriver.php
  2. 8.9.x core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityPublishedActionDeriver.php
  3. 11.x core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityPublishedActionDeriver.php

Namespace

Drupal\Core\Action\Plugin\Action\Derivative

File

core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityPublishedActionDeriver.php

View source
<?php

namespace Drupal\Core\Action\Plugin\Action\Derivative;

use Drupal\Core\Entity\EntityPublishedInterface;
use Drupal\Core\Entity\EntityTypeInterface;

/**
 * Provides an action deriver that finds publishable entity types.
 *
 * @see \Drupal\Core\Action\Plugin\Action\PublishAction
 * @see \Drupal\Core\Action\Plugin\Action\UnpublishAction
 */
class EntityPublishedActionDeriver extends EntityActionDeriverBase {
    
    /**
     * {@inheritdoc}
     */
    protected function isApplicable(EntityTypeInterface $entity_type) {
        return $entity_type->entityClassImplements(EntityPublishedInterface::class);
    }

}

Classes

Title Deprecated Summary
EntityPublishedActionDeriver Provides an action deriver that finds publishable entity types.

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