AdminBlog   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getAdminCategory() 0 7 2
A getListSate() 0 15 2
1
<?php
2
	namespace modules\blog\admin\controller;
3
	
4
	
5
	use core\App;
6
	use modules\blog\app\controller\Blog;
7
	
8
	class AdminBlog {
9
		private static $admin_category;
10
		
11
		//-------------------------- BUILDER ----------------------------------------------------------------------------//
12
		public function __construct() {
13
			
14
		}
15
		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
16
		
17
		
18
		//-------------------------- GETTER ----------------------------------------------------------------------------//
19
		public static function getAdminCategory() {
20
			if (self::$admin_category == null) {
21
				self::$admin_category = new AdminCategory();
22
			}
23
			
24
			return self::$admin_category;
25
		}
26
		
27
		public static function getListSate() {
28
			$dbc = App::getDb();
29
			
30
			$query = $dbc->select()->from("_blog_state")->get();
31
			
32
			$state = [];
33
			foreach ($query as $obj) {
34
				$state[] = [
35
					"id_state" => $obj->ID_state,
36
					"state" => $obj->state
37
				];
38
			}
39
			
40
			Blog::setValues(["list_state" => $state]);
41
		}
42
		//-------------------------- END GETTER ----------------------------------------------------------------------------//
43
		
44
		
45
		//-------------------------- SETTER ----------------------------------------------------------------------------//
46
		//-------------------------- END SETTER ----------------------------------------------------------------------------//    
47
	}