You are here

class Domain in Domain Access 8

Same name in this branch
  1. 8 domain/src/Entity/Domain.php \Drupal\domain\Entity\Domain
  2. 8 domain/src/Plugin/Condition/Domain.php \Drupal\domain\Plugin\Condition\Domain
  3. 8 domain/src/Plugin/views/argument_default/Domain.php \Drupal\domain\Plugin\views\argument_default\Domain
  4. 8 domain/src/Plugin/views/access/Domain.php \Drupal\domain\Plugin\views\access\Domain

Defines the domain entity.

Plugin annotation


@ConfigEntityType(
  id = "domain",
  label = @Translation("Domain record"),
  module = "domain",
  handlers = {
    "storage" = "Drupal\domain\DomainStorage",
    "access" = "Drupal\domain\DomainAccessControlHandler",
    "list_builder" = "Drupal\domain\DomainListBuilder",
    "form" = {
      "default" = "Drupal\domain\DomainForm",
      "edit" = "Drupal\domain\DomainForm",
      "delete" = "Drupal\domain\Form\DomainDeleteForm"
    }
  },
  config_prefix = "record",
  admin_permission = "administer domains",
  entity_keys = {
    "id" = "id",
    "domain_id" = "domain_id",
    "label" = "name",
    "uuid" = "uuid",
    "status" = "status",
    "weight" = "weight"
  },
  links = {
    "delete-form" = "/admin/config/domain/delete/{domain}",
    "edit-form" = "/admin/config/domain/edit/{domain}",
    "collection" = "/admin/config/domain",
  },
  uri_callback = "domain_uri",
  config_export = {
    "id",
    "domain_id",
    "hostname",
    "name",
    "scheme",
    "status",
    "weight",
    "is_default",
  }
)

Hierarchy

Expanded class hierarchy of Domain

17 string references to 'Domain'
domain.info.yml in domain/domain.info.yml
domain/domain.info.yml
domain.schema.yml in domain/config/schema/domain.schema.yml
domain/config/schema/domain.schema.yml
Domain::buildOptionsForm in domain/src/Plugin/views/access/Domain.php
Provide a form to edit options for this plugin.
DomainAccessActionBase::buildConfigurationForm in domain_access/src/Plugin/Action/DomainAccessActionBase.php
Form constructor.
DomainAliasForm::form in domain_alias/src/DomainAliasForm.php
Gets the actual form array to be built.

... See full list

File

domain/src/Entity/Domain.php, line 59

Namespace

Drupal\domain\Entity
View source
class Domain extends ConfigEntityBase implements DomainInterface {
  use StringTranslationTrait;

  /**
   * The ID of the domain entity.
   *
   * @var string
   */
  protected $id;

  /**
   * The domain record ID.
   *
   * @var int
   */
  protected $domain_id;

  /**
   * The domain list name (e.g. Drupal).
   *
   * @var string
   */
  protected $name;

  /**
   * The domain hostname (e.g. example.com).
   *
   * @var string
   */
  protected $hostname;

  /**
   * The domain record sort order.
   *
   * @var int
   */
  protected $weight;

  /**
   * Indicates the default domain.
   *
   * @var bool
   */
  protected $is_default = FALSE;

  /**
   * The domain record protocol (e.g. http://).
   *
   * @var string
   */
  protected $scheme;

  /**
   * The domain record base path, a calculated value.
   *
   * @var string
   */
  protected $path;

  /**
   * The domain record current url, a calculated value.
   *
   * @var string
   */
  protected $url;

  /**
   * The domain record http response test (e.g. 200), a calculated value.
   *
   * @var int
   */
  protected $response = NULL;

  /**
   * The redirect method to use, if needed.
   *
   * @var int|null
   */
  protected $redirect = NULL;

  /**
   * The type of match returned by the negotiator.
   *
   * @var int
   */
  protected $matchType;

  /**
   * The canonical hostname for the domain.
   *
   * @var string
   */
  protected $canonical;

  /**
   * {@inheritdoc}
   */
  public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
    parent::preCreate($storage_controller, $values);
    $domain_storage = \Drupal::entityTypeManager()
      ->getStorage('domain');
    $default = $domain_storage
      ->loadDefaultId();
    $count = $storage_controller
      ->getQuery()
      ->count()
      ->execute();
    $values += [
      'scheme' => empty($GLOBALS['is_https']) ? 'http' : 'https',
      'status' => 1,
      'weight' => $count + 1,
      'is_default' => (int) empty($default),
    ];

