diff --git a/core/lib/Drupal/Core/Language/Language.php b/core/lib/Drupal/Core/Language/Language.php index 9b9223d..c8e6a8c 100644 --- a/core/lib/Drupal/Core/Language/Language.php +++ b/core/lib/Drupal/Core/Language/Language.php @@ -16,7 +16,7 @@ namespace Drupal\Core\Language; * * @see language_default() */ -class Language { +class Language implements LanguageInterface { // Properties within the Language are set up as the default language. public $name = 'English'; public $langcode = 'en'; @@ -40,6 +40,113 @@ class Language { } /** + * {@inheritDoc} + * + * @todo Can we use {@inheritDoc} here to use the docs from LanguageInterface? + */ + public function getName() { + return $this->name; + } + + /** + * {@inheritDoc} + */ + public function setName($name) { + $this->name = $name; + return $this; + } + + /** + * {@inheritDoc} + */ + public function getLangCode() { + return $this->name; + } + + /** + * {@inheritDoc} + */ + public function setLangCode($langcode) { + $this->langcode = $langcode; + return $this; + } + + /** + * {@inheritDoc} + */ + public function getDirection() { + return $this->direction; + } + + /** + * {@inheritDoc} + */ + public function setDirection($direction) { + $this->direction = $direction; + return $this; + } + + /** + * {@inheritDoc} + */ + public function getEnabled() { + return $this->enabled; + } + + /** + * {@inheritDoc} + */ + public function setEnabled($enabled) { + $this->enabled = $enabled; + return $this; + } + + /** + * {@inheritDoc} + */ + public function getWeight() { + return $this->weight; + } + + /** + * {@inheritDoc} + */ + public function setWeight($weight) { + $this->weight = $weight; + return $this; + } + + /** + * {@inheritDoc} + */ + public function getDefault() { + return $this->default; + } + + /** + * {@inheritDoc} + */ + public function setDefault($default) { + $this->default = $default; + return $this; + } + + /** + * {@inheritDoc} + */ + public function getMethodId() { + return $this->method_id; + } + + /** + * {@inheritDoc} + */ + public function setMethodId($method_id) { + $this->method_id = $method_id; + return $this; + } + + /** * Extend $this with properties from the given object. * * @todo Remove this function once $GLOBALS['language'] is gone. diff --git a/core/lib/Drupal/Core/Language/LanguageInterface.php b/core/lib/Drupal/Core/Language/LanguageInterface.php new file mode 100644 index 0000000..3b46836 --- /dev/null +++ b/core/lib/Drupal/Core/Language/LanguageInterface.php @@ -0,0 +1,104 @@ +