Completed
Push — master ( 41fefb...679c1c )
by Peter
13:55
created

UnsafeValidatorAnnotation::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL or Commercial license.
5
 *
6
 * @package maslosoft/mangan
7
 * @licence AGPL or Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]>
9
 * @copyright Copyright (c) Maslosoft
10
 * @copyright Copyright (c) Others as mentioned in code
11
 * @link http://maslosoft.com/mangan/
12
 */
13
14
namespace Maslosoft\Mangan\Annotations\Validators;
15
16
/**
17
 * CUnsafeValidator marks the associated attributes to be unsafe so that they cannot be massively assigned.
18
 *
19
 * @author Qiang Xue <[email protected]>
20
 * @version $Id$
21
 * @package system.validators
22
 * @since 1.0
23
 */
24
class UnsafeValidatorAnnotation extends ValidatorAnnotation
25
{
26
27
	/**
28
	 * @var boolean whether attributes listed with this validator should be considered safe for massive assignment.
29
	 * Defaults to false.
30
	 * @since 1.1.4
31
	 */
32
	public $safe = false;
33
34 1
	public function init()
35
	{
36 1
		$this->_entity->safe = false;
37 1
	}
38
39
}
40