Domain/Domain.php
protected function doDeleteResource(ResourceInterface $resource, $soft)
    {
        $skipped = false;
        $object = $resource->getRealData();

        if ($object instanceof SoftDeletableInterface) {
            if ($soft) {
                if ($object->isDeleted()) {
                    $skipped = true;
                } else {
                    $this->doDeleteResourceAction($resource);
                }
            } else {
                if (!$object->isDeleted()) {
                    $object->setDeletedAt(new \DateTime());
                }
                $this->doDeleteResourceAction($resource);
            }
        } else {
            $this->doDeleteResourceAction($resource);
        }

        return $skipped;
    }
protected function doDeleteResource(ResourceInterface $resource, $soft)
    {
        $skipped = false;
        $object = $resource->getRealData();

        if ($object instanceof SoftDeletableInterface) {
            if ($soft) {
                if ($object->isDeleted()) {
                    $skipped = true;
                } else {
                    $this->doDeleteResourceAction($resource);
                }
            } else {
                if (!$object->isDeleted()) {
                    $object->setDeletedAt(new \DateTime());
                }
                $this->doDeleteResourceAction($resource);
            }
        } else {
            $this->doDeleteResourceAction($resource);
        }

        return $skipped;
    }
protected function doDeleteResource ( ResourceInterface $ resource , $ soft ) { $ skipped = false ; $ object = $ resource -> getRealData ( ) ; if ( $ object instanceof SoftDeletableInterface ) { if ( $ soft ) { if ( $ object -> isDeleted ( ) ) { $ skipped = true ; } else { $ this -> doDeleteResourceAction ( $ resource ) ; } } else { if ( ! $ object -> isDeleted ( ) ) { $ object -> setDeletedAt ( new \ DateTime ( ) ) ; } $ this -> doDeleteResourceAction ( $ resource ) ; } } else { $ this -> doDeleteResourceAction ( $ resource ) ; } return $ skipped ; }
Do delete a resource.

@param ResourceInterface $resource The resource
@param bool              $soft     The soft deletable

@throws

@return bool Check if the resource is skipped or deleted
Do delete a resource .