BlockInterface::createDuplicateBlock

public BlockInterface::createDuplicateBlock($new_id = NULL, $new_theme = NULL) Creates a duplicate of the block entity. Parameters string $new_id: (optional) The new ID on the duplicate block. string $new_theme: (optional) The theme on the duplicate block. Return value static A clone of $this with all identifiers unset, so saving it inserts a new entity into the storage system. File core/modules/block/src/BlockInterface.php, line 133 Class BlockInterface Provides an interface defining a

BlockInterface::BLOCK_REGION_NONE

Denotes that a block is not enabled in any region and should not be shown. File core/modules/block/src/BlockInterface.php, line 20 Class BlockInterface Provides an interface defining a block entity. Namespace Drupal\block Code const BLOCK_REGION_NONE = -1;

BlockInterface

Provides an interface defining a block entity. Hierarchy interface \Drupal\Core\Entity\EntityInterface; interface \Drupal\Core\Config\Entity\ThirdPartySettingsInterfaceinterface \Drupal\Core\Config\Entity\ConfigEntityInterfaceinterface \Drupal\block\BlockInterface File core/modules/block/src/BlockInterface.php, line 10 Namespace Drupal\block Members Name Modifiers Type Description AccessibleInterface::access public function Checks data value access. BlockInterface::B

BlockForm::validateForm

public BlockForm::validateForm(array &$form, FormStateInterface $form_state) Form validation handler. Parameters array $form: An associative array containing the structure of the form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Overrides FormBase::validateForm File core/modules/block/src/BlockForm.php, line 301 Class BlockForm Provides form for block instance forms. Namespace Drupal\block Code public function validateForm(array &$form, For

BlockForm::__construct

public BlockForm::__construct(EntityManagerInterface $entity_manager, ExecutableManagerInterface $manager, ContextRepositoryInterface $context_repository, LanguageManagerInterface $language, ThemeHandlerInterface $theme_handler, PluginFormFactoryInterface $plugin_form_manager) Constructs a BlockForm object. Parameters \Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager. \Drupal\Core\Executable\ExecutableManagerInterface $manager: The ConditionManager for building the

BlockForm::validateVisibility

protected BlockForm::validateVisibility(array $form, FormStateInterface $form_state) Helper function to independently validate the visibility UI. Parameters array $form: A nested array form elements comprising the form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. File core/modules/block/src/BlockForm.php, line 319 Class BlockForm Provides form for block instance forms. Namespace Drupal\block Code protected function validateVisibility(array $form, F

BlockForm::submitVisibility

protected BlockForm::submitVisibility(array $form, FormStateInterface $form_state) Helper function to independently submit the visibility UI. Parameters array $form: A nested array form elements comprising the form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. File core/modules/block/src/BlockForm.php, line 377 Class BlockForm Provides form for block instance forms. Namespace Drupal\block Code protected function submitVisibility(array $form, FormSta

BlockForm::submitForm

public BlockForm::submitForm(array &$form, FormStateInterface $form_state) This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state can be updated, this way the subsequently invoked handlers can retrieve a regular entity object to act on. Generally this method should not be overridden unless the ent

BlockForm::getUniqueMachineName

public BlockForm::getUniqueMachineName(BlockInterface $block) Generates a unique machine name for a block. Parameters \Drupal\block\BlockInterface $block: The block entity. Return value string Returns the unique name. File core/modules/block/src/BlockForm.php, line 408 Class BlockForm Provides form for block instance forms. Namespace Drupal\block Code public function getUniqueMachineName(BlockInterface $block) { $suggestion = $block->getPlugin()->getMachineNameSuggestion();

BlockForm::form

public BlockForm::form(array $form, FormStateInterface $form_state) Gets the actual form array to be built. Overrides EntityForm::form See also \Drupal\Core\Entity\EntityForm::processForm() \Drupal\Core\Entity\EntityForm::afterBuild() File core/modules/block/src/BlockForm.php, line 123 Class BlockForm Provides form for block instance forms. Namespace Drupal\block Code public function form(array $form, FormStateInterface $form_state) { $entity = $this->entity; // Store theme se