. */ /* */ /*************************************************************************************/ namespace ColissimoPickupPoint\WebService; use stdClass; use Symfony\Component\Config\Definition\Exception\Exception; /** * Class FindById * @package ColissimoPickupPoint\WebService * @author Thelia * * @method FindById getId() * @method FindById setId($value) * @method FindById getReseau() * @method FindById setReseau($value) * @method FindById getLangue() * @method FindById setLangue($value) * @method FindById getDate() * @method FindById setDate($value) */ class FindById extends BaseColissimoPickupPointWebService { protected $id; /** @var string if belgique: R12, else empty */ protected $reseau; protected $langue; protected $date; public function __construct() { parent::__construct('findPointRetraitAcheminementByID'); } public function isError(stdClass $response) { return isset($response->return->errorCode) && $response->return->errorCode != 0; } public function getError(stdClass $response) { return isset($response->return->errorMessage) ? $response->return->errorMessage : 'Unknown error'; } /** * @param stdClass $response * @return stdClass * @throws Exception */ public function getFormattedResponse(stdClass $response) { if (!isset($response->return->pointRetraitAcheminement)) { throw new Exception('An unknown error happened'); } return $response->return->pointRetraitAcheminement; } }