示例#1
0
 public function save($data)
 {
     $return = parent::save($data);
     if ($return) {
         if (isset($data['is_default']) && (int) $data['is_default'] == 1) {
             $id = (int) $this->getState($this->getName() . '.id');
             if ($id > 0) {
                 $db = JFactory::getDbo();
                 $db->setQuery('update #__djc2_customer_groups set is_default=0 where id !=' . $id);
                 if (!$db->query()) {
                     $this->setError($db->getErrorMsg());
                     return false;
                 }
             }
         }
     }
     return $return;
 }
示例#2
0
 public function save($data)
 {
     return parent::save($data);
 }
示例#3
0
 public function save($data)
 {
     $new_status = $data['status'];
     $old_status = false;
     if ((int) $data['id'] > 0) {
         $table = $this->getTable();
         $table->load((int) $data['id']);
         $old_status = $table->status;
     }
     if (!parent::save($data)) {
         return false;
     }
     $id = $this->getState($this->getName() . '.id');
     $table = $this->getTable();
     if ($table->load((int) $id) && $table->status != $old_status && !empty($table->email)) {
         $data = $table->getProperties();
         foreach ($data['items'] as $k => $v) {
             $data['items'][$k] = JArrayHelper::fromObject($v);
         }
         return $this->_sendEmail($data);
     }
     return true;
 }
示例#4
0
 public function save($data)
 {
     if (!parent::save($data)) {
         return false;
     }
     return true;
 }