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

UnsafeValidatorAnnotation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 16
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 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