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

User::define()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 26
rs 8.8571
cc 1
eloc 19
nc 1
nop 0
1
<?php
2
3
namespace Modules\Entitizer\Definition {
4
5
	use Modules\Entitizer;
6
7
	class User extends Entitizer\Utils\Definition {
8
9
		use Entitizer\Common\User;
10
11
		# Define presets
12
13
		protected function define() {
14
15
			# Add params
16
17
			$this->params->integer      ('rank',                true, 1, true, RANK_GUEST);
18
			$this->params->textual      ('name',                true, 16, false, '');
19
			$this->params->textual      ('email',               true, 128, false, '');
20
			$this->params->textual      ('auth_key',            true, 40, true, '');
21
			$this->params->textual      ('password',            true, 40, true, '');
22
			$this->params->textual      ('first_name',          true, 255, false, '');
23
			$this->params->textual      ('last_name',           true, 255, false, '');
24
			$this->params->integer      ('sex',                 true, 1, true, SEX_NOT_SELECTED);
25
			$this->params->textual      ('city',                true, 255, false, '');
26
			$this->params->textual      ('country',             true, 2, false, '');
27
			$this->params->textual      ('timezone',            true, 40, false, '');
28
			$this->params->integer      ('time_registered',     false, 10, true, 0);
29
			$this->params->integer      ('time_logged',         false, 10, true, 0);
30
31
			# Add indexes
32
33
			$this->indexes->add         ('rank');
34
			$this->indexes->add         ('name',                'UNIQUE');
35
			$this->indexes->add         ('email',               'UNIQUE');
36
			$this->indexes->add         ('time_registered');
37
			$this->indexes->add         ('time_logged');
38
		}
39
	}
40
}
41