You are here

abstract class FieldableEdgeEntityBase in Apigee Edge 8

Base field support for Apigee Entities without making them content entities.

We borrowed some goodies from Drupal\Core\Entity\ContentEntityBase here, but only what was really necessary.

Hierarchy

Expanded class hierarchy of FieldableEdgeEntityBase

See also

\Drupal\Core\Entity\ContentEntityBase

File

src/Entity/FieldableEdgeEntityBase.php, line 38

Namespace

Drupal\apigee_edge\Entity
View source
abstract class FieldableEdgeEntityBase extends EdgeEntityBase implements FieldableEdgeEntityInterface {

  // The majority of Drupal core & contrib assumes that if an entity is
  // fieldable then it must be a content entity and because it is content entity
  // it also must support revisioning. This incorrect assumption justifies the
  // reason why this is here.
  use RevisioningWorkaroundTrait;

  /**
   * Whether entity validation is required before saving the entity.
   *
   * @var bool
   */
  protected $validationRequired = FALSE;

  /**
   * Local cache for field definitions.
   *
   * @var array|null
   *
   * @see \Drupal\apigee_edge\Entity\FieldableEdgeEntityBase::getFieldDefinitions()
   */
  protected $fieldDefinitions;

  /**
   * Local cache for for fields.
   *
   * @var \Drupal\Core\Field\FieldItemListInterface[]
   *
   * @see \Drupal\apigee_edge\Entity\FieldableEdgeEntityBase::get()
   */
  protected $fields = [];

  /**
   * Whether entity validation was performed.
   *
   * @var bool
   */
  protected $validated = FALSE;

  /**
   * {@inheritdoc}
   */
  public function __sleep() {
    $this->fields = [];
    $this->fieldDefinitions = NULL;
    return parent::__sleep();
  }

  /**
   * {@inheritdoc}
   */
  public static function bundleFieldDefinitions(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $definitions = [];

    // Expose non-blacklisted properties from decorated
    // entity object as base fields by default.
    foreach (static::getProperties() as $name => $type) {
      if ($definition = static::getBaseFieldDefinition($name, $type)) {
        $definitions[$name] = $definition;
      }
    }
    return $definitions;
  }

