Ejemplo n.º 1
0
 public function getCurrentProductI18n($culture = null)
 {
     if (is_null($culture)) {
         $culture = is_null($this->culture) ? sfPropel::getDefaultCulture() : $this->culture;
     }
     if (!isset($this->current_i18n[$culture])) {
         $obj = ProductI18nPeer::retrieveByPK($this->getId(), $culture);
         if ($obj) {
             $this->setProductI18nForCulture($obj, $culture);
         } else {
             $this->setProductI18nForCulture(new ProductI18n(), $culture);
             $this->current_i18n[$culture]->setCulture($culture);
         }
     }
     return $this->current_i18n[$culture];
 }
Ejemplo n.º 2
0
 /**
  * Returns the current translation.
  *
  * @return ProductI18n
  */
 public function getCurrentTranslation($culture = null)
 {
     if (null === $culture) {
         $culture = null === $this->culture ? sfPropel::getDefaultCulture() : $this->culture;
     }
     if (!isset($this->current_i18n[$culture])) {
         $object = $this->isNew() ? null : ProductI18nPeer::retrieveByPK($this->getPrimaryKey(), $culture);
         if ($object) {
             $this->setTranslationForCulture($object, $culture);
         } else {
             $this->setTranslationForCulture(new ProductI18n(), $culture);
             $this->current_i18n[$culture]->setCulture($culture);
         }
     }
     return $this->current_i18n[$culture];
 }
Ejemplo n.º 3
0
 public function getCurrentProductI18n()
 {
     if (!isset($this->current_i18n[$this->culture])) {
         $obj = ProductI18nPeer::retrieveByPK($this->getId(), $this->culture);
         if ($obj) {
             $this->setProductI18nForCulture($obj, $this->culture);
         } else {
             $this->setProductI18nForCulture(new ProductI18n(), $this->culture);
             $this->current_i18n[$this->culture]->setCulture($this->culture);
         }
     }
     return $this->current_i18n[$this->culture];
 }