Пример #1
0
 /**
  * @return \Shopware\Components\Api\Resource\Variant
  */
 private function getVariantResource()
 {
     $resource = new \Shopware\Components\Api\Resource\Variant();
     $resource->setManager(Shopware()->Models());
     $resource->setResultMode(1);
     return $resource;
 }
Пример #2
0
 /**
  * Delete a given variant
  *
  * DELETE /api/variants/{id}
  */
 public function deleteAction()
 {
     $id = $this->Request()->getParam('id');
     $useNumberAsId = (bool) $this->Request()->getParam('useNumberAsId', 0);
     if ($useNumberAsId) {
         $this->resource->deleteByNumber($id);
     } else {
         $this->resource->delete($id);
     }
     $this->View()->assign(['success' => true]);
 }