class UserBCDecorator

Defines the user specific entity BC decorator.

Hierarchy

Expanded class hierarchy of UserBCDecorator

1 file declares its use of UserBCDecorator
User.php in drupal/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
Definition of Drupal\user\Plugin\Core\Entity\User.

File

drupal/core/modules/user/lib/Drupal/user/UserBCDecorator.php, line 15
Contains \Drupal\user\UserBCDecorator.

Namespace

Drupal\user
View source
class UserBCDecorator extends EntityBCDecorator implements UserInterface {

  /**
   * {@inheritdoc}
   */
  public function &__get($name) {

    // Special handling for roles, as the return value is expected to be an
    // array.
    if ($name == 'roles') {
      $roles = $this->decorated
        ->getRoles();
      return $roles;
    }
    return parent::__get($name);
  }

  /**
   * {@inheritdoc}
   */
  public function getRoles() {
    return $this->decorated
      ->getRoles();
  }

  /**
   * {@inheritdoc}
   */
  public function getSecureSessionId() {
    return $this->decorated
      ->getSecureSessionId();
  }

  /**
   * {@inheritdoc}
   */
  public function getSessionData() {
    return $this->decorated
      ->getSecureSessionId();
  }

  /**
   * {@inheritdoc}
   */
  public function getSessionId() {
    return $this->decorated
      ->getSessionId();
  }

  /**
   * {@inheritdoc}
   */
  public function hasRole($rid) {
    return $this
      ->getBCEntity()
      ->hasRole($rid);
  }

  /**
   * {@inheritdoc}
   */
  public function addRole($rid) {
    $this
      ->getBCEntity()
      ->addRole($rid);
  }

  /**
   * {@inheritdoc}
   */
  public function removeRole($rid) {
    $this
      ->getBCEntity()
      ->removeRole($rid);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityBCDecorator::$decorated protected property The EntityInterface object being decorated.
EntityBCDecorator::$definitions protected property Local cache for field definitions.
EntityBCDecorator::access public function Forwards the call to the decorated entity. Overrides AccessibleInterface::access
EntityBCDecorator::bundle public function Forwards the call to the decorated entity. Overrides EntityInterface::bundle
EntityBCDecorator::createDuplicate public function Forwards the call to the decorated entity. Overrides EntityInterface::createDuplicate
EntityBCDecorator::delete public function Forwards the call to the decorated entity. Overrides EntityInterface::delete
EntityBCDecorator::enforceIsNew public function Forwards the call to the decorated entity. Overrides EntityInterface::enforceIsNew
EntityBCDecorator::entityInfo public function Forwards the call to the decorated entity. Overrides EntityInterface::entityInfo
EntityBCDecorator::entityType public function Forwards the call to the decorated entity. Overrides EntityInterface::entityType
EntityBCDecorator::get public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::get
EntityBCDecorator::getBCEntity public function Overrides Entity::getBCEntity(). Overrides EntityInterface::getBCEntity
EntityBCDecorator::getConstraints public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getConstraints
EntityBCDecorator::getDefinition public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getDefinition
EntityBCDecorator::getExportProperties public function Forwards the call to the decorated entity. Overrides EntityInterface::getExportProperties
EntityBCDecorator::getIterator public function Forwards the call to the decorated entity.
EntityBCDecorator::getName public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getName
EntityBCDecorator::getNGEntity public function Overrides Entity::getNGEntity(). Overrides EntityInterface::getNGEntity
EntityBCDecorator::getParent public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getParent
EntityBCDecorator::getProperties public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::getProperties
EntityBCDecorator::getPropertyDefinition public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::getPropertyDefinition
EntityBCDecorator::getPropertyDefinitions public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::getPropertyDefinitions
EntityBCDecorator::getPropertyPath public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getPropertyPath
EntityBCDecorator::getPropertyValues public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::getPropertyValues
EntityBCDecorator::getRevisionId public function Forwards the call to the decorated entity. Overrides EntityInterface::getRevisionId
EntityBCDecorator::getRoot public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getRoot
EntityBCDecorator::getString public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getString
EntityBCDecorator::getTranslation public function Forwards the call to the decorated entity. Overrides TranslatableInterface::getTranslation
EntityBCDecorator::getTranslationLanguages public function Forwards the call to the decorated entity. Overrides TranslatableInterface::getTranslationLanguages
EntityBCDecorator::getType public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getType
EntityBCDecorator::getValue public function Forwards the call to the decorated entity. Overrides TypedDataInterface::getValue
EntityBCDecorator::id public function Forwards the call to the decorated entity. Overrides EntityInterface::id
EntityBCDecorator::isDefaultRevision public function Forwards the call to the decorated entity. Overrides EntityInterface::isDefaultRevision
EntityBCDecorator::isEmpty public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::isEmpty
EntityBCDecorator::isNew public function Forwards the call to the decorated entity. Overrides EntityInterface::isNew
EntityBCDecorator::isNewRevision public function Forwards the call to the decorated entity. Overrides EntityInterface::isNewRevision
EntityBCDecorator::isTranslatable public function Forwards the call to the decorated entity. Overrides EntityInterface::isTranslatable
EntityBCDecorator::label public function Forwards the call to the decorated entity. Overrides EntityInterface::label
EntityBCDecorator::language public function Forwards the call to the decorated entity. Overrides TranslatableInterface::language
EntityBCDecorator::onChange public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::onChange
EntityBCDecorator::save public function Forwards the call to the decorated entity. Overrides EntityInterface::save
EntityBCDecorator::set public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::set
EntityBCDecorator::setContext public function Forwards the call to the decorated entity. Overrides TypedDataInterface::setContext
EntityBCDecorator::setNewRevision public function Forwards the call to the decorated entity. Overrides EntityInterface::setNewRevision
EntityBCDecorator::setPropertyValues public function Forwards the call to the decorated entity. Overrides ComplexDataInterface::setPropertyValues
EntityBCDecorator::setValue public function Forwards the call to the decorated entity. Overrides TypedDataInterface::setValue
EntityBCDecorator::uri public function Forwards the call to the decorated entity. Overrides EntityInterface::uri
EntityBCDecorator::uriRelationships public function Forwards the call to the decorated entity. Overrides EntityInterface::uriRelationships
EntityBCDecorator::uuid public function Forwards the call to the decorated entity. Overrides EntityInterface::uuid
EntityBCDecorator::validate public function Forwards the call to the decorated entity. Overrides TypedDataInterface::validate
EntityBCDecorator::__clone function Implements the magic method for clone().
EntityBCDecorator::__construct function Constructs a Drupal\Core\Entity\EntityCompatibilityDecorator object.
EntityBCDecorator::__isset public function Implements the magic method for isset().
EntityBCDecorator::__set public function Implements the magic method for setting object properties.
EntityBCDecorator::__unset public function Implements the magic method for unset().
UserBCDecorator::addRole public function Add a role to a user. Overrides UserInterface::addRole
UserBCDecorator::getRoles public function Returns a list of roles. Overrides UserInterface::getRoles
UserBCDecorator::getSecureSessionId public function Returns the secure session ID. Overrides AccountInterface::getSecureSessionId
UserBCDecorator::getSessionData public function Returns the session data. Overrides AccountInterface::getSessionData
UserBCDecorator::getSessionId public function Returns the session ID. Overrides AccountInterface::getSessionId
UserBCDecorator::hasRole public function Whether a user has a certain role. Overrides UserInterface::hasRole
UserBCDecorator::removeRole public function Remove a role from a user. Overrides UserInterface::removeRole
UserBCDecorator::__get public function Implements the magic method for getting object properties. Overrides EntityBCDecorator::__get