Total Complexity | 4 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class CustomBehaviorForm extends Model { |
||
12 | public $name; |
||
13 | public $category_id; |
||
14 | |||
15 | private $user; |
||
16 | private $categories; |
||
17 | |||
18 | /** |
||
19 | * Creates a form model |
||
20 | * |
||
21 | * @param object $user |
||
22 | * @param array $config name-value pairs that will be used to initialize the object properties |
||
23 | */ |
||
24 | public function __construct(\common\interfaces\UserInterface $user, \common\interfaces\CategoryInterface $category, $config = []) { |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @inheritdoc |
||
32 | * @codeCoverageIgnore |
||
33 | */ |
||
34 | public function rules() { |
||
35 | return [ |
||
36 | [['name', 'category_id'], 'required'], |
||
37 | ['name', 'filter', 'filter' => 'trim'], |
||
38 | ['category_id', 'integer'], |
||
39 | ['category_id', 'in', 'range'=>array_keys($this->categories)], |
||
40 | |||
41 | ]; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @codeCoverageIgnore |
||
46 | */ |
||
47 | public function attributeLabels() { |
||
48 | return [ |
||
49 | 'name' => 'Behavior Name', |
||
50 | 'category_id' => 'Behavior Category', |
||
51 | ]; |
||
52 | } |
||
53 | |||
54 | |||
55 | public function save() { |
||
61 | } |
||
62 | } |
||
63 |