SearchPageListBuilder
class SearchPageListBuilder extends DraggableListBuilder implements FormInterface (View source)
Defines a class to build a listing of search page entities.
Traits
Provides access to configuration for forms.
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 | $entitiesKey | The key to use for the form element containing the entities. |
from DraggableListBuilder |
| protected SearchPageInterface[] | $entities | The entities being listed. |
|
| protected string|bool | $weightKey | Name of the entity's weight field or FALSE if no field is provided. |
from DraggableListBuilder |
| protected FormBuilderInterface | $formBuilder | The form builder. |
from DraggableListBuilder |
| protected ConfigFactoryInterface | $configFactory | Stores the configuration factory. |
|
| protected SearchPluginManager | $searchManager | The search manager. |
|
| protected SearchIndexInterface | $searchIndex | The search index. |
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 SearchPageListBuilder object.
Loads entities of this type from storage for listing.
Provides an array of information to build a list of operation links.
Builds the header row for the entity listing.
Builds a renderable list of operation links for the entity.
Retrieves a configuration object.
{@inheritdoc}
Returns a unique string identifying the form.
Form submission handler for the reindex button on the search admin settings form.
Form validation handler for adding a new search page.
Form submission handler for adding a new search page.
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, SearchPluginManager $search_manager, ConfigFactoryInterface $config_factory, MessengerInterface $messenger, SearchIndexInterface $search_index)
Constructs a new SearchPageListBuilder 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()
Builds a listing of entities for the given entity type.
protected
getTitle()
Gets the title of the page.
array
buildForm(array $form, FormStateInterface $form_state)
Form constructor.
validateForm(array $form, FormStateInterface $form_state)
Form validation handler.
submitForm(array $form, FormStateInterface $form_state)
Form submission handler.
protected FormBuilderInterface
formBuilder()
Returns the form builder.
protected Config|ImmutableConfig
config(string $name)
Retrieves a configuration object.
protected
getEditableConfigNames()
{@inheritdoc}
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().
searchAdminReindexSubmit(array $form, FormStateInterface $form_state)
Form submission handler for the reindex button on the search admin settings form.
validateAddSearchPage(array $form, FormStateInterface $form_state)
Form validation handler for adding a new search page.
submitAddSearchPage(array $form, FormStateInterface $form_state)
Form submission handler for adding a new search page.