You are here

interface DomainInterface in Domain Access 8

Provides an interface defining a domain entity.

Hierarchy

Expanded class hierarchy of DomainInterface

All classes that implement DomainInterface

34 files declare their use of DomainInterface
DefaultDomain.php in domain/src/Plugin/Action/DefaultDomain.php
DeleteDomain.php in domain/src/Plugin/Action/DeleteDomain.php
DisableDomain.php in domain/src/Plugin/Action/DisableDomain.php
domain.drush.inc in domain/domain.drush.inc
Drush commands for Domain Access.
domain.install in domain/domain.install
Install, update and uninstall functions for the Domain Access module.

... See full list

File

domain/src/DomainInterface.php, line 11

Namespace

Drupal\domain
View source
interface DomainInterface extends ConfigEntityInterface {

  /**
   * The name of the admin access control field.
   */
  const DOMAIN_ADMIN_FIELD = 'field_domain_admin';

  /**
   * Detects if the current domain is the active domain.
   *
   * @return bool
   *   TRUE if domain enabled, FALSE otherwise.
   */
  public function isActive();

  /**
   * Detects if the current domain is the default domain.
   *
   * @return bool
   *   TRUE if domain set as default, FALSE otherwise.
   */
  public function isDefault();

  /**
   * Detects if the domain uses https for links.
   *
   * @return bool
   *   TRUE if domain protocol is HTTPS, FALSE otherwise.
   */
  public function isHttps();

  /**
   * Makes a domain record the default.
   */
  public function saveDefault();

  /**
   * Saves a specific domain attribute.
   *
   * @param string $name
   *   The property key to save for the $domain object.
   * @param mixed $value
   *   The value to set for the property.
   */
  public function saveProperty($name, $value);

  /**
   * Sets the base path to this domain.
   */
  public function setPath();

  /**
   * Sets the domain-specific link to the current URL.
   */
  public function setUrl();

  /**
   * Gets the path for a domain.
   *
   * @return string
   *   A URL string for the base path to the domain. (e.g. http://example.com/)
   */
  public function getPath();

  /**
   * Gets the url for a domain.
   *
   * @return string
   *   A URL string for the current request on the requested domain. If the
   *   current request is /user the return would be http://example.com/user or
   *   http://one.example.com, depending on the current domain context.
   */
  public function getUrl();

  /**
   * Returns the active scheme for a domain record.
   *
   * This method is to be used when generating URLs.
   *
   * @param bool $add_suffix
   *   Tells the method to return :// after the string.
   *
   * @return string
   *   Returns a valid scheme (http or https), with or without the suffix.
   */
  public function getScheme($add_suffix = TRUE);

  /**
   * Returns the stored scheme value for a domain record.
   *
   * This method is to be used with forms and when saving domain records. It
   * returns the raw value (http|https|variable) of the domain's default scheme.
   *
   * @return string
   *   Returns a stored scheme default (http|https|variable) for the record.
   */
  public function getRawScheme();

  /**
   * Retrieves the value of the response test.
   *
   * @return int
   *   The HTTP response code of the domain test, expected to be 200.
   */
  public function getResponse();

  /**
   * Sets the value of the response test.
   *
   * @param int $response
   *   The HTTP response code to set.
   */
  public function setResponse($response);

  /**
   * Adds a property to the domain record.
   *
   * @param string $name
   *   The name of the property to retrieve.
   * @param mixed $value
   *   The value of the property.
   */
  public function addProperty($name, $value);

  /**
   * Returns a URL object for a domain.
   *
   * @param bool $current_path
   *   Indicates that the link should point to the path of the current request.
   *
   * @return \Drupal\Core\Url
   *   A core URL object.
   */
  public function getLink($current_path = TRUE);

  /**
   * Returns the redirect status of the current domain.
   *
   * @return int|null
   *   If numeric, the type of redirect to issue (301 or 302).
   */
  public function getRedirect();

  /**
   * Sets a redirect on the current domain.
   *
   * @param int $code
   *   A valid HTTP redirect code (301 or 302).
   */
  public function setRedirect($code = 302);

  /**
   * Gets the hostname of the domain.
   *
   * @return string
   *   The domain hostname.
   */
  public function getHostname();

  /**
   * Sets the hostname of the domain.
   *
   * @param string $hostname
   *   The hostname value to set, in the format example.com.
   */
  public function setHostname($hostname);

  /**
   * Gets the numeric id of the domain record.
   *
   * @return int
   *   The domain id.
   */
  public function getDomainId();

