You are here

interface DomainStorageInterface in Domain Access 8

Provides an interface for domain entity storage.

Hierarchy

Expanded class hierarchy of DomainStorageInterface

All classes that implement DomainStorageInterface

4 files declare their use of DomainStorageInterface
Domain.php in domain/src/Plugin/views/access/Domain.php
DomainAccessContent.php in domain_access/src/Plugin/views/access/DomainAccessContent.php
DomainAliasForm.php in domain_alias/src/DomainAliasForm.php
DomainControllerBase.php in domain/src/Controller/DomainControllerBase.php

File

domain/src/DomainStorageInterface.php, line 10

Namespace

Drupal\domain
View source
interface DomainStorageInterface extends ConfigEntityStorageInterface {

  /**
   * Gets the default domain object.
   *
   * @return \Drupal\domain\DomainInterface|null
   *   The default domain record or NULL.
   */
  public function loadDefaultDomain();

  /**
   * Returns the id of the default domain.
   *
   * @return int|bool
   *   The id of the default domain or FALSE if none is set.
   */
  public function loadDefaultId();

  /**
   * Loads multiple domains and sorts by weight.
   *
   * @param array $ids
   *   An optional array of specific ids to load.
   *
   * @return \Drupal\domain\DomainInterface[]
   *   An array of domain records.
   */
  public function loadMultipleSorted(array $ids = NULL);

  /**
   * Loads a domain record by hostname lookup.
   *
   * @param string $hostname
   *   A hostname string, in the format example.com.
   *
   * @return \Drupal\domain\DomainInterface|null
   *   The domain record or NULL.
   */
  public function loadByHostname($hostname);

  /**
   * Returns the list of domains formatted for a form options list.
   *
   * @return array
   *   A weight-sorted array of id => label for use in forms.
   */
  public function loadOptionsList();

  /**
   * Sorts domains by weight.
   *
   * For use by loadMultipleSorted().
   *
   * @param DomainInterface $a
   *   The first Domain object to sort.
   * @param DomainInterface $b
   *   The Domain object to compare against.
   *
   * @return bool
   *   Wether the first domain weight is greater or not.
   */
  public function sort(DomainInterface $a, DomainInterface $b);

  /**
   * Gets the entity field schema for domain records.
   *
   * @return array
   *   An array representing the field schema of the object.
   */
  public function loadSchema();

  /**
   * Removes www. prefix from a hostname, if set.
   *
   * @param string $hostname
   *   A hostname.
   *
   * @return string
   *   The cleaned hostname.
   */
  public function prepareHostname($hostname);

  /**
   * Gets the hostname of the active request.
   *
   * @return string
   *   The hostname string of the current request.
   */
  public function createHostname();

  /**
   * Creates a machine-name string from the hostname.
   *
   * This string is the primary key of the entity.
   *
   * @param string $hostname
   *   The hostname of the domain record. If empty, the current request will be
   *   used.
   *
   * @return string
   *   A string containing A-Z, a-z, 0-9, and _ characters.
   */
  public function createMachineName($hostname = NULL);

  /**
   * Returns the default http/https scheme for the site.
   *
   * This function helps us account for variable schemes across environments.
   *
   * @return string
   *   A string representation of s scheme (http|https).
   */
  public function getDefaultScheme();

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigEntityStorageInterface::createFromStorageRecord public function Creates a configuration entity from storage values. 1
ConfigEntityStorageInterface::getIDFromConfigName public static function Extracts the configuration entity ID from the full configuration name. 1
ConfigEntityStorageInterface::loadMultipleOverrideFree public function Loads one or more entities in their original form without overrides. 1
ConfigEntityStorageInterface::loadOverrideFree public function Loads one entity in their original form without overrides. 1
ConfigEntityStorageInterface::updateFromStorageRecord public function Updates a configuration entity from storage values. 1
DomainStorageInterface::createHostname public function Gets the hostname of the active request. 1
DomainStorageInterface::createMachineName public function Creates a machine-name string from the hostname. 1
DomainStorageInterface::getDefaultScheme public function Returns the default http/https scheme for the site. 1
DomainStorageInterface::loadByHostname public function Loads a domain record by hostname lookup. 1
DomainStorageInterface::loadDefaultDomain public function Gets the default domain object. 1
DomainStorageInterface::loadDefaultId public function Returns the id of the default domain. 1
DomainStorageInterface::loadMultipleSorted public function Loads multiple domains and sorts by weight. 1
DomainStorageInterface::loadOptionsList public function Returns the list of domains formatted for a form options list. 1
DomainStorageInterface::loadSchema public function Gets the entity field schema for domain records. 1
DomainStorageInterface::prepareHostname public function Removes www. prefix from a hostname, if set. 1
DomainStorageInterface::sort public function Sorts domains by weight. 1
EntityStorageInterface::create public function Constructs a new entity object, without permanently saving it. 1
EntityStorageInterface::delete public function Deletes permanently saved entities. 1
EntityStorageInterface::deleteRevision public function Delete a specific entity revision. 4
EntityStorageInterface::FIELD_LOAD_CURRENT constant Load the most recent version of an entity's field data.
EntityStorageInterface::FIELD_LOAD_REVISION constant Load the version of an entity's field data specified in the entity.
EntityStorageInterface::getAggregateQuery public function Gets an aggregated query instance. 1
EntityStorageInterface::getEntityType public function Gets the entity type definition. 1
EntityStorageInterface::getEntityTypeId public function Gets the entity type ID. 1
EntityStorageInterface::getQuery public function Gets an entity query instance. 1
EntityStorageInterface::hasData public function Determines if the storage contains any data. 1
EntityStorageInterface::load public function Loads one entity. 1
EntityStorageInterface::loadByProperties public function Load entities by their property values. 1
EntityStorageInterface::loadMultiple public function Loads one or more entities. 1
EntityStorageInterface::loadRevision public function Load a specific entity revision. 4
EntityStorageInterface::loadUnchanged public function Loads an unchanged entity from the database. 1
EntityStorageInterface::resetCache public function Resets the internal, static entity cache. 1
EntityStorageInterface::restore public function Restores a previously saved entity. 1
EntityStorageInterface::save public function Saves the entity permanently. 1