first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Subclass for performing query and update operations on the 'st_paczkomaty_dispatch_order' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package plugins.stPaczkomatyPlugin.lib.model
|
||||
*/
|
||||
class PaczkomatyDispatchOrderPeer extends BasePaczkomatyDispatchOrderPeer
|
||||
{
|
||||
public static function doSelectWithShipX(Criteria $c, $con = null)
|
||||
{
|
||||
/**
|
||||
* @var PaczkomatyDispatchOrder[]
|
||||
*/
|
||||
$results = [];
|
||||
$ids = [];
|
||||
|
||||
foreach (parent::doSelect($c, $con) as $index => $result)
|
||||
{
|
||||
$ids[] = $result->getDispatchOrderId();
|
||||
$results[empty($result->getDispatchOrderId()) ? $index : $result->getDispatchOrderId()] = $result;
|
||||
}
|
||||
|
||||
$api = stInPostApi::getInstance();
|
||||
$response = $api->getDispatchOrders($ids);
|
||||
|
||||
foreach ($response->items as $item)
|
||||
{
|
||||
if (isset($results[$item->id]))
|
||||
{
|
||||
$results[$item->id]->setStatus($item->status);
|
||||
$results[$item->id]->save();
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user