|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
|
|
|
|
|
namespace yii\db; |
|
|
|
|
|
|
|
|
|
use Yii; |
|
|
|
|
use yii\base\InvalidConfigException; |
|
|
|
|
use yii\helpers\Inflector; |
|
|
|
|
use yii\helpers\StringHelper; |
|
|
|
@ -376,6 +377,7 @@ class ActiveRecord extends BaseActiveRecord
|
|
|
|
|
public function insert($runValidation = true, $attributes = null) |
|
|
|
|
{ |
|
|
|
|
if ($runValidation && !$this->validate($attributes)) { |
|
|
|
|
Yii::info('Model not inserted due to validation error.', __METHOD__); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
$db = static::getDb(); |
|
|
|
@ -493,6 +495,7 @@ class ActiveRecord extends BaseActiveRecord
|
|
|
|
|
public function update($runValidation = true, $attributes = null) |
|
|
|
|
{ |
|
|
|
|
if ($runValidation && !$this->validate($attributes)) { |
|
|
|
|
Yii::info('Model not updated due to validation error.', __METHOD__); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
$db = static::getDb(); |
|
|
|
|