コード例 #1
0
ファイル: Orders.php プロジェクト: ClaudioThomas/shopware-4
 /**
  * Update order
  *
  * PUT /api/orders/{id}
  */
 public function putAction()
 {
     $id = $this->Request()->getParam('id');
     $useNumberAsId = (bool) $this->Request()->getParam('useNumberAsId', 0);
     $params = $this->Request()->getPost();
     if ($useNumberAsId) {
         $order = $this->resource->updateByNumber($id, $params);
     } else {
         $order = $this->resource->update($id, $params);
     }
     $location = $this->apiBaseUrl . 'orders/' . $order->getId();
     $data = array('id' => $order->getId(), 'location' => $location);
     $this->View()->assign(array('success' => true, 'data' => $data));
 }
コード例 #2
0
ファイル: Orders.php プロジェクト: nhp/shopware-4
    /**
     * Update order
     *
     * PUT /api/orders/{id}
     */
    public function putAction()
    {
        $id = $this->Request()->getParam('id');
        $params = $this->Request()->getPost();

        $order = $this->resource->update($id, $params);

        $location = $this->apiBaseUrl . 'orders/' . $order->getId();
        $data = array(
            'id'       => $order->getId(),
            'location' => $location
        );

        $this->View()->assign(array('success' => true, 'data' => $data));
        $this->Response()->setHeader('Location', $location);
    }