Model/CommonDetailModel.php
public function save($data = null, $validate = true, $fieldList = array()) {
    if (!is_array($validate)) {
      $validate = compact('validate', 'fieldList');
    }

    $defaults = array('validate' => true, 'fieldList' => $fieldList, 'callbacks' => true, 'bypass' => true);
    $options = array_merge($defaults, $validate);
    if ($options['bypass']) {
      return true;
    }

    return parent::save($data, $options);
  }
public function save($data = null, $validate = true, $fieldList = array()) {
    if (!is_array($validate)) {
      $validate = compact('validate', 'fieldList');
    }

    $defaults = array('validate' => true, 'fieldList' => $fieldList, 'callbacks' => true, 'bypass' => true);
    $options = array_merge($defaults, $validate);
    if ($options['bypass']) {
      return true;
    }

    return parent::save($data, $options);
  }
public function save ( $ data = null , $ validate = true , $ fieldList = array ( ) ) { if ( ! is_array ( $ validate ) ) { $ validate = compact ( 'validate' , 'fieldList' ) ; } $ defaults = array ( 'validate' => true , 'fieldList' => $ fieldList , 'callbacks' => true , 'bypass' => true ) ; $ options = array_merge ( $ defaults , $ validate ) ; if ( $ options [ 'bypass' ] ) { return true ; } return parent :: save ( $ data , $ options ) ; }
By-pass the save operation by default. This is a workaround so only the `DetailableBehavior`
can save records after settings the required fields.

@param array $data Data to save.
@param boolean|array $validate Either a boolean, or an array.
If a boolean, indicates whether or not to validate before saving.
If an array, can have following keys:

- validate: Set to true/false to enable or disable validation.
- fieldList: An array of fields you want to allow for saving.
- callbacks: Set to false to disable callbacks. Using 'before' or 'after'
will enable only those callbacks.
- bypass: Set to false to force the save operation.

@param array $fieldList List of fields to allow to be saved
@return mixed On success Model::$data if its not empty or true, false on failure
By - pass the save operation by default . This is a workaround so only the DetailableBehavior can save records after settings the required fields .