* @author Sebastian Ertner * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @link http://www.temando.com/ */ class FulfillmentRequest implements FulfillmentRequestInterface { /** * @var FulfillmentRequestTypeInterface */ private $fulfillment; /** * OrderRequest constructor. * * @param FulfillmentRequestTypeInterface $fulfillment */ public function __construct(FulfillmentRequestTypeInterface $fulfillment) { $this->fulfillment = $fulfillment; } /** * @return string[] */ public function getPathParams() { if (!$this->fulfillment->getId()) { return []; } return [ $this->fulfillment->getId(), ]; } /** * @return string */ public function getRequestBody() { return json_encode($this->fulfillment, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } }