Test Failed
Push — master ( 7c30c4...acb065 )
by dima
03:52
created

Specification::getOfset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 0
cts 1
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace SimpleORM;
4
5
/**
6
 * Description of Specification
7
 *
8
 * @author Dmitriy
9
 */
10
class Specification implements ISpecificationCriteria
11
{
12
13
	protected $where = [];
14
15
	protected $limit = 0;
16
17
	protected $ofset = 0;
18
19
	protected $joins = [];
20
21
	protected $order = [];
22
23
	protected $manualJoins = [];
24
25
	protected $group = null;
26
27
	protected $manualWheres = [];
28
29
	protected $whereType = 'AND';
30
31
	protected $manualSelect;
32
33
	
34
	static public function create(){
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
35
		return new SELF;
36
	}
37
	
38
	function getManualSelect()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
39
	{
40
		return $this->manualSelect;
41
	}
42
43
	function setManualSelect($Select)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
44
	{
45
		$this->manualSelect = $Select;
46
		return $this;
47
	}
48
49
	function getWhere()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
50
	{
51
		return $this->where;
52
	}
53
54
	function getLimit()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
55
	{
56
		return $this->limit;
57
	}
58
59
	function getOfset()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
60
	{
61
		return $this->ofset;
62
	}
63
64
	function getJoins()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
65
	{
66
		return $this->joins;
67
	}
68
69
	function getOrder()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
70
	{
71
		return $this->order;
72
	}
73
74
	function getManualJoins()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
75
	{
76
		return $this->manualJoins;
77
	}
78
79
	function getGroup()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
80
	{
81
		return $this->group;
82
	}
83
84
	function getManualWheres()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
85
	{
86
		return $this->manualWheres;
87
	}
88
89
	function getWhereType()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
90
	{
91
		return $this->whereType;
92
	}
93
94
	function setWhere($field, $value = false)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
95
	{
96
		if ($value !== false) {
97
			$this->where[$field] = $value;
98
		} else {
99
			$this->where = $field;
100
		}
101
102
		return $this;
103
	}
104
105
	function setLimit($limit)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
106
	{
107
		$this->limit = $limit;
108
		return $this;
109
	}
110
111
	function setOfset($ofset)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
112
	{
113
		$this->ofset = $ofset;
114
		return $this;
115
	}
116
117
	function setJoins($joins)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
118
	{
119
		$this->joins = $joins;
120
		return $this;
121
	}
122
123
	function setOrder($order)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
124
	{
125
		$this->order = $order;
126
		return $this;
127
	}
128
129
	function setManualJoins($manualJoins)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
130
	{
131
		$this->manualJoins = $manualJoins;
132
		return $this;
133
	}
134
135
	function setGroup($group)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
136
	{
137
		$this->group = $group;
138
		return $this;
139
	}
140
141
	function setManualWheres($manualWheres)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
142
	{
143
		$this->manualWheres = $manualWheres;
144
		return $this;
145
	}
146
147
	function setWhereType($whereType)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
148
	{
149
		$this->whereType = $whereType;
150
		return $this;
151
	}
152
153
	/**
154
	 * Создание критериев
155
	 */
156
	public function getCriteria()
157
	{
158
		
159
	}
160
}
161