Checks if outcome can be deleted.

@return bool
336369
public function can_delete() {
        if ($this->get_item_uses_count()) {
            return false;
        }
        if (empty($this->courseid)) {
            if ($this->get_course_uses_count()) {
                return false;
            }
        }
        return true;
    }
1285690
final public function delete()
    {
        $pre = $this->preDelete();
        if ($pre === false) {
            $this->logger->error(sprintf(
                'Can not delete object "%s:%s"; cancelled by %s::preDelete()',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $ret = $this->source()->deleteItem($this);
        if ($ret === false) {
            $this->logger->error(sprintf(
                'Can not delete object "%s:%s"; repository failed for %s',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $del = $this->postDelete();
        if ($del === false) {
            $this->logger->warning(sprintf(
                'Deleted object "%s:%s" but %s::postDelete() failed',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        return true;
    }
183587
protected function canDeleteCategory()
    {
        return isset($this->data_category['category_id'])
            && $this->category->canDelete($this->data_category['category_id'])
            && $this->access('category_delete');
    }
388785
public function delete_by()
    {
        $where = func_get_args();

	    $where = $this->trigger('before_delete', $where);

        $this->_set_where($where);


        if ($this->soft_delete)
        {
            $result = $this->_database->update($this->_table, array( $this->soft_delete_key => TRUE ));
        }
        else
        {
            $result = $this->_database->delete($this->_table);
        }

        $this->trigger('after_delete', $result);

        return $result;
    }
1195185
protected function isDeletable()
    {
        return
            $this->deletable
            &&
            ! $this->isTrashed()
            &&
            $this->getModelConfiguration()->isDeletable(
                $this->getModel()
            );
    }
265750
public function delete(): bool
    {
        $isSoftDeleted = array_key_exists('Illuminate\Database\Eloquent\SoftDeletes', class_uses($this));
        if ($this->exists && ! $isSoftDeleted) {
            $this->roles()->detach();
        }

        return parent::delete();
    }
26625
private function isSoftDelete()
    {
        // check flag variable used in laravel 4.2+
        if (isset($this->forceDeleting)) {
            return !$this->forceDeleting;
        }

        // otherwise, look for flag used in older versions
        if (isset($this->softDelete)) {
            return $this->softDelete;
        }

        return false;
    }
1063098
public function delete()
    {
        $queryKeys = $this->prepareKeys(false);

        if (count($queryKeys) > 0) {
            return $this->redClient->del($queryKeys);
        }

        return false;
    }
1163370
public function delete()
    {
        $return = false;
        if (isset($this->tokenId)) {
            $return = $this->apiCall->delete(
                $this->endpoint.'/delete',
                array('tokenId'=>$this->tokenId)
            );
        }
        return $return;
    }
4746
public function delete()
    {
        if (empty($this->unique)) {
            return false;
        }
        foreach($this->unique as $column) {
            if (!isset($this->instance[$column])) {
                return false;
            }
        }

        $sql = 'DELETE FROM '.$this->fq_name.' WHERE 1=1';
        $args = array();
        foreach($this->unique as $name) {
            $sql .= ' AND '.$this->connection->identifierEscape($name).' = ?';
            $args[] = $this->instance[$name];
        }

        $prep = $this->connection->prepare($sql);
        $result = $this->connection->execute($prep, $args);

        return ($result === false) ? false : true;
    }
755960
protected function canDeleteLanguage()
    {
        return isset($this->data_language['code'])
            && $this->access('language_delete')
            && $this->language->canDelete($this->data_language['code']);
    }
179536
public final function remove()
    {
        if ($this->exists())
        {
            if (unlink($this->getPath()))
                return true;
            throw new \Exception($this->getName() . ': Deleting failed');
        }
    }
11471
public function delete()
    {
        if (isset($this->onDelete)) {
            return call_user_func($this->onDelete, $this);
        }

        $this->forceDelete();
    }
455794
private function canRetry()
    {
        if ($this->isUnlimitedAttempts()) {
            return true;
        }

        $this->attempts++;

        return $this->attempts < $this->maxAttempts;
    }
741115
public function delete() {
        if (!$this->is_writable()) {
            return false;
        }

        if ($this->is_directory()) {
            $filepath = $this->lf->get_filepath();
            $fs = get_file_storage();
            $storedfiles = $fs->get_area_files($this->context->id, $this->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid());
            foreach ($storedfiles as $file) {
                if (strpos($file->get_filepath(), $filepath) === 0) {
                    $file->delete();
                }
            }
        }

        return $this->lf->delete();
    }
387566
public function isSuccessful()
    {
        $successful = false;

        $errorCode = $this->getErrorCode();
        if ($errorCode === 200 || $errorCode === 0) {
            $successful = true;
        }

        return $successful;
    }
549575
public function deleteOutdated(): bool
    {
        $sql =  'DELETE FROM `' . $this->table . '`'
                . ' WHERE `' . $this->savetimeField . '`<'
                . '(' . time() . '-`' . $this->timestampField . '`)';
        return $this->db->query($sql);
    }