Dataset   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
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 {
11
12
	abstract class Dataset extends Utils\Factory {
13
14
		protected static $error_message = 'The dataset class for the given table does not exist';
15
16
		# Objects cache
17
18
		protected static $cache = [];
19
20
		# Datasets classes
21
22
		protected static $classes = [
23
24
			TABLE_PAGES             => 'Modules\Entitizer\Dataset\Page',
25
			TABLE_MENU              => 'Modules\Entitizer\Dataset\Menuitem',
26
			TABLE_VARIABLES         => 'Modules\Entitizer\Dataset\Variable',
27
			TABLE_WIDGETS           => 'Modules\Entitizer\Dataset\Widget',
28
			TABLE_USERS             => 'Modules\Entitizer\Dataset\User',
29
			TABLE_USERS_SECRETS     => 'Modules\Entitizer\Dataset\User\Secret',
30
			TABLE_USERS_SESSIONS    => 'Modules\Entitizer\Dataset\User\Session'
31
		];
32
33
		/**
34
		 * Get a dataset object with a custom data
35
		 */
36
37
		public static function get(string $table, array $data = []) {
38
39
			return (clone parent::get($table))->update($data);
40
		}
41
	}
42
}
43