Browse Source

minor fixes.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
b9287abf81
  1. 4
      framework/base/Application.php
  2. 3
      framework/db/ActiveRecord.php

4
framework/base/Application.php

@ -124,6 +124,10 @@ abstract class Application extends Module
* 'name' => 'extension name',
* 'version' => 'version number',
* 'bootstrap' => 'BootstrapClassName',
* 'alias' => [
* '@alias1' => 'to/path1',
* '@alias2' => 'to/path2',
* ],
* ]
* ~~~
*/

3
framework/db/ActiveRecord.php

@ -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();

Loading…
Cancel
Save