src/Datajet/Resource/Product.php
public function delete($id)
    {
        $response = false;
        if (empty($id)) {
            throw new \InvalidArgumentException('ID Product cannot be empty');
        }

        try {
            $apiResponse = $this->client->delete("{$this->uriImport}product/{$id}", [
                'query' => [
                    'key' => $this->config['data']['key'],
                ],
            ]);

            $apiResponse = json_decode($apiResponse->getBody(), true);

            if (isset($apiResponse['affected']) && $apiResponse['affected'] > 0) {
                $response = true;
            }
        } catch (ClientException $e) {
            $response = false;
        }

        return $response;
    }
public function delete($id)
    {
        $response = false;
        if (empty($id)) {
            throw new \InvalidArgumentException('ID Product cannot be empty');
        }

        try {
            $apiResponse = $this->client->delete("{$this->uriImport}product/{$id}", [
                'query' => [
                    'key' => $this->config['data']['key'],
                ],
            ]);

            $apiResponse = json_decode($apiResponse->getBody(), true);

            if (isset($apiResponse['affected']) && $apiResponse['affected'] > 0) {
                $response = true;
            }
        } catch (ClientException $e) {
            $response = false;
        }

        return $response;
    }
public function delete ( $ id ) { $ response = false ; if ( empty ( $ id ) ) { throw new \ InvalidArgumentException ( 'ID Product cannot be empty' ) ; } try { $ apiResponse = $ this -> client -> delete ( "{$this->uriImport}product/{$id}" , [ 'query' => [ 'key' => $ this -> config [ 'data' ] [ 'key' ] , ] , ] ) ; $ apiResponse = json_decode ( $ apiResponse -> getBody ( ) , true ) ; if ( isset ( $ apiResponse [ 'affected' ] ) && $ apiResponse [ 'affected' ] > 0 ) { $ response = true ; } } catch ( ClientException $ e ) { $ response = false ; } return $ response ; }
Product Delete.

@param string $id

@return bool
Product Delete .