public function beforeSave()
 {
     parent::beforeSave();
     if ($this->isNew()) {
         $this->user_id = getUserID();
     }
 }
 public function beforeSave()
 {
     parent::beforeSave();
     if (!$this->regex) {
         $this->hostname = '^' . str_replace("\\*", ".*", preg_quote($this->hostname)) . '$';
     }
 }
 public function beforeSave()
 {
     parent::beforeSave();
     $default = getArrayVar(self::$_defaultOpts, $this->name);
     if ($this->value == null) {
         $this->value = $default;
     }
 }
 public function beforeSave()
 {
     parent::beforeSave();
     if ($this->isNew()) {
         $this->user_id = getUserID();
     }
     $this->slug = trim($this->cloakerAPIPath(), '/');
 }
 public function beforeSave()
 {
     parent::beforeSave();
     if ($this->isNew()) {
         $this->time = time();
         BTApp::importModel("ClickCounterModel");
         $cnt = ClickCounterModel::model()->getRow();
         $cnt->inc();
         $this->click_id = $cnt->click_count;
     }
 }
 public function beforeSave()
 {
     parent::beforeSave();
     $this->ip_from = ip2long($this->ip_from);
     $this->ip_to = ip2long($this->ip_to);
 }
 public function beforeSave()
 {
     parent::beforeSave();
     //handle password salting
     if ($this->plain_pass) {
         $this->pass_salt = self::generateSalt();
         $this->pass = self::saltPassword($this->plain_pass, $this->pass_salt);
     }
 }