3 namespace Drupal\block_content;
5 use Drupal\block_content\Access\RefinableDependentAccessInterface;
6 use Drupal\Core\Entity\ContentEntityInterface;
7 use Drupal\Core\Entity\EntityChangedInterface;
8 use Drupal\Core\Entity\EntityPublishedInterface;
9 use Drupal\Core\Entity\RevisionLogInterface;
12 * Provides an interface defining a custom block entity.
14 interface BlockContentInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface, EntityPublishedInterface, RefinableDependentAccessInterface {
17 * Returns the block revision log message.
20 * The revision log message.
22 * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. Use
23 * \Drupal\Core\Entity\RevisionLogInterface::getRevisionLogMessage() instead.
25 public function getRevisionLog();
28 * Sets the block description.
31 * The block description.
33 * @return \Drupal\block_content\BlockContentInterface
34 * The class instance that this method is called on.
36 public function setInfo($info);
39 * Sets the block revision log message.
41 * @param string $revision_log
42 * The revision log message.
44 * @return \Drupal\block_content\BlockContentInterface
45 * The class instance that this method is called on.
47 * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. Use
48 * \Drupal\Core\Entity\RevisionLogInterface::setRevisionLogMessage() instead.
50 public function setRevisionLog($revision_log);
53 * Determines if the block is reusable or not.
56 * Returns TRUE if reusable and FALSE otherwise.
58 public function isReusable();
61 * Sets the block to be reusable.
65 public function setReusable();
68 * Sets the block to be non-reusable.
72 public function setNonReusable();
75 * Sets the theme value.
77 * When creating a new block content block from the block library, the user is
78 * redirected to the configure form for that block in the given theme. The
79 * theme is stored against the block when the block content add form is shown.
81 * @param string $theme
84 * @return \Drupal\block_content\BlockContentInterface
85 * The class instance that this method is called on.
87 public function setTheme($theme);
90 * Gets the theme value.
92 * When creating a new block content block from the block library, the user is
93 * redirected to the configure form for that block in the given theme. The
94 * theme is stored against the block when the block content add form is shown.
99 public function getTheme();
102 * Gets the configured instances of this custom block.
105 * Array of Drupal\block\Core\Plugin\Entity\Block entities.
107 public function getInstances();