  /**
   * Gets the sort weight of the domain record.
   *
   * @return int
   *   The domain record sort weight.
   */
  public function getWeight();

  /**
   * Sets the type of record match returned by the negotiator.
   *
   * @param int $match_type
   *   A numeric constant indicating the type of match derived by the caller.
   *   Use this value to determine if the request needs to be overridden. Valid
   *   types are DomainNegotiatorInterface::DOMAIN_MATCH_NONE,
   *   DomainNegotiatorInterface::DOMAIN_MATCH_EXACT,
   *   DomainNegotiatorInterface::DOMAIN_MATCH_ALIAS.
   */
  public function setMatchType($match_type = DomainNegotiatorInterface::DOMAIN_MATCHED_EXACT);

  /**
   * Gets the type of record match returned by the negotiator.
   *
   * This value will be set by the domain negotiation routine and is not present
   * when loading a domain record via DomainStorageInterface.
   *
   * @return int
   *   The domain record match type.
   *
   * @see setMatchType()
   */
  public function getMatchType();

  /**
   * Find the port used for the domain.
   *
   * @return string
   *   An optional port string (e.g. ':8080') or an empty string;
   */
  public function getPort();

  /**
   * Creates a unique domain id for this record.
   */
  public function createDomainId();

  /**
   * Retrieves the canonical (registered) hostname for the domain.
   *
   * @return string
   *   A hostname string.
   */
  public function getCanonical();

