Completed
Push — master ( 5afe3b...44ee0c )
by Jean-Christophe
05:18
created

ObjectsConditionParser::hasParam()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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
	protected $objects;
14
	
15
	public function __construct(){
16
		$this->conditionParser=new ConditionParser();
17
		$this->objects=[];
18
	}
19
	
20
	public function addPartObject($object,$condition,$value){
21
		$this->objects[]=$object;
22
		return $this->conditionParser->addPart($condition, $value);
23
	}
24
	/**
25
	 * @return \Ubiquity\orm\parser\ConditionParser
26
	 */
27
	public function getConditionParser() {
28
		return $this->conditionParser;
29
	}
30
31
	/**
32
	 * @return multitype:
0 ignored issues
show
Documentation introduced by
The doc-type multitype: could not be parsed: Unknown type name "multitype:" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
33
	 */
34
	public function getObjects() {
35
		return $this->objects;
36
	}
37
	
38
	public function hasParam($value){
39
		return $this->conditionParser->hasParam($value);
40
	}
41
	
42
	public function compileParts($separator=" OR "){
43
		$this->conditionParser->compileParts($separator);
44
	}
45
	
46
	public function addObject($object){
47
		$this->objects[]=$object;
48
	}
49
	
50
	public function isFull(){
51
		return $this->conditionParser->countParts()>=PendingRelationsRequest::$MAX_ROW_COUNT;
52
	}
53
}
54
55