-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getByInspectionIdVehicleAndDate() API call and tests, fixing accident…
…al CRLF's
- Loading branch information
1 parent
27633c4
commit 0c4a960
Showing
14 changed files
with
467 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,76 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelAbstract; | ||
|
||
/** | ||
* Vehicle Defect Model | ||
* | ||
* @method int getVehicleDefectId() | ||
* @method int getVehicleInspectionId() | ||
* @method int getDefectType() | ||
* @method int getCreatedByContactId() | ||
* @method \DateTime getDefectDateUtc() | ||
* @method string getNotes() | ||
* @method int getDefectStatusType() | ||
* @method DefectStatusRowset getVehicleDefectStatus() | ||
* @method DefectAttachmentRowset getVehicleDefectAttachments() | ||
* @method DefectCommentRowset getVehicleDefectComments() | ||
* | ||
* @method Defect setVehicleDefectId(int $defectId) | ||
* @method Defect setVehicleInspectionId(int $inspectionId) | ||
* @method Defect setDefectType(int $type) | ||
* @method Defect setCreatedByContactId(int $contactId) | ||
* @method Defect setNotes(string $notes) | ||
* @method Defect setDefectStatusType(int $statusType) | ||
* @method Defect setVehicleDefectStatus(array|object $statuses) | ||
* @method Defect setVehicleDefectAttachments(array|object $attachments) | ||
* @method Defect setVehicleDefectComments(array|object $comments) | ||
*/ | ||
class Defect extends ModelAbstract | ||
{ | ||
|
||
protected $_allowedProperties = [ | ||
'VehicleDefectId', | ||
'VehicleInspectionId', | ||
'DefectType', | ||
'CreatedByContactId', | ||
'DefectDateUtc', | ||
'Notes', | ||
'DefectStatusType', | ||
'VehicleDefectStatus', | ||
'VehicleDefectAttachments', | ||
'VehicleDefectComments' | ||
]; | ||
|
||
/** | ||
* @param string|\DateTime $dateTime a DateTime object or date in string representation | ||
* @return Defect | ||
*/ | ||
public function setDefectDateUtc($dateTime) | ||
{ | ||
if (!$dateTime instanceof \DateTime) { | ||
$dateTime = new \DateTime($dateTime, new \DateTimeZone('UTC')); | ||
} | ||
$this->_properties['DefectDateUtc'] = $dateTime; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* convert the model to an array | ||
* @return array | ||
*/ | ||
public function toArray() | ||
{ | ||
$values = parent::toArray(); | ||
|
||
if (!empty($values['DefectDateUtc'])) { | ||
$values['DefectDateUtc'] = $values['DefectDateUtc']->format('c'); | ||
} | ||
|
||
return $values; | ||
} | ||
|
||
} | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelAbstract; | ||
|
||
/** | ||
* Vehicle Defect Model | ||
* | ||
* @method int getVehicleDefectId() | ||
* @method int getVehicleInspectionId() | ||
* @method int getDefectType() | ||
* @method int getCreatedByContactId() | ||
* @method \DateTime getDefectDateUtc() | ||
* @method string getNotes() | ||
* @method int getDefectStatusType() | ||
* @method DefectStatusRowset getVehicleDefectStatus() | ||
* @method DefectAttachmentRowset getVehicleDefectAttachments() | ||
* @method DefectCommentRowset getVehicleDefectComments() | ||
* | ||
* @method Defect setVehicleDefectId(int $defectId) | ||
* @method Defect setVehicleInspectionId(int $inspectionId) | ||
* @method Defect setDefectType(int $type) | ||
* @method Defect setCreatedByContactId(int $contactId) | ||
* @method Defect setNotes(string $notes) | ||
* @method Defect setDefectStatusType(int $statusType) | ||
* @method Defect setVehicleDefectStatus(array|object $statuses) | ||
* @method Defect setVehicleDefectAttachments(array|object $attachments) | ||
* @method Defect setVehicleDefectComments(array|object $comments) | ||
*/ | ||
class Defect extends ModelAbstract | ||
{ | ||
|
||
protected $_allowedProperties = [ | ||
'VehicleDefectId', | ||
'VehicleInspectionId', | ||
'DefectType', | ||
'CreatedByContactId', | ||
'DefectDateUtc', | ||
'Notes', | ||
'DefectStatusType', | ||
'VehicleDefectStatus', | ||
'VehicleDefectAttachments', | ||
'VehicleDefectComments' | ||
]; | ||
|
||
/** | ||
* @param string|\DateTime $dateTime a DateTime object or date in string representation | ||
* @return Defect | ||
*/ | ||
public function setDefectDateUtc($dateTime) | ||
{ | ||
if (!$dateTime instanceof \DateTime) { | ||
$dateTime = new \DateTime($dateTime, new \DateTimeZone('UTC')); | ||
} | ||
$this->_properties['DefectDateUtc'] = $dateTime; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* convert the model to an array | ||
* @return array | ||
*/ | ||
public function toArray() | ||
{ | ||
$values = parent::toArray(); | ||
|
||
if (!empty($values['DefectDateUtc'])) { | ||
$values['DefectDateUtc'] = $values['DefectDateUtc']->format('c'); | ||
} | ||
|
||
return $values; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelAbstract; | ||
|
||
/** | ||
* Vehicle DefectAttachment Model | ||
* | ||
* @method int getVehicleDefectAttachmentId() | ||
* @method int getVehicleDefectId() | ||
* @method string getAttachmentType() | ||
* @method string getAttachmentLocation() | ||
* @method string getAttachmentDateUtc() | ||
* | ||
* @method DefectAttachment setVehicleDefectAttachmentId(int $attachmentId) | ||
* @method DefectAttachment setVehicleDefectId(int $defectId) | ||
* @method DefectAttachment setAttachmentType(string $type) | ||
* @method DefectAttachment setAttachmentLocation(string $location) | ||
* @method DefectAttachment setAttachmentDateUtc(string $date) | ||
*/ | ||
class DefectAttachment extends ModelAbstract | ||
{ | ||
|
||
protected $_allowedProperties = [ | ||
'VehicleDefectAttachmentId', | ||
'VehicleDefectId', | ||
'AttachmentType', | ||
'AttachmentLocation', | ||
'AttachmentDateUtc' | ||
]; | ||
|
||
} | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelAbstract; | ||
|
||
/** | ||
* Vehicle DefectAttachment Model | ||
* | ||
* @method int getVehicleDefectAttachmentId() | ||
* @method int getVehicleDefectId() | ||
* @method string getAttachmentType() | ||
* @method string getAttachmentLocation() | ||
* @method string getAttachmentDateUtc() | ||
* | ||
* @method DefectAttachment setVehicleDefectAttachmentId(int $attachmentId) | ||
* @method DefectAttachment setVehicleDefectId(int $defectId) | ||
* @method DefectAttachment setAttachmentType(string $type) | ||
* @method DefectAttachment setAttachmentLocation(string $location) | ||
* @method DefectAttachment setAttachmentDateUtc(string $date) | ||
*/ | ||
class DefectAttachment extends ModelAbstract | ||
{ | ||
|
||
protected $_allowedProperties = [ | ||
'VehicleDefectAttachmentId', | ||
'VehicleDefectId', | ||
'AttachmentType', | ||
'AttachmentLocation', | ||
'AttachmentDateUtc' | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelRowsetAbstract; | ||
|
||
/** | ||
* Vehicle DefectAttachment Rowset Model | ||
*/ | ||
class DefectAttachmentRowset extends ModelRowsetAbstract | ||
{ | ||
|
||
/** | ||
* Create new model to be added into the rowset | ||
* @param array|object $properties | ||
* @return DefectAttachment | ||
*/ | ||
public function getModel($properties) | ||
{ | ||
return new DefectAttachment($properties); | ||
} | ||
|
||
} | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelRowsetAbstract; | ||
|
||
/** | ||
* Vehicle DefectAttachment Rowset Model | ||
*/ | ||
class DefectAttachmentRowset extends ModelRowsetAbstract | ||
{ | ||
|
||
/** | ||
* Create new model to be added into the rowset | ||
* @param array|object $properties | ||
* @return DefectAttachment | ||
*/ | ||
public function getModel($properties) | ||
{ | ||
return new DefectAttachment($properties); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelAbstract; | ||
|
||
/** | ||
* Vehicle DefectComment Model | ||
* | ||
* @method int getVehicleDefectCommentId() | ||
* @method int getVehicleDefectId() | ||
* @method int getCreatedByContactId() | ||
* @method string getComment() | ||
* @method string getCommentDateUtc() | ||
* | ||
* @method DefectComment setVehicleDefectCommentId(int $commentId) | ||
* @method DefectComment setVehicleDefectId(int $defectId) | ||
* @method DefectComment setCreatedByContactId(int $contactId) | ||
* @method DefectComment setComment(string $comment) | ||
* @method DefectComment setCommentDateUtc(string $date) | ||
*/ | ||
class DefectComment extends ModelAbstract | ||
{ | ||
|
||
protected $_allowedProperties = [ | ||
'VehicleDefectCommentId', | ||
'VehicleDefectId', | ||
'CreatedByContactId', | ||
'Comment', | ||
'CommentDateUtc' | ||
]; | ||
|
||
} | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelAbstract; | ||
|
||
/** | ||
* Vehicle DefectComment Model | ||
* | ||
* @method int getVehicleDefectCommentId() | ||
* @method int getVehicleDefectId() | ||
* @method int getCreatedByContactId() | ||
* @method string getComment() | ||
* @method string getCommentDateUtc() | ||
* | ||
* @method DefectComment setVehicleDefectCommentId(int $commentId) | ||
* @method DefectComment setVehicleDefectId(int $defectId) | ||
* @method DefectComment setCreatedByContactId(int $contactId) | ||
* @method DefectComment setComment(string $comment) | ||
* @method DefectComment setCommentDateUtc(string $date) | ||
*/ | ||
class DefectComment extends ModelAbstract | ||
{ | ||
|
||
protected $_allowedProperties = [ | ||
'VehicleDefectCommentId', | ||
'VehicleDefectId', | ||
'CreatedByContactId', | ||
'Comment', | ||
'CommentDateUtc' | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelRowsetAbstract; | ||
|
||
/** | ||
* Vehicle DefectComment Rowset Model | ||
*/ | ||
class DefectCommentRowset extends ModelRowsetAbstract | ||
{ | ||
|
||
/** | ||
* Create new model to be added into the rowset | ||
* @param array|object $properties | ||
* @return DefectComment | ||
*/ | ||
public function getModel($properties) | ||
{ | ||
return new DefectComment($properties); | ||
} | ||
|
||
} | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelRowsetAbstract; | ||
|
||
/** | ||
* Vehicle DefectComment Rowset Model | ||
*/ | ||
class DefectCommentRowset extends ModelRowsetAbstract | ||
{ | ||
|
||
/** | ||
* Create new model to be added into the rowset | ||
* @param array|object $properties | ||
* @return DefectComment | ||
*/ | ||
public function getModel($properties) | ||
{ | ||
return new DefectComment($properties); | ||
} | ||
|
||
} |
Oops, something went wrong.