Widget::define()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 8

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
dl 15
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 View Code Duplication
	class Widget extends Entitizer\Utils\Definition {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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