예제 #1
0
 /**
  * @param   request daily_prices_config  prices config information
  * @see modules/DailyPrices/js/config.js
  * @return 	json    json array information: success or failure
  */
 function configupdateJsonAction()
 {
     $fields = $this->_getParam('daily_prices_config', array());
     $model = new RM_DailyPricesConfig();
     foreach ($fields as $name => $value) {
         $configRow = $model->find($name)->current();
         $configRow->value = $value;
         $configRow->save();
     }
     return array('data' => array('success' => true));
 }
예제 #2
0
 /**
  * Check is input day is weekend.
  *
  * @param Zend_Db_Table_Row
  * @param RM_Date $day
  * @return bool
  */
 public function isWeekend($unit, $day)
 {
     $dayNumber = $day->getWeekday();
     $weekend = $this->fetchValueByUnit($unit->id, 'weekend_days');
     return RM_DailyPricesConfig::isWeekend($weekend, $dayNumber);
 }