CustomBlockInterface.php 2.05 KB
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\custom_block\Entity\CustomBlockInterface.
6 7 8 9 10
 */

namespace Drupal\custom_block;

use Drupal\Core\Entity\ContentEntityInterface;
11
use Drupal\Core\Entity\EntityChangedInterface;
12 13 14 15

/**
 * Provides an interface defining a custom block entity.
 */
16
interface CustomBlockInterface extends ContentEntityInterface, EntityChangedInterface {
17

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
  /**
   * Returns the block revision log message.
   *
   * @return string
   *   The revision log message.
   */
  public function getRevisionLog();

  /**
   * Sets the block description.
   *
   * @param string $info
   *   The block description.
   *
   * @return \Drupal\custom_block\CustomBlockInterface
   *   The class instance that this method is called on.
   */
  public function setInfo($info);

  /**
   * Sets the block revision log message.
   *
40
   * @param string $revision_log
41 42 43 44 45
   *   The revision log message.
   *
   * @return \Drupal\custom_block\CustomBlockInterface
   *   The class instance that this method is called on.
   */
46
  public function setRevisionLog($revision_log);
47

48 49 50 51 52 53 54 55 56
  /**
   * Sets the theme value.
   *
   * When creating a new custom block from the block library, the user is
   * redirected to the configure form for that block in the given theme. The
   * theme is stored against the block when the custom block add form is shown.
   *
   * @param string $theme
   *   The theme name.
57 58 59
   *
   * @return \Drupal\custom_block\CustomBlockInterface
   *   The class instance that this method is called on.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
   */
  public function setTheme($theme);

  /**
   * Gets the theme value.
   *
   * When creating a new custom block from the block library, the user is
   * redirected to the configure form for that block in the given theme. The
   * theme is stored against the block when the custom block add form is shown.
   *
   * @return string
   *   The theme name.
   */
  public function getTheme();

75 76 77 78 79 80 81 82
  /**
   * Gets the configured instances of this custom block.
   *
   * @return array
   *   Array of Drupal\block\Core\Plugin\Entity\Block entities.
   */
  public function getInstances();

83
}