Cancel all resource in list that have an successfully status.

@param ResourceListInterface $resources The list of resources
763395
public static function cancelAllSuccessResources(ResourceListInterface $resources): void
    {
        foreach ($resources->all() as $resource) {
            if (ResourceStatutes::ERROR !== $resource->getStatus()) {
                $resource->setStatus(ResourceStatutes::CANCELED);
            }
        }
    }
828741
public function onLoaded(ResourceInterface $resource)
    {
        if (!$this->isDebugging() || $this->current === $resource) {
            return;
        }

        $this->ensureCollector($this->current);
        $this->meta[$this->current]->addResource($resource);
    }
231011
private function checkResources(array $resources): bool
    {
        $isValid = true;
        foreach ($resources as $key => $valueAndLocale) {
            $isValid = $isValid === true && $this->checkPair((string)$key, $valueAndLocale);
        }

        return $isValid;
    }
377680
public function set(ResourceInterface $resource): ResourceCollectionInterface
    {
        $this->collection[$this->buildArrayKey($resource->type(), $resource->id())] = $resource;

        return $this;
    }
229930
private function removeResource(InputInterface $input, OutputInterface $output)
    {
        $resource = $input->getOption('resource');
        $output->writeln(
            sprintf('<comment>Removing resource <info>%s</info></comment>', $resource)
        );

        $api = $this->getCloudinaryApi();

        $response = $api->delete_resources($resource);
        $this->outputApiResponse($response, 'deleted', $output);
    }
261590
public function delete(Resource $resource)
    {
        $data = $resource->toArray();

        $user = $this->userManager->findUserByUsername($data['username']);
        if (!$user) {
            $errorMessage = $this->translator->trans('error.user_not_found', array('%username%' => $data['username']));
            throw new NotFoundHttpException($errorMessage);
        }

        $this->userManager->deleteUser($user);
    }
248618
public function equals(ResourceInterface $resource) {
		if ($this->hasIdentification() === false || $resource->getResource()->hasIdentification() === false) {
			throw new Exception('can not compare resources if identification is missing');
		}
		
		return ($this->getIdentificationKey() === $resource->getResource()->getIdentificationKey());
	}
1285058
public function removeListElement( core_kernel_classes_Resource $element)
    {
        $returnValue = (bool) false;

        
        
		if(!is_null($element)){
			$returnValue = $element->delete();
        }
        
        

        return (bool) $returnValue;
    }
761294
protected function validateUndeleteResource(ResourceInterface $resource, $type): void
    {
        if (static::TYPE_UNDELETE === $type) {
            $object = $resource->getRealData();

            if ($object instanceof SoftDeletableInterface) {
                $object->setDeletedAt();
            } else {
                DomainUtil::addResourceError($resource, $this->translator->trans('domain.resource_type_not_undeleted', [], 'FxpResource'));
            }
        }
    }
1195216
public function setResource(ImageResourceInterface $resource)
    {
        $this->resource = $resource;

        if ($this->resource instanceof ImageFilterableInterface) {
            $this->filterResolver = new FilterResolver($this->resource->loadFilters());
        }
    }
943033
def delete_resource(self, resource_id):
        """"""
        resource_obj = self.resource(resource_id)
        logger.debug("Deleting resource {0}".format(resource_obj.name))
        self.session.delete(resource_obj)
        self.save()
346503
public function unpublishResource(PersistentResource $resource)
    {
        try {
            $objectName = $this->keyPrefix . $this->getRelativePublicationPathAndFilename($resource);
            $this->s3Client->deleteObject(array(
                'Bucket' => $this->bucketName,
                'Key' => $objectName
            ));
            $this->systemLogger->log(sprintf('Successfully unpublished resource as object "%s" (MD5: %s) from bucket "%s"', $objectName, $resource->getMd5() ?: 'unknown', $this->bucketName), LOG_DEBUG);
        } catch (\Exception $e) {
        }
    }
193593
public function addResource(ResourceInterface $resource) {
		if ($this->type === RelationshipObject::TO_ONE) {
			throw new InputException('can not add a resource to a to-one relationship, use ->setResource()');
		}
		
		$this->resources[] = $resource;
	}
927959
protected static void removeInternalFiles(List<CmsResource> resources) {

        Iterator<CmsResource> iter = resources.iterator();
        while (iter.hasNext()) {
            CmsResource resource = iter.next();
            if (resource.isInternal()) {
                iter.remove();
            }
        }
    }
292423
public function removeElement(ResourceInterface $resource): ResourceCollectionInterface
    {
        $this->remove($resource->type(), $resource->id());

        return $this;
    }
623945
public static function releaseResource(IPoolResource $resource)
    {
        $resource->getPool()->release($resource);
        if(RequestContext::exsits())
        {
            static::removeResourceFromRequestContext($resource);
        }
    }
424765
public function release($resource)
    {
        $this->idlePool->enqueue($resource);
        //有任务要做
        if (count($this->taskQueue) > 0)
        {
            $this->doTask();
        }
    }