Menuitem::define()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
/**
4
 * @package Cadmium\System\Modules\Entitizer
5
 * @author Anton Romanov
6
 * @copyright Copyright (c) 2015-2017, Anton Romanov
7
 * @link http://cadmium-cms.com
8
 */
9
10
namespace Modules\Entitizer\Definition {
11
12
	use Modules\Entitizer;
13
14
	class Menuitem extends Entitizer\Utils\Definition {
15
16
		use Entitizer\Common\Menuitem;
17
18
		/**
19
		 * Define the entity fields
20
		 */
21
22
		protected function define() {
23
24
			# Add params
25
26
			$this->params->addBoolean       ('active',              false);
27
			$this->params->addInteger       ('position',            true, 2, true, 0);
28
			$this->params->addTextual       ('slug',                true, 255, false, '');
29
			$this->params->addTextual       ('text',                true, 255, false, '');
30
			$this->params->addInteger       ('target',              true, 1, true, TARGET_SELF);
31
32
			# Add indexes
33
34
			$this->indexes->add             ('active');
35
			$this->indexes->add             ('position');
36
		}
37
	}
38
}
39