diff core/modules/user/src/EntityOwnerInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/user/src/EntityOwnerInterface.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,52 @@
+<?php
+
+namespace Drupal\user;
+
+/**
+ * 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.
+ */
+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);
+
+}