Пример #1
0
 public function manageGuests($conditionArray = null)
 {
     try {
         $cache = new Rdine_Helper_CacheManager();
         $resdata = array();
         if (!($resdata = $cache->Fetch('ddrestaurantdata'))) {
             $db = $this->getDbTable();
             $select = $db->select()->from(array('cus' => 'rd.customer'), array('cusid', 'cusfirst_name', 'cuslast_name', 'cusmobile', 'cus_status'))->joinLeft(array('usr' => 'rd.user'), "usr.usrid = cus.cusfk_user", array("useremail" => "usr.usremail"))->order("cus.cusfirst_name")->setIntegrityCheck(false);
             if (sizeof($conditionArray) > 0) {
                 foreach ($conditionArray as $key => $value) {
                     if (strlen($value) > 0) {
                         if ($key == "resname") {
                             $select->where("{$key} ILIKE ?", "%" . $value . "%");
                         } else {
                             $select->where("{$key} = ?", $value);
                         }
                     }
                 }
             }
             $records = $db->fetchAll($select);
             $cache->Save($resdata, 'ddrestaurantdata');
             return $records;
         }
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage());
     }
 }
Пример #2
0
 /**
  * Fetches all the enquiry status basedata rows and saves in cache
  */
 public function fetchAll()
 {
     $cache = new Rdine_Helper_CacheManager();
     $enquirystatus = array();
     if (!($enquirystatus = $cache->Fetch('enquirystatus'))) {
         $where = array('status = ?' => true);
         $records = $this->getDbTable()->fetchAll($where);
         foreach ($records as $record) {
             $enquirystatus[] = new Application_Model_EnquiryStatus($record->toArray());
         }
         $cache->Save($enquirystatus, 'enquirystatus');
     } else {
         $enquirystatus = $cache->Fetch('enquirystatus');
     }
     $cache = null;
     return $enquirystatus;
 }
Пример #3
0
 public function fetchAll()
 {
     try {
         $cache = new Rdine_Helper_CacheManager();
         $timezonedata = array();
         if (!($timezonedata = $cache->Fetch('ddtimezonedata'))) {
             $where = array('status = ?' => true);
             $records = $this->getDbTable()->fetchAll($where);
             foreach ($records as $record) {
                 $timezonedata[] = new Application_Model_Timezomebd($record->toArray());
             }
             $cache->Save($timezonedata, 'ddtimezonedata');
         } else {
             $timezonedata = $cache->Fetch('ddtimezonedata');
         }
         $cache = null;
         return $timezonedata;
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage());
     }
 }
 public function fetchAll()
 {
     try {
         $cache = new Rdine_Helper_CacheManager();
         $sources = array();
         if (!($sources = $cache->Fetch('sources'))) {
             $where = array('status = ?' => true);
             $records = $this->getDbTable()->fetchAll($where);
             foreach ($records as $record) {
                 $sources[] = new Application_Model_SourceofRestaurant($record->toArray());
             }
             $cache->Save($sources, 'sources');
         } else {
             $sources = $cache->Fetch('sources');
         }
         $cache = null;
         return $sources;
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage());
     }
 }