yiisoft/yii — pull request #2607 by creocoder (2013-07-05 08:46:21+00:00)
Title: (CModel::prependValidator(), CModel::appendValidator()) (Enh #2259 rework)

Previously there was added `CModel::addValidator()`. This is absolluttley wrong from API point of view. If we allow append validator to the list we should allow prepend validator in the list. Because validator order sometimes is very important thing. Also prepend need for behaviors like this:

```php
namespace common\components;

class DefaultNullBehavior extends \CModelBehavior
{
public function beforeValidate($event)
{
$this->owner->addValidator('default', $this->owner->safeAttributeNames, array('value' => null));
}
}

```