Commit b9287abf by Qiang Xue

minor fixes.

parent c3ce904a
...@@ -124,6 +124,10 @@ abstract class Application extends Module ...@@ -124,6 +124,10 @@ abstract class Application extends Module
* 'name' => 'extension name', * 'name' => 'extension name',
* 'version' => 'version number', * 'version' => 'version number',
* 'bootstrap' => 'BootstrapClassName', * 'bootstrap' => 'BootstrapClassName',
* 'alias' => [
* '@alias1' => 'to/path1',
* '@alias2' => 'to/path2',
* ],
* ] * ]
* ~~~ * ~~~
*/ */
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace yii\db; namespace yii\db;
use Yii;
use yii\base\InvalidConfigException; use yii\base\InvalidConfigException;
use yii\helpers\Inflector; use yii\helpers\Inflector;
use yii\helpers\StringHelper; use yii\helpers\StringHelper;
...@@ -376,6 +377,7 @@ class ActiveRecord extends BaseActiveRecord ...@@ -376,6 +377,7 @@ class ActiveRecord extends BaseActiveRecord
public function insert($runValidation = true, $attributes = null) public function insert($runValidation = true, $attributes = null)
{ {
if ($runValidation && !$this->validate($attributes)) { if ($runValidation && !$this->validate($attributes)) {
Yii::info('Model not inserted due to validation error.', __METHOD__);
return false; return false;
} }
$db = static::getDb(); $db = static::getDb();
...@@ -493,6 +495,7 @@ class ActiveRecord extends BaseActiveRecord ...@@ -493,6 +495,7 @@ class ActiveRecord extends BaseActiveRecord
public function update($runValidation = true, $attributes = null) public function update($runValidation = true, $attributes = null)
{ {
if ($runValidation && !$this->validate($attributes)) { if ($runValidation && !$this->validate($attributes)) {
Yii::info('Model not updated due to validation error.', __METHOD__);
return false; return false;
} }
$db = static::getDb(); $db = static::getDb();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment