From e3f6faf5756cd4105f6c371708a9878a762a72f6 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Tue, 7 May 2013 18:40:31 +0400 Subject: [PATCH] && => || fix --- framework/db/ActiveRecord.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/db/ActiveRecord.php b/framework/db/ActiveRecord.php index 87d4809..16c3f77 100644 --- a/framework/db/ActiveRecord.php +++ b/framework/db/ActiveRecord.php @@ -667,7 +667,7 @@ class ActiveRecord extends Model */ public function insert($runValidation = true, $attributes = null) { - if ($runValidation && !$this->validate($attributes) && !$this->beforeSave(true)) { + if ($runValidation && !$this->validate($attributes) || !$this->beforeSave(true)) { return false; } $values = $this->getDirtyAttributes($attributes); @@ -747,7 +747,7 @@ class ActiveRecord extends Model */ public function update($runValidation = true, $attributes = null) { - if ($runValidation && !$this->validate($attributes) && !$this->beforeSave(false)) { + if ($runValidation && !$this->validate($attributes) || !$this->beforeSave(false)) { return false; } $values = $this->getDirtyAttributes($attributes);