Destroys (permanently deletes) an object

@param  string $sObject The object's filename
@param  string $sBucket The bucket's slug

@return boolean
193517
public function objectDestroy($sObject, $sBucket)
    {
        try {

            $sFilename  = strtolower(substr($sObject, 0, strrpos($sObject, '.')));
            $sExtension = strtolower(substr($sObject, strrpos($sObject, '.')));
            $this->sdk()->deleteObjects([
                'Bucket' => $this->getBucket(),
                'Delete' => [
                    'Objects' => [
                        ['Key' => $sBucket . '/' . $sFilename . $sExtension],
                        ['Key' => $sBucket . '/' . $sFilename . '-download' . $sExtension],
                    ],
                ],
            ]);
            return true;

        } catch (\Exception $e) {
            $this->setError('AWS-SDK EXCEPTION: [objectDestroy]: ' . $e->getMessage());
            return false;
        }
    }
280191
function destroy(object) {
    if (isObject(object)) {
        if (isFunction(object.finalize)) {
            object.finalize();
        }
        for (var property in object) {
            if (true) {//For lint
                delete object[property];
            }
        }
    }
}
1058659
public function delete($object, array $options = [])
    {
        $this->checkPermission('DELETE', $object, [], true);

        if ($this->dispatch('delete', 'pre', [$object, $options])) {
            if (!in_array(Options::SOFT_DELETE, $options)) {
                $this->om->remove($object);
                $this->om->flush();
            }
            $this->dispatch('delete', 'post', [$object, $options]);
        }
    }
280839
protected function destroy( ValueObject $object )
    {
        // Ignore warnings about not empty cache directory. See: https://github.com/ezsystems/BehatBundle/pull/71
        $currentErrorReportingLevel = error_reporting();
        error_reporting($currentErrorReportingLevel & ~E_WARNING);

        /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $repository->sudo(
            function() use( $repository, $object )
            {
                $roleService = $repository->getRoleService();
                try
                {
                    $objectToBeRemoved = $roleService->loadRole( $object->id );
                    $roleService->deleteRole( $objectToBeRemoved );
                }
                catch ( ApiExceptions\NotFoundException $e )
                {
                    // nothing to do
                }
            }
        );

        error_reporting($currentErrorReportingLevel);
    }
1031411
public function bucketCreate($sBucket)
    {
        //  Attempt to create a 'folder' object on S3
        if (!$this->sdk()->doesObjectExist($this->getBucket(), $sBucket . '/')) {

            try {

                $this->sdk()->putObject([
                    'Bucket' => $this->getBucket(),
                    'Key'    => $sBucket . '/',
                    'Body'   => '',
                ]);

                return true;

            } catch (\Exception $e) {
                $this->setError('AWS-SDK EXCEPTION: [bucketCreate]: ' . $e->getMessage());
                return false;
            }

        } else {

            //  Bucket already exists.
            return true;
        }
    }
939422
public function shutdownObject()
    {
        /** @var PersistentResource $resource */
        foreach ($this->resourceRepository->getAddedResources() as $resource) {
            if ($this->persistenceManager->isNewObject($resource)) {
                $this->deleteResource($resource, false);
            }
        }
    }
1097976
public function deleteBlob($container = '', $name = '', $noCheck = false)
    {
        $this->checkConnection();
        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);
            if (empty($container)) {
                throw new \Exception("No container named '$container'");
            }

            $obj = null;
            try {
                $obj = $container->DataObject($name);
            } catch (\Exception $ex) {
                if ($noCheck) {
                    return;
                }
                throw $ex;
            }
            if ($obj) {
                $obj->Delete();
            }
        } catch (\Exception $ex) {
            static::handleGuzzleException($ex);
            if ($ex instanceof ObjFetchError) {
                throw new NotFoundException("File '$name' was not found.'");
            }
            throw new DfException('Failed to delete blob "' . $name . '": ' . $ex->getMessage());
        }
    }
605341
public function deleteBrickBySlug($slug)
    {
        $bricks = $this->repository->bricks;
        foreach ($bricks as $key => $brickObject) {
            if ($brickObject->slug == $slug) {
                unset($bricks[$key]);
            }
        }

        $bricks = array_values($bricks);
        $this->repository->bricks = $bricks;
        $this->save();
    }
1310387
public function deleteFile($container, $path, $noCheck = false)
    {
        $this->deleteBlob($container, $path, $noCheck);
    }
484444
public function remove(KObjectHandlable $object)
    {
        if ($this->offsetExists($object)) {
            $this->offsetUnset($object);
        }

        return $this;
    }
921188
public function deleteObjects(string $bucket, array $objects)
    {
        try {
            $this->client->deleteObjects($bucket, $objects);
            return $this->success('批量删除文件成功');
        } catch (\Exception $exception) {
            return $this->error('调用阿里云接口出错：' . $exception->getMessage());
        }
    }
1214534
public function delete_object( $params ) {

		$params = (object) $params;
		$object = $this->load_object( $params );

		if ( empty( $object ) ) {
			return pods_error( sprintf( __( "%s Object not found", 'pods' ), ucwords( $params->type ) ), $this );
		}

		$success = wp_delete_post( $params->id );

		if ( ! $success ) {
			return pods_error( sprintf( __( "%s Object not deleted", 'pods' ), ucwords( $params->type ) ), $this );
		}

		pods_transient_clear( 'pods_objects_' . $params->type );

		return true;
	}
853313
public static function deleteObject($bucket, $uri)
	{
		$rest = new S3Request('DELETE', $bucket, $uri, self::$endpoint);
		$rest = $rest->getResponse();
		if ($rest->error === false && $rest->code !== 204)
			$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
		if ($rest->error !== false)
		{
			self::__triggerError(sprintf("S3::deleteObject(): [%s] %s",
			$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
			return false;
		}
		return true;
	}
484372
public function deleteThumbnail($oObject)
    {
        if (($sThumb = $oObject->oxarticles__oxthumb->value)) {
            // deleting article main icon and thumb picture
            $sPath = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureDir(false) . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType("TH");
            \OxidEsales\Eshop\Core\Registry::getUtilsPic()->safePictureDelete($sThumb, $sPath, "oxarticles", "oxthumb");
        }
    }
653378
public function remove($object, $flush = true)
    {
        $this->isExpectedObject($object);
        $this->objectManager->remove($object);
        if ($flush) {
            $this->flush();
        }
    }
1048090
public function remove($object)
    {
        // create property accessor
        $accessor = PropertyAccess::createPropertyAccessor();

        // delete existing documents with same id
        foreach ($this->index->find('id:' . $accessor->getValue($object, 'id')) as $hit) {
            $this->index->delete($hit->id);
        }
    }
1364634
public function objectLocalPath($sBucket, $sFilename)
    {
        $sPath = $this->getPath() . $sBucket . '/' . $sFilename;

        if (is_file($sPath)) {
            return $sPath;
        } else {
            $this->setError('Could not find a valid local path for object ' . $sBucket . '/' . $sFilename);
            return false;
        }
    }