BlockListBuilder
class BlockListBuilder extends ConfigEntityListBuilder implements FormInterface (View source)
Defines a class to build a listing of block entities.
Traits
Provides a trait for the messenger service.
Wrapper methods for the Redirect Destination.
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Provides dependency injection friendly methods for serialization.
Properties
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected ModuleHandlerInterface | $moduleHandler | The module handler to invoke hooks on. |
from EntityHandlerBase |
| protected MessengerInterface | $messenger | The messenger. |
|
| protected RedirectDestinationInterface | $redirectDestination | The redirect destination service. |
from RedirectDestinationTrait |
| protected EntityStorageInterface | $storage | The entity storage class. |
from EntityListBuilder |
| protected string | $entityTypeId | The entity type ID. |
from EntityListBuilder |
| protected EntityTypeInterface | $entityType | Information about the entity type. |
from EntityListBuilder |
| protected int|false | $limit | The number of entities to list per page, or FALSE to list all entities. |
from EntityListBuilder |
| protected string | $theme | The theme containing the blocks. |
|
| protected Request | $request | The current request. |
|
| protected ThemeManagerInterface | $themeManager | The theme manager. |
|
| protected FormBuilderInterface | $formBuilder | The form builder. |
Methods
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
Returns the redirect destination service.
Sets the redirect destination service.
Instantiates a new instance of this entity handler.
Constructs a new BlockListBuilder object.
Loads entities of this type from storage for listing.
Loads entity IDs using a pager sorted by the entity id.
Provides an array of information to build a list of operation links.
Builds a renderable list of operation links for the entity.
Builds a listing of entities for the given entity type.
Returns a unique string identifying the form.
Builds the main "Blocks" portion of the form.
Gets the name of the theme used for this block listing.
Wraps system_region_list().
Details
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
protected ModuleHandlerInterface
moduleHandler()
Gets the module handler.
$this
setModuleHandler(ModuleHandlerInterface $module_handler)
Sets the module handler for this handler.
setMessenger(MessengerInterface $messenger)
Sets the messenger.
MessengerInterface
messenger()
Gets the messenger.
protected array
getDestinationArray()
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
protected RedirectDestinationInterface
getRedirectDestination()
Returns the redirect destination service.
$this
setRedirectDestination(RedirectDestinationInterface $redirect_destination)
Sets the redirect destination service.
static EntityHandlerInterface
createInstance(ContainerInterface $container, EntityTypeInterface $entity_type)
Instantiates a new instance of this entity handler.
This is a factory method that returns a new instance of this object. The factory should pass any needed dependencies into the constructor of this object, but not the container itself. Every call to this method must return a new instance of this object; that is, it may not implement a singleton.
__construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ThemeManagerInterface $theme_manager, FormBuilderInterface $form_builder, MessengerInterface $messenger)
Constructs a new BlockListBuilder object.
EntityStorageInterface
getStorage()
Gets the entity storage.
EntityInterface[]
load()
Loads entities of this type from storage for listing.
This allows the implementation to manipulate the listing, like filtering or sorting the loaded entities.
protected array
getEntityIds()
Loads entity IDs using a pager sorted by the entity id.
array
getOperations(EntityInterface $entity)
Provides an array of information to build a list of operation links.
array
getDefaultOperations(EntityInterface $entity)
Gets this list's default operations.
array
buildHeader()
Builds the header row for the entity listing.
array
buildRow(EntityInterface $entity)
Builds a row for an entity in the entity listing.
array
buildOperations(EntityInterface $entity)
Builds a renderable list of operation links for the entity.
array
render(string|null $theme = NULL, Request $request = NULL)
Builds a listing of entities for the given entity type.
protected
getTitle()
Gets the title of the page.
string
getFormId()
Returns a unique string identifying the form.
The returned ID should be a unique string that can be a valid PHP function name, since it's used in hook implementation names such as hook_form_FORM_ID_alter().
array
buildForm(array $form, FormStateInterface $form_state)
Form constructor.
protected array
buildBlocksForm()
Builds the main "Blocks" portion of the form.
protected string
getThemeName()
Gets the name of the theme used for this block listing.
validateForm(array $form, FormStateInterface $form_state)
Form validation handler.
submitForm(array $form, FormStateInterface $form_state)
Form submission handler.
protected
systemRegionList($theme, $show = REGIONS_ALL)
Wraps system_region_list().