Skip to content

Commit

Permalink
getByInspectionIdVehicleAndDate() API call and tests, fixing accident…
Browse files Browse the repository at this point in the history
…al CRLF's
  • Loading branch information
sergeymitr committed Mar 15, 2017
1 parent 27633c4 commit 0c4a960
Show file tree
Hide file tree
Showing 14 changed files with 467 additions and 446 deletions.
152 changes: 76 additions & 76 deletions lib/Models/Vehicle/Defect.php
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;
}

}
66 changes: 33 additions & 33 deletions lib/Models/Vehicle/DefectAttachment.php
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'
];

}
46 changes: 23 additions & 23 deletions lib/Models/Vehicle/DefectAttachmentRowset.php
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);
}

}
66 changes: 33 additions & 33 deletions lib/Models/Vehicle/DefectComment.php
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'
];

}
46 changes: 23 additions & 23 deletions lib/Models/Vehicle/DefectCommentRowset.php
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);
}

}
Loading

0 comments on commit 0c4a960

Please sign in to comment.