Page::define()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 21
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 Page extends Entitizer\Utils\Definition {
15
16
		use Entitizer\Common\Page;
17
18
		/**
19
		 * Define the entity fields
20
		 */
21
22
		protected function define() {
23
24
			# Add params
25
26
			$this->params->addInteger       ('visibility',          true, 1, true, VISIBILITY_DRAFT);
27
			$this->params->addInteger       ('access',              true, 1, true, ACCESS_PUBLIC);
28
			$this->params->addBoolean       ('locked',              true);
29
			$this->params->addTextual       ('slug',                true, 255, false, '');
30
			$this->params->addTextual       ('name',                true, 255, false, '');
31
			$this->params->addTextual       ('title',               true, 255, false, '');
32
			$this->params->addTextual       ('contents',            false, 0, false, '');
33
			$this->params->addTextual       ('description',         false, 0, false, '');
34
			$this->params->addTextual       ('keywords',            false, 0, false, '');
35
			$this->params->addBoolean       ('robots_index',        false);
36
			$this->params->addBoolean       ('robots_follow',       false);
37
			$this->params->addInteger       ('time_created',        false, 10, true, 0);
38
			$this->params->addInteger       ('time_modified',       false, 10, true, 0);
39
40
			# Add indexes
41
42
			$this->indexes->add             ('visibility');
43
			$this->indexes->add             ('access');
44
			$this->indexes->add             ('slug');
45
			$this->indexes->add             ('name');
46
			$this->indexes->add             ('title');
47
			$this->indexes->add             ('time_created');
48
			$this->indexes->add             ('time_modified');
49
		}
50
	}
51
}
52