  /**
   * Parses the properties and its types from the parent class.
   *
   * @return array
   *   The key is the property name, the value is its type, declared in the
   *   docblocks.
   */
  protected static function getProperties() : array {
    $props = [];
    try {
      $rc = new \ReflectionClass(static::decoratedClass());
      foreach ($rc
        ->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {

        // This is not a property getter rather a utility function.
        if ($method
          ->getNumberOfParameters() > 0) {
          continue;
        }

        // Find property getters on decorated PHP API Client entity classes.
        if (strpos($method
          ->getName(), 'get') === 0) {
          $property = lcfirst(substr($method
            ->getName(), 3));
        }
        elseif (strpos($method
          ->getName(), 'is') === 0) {
          $property = lcfirst(substr($method
            ->getName(), 2));
        }
        else {
          continue;
        }
        if (static::exposePropertyAsBaseField($property)) {
          continue;
        }
        $props[$property] = static::propertyFieldType($property);
      }
    } catch (\ReflectionException $e) {
    }
    return $props;
  }

  /**
   * Array of properties that should not be exposed as base fields by default.
   *
   * @return string[]
   *   Array with property names.
   */
  protected static function propertyToBaseFieldBlackList() : array {
    return [
      // We expose each attribute as a field.
      'attributes',
      // Do not expose the organization user (used in Drupal) who created the
      // entity. (These properties are generally available on Management API
      // entities this is the reason why we blacklisted them in this base
      // class).
      'createdBy',
      'lastModifiedBy',
    ];
  }

  /**
   * Returns whether an entity property is blacklisted to be exposed as field.
   *
   * @param string $property
   *   Property name.
   *
   * @return bool
   *   TRUE if it is blacklisted, FALSE otherwise.
   */
  private static function exposePropertyAsBaseField(string $property) : bool {
    return in_array($property, static::propertyToBaseFieldBlackList());
  }

  /**
   * Static mapping between entity properties and Drupal field types.
   *
   * @return array
   *   An associative array where keys are entity properties and values are
   *   destination Drupal field types.
   */
  protected static function propertyToBaseFieldTypeMap() : array {
    return [
      // We do not want Drupal to apply default values
      // on these properties if they are empty therefore their field type is
      // a simple "timestamp" instead of "created" or "changed".
      // (These properties are generally available on Management API
      // entities this is the reason why we defined them in this base
      // class).
      'createdAt' => 'timestamp',
      'lastModifiedAt' => 'timestamp',
    ];
  }

  /**
   * Returns the type of the field that should represent an entity property.
   *
   * @param string $property
   *   Property name.
   *
   * @return string
   *   Type of the field that should represent an entity property.
   *   Default is string.
   */
  private static function propertyFieldType(string $property) : string {
    return array_key_exists($property, static::propertyToBaseFieldTypeMap()) ? static::propertyToBaseFieldTypeMap()[$property] : 'string';
  }

  /**
   * Attempts to create a base field definition from a type.
   *
   * @param string $name
   *   Name of the base field.
   * @param string $type
   *   Type of the property.
   *
   * @return \Drupal\Core\Field\BaseFieldDefinition|null
   *   Base field definition if found, null otherwise.
   */
  protected static function getBaseFieldDefinition(string $name, string $type) : ?BaseFieldDefinition {
    $label = ucwords(preg_replace('/([a-z])([A-Z])/', '$1 $2', $name));
    $is_array = strpos($type, 'list_') === 0;
    try {
      $definition = BaseFieldDefinition::create($type);
    } catch (\Exception $ex) {

      // Type not found.
      return NULL;
    }
    $definition
      ->setLabel(t($label));
    $definition
      ->setCardinality($is_array ? FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED : 1);
    $definition
      ->setTranslatable(FALSE);
    $definition
      ->setDisplayConfigurable('view', TRUE);
    $definition
      ->setDisplayConfigurable('form', TRUE);
    return $definition;
  }

  /**
   * {@inheritdoc}
   */
  public function get($field_name) {
    if (!isset($this->fields[$field_name])) {
      $value = $this
        ->getFieldValue($field_name);

      // Here field name equals the property name.
      if ($value !== NULL) {

        // Fix field value of a timestamp property field.
        if (static::propertyFieldType($field_name) === 'timestamp') {
          if (is_array($value)) {
            $value = array_map(function ($item) {

              /** @var \DateTimeImmutable $item */
              return $item
                ->getTimestamp();
            }, $value);
          }
          else {

            /** @var \DateTimeImmutable $value */
            $value = $value
              ->getTimestamp();
          }
        }
      }

      // Based on \Drupal\Core\Entity\ContentEntityBase::getTranslatedField().

      /** @var \Drupal\Core\Field\FieldTypePluginManagerInterface $manager */
      $manager = \Drupal::service('plugin.manager.field.field_type');
      $this->fields[$field_name] = $manager
        ->createFieldItemList($this, $field_name, $value);
    }
    return $this->fields[$field_name];
  }

  /**
   * Returns the field value from the current object.
   *
   * @param string $field_name
   *   Machine name of a field.
   *
   * @return mixed|null
   *   Value of a field from current object, or null if it does exits.
   */
  protected function getFieldValue(string $field_name) {

    // We call the getters on the current object instead of the decorated one
    // because they can return the correct information.
    // Because the current object implements the interface of the decorated
    // object there should be any getter on the decorated object that does not
    // have a decorator in the current class (that potentially also calls to the
    // decorated getter method under the hood.)
    foreach ([
      'get',
      'is',
    ] as $prefix) {
      $getter = $prefix . ucfirst($field_name);
      if (method_exists($this, $getter)) {
        return call_user_func([
          $this,
          $getter,
        ]);
      }
    }
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getFieldDefinition($name) {
    if (!isset($this->fieldDefinitions)) {
      $this
        ->getFieldDefinitions();
    }
    if (isset($this->fieldDefinitions[$name])) {
      return $this->fieldDefinitions[$name];
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getFieldDefinitions() {
    if (!isset($this->fieldDefinitions)) {
      $this->fieldDefinitions = \Drupal::service('entity_field.manager')
        ->getFieldDefinitions($this->entityTypeId, $this
        ->bundle());
    }
    return $this->fieldDefinitions;
  }

  /**
   * {@inheritdoc}
   */
  public function getFields($include_computed = TRUE) {
    $fields = [];
    foreach ($this
      ->getFieldDefinitions() as $name => $definition) {
      if ($include_computed || !$definition
        ->isComputed()) {
        $fields[$name] = $this
          ->get($name);
      }
    }
    return $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function getTranslatableFields($include_computed = TRUE) {
    $fields = [];
    foreach ($this
      ->getFieldDefinitions() as $name => $definition) {
      if (($include_computed || !$definition
        ->isComputed()) && $definition
        ->isTranslatable()) {
        $fields[$name] = $this
          ->get($name);
      }
    }
    return $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function hasField($field_name) {
    return (bool) $this
      ->getFieldDefinition($field_name);
  }

  /**
   * {@inheritdoc}
   */
  public function validate() {
    $this->validated = TRUE;
    $violations = $this
      ->getTypedData()
      ->validate();
    return new EntityConstraintViolationList($this, iterator_to_array($violations));
  }

  /**
   * {@inheritdoc}
   */
  public function isValidationRequired() {
    return $this->validationRequired;
  }

  /**
   * {@inheritdoc}
   */
  public function setValidationRequired($required) {
    $this->validationRequired = $required;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function onChange($field_name) {
    $value = $this
      ->convertFieldValueToPropertyValue($field_name);

    // Save field's value to the its related property (if there is one).
    try {
      $this
        ->setPropertyValue($field_name, $value);
    } catch (InvalidArgumentException $e) {

      // Property not found, which could be fine.
    }
  }

  /**
   * Converts a field value to a property value.
   *
   * @param string $field_name
   *   Name of a field.
   *
   * @return mixed
   *   Value of a property.
   */
  protected function convertFieldValueToPropertyValue(string $field_name) {

    /** @var \Drupal\Core\Field\FieldDefinitionInterface $definition */
    $definition = $this
      ->getFieldDefinition($field_name);
    if ($definition
      ->getFieldStorageDefinition()
      ->getCardinality() === 1) {
      $value = $this
        ->get($field_name)->value;
    }
    else {

      // Extract values from multi-value fields the right way. Magic getter
      // would just return the first item from the list.
      // @see \Drupal\Core\Field\FieldItemList::__get()
      $value = [];
      foreach ($this
        ->get($field_name) as $index => $item) {
        $value[$index] = $item->value;
      }
    }

    // Take care of timestamp fields that value in the SDK is a
    // date object.
    if (static::propertyFieldType($field_name) === 'timestamp') {

      /** @var \DateTimeImmutable $value */
      $value = \DateTimeImmutable::createFromFormat('U', $value);
    }
    return $value;
  }

  /**
   * {@inheritdoc}
   */
  public function set($field_name, $value, $notify = TRUE) {

    // Do not try to set value of a field that does not exist.
    if (!$this
      ->hasField($field_name)) {

      // According to spec an exception should be thrown in this case.
      throw new InvalidArgumentException(sprintf('"%s" field does not exist on "s" entity.', $field_name, get_class($this)));
    }

    // Value that is compatible with what a mapped base field can accept.
    $field_value = $value;
    if (is_object($value)) {

      // Take care of timestamp fields that value from the SDK is a
      // date object.
      if (static::propertyFieldType($field_name) === 'timestamp') {

        /** @var \DateTimeImmutable $value */
        $field_value = $value
          ->getTimestamp();
      }
      else {
        $field_value = (string) $value;
      }
    }

    // Save field's value as a field. This calls onChange() that saves
    // field value to the related property.
    $this
      ->get($field_name)
      ->setValue($field_value, $notify);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setPropertyValue(string $field_name, $value) : void {

    // Ignore NULL values, because those are not supported by setters of
    // the SDK entities.
    if ($value === NULL) {
      return;
    }

    // We try to call the setter on the current object first,
    // because it can take care of extra things not just updating the values
    // on the decorated SDK entity.
    $setter = 'set' . ucfirst($field_name);
    $destination = NULL;
    if (method_exists($this, $setter)) {
      $destination = $this;
    }
    elseif (method_exists($this->decorated, $setter)) {
      $destination = $this->decorated;
    }
    if ($destination) {
      try {
        $destination
          ->{$setter}($value);
      } catch (\TypeError $error) {

        // Auto-retry, pass the value as variable-length arguments.
        // Ignore empty variable list.
        if (is_array($value)) {

          // Clear the value of the property.
          if (empty($value)) {
            $destination
              ->{$setter}();
          }
          else {
            $destination
              ->{$setter}(...$value);
          }
        }
        else {
          throw $error;
        }
      }
    }
    else {
      throw new InvalidArgumentException("Property with %s name not found.");
    }
  }

  /**
   * {@inheritdoc}
   */
  public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);

    // Cleans stale data from the field instance cache.
    // If edge updates a property, then the updated property won't be copied
    // into the field instance cache.
    $this->fields = [];
  }

  /**
   * {@inheritdoc}
   */
  public function toArray() {
    $values = [];
    foreach ($this
      ->getFields() as $name => $property) {
      $values[$name] = $property
        ->getValue();
    }
    return $values;
  }

  /**
   * {@inheritdoc}
   */
  public function getIterator() {
    return new \ArrayIterator($this
      ->getFields());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 1
DependencySerializationTrait::__wakeup public function 2
EdgeEntityBase::$decorated protected property The decorated SDK entity. 2
EdgeEntityBase::createFrom public static function Creates a Drupal entity from an SDK Entity. Overrides EdgeEntityInterface::createFrom
EdgeEntityBase::decorated public function Returns the decorated SDK entity. Overrides EdgeEntityInterface::decorated 2
EdgeEntityBase::decoratedClass abstract protected static function The FQCN of the decorated class from the PHP API Client. 5
EdgeEntityBase::drupalEntityId abstract protected function Return the entity id used in Drupal. 4
EdgeEntityBase::getTranslation public function
EdgeEntityBase::hasTranslation public function
EdgeEntityBase::id public function We have to override this to make it compatible with the SDK's entity interface that enforces the return type. Overrides EntityBase::id 5
EdgeEntityBase::isTranslatable public function
EdgeEntityBase::label public function Gets the label of the entity. Overrides EntityBase::label 2
EdgeEntityBase::uniqueIdProperties public static function Returns all unique ids how an entity can be referenced in Apigee Edge. Overrides EdgeEntityInterface::uniqueIdProperties 2
EdgeEntityBase::uniqueIds public function List of unique ids how an entity can be referenced in Apigee Edge. Overrides EdgeEntityInterface::uniqueIds
EdgeEntityBase::__construct public function EdgeEntityBase constructor. Overrides EntityBase::__construct 3
EntityBase::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
EntityBase::$entityTypeId protected property The entity type.
EntityBase::$typedData protected property A typed data object wrapping this entity.
EntityBase::access public function Checks data value access. Overrides AccessibleInterface::access 1
EntityBase::bundle public function Gets the bundle of the entity. Overrides EntityInterface::bundle 1
EntityBase::create public static function Constructs a new entity object, without permanently saving it. Overrides EntityInterface::create
EntityBase::createDuplicate public function Creates a duplicate of the entity. Overrides EntityInterface::createDuplicate 2
EntityBase::delete public function Deletes an entity permanently. Overrides EntityInterface::delete 2
EntityBase::enforceIsNew public function Enforces an entity to be new. Overrides EntityInterface::enforceIsNew
EntityBase::entityManager Deprecated protected function Gets the entity manager.
EntityBase::entityTypeBundleInfo protected function Gets the entity type bundle info service.
EntityBase::entityTypeManager protected function Gets the entity type manager.
EntityBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyTrait::getCacheContexts
EntityBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyTrait::getCacheMaxAge
EntityBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyTrait::getCacheTags
EntityBase::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides EntityInterface::getCacheTagsToInvalidate 2
EntityBase::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityInterface::getConfigDependencyKey
EntityBase::getConfigDependencyName public function Gets the configuration dependency name. Overrides EntityInterface::getConfigDependencyName 1
EntityBase::getConfigTarget public function Gets the configuration target identifier for the entity. Overrides EntityInterface::getConfigTarget 1
EntityBase::getEntityType public function Gets the entity type definition. Overrides EntityInterface::getEntityType
EntityBase::getEntityTypeId public function Gets the ID of the type of the entity. Overrides EntityInterface::getEntityTypeId
EntityBase::getListCacheTagsToInvalidate protected function The list cache tags to invalidate for this entity.
EntityBase::getOriginalId public function Gets the original ID. Overrides EntityInterface::getOriginalId 1
EntityBase::getTypedData public function Gets a typed data object for this entity object. Overrides EntityInterface::getTypedData
EntityBase::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityInterface::hasLinkTemplate
EntityBase::invalidateTagsOnDelete protected static function Invalidates an entity's cache tags upon delete. 1
EntityBase::invalidateTagsOnSave protected function Invalidates an entity's cache tags upon save. 1
EntityBase::isNew public function Determines whether the entity is new. Overrides EntityInterface::isNew 2
EntityBase::language public function Gets the language of the entity. Overrides EntityInterface::language 1
EntityBase::languageManager protected function Gets the language manager.
EntityBase::link public function Deprecated way of generating a link to the entity. See toLink(). Overrides EntityInterface::link 1
EntityBase::linkTemplates protected function Gets an array link templates. 1
EntityBase::load public static function Loads an entity. Overrides EntityInterface::load
EntityBase::loadMultiple public static function Loads one or more entities. Overrides EntityInterface::loadMultiple
EntityBase::postCreate public function Acts on a created entity before hooks are invoked. Overrides EntityInterface::postCreate 4
EntityBase::postDelete public static function Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface::postDelete 16
EntityBase::postLoad public static function Acts on loaded entities. Overrides EntityInterface::postLoad 2
EntityBase::preCreate public static function Changes the values of an entity before it is created. Overrides EntityInterface::preCreate 5
EntityBase::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides EntityInterface::preDelete 4
EntityBase::preSave public function Acts on an entity before the presave hook is invoked. Overrides EntityInterface::preSave 2
EntityBase::referencedEntities public function Gets a list of entities referenced by this entity. Overrides EntityInterface::referencedEntities 1
EntityBase::save public function Saves an entity permanently. Overrides EntityInterface::save 3
EntityBase::setOriginalId public function Sets the original ID. Overrides EntityInterface::setOriginalId 1
EntityBase::toLink public function Generates the HTML for a link to this entity. Overrides EntityInterface::toLink
EntityBase::toUrl public function Gets the URL object for the entity. Overrides EntityInterface::toUrl 2
EntityBase::uriRelationships public function Gets a list of URI relationships supported by this entity. Overrides EntityInterface::uriRelationships
EntityBase::url public function Gets the public URL for this entity. Overrides EntityInterface::url 2
EntityBase::urlInfo public function Gets the URL object for the entity. Overrides EntityInterface::urlInfo 1
EntityBase::urlRouteParameters protected function Gets an array of placeholders for this entity. 2
EntityBase::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface::uuid 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
FieldableEdgeEntityBase::$fieldDefinitions protected property Local cache for field definitions.
FieldableEdgeEntityBase::$fields protected property Local cache for for fields.
FieldableEdgeEntityBase::$validated protected property Whether entity validation was performed.
FieldableEdgeEntityBase::$validationRequired protected property Whether entity validation is required before saving the entity.
FieldableEdgeEntityBase::baseFieldDefinitions public static function Provides base field definitions for an entity type. Overrides FieldableEntityInterface::baseFieldDefinitions 2
FieldableEdgeEntityBase::bundleFieldDefinitions public static function Provides field definitions for a specific bundle. Overrides FieldableEntityInterface::bundleFieldDefinitions
FieldableEdgeEntityBase::convertFieldValueToPropertyValue protected function Converts a field value to a property value.
FieldableEdgeEntityBase::exposePropertyAsBaseField private static function Returns whether an entity property is blacklisted to be exposed as field.
FieldableEdgeEntityBase::get public function Gets a field item list. Overrides FieldableEntityInterface::get 1
FieldableEdgeEntityBase::getBaseFieldDefinition protected static function Attempts to create a base field definition from a type.
FieldableEdgeEntityBase::getFieldDefinition public function Gets the definition of a contained field. Overrides FieldableEntityInterface::getFieldDefinition
FieldableEdgeEntityBase::getFieldDefinitions public function Gets an array of field definitions of all contained fields. Overrides FieldableEntityInterface::getFieldDefinitions
FieldableEdgeEntityBase::getFields public function Gets an array of all field item lists. Overrides FieldableEntityInterface::getFields
FieldableEdgeEntityBase::getFieldValue protected function Returns the field value from the current object.
FieldableEdgeEntityBase::getIterator public function
FieldableEdgeEntityBase::getProperties protected static function Parses the properties and its types from the parent class.
FieldableEdgeEntityBase::getTranslatableFields public function Gets an array of field item lists for translatable fields. Overrides FieldableEntityInterface::getTranslatableFields
FieldableEdgeEntityBase::hasField public function Determines whether the entity has a field with the given name. Overrides FieldableEntityInterface::hasField
FieldableEdgeEntityBase::isValidationRequired public function Checks whether entity validation is required before saving the entity. Overrides FieldableEntityInterface::isValidationRequired
FieldableEdgeEntityBase::onChange public function Reacts to changes to a field. Overrides FieldableEntityInterface::onChange
FieldableEdgeEntityBase::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase::postSave
FieldableEdgeEntityBase::propertyFieldType private static function Returns the type of the field that should represent an entity property.
FieldableEdgeEntityBase::propertyToBaseFieldBlackList protected static function Array of properties that should not be exposed as base fields by default. 2
FieldableEdgeEntityBase::propertyToBaseFieldTypeMap protected static function Static mapping between entity properties and Drupal field types. 2
FieldableEdgeEntityBase::set public function Sets a field value. Overrides FieldableEntityInterface::set 1
FieldableEdgeEntityBase::setPropertyValue public function Updates the property value on an entity by field name. Overrides FieldableEdgeEntityInterface::setPropertyValue 1
FieldableEdgeEntityBase::setValidationRequired public function Sets whether entity validation is required before saving the entity. Overrides FieldableEntityInterface::setValidationRequired
FieldableEdgeEntityBase::toArray public function Gets an array of all property values. Overrides EntityBase::toArray
FieldableEdgeEntityBase::validate public function Validates the currently set values. Overrides FieldableEntityInterface::validate
FieldableEdgeEntityBase::__sleep public function Overrides EntityBase::__sleep
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
RevisioningWorkaroundTrait::getLoadedRevisionId public function
RevisioningWorkaroundTrait::getRevisionId public function
RevisioningWorkaroundTrait::isDefaultRevision public function
RevisioningWorkaroundTrait::isLatestRevision public function
RevisioningWorkaroundTrait::isNewRevision public function
RevisioningWorkaroundTrait::preSaveRevision public function
RevisioningWorkaroundTrait::setNewRevision public function
RevisioningWorkaroundTrait::updateLoadedRevisionId public function
RevisioningWorkaroundTrait::wasDefaultRevision public function