Completed
Branch 0.3.0 (b16461)
by Anton
04:03
created

Page::define()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 28
rs 8.8571
cc 1
eloc 21
nc 1
nop 0
1
<?php
2
3
namespace Modules\Entitizer\Definition {
4
5
	use Modules\Entitizer;
6
7
	class Page extends Entitizer\Utils\Definition {
8
9
		use Entitizer\Common\Page;
10
11
		# Define presets
12
13
		protected function define() {
14
15
			# Add params
16
17
			$this->params->integer      ('visibility',          true, 1, true, VISIBILITY_DRAFT);
18
			$this->params->integer      ('access',              true, 1, true, ACCESS_PUBLIC);
19
			$this->params->boolean      ('locked',              true);
20
			$this->params->textual      ('slug',                true, 255, false, '');
21
			$this->params->textual      ('name',                true, 255, false, '');
22
			$this->params->textual      ('title',               true, 255, false, '');
23
			$this->params->textual      ('contents',            false, 0, false, '');
24
			$this->params->textual      ('description',         false, 0, false, '');
25
			$this->params->textual      ('keywords',            false, 0, false, '');
26
			$this->params->boolean      ('robots_index',        false);
27
			$this->params->boolean      ('robots_follow',       false);
28
			$this->params->integer      ('time_created',        false, 10, true, 0);
29
			$this->params->integer      ('time_modified',       false, 10, true, 0);
30
31
			# Add indexes
32
33
			$this->indexes->add         ('visibility');
34
			$this->indexes->add         ('access');
35
			$this->indexes->add         ('slug');
36
			$this->indexes->add         ('name');
37
			$this->indexes->add         ('title');
38
			$this->indexes->add         ('time_created');
39
			$this->indexes->add         ('time_modified');
40
		}
41
	}
42
}
43