annotate core/modules/user/src/EntityOwnerInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\user;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Defines a common interface for entities that have an owner.
Chris@0 7 *
Chris@0 8 * An owner is someone who has primary control over an entity, similar to
Chris@0 9 * owners in Unix file system access. This may or may not be the entity's
Chris@0 10 * original author. The owner may also have less permissions than other users,
Chris@0 11 * such as administrators.
Chris@0 12 */
Chris@0 13 interface EntityOwnerInterface {
Chris@0 14
Chris@0 15 /**
Chris@0 16 * Returns the entity owner's user entity.
Chris@0 17 *
Chris@0 18 * @return \Drupal\user\UserInterface
Chris@0 19 * The owner user entity.
Chris@0 20 */
Chris@0 21 public function getOwner();
Chris@0 22
Chris@0 23 /**
Chris@0 24 * Sets the entity owner's user entity.
Chris@0 25 *
Chris@0 26 * @param \Drupal\user\UserInterface $account
Chris@0 27 * The owner user entity.
Chris@0 28 *
Chris@0 29 * @return $this
Chris@0 30 */
Chris@0 31 public function setOwner(UserInterface $account);
Chris@0 32
Chris@0 33 /**
Chris@0 34 * Returns the entity owner's user ID.
Chris@0 35 *
Chris@0 36 * @return int|null
Chris@0 37 * The owner user ID, or NULL in case the user ID field has not been set on
Chris@0 38 * the entity.
Chris@0 39 */
Chris@0 40 public function getOwnerId();
Chris@0 41
Chris@0 42 /**
Chris@0 43 * Sets the entity owner's user ID.
Chris@0 44 *
Chris@0 45 * @param int $uid
Chris@0 46 * The owner user id.
Chris@0 47 *
Chris@0 48 * @return $this
Chris@0 49 */
Chris@0 50 public function setOwnerId($uid);
Chris@0 51
Chris@0 52 }