public function deleteOrFail(EntityInterface $entity, $options = [])
    {
        $deleted = $this->delete($entity, $options);
        if ($deleted === false) {
            throw new PersistenceFailedException($entity, ['delete']);
        }

        return $deleted;
    }
public function deleteOrFail(EntityInterface $entity, $options = [])
    {
        $deleted = $this->delete($entity, $options);
        if ($deleted === false) {
            throw new PersistenceFailedException($entity, ['delete']);
        }

        return $deleted;
    }
public function deleteOrFail ( EntityInterface $ entity , $ options = [ ] ) { $ deleted = $ this -> delete ( $ entity , $ options ) ; if ( $ deleted === false ) { throw new PersistenceFailedException ( $ entity , [ 'delete' ] ) ; } return $ deleted ; }
Try to delete an entity or throw a PersistenceFailedException if the entity is new,
has no primary key value, application rules checks failed or the delete was aborted by a callback.

@param \Cake\Datasource\EntityInterface $entity The entity to remove.
@param array|\ArrayAccess $options The options for the delete.
@return bool success
@throws \Cake\ORM\Exception\PersistenceFailedException
@see \Cake\ORM\Table::delete()
Try to delete an entity or throw a PersistenceFailedException if the entity is new has no primary key value application rules checks failed or the delete was aborted by a callback .