Skip to content

Commit

Permalink
Merge pull request #35 from gabrielsme/master
Browse files Browse the repository at this point in the history
Correções nas chamadas dos callbacks no padrão do Cake 2.5
  • Loading branch information
jrbasso committed Dec 5, 2014
2 parents 5d4a8b4 + 7913ff4 commit cbec239
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Model/Behavior/AjusteDataBehavior.php
Expand Up @@ -51,7 +51,7 @@ public function setup(Model $model, $config = array()) {
* @return boolean
* @access public
*/
public function beforeValidate(Model $model) {
public function beforeValidate(Model $model, $config = array()) {
return $this->ajustarDatas($model);
}

Expand All @@ -62,7 +62,7 @@ public function beforeValidate(Model $model) {
* @return boolean
* @access public
*/
public function beforeSave(Model $model) {
public function beforeSave(Model $model, $config = array()) {
return $this->ajustarDatas($model);
}

Expand Down
4 changes: 2 additions & 2 deletions Model/Behavior/AjusteFloatBehavior.php
Expand Up @@ -52,7 +52,7 @@ public function setup(Model $model, $config = array()) {
* @return boolean
* @access public
*/
public function beforeValidate(Model $model) {
public function beforeValidate(Model $model, $config = array()) {
foreach($model->data[$model->alias] as $field => $value) {
if ($model->hasField($field) && $model->_schema[$field]['type'] == 'float') {
if (!is_string($value) || preg_match('/^[0-9]+(\.[0-9]+)?$/', $value)) {
Expand Down Expand Up @@ -106,7 +106,7 @@ public function beforeFind(Model $model, $query) {
* @return void
* @access public
*/
public function beforeSave(Model $model) {
public function beforeSave(Model $model, $config = array()) {
$data =& $model->data[$model->alias];
foreach ($data as $name => $value) {
if (in_array($name, $this->floatFields[$model->alias])) {
Expand Down

0 comments on commit cbec239

Please sign in to comment.