Short description of method delete

@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param  Resource resource
@param  boolean deleteReference
@return boolean
327645
public function delete( core_kernel_classes_Resource $resource, $deleteReference = false)
    {
        $returnValue = (bool) false;

		$query = 'DELETE FROM statements WHERE subject = ? AND '.$this->getModelWriteSqlCondition();
        $returnValue = $this->getPersistence()->exec($query, array($resource->getUri()));

        //if no rows affected return false
        if (!$returnValue){
        	$returnValue = false;
        } 
        else if($deleteReference){
        	$sqlQuery = 'DELETE FROM statements WHERE ' . $this->getPersistence()->getPlatForm()->getObjectTypeCondition() . ' = ? AND '.$this->getModelWriteSqlCondition();
        	$return = $this->getPersistence()->exec($sqlQuery, array ($resource->getUri()));
        	
        	if ($return !== false){
        		$returnValue = true;
        	}
        }
        

        return (bool) $returnValue;
    }
578380
public function deleteReference($data)
	{
		// Process the given data.
		$processPayload = $this->process('DELETE_REFERENCE', $data);

		if( ! $processPayload->isStatus(Payload::STATUS_VALID))
		{
			return $processPayload;
		}

		return $this->aggregate[ReferenceServiceProvider::getProviderKey()]->delete(['entity_uuid' => $data['uuid'], 'reference_uuid' => $data['reference']]);
	}
754793
public static base_response delete(nitro_service client, dnsaddrec resource) throws Exception {
		dnsaddrec deleteresource = new dnsaddrec();
		deleteresource.hostname = resource.hostname;
		deleteresource.ipaddress = resource.ipaddress;
		return deleteresource.delete_resource(client);
	}
1325970
public function delete($dn)
	{
		if (!$this->isBound || !$this->isConnected())
		{
			return false;
		}

		return ldap_delete($this->resource, $dn);
	}
445501
public static base_response delete(nitro_service client, route resource) throws Exception {
		route deleteresource = new route();
		deleteresource.network = resource.network;
		deleteresource.netmask = resource.netmask;
		deleteresource.gateway = resource.gateway;
		deleteresource.td = resource.td;
		return deleteresource.delete_resource(client);
	}
482538
public static void checkRemoveOK(Resource resource) throws IOException {
	if (!resource.exists()) throw new IOException("can't delete resource " + resource + ", resource does not exist");
	if (!resource.canWrite()) throw new IOException("can't delete resource " + resource + ", no access");

    }
886332
public static base_response delete(nitro_service client, String network) throws Exception {
		route6 deleteresource = new route6();
		deleteresource.network = network;
		return deleteresource.delete_resource(client);
	}
1319867
public function delete($resource, array $args = [], array $options = [])
    {
        $response = parent::delete($resource, $args, $options);
        $this->calls[] = [
            'method' => 'DELETE',
            'resource' => $resource,
            'args' => $args,
            'options' => $options,
            'success' => $response->success(),
            'response' => $response->getBody(),
        ];
        return $response;
    }
543464
public static snmp_trap delete(nitro_service client, snmp_trap resource) throws Exception
	{
		resource.validate("delete");
		return ((snmp_trap[]) resource.delete_resource(client))[0];
	}
795252
public static base_response delete(nitro_service client, dnsnameserver resource) throws Exception {
		dnsnameserver deleteresource = new dnsnameserver();
		deleteresource.ip = resource.ip;
		deleteresource.dnsvservername = resource.dnsvservername;
		return deleteresource.delete_resource(client);
	}
338021
public function delete()
    {
        try {
            $this->getHttpClient()->request('DELETE', $this->apiUrl());
        } catch (RequestException $e) {
            $this->throwResourceException($e->getResponse(), 'delete', DeleteResourceException::class);
        }

        return true;
    }
83676
public function onDelete(DeleteResourceEvent $event)
    {
        $ds = DIRECTORY_SEPARATOR;

        /** @var File $resource */
        $resource = $event->getResource();
        $workspace = $resource->getResourceNode()->getWorkspace();
        $hashName = $resource->getHashName();

        $archiveFile = $this->filesDir.$ds.'webresource'.$ds.$workspace->getUuid().$ds.$hashName;
        $webResourcesPath = $this->uploadDir.$ds.'webresource'.$ds.$workspace->getUuid().$ds.$hashName;

        if (file_exists($archiveFile)) {
            $event->setFiles([$archiveFile]);
        }
        if (file_exists($webResourcesPath)) {
            try {
                $this->deleteFiles($webResourcesPath);
            } catch (\Exception $e) {
            }
        }
        $this->om->remove($resource);
        $event->stopPropagation();
    }
987270
def delete(self, resource_id):
        
        resource = self._resource(resource_id)
        error_message = is_valid_method(self.__model__, resource)
        if error_message:
            raise BadRequestException(error_message)
        db.session().delete(resource)
        db.session().commit()
        return self._no_content_response()
1145015
protected function sendDeleteRequest($resource)
    {
        $response = $this->sendRequest(
            'DELETE',
            $this->getServiceUrl($resource),
            [
                'headers' => [
                    'Accept' => 'application/x-yametrika+json',
                    'Content-Type' => 'application/x-yametrika+json',
                    'Authorization' => 'OAuth ' . $this->getAccessToken(),
                ]
            ]
        );

        return $this->getDecodedBody($response->getBody());
    }
765304
public function deleteResource(string $project, string $resource): ResponseInterface
    {
        return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$project/resource/$resource")));
    }
198743
public function deleteResource(PersistentResource $resource)
    {
        $this->s3Client->deleteObject(array(
            'Bucket' => $this->bucketName,
            'Key' => $this->keyPrefix . $resource->getSha1()
        ));
        return true;
    }
1015861
public function deleteAction( $resource, $related )
	{
		$response = $this->createClient( $resource, $related )->delete( $this->getPsrRequest(), new Response() );
		return $this->setPsrResponse( $response );
	}