Arraybuilder::setATDProductNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 17
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 28
rs 9.7
1
<?php
2
3
namespace Nickcheek\Atdconnect;
4
5
class Arraybuilder
6
{
7
	public $search;
8
	public $location;
9
10
	public function __construct()
11
	{
12
		$config = include('config/config.php');
13
        $this->location = $config->location;
14
15
	}
16
17
	public function setSizeSearch($size)
18
    {
19
	    $this->search = array(
20
			'locationNumber' => $this->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 $this->search;
47
    }
48
    
49
    public function setKeywordSearch($word)
50
    {
51
	    $this->search = array(
52
			'locationNumber' => $this->location,
53
			'keywords' => $word,
54
			'options' => array(
55
				'images' => array(
56
					'thumbnail'=>'1',
57
					'small'=> '1',
58
					'large'=> '1',
59
				)
60
			)
61
		);
62
        return $this->search;
63
    }
64
    
65
    public function setATDProductNumber($number)
66
    {
67
	    $this->search = array(
68
			'locationNumber' => $this->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 $this->search;
93
    }
94
    
95
    
96
}