  /**
   * Sets the canonical (registered) hostname for the domain.
   */
  public function setCanonical($hostname = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
AccessibleInterface::access public function Checks data value access. 9
CacheableDependencyInterface::getCacheContexts public function The cache contexts associated with this object. 34
CacheableDependencyInterface::getCacheMaxAge public function The maximum age for which this object may be cached. 34
CacheableDependencyInterface::getCacheTags public function The cache tags associated with this object. 27
ConfigEntityInterface::calculateDependencies public function Calculates dependencies and stores them in the dependency property. 2
ConfigEntityInterface::disable public function Disables the configuration entity. 2
ConfigEntityInterface::enable public function Enables the configuration entity. 2
ConfigEntityInterface::get public function Returns the value of a property. 2
ConfigEntityInterface::getDependencies public function Gets the configuration dependencies. 2
ConfigEntityInterface::hasTrustedData public function Gets whether on not the data is trusted. 2
ConfigEntityInterface::isInstallable public function Checks whether this entity is installable. 2
ConfigEntityInterface::isUninstalling public function Returns whether this entity is being changed during the uninstall process. 2
ConfigEntityInterface::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. 2
ConfigEntityInterface::set public function Sets the value of a property. 2
ConfigEntityInterface::setStatus public function Sets the status of the configuration entity. 2
ConfigEntityInterface::status public function Returns whether the configuration entity is enabled. 2
ConfigEntityInterface::trustData public function Sets that the data should be trusted. 2
DomainInterface::addProperty public function Adds a property to the domain record. 1
DomainInterface::createDomainId public function Creates a unique domain id for this record. 1
DomainInterface::DOMAIN_ADMIN_FIELD constant The name of the admin access control field.
DomainInterface::getCanonical public function Retrieves the canonical (registered) hostname for the domain. 1
DomainInterface::getDomainId public function Gets the numeric id of the domain record. 1
DomainInterface::getHostname public function Gets the hostname of the domain. 1
DomainInterface::getLink public function Returns a URL object for a domain. 1
DomainInterface::getMatchType public function Gets the type of record match returned by the negotiator. 1
DomainInterface::getPath public function Gets the path for a domain. 1
DomainInterface::getPort public function Find the port used for the domain. 1
DomainInterface::getRawScheme public function Returns the stored scheme value for a domain record. 1
DomainInterface::getRedirect public function Returns the redirect status of the current domain. 1
DomainInterface::getResponse public function Retrieves the value of the response test. 1
DomainInterface::getScheme public function Returns the active scheme for a domain record. 1
DomainInterface::getUrl public function Gets the url for a domain. 1
DomainInterface::getWeight public function Gets the sort weight of the domain record. 1
DomainInterface::isActive public function Detects if the current domain is the active domain. 1
DomainInterface::isDefault public function Detects if the current domain is the default domain. 1
DomainInterface::isHttps public function Detects if the domain uses https for links. 1
DomainInterface::saveDefault public function Makes a domain record the default. 1
DomainInterface::saveProperty public function Saves a specific domain attribute. 1
DomainInterface::setCanonical public function Sets the canonical (registered) hostname for the domain. 1
DomainInterface::setHostname public function Sets the hostname of the domain. 1
DomainInterface::setMatchType public function Sets the type of record match returned by the negotiator. 1
DomainInterface::setPath public function Sets the base path to this domain. 1
DomainInterface::setRedirect public function Sets a redirect on the current domain. 1
DomainInterface::setResponse public function Sets the value of the response test. 1
DomainInterface::setUrl public function Sets the domain-specific link to the current URL. 1
EntityInterface::bundle public function Gets the bundle of the entity. 2
EntityInterface::create public static function Constructs a new entity object, without permanently saving it. 2
EntityInterface::createDuplicate public function Creates a duplicate of the entity. 2
EntityInterface::delete public function Deletes an entity permanently. 2
EntityInterface::enforceIsNew public function Enforces an entity to be new. 2
EntityInterface::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. 2
EntityInterface::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. 2
EntityInterface::getConfigDependencyName public function Gets the configuration dependency name. 2
EntityInterface::getConfigTarget public function Gets the configuration target identifier for the entity. 2
EntityInterface::getEntityType public function Gets the entity type definition. 2
EntityInterface::getEntityTypeId public function Gets the ID of the type of the entity. 2
EntityInterface::getOriginalId public function Gets the original ID. 2
EntityInterface::getTypedData public function Gets a typed data object for this entity object. 2
EntityInterface::hasLinkTemplate public function Indicates if a link template exists for a given key. 2
EntityInterface::id public function Gets the identifier. 2
EntityInterface::isNew public function Determines whether the entity is new. 2
EntityInterface::label public function Gets the label of the entity. 2
EntityInterface::language public function Gets the language of the entity. 2
EntityInterface::link Deprecated public function Deprecated way of generating a link to the entity. See toLink(). 2
EntityInterface::load public static function Loads an entity. 2
EntityInterface::loadMultiple public static function Loads one or more entities. 2
EntityInterface::postCreate public function Acts on a created entity before hooks are invoked. 2
EntityInterface::postDelete public static function Acts on deleted entities before the delete hook is invoked. 2
EntityInterface::postLoad public static function Acts on loaded entities. 3
EntityInterface::postSave public function Acts on a saved entity before the insert or update hook is invoked. 2
EntityInterface::preCreate public static function Changes the values of an entity before it is created. 2
EntityInterface::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. 2
EntityInterface::preSave public function Acts on an entity before the presave hook is invoked. 2
EntityInterface::referencedEntities public function Gets a list of entities referenced by this entity. 2
EntityInterface::save public function Saves an entity permanently. 2
EntityInterface::setOriginalId public function Sets the original ID. 2
EntityInterface::toArray public function Gets an array of all property values. 3
EntityInterface::toLink public function Generates the HTML for a link to this entity. 2
EntityInterface::toUrl public function Gets the URL object for the entity. 2
EntityInterface::uriRelationships public function Gets a list of URI relationships supported by this entity. 2
EntityInterface::url Deprecated public function Gets the public URL for this entity. 2
EntityInterface::urlInfo Deprecated public function Gets the URL object for the entity. 2
EntityInterface::uuid public function Gets the entity UUID (Universally Unique Identifier). 2
RefinableCacheableDependencyInterface::addCacheableDependency public function Adds a dependency on an object: merges its cacheability metadata. 1
RefinableCacheableDependencyInterface::addCacheContexts public function Adds cache contexts. 1
RefinableCacheableDependencyInterface::addCacheTags public function Adds cache tags. 1
RefinableCacheableDependencyInterface::mergeCacheMaxAge public function Merges the maximum age (in seconds) with the existing maximum age. 1
SynchronizableInterface::isSyncing public function Returns whether this entity is being changed as part of a synchronization. 1
SynchronizableInterface::setSyncing public function Sets the status of the synchronization flag. 1
ThirdPartySettingsInterface::getThirdPartyProviders public function Gets the list of third parties that store information. 5
ThirdPartySettingsInterface::getThirdPartySetting public function Gets the value of a third-party setting. 5
ThirdPartySettingsInterface::getThirdPartySettings public function Gets all third-party settings of a given module. 5
ThirdPartySettingsInterface::setThirdPartySetting public function Sets the value of a third-party setting. 5
ThirdPartySettingsInterface::unsetThirdPartySetting public function Unsets a third-party setting. 5