Foreigns::add()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 3
nc 2
nop 5
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\Utils\Definition\Group {
11
12
	use Modules\Entitizer\Utils\Definition;
13
14
	class Foreigns extends Definition\Group {
15
16
		/**
17
		 * Add a foreign
18
		 */
19
20
		public function add(string $name, string $table, string $field, string $delete = null, string $update = null) {
21
22
			if ((false === $this->definition->getParam($name)) || isset($this->list[$name])) return;
23
24
			$this->list[$name] = new Definition\Item\Foreign($name, $table, $field, $delete, $update);
25
		}
26
	}
27
}
28