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