UnsafeValidator.php 916 Bytes
Newer Older
w  
Qiang Xue committed
1 2
<?php
/**
w  
Qiang Xue committed
3
 * UnsafeValidator class file.
w  
Qiang Xue committed
4 5
 *
 * @link http://www.yiiframework.com/
w  
Qiang Xue committed
6
 * @copyright Copyright &copy; 2008-2012 Yii Software LLC
w  
Qiang Xue committed
7 8 9
 * @license http://www.yiiframework.com/license/
 */

w  
Qiang Xue committed
10 11
namespace yii\validators;

w  
Qiang Xue committed
12
/**
w  
Qiang Xue committed
13
 * UnsafeValidator marks the associated attributes to be unsafe so that they cannot be massively assigned.
w  
Qiang Xue committed
14 15
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
w  
Qiang Xue committed
16
 * @since 2.0
w  
Qiang Xue committed
17
 */
w  
Qiang Xue committed
18
class UnsafeValidator extends Validator
w  
Qiang Xue committed
19 20 21 22 23 24
{
	/**
	 * @var boolean whether attributes listed with this validator should be considered safe for massive assignment.
	 * Defaults to false.
	 */
	public $safe = false;
w  
Qiang Xue committed
25

w  
Qiang Xue committed
26 27 28
	/**
	 * Validates the attribute of the object.
	 * If there is any error, the error message is added to the object.
w  
Qiang Xue committed
29
	 * @param \yii\base\Model $object the object being validated
w  
Qiang Xue committed
30 31
	 * @param string $attribute the attribute being validated
	 */
w  
Qiang Xue committed
32
	public function validateAttribute($object, $attribute)
w  
Qiang Xue committed
33 34 35 36
	{
	}
}