Exemple #1
0
 public function beforeUpdate()
 {
     if (parent::beforeUpdate()) {
         return true;
     }
     return false;
 }
Exemple #2
0
 public function beforeSave()
 {
     if (parent::beforeSave()) {
         $this->_replace = true;
         return true;
     }
     return false;
 }
Exemple #3
0
 public function beforeUpdate()
 {
     if (parent::beforeUpdate()) {
         $this->updated = 'NOW():sql';
         $this->user_id_updated = $this->model_uset_id;
         return true;
     } else {
         return false;
     }
 }
Exemple #4
0
 public function __construct()
 {
     if (!self::$_msql) {
         self::$_msql = SafeMySQL::getInstance();
     }
     $this->setIsNewRecord(TRUE);
     $this->relations = $this->relations();
     $this->modelName = strtolower(get_class($this));
     $this->init();
 }
Exemple #5
0
 public function beforeSave()
 {
     if (parent::beforeSave()) {
         if (!$this->checkDublicateKey()) {
             return false;
         }
         return TRUE;
     } else {
         return false;
     }
 }
Exemple #6
0
 public function beforeSave()
 {
     if (parent::beforeSave()) {
         $this->clearUrl('url', 'return_url');
         if (!$this->smtp_id) {
             $this->smtp_id = null;
         }
         if (!$this->fulfillment_id) {
             $this->fulfillment_id = null;
         }
         return TRUE;
     } else {
         return false;
     }
 }
Exemple #7
0
 public function clearCache()
 {
     parent::clearCache();
     AF::cache()->delete('all_gateways');
 }
Exemple #8
0
 public function clearCache()
 {
     parent::clearCache();
     AF::cache()->delete('all_users_by_user_id');
 }
Exemple #9
0
 public function cloneModel($ids = null)
 {
     $this->profile_name = 'copy_' . $this->profile_name;
     return parent::cloneModel($ids);
 }
Exemple #10
0
 public function cloneModel($ids = null)
 {
     $this->shipping_name = 'copy_' . $this->shipping_name;
     return parent::cloneModel($ids);
 }
Exemple #11
0
 public function clearCache()
 {
     parent::clearCache();
     //Clear all ip_md5()
     $array = AF::cache()->get('array_ip');
     foreach ($array as $k => $v) {
         AF::cache()->delete($k);
     }
     AF::cache()->delete('array_ip');
 }
Exemple #12
0
 public function afterDelete()
 {
     parent::afterDelete();
     $sql = "DELETE FROM `events_products`\n                WHERE `product_id` = ?i";
     self::$_msql->query($sql, $this->product_id);
     $this->updateSites();
 }
Exemple #13
0
 public function clearCache()
 {
     parent::clearCache();
     $cacheID = 'distinct_event_types';
     AF::cache()->delete($cacheID);
 }
Exemple #14
0
 public function clearCache()
 {
     parent::clearCache();
     AF::cache()->delete('all_languages');
     AF::cache()->delete('all_countries');
 }
Exemple #15
0
 /**
  * Returns the static model of the specified AR class.
  * Please note that you should have this exact method in all your AFActiveRecord descendants!
  * @param string $className active record class name.
  * @return Affiliate the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
Exemple #16
0
 public function clearCache()
 {
     parent::clearCache();
     AF::cache()->delete('satets_by_state_name');
 }
Exemple #17
0
 public function fillAddressFromArray($arr, $address_type = 'shipping')
 {
     if ($address_type == 'billing') {
         $bArr = array();
         foreach ($arr as $key => $field) {
             if (stripos($key, 'billing_') !== false) {
                 $bArr[str_replace('billing_', '', $key)] = $field;
             }
         }
         $arr = $bArr;
     }
     // check for "blank" state
     if ($arr['state_id'] == '0') {
         $arr['state_id'] = '';
     }
     // lowercase country_id.  uppercase values are affecting queries
     $arr['country_id'] = strtolower($arr['country_id']);
     parent::fillFromArray($arr);
     $this->address_type = $address_type;
 }
Exemple #18
0
 public function beforeUpdate()
 {
     if (parent::beforeUpdate()) {
         // This is the temporary decision because we didn't have a created field before
         if ($this->created == '0000-00-00 00:00:00') {
             $this->created = 'NOW():sql';
         }
         return TRUE;
     } else {
         return false;
     }
 }
Exemple #19
0
 public function afterUpdate()
 {
     // Save the body_html and body_plain fields
     $this->saveBodyHtml();
     $this->saveBodyPlain();
     parent::afterUpdate();
 }
Exemple #20
0
 public function beforeUpdate()
 {
     if (!parent::beforeUpdate()) {
         return false;
     }
     $this->convertByMethod();
     return true;
 }
Exemple #21
0
 public function beforeSave()
 {
     if (parent::beforeSave()) {
         if ($this->IsNewRecord) {
             $this->created = 'NOW():sql';
         }
         //date("Y-m-d h:m:i", time());
         return true;
     }
     return false;
 }
Exemple #22
0
 public function delete()
 {
     $mFF = new FulfillmentField();
     $mFF->deleteFulfillmentFields($this->fulfillment_id);
     return parent::delete();
 }
Exemple #23
0
 public function afterDelete()
 {
     parent::afterDelete();
     //SiteApi::executeUpdate(2);
 }