public function getTargetLang() { $c = new Criteria(); $c->add(CataloguePeer::CAT_ID, $this->getCatId()); $catalogue = CataloguePeer::doSelectOne($c); if ($catalogue) { return $catalogue->getTargetLang(); } }
/** * Get the associated Catalogue object * * @param PropelPDO Optional Connection object. * @return Catalogue The associated Catalogue object. * @throws PropelException */ public function getCatalogue(PropelPDO $con = null) { if ($this->aCatalogue === null && ($this->id_idioma !== "" && $this->id_idioma !== null)) { $c = new Criteria(CataloguePeer::DATABASE_NAME); $c->add(CataloguePeer::CAT_ID, $this->id_idioma); $this->aCatalogue = CataloguePeer::doSelectOne($c, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aCatalogue->addUsuarios($this); */ } return $this->aCatalogue; }
/** * Función que devuelve el idioma del usuario actual. * @return string, idioma del usuario actual * @version 16-02-09 * @author Ana Martín */ public static function getIdiomaUsuarioActual() { $cultura = sfContext::getInstance()->getUser()->getCulture(); $c = new Criteria(); $c->add(CataloguePeer::TARGET_LANG, $cultura); $idioma = CataloguePeer::doSelectOne($c); if ($idioma) { return $idioma->getCatId(); } else { return self::IDIOMA_DEFAULT; } /* Ana: 12-11-2008 El idioma por defecto del usuario actual solo se tiene en cuenta la primera vez que entras. Las siguientes tiene que coger la cultura que exista.*/ }