class WebformContentCreatorEntity in Webform Content Creator 2.x
Same name and namespace in other branches
- 8 src/Entity/WebformContentCreatorEntity.php \Drupal\webform_content_creator\Entity\WebformContentCreatorEntity
- 3.x src/Entity/WebformContentCreatorEntity.php \Drupal\webform_content_creator\Entity\WebformContentCreatorEntity
Defines the Webform Content Creator entity.
Plugin annotation
@ConfigEntityType(
  id = "webform_content_creator",
  label = @Translation("Webform Content Creator"),
  handlers = {
    "list_builder" = "Drupal\webform_content_creator\Controller\WebformContentCreatorListBuilder",
    "form" = {
      "add" = "Drupal\webform_content_creator\Form\WebformContentCreatorForm",
      "edit" = "Drupal\webform_content_creator\Form\WebformContentCreatorForm",
      "delete" = "Drupal\webform_content_creator\Form\WebformContentCreatorDeleteForm",
      "manage_fields" = "Drupal\webform_content_creator\Form\WebformContentCreatorManageFieldsForm",
    }
  },
  config_prefix = "webform_content_creator",
  admin_permission = "administer site configuration",
  entity_keys = {
    "id" = "id",
    "title" = "title",
    "webform" = "webform",
    "content_type" = "content_type",
    "target_entity_type" = "target_entity_type",
    "target_bundle" = "target_bundle",
  },
  links = {
    "manage-fields-form" = "/admin/config/webform_content_creator/manage/{webform_content_creator}/fields",
    "edit-form" = "/admin/config/webform_content_creator/{webform_content_creator}",
    "delete-form" = "/admin/config/webform_content_creator/{webform_content_creator}/delete",
  },
  config_export = {
    "id",
    "title",
    "webform",
    "field_title",
    "use_encrypt",
    "encryption_profile",
    "sync_content",
    "sync_content_delete",
    "sync_content_node_field",
    "sync_content_field",
    "elements",
    "content_type",
    "target_entity_type",
    "target_bundle",
  }
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait- class \Drupal\webform_content_creator\Entity\WebformContentCreatorEntity implements WebformContentCreatorInterface uses StringTranslationTrait
 
 
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
Expanded class hierarchy of WebformContentCreatorEntity
1 file declares its use of WebformContentCreatorEntity
- WebformContentCreatorEntityTest.php in tests/src/ Unit/ Entity/ WebformContentCreatorEntityTest.php 
File
- src/Entity/ WebformContentCreatorEntity.php, line 65 
Namespace
Drupal\webform_content_creator\EntityView source
class WebformContentCreatorEntity extends ConfigEntityBase implements WebformContentCreatorInterface {
  use StringTranslationTrait, MessengerTrait;
  /**
   * Webform content creator entity id.
   *
   * @var string
   */
  protected $id;
  /**
   * Webform content creator entity title.
   *
   * @var string
   */
  protected $title;
  /**
   * Content title.
   *
   * @var string
   */
  protected $field_title;
  /**
   * Webform machine name.
   *
   * @var string
   */
  protected $webform;
  /**
   * Target entity type machine name.
   *
   * @var string
   */
  protected $target_entity_type;
  /**
   * Target bundle machine name.
   *
   * @var string
   */
  protected $target_bundle;
  /**
   * Mapping between webform submission values and content field values.
   *
   * @var array
   */
  protected $elements;
  /**
   * Use encryption.
   *
   * @var bool
   */
  protected $use_encrypt;
  /**
   * Encryption profile.
   *
   * @var string
   */
  protected $encryption_profile;
  /**
   * Returns the entity title.
   *
   * @return string
   *   The entity title.
   */
  public function getTitle() {
    return $this
      ->get('title');
  }
  /**
   * Sets the entity title.
   *
   * @param string $title
   *   Content title.
   *
   * @return $this
   *   The Webform Content Creator entity.
   */
  public function setTitle($title) {
    $this
      ->set('title', $title);
    return $this;
  }
  /**
   * Returns the target entity type id.
   *
   * @return string
   *   The target entity type id.
   */
  public function getEntityTypeValue() {
    $result = $this
      ->get('target_entity_type');
    if (empty($result)) {
      $result = 'node';
    }
    return $result;
  }
  /**
   * Sets the target entity type id.
   *
   * @param string $entityType
   *   Target entity type id.
   *
   * @return $this
   *   The Webform Content Creator entity.
   */
  public function setEntityTypeValue($entityType) {
    $this
      ->set('target_entity_type', $entityType);
    return $this;
  }
  /**
   * Returns the target bundle id.
   *
   * @return string
   *   The target bundle id.
   */
  public function getBundleValue() {
    $result = $this
      ->get('target_bundle');
    if (empty($result)) {
      $result = $this
        ->get('content_type');
    }
    return $result;
  }
  /**
   * Sets the target bundle id.
   *
   * @param string $bundle
   *   Target bundle id.
   *
   * @return $this
   *   The Webform Content Creator entity.
   */
  public function setBundleValue($bundle) {
    $this
      ->set('target_bundle', $bundle);
    return $this;
  }
  /**
   * Returns the entity webform id.
   *
   * @return string
   *   The entity webform.
   */
  public function getWebform() {
    return $this
      ->get('webform');
  }
  /**
   * Sets the entity webform id.
   *
   * @param string $webform
   *   Webform id.
   *
   * @return $this
   *   The Webform Content Creator entity.
   */
  public function setWebform($webform) {
    $this
      ->set('webform', $webform);
    return $this;
  }
  /**
   * Returns the entity attributes as an associative array.
   *
   * @return array
   *   The entity attributes mapping.
   */
  public function getAttributes() {
    return $this
      ->get(WebformContentCreatorInterface::ELEMENTS);
  }
  /**
   * Check if synchronization between content entities and webform submissions is used.
   *
   * @return bool
   *   true, when the synchronization is used. Otherwise, returns false.
   */
  public function getSyncEditContentCheck() {
    return $this
      ->get(WebformContentCreatorInterface::SYNC_CONTENT);
  }
  /**
   * Check if synchronization is used in deletion.
   *
   * @return bool
   *   true, when the synchronization is used. Otherwise, returns false.
   */
  public function getSyncDeleteContentCheck() {
    return $this
      ->get(WebformContentCreatorInterface::SYNC_CONTENT_DELETE);
  }
  /**
   * Get content field in which the webform submission id will be stored.
   *
   * @return string
   *   Field machine name.
   */
  public function getSyncContentField() {
    return $this
      ->get(WebformContentCreatorInterface::SYNC_CONTENT_FIELD);
  }
  /**
   * Returns the encryption method.
   *
   * @return bool
   *   true, when an encryption profile is used. Otherwise, returns false.
   */
  public function getEncryptionCheck() {
    return $this
      ->get(WebformContentCreatorInterface::USE_ENCRYPT);
  }
  /**
   * Returns the encryption profile.
   *
   * @return string
   *   The encryption profile name.
   */
  public function getEncryptionProfile() {
    return $this
      ->get(WebformContentCreatorInterface::ENCRYPTION_PROFILE);
  }
  // /**
  //  * Get content title.
  //  *
  //  * @return string
  //  *   Content title.
  //  */
  // private function getContentTitle() {
  //   // Get title.
  //   if ($this->get(WebformContentCreatorInterface::FIELD_TITLE) !== NULL && $this->get(WebformContentCreatorInterface::FIELD_TITLE) !== '') {
  //     $contentTitle = $this->get(WebformContentCreatorInterface::FIELD_TITLE);
  //   }
  //   else {
  //     $contentTitle = \Drupal::entityTypeManager()->getStorage(WebformContentCreatorInterface::WEBFORM)->load($this->get(WebformContentCreatorInterface::WEBFORM))->label();
  //   }
  //   return $contentTitle;
  // }
  /**
   * Get encryption profile name.
   *
   * @return string
   *   Encryption profile name.
   */
  private function getProfileName() {
    $encryptionProfile = '';
    $useEncrypt = $this
      ->get(WebformContentCreatorInterface::USE_ENCRYPT);
    if ($useEncrypt) {
      $encryptionProfile = \Drupal::service('entity_type.manager')
        ->getStorage(WebformContentCreatorInterface::ENCRYPTION_PROFILE)
        ->load($this
        ->getEncryptionProfile());
    }
    return $encryptionProfile;
  }
  /**
   * Get decrypted value with the configured encryption profile.
   *
   * @param string $value
   *   Encrypted value.
   * @param string $encryptionProfile
   *   Encryption profile name.
   *
   * @return string
   *   Encryption profile used to encrypt/decrypt $value
   */
  private function getDecryptionFromProfile($value, $encryptionProfile = '') {
    if ($this
      ->getEncryptionCheck()) {
      $decValue = WebformContentCreatorUtilities::getDecryptedValue($value, $encryptionProfile);
    }
    else {
      $decValue = $value;
    }
    return $decValue;
  }
  /**
   * Use a single mapping to set a Content field value.
   *
   * @param \Drupal\Core\Entity\EntityInterface $initialContent
   *   Content entity being mapped with a webform submission.
   * @param \Drupal\webform\WebformSubmissionInterface $webform_submission
   *   Webform submission entity.
   * @param array $fields
   *   Content entity fields.
   * @param array $data
   *   Webform submission data.
   * @param string $encryptionProfile
   *   Encryption profile used in Webform encrypt module.
   * @param string $fieldId
   *   Content field id.
   * @param array $mapping
   *   Single mapping between content entity and webform submission.
   * @param array $attributes
   *   All mapping values between Content entity and Webform submission values.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   Created content entity.
   */
  private function mapContentField(EntityInterface $initialContent, WebformSubmissionInterface $webform_submission, array $fields = [], array $data = [], $encryptionProfile = '', $fieldId = '', array $mapping = [], array $attributes = []) {
    $content = $initialContent;
    if (!$content
      ->hasField($fieldId) || !is_array($mapping)) {
      return $content;
    }
    if ($attributes[$fieldId][WebformContentCreatorInterface::CUSTOM_CHECK]) {
      $decValue = WebformContentCreatorUtilities::getDecryptedTokenValue($mapping[WebformContentCreatorInterface::CUSTOM_VALUE], $encryptionProfile, $webform_submission);
      if ($decValue === 'true' || $decValue === 'TRUE') {
        $decValue = TRUE;
      }
    }
    else {
      if (!$attributes[$fieldId][WebformContentCreatorInterface::TYPE]) {
        if (!array_key_exists(WebformContentCreatorInterface::WEBFORM_FIELD, $mapping) || !array_key_exists($mapping[WebformContentCreatorInterface::WEBFORM_FIELD], $data)) {
          return $content;
        }
        $decValue = $this
          ->getDecryptionFromProfile($data[$mapping[WebformContentCreatorInterface::WEBFORM_FIELD]], $encryptionProfile);
        if ($fields[$fieldId]
          ->getType() === 'entity_reference' && (!is_array($decValue) && intval($decValue) === 0)) {
          $content
            ->set($fieldId, []);
          return $content;
        }
      }
      else {
        $fieldObject = $webform_submission->{$mapping[WebformContentCreatorInterface::WEBFORM_FIELD]};
        if ($fieldObject instanceof EntityReferenceFieldItemList) {
          $decValue = $webform_submission->{$mapping[WebformContentCreatorInterface::WEBFORM_FIELD]}
            ->getValue()[0]['target_id'];
        }
        else {
          $decValue = $webform_submission->{$mapping[WebformContentCreatorInterface::WEBFORM_FIELD]}->value;
        }
      }
    }
    if ($fields[$fieldId]
      ->getType() == 'datetime') {
      $decValue = $this
        ->convertTimestamp($decValue, $fields, $fieldId);
    }
    // Check if field's max length is exceeded.
    $maxLength = $this
      ->checkMaxFieldSizeExceeded($fields, $fieldId, $decValue);
    if ($maxLength === 0) {
      $content
        ->set($fieldId, $decValue);
    }
    else {
      $content
        ->set($fieldId, substr($decValue, 0, $maxLength));
    }
    return $content;
  }
  /**
   * Create content entity from webform submission.
   *
   * @param \Drupal\webform\WebformSubmissionInterface $webform_submission
   *   Webform submission.
   */
  public function createContent(WebformSubmissionInterface $webform_submission) {
    $entity_type_id = $this
      ->getEntityTypeValue();
    $bundle_id = $this
      ->getBundleValue();
    $fields = WebformContentCreatorUtilities::bundleFields($entity_type_id, $bundle_id);
    if (empty($fields)) {
      return FALSE;
    }
    // Get webform submission data.
    $data = $webform_submission
      ->getData();
    if (empty($data)) {
      return 0;
    }
    $encryptionProfile = $this
      ->getProfileName();
    $entity_type = \Drupal::entityTypeManager()
      ->getDefinition($entity_type_id);
    // Create new content.
    $content = \Drupal::entityTypeManager()
      ->getStorage($entity_type_id)
      ->create([
      $entity_type
        ->getKey('bundle') => $this
        ->getBundleValue(),
    ]);
    // Set content fields values.
    $attributes = $this
      ->get(WebformContentCreatorInterface::ELEMENTS);
    if (!$this
      ->existsBundle()) {
      return FALSE;
    }
    foreach ($attributes as $k2 => $v2) {
      $content = $this
        ->mapContentField($content, $webform_submission, $fields, $data, $encryptionProfile, $k2, $v2, $attributes);
    }
    $result = FALSE;
    // Save content.
    try {
      $result = $content
        ->save();
    } catch (\Exception $e) {
      \Drupal::logger(WebformContentCreatorInterface::WEBFORM_CONTENT_CREATOR)
        ->error($this
        ->t('A problem occurred when creating a new content.'));
      \Drupal::logger(WebformContentCreatorInterface::WEBFORM_CONTENT_CREATOR)
        ->error($e
        ->getMessage());
    }
    return $result;
  }
  /**
   * Update content from webform submission.
   *
   * @param \Drupal\webform\WebformSubmissionInterface $webform_submission
   *   Webform submission.
   * @param string $op
   *   Operation.
   *
   * @return bool
   *   True, if succeeded. Otherwise, return false.
   */
  public function updateContent(WebformSubmissionInterface $webform_submission, $op = 'edit') {
    if (empty($this
      ->getSyncContentField())) {
      return FALSE;
    }
    $entity_type_id = $this
      ->getEntityTypeValue();
    $bundle_id = $this
      ->getBundleValue();
    $fields = WebformContentCreatorUtilities::bundleFields($entity_type_id, $bundle_id);
    if (empty($fields)) {
      return FALSE;
    }
    if (!array_key_exists($this
      ->getSyncContentField(), $fields)) {
      return FALSE;
    }
    // Get webform submission data.
    $data = $webform_submission
      ->getData();
    if (empty($data)) {
      return FALSE;
    }
    $encryptionProfile = $this
      ->getProfileName();
    // Get contents created from this webform submission.
    $contents = \Drupal::entityTypeManager()
      ->getStorage($entity_type_id)
      ->loadByProperties([
      $this
        ->getSyncContentField() => $webform_submission
        ->id(),
    ]);
    // Use only first result, if exists.
    if (!($content = reset($contents))) {
      return FALSE;
    }
    if ($op === 'delete' && !empty($this
      ->getSyncDeleteContentCheck())) {
      $result = $content
        ->delete();
      return $result;
    }
    if (empty($this
      ->getSyncEditContentCheck())) {
      return FALSE;
    }
    // Set content fields values.
    $attributes = $this
      ->get(WebformContentCreatorInterface::ELEMENTS);
    foreach ($attributes as $k2 => $v2) {
      $content = $this
        ->mapContentField($content, $webform_submission, $fields, $data, $encryptionProfile, $k2, $v2, $attributes);
    }
    $result = FALSE;
    // Save content.
    try {
      $result = $content
        ->save();
    } catch (\Exception $e) {
      \Drupal::logger(WebformContentCreatorInterface::WEBFORM_CONTENT_CREATOR)
        ->error($this
        ->t('A problem occurred while updating content.'));
      \Drupal::logger(WebformContentCreatorInterface::WEBFORM_CONTENT_CREATOR)
        ->error($e
        ->getMessage());
    }
    return $result;
  }
  /**
   * Check if the entity type exists.
   *
   * @return bool
   *   True, if entity type exists. Otherwise, returns false.
   */
  public function existsEntityType() {
    // Get entity type id.
    $entity_type_id = $this
      ->getEntityTypeValue();
    $entity_keys = array_keys(\Drupal::entityTypeManager()
      ->getDefinitions());
    return in_array($entity_type_id, $entity_keys);
  }
  /**
   * Check if the bundle exists.
   *
   * @return bool
   *   True, if the bundle exists. Otherwise, returns false.
   */
  public function existsBundle() {
    // Get entity type id.
    $entity_type_id = $this
      ->getEntityTypeValue();
    // Get bundle id.
    $bundle_id = $this
      ->getBundleValue();
    // Get bundles of entity type being used.
    $bundles = \Drupal::service('entity_type.bundle.info')
      ->getBundleInfo($entity_type_id);
    $bundles = array_keys($bundles);
    return in_array($bundle_id, $bundles);
  }
  /**
   * Check if the target entity type id is equal to the configured entity type.
   *
   * @param string $e
   *   Target entity type id.
   *
   * @return bool
   *   True, if the parameter is equal to the target entity type id of Webform
   *   content creator entity. Otherwise, returns false.
   */
  public function equalsEntityType($e) {
    return $e === $this
      ->getEntityTypeValue();
  }
  /**
   * Check if the target bundle id is equal to the configured bundle.
   *
   * @param string $bundle
   *   Target bundle id.
   *
   * @return bool
   *   True, if the parameter is equal to the target bundle id of Webform
   *   content creator entity. Otherwise, returns false.
   */
  public function equalsBundle($bundle) {
    return $bundle === $this
      ->getBundleValue();
  }
  /**
   * Check if the webform id is equal to the configured webform id.
   *
   * @param string $webform
   *   Webform id.
   *
   * @return bool
   *   True, if the parameter is equal to the webform id of Webform
   *   content creator entity. Otherwise, returns false.
   */
  public function equalsWebform($webform) {
    return $webform === $this
      ->getWebform();
  }
  /**
   * Show a message accordingly to status, after creating/updating an entity.
   *
   * @param int $status
   *   Status int, returned after creating/updating an entity.
   */
  public function statusMessage($status) {
    if ($status) {
      $this
        ->messenger()
        ->addMessage($this
        ->t('Saved the %label entity.', [
        '%label' => $this
          ->getTitle(),
      ]));
    }
    else {
      $this
        ->messenger()
        ->addMessage($this
        ->t('The %label entity was not saved.', [
        '%label' => $this
          ->getTitle(),
      ]));
    }
  }
  /**
   * Check if field maximum size is exceeded.
   *
   * @param array $fields
   *   Content type fields.
   * @param string $k
   *   Field machine name.
   * @param string $decValue
   *   Decrypted value.
   *
   * @return int
   *   1 if maximum size is exceeded, otherwise return 0.
   */
  public function checkMaxFieldSizeExceeded(array $fields, $k, $decValue = "") {
    if (!array_key_exists($k, $fields) || empty($fields[$k])) {
      return 0;
    }
    $fieldSettings = $fields[$k]
      ->getSettings();
    if (empty($fieldSettings) || !array_key_exists('max_length', $fieldSettings)) {
      return 0;
    }
    $maxLength = $fieldSettings['max_length'];
    if (empty($maxLength)) {
      return 0;
    }
    if ($maxLength < strlen($decValue)) {
      \Drupal::logger(WebformContentCreatorInterface::WEBFORM_CONTENT_CREATOR)
        ->notice($this
        ->t('Problem: Field max length exceeded (truncated).'));
      return $maxLength;
    }
    return strlen($decValue);
  }
  /**
   * Convert timestamp value according to field type.
   *
   * @param int $datefield
   *   Original datetime value.
   * @param array $fields
   *   Content type fields.
   * @param int $fieldId
   *   Field machine name id.
   *
   * @return Timestamp
   *   Converted value.
   */
  public function convertTimestamp($datefield, array $fields, $fieldId) {
    $dateTime = new DrupalDateTime($datefield, 'UTC');
    $dateType = $fields[$fieldId]
      ->getSettings()['datetime_type'];
    if ($dateType === 'datetime') {
      $formatted = \Drupal::service('date.formatter')
        ->format($dateTime
        ->getTimestamp(), 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, 'UTC');
    }
    else {
      $formatted = \Drupal::service('date.formatter')
        ->format($dateTime
        ->getTimestamp(), 'custom', DateTimeItemInterface::DATE_STORAGE_FORMAT, 'UTC');
    }
    return $formatted;
  }
}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 | ||
| ConfigEntityBase:: | protected | function | Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). | |
| ConfigEntityBase:: | public | function | Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityInterface:: | 14 | 
| 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 | Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface:: | 8 | 
| 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 | Constructs an Entity object. Overrides EntityBase:: | 10 | 
| ConfigEntityBase:: | public | function | Overrides EntityBase:: | 4 | 
| DependencySerializationTrait:: | protected | property | ||
| DependencySerializationTrait:: | protected | property | ||
| DependencySerializationTrait:: | public | function | Aliased as: traitSleep | 2 | 
| 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 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:: | 18 | 
| 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:: | 7 | 
| 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 | ||
| StringTranslationTrait:: | protected | property | The string translation service. | 4 | 
| StringTranslationTrait:: | protected | function | Formats a string containing a count of items. | |
| StringTranslationTrait:: | protected | function | Returns the number of plurals supported by a given language. | |
| StringTranslationTrait:: | protected | function | Gets the string translation service. | |
| StringTranslationTrait:: | public | function | Sets the string translation service to use. | 2 | 
| StringTranslationTrait:: | protected | function | Translates a string to the current language or to a given language. | |
| SynchronizableEntityTrait:: | protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
| SynchronizableEntityTrait:: | public | function | ||
| SynchronizableEntityTrait:: | public | function | ||
| WebformContentCreatorEntity:: | protected | property | Mapping between webform submission values and content field values. | |
| WebformContentCreatorEntity:: | protected | property | Encryption profile. | |
| WebformContentCreatorEntity:: | protected | property | Content title. | |
| WebformContentCreatorEntity:: | protected | property | Webform content creator entity id. | |
| WebformContentCreatorEntity:: | protected | property | Target bundle machine name. | |
| WebformContentCreatorEntity:: | protected | property | Target entity type machine name. | |
| WebformContentCreatorEntity:: | protected | property | Webform content creator entity title. | |
| WebformContentCreatorEntity:: | protected | property | Use encryption. | |
| WebformContentCreatorEntity:: | protected | property | Webform machine name. | |
| WebformContentCreatorEntity:: | public | function | Check if field maximum size is exceeded. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Convert timestamp value according to field type. | |
| WebformContentCreatorEntity:: | public | function | Create content entity from webform submission. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Check if the target bundle id is equal to the configured bundle. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Check if the target entity type id is equal to the configured entity type. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Check if the webform id is equal to the configured webform id. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Check if the bundle exists. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Check if the entity type exists. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Returns the entity attributes as an associative array. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Returns the target bundle id. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | private | function | Get decrypted value with the configured encryption profile. | |
| WebformContentCreatorEntity:: | public | function | Returns the encryption method. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Returns the encryption profile. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Returns the target entity type id. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | private | function | Get encryption profile name. | |
| WebformContentCreatorEntity:: | public | function | Get content field in which the webform submission id will be stored. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Check if synchronization is used in deletion. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Check if synchronization between content entities and webform submissions is used. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Returns the entity title. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Returns the entity webform id. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | private | function | Use a single mapping to set a Content field value. | |
| WebformContentCreatorEntity:: | public | function | Sets the target bundle id. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Sets the target entity type id. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Sets the entity title. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Sets the entity webform id. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Show a message accordingly to status, after creating/updating an entity. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorEntity:: | public | function | Update content from webform submission. Overrides WebformContentCreatorInterface:: | |
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | |||
| WebformContentCreatorInterface:: | constant | 
