setLatin($latin); } if (!empty($eastAsia)) { $this->setEastAsia($eastAsia); } if (!empty($bidirectional)) { $this->setBidirectional($bidirectional); } } /** * Set the Latin Language * * @param string $latin * The value for the latin language * @return self */ public function setLatin($latin) { $this->validateLocale($latin); $this->latin = $latin; return $this; } /** * Get the Latin Language * * @return string|null */ public function getLatin() { return $this->latin; } /** * Set the Language ID * * @param int $langId * The value for the language ID * @return self * @see https://technet.microsoft.com/en-us/library/cc287874(v=office.12).aspx */ public function setLangId($langId) { $this->langId = $langId; return $this; } /** * Get the Language ID * * @return int */ public function getLangId() { return $this->langId; } /** * Set the East Asian Language * * @param string $eastAsia * The value for the east asian language * @return self */ public function setEastAsia($eastAsia) { $this->validateLocale($eastAsia); $this->eastAsia = $eastAsia; return $this; } /** * Get the East Asian Language * * @return string|null */ public function getEastAsia() { return $this->eastAsia; } /** * Set the Complex Script Language * * @param string $bidirectional * The value for the complex script language * @return self */ public function setBidirectional($bidirectional) { $this->validateLocale($bidirectional); $this->bidirectional = $bidirectional; return $this; } /** * Get the Complex Script Language * * @return string|null */ public function getBidirectional() { return $this->bidirectional; } /** * Validates that the language passed is in the format xx-xx * * @param string $locale * @return boolean */ private function validateLocale($locale) { if ($locale !== null && strstr($locale, '-') === false) { throw new \InvalidArgumentException($locale . ' is not a valid language code'); } } }