Remove not used dangerous code
This commit is contained in:
parent
02f559db5f
commit
18aa03defe
@ -18,10 +18,10 @@
|
|||||||
* versions in the future. If you wish to customize PrestaShop for your
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
* needs please refer to http://www.prestashop.com for more information.
|
* needs please refer to http://www.prestashop.com for more information.
|
||||||
*
|
*
|
||||||
* @author PrestaShop SA <contact@prestashop.com>
|
* @author PrestaShop SA <contact@prestashop.com>
|
||||||
* @copyright 2007-2013 PrestaShop SA
|
* @copyright 2007-2013 PrestaShop SA
|
||||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
* PrestaShop Webservice Library
|
* PrestaShop Webservice Library
|
||||||
* @package PrestaShopWebservice
|
* @package PrestaShopWebservice
|
||||||
*/
|
*/
|
||||||
@ -395,52 +395,6 @@ class PrestaShopWebservice
|
|||||||
self::checkStatusCode($request['status_code']);// check the response validity
|
self::checkStatusCode($request['status_code']);// check the response validity
|
||||||
return self::parseXML($request['response']);
|
return self::parseXML($request['response']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete (DELETE) a resource.
|
|
||||||
* Unique parameter must take : <br><br>
|
|
||||||
* 'resource' => Resource name<br>
|
|
||||||
* 'id' => ID or array which contains IDs of a resource(s) you want to delete<br><br>
|
|
||||||
* <code>
|
|
||||||
* <?php
|
|
||||||
* require_once('./PrestaShopWebservice.php');
|
|
||||||
* try
|
|
||||||
* {
|
|
||||||
* $ws = new PrestaShopWebservice('http://mystore.com/', 'ZQ88PRJX5VWQHCWE4EE7SQ7HPNX00RAJ', false);
|
|
||||||
* $xml = $ws->delete(array('resource' => 'orders', 'id' => 1));
|
|
||||||
* // Following code will not be executed if an exception is thrown.
|
|
||||||
* echo 'Successfully deleted.';
|
|
||||||
* }
|
|
||||||
* catch (PrestaShopWebserviceException $ex)
|
|
||||||
* {
|
|
||||||
* echo 'Error : '.$ex->getMessage();
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
* </code>
|
|
||||||
*
|
|
||||||
* @param array $options Array representing resource to delete.
|
|
||||||
* @return boolean True
|
|
||||||
*/
|
|
||||||
public function delete($options)
|
|
||||||
{
|
|
||||||
if (isset($options['url'])) {
|
|
||||||
$url = $options['url'];
|
|
||||||
} elseif (isset($options['resource']) && isset($options['id'])) {
|
|
||||||
if (is_array($options['id']))
|
|
||||||
$url = $this->url.'/api/'.$options['resource'].'/?id=['.implode(',', $options['id']).']';
|
|
||||||
else
|
|
||||||
$url = $this->url.'/api/'.$options['resource'].'/'.$options['id'];
|
|
||||||
}
|
|
||||||
if (isset($options['id_shop'])) {
|
|
||||||
$url .= '&id_shop='.$options['id_shop'];
|
|
||||||
}
|
|
||||||
if (isset($options['id_group_shop'])) {
|
|
||||||
$url .= '&id_group_shop='.$options['id_group_shop'];
|
|
||||||
}
|
|
||||||
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE'));
|
|
||||||
self::checkStatusCode($request['status_code']);// check the response validity
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user