You are here

interface EntityOwnerInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/EntityOwnerInterface.php \Drupal\user\EntityOwnerInterface

Defines a common interface for entities that have an owner.

An owner is someone who has primary control over an entity, similar to owners in Unix file system access. This may or may not be the entity's original author. The owner may also have less permissions than other users, such as administrators.

Hierarchy

Expanded class hierarchy of EntityOwnerInterface

All classes that implement EntityOwnerInterface

7 files declare their use of EntityOwnerInterface
CommentInterface.php in core/modules/comment/src/CommentInterface.php
Contains \Drupal\comment\CommentInterface.
CommentStatistics.php in core/modules/comment/src/CommentStatistics.php
Contains \Drupal\comment\CommentStatistics.
DefaultSelection.php in core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php
Contains \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection.
EntityReferenceAutocompleteWidget.php in core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php
Contains \Drupal\Core\Field\Plugin\Field\FieldWidget\EntityReferenceAutocompleteWidget.
EntityTest.php in core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php
Contains \Drupal\entity_test\Entity\EntityTest.

... See full list

File

core/modules/user/src/EntityOwnerInterface.php, line 18
Contains \Drupal\user\EntityOwnerInterface.

Namespace

Drupal\user
View source
interface EntityOwnerInterface {

  /**
   * Returns the entity owner's user entity.
   *
   * @return \Drupal\user\UserInterface
   *   The owner user entity.
   */
  public function getOwner();

  /**
   * Sets the entity owner's user entity.
   *
   * @param \Drupal\user\UserInterface $account
   *   The owner user entity.
   *
   * @return $this
   */
  public function setOwner(UserInterface $account);

  /**
   * Returns the entity owner's user ID.
   *
   * @return int|null
   *   The owner user ID, or NULL in case the user ID field has not been set on
   *   the entity.
   */
  public function getOwnerId();

  /**
   * Sets the entity owner's user ID.
   *
   * @param int $uid
   *   The owner user id.
   *
   * @return $this
   */
  public function setOwnerId($uid);

}

Members

Namesort descending Modifiers Type Description Overrides
EntityOwnerInterface::getOwner public function Returns the entity owner's user entity. 4
EntityOwnerInterface::getOwnerId public function Returns the entity owner's user ID. 4
EntityOwnerInterface::setOwner public function Sets the entity owner's user entity. 4
EntityOwnerInterface::setOwnerId public function Sets the entity owner's user ID. 4