diff --git a/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php index 1d17d5e..795a79f 100644 --- a/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php +++ b/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php @@ -55,5 +55,18 @@ * ) */ class EntityViewMode extends EntityDisplayModeBase implements EntityViewModeInterface { - + /** + * {@inheritdoc} + */ + public function setTargetType($targetType) { + $this->set('targetEntityType', $targetType); + return $this;; + } + /** + * {@inheritdoc} + */ + public function setLabel($label) { + $this->set('label', $label); + return $this; + } } diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeBase.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeBase.php index 1541143..32b2720 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeBase.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeBase.php @@ -33,7 +33,7 @@ * * @var string */ - public $label; + protected $label; /** * The entity type this form or view mode is used for. @@ -43,7 +43,7 @@ * * @var string */ - public $targetEntityType; + protected $targetEntityType; /** * Whether or not this form or view mode has custom settings by default. diff --git a/core/modules/entity/lib/Drupal/entity/EntityViewModeInterface.php b/core/modules/entity/lib/Drupal/entity/EntityViewModeInterface.php index 7ff4e51..1640e07 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityViewModeInterface.php +++ b/core/modules/entity/lib/Drupal/entity/EntityViewModeInterface.php @@ -11,5 +11,22 @@ * Provides an interface defining an entity view mode entity type. */ interface EntityViewModeInterface extends EntityDisplayModeInterface { - + /** + * Sets the target entity type to be displayed. + * + * @param string targetType + * The entity type that this EntityView is for + * + * @return self + */ + public function setTargetType($targetType); + /** + * Sets the label. + * + * @param string $label + * The label to be set for the viewMode. + * + * @return self + */ + public function setLabel($label); }