@@ -3,126 +3,126 @@ |
||
| 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($count); |
|
| 30 | - } else { |
|
| 31 | - return new self($count); |
|
| 32 | - } |
|
| 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($count); |
|
| 30 | + } else { |
|
| 31 | + return new self($count); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - } |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - public function getVehicleYear() |
|
| 37 | - { |
|
| 36 | + public function getVehicleYear() |
|
| 37 | + { |
|
| 38 | 38 | return $this->apiCall('getVehicleYear','',$this->wsdl); |
| 39 | - } |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function getVehicleMake($year) |
|
| 42 | - { |
|
| 43 | - try { if (empty($year)) { throw new \Exception("A Vehicle Year Has Not Been Set."); } |
|
| 44 | - return $this->apiCall('getVehicleMake',['vehicle' => ['year'=>$year]],$this->wsdl); |
|
| 41 | + public function getVehicleMake($year) |
|
| 42 | + { |
|
| 43 | + try { if (empty($year)) { throw new \Exception("A Vehicle Year Has Not Been Set."); } |
|
| 44 | + return $this->apiCall('getVehicleMake',['vehicle' => ['year'=>$year]],$this->wsdl); |
|
| 45 | 45 | } catch (Exception $e) { return $e; } |
| 46 | - } |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - public function getVehicleModel($year,$make) |
|
| 49 | - { |
|
| 48 | + public function getVehicleModel($year,$make) |
|
| 49 | + { |
|
| 50 | 50 | |
| 51 | - try {if (empty($year)||empty($make)) {throw new \Exception("A Vehicle Year OR Make Has Not Been Set.");} |
|
| 51 | + try {if (empty($year)||empty($make)) {throw new \Exception("A Vehicle Year OR Make Has Not Been Set.");} |
|
| 52 | 52 | |
| 53 | - return $this->apiCall('getVehicleModel',['vehicle' => ['year'=>$year,'make'=>$make]],$this->wsdl); |
|
| 53 | + return $this->apiCall('getVehicleModel',['vehicle' => ['year'=>$year,'make'=>$make]],$this->wsdl); |
|
| 54 | 54 | |
| 55 | 55 | } catch (Exception $e) {return $e;} |
| 56 | - } |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | 58 | |
| 59 | - public function getVehicleTrim($year,$make,$model) |
|
| 60 | - { |
|
| 61 | - try {if (empty($year)||empty($make)||empty($model)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
| 59 | + public function getVehicleTrim($year,$make,$model) |
|
| 60 | + { |
|
| 61 | + try {if (empty($year)||empty($make)||empty($model)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
| 62 | 62 | |
| 63 | - return $this->apiCall('getVehicleTrim',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model]],$this->wsdl); |
|
| 63 | + return $this->apiCall('getVehicleTrim',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model]],$this->wsdl); |
|
| 64 | 64 | |
| 65 | 65 | } catch (Exception $e) {return $e;} |
| 66 | - } |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - public function getVehicleTrimOption($year,$make,$model,$trim) |
|
| 69 | - { |
|
| 70 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
| 68 | + public function getVehicleTrimOption($year,$make,$model,$trim) |
|
| 69 | + { |
|
| 70 | + try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
| 71 | 71 | |
| 72 | - return $this->apiCall('getVehicleTrimOption',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
| 72 | + return $this->apiCall('getVehicleTrimOption',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
| 73 | 73 | |
| 74 | - } catch (Exception $e) {return $e;} |
|
| 74 | + } catch (Exception $e) {return $e;} |
|
| 75 | 75 | |
| 76 | - } |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - public function getVehiclePlusSizes($year,$make,$model,$trim) |
|
| 79 | - { |
|
| 80 | - 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 | + public function getVehiclePlusSizes($year,$make,$model,$trim) |
|
| 79 | + { |
|
| 80 | + try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make, Model, or Trim Has Not Been Set.");} |
|
| 81 | 81 | |
| 82 | - return $this->apiCall('getVehiclePlusSizes',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
| 82 | + return $this->apiCall('getVehiclePlusSizes',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
| 83 | 83 | |
| 84 | - } catch (Exception $e) {return $e;} |
|
| 84 | + } catch (Exception $e) {return $e;} |
|
| 85 | 85 | |
| 86 | - } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - public function getProductByFitment($year,$make,$model,$trim,$option) |
|
| 89 | - { |
|
| 90 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)||empty($option)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 88 | + public function getProductByFitment($year,$make,$model,$trim,$option) |
|
| 89 | + { |
|
| 90 | + try {if (empty($year)||empty($make)||empty($model)||empty($trim)||empty($option)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 91 | 91 | |
| 92 | - return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim,'trimOption'=>$option]],$this->wsdl); |
|
| 92 | + return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim,'trimOption'=>$option]],$this->wsdl); |
|
| 93 | 93 | |
| 94 | - } catch (Exception $e) {return $e;} |
|
| 94 | + } catch (Exception $e) {return $e;} |
|
| 95 | 95 | |
| 96 | - } |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - public function getVehicleByVehicleId($vID) |
|
| 99 | - { |
|
| 100 | - try {if (empty($vID)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 98 | + public function getVehicleByVehicleId($vID) |
|
| 99 | + { |
|
| 100 | + try {if (empty($vID)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 101 | 101 | |
| 102 | - return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['vehicleId'=>$vID]],$this->wsdl); |
|
| 102 | + return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['vehicleId'=>$vID]],$this->wsdl); |
|
| 103 | 103 | |
| 104 | - } catch (Exception $e) {return $e;} |
|
| 104 | + } catch (Exception $e) {return $e;} |
|
| 105 | 105 | |
| 106 | - } |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - public function getVehicleByLicensePlate($num,$state) |
|
| 109 | - { |
|
| 110 | - try {if (empty($num)||empty($state)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 108 | + public function getVehicleByLicensePlate($num,$state) |
|
| 109 | + { |
|
| 110 | + try {if (empty($num)||empty($state)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 111 | 111 | |
| 112 | - return $this->apiCall('getVehicleByLicensePlate',['licensePlateNumber'=>$num,'licensePlateState' => $state],$this->wsdl); |
|
| 112 | + return $this->apiCall('getVehicleByLicensePlate',['licensePlateNumber'=>$num,'licensePlateState' => $state],$this->wsdl); |
|
| 113 | 113 | |
| 114 | - } catch (Exception $e) {return $e;} |
|
| 114 | + } catch (Exception $e) {return $e;} |
|
| 115 | 115 | |
| 116 | - } |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - public function getVehicleByVIN($vin) |
|
| 119 | - { |
|
| 120 | - try {if (empty($vin)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 118 | + public function getVehicleByVIN($vin) |
|
| 119 | + { |
|
| 120 | + try {if (empty($vin)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 121 | 121 | |
| 122 | - return $this->apiCall('getVehicleByVIN',['VIN'=>$vin],$this->wsdl); |
|
| 122 | + return $this->apiCall('getVehicleByVIN',['VIN'=>$vin],$this->wsdl); |
|
| 123 | 123 | |
| 124 | - } catch (Exception $e) {return $e;} |
|
| 124 | + } catch (Exception $e) {return $e;} |
|
| 125 | 125 | |
| 126 | - } |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | 128 | } |
| 129 | 129 | \ 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,7 +25,7 @@ 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($count); |
| 30 | 30 | } else { |
| 31 | 31 | return new self($count); |
@@ -35,93 +35,93 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function getVehicleYear() |
| 37 | 37 | { |
| 38 | - return $this->apiCall('getVehicleYear','',$this->wsdl); |
|
| 38 | + return $this->apiCall('getVehicleYear', '', $this->wsdl); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function getVehicleMake($year) |
| 42 | 42 | { |
| 43 | 43 | try { if (empty($year)) { throw new \Exception("A Vehicle Year Has Not Been Set."); } |
| 44 | - return $this->apiCall('getVehicleMake',['vehicle' => ['year'=>$year]],$this->wsdl); |
|
| 44 | + return $this->apiCall('getVehicleMake', ['vehicle' => ['year'=>$year]], $this->wsdl); |
|
| 45 | 45 | } catch (Exception $e) { return $e; } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public function getVehicleModel($year,$make) |
|
| 48 | + public function getVehicleModel($year, $make) |
|
| 49 | 49 | { |
| 50 | 50 | |
| 51 | - try {if (empty($year)||empty($make)) {throw new \Exception("A Vehicle Year OR Make Has Not Been Set.");} |
|
| 51 | + try {if (empty($year) || empty($make)) {throw new \Exception("A Vehicle Year OR Make Has Not Been Set."); } |
|
| 52 | 52 | |
| 53 | - return $this->apiCall('getVehicleModel',['vehicle' => ['year'=>$year,'make'=>$make]],$this->wsdl); |
|
| 53 | + return $this->apiCall('getVehicleModel', ['vehicle' => ['year'=>$year, 'make'=>$make]], $this->wsdl); |
|
| 54 | 54 | |
| 55 | - } catch (Exception $e) {return $e;} |
|
| 55 | + } catch (Exception $e) {return $e; } |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | - public function getVehicleTrim($year,$make,$model) |
|
| 59 | + public function getVehicleTrim($year, $make, $model) |
|
| 60 | 60 | { |
| 61 | - try {if (empty($year)||empty($make)||empty($model)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
| 61 | + try {if (empty($year) || empty($make) || empty($model)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set."); } |
|
| 62 | 62 | |
| 63 | - return $this->apiCall('getVehicleTrim',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model]],$this->wsdl); |
|
| 63 | + return $this->apiCall('getVehicleTrim', ['vehicle' => ['year'=>$year, 'make'=>$make, 'model'=>$model]], $this->wsdl); |
|
| 64 | 64 | |
| 65 | - } catch (Exception $e) {return $e;} |
|
| 65 | + } catch (Exception $e) {return $e; } |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function getVehicleTrimOption($year,$make,$model,$trim) |
|
| 68 | + public function getVehicleTrimOption($year, $make, $model, $trim) |
|
| 69 | 69 | { |
| 70 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");} |
|
| 70 | + try {if (empty($year) || empty($make) || empty($model) || empty($trim)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set."); } |
|
| 71 | 71 | |
| 72 | - return $this->apiCall('getVehicleTrimOption',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
| 72 | + return $this->apiCall('getVehicleTrimOption', ['vehicle' => ['year'=>$year, 'make'=>$make, 'model'=>$model, 'trim'=>$trim]], $this->wsdl); |
|
| 73 | 73 | |
| 74 | - } catch (Exception $e) {return $e;} |
|
| 74 | + } catch (Exception $e) {return $e; } |
|
| 75 | 75 | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public function getVehiclePlusSizes($year,$make,$model,$trim) |
|
| 78 | + public function getVehiclePlusSizes($year, $make, $model, $trim) |
|
| 79 | 79 | { |
| 80 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make, Model, or Trim Has Not Been Set.");} |
|
| 80 | + try {if (empty($year) || empty($make) || empty($model) || empty($trim)) {throw new \Exception("A Vehicle Year, Make, Model, or Trim Has Not Been Set."); } |
|
| 81 | 81 | |
| 82 | - return $this->apiCall('getVehiclePlusSizes',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl); |
|
| 82 | + return $this->apiCall('getVehiclePlusSizes', ['vehicle' => ['year'=>$year, 'make'=>$make, 'model'=>$model, 'trim'=>$trim]], $this->wsdl); |
|
| 83 | 83 | |
| 84 | - } catch (Exception $e) {return $e;} |
|
| 84 | + } catch (Exception $e) {return $e; } |
|
| 85 | 85 | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - public function getProductByFitment($year,$make,$model,$trim,$option) |
|
| 88 | + public function getProductByFitment($year, $make, $model, $trim, $option) |
|
| 89 | 89 | { |
| 90 | - try {if (empty($year)||empty($make)||empty($model)||empty($trim)||empty($option)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 90 | + try {if (empty($year) || empty($make) || empty($model) || empty($trim) || empty($option)) {throw new \Exception("A Vehicle value required has not been set."); } |
|
| 91 | 91 | |
| 92 | - return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim,'trimOption'=>$option]],$this->wsdl); |
|
| 92 | + return $this->apiCall('getProductByFitment', ['locationNumber'=>$this->location, 'vehicle' => ['year'=>$year, 'make'=>$make, 'model'=>$model, 'trim'=>$trim, 'trimOption'=>$option]], $this->wsdl); |
|
| 93 | 93 | |
| 94 | - } catch (Exception $e) {return $e;} |
|
| 94 | + } catch (Exception $e) {return $e; } |
|
| 95 | 95 | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function getVehicleByVehicleId($vID) |
| 99 | 99 | { |
| 100 | - try {if (empty($vID)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 100 | + try {if (empty($vID)) {throw new \Exception("A Vehicle value required has not been set."); } |
|
| 101 | 101 | |
| 102 | - return $this->apiCall('getProductByFitment',['locationNumber'=>$this->location,'vehicle' => ['vehicleId'=>$vID]],$this->wsdl); |
|
| 102 | + return $this->apiCall('getProductByFitment', ['locationNumber'=>$this->location, 'vehicle' => ['vehicleId'=>$vID]], $this->wsdl); |
|
| 103 | 103 | |
| 104 | - } catch (Exception $e) {return $e;} |
|
| 104 | + } catch (Exception $e) {return $e; } |
|
| 105 | 105 | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - public function getVehicleByLicensePlate($num,$state) |
|
| 108 | + public function getVehicleByLicensePlate($num, $state) |
|
| 109 | 109 | { |
| 110 | - try {if (empty($num)||empty($state)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 110 | + try {if (empty($num) || empty($state)) {throw new \Exception("A Vehicle value required has not been set."); } |
|
| 111 | 111 | |
| 112 | - return $this->apiCall('getVehicleByLicensePlate',['licensePlateNumber'=>$num,'licensePlateState' => $state],$this->wsdl); |
|
| 112 | + return $this->apiCall('getVehicleByLicensePlate', ['licensePlateNumber'=>$num, 'licensePlateState' => $state], $this->wsdl); |
|
| 113 | 113 | |
| 114 | - } catch (Exception $e) {return $e;} |
|
| 114 | + } catch (Exception $e) {return $e; } |
|
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | public function getVehicleByVIN($vin) |
| 119 | 119 | { |
| 120 | - try {if (empty($vin)) {throw new \Exception("A Vehicle value required has not been set.");} |
|
| 120 | + try {if (empty($vin)) {throw new \Exception("A Vehicle value required has not been set."); } |
|
| 121 | 121 | |
| 122 | - return $this->apiCall('getVehicleByVIN',['VIN'=>$vin],$this->wsdl); |
|
| 122 | + return $this->apiCall('getVehicleByVIN', ['VIN'=>$vin], $this->wsdl); |
|
| 123 | 123 | |
| 124 | - } catch (Exception $e) {return $e;} |
|
| 124 | + } catch (Exception $e) {return $e; } |
|
| 125 | 125 | |
| 126 | 126 | } |
| 127 | 127 | |