class Search in Search API Autocomplete 8
Describes the autocomplete settings for a certain search.
Plugin annotation
@ConfigEntityType(
id = "search_api_autocomplete_search",
label = @Translation("Autocomplete search"),
label_collection = @Translation("Autocomplete searches"),
label_singular = @Translation("autocomplete search"),
label_plural = @Translation("autocomplete searches"),
label_count = @PluralTranslation(
singular = "@count autocomplete search",
plural = "@count autocomplete searches",
),
handlers = {
"storage" = "Drupal\search_api_autocomplete\Entity\SearchStorage",
"form" = {
"default" = "\Drupal\search_api_autocomplete\Form\SearchEditForm",
"edit" = "\Drupal\search_api_autocomplete\Form\SearchEditForm",
"delete" = "\Drupal\Core\Entity\EntityDeleteForm",
},
"list_builder" = "\Drupal\Core\Entity\EntityListBuilder",
"route_provider" = {
"default" = "\Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
},
},
admin_permission = "administer search_api_autocomplete",
config_prefix = "search",
entity_keys = {
"id" = "id",
"label" = "label",
"uuid" = "uuid",
"status" = "status",
},
links = {
"edit-form" = "/admin/config/search/search-api/index/{search_api_index}/autocomplete/{search_api_autocomplete_search}/edit",
"delete-form" = "/admin/config/search/search-api/index/{search_api_index}/autocomplete/{search_api_autocomplete_search}/delete",
},
config_export = {
"id",
"label",
"status",
"index_id",
"suggester_settings",
"suggester_weights",
"suggester_limits",
"search_settings",
"options",
}
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
- class \Drupal\search_api_autocomplete\Entity\Search implements SearchInterface
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
Expanded class hierarchy of Search
8 files declare their use of Search
- CacheInvalidationTest.php in tests/
src/ Functional/ CacheInvalidationTest.php - DependencyRemovalTest.php in tests/
src/ Kernel/ DependencyRemovalTest.php - IndexOverviewForm.php in src/
Form/ IndexOverviewForm.php - IntegrationTest.php in tests/
src/ FunctionalJavascript/ IntegrationTest.php - PagesIntegrationTest.php in tests/
src/ FunctionalJavascript/ PagesIntegrationTest.php
5 string references to 'Search'
- search_api_autocomplete.info.yml in ./
search_api_autocomplete.info.yml - search_api_autocomplete.info.yml
- search_api_autocomplete_test.info.yml in tests/
search_api_autocomplete_test/ search_api_autocomplete_test.info.yml - tests/search_api_autocomplete_test/search_api_autocomplete_test.info.yml
- search_api_autocomplete_test_hooks.info.yml in tests/
search_api_autocomplete_test_hooks/ search_api_autocomplete_test_hooks.info.yml - tests/search_api_autocomplete_test_hooks/search_api_autocomplete_test_hooks.info.yml
- search_api_autocomplete_test_pages.info.yml in tests/
search_api_autocomplete_test_pages/ search_api_autocomplete_test_pages.info.yml - tests/search_api_autocomplete_test_pages/search_api_autocomplete_test_pages.info.yml
- views.view.search_api_autocomplete_test_view.yml in tests/
search_api_autocomplete_test/ config/ install/ views.view.search_api_autocomplete_test_view.yml - tests/search_api_autocomplete_test/config/install/views.view.search_api_autocomplete_test_view.yml
File
- src/
Entity/ Search.php, line 64
Namespace
Drupal\search_api_autocomplete\EntityView source
class Search extends ConfigEntityBase implements SearchInterface {
/**
* The entity ID.
*
* @var string
*/
protected $id;
/**
* The entity label.
*
* @var string
*/
protected $label;
/**
* The index ID.
*
* @var string
*/
protected $index_id;
/**
* The search index instance.
*
* @var \Drupal\search_api\IndexInterface|null
*
* @see \Drupal\search_api_autocomplete\Entity\Search::getIndex()
*/
protected $index;
/**
* The settings of the suggesters selected for this search.
*
* The array has the following structure:
*
* @code
* [
* 'SUGGESTER_ID' => [
* // Settings …
* ],
* …
* ]
* @endcode
*
* @var array
*/
protected $suggester_settings = [];
/**
* The suggester weights, keyed by suggester ID.
*
* @var int[]
*/
protected $suggester_weights = [];
/**
* The suggester limits (where set), keyed by suggester ID.
*
* @var int[]
*/
protected $suggester_limits = [];
/**
* The loaded suggester plugins.
*
* @var \Drupal\search_api_autocomplete\Suggester\SuggesterInterface[]|null
*/
protected $suggesterInstances;
/**
* The settings for the search plugin.
*
* The array has the following structure:
*
* @code
* [
* 'SEARCH_ID' => [
* // Settings …
* ]
* ]
* @endcode
*
* There is always just a single entry in the array.
*
* @var array
*/
protected $search_settings = [];
/**
* The search plugin.
*
* @var \Drupal\search_api_autocomplete\Search\SearchPluginInterface|null
*/
protected $searchPlugin;
/**
* An array of general options for this search.
*
* @var array
*/
protected $options = [];
/**
* {@inheritdoc}
*/
public static function getDefaultOptions() {
return [
'autosubmit' => TRUE,
'delay' => NULL,
'limit' => 10,
'min_length' => 1,
'submit_button_selector' => ':submit',
];
}
/**
* {@inheritdoc}
*/
protected function urlRouteParameters($rel) {
$parameters = parent::urlRouteParameters($rel);
$parameters['search_api_index'] = $this
->getIndexId();
return $parameters;
}
/**
* {@inheritdoc}
*/
public function getIndexId() {
return $this->index_id;
}
/**
* {@inheritdoc}
*/
public function hasValidIndex() {
return $this->index || Index::load($this->index_id);
}
/**
* {@inheritdoc}
*/
public function getIndex() {
if (!isset($this->index)) {
$this->index = Index::load($this->index_id);
if (!$this->index) {
throw new SearchApiAutocompleteException("The index with ID \"{$this->index_id}\" could not be loaded.");
}
}
return $this->index;
}
/**
* {@inheritdoc}
*/
public function getSuggesters() {
if ($this->suggesterInstances === NULL) {
$this->suggesterInstances = \Drupal::getContainer()
->get('search_api_autocomplete.plugin_helper')
->createSuggesterPlugins($this, array_keys($this->suggester_settings));
}
return $this->suggesterInstances;
}
/**
* {@inheritdoc}
*/
public function getSuggesterIds() {
if ($this->suggesterInstances !== NULL) {
return array_keys($this->suggesterInstances);
}
return array_keys($this->suggester_settings);
}
/**
* {@inheritdoc}
*/
public function isValidSuggester($suggester_id) {
$suggesters = $this
->getSuggesters();
return !empty($suggesters[$suggester_id]);
}
/**
* {@inheritdoc}
*/
public function getSuggester($suggester_id) {
$suggesters = $this
->getSuggesters();
if (empty($suggesters[$suggester_id])) {
$index_label = $this
->label();
throw new SearchApiAutocompleteException("The suggester with ID '{$suggester_id}' could not be retrieved for index '{$index_label}'.");
}
return $suggesters[$suggester_id];
}
/**
* {@inheritdoc}
*/
public function addSuggester(SuggesterInterface $suggester) {
// Make sure the suggesterInstances are loaded before trying to add a plugin
// to them.
if ($this->suggesterInstances === NULL) {
$this
->getSuggesters();
}
$this->suggesterInstances[$suggester
->getPluginId()] = $suggester;
return $this;
}
/**
* {@inheritdoc}
*/
public function removeSuggester($suggester_id) {
// Depending on whether the suggesters have already been loaded, we have to
// either remove the settings or the instance.
if ($this->suggesterInstances === NULL) {
unset($this->suggester_settings[$suggester_id]);
}
else {
unset($this->suggesterInstances[$suggester_id]);
}
unset($this->suggester_weights[$suggester_id]);
unset($this->suggester_limits[$suggester_id]);
return $this;
}
/**
* {@inheritdoc}
*/
public function setSuggesters(array $suggesters = NULL) {
$this->suggesterInstances = $suggesters;
// Sanitize the suggester weights and limits.
$this->suggester_weights = array_intersect_key($this->suggester_weights, $suggesters);
$this->suggester_limits = array_intersect_key($this->suggester_limits, $suggesters);
return $this;
}
/**
* {@inheritdoc}
*/
public function getSuggesterWeights() {
return $this->suggester_weights;
}
/**
* {@inheritdoc}
*/
public function getSuggesterLimits() {
return $this->suggester_limits;
}
/**
* {@inheritdoc}
*/
public function hasValidSearchPlugin() {
return (bool) \Drupal::getContainer()
->get('plugin.manager.search_api_autocomplete.search')
->getDefinition($this
->getSearchPluginId(), FALSE);
}
/**
* {@inheritdoc}
*/
public function getSearchPluginId() {
if ($this->searchPlugin) {
return $this->searchPlugin
->getPluginId();
}
reset($this->search_settings);
return key($this->search_settings);
}
/**
* {@inheritdoc}
*/
public function getSearchPlugin() {
if (!$this->searchPlugin) {
$plugin_id = $this
->getSearchPluginId();
$configuration = [];
if (!empty($this->search_settings[$plugin_id])) {
$configuration = $this->search_settings[$plugin_id];
}
$this->searchPlugin = \Drupal::getContainer()
->get('search_api_autocomplete.plugin_helper')
->createSearchPlugin($this, $plugin_id, $configuration);
}
return $this->searchPlugin;
}
/**
* {@inheritdoc}
*/
public function getOption($name) {
$options = $this
->getOptions();
return isset($options[$name]) ? $options[$name] : NULL;
}
/**
* {@inheritdoc}
*/
public function getOptions() {
return $this->options + static::getDefaultOptions();
}
/**
* {@inheritdoc}
*/
public function setOption($name, $option) {
$this->options[$name] = $option;
return $this;
}
/**
* {@inheritdoc}
*/
public function setOptions(array $options) {
$this->options = $options;
return $this;
}
/**
* {@inheritdoc}
*/
public function createQuery($keys, array $data = []) {
return $this
->getSearchPlugin()
->createQuery($keys, $data);
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
// Make sure the search plugin's index matches this entity's index.
$plugin_index_id = $this
->getSearchPlugin()
->getIndexId();
if ($this
->getIndexId() !== $plugin_index_id) {
throw new SearchApiAutocompleteException("Attempt to save autocomplete search '{$this->id()}' with search plugin '{$this->getSearchPluginId()}' of index '{$plugin_index_id}' while the autocomplete search points to index '{$this->getIndexId()}'");
}
// Make sure only one search entity is ever saved for a certain search
// plugin.
/** @var \Drupal\search_api_autocomplete\Entity\SearchStorage $storage */
$search = $storage
->loadBySearchPlugin($this
->getSearchPluginId());
if ($search && $search
->id() !== $this
->id()) {
throw new SearchApiAutocompleteException("Attempt to save autocomplete search '{$this->id()}' with search plugin '{$this->getSearchPluginId()}' when this plugin is already used for '{$search->id()}'");
}
// If we are in the process of syncing, we shouldn't change any entity
// properties (or other configuration).
if ($this
->isSyncing()) {
return;
}
// Write the plugin settings to the persistent *_settings properties.
$this
->writeChangesToSettings();
// If there are no suggesters set for the search, it can't be enabled.
if (!$this
->getSuggesters()) {
$this
->disable();
}
}
/**
* {@inheritdoc}
*/
protected function invalidateTagsOnSave($update) {
parent::invalidateTagsOnSave($update);
$plugin_id = $this
->getSearchPluginId();
Cache::invalidateTags([
"search_api_autocomplete_search_list:{$plugin_id}",
]);
}
/**
* {@inheritdoc}
*/
protected static function invalidateTagsOnDelete(EntityTypeInterface $entity_type, array $entities) {
parent::invalidateTagsOnDelete($entity_type, $entities);
$tags = [];
foreach ($entities as $entity) {
if ($entity instanceof Search) {
$plugin_id = $entity
->getSearchPluginId();
$tags[] = "search_api_autocomplete_search_list:{$plugin_id}";
}
}
if ($tags) {
Cache::invalidateTags(array_unique($tags));
}
}
/**
* Prepares for changes to this search to be persisted.
*
* To this end, the settings for all loaded plugin objects are written back to
* the corresponding *_settings properties.
*
* @return $this
*/
protected function writeChangesToSettings() {
// Write the enabled suggesters to the settings property.
$this->suggester_settings = [];
foreach ($this
->getSuggesters() as $suggester_id => $suggester) {
if ($suggester
->supportsSearch($this)) {
$configuration = $suggester
->getConfiguration();
$this->suggester_settings[$suggester_id] = $configuration;
}
else {
unset($this->suggesterInstances[$suggester_id]);
}
}
// Write the search plugin configuration to the settings property.
if ($this->searchPlugin !== NULL) {
$plugin_id = $this->searchPlugin
->getPluginId();
$this->search_settings = [
$plugin_id => $this->searchPlugin
->getConfiguration(),
];
}
return $this;
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
$dependencies = $this
->getDependencyData();
// Keep only "enforced" dependencies, then add those computed by
// getDependencyData().
$this->dependencies = array_intersect_key($this->dependencies, [
'enforced' => TRUE,
]);
$this->dependencies += array_map('array_keys', $dependencies);
return $this;
}
/**
* {@inheritdoc}
*/
public function onDependencyRemoval(array $dependencies) {
$changed = parent::onDependencyRemoval($dependencies);
$plugins = $this
->getAllPlugins();
$dependency_data = $this
->getDependencyData();
// Make sure our dependency data has the exact same keys as $dependencies,
// to simplify the subsequent code.
$dependencies = array_filter($dependencies);
$dependency_data = array_intersect_key($dependency_data, $dependencies);
$dependency_data += array_fill_keys(array_keys($dependencies), []);
$call_on_removal = [];
foreach ($dependencies as $dependency_type => $dependency_objects) {
// Annoyingly, modules and theme dependencies come not keyed by dependency
// name here, while entities do. Flip the array for modules and themes to
// make the code simpler.
if (in_array($dependency_type, [
'module',
'theme',
])) {
$dependency_objects = array_flip($dependency_objects);
}
$dependency_data[$dependency_type] = array_intersect_key($dependency_data[$dependency_type], $dependency_objects);
foreach ($dependency_data[$dependency_type] as $name => $dependency_sources) {
// We first remove all the "hard" dependencies.
if (!empty($dependency_sources['always'])) {
foreach ($dependency_sources['always'] as $plugin_type => $type_plugins) {
// We can hardly remove the search entity itself.
if ($plugin_type == 'entity') {
continue;
}
// Otherwise, we need to remove the plugin in question.
$changed = TRUE;
$plugins[$plugin_type] = array_diff_key($plugins[$plugin_type], $type_plugins);
}
}
// Then, collect all the optional ones.
if (!empty($dependency_sources['optional'])) {
// However this plays out, it will lead to a change.
$changed = TRUE;
foreach ($dependency_sources['optional'] as $plugin_type => $type_plugins) {
// Only include those plugins that have not already been removed.
$type_plugins = array_intersect_key($type_plugins, $plugins[$plugin_type]);
foreach ($type_plugins as $plugin_id => $plugin) {
$call_on_removal[$plugin_type][$plugin_id][$dependency_type][$name] = $dependency_objects[$name];
}
}
}
}
}
// Now for all plugins with optional dependencies (stored in
// $call_on_removal, mapped to their removed dependencies) call their
// onDependencyRemoval() methods.
foreach ($call_on_removal as $plugin_type => $type_plugins) {
foreach ($type_plugins as $plugin_id => $plugin_dependencies) {
$plugin = $plugins[$plugin_type][$plugin_id];
$removal_successful = $plugin
->onDependencyRemoval($plugin_dependencies);
if (!$removal_successful) {
unset($plugins[$plugin_type][$plugin_id]);
}
}
}
// If we had to remove the search plugin, the search entity cannot be
// "rescued". Return FALSE in this case, which will cause the entity to be
// deleted.
if (empty($plugins['search_plugin'])) {
return FALSE;
}
// If there are no suggesters left, we just disable the search.
if (empty($plugins['suggesters'])) {
$this
->disable();
}
// In case we removed any suggesters, set our suggesters to the remaining
// ones. (If we didn't remove any, this is a no-op.) Since the plugins
// already changed their configuration, if necessary, those changes should
// be propagated automatically when saving via preSave().
$this
->setSuggesters($plugins['suggesters']);
return $changed;
}
/**
* Retrieves data about this search entity's dependencies.
*
* The return value is structured as follows:
*
* @code
* [
* 'config' => [
* 'CONFIG_DEPENDENCY_KEY' => [
* 'always' => [
* 'search_plugin' => [
* 'SEARCH_ID' => $search_plugin,
* ],
* 'suggesters' => [
* 'SUGGESTER_ID_1' => $suggester_1,
* 'SUGGESTER_ID_2' => $suggester_2,
* ],
* ],
* 'optional' => [
* 'entity' => [
* 'SEARCH_ID' => $search,
* ],
* ],
* ],
* ],
* ]
* @endcode
*
* Enforced dependencies are not included in this method's return value.
*
* @return object[][][][][]
* An associative array containing the search's dependencies. The array is
* first keyed by the config dependency type ("module", "config", etc.) and
* then by the names of the config dependencies of that type which the index
* has. The values are associative arrays with up to two keys, "always" and
* "optional", specifying whether the dependency is a hard one by the plugin
* (or entity) in question or potentially depending on the configuration.
* The values on this level are arrays with keys "entity", "search_plugin"
* and/or "suggesters" and values arrays of IDs mapped to their entities or
* plugins.
*/
protected function getDependencyData() {
$dependency_data = [];
// Since calculateDependencies() will work directly on the $dependencies
// property, we first save its original state and then restore it
// afterwards.
$original_dependencies = $this->dependencies;
parent::calculateDependencies();
unset($this->dependencies['enforced']);
foreach ($this->dependencies as $dependency_type => $list) {
foreach ($list as $name) {
$dependency_data[$dependency_type][$name]['always']['entity'][$this->id] = $this;
}
}
$this->dependencies = $original_dependencies;
// Include the dependency to the search index.
if ($this
->hasValidIndex()) {
$name = $this
->getIndex()
->getConfigDependencyName();
$dependency_data['config'][$name]['always']['entity'][$this->id] = $this;
}
// All other plugins can be treated uniformly.
foreach ($this
->getAllPlugins() as $plugin_type => $type_plugins) {
foreach ($type_plugins as $plugin_id => $plugin) {
// Largely copied from
// \Drupal\Core\Plugin\PluginDependencyTrait::calculatePluginDependencies().
$definition = $plugin
->getPluginDefinition();
// First, always depend on the module providing the plugin.
$dependency_data['module'][$definition['provider']]['always'][$plugin_type][$plugin_id] = $plugin;
// Plugins can declare additional dependencies in their definition.
if (isset($definition['config_dependencies'])) {
foreach ($definition['config_dependencies'] as $dependency_type => $list) {
foreach ($list as $name) {
$dependency_data[$dependency_type][$name]['always'][$plugin_type][$plugin_id] = $plugin;
}
}
}
// Finally, add the dynamically-calculated dependencies of the plugin.
foreach ($plugin
->calculateDependencies() as $dependency_type => $list) {
foreach ($list as $name) {
$dependency_data[$dependency_type][$name]['optional'][$plugin_type][$plugin_id] = $plugin;
}
}
}
}
return $dependency_data;
}
/**
* Retrieves all the plugins contained in this search entity.
*
* @return \Drupal\search_api_autocomplete\Plugin\PluginInterface[][]
* All plugins contained in this search, keyed by the plugin type
* ("search_plugin" or "suggesters") and their plugin IDs.
*/
protected function getAllPlugins() {
$plugins = [];
if ($this
->hasValidSearchPlugin()) {
$plugin_id = $this
->getSearchPluginId();
$plugins['search_plugin'][$plugin_id] = $this
->getSearchPlugin();
}
$plugins['suggesters'] = $this
->getSuggesters();
return $plugins;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
ConfigEntityBase:: |
private | property | Whether the config is being deleted by the uninstall process. | |
ConfigEntityBase:: |
protected | property | The language code of the entity's default language. | |
ConfigEntityBase:: |
protected | property | The original ID of the configuration entity. | |
ConfigEntityBase:: |
protected | property | The enabled/disabled status of the configuration entity. | 4 |
ConfigEntityBase:: |
protected | property | Third party entity settings. | |
ConfigEntityBase:: |
protected | property | Trust supplied data and not use configuration schema on save. | |
ConfigEntityBase:: |
protected | property | The UUID for this entity. | |
ConfigEntityBase:: |
protected | property | Information maintained by Drupal core about configuration. | |
ConfigEntityBase:: |
protected | function | Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). | |
ConfigEntityBase:: |
public | function |
Creates a duplicate of the entity. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Disables the configuration entity. Overrides ConfigEntityInterface:: |
1 |
ConfigEntityBase:: |
public | function |
Enables the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the cache tags that should be used to invalidate caches. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Gets the configuration dependency name. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected static | function | Gets the configuration manager. | |
ConfigEntityBase:: |
public | function |
Gets the configuration target identifier for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the configuration dependencies. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
protected | function | Gets the typed config manager. | |
ConfigEntityBase:: |
public | function |
Gets whether on not the data is trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Checks whether this entity is installable. Overrides ConfigEntityInterface:: |
2 |
ConfigEntityBase:: |
public | function |
Overrides Entity::isNew(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public static | function |
Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase:: |
8 |
ConfigEntityBase:: |
public | function |
Saves an entity permanently. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Sets the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets the status of the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function | ||
ConfigEntityBase:: |
public static | function | Helper callback for uasort() to sort configuration entities by weight and label. | 6 |
ConfigEntityBase:: |
public | function |
Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface:: |
4 |
ConfigEntityBase:: |
public | function |
Gets an array of all property values. Overrides EntityBase:: |
2 |
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets that the data should be trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Unsets a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the public URL for this entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Constructs an Entity object. Overrides EntityBase:: |
10 |
ConfigEntityBase:: |
public | function |
Overrides EntityBase:: |
4 |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | Aliased as: traitSleep | 1 |
DependencySerializationTrait:: |
public | function | 2 | |
DependencyTrait:: |
protected | property | The object's dependencies. | |
DependencyTrait:: |
protected | function | Adds multiple dependencies. | |
DependencyTrait:: |
protected | function | Adds a dependency. Aliased as: addDependencyTrait | |
EntityBase:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
EntityBase:: |
protected | property | The entity type. | |
EntityBase:: |
protected | property | A typed data object wrapping this entity. | |
EntityBase:: |
public | function |
Checks data value access. Overrides AccessibleInterface:: |
1 |
EntityBase:: |
public | function |
Gets the bundle of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public static | function |
Constructs a new entity object, without permanently saving it. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Deletes an entity permanently. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Enforces an entity to be new. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets the entity manager. | |
EntityBase:: |
protected | function | Gets the entity type bundle info service. | |
EntityBase:: |
protected | function | Gets the entity type manager. | |
EntityBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
Gets the key that is used to store configuration dependencies. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the entity type definition. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the ID of the type of the entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | The list cache tags to invalidate for this entity. | |
EntityBase:: |
public | function |
Gets a typed data object for this entity object. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Indicates if a link template exists for a given key. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the identifier. Overrides EntityInterface:: |
11 |
EntityBase:: |
public | function |
Gets the label of the entity. Overrides EntityInterface:: |
6 |
EntityBase:: |
public | function |
Gets the language of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the language manager. | |
EntityBase:: |
protected | function | Gets an array link templates. | 1 |
EntityBase:: |
public static | function |
Loads an entity. Overrides EntityInterface:: |
|
EntityBase:: |
public static | function |
Loads one or more entities. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Acts on a created entity before hooks are invoked. Overrides EntityInterface:: |
4 |
EntityBase:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface:: |
16 |
EntityBase:: |
public static | function |
Acts on loaded entities. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Acts on a saved entity before the insert or update hook is invoked. Overrides EntityInterface:: |
14 |
EntityBase:: |
public static | function |
Changes the values of an entity before it is created. Overrides EntityInterface:: |
5 |
EntityBase:: |
public | function |
Gets a list of entities referenced by this entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Generates the HTML for a link to this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets a list of URI relationships supported by this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the UUID generator. | |
PluginDependencyTrait:: |
protected | function | Calculates and adds dependencies of a specific plugin instance. | 1 |
PluginDependencyTrait:: |
protected | function | Calculates and returns dependencies of a specific plugin instance. | |
PluginDependencyTrait:: |
protected | function | Wraps the module handler. | 1 |
PluginDependencyTrait:: |
protected | function | Wraps the theme handler. | 1 |
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
Search:: |
protected | property | The entity ID. | |
Search:: |
protected | property | The search index instance. | |
Search:: |
protected | property | The index ID. | |
Search:: |
protected | property | The entity label. | |
Search:: |
protected | property | An array of general options for this search. | |
Search:: |
protected | property | The search plugin. | |
Search:: |
protected | property | The settings for the search plugin. | |
Search:: |
protected | property | The loaded suggester plugins. | |
Search:: |
protected | property | The suggester limits (where set), keyed by suggester ID. | |
Search:: |
protected | property | The settings of the suggesters selected for this search. | |
Search:: |
protected | property | The suggester weights, keyed by suggester ID. | |
Search:: |
public | function |
Adds a suggester to this search. Overrides SearchInterface:: |
|
Search:: |
public | function |
Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityBase:: |
|
Search:: |
public | function |
Creates a query object for this search. Overrides SearchInterface:: |
|
Search:: |
protected | function | Retrieves all the plugins contained in this search entity. | |
Search:: |
public static | function |
Retrieves the default options for a search. Overrides SearchInterface:: |
|
Search:: |
protected | function | Retrieves data about this search entity's dependencies. | |
Search:: |
public | function |
Retrieves the index this search belongs to. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves the ID of the index this search belongs to. Overrides SearchInterface:: |
|
Search:: |
public | function |
Gets a specific option's value. Overrides SearchInterface:: |
|
Search:: |
public | function |
Gets the search's options. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves the search plugin. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves the search plugin's ID. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves a specific suggester plugin for this search. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves the IDs of all suggesters enabled for this search. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves the individual limits set for the search's suggesters. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves this search's suggester plugins. Overrides SearchInterface:: |
|
Search:: |
public | function |
Retrieves the weights set for the search's suggesters. Overrides SearchInterface:: |
|
Search:: |
public | function |
Determines whether this search has a valid index set. Overrides SearchInterface:: |
|
Search:: |
public | function |
Determines whether the search plugin set for this search is valid. Overrides SearchInterface:: |
|
Search:: |
protected static | function |
Override to never invalidate the individual entities' cache tags; the
config system already invalidates them. Overrides ConfigEntityBase:: |
|
Search:: |
protected | function |
Override to never invalidate the entity's cache tag; the config system
already invalidates it. Overrides ConfigEntityBase:: |
|
Search:: |
public | function |
Determines whether the given suggester ID is valid for this search. Overrides SearchInterface:: |
|
Search:: |
public | function |
Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityBase:: |
|
Search:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides ConfigEntityBase:: |
|
Search:: |
public | function |
Removes a suggester from this search. Overrides SearchInterface:: |
|
Search:: |
public | function |
Sets an option. Overrides SearchInterface:: |
|
Search:: |
public | function |
Sets the search options. Overrides SearchInterface:: |
|
Search:: |
public | function |
Sets this search's suggester plugins. Overrides SearchInterface:: |
|
Search:: |
protected | function |
Gets an array of placeholders for this entity. Overrides EntityBase:: |
|
Search:: |
protected | function | Prepares for changes to this search to be persisted. | |
SynchronizableEntityTrait:: |
protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
SynchronizableEntityTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
public | function |