Code Duplication    Length = 24-27 lines in 3 locations

www/engine/System/Classes/Modules/Entitizer/Definition/User/Secret.php 1 location

@@ 14-40 (lines=27) @@
11
12
	use Modules\Entitizer;
13
14
	class Secret extends Entitizer\Utils\Definition {
15
16
		use Entitizer\Common\User\Secret;
17
18
		/**
19
		 * Define the entity fields
20
		 */
21
22
		protected function define() {
23
24
			# Add params
25
26
			$this->params->addTextual       ('code',                true, 40, true, '');
27
			$this->params->addTextual       ('ip',                  true, 255, false, '');
28
			$this->params->addInteger       ('time',                false, 10, true, 0);
29
30
			# Add indexes
31
32
			$this->indexes->add             ('code',                'UNIQUE');
33
			$this->indexes->add             ('ip');
34
			$this->indexes->add             ('time');
35
36
			# Add foreign keys
37
38
			$this->foreigns->add            ('id',                  TABLE_USERS, 'id', 'CASCADE', 'RESTRICT');
39
		}
40
	}
41
}
42

www/engine/System/Classes/Modules/Entitizer/Definition/User/Session.php 1 location

@@ 14-40 (lines=27) @@
11
12
	use Modules\Entitizer;
13
14
	class Session extends Entitizer\Utils\Definition {
15
16
		use Entitizer\Common\User\Session;
17
18
		/**
19
		 * Define the entity fields
20
		 */
21
22
		protected function define() {
23
24
			# Add params
25
26
			$this->params->addTextual       ('code',                true, 40, true, '');
27
			$this->params->addTextual       ('ip',                  true, 255, false, '');
28
			$this->params->addInteger       ('time',                false, 10, true, 0);
29
30
			# Add indexes
31
32
			$this->indexes->add             ('code',                'UNIQUE');
33
			$this->indexes->add             ('ip');
34
			$this->indexes->add             ('time');
35
36
			# Add foreign keys
37
38
			$this->foreigns->add            ('id',                  TABLE_USERS, 'id', 'CASCADE', 'RESTRICT');
39
		}
40
	}
41
}
42

www/engine/System/Classes/Modules/Entitizer/Definition/Widget.php 1 location

@@ 14-37 (lines=24) @@
11
12
	use Modules\Entitizer;
13
14
	class Widget extends Entitizer\Utils\Definition {
15
16
		use Entitizer\Common\Widget;
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->addTextual       ('name',                true, 255, false, '');
28
			$this->params->addTextual       ('title',               true, 255, false, '');
29
			$this->params->addTextual       ('contents',            false, 0, false, '');
30
31
			# Add indexes
32
33
			$this->indexes->add             ('active');
34
			$this->indexes->add             ('name',                'UNIQUE');
35
			$this->indexes->add             ('title');
36
		}
37
	}
38
}
39