BlockContentWorkspaceHandler.php

Same filename in other branches
  1. 10 core/modules/workspaces/src/Entity/Handler/BlockContentWorkspaceHandler.php

Namespace

Drupal\workspaces\Entity\Handler

File

core/modules/workspaces/src/Entity/Handler/BlockContentWorkspaceHandler.php

View source
<?php

namespace Drupal\workspaces\Entity\Handler;

use Drupal\Core\Entity\EntityInterface;

/**
 * Provides a custom workspace handler for block_content entities.
 *
 * @internal
 */
class BlockContentWorkspaceHandler extends DefaultWorkspaceHandler {
    
    /**
     * {@inheritdoc}
     */
    public function isEntitySupported(EntityInterface $entity) : bool {
        // Only reusable blocks can be tracked individually. Non-reusable or inline
        // blocks are tracked as part of the entity they are a composite of.
        
        /** @var \Drupal\block_content\BlockContentInterface $entity */
        return $entity->isReusable();
    }

}

Classes

Title Deprecated Summary
BlockContentWorkspaceHandler Provides a custom workspace handler for block_content entities.

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