public static function getUsuari($email)
 {
     $C = new Criteria();
     $C->add(UsuarisPeer::EMAIL, $email);
     $C->add(UsuarisPeer::ACTIU, true);
     return UsuarisPeer::doSelect($C);
 }
Beispiel #2
0
 public function getMailsUsuaris()
 {
     $RET = array();
     $IDL = $this->getIdllistes();
     $C = new Criteria();
     $C->add(UsuarisllistesPeer::LLISTES_IDLLISTES, $IDL);
     $C->addJoin(UsuarisllistesPeer::USUARIS_USUARISID, UsuarisPeer::USUARIID);
     foreach (UsuarisPeer::doSelect($C) as $U) {
         $RET[$U->getEmail()] = $U->getEmail();
     }
     return $RET;
 }
Beispiel #3
0
 public static function getSelectUsuarisPermis($APPID, $idS)
 {
     $RET = array();
     $C = new Criteria();
     $C = self::getCriteriaActiu($C, $idS);
     $C = UsuarisPeer::getCriteriaActiu($C, $idS);
     $C->addJoin(UsuarisPeer::USUARIID, self::USUARI_ID);
     foreach (UsuarisPeer::doSelect($C) as $U) {
         $RET[$U->getUsuariid()] = $U->getDni() . ' - ' . $U->getNomComplet();
     }
     return $RET;
 }
Beispiel #4
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(UsuarisPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(UsuarisPeer::DATABASE_NAME);
         $criteria->add(UsuarisPeer::USUARIID, $pks, Criteria::IN);
         $objs = UsuarisPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Beispiel #5
0
 public static function getDesvinculatsArray($IDL, $CERCA)
 {
     $SQL = "UsuariID not in (SELECT Usuaris_UsuarisID FROM usuarisllistes where Llistes_idLlistes = {$IDL}) ";
     $C = self::CercaUsuaris($CERCA);
     $C->add(UsuarisPeer::USUARIID, $SQL, Criteria::CUSTOM);
     $C->addAscendingOrderByColumn(UsuarisPeer::COG1);
     $C->addAscendingOrderByColumn(UsuarisPeer::COG2);
     $C->addAscendingOrderByColumn(UsuarisPeer::NOM);
     $RET = array();
     foreach (UsuarisPeer::doSelect($C) as $OU) {
         $RET[$OU->getUsuariid()] = $OU->getNomComplet();
     }
     return $RET;
 }
Beispiel #6
0
 /**
  * Gets an array of Usuaris objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this Nivells has previously been saved, it will retrieve
  * related Usuariss from storage. If this Nivells is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array Usuaris[]
  * @throws     PropelException
  */
 public function getUsuariss($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(NivellsPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collUsuariss === null) {
         if ($this->isNew()) {
             $this->collUsuariss = array();
         } else {
             $criteria->add(UsuarisPeer::NIVELLS_IDNIVELLS, $this->idnivells);
             UsuarisPeer::addSelectColumns($criteria);
             $this->collUsuariss = UsuarisPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(UsuarisPeer::NIVELLS_IDNIVELLS, $this->idnivells);
             UsuarisPeer::addSelectColumns($criteria);
             if (!isset($this->lastUsuarisCriteria) || !$this->lastUsuarisCriteria->equals($criteria)) {
                 $this->collUsuariss = UsuarisPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastUsuarisCriteria = $criteria;
     return $this->collUsuariss;
 }
Beispiel #7
0
 /**
  * Funci� que serveix per cercar usuaris que compleixen unes caracter�stiques i apareixen per un autocomplete.
  * @param $q Text a cercar
  * @param $lim Quants en busquem
  * @param $IDS Identificador de site
  * @return Array('clau'=>'Nom')
  * */
 public static function getSiteUsersCercaUser($q, $lim, $IDS)
 {
     $C = self::getCriteriaActiu(new Criteria());
     $C = UsuarisPeer::CriteriaCerca($q, $C);
     if ($IDS > 0) {
         $C->addJoin(UsuarisPeer::USUARIID, UsuarisSitesPeer::USUARI_ID);
         $C->add(UsuarisSitesPeer::SITE_ID, $IDS);
     }
     $C->setLimit($lim);
     foreach (UsuarisPeer::doSelect($C) as $U) {
         $RET[$U->getUsuariId()] = array('clau' => $U->getUsuariId(), 'text' => $U->getNomComplet());
     }
     return $RET;
 }