Пример #1
0
 /**
  * This function checks the user session
  *
  *
  * @name verifySession
  *
  * @param string sSessionId
  * @return array
  */
 public function verifySession($sSessionId = NULL)
 {
     try {
         if ($sSessionId != NULL) {
             $this->sessionId = $sSessionId;
         } else {
             if ($this->sessionId == NULL) {
                 throw new Exception('session id was not set.');
             }
         }
         $date = date('Y-m-d H:i:s');
         $oCriteria = new Criteria('workflow');
         $oCriteria->addSelectColumn(SessionPeer::USR_UID);
         $oCriteria->addSelectColumn(SessionPeer::SES_STATUS);
         $oCriteria->addSelectColumn(SessionPeer::SES_DUE_DATE);
         $oCriteria->add(SessionPeer::SES_UID, $this->sessionId);
         $oCriteria->add(SessionPeer::SES_STATUS, 'ACTIVE');
         $oCriteria->add(SessionPeer::SES_DUE_DATE, $date, Criteria::GREATER_EQUAL);
         $oDataset = SessionPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         $aRow = $oDataset->getRow();
         if (!is_array($aRow)) {
             $this->deleteTmpfile();
         }
         return $aRow;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
Пример #2
0
 /**
  * Method to do selects.
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      Connection $con
  * @return     array Array of selected Objects
  * @throws     PropelException Any exceptions caught during processing will be
  *       rethrown wrapped into a PropelException.
  */
 public static function doSelect(Criteria $criteria, $con = null)
 {
     return SessionPeer::populateObjects(SessionPeer::doSelectRS($criteria, $con));
 }