Passed
Push — master ( 70ce04...9471d7 )
by Jean-Christophe
03:03
created

ObjectsConditionParser::hasParam()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Ubiquity\orm\core;
4
5
use Ubiquity\orm\parser\ConditionParser;
6
7
class ObjectsConditionParser {
8
	
9
	/**
10
	 * @var ConditionParser
11
	 */
12
	protected $conditionParser;
13
	/**
14
	 * @var array
15
	 */
16
	protected $objects;
17
	
18 4
	public function __construct(){
19 4
		$this->conditionParser=new ConditionParser();
20 4
		$this->objects=[];
21 4
	}
22
	
23 4
	public function addPartObject($object,$condition,$value){
24 4
		$this->objects[]=$object;
25 4
		return $this->conditionParser->addPart($condition, $value);
26
	}
27
	/**
28
	 * @return \Ubiquity\orm\parser\ConditionParser
29
	 */
30 4
	public function getConditionParser() {
31 4
		return $this->conditionParser;
32
	}
33
34
	/**
35
	 * @return array
36
	 */
37 4
	public function getObjects() {
38 4
		return $this->objects;
39
	}
40
	
41 4
	public function hasParam($value){
42 4
		return $this->conditionParser->hasParam($value);
43
	}
44
	
45 4
	public function compileParts($separator=" OR "){
46 4
		$this->conditionParser->compileParts($separator);
47 4
	}
48
	
49 3
	public function addObject($object){
50 3
		$this->objects[]=$object;
51 3
	}
52
	
53 4
	public function isFull(){
54 4
		return $this->conditionParser->countParts()>=PendingRelationsRequest::$MAX_ROW_COUNT;
55
	}
56
}
57
58