revisionLogBaseFieldDefinitions example


class EntityTestMulRevChangedWithRevisionLog extends EntityTestMulRevChanged implements RevisionLogInterface {

  use RevisionLogEntityTrait;

  /** * {@inheritdoc} */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);
    $fields += static::revisionLogBaseFieldDefinitions($entity_type);

    return $fields;
  }

}

abstract class RevisionableContentEntityBase extends ContentEntityBase implements RevisionLogInterface {

  use RevisionLogEntityTrait;

  /** * {@inheritdoc} */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);

    $fields += static::revisionLogBaseFieldDefinitions($entity_type);
    return $fields;
  }

}
use EntityChangedTrait;
  use EntityPublishedTrait;
  use RevisionLogEntityTrait;

  /** * {@inheritdoc} */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);

    // Add the revision metadata fields.     $fields += static::revisionLogBaseFieldDefinitions($entity_type);

    // Add the published field.     $fields += static::publishedBaseFieldDefinitions($entity_type);

    return $fields;
  }

}
Home | Imprint | This part of the site doesn't use cookies.