/** * @return bool * @throws Main\NotSupportedException * @throws Main\SystemException */ public static function tryUnship() { // throw new Main\NotImplementedException(); // if ($result = Provider::tryShipment($this)) // { // //$shipped = false; // foreach ($result as $resultDat) // { // if ($resultDat['RESULT'] === false) // { // throw new Main\SystemException('wrong shipment'); // } // } // } // return true; $result = new Result(); /** @var Result $r */ $r = Provider::tryShipment($this); if ($r->isSuccess()) { $resultList = $r->getData(); if (!empty($resultList) && is_array($resultList)) { /** @var Result $resultDat */ foreach ($resultList as $resultDat) { if (!$resultDat->isSuccess()) { $result->addErrors($resultDat->getErrors()); } } } } return $result; }