protected function setLocale($locale) { if (!array_key_exists($locale, $this->getPossibleLanguages())) { throw new InvalidArgumentException('Invalid language'); } $this->locale = $locale; return $this; }