function beforeSave($options = array())
 {
     parent::beforeSave($options);
     if (!isset($this->data['BuilderProject']['id'])) {
         $this->data['BuilderProject']['created_by_id'] = $this->loginUser['id'];
     }
     return true;
 }
Exemplo n.º 2
0
 public function beforeSave($options = array())
 {
     parent::beforeSave($options);
     $this->data['Customer']['sales_rape_cache'] = '';
     if (isset($this->data['Customer']['sales_representatives'])) {
         if (is_array($this->data['Customer']['sales_representatives']) && !empty($this->data['Customer']['sales_representatives'])) {
             $this->data['Customer']['sales_rape_cache'] = $this->createSearchCache($this->data['Customer']['sales_representatives']);
             $this->data['Customer']['sales_representatives'] = serialize($this->data['Customer']['sales_representatives']);
         }
     }
     if (isset($this->data['Customer']['sales_representative'])) {
         if (is_array($this->data['Customer']['sales_representative']) && !empty($this->data['Customer']['sales_representative'])) {
             $this->data['Customer']['sales_rape_cache'] = $this->createSearchCache($this->data['Customer']['sales_representative']);
             $this->data['Customer']['sales_representatives'] = serialize($this->data['Customer']['sales_representative']);
         }
     }
     return true;
 }