@@ -3,118 +3,118 @@ |
||
3 | 3 | namespace Nickcheek\Atdconnect\Services; |
4 | 4 | |
5 | 5 | class Vehicle { |
6 | - use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
6 | + use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
7 | 7 | |
8 | - private $location; |
|
9 | - private $wsdl; |
|
8 | + private $location; |
|
9 | + private $wsdl; |
|
10 | 10 | |
11 | - public $vehicleYear; |
|
12 | - public $vehicleMake; |
|
13 | - public $vehicleModel; |
|
11 | + public $vehicleYear; |
|
12 | + public $vehicleMake; |
|
13 | + public $vehicleModel; |
|
14 | 14 | |
15 | - public function __construct() |
|
16 | - { |
|
17 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
18 | - $this->location = $config->location; |
|
19 | - $this->wsdl = 'http://testws.atdconnect.com/ws/3_4/fitments.wsdl'; |
|
15 | + public function __construct() |
|
16 | + { |
|
17 | + $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
18 | + $this->location = $config->location; |
|
19 | + $this->wsdl = 'http://testws.atdconnect.com/ws/3_4/fitments.wsdl'; |
|
20 | 20 | |
21 | - } |
|
21 | + } |
|
22 | 22 | |
23 | - //************************************************ |
|
24 | - // Vehicle Service |
|
25 | - //************************************************ |
|
23 | + //************************************************ |
|
24 | + // Vehicle Service |
|
25 | + //************************************************ |
|
26 | 26 | |
27 | - public function getVehicleYear() |
|
28 | - { |
|
27 | + public function getVehicleYear() |
|
28 | + { |
|
29 | 29 | return $this->apiCall('getVehicleYear','',$this->wsdl); |
30 | - } |
|
30 | + } |
|
31 | 31 | |
32 | - public function getVehicleMake($year) |
|
33 | - { |
|
34 | - try { if (empty($year)) { throw new \Exception("A Vehicle Year Has Not Been Set."); } |
|
35 | - return $this->apiCall('getVehicleMake',['vehicle' => ['year'=>$year]],$this->wsdl); |
|
32 | + public function getVehicleMake($year) |
|
33 | + { |
|
34 | + try { if (empty($year)) { throw new \Exception("A Vehicle Year Has Not Been Set."); } |
|
35 | + return $this->apiCall('getVehicleMake',['vehicle' => ['year'=>$year]],$this->wsdl); |
|
36 | 36 | } catch (Exception $e) { return $e; } |
37 | - } |
|
37 | + } |
|
38 | 38 | |
39 | - public function getVehicleModel($year,$make) |
|
40 | - { |
|
39 | + public function getVehicleModel($year,$make) |
|
40 | + { |
|
41 | 41 | |
42 | - try {if (empty($year)||empty($make)) {throw new \Exception("A Vehicle Year OR Make Has Not Been Set.");} |
|
42 | + try {if (empty($year)||empty($make)) {throw new \Exception("A Vehicle Year OR Make Has Not Been Set.");} |
|
43 | 43 | |
44 | - return $this->apiCall('getVehicleModel',['vehicle' => ['year'=>$year,'make'=>$make]],$this->wsdl); |
|
44 | + return $this->apiCall('getVehicleModel',['vehicle' => ['year'=>$year,'make'=>$make]],$this->wsdl); |
|
45 | 45 | |
46 | 46 | } catch (Exception $e) {return $e;} |
47 | - } |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - public function getVehicleTrim($year,$make,$model) |
|
51 | - { |
|
52 | - try {if (empty($year)||empty($make)||empty($model)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
50 | + public function getVehicleTrim($year,$make,$model) |
|
51 | + { |
|
52 | + try {if (empty($year)||empty($make)||empty($model)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
53 | 53 | |
54 | - return $this->apiCall('getVehicleTrim',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model]],$this->wsdl); |
|
54 | + return $this->apiCall('getVehicleTrim',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model]],$this->wsdl); |
|
55 | 55 | |
56 | 56 | } catch (Exception $e) {return $e;} |
57 | - } |
|
57 | + } |
|
58 | 58 | |
59 | - public function getVehicleTrimOption($year,$make,$model,$trim) |
|
60 | - { |
|
61 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
59 | + public function getVehicleTrimOption($year,$make,$model,$trim) |
|
60 | + { |
|
61 | + try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
62 | 62 | |
63 | - return $this->apiCall('getVehicleTrimOption',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
63 | + return $this->apiCall('getVehicleTrimOption',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
64 | 64 | |
65 | - } catch (Exception $e) {return $e;} |
|
65 | + } catch (Exception $e) {return $e;} |
|
66 | 66 | |
67 | - } |
|
67 | + } |
|
68 | 68 | |
69 | - public function getVehiclePlusSizes($year,$make,$model,$trim) |
|
70 | - { |
|
71 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make, Model, or Trim Has Not Been Set.");} |
|
69 | + public function getVehiclePlusSizes($year,$make,$model,$trim) |
|
70 | + { |
|
71 | + try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make, Model, or Trim Has Not Been Set.");} |
|
72 | 72 | |
73 | - return $this->apiCall('getVehiclePlusSizes',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
73 | + return $this->apiCall('getVehiclePlusSizes',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
74 | 74 | |
75 | - } catch (Exception $e) {return $e;} |
|
75 | + } catch (Exception $e) {return $e;} |
|
76 | 76 | |
77 | - } |
|
77 | + } |
|
78 | 78 | |
79 | - public function getProductByFitment($year,$make,$model,$trim,$option) |
|
80 | - { |
|
81 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)||empty($option)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
79 | + public function getProductByFitment($year,$make,$model,$trim,$option) |
|
80 | + { |
|
81 | + try {if (empty($year)||empty($make)||empty($model)||empty($trim)||empty($option)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
82 | 82 | |
83 | - return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim,'trimOption'=>$option]],$this->wsdl); |
|
83 | + return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim,'trimOption'=>$option]],$this->wsdl); |
|
84 | 84 | |
85 | - } catch (Exception $e) {return $e;} |
|
85 | + } catch (Exception $e) {return $e;} |
|
86 | 86 | |
87 | - } |
|
87 | + } |
|
88 | 88 | |
89 | - public function getVehicleByVehicleId($vID) |
|
90 | - { |
|
91 | - try {if (empty($vID)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
89 | + public function getVehicleByVehicleId($vID) |
|
90 | + { |
|
91 | + try {if (empty($vID)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
92 | 92 | |
93 | - return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['vehicleId'=>$vID]],$this->wsdl); |
|
93 | + return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['vehicleId'=>$vID]],$this->wsdl); |
|
94 | 94 | |
95 | - } catch (Exception $e) {return $e;} |
|
95 | + } catch (Exception $e) {return $e;} |
|
96 | 96 | |
97 | - } |
|
97 | + } |
|
98 | 98 | |
99 | - public function getVehicleByLicensePlate($num,$state) |
|
100 | - { |
|
101 | - try {if (empty($num)||empty($state)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
99 | + public function getVehicleByLicensePlate($num,$state) |
|
100 | + { |
|
101 | + try {if (empty($num)||empty($state)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
102 | 102 | |
103 | - return $this->apiCall('getVehicleByLicensePlate',['licensePlateNumber'=>$num,'licensePlateState' => $state],$this->wsdl); |
|
103 | + return $this->apiCall('getVehicleByLicensePlate',['licensePlateNumber'=>$num,'licensePlateState' => $state],$this->wsdl); |
|
104 | 104 | |
105 | - } catch (Exception $e) {return $e;} |
|
105 | + } catch (Exception $e) {return $e;} |
|
106 | 106 | |
107 | - } |
|
107 | + } |
|
108 | 108 | |
109 | - public function getVehicleByVIN($vin) |
|
110 | - { |
|
111 | - try {if (empty($vin)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
109 | + public function getVehicleByVIN($vin) |
|
110 | + { |
|
111 | + try {if (empty($vin)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
112 | 112 | |
113 | - return $this->apiCall('getVehicleByVIN',['VIN'=>$vin],$this->wsdl); |
|
113 | + return $this->apiCall('getVehicleByVIN',['VIN'=>$vin],$this->wsdl); |
|
114 | 114 | |
115 | - } catch (Exception $e) {return $e;} |
|
115 | + } catch (Exception $e) {return $e;} |
|
116 | 116 | |
117 | - } |
|
117 | + } |
|
118 | 118 | |
119 | 119 | |
120 | 120 |