class DynamicLayout in Dynamic Layouts 8
Same name in this branch
- 8 src/Entity/DynamicLayout.php \Drupal\dynamic_layouts\Entity\DynamicLayout
- 8 src/Plugin/Layout/DynamicLayout.php \Drupal\dynamic_layouts\Plugin\Layout\DynamicLayout
Defines the DynamicLayout entity.
The DynamicLayout entity stores information about a dynamic layout.
Plugin annotation
@ConfigEntityType(
id = "dynamic_layout",
label = @Translation("Dynamic Layout"),
module = "dynamic_layout",
config_prefix = "dynamic_layout",
admin_permission = "admin dynamic layouts",
handlers = {
"list_builder" = "Drupal\dynamic_layouts\DynamicLayoutListBuilder",
"form" = {
"default" = "Drupal\dynamic_layouts\Form\DynamicLayoutForm",
"delete" = "Drupal\dynamic_layouts\Form\DynamicLayoutDeleteForm"
},
},
links = {
"edit-form" = "/admin/config/dynamic-layouts/manage/{dynamic_layout}",
"delete-form" =
"/admin/config/dynamic-layouts/manage/{dynamic_layout}/delete"
},
entity_keys = {
"id" = "id",
"label" = "label",
"weight" = "weight"
},
config_export = {
"id",
"label",
"weight",
"category",
"regions",
"default_column_class",
"default_row_class"
}
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
- class \Drupal\dynamic_layouts\Entity\DynamicLayout implements DynamicLayoutInterface
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
Expanded class hierarchy of DynamicLayout
File
- src/
Entity/ DynamicLayout.php, line 51
Namespace
Drupal\dynamic_layouts\EntityView source
class DynamicLayout extends ConfigEntityBase implements DynamicLayoutInterface {
/**
* The layout machine name.
*
* @var string
*/
public $id;
/**
* The human readable name of this layout.
*
* @var string
*/
public $label;
/**
* The position weight (not physical) of this layout.
*
* @var int
*/
public $weight;
/**
* The category of this layout.
*
* @var string
*/
public $category;
/**
* The regions of this layout.
*
* @var string
*/
public $regions;
/**
* The default column class.
*
* @var string
*/
public $default_column_class;
/**
* The default row class.
*
* @var string
*/
public $default_row_class;
/**
* {@inheritdoc}
*/
public function getCategory() {
return $this->category;
}
/**
* {@inheritdoc}
*/
public function getDefaultColumnClass() {
return $this->default_column_class;
}
/**
* {@inheritdoc}
*/
public function setDefaultRowClass($default_row_class) {
$this->default_row_class = $default_row_class;
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
if ($rows) {
foreach ($rows as $key => $row) {
$rows[$key][Constants::DEFAULT_ROW_CLASS] = $default_row_class;
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function setDefaultColumnClass($default_column_class) {
$this->default_column_class = $default_column_class;
// Loop over the rows and their columns.
$rows = $this
->getRows();
if ($rows) {
foreach ($rows as $row_key => $row) {
$columns = $row[Constants::COLUMNS];
foreach ($columns as $column_key => $column) {
$rows[$row_key][Constants::COLUMNS][$column_key][Constants::DEFAULT_COLUMN_CLASS] = $default_column_class;
}
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function getDefaultRowClass() {
return $this->default_row_class;
}
/**
* {@inheritdoc}
*/
public function getRegions() {
return $this->regions;
}
/**
* {@inheritdoc}
*/
public function setRowClasses($row_id, array $row_classes) {
$updated_row = $this
->getRowById($row_id);
$updated_row[Constants::CUSTOM_ROW_CLASSES] = $row_classes;
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
if ($row[Constants::ROW_ID] == $row_id) {
$rows[$key] = $updated_row;
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function setCustomColumnClasses($row_id, $column_id, array $column_classes) {
$updated_row = $this
->getRowById($row_id);
$updated_column = $this
->getColumnById($updated_row, $column_id);
$updated_column[Constants::CUSTOM_COLUMN_CLASSES] = $column_classes;
$columns = $updated_row[Constants::COLUMNS];
// Loop over the columns and set the updated column.
foreach ($columns as $key => $column) {
if ($column[Constants::COLUMN_ID] == $column_id) {
$columns[$key] = $updated_column;
}
}
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
if ($row[Constants::ROW_ID] == $row_id) {
$rows[$key][Constants::COLUMNS] = $columns;
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function setColumnName($row_id, $column_id, $column_name) {
$updated_row = $this
->getRowById($row_id);
$columns = $updated_row[Constants::COLUMNS];
// Set the column name.
$updated_column = $this
->getColumnById($updated_row, $column_id);
$updated_column[Constants::COLUMN_NAME] = $column_name;
if (!$column_name) {
$column_name = 'r' . $row_id . 'c' . $column_id;
}
// Convert to machine name.
$region_name = strtolower($column_name);
$region_name = preg_replace('/[^a-z0-9_]+/', '_', $region_name);
$region_name = preg_replace('/_+/', '_', $region_name);
// Set the region name.
$updated_column[Constants::REGION_NAME] = $region_name;
// Loop over the columns and set the updated column.
foreach ($columns as $key => $column) {
if ($column[Constants::COLUMN_ID] == $column_id) {
$columns[$key] = $updated_column;
}
}
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
if ($row[Constants::ROW_ID] == $row_id) {
$rows[$key][Constants::COLUMNS] = $columns;
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function setCustomColumnWidthNumber($row_id, $column_id, $custom_column_width_number) {
$updated_row = $this
->getRowById($row_id);
$updated_column = $this
->getColumnById($updated_row, $column_id);
$updated_column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER] = $custom_column_width_number;
$columns = $updated_row[Constants::COLUMNS];
// Loop over the columns and set the updated column.
foreach ($columns as $key => $column) {
if ($column[Constants::COLUMN_ID] == $column_id) {
$columns[$key] = $updated_column;
}
}
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
if ($row[Constants::ROW_ID] == $row_id) {
$rows[$key][Constants::COLUMNS] = $columns;
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function getRowClasses($row_id) {
$row = $this
->getRowById($row_id);
// Convert to comma separated.
$row_classes = '';
if (is_array($row[Constants::CUSTOM_ROW_CLASSES])) {
$row_classes = implode(', ', $row[Constants::CUSTOM_ROW_CLASSES]);
}
return $row_classes;
}
/**
* {@inheritdoc}
*/
public function getColumnClasses($row_id, $column_id) {
$row = $this
->getRowById($row_id);
$column_classes = '';
$column = $this
->getColumnById($row, $column_id);
// Guarding.
if (!isset($column[Constants::CUSTOM_COLUMN_CLASSES])) {
return $column_classes;
}
if (!is_array($column[Constants::CUSTOM_COLUMN_CLASSES])) {
return $column_classes;
}
return implode(', ', $column[Constants::CUSTOM_COLUMN_CLASSES]);
}
/**
* {@inheritdoc}
*/
public function getColumnName($row_id, $column_id) {
$row = $this
->getRowById($row_id);
$column = $this
->getColumnById($row, $column_id);
return $column[Constants::COLUMN_NAME];
}
/**
* {@inheritdoc}
*/
public function getColumnWidthNumber($row_id, $column_id) {
$row = $this
->getRowById($row_id);
$column = $this
->getColumnById($row, $column_id);
$column_width_number = $column[Constants::COLUMN_WIDTH_NUMBER];
if (isset($column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER])) {
$column_width_number = $column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER];
}
return $column_width_number;
}
/**
* {@inheritdoc}
*/
public function deleteRow($row_id) {
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
if ($row[Constants::ROW_ID] == $row_id) {
unset($rows[$key]);
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function addRow() {
$rows = $this
->getRows();
$column_count = 1;
/** @var \Drupal\dynamic_layouts\DynamicLayoutSettingsInterface $settings */
$last_column_class = '';
$column_width_prefix = '';
if ($settings = \Drupal::entityTypeManager()
->getStorage(Constants::DYNAMIC_LAYOUT_SETTINGS)
->load(Constants::SETTINGS)) {
$column_classes = array_keys($settings
->getFrontendColumnClasses());
$last_column_class = end($column_classes);
$column_width_prefix = $settings
->getColumnPrefix();
}
$row_id = uniqid();
$columns = [];
for ($i = 1; $i <= $column_count; $i++) {
$column_id = uniqid();
$edit_column = $this
->getEditColumnLink($this
->id(), $row_id, $column_id);
$delete_column = $this
->getDeleteColumnLink($this
->id(), $row_id, $column_id);
$columns[] = [
Constants::EDIT_COLUMN => $edit_column,
Constants::DELETE_COLUMN => $delete_column,
Constants::COLUMN_ID => $column_id,
Constants::COLUMN_WIDTH_NUMBER => $last_column_class,
Constants::COLUMN_WIDTH_PREFIX => $column_width_prefix,
Constants::DEFAULT_COLUMN_CLASS => $this->default_column_class,
Constants::CUSTOM_COLUMN_CLASSES => [],
Constants::COLUMN_NAME => '',
Constants::REGION_NAME => 'r' . $row_id . 'c' . $column_id,
Constants::ADMIN_COLUMN_CLASSES => [
Constants::DYNAMIC_LAYOUT_COLUMN,
],
];
}
// Add new row.
$rows[] = [
Constants::ROW_ID => $row_id,
'admin_row_classes' => [
'dynamic-layout-row',
],
Constants::DEFAULT_ROW_CLASS => $this->default_row_class,
Constants::CUSTOM_ROW_CLASSES => [],
Constants::COLUMNS => $columns,
];
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function addStartingRows($general_settings) {
$rows_count = 1;
if (isset($general_settings['start_rows_count'])) {
$rows_count = $general_settings['start_rows_count'];
}
// Set the default column class for the starting rows.
$starting_default_column_class = '';
if (isset($general_settings[Constants::DEFAULT_COLUMN_CLASS]) && $general_settings[Constants::DEFAULT_COLUMN_CLASS]) {
$starting_default_column_class = \trim($general_settings[Constants::DEFAULT_COLUMN_CLASS]);
$this->default_column_class = $starting_default_column_class;
}
// Set the default row class for the starting rows.
$starting_default_row_class = '';
if (isset($general_settings[Constants::DEFAULT_ROW_CLASS]) && $general_settings[Constants::DEFAULT_ROW_CLASS]) {
$starting_default_row_class = \trim($general_settings[Constants::DEFAULT_ROW_CLASS]);
$this->default_row_class = $starting_default_row_class;
}
/** @var \Drupal\dynamic_layouts\DynamicLayoutSettingsInterface $settings */
$last_column_class = '';
$column_width_prefix = '';
if ($settings = \Drupal::entityTypeManager()
->getStorage(Constants::DYNAMIC_LAYOUT_SETTINGS)
->load(Constants::SETTINGS)) {
$column_width_prefix = $settings
->getColumnPrefix();
$column_classes = array_keys($settings
->getFrontendColumnClasses());
$last_column_class = end($column_classes);
}
// Add new rows.
$rows = [];
for ($i = 1; $i <= $rows_count; $i++) {
$row_id = uniqid();
$column_id = uniqid();
$columns = [];
$edit_column = $this
->getEditColumnLink($this
->id(), $row_id, $column_id);
$delete_column = $this
->getDeleteColumnLink($this
->id(), $row_id, $column_id);
$columns[] = [
Constants::EDIT_COLUMN => $edit_column,
Constants::DELETE_COLUMN => $delete_column,
Constants::COLUMN_ID => $column_id,
Constants::COLUMN_WIDTH_NUMBER => $last_column_class,
Constants::COLUMN_WIDTH_PREFIX => $column_width_prefix,
Constants::DEFAULT_COLUMN_CLASS => $starting_default_column_class,
Constants::CUSTOM_COLUMN_CLASSES => [],
Constants::COLUMN_NAME => '',
Constants::REGION_NAME => 'r' . $row_id . 'c' . $column_id,
Constants::ADMIN_COLUMN_CLASSES => [
Constants::DYNAMIC_LAYOUT_COLUMN,
],
];
$rows[] = [
Constants::ROW_ID => $row_id,
Constants::DEFAULT_ROW_CLASS => $starting_default_row_class,
'admin_row_classes' => [
'dynamic-layout-row',
],
Constants::CUSTOM_ROW_CLASSES => [],
Constants::COLUMNS => $columns,
];
}
$this->regions = serialize($rows);
$this
->save();
}
/**
* {@inheritdoc}
*/
private function getDeleteColumnLink($entity_id, $row_id, $column_id) {
$delete_column_url = Url::fromRoute('dynamic_layouts.delete_column', [
Constants::COLUMN_ID => $column_id,
'dynamic_layout_id' => $entity_id,
Constants::ROW_ID => $row_id,
]);
$title = t('Delete column');
$link_options = [
'attributes' => [
'class' => [
'delete-link',
'btn',
'use-ajax',
],
'title' => $title,
],
];
$delete_column_url
->setOptions($link_options);
$delete_column_link = Link::fromTextAndUrl($title, $delete_column_url);
$delete_column = $delete_column_link
->toRenderable();
return render($delete_column);
}
/**
* {@inheritdoc}
*/
private function getEditColumnLink($entity_id, $row_id, $column_id) {
$edit_column_url = Url::fromRoute('dynamic_layouts.edit_column_modal_form', [
Constants::COLUMN_ID => $column_id,
'entity_id' => $entity_id,
Constants::ROW_ID => $row_id,
]);
$title = t('Edit column');
$link_options = [
'attributes' => [
'class' => [
'edit-link',
'btn',
'use-ajax',
],
'title' => $title,
],
];
$edit_column_url
->setOptions($link_options);
$edit_column_link = Link::fromTextAndUrl($title, $edit_column_url);
$edit_column = $edit_column_link
->toRenderable();
return render($edit_column);
}
/**
* Render a link to add a column to a row.
*
* @param int $row_id
* The specific row id.
* @param string $route
* The route we need to render the link to.
* @param string $text
* The text we want to render in the link.
* @param array $options
* Give options to the link.
*
* @return string
* The rendered link.
*/
public function getRowLink($row_id, $route, $text, array $options = []) {
$link = Link::createFromRoute($text, $route, [
'dynamic_layout_id' => $this
->id(),
Constants::ROW_ID => $row_id,
], $options);
$renderLink = $link
->toRenderable();
return render($renderLink);
}
/**
* {@inheritdoc}
*/
public function deleteColumn($row_id, $column_id) {
$updated_row = $this
->getRowById($row_id);
$columns = $updated_row[Constants::COLUMNS];
/** @var \Drupal\dynamic_layouts\DynamicLayoutSettingsInterface $settings */
$calculated_column_width_number = NULL;
if ($settings = \Drupal::entityTypeManager()
->getStorage(Constants::DYNAMIC_LAYOUT_SETTINGS)
->load(Constants::SETTINGS)) {
$calculated_column_width_number = $this
->calculateColumnWidth($columns, $settings, 'deleted');
}
// Loop over the columns and set the updated column.
foreach ($columns as $key => $column) {
if ($column[Constants::COLUMN_ID] == $column_id) {
unset($columns[$key]);
continue;
}
if ($calculated_column_width_number && !isset($column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER])) {
$columns[$key][Constants::COLUMN_WIDTH_NUMBER] = $calculated_column_width_number;
}
}
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
if ($row[Constants::ROW_ID] == $row_id) {
$rows[$key][Constants::COLUMNS] = $columns;
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
public function addColumn($row_id) {
$updated_row = $this
->getRowById($row_id);
$columns = $updated_row[Constants::COLUMNS];
$column_id = uniqid();
$column_width_number = '';
$edit_column = $this
->getEditColumnLink($this
->id(), $row_id, $column_id);
$delete_column = $this
->getDeleteColumnLink($this
->id(), $row_id, $column_id);
/** @var \Drupal\dynamic_layouts\DynamicLayoutSettingsInterface $settings */
$column_width_prefix = '';
if ($settings = \Drupal::entityTypeManager()
->getStorage(Constants::DYNAMIC_LAYOUT_SETTINGS)
->load(Constants::SETTINGS)) {
$column_classes = $settings
->getFrontendColumnClasses();
$column_width_number = end($column_classes);
$column_width_prefix = $settings
->getColumnPrefix();
if ($calculated_column_width_number = $this
->calculateColumnWidth($columns, $settings, 'added')) {
$column_width_number = $calculated_column_width_number;
// Give each column this column width number.
foreach ($columns as $key => $column) {
if (!isset($column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER])) {
$columns[$key][Constants::COLUMN_WIDTH_NUMBER] = $calculated_column_width_number;
}
}
}
}
$columns[] = [
Constants::EDIT_COLUMN => $edit_column,
Constants::DELETE_COLUMN => $delete_column,
Constants::COLUMN_ID => $column_id,
Constants::COLUMN_WIDTH_NUMBER => $column_width_number,
Constants::COLUMN_WIDTH_PREFIX => $column_width_prefix,
Constants::DEFAULT_COLUMN_CLASS => $this->default_column_class,
Constants::CUSTOM_COLUMN_CLASSES => [],
Constants::COLUMN_NAME => '',
Constants::REGION_NAME => 'r' . $row_id . 'c' . $column_id,
Constants::ADMIN_COLUMN_CLASSES => [
Constants::DYNAMIC_LAYOUT_COLUMN,
],
];
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
if ($row[Constants::ROW_ID] == $row_id) {
$rows[$key][Constants::COLUMNS] = $columns;
}
}
$this->regions = serialize($rows);
}
/**
* {@inheritdoc}
*/
private function calculateColumnWidth($columns, DynamicLayoutSettingsInterface $settings, $action) {
if (!$settings) {
return NULL;
}
if (!$columns) {
return NULL;
}
// Count the column's that dont have a custom column width number.
$column_counter = 0;
foreach ($columns as $column) {
if (!isset($column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER])) {
$column_counter++;
}
}
// Get the frontend library & column count and add/remove 1.
$column_count = $column_counter + 1;
if ($action == 'deleted') {
$column_count = $column_counter - 1;
}
// Convert to integer, just to be sure.
$grid_column_count = \intval($settings
->getGridColumnCount());
// Divide the column count by grid column count.
return \round($grid_column_count / $column_count);
}
/**
* {@inheritdoc}
*/
public function getRows() {
return unserialize($this->regions);
}
/**
* {@inheritdoc}
*/
public function getLayoutRegions() {
$rows = $this
->getRows();
// Loop over the rows to gather the layout regions.
$layout_regions = [];
$row_count = 1;
foreach ($rows as $row) {
// Check if we have columns.
if (!isset($row[Constants::ROW_ID]) || !isset($row[Constants::COLUMNS])) {
continue;
}
// Loop over the columns from this row.
$column_count = 1;
foreach ($row[Constants::COLUMNS] as $column) {
$region_name = t('Row @row_count - Column @column_count', [
'@row_count' => $row_count,
'@column_count' => $column_count,
]);
$region_machine_name = 'r' . $row[Constants::ROW_ID] . 'c' . $column[Constants::COLUMN_ID];
if (isset($column[Constants::COLUMN_NAME]) && $column[Constants::COLUMN_NAME]) {
$region_name = $column[Constants::COLUMN_NAME];
// Convert to machine name.
$region_machine_name = strtolower($region_name);
$region_machine_name = preg_replace('/[^a-z0-9_]+/', '_', $region_machine_name);
$region_machine_name = preg_replace('/_+/', '_', $region_machine_name);
// Overwrite if we have a region name.
if (isset($column[Constants::REGION_NAME]) && $column[Constants::REGION_NAME]) {
$region_machine_name = $column[Constants::REGION_NAME];
}
}
$layout_regions[$region_machine_name] = [
'label' => $region_name,
];
$column_count++;
}
$row_count++;
}
return $layout_regions;
}
/**
* {@inheritdoc}
*/
private function getRowById($row_id) {
$rows = $this
->getRows();
$row_by_number = [];
// Loop over the rows.
foreach ($rows as $row) {
if ($row[Constants::ROW_ID] === $row_id) {
$row_by_number = $row;
}
}
return $row_by_number;
}
/**
* {@inheritdoc}
*/
private function getColumnById($row, $column_id) {
$column_by_id = [];
// Loop over the row columns.
foreach ($row[Constants::COLUMNS] as $column) {
if ($column[Constants::COLUMN_ID] === $column_id) {
$column_by_id = $column;
}
}
return $column_by_id;
}
/**
* {@inheritdoc}
*/
public function getIconMap() {
$icon_map = [];
$rows = $this
->getRows();
foreach ($rows as $key => $row) {
$icon_map[$key] = [];
if (isset($row[Constants::COLUMNS]) && !empty(Constants::COLUMNS)) {
$columns = $row[Constants::COLUMNS];
foreach ($columns as $column) {
$column_width_number = $column[Constants::COLUMN_WIDTH_NUMBER];
if (isset($column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER]) && !empty($column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER])) {
$column_width_number = $column[Constants::CUSTOM_COLUMN_WIDTH_NUMBER];
}
for ($i = 1; $i <= $column_width_number; $i++) {
$icon_map[$key][] = $column[Constants::COLUMN_ID];
}
}
}
}
return array_values($icon_map);
}
}
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 |
Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityInterface:: |
13 |
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:: |
protected static | function |
Override to never invalidate the individual entities' cache tags; the
config system already invalidates them. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected | function |
Override to never invalidate the entity's cache tag; the config system
already invalidates it. Overrides EntityBase:: |
|
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 | function |
Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface:: |
7 |
ConfigEntityBase:: |
public static | function |
Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase:: |
8 |
ConfigEntityBase:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides EntityBase:: |
13 |
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 | |
DynamicLayout:: |
public | property | The category of this layout. | |
DynamicLayout:: |
public | property | The default column class. | |
DynamicLayout:: |
public | property | The default row class. | |
DynamicLayout:: |
public | property | The layout machine name. | |
DynamicLayout:: |
public | property | The human readable name of this layout. | |
DynamicLayout:: |
public | property | The regions of this layout. | |
DynamicLayout:: |
public | property | The position weight (not physical) of this layout. | |
DynamicLayout:: |
public | function |
Add a column to a row. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Add a row to the layout. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Add multiple rows to the layout. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
private | function | ||
DynamicLayout:: |
public | function |
Delete a specific column from the layout. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Delete a specific row from the layout. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Get the layout category. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
private | function | ||
DynamicLayout:: |
public | function |
Get the layout column classes, comma separated. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Get the layout column name. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Set the column width number. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Get the default column class. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Get the default row class. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
private | function | ||
DynamicLayout:: |
private | function | ||
DynamicLayout:: |
public | function |
Get the icon map for this layout. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Get all layout regions. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Get the layout regions. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
private | function | ||
DynamicLayout:: |
public | function |
Get the layout row classes, comma separated. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function | Render a link to add a column to a row. | |
DynamicLayout:: |
public | function |
Get the unserialized rows. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Set the layout column classes. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Set the layout column classes. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Set the custom column width number. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Set the default column class. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Set the default row class. Overrides DynamicLayoutInterface:: |
|
DynamicLayout:: |
public | function |
Set the layout row classes. Overrides DynamicLayoutInterface:: |
|
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:: |
protected | function | Gets an array of placeholders for this entity. | 2 |
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 | ||
SynchronizableEntityTrait:: |
protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
SynchronizableEntityTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
public | function |