Documentation

CatalogItem extends ContentEntityBase
in package
implements CatalogItemInterface

Defines the catalog item entity class.

Attributes
#[ContentEntityType]
$id: 'catalog_item'
$label: new \Drupal\Core\StringTranslation\TranslatableMarkup('Catalog Item')
$label_collection: new \Drupal\Core\StringTranslation\TranslatableMarkup('Catalog Items')
$label_singular: new \Drupal\Core\StringTranslation\TranslatableMarkup('catalog item')
$label_plural: new \Drupal\Core\StringTranslation\TranslatableMarkup('catalog items')
$constraints: ["SerialNumberUniqueInCollection" => [], "IsbnUniqueAcrossCollections" => [], "ConsumableConstraintValidator" => []]
$entity_keys: ['id' => 'imcid', 'bundle' => 'type', 'label' => 'label', 'uuid' => 'uuid']
$handlers: ['list_builder' => \Drupal\ilms_catalog\CatalogItemListBuilder::class, 'views_data' => \Drupal\views\EntityViewsData::class, 'view_builder' => \Drupal\Core\Entity\EntityViewBuilder::class, 'form' => ['add' => \Drupal\ilms_catalog\Form\CatalogItemForm::class, 'edit' => \Drupal\ilms_catalog\Form\CatalogItemForm::class, 'delete' => \Drupal\ilms_catalog\Form\CatalogItemDeleteForm::class], 'route_provider' => ['html' => \Drupal\ilms_catalog\Routing\CatalogItemHtmlRouteProvider::class]]
$links: ['add-form' => '/admin/ilms/catalog/{catalog_item_type}/add', 'add-page' => '/admin/ilms/catalog/add', 'canonical' => '/admin/ilms/catalog/{catalog_item_type}/{catalog_item}', 'edit-form' => '/admin/ilms/catalog/{catalog_item_type}/{catalog_item}', 'delete-form' => '/admin/ilms/catalog/{catalog_item_type}/{catalog_item}/delete']
$admin_permission: 'access catalog'
$bundle_entity_type: 'catalog_item_type'
$bundle_label: new \Drupal\Core\StringTranslation\TranslatableMarkup('Catalog Item type')
$base_table: 'catalog_item'
$label_count: ['singular' => '@count catalog items', 'plural' => '@count catalog items']
$field_ui_base_route: 'entity.catalog_item_type.edit_form'

Table of Contents

Interfaces

CatalogItemInterface
Provides an interface defining a catalog item entity type.

Methods

baseFieldDefinitions()  : array<string|int, mixed>
{@inheritdoc}
getParent()  : Entity|null
Returns the parent of the catalog item.
isCatalogItem()  : bool
Method to determine if this entity has configurable fields.
isParent()  : bool
Returns if the catalog item is a parent or not.
postSave()  : mixed
Implements Entity::postSave().
urlRouteParameters()  : mixed
{@inheritdoc}

Methods

baseFieldDefinitions()

{@inheritdoc}

public static baseFieldDefinitions(EntityTypeInterface $entity_type) : array<string|int, mixed>
Parameters
$entity_type : EntityTypeInterface
Return values
array<string|int, mixed>

getParent()

Returns the parent of the catalog item.

public getParent() : Entity|null
Return values
Entity|null

Returns the parent entity or NULL if no parent exists.

isCatalogItem()

Method to determine if this entity has configurable fields.

public static isCatalogItem() : bool
Return values
bool

Should return TRUE if this item should generate a link on the Field Configuration page, or FALSE if not.

isParent()

Returns if the catalog item is a parent or not.

public isParent() : bool
Return values
bool

Boolean value determining if the entity is a parent or not.

postSave()

Implements Entity::postSave().

public postSave(EntityStorageInterface $storage[, mixed $update = true ]) : mixed

Method to update child entities based on the parent entities values when it's saved.

This method will sync the shared fields of the parent with the children in the collection.

Parameters
$storage : EntityStorageInterface
$update : mixed = true

urlRouteParameters()

{@inheritdoc}

public urlRouteParameters(mixed $rel) : mixed
Parameters
$rel : mixed

        
On this page

Search results