    // Note that we have not created a domain_id, which is only used for
    // node access control and will be added on save.
  }

  /**
   * {@inheritdoc}
   */
  public function isActive() {
    $negotiator = \Drupal::service('domain.negotiator');

    /** @var self $domain */
    $domain = $negotiator
      ->getActiveDomain();
    if (empty($domain)) {
      return FALSE;
    }
    return $this
      ->id() == $domain
      ->id();
  }

  /**
   * {@inheritdoc}
   */
  public function addProperty($name, $value) {
    if (!isset($this->{$name})) {
      $this->{$name} = $value;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function isDefault() {
    return (bool) $this->is_default;
  }

  /**
   * {@inheritdoc}
   */
  public function isHttps() {
    return (bool) ($this
      ->getScheme(FALSE) == 'https');
  }

  /**
   * {@inheritdoc}
   */
  public function saveDefault() {
    if (!$this
      ->isDefault()) {

      // Swap the current default.

      /** @var self $default */
      if ($default = \Drupal::entityTypeManager()
        ->getStorage('domain')
        ->loadDefaultDomain()) {
        $default->is_default = FALSE;
        $default
          ->setHostname($default
          ->getCanonical());
        $default
          ->save();
      }

      // Save the new default.
      $this->is_default = TRUE;
      $this
        ->setHostname($this
        ->getCanonical());
      $this
        ->save();
    }
    else {
      \Drupal::messenger()
        ->addMessage($this
        ->t('The selected domain is already the default.'), 'warning');
    }
  }

  /**
   * {@inheritdoc}
   */
  public function enable() {
    $this
      ->setStatus(TRUE);
    $this
      ->setHostname($this
      ->getCanonical());
    $this
      ->save();
  }

  /**
   * {@inheritdoc}
   */
  public function disable() {
    if (!$this
      ->isDefault()) {
      $this
        ->setStatus(FALSE);
      $this
        ->setHostname($this
        ->getCanonical());
      $this
        ->save();
    }
    else {
      \Drupal::messenger()
        ->addMessage($this
        ->t('The default domain cannot be disabled.'), 'warning');
    }
  }

  /**
   * {@inheritdoc}
   */
  public function saveProperty($name, $value) {
    if (isset($this->{$name})) {
      $this->{$name} = $value;
      $this
        ->setHostname($this
        ->getCanonical());
      $this
        ->save();
      \Drupal::messenger()
        ->addMessage($this
        ->t('The @key attribute was set to @value for domain @hostname.', [
        '@key' => $name,
        '@value' => $value,
        '@hostname' => $this->hostname,
      ]));
    }
    else {
      \Drupal::messenger()
        ->addMessage($this
        ->t('The @key attribute does not exist.', [
        '@key' => $name,
      ]));
    }
  }

  /**
   * {@inheritdoc}
   */
  public function setPath() {
    global $base_path;
    $this->path = $this
      ->getScheme() . $this
      ->getHostname() . ($base_path ?: '/');
  }

  /**
   * {@inheritdoc}
   */
  public function setUrl() {
    $request = \Drupal::request();
    $uri = $request ? $request
      ->getRequestUri() : '/';
    $this->url = $this
      ->getScheme() . $this
      ->getHostname() . $uri;
  }

  /**
   * {@inheritdoc}
   */
  public function getPath() {
    if (!isset($this->path)) {
      $this
        ->setPath();
    }
    return $this->path;
  }

  /**
   * Returns the raw path of the domain object, without the base url.
   */
  public function getRawPath() {
    return $this
      ->getScheme() . $this
      ->getHostname();
  }

  /**
   * Builds a link from a known internal path.
   *
   * @param string $path
   *   A Drupal-formatted internal path, starting with /. Note that it is the
   *   caller's responsibility to handle the base_path().
   *
   * @return string
   *   The built link.
   */
  public function buildUrl($path) {
    return $this
      ->getRawPath() . $path;
  }

  /**
   * {@inheritdoc}
   */
  public function getUrl() {
    if (!isset($this->url)) {
      $this
        ->setUrl();
    }
    return $this->url;
  }

  /**
   * {@inheritdoc}
   */
  public function preSave(EntityStorageInterface $storage) {
    parent::preSave($storage);

    // Sets the default domain properly.

    /** @var self $default */
    $default = $storage
      ->loadDefaultDomain();
    if (!$default) {
      $this->is_default = TRUE;
    }
    elseif ($this->is_default && $default
      ->getDomainId() != $this
      ->getDomainId()) {

      // Swap the current default.
      $default->is_default = FALSE;
      $default
        ->save();
    }

    // Ensures we have a proper domain_id but does not erase existing ones.
    if ($this
      ->isNew() && empty($this
      ->getDomainId())) {
      $this
        ->createDomainId();
    }

    // Prevent duplicate hostname.
    $hostname = $this
      ->getHostname();

    // Do not use domain loader because it may change hostname.
    $existing = $storage
      ->loadByProperties([
      'hostname' => $hostname,
    ]);
    $existing = reset($existing);
    if ($existing && $this
      ->getDomainId() != $existing
      ->getDomainId()) {
      throw new ConfigValueException("The hostname ({$hostname}) is already registered.");
    }
  }

  /**
   * {@inheritdoc}
   */
  public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);

    // Invalidate cache tags relevant to domains.
    \Drupal::service('cache_tags.invalidator')
      ->invalidateTags([
      'rendered',
      'url.site',
    ]);
  }

  /**
   * {@inheritdoc}
   */
  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage, $entities);
    foreach ($entities as $entity) {
      $actions = $storage
        ->loadMultiple([
        'domain_default_action.' . $entity
          ->id(),
        'domain_delete_action.' . $entity
          ->id(),
        'domain_disable_action.' . $entity
          ->id(),
        'domain_enable_action.' . $entity
          ->id(),
      ]);
      foreach ($actions as $action) {
        $action
          ->delete();
      }
    }

    // Invalidate cache tags relevant to domains.
    \Drupal::service('cache_tags.invalidator')
      ->invalidateTags([
      'rendered',
      'url.site',
    ]);
  }

  /**
   * {@inheritdoc}
   */
  public function createDomainId() {

    // We cannot reliably use sequences (1, 2, 3) because those can be different
    // across environments. Instead, we use the crc32 hash function to create a
    // unique numeric id for each domain. In some systems (Windows?) we have
    // reports of crc32 returning a negative number. Issue #2794047.
    // If we don't use hash(), then crc32() returns different results for 32-
    // and 64-bit systems. On 32-bit systems, the number returned may also be
    // too large for PHP.
    // See #2908236.
    $id = hash('crc32', $this
      ->id());
    $id = abs(hexdec(substr($id, 0, -2)));
    $this
      ->createNumericId($id);
  }

  /**
   * Creates a unique numeric id for use in the {node_access} table.
   *
   * @param int $id
   *   An integer to use as the numeric id.
   */
  public function createNumericId($id) {

    // Ensure that this value is unique.
    $storage = \Drupal::entityTypeManager()
      ->getStorage('domain');
    $result = $storage
      ->loadByProperties([
      'domain_id' => $id,
    ]);
    if (empty($result)) {
      $this->domain_id = $id;
    }
    else {
      $id++;
      $this
        ->createNumericId($id);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getScheme($add_suffix = TRUE) {
    $scheme = $this->scheme;
    if ($scheme == 'variable') {
      $scheme = \Drupal::entityTypeManager()
        ->getStorage('domain')
        ->getDefaultScheme();
    }
    elseif ($scheme != 'https') {
      $scheme = 'http';
    }
    $scheme .= $add_suffix ? '://' : '';
    return $scheme;
  }

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

  /**
   * {@inheritdoc}
   */
  public function getResponse() {
    if (empty($this->response)) {
      $validator = \Drupal::service('domain.validator');
      $validator
        ->checkResponse($this);
    }
    return $this->response;
  }

  /**
   * {@inheritdoc}
   */
  public function setResponse($response) {
    $this->response = $response;
  }

  /**
   * {@inheritdoc}
   */
  public function getLink($current_path = TRUE) {
    $options = [
      'absolute' => TRUE,
      'https' => $this
        ->isHttps(),
    ];
    if ($current_path) {
      $url = Url::fromUri($this
        ->getUrl(), $options);
    }
    else {
      $url = Url::fromUri($this
        ->getPath(), $options);
    }
    return Link::fromTextAndUrl($this
      ->getCanonical(), $url)
      ->toString();
  }

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

  /**
   * {@inheritdoc}
   */
  public function setRedirect($code = 302) {
    $this->redirect = $code;
  }

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

  /**
   * {@inheritdoc}
   */
  public function setHostname($hostname) {
    $this->hostname = $hostname;
  }

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

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

  /**
   * {@inheritdoc}
   */
  public function setMatchType($match_type = DomainNegotiatorInterface::DOMAIN_MATCHED_EXACT) {
    $this->matchType = $match_type;
  }

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

  /**
   * {@inheritdoc}
   */
  public function getPort() {
    $ports = explode(':', $this
      ->getHostname());
    if (isset($ports[1])) {
      return ':' . $ports[1];
    }
    return '';
  }

  /**
   * {@inheritdoc}
   */
  public function setCanonical($hostname = NULL) {
    if (is_null($hostname)) {
      $this->canonical = $this
        ->getHostname();
    }
    else {
      $this->canonical = $hostname;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getCanonical() {
    if (empty($this->canonical)) {
      $this
        ->setCanonical();
    }
    return $this->canonical;
  }

  /**
   * Prevent render errors when Twig wants to read this object.
   *
   * @see \Drupal\Core\Template\TwigExtension::escapeFilter()
   *
   * @return string
   *   The name of the domain being rendered.
   */
  public function toString() {
    return $this->name;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigEntityBase::$isUninstalling private property Whether the config is being deleted by the uninstall process.
ConfigEntityBase::$langcode protected property The language code of the entity's default language.
ConfigEntityBase::$originalId protected property The original ID of the configuration entity.
ConfigEntityBase::$status protected property The enabled/disabled status of the configuration entity. 4
ConfigEntityBase::$third_party_settings protected property Third party entity settings.
ConfigEntityBase::$trustedData protected property Trust supplied data and not use configuration schema on save.
ConfigEntityBase::$uuid protected property The UUID for this entity.
ConfigEntityBase::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
ConfigEntityBase::calculateDependencies public function Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityInterface::calculateDependencies 13
ConfigEntityBase::createDuplicate public function Creates a duplicate of the entity. Overrides EntityBase::createDuplicate 1
ConfigEntityBase::get public function Returns the value of a property. Overrides ConfigEntityInterface::get
ConfigEntityBase::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides EntityBase::getCacheTagsToInvalidate 1
ConfigEntityBase::getConfigDependencyName public function Gets the configuration dependency name. Overrides EntityBase::getConfigDependencyName
ConfigEntityBase::getConfigManager protected static function Gets the configuration manager.
ConfigEntityBase::getConfigTarget public function Gets the configuration target identifier for the entity. Overrides EntityBase::getConfigTarget
ConfigEntityBase::getDependencies public function Gets the configuration dependencies. Overrides ConfigEntityInterface::getDependencies
ConfigEntityBase::getOriginalId public function Gets the original ID. Overrides EntityBase::getOriginalId
ConfigEntityBase::getThirdPartyProviders public function Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface::getThirdPartyProviders
ConfigEntityBase::getThirdPartySetting public function Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface::getThirdPartySetting
ConfigEntityBase::getThirdPartySettings public function Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface::getThirdPartySettings
ConfigEntityBase::getTypedConfig protected function Gets the typed config manager.
ConfigEntityBase::hasTrustedData public function Gets whether on not the data is trusted. Overrides ConfigEntityInterface::hasTrustedData
ConfigEntityBase::invalidateTagsOnDelete protected static function Override to never invalidate the individual entities' cache tags; the config system already invalidates them. Overrides EntityBase::invalidateTagsOnDelete
ConfigEntityBase::invalidateTagsOnSave protected function Override to never invalidate the entity's cache tag; the config system already invalidates it. Overrides EntityBase::invalidateTagsOnSave
ConfigEntityBase::isInstallable public function Checks whether this entity is installable. Overrides ConfigEntityInterface::isInstallable 2
ConfigEntityBase::isNew public function Overrides Entity::isNew(). Overrides EntityBase::isNew
ConfigEntityBase::isUninstalling public function Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface::isUninstalling
ConfigEntityBase::link public function Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase::link
ConfigEntityBase::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface::onDependencyRemoval 7
ConfigEntityBase::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase::preDelete 8
ConfigEntityBase::save public function Saves an entity permanently. Overrides EntityBase::save 1
ConfigEntityBase::set public function Sets the value of a property. Overrides ConfigEntityInterface::set
ConfigEntityBase::setOriginalId public function Sets the original ID. Overrides EntityBase::setOriginalId
ConfigEntityBase::setStatus public function Sets the status of the configuration entity. Overrides ConfigEntityInterface::setStatus
ConfigEntityBase::setThirdPartySetting public function Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface::setThirdPartySetting
ConfigEntityBase::setUninstalling public function
ConfigEntityBase::sort public static function Helper callback for uasort() to sort configuration entities by weight and label. 6
ConfigEntityBase::status public function Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface::status 4
ConfigEntityBase::toArray public function Gets an array of all property values. Overrides EntityBase::toArray 2
ConfigEntityBase::toUrl public function Gets the URL object for the entity. Overrides EntityBase::toUrl
ConfigEntityBase::trustData public function Sets that the data should be trusted. Overrides ConfigEntityInterface::trustData
ConfigEntityBase::unsetThirdPartySetting public function Unsets a third-party setting. Overrides ThirdPartySettingsInterface::unsetThirdPartySetting
ConfigEntityBase::url public function Gets the public URL for this entity. Overrides EntityBase::url
ConfigEntityBase::urlInfo public function Gets the URL object for the entity. Overrides EntityBase::urlInfo
ConfigEntityBase::__construct public function Constructs an Entity object. Overrides EntityBase::__construct 10
ConfigEntityBase::__sleep public function Overrides EntityBase::__sleep 4
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 1
DependencySerializationTrait::__wakeup public function 2
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency. Aliased as: addDependencyTrait
Domain::$canonical protected property The canonical hostname for the domain.
Domain::$domain_id protected property The domain record ID.
Domain::$hostname protected property The domain hostname (e.g. example.com).
Domain::$id protected property The ID of the domain entity.
Domain::$is_default protected property Indicates the default domain.
Domain::$matchType protected property The type of match returned by the negotiator.
Domain::$name protected property The domain list name (e.g. Drupal).
Domain::$path protected property The domain record base path, a calculated value.
Domain::$redirect protected property The redirect method to use, if needed.
Domain::$response protected property The domain record http response test (e.g. 200), a calculated value.
Domain::$scheme protected property The domain record protocol (e.g. http://).
Domain::$url protected property The domain record current url, a calculated value.
Domain::$weight protected property The domain record sort order.
Domain::addProperty public function Adds a property to the domain record. Overrides DomainInterface::addProperty
Domain::buildUrl public function Builds a link from a known internal path.
Domain::createDomainId public function Creates a unique domain id for this record. Overrides DomainInterface::createDomainId
Domain::createNumericId public function Creates a unique numeric id for use in the {node_access} table.
Domain::disable public function Disables the configuration entity. Overrides ConfigEntityBase::disable
Domain::enable public function Enables the configuration entity. Overrides ConfigEntityBase::enable
Domain::getCanonical public function Retrieves the canonical (registered) hostname for the domain. Overrides DomainInterface::getCanonical
Domain::getDomainId public function Gets the numeric id of the domain record. Overrides DomainInterface::getDomainId
Domain::getHostname public function Gets the hostname of the domain. Overrides DomainInterface::getHostname
Domain::getLink public function Returns a URL object for a domain. Overrides DomainInterface::getLink
Domain::getMatchType public function Gets the type of record match returned by the negotiator. Overrides DomainInterface::getMatchType
Domain::getPath public function Gets the path for a domain. Overrides DomainInterface::getPath
Domain::getPort public function Find the port used for the domain. Overrides DomainInterface::getPort
Domain::getRawPath public function Returns the raw path of the domain object, without the base url.
Domain::getRawScheme public function Returns the stored scheme value for a domain record. Overrides DomainInterface::getRawScheme
Domain::getRedirect public function Returns the redirect status of the current domain. Overrides DomainInterface::getRedirect
Domain::getResponse public function Retrieves the value of the response test. Overrides DomainInterface::getResponse
Domain::getScheme public function Returns the active scheme for a domain record. Overrides DomainInterface::getScheme
Domain::getUrl public function Gets the url for a domain. Overrides DomainInterface::getUrl
Domain::getWeight public function Gets the sort weight of the domain record. Overrides DomainInterface::getWeight
Domain::isActive public function Detects if the current domain is the active domain. Overrides DomainInterface::isActive
Domain::isDefault public function Detects if the current domain is the default domain. Overrides DomainInterface::isDefault
Domain::isHttps public function Detects if the domain uses https for links. Overrides DomainInterface::isHttps
Domain::postDelete public static function Acts on deleted entities before the delete hook is invoked. Overrides EntityBase::postDelete
Domain::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase::postSave
Domain::preCreate public static function Changes the values of an entity before it is created. Overrides EntityBase::preCreate
Domain::preSave public function Acts on an entity before the presave hook is invoked. Overrides ConfigEntityBase::preSave
Domain::saveDefault public function Makes a domain record the default. Overrides DomainInterface::saveDefault
Domain::saveProperty public function Saves a specific domain attribute. Overrides DomainInterface::saveProperty
Domain::setCanonical public function Sets the canonical (registered) hostname for the domain. Overrides DomainInterface::setCanonical
Domain::setHostname public function Sets the hostname of the domain. Overrides DomainInterface::setHostname
Domain::setMatchType public function Sets the type of record match returned by the negotiator. Overrides DomainInterface::setMatchType
Domain::setPath public function Sets the base path to this domain. Overrides DomainInterface::setPath
Domain::setRedirect public function Sets a redirect on the current domain. Overrides DomainInterface::setRedirect
Domain::setResponse public function Sets the value of the response test. Overrides DomainInterface::setResponse
Domain::setUrl public function Sets the domain-specific link to the current URL. Overrides DomainInterface::setUrl
Domain::toString public function Prevent render errors when Twig wants to read this object.
DomainInterface::DOMAIN_ADMIN_FIELD constant The name of the admin access control field.
EntityBase::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
EntityBase::$entityTypeId protected property The entity type.
EntityBase::$typedData protected property A typed data object wrapping this entity.
EntityBase::access public function Checks data value access. Overrides AccessibleInterface::access 1
EntityBase::bundle public function Gets the bundle of the entity. Overrides EntityInterface::bundle 1
EntityBase::create public static function Constructs a new entity object, without permanently saving it. Overrides EntityInterface::create
EntityBase::delete public function Deletes an entity permanently. Overrides EntityInterface::delete 2
EntityBase::enforceIsNew public function Enforces an entity to be new. Overrides EntityInterface::enforceIsNew
EntityBase::entityManager Deprecated protected function Gets the entity manager.
EntityBase::entityTypeBundleInfo protected function Gets the entity type bundle info service.
EntityBase::entityTypeManager protected function Gets the entity type manager.
EntityBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyTrait::getCacheContexts
EntityBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyTrait::getCacheMaxAge
EntityBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyTrait::getCacheTags
EntityBase::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityInterface::getConfigDependencyKey
EntityBase::getEntityType public function Gets the entity type definition. Overrides EntityInterface::getEntityType
EntityBase::getEntityTypeId public function Gets the ID of the type of the entity. Overrides EntityInterface::getEntityTypeId
EntityBase::getListCacheTagsToInvalidate protected function The list cache tags to invalidate for this entity.
EntityBase::getTypedData public function Gets a typed data object for this entity object. Overrides EntityInterface::getTypedData
EntityBase::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityInterface::hasLinkTemplate
EntityBase::id public function Gets the identifier. Overrides EntityInterface::id 11
EntityBase::label public function Gets the label of the entity. Overrides EntityInterface::label 6
EntityBase::language public function Gets the language of the entity. Overrides EntityInterface::language 1
EntityBase::languageManager protected function Gets the language manager.
EntityBase::linkTemplates protected function Gets an array link templates. 1
EntityBase::load public static function Loads an entity. Overrides EntityInterface::load
EntityBase::loadMultiple public static function Loads one or more entities. Overrides EntityInterface::loadMultiple
EntityBase::postCreate public function Acts on a created entity before hooks are invoked. Overrides EntityInterface::postCreate 4
EntityBase::postLoad public static function Acts on loaded entities. Overrides EntityInterface::postLoad 2
EntityBase::referencedEntities public function Gets a list of entities referenced by this entity. Overrides EntityInterface::referencedEntities 1
EntityBase::toLink public function Generates the HTML for a link to this entity. Overrides EntityInterface::toLink
EntityBase::uriRelationships public function Gets a list of URI relationships supported by this entity. Overrides EntityInterface::uriRelationships
EntityBase::urlRouteParameters protected function Gets an array of placeholders for this entity. 2
EntityBase::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface::uuid 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
PluginDependencyTrait::calculatePluginDependencies protected function Calculates and adds dependencies of a specific plugin instance. 1
PluginDependencyTrait::getPluginDependencies protected function Calculates and returns dependencies of a specific plugin instance.
PluginDependencyTrait::moduleHandler protected function Wraps the module handler. 1
PluginDependencyTrait::themeHandler protected function Wraps the theme handler. 1
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
SynchronizableEntityTrait::$isSyncing protected property Whether this entity is being created, updated or deleted through a synchronization process.
SynchronizableEntityTrait::isSyncing public function
SynchronizableEntityTrait::setSyncing public function