trait MaskEntityTrait

Same name and namespace in other branches
  1. 8.x-3.x modules/ctools_entity_mask/src/MaskEntityTrait.php \Drupal\ctools_entity_mask\MaskEntityTrait

Provides common functionality for mask entities.

Hierarchy

1 file declares its use of MaskEntityTrait
BlockContent.php in modules/ctools_entity_mask/tests/modules/entity_mask_test/src/Entity/BlockContent.php

File

modules/ctools_entity_mask/src/MaskEntityTrait.php, line 8

Namespace

Drupal\ctools_entity_mask
View source
trait MaskEntityTrait {
  
  /**
   * Implements \Drupal\Core\Entity\EntityInterface::id().
   *
   * Mask entities are generally not saved to the database like standard content
   * entities, so it cannot be assumed that they will have a serial ID at any
   * point in their lives. However, Drupal still expects all entities to have an
   * identifier of some kind, so this dual-purposes the UUID as the canonical
   * entity ID. (It would be nice if core did this as a rule for all entities
   * and stopped using serial IDs, but, y'know, baby steps.)
   *
   * @return string
   *   Returns the UUID of the Entity.
   */
  public function id() {
    return $this->uuid();
  }

}

Members

Title Sort descending Modifiers Object type Summary
MaskEntityTrait::id public function Implements \Drupal\Core\Entity\EntityInterface::id().