Passed
Push — master ( 83f298...845c7a )
by Nicholas
02:17
created

Arraybuilder::setATDProductNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 28
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Nickcheek\Atdconnect;
4
5
class Arraybuilder
6
{
7
	public static $search;
8
	public static $location;
9
10
	public function __construct()
11
	{
12
		$config = include('config/config.php');
13
        self::$location = $config->location;
14
15
	}
16
17
	public function setSizeSearch($size)
18
    {
19
	    static::$search = array(
20
			'locationNumber' => static::$location,
21
			'criteria' => array(
22
				'entry' => array(
23
					'key'=> 'Size',
24
					'value'=>$size
25
				)
26
			),
27
			'options' => array(
28
				'price' => array(
29
					'cost'=>'1',
30
					'retail'=>'1'
31
				),
32
				'availability' => array(
33
					'local'=>'1'
34
				),
35
				'productSpec'=> array(
36
					'entry'=> array(
37
						'key'=>'SpeedRating'
38
					),
39
					'entry'=> array(
40
						'key'=>'TemperatureRating'
41
					)
42
				),
43
				'includeRebates'=>'1'
44
			)
45
		);
46
        return static::$search;
47
    }
48
    
49
    public function setKeywordSearch($word)
50
    {
51
	    static::$search = array(
52
			'locationNumber' => static::$location,
53
			'keywords' => $word,
54
			'options' => array(
55
				'images' => array(
56
					'thumbnail'=>'1',
57
					'small'=> '1',
58
					'large'=> '1',
59
				)
60
			)
61
		);
62
        return static::$keyword;
0 ignored issues
show
Bug Best Practice introduced by
The property keyword does not exist on Nickcheek\Atdconnect\Arraybuilder. Did you maybe forget to declare it?
Loading history...
63
    }
64
    
65
    public function setATDProductNumber($number)
66
    {
67
	    static::$search = array(
68
			'locationNumber' => static::$location,
69
			'criteria' => array(
70
				'entry'=>array(
71
					'key'=>'ATDProductNumber',
72
					'value'=>$number
73
				)
74
			),
75
			'options' => array(
76
				'images' => array(
77
					'thumbnail'=> '1',
78
					'small' => '1',
79
					'large' => '1'
80
				)
81
			),
82
			'productSpec'=> array(
83
					'entry'=> array(
84
						'key'=>'SpeedRating'
85
					),
86
					'entry'=> array(
87
						'key'=>'TemperatureRating'
88
					)
89
				)
90
					
91
		);
92
        return static::$search;
93
    }
94
    
95
    
96
}