Ejemplo n.º 1
0
 public function getTargetLang()
 {
     $c = new Criteria();
     $c->add(CataloguePeer::CAT_ID, $this->getCatId());
     $catalogue = CataloguePeer::doSelectOne($c);
     if ($catalogue) {
         return $catalogue->getTargetLang();
     }
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
 /**
  * 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.*/
 }