forked from shiptoreps/shiptor-russia-php-api-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from omkod/dev
Добавлен метод editPickUp
- Loading branch information
Showing
2 changed files
with
63 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace ShiptorRussiaApiClient\Client\Api\ShippingEndpoint\Request; | ||
|
||
use ShiptorRussiaApiClient\Client\Api\ShippingEndpoint\Model\Pickup as EditPickUpResult; | ||
use ShiptorRussiaApiClient\Client\Api\ShippingEndpoint\Request\GenericRequest as GenericShippingRequest; | ||
|
||
class EditPickUp extends GenericShippingRequest | ||
{ | ||
protected $name = "editPickUp"; | ||
|
||
protected function initFields() | ||
{ | ||
$this->getFieldsCollection() | ||
->Number("id")->setRequired()->add() | ||
->Number("warehouse_id")->setRequired()->add() | ||
->String("date")->setRequired()->add() | ||
->Number("time")->add() | ||
->String("comment")->add() | ||
->Number("packages")->setMulty()->setRequired()->add(); | ||
} | ||
|
||
public function getResponseClassName() | ||
{ | ||
return EditPickUpResult::class; | ||
} | ||
|
||
public function setId($id) | ||
{ | ||
$this->setField("id", $id); | ||
return $this; | ||
} | ||
|
||
public function setWarehouse($warehouseId){ | ||
return $this->setField("warehouse_id", $warehouseId); | ||
} | ||
|
||
public function setDate($date){ | ||
$convertedDate = date("Y-m-d",strtotime($date)); | ||
return $this->setField("date", $convertedDate); | ||
} | ||
|
||
public function setTime($time) | ||
{ | ||
return $this->setField("time", $time); | ||
} | ||
|
||
public function setPackages($arPackages){ | ||
return $this->setField("packages", (array)$arPackages); | ||
} | ||
|
||
public function setComment($comment){ | ||
return $this->setField("comment", $comment); | ||
} | ||
} | ||
|