Passed
Push — master ( 954e58...8ebbc0 )
by Anthony
03:24
created

ParentTexte   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getParentTexte() 0 11 4
1
<?php
2
	namespace core\admin\contenus;
3
	trait ParentTexte {
4
		private $parent_texte;
5
		
6
		
7
		//-------------------------- BUILDER ----------------------------------------------------------------------------//
8
		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
9
		
10
		
11
		
12
		//-------------------------- GETTER ----------------------------------------------------------------------------//
13
		public function getParentTexte($parent) {
14
			$dbc = \core\App::getDb();
15
16
			$query = $dbc->select("titre")->from("page")->where("ID_page", "=", $parent)->get();
17
18
			if ((is_array($query)) && (count($query) > 0)) {
19
				foreach ($query as $obj) $this->parent_texte = $obj->titre;
20
			}
21
22
			return $this->parent_texte;
23
		}
24
		//-------------------------- END GETTER ----------------------------------------------------------------------------//
25
		
26
		
27
		
28
		//-------------------------- SETTER ----------------------------------------------------------------------------//
29
		//-------------------------- END SETTER ----------------------------------------------------------------------------//
30
	}