DomainCreatorInterface.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace Drupal\domain;
  3. /**
  4. * Handles the creation of new domain records.
  5. *
  6. * @deprecated
  7. * This interface will be removed before the 8.1.0 release.
  8. */
  9. interface DomainCreatorInterface {
  10. /**
  11. * Creates a domain object for saving.
  12. *
  13. * @param array $values
  14. * The values to assign to the domain record.
  15. * Required values are: hostname, name.
  16. * Passing an empty array will create a domain from the current request.
  17. *
  18. * @return \Drupal\domain\DomainInterface
  19. * A domain record object.
  20. */
  21. public function createDomain(array $values = []);
  22. /**
  23. * Gets the hostname of the active request.
  24. *
  25. * @return string
  26. * The hostname string of the current request.
  27. */
  28. public function createHostname();
  29. /**
  30. * Creates a machine-name string from the hostname.
  31. *
  32. * This string is the primary key of the entity.
  33. *
  34. * @param string $hostname
  35. * The hostname of the domain record. If empty, the current request will be
  36. * used.
  37. *
  38. * @return string
  39. * A string containing A-Z, a-z, 0-9, and _ characters.
  40. */
  41. public function createMachineName($hostname = NULL);
  42. }