Пример #1
0
 /**
  * Get or create a Propel Tranlation object for the given locale
  *
  * @param string $locale
  *
  * @return Translation
  */
 public function getOrCreateTranslationForLocale($locale)
 {
     foreach ($this->getTranslations() as $propelTranslation) {
         if ($propelTranslation->getLocale() == $locale) {
             return $propelTranslation;
         }
     }
     $propelTranslation = new PropelTranslation();
     $propelTranslation->setLocale($locale);
     $this->addTranslation($propelTranslation);
     return $propelTranslation;
 }