Deletes this outcome from the database.

@param string $source from where was the object deleted (mod/forum, manual, etc.)
@return bool success
328738
public function delete($source=null) {
        global $DB;
        if (!empty($this->courseid)) {
            $DB->delete_records('grade_outcomes_courses', array('outcomeid' => $this->id, 'courseid' => $this->courseid));
        }
        if (parent::delete($source)) {
            $context = context_system::instance();
            $fs = get_file_storage();
            $files = $fs->get_area_files($context->id, 'grade', 'outcome', $this->id);
            foreach ($files as $file) {
                $file->delete();
            }
            return true;
        }
        return false;
    }
519227
public function deleteSourceAction($source)
    {
        $deleted = $this->externalUserGroupSyncManager->deleteExternalSource($source);

        return new JsonResponse(['deleted' => true], !$deleted ? 500 : 200);
    }
1263362
public function delete()
    {
        $database = DatabaseLayer::getInstance();

        $delete = $database->delete($this->getTableName(), $this->getTableAlias());
        $delete->setModel($this);
        $delete->condition($this->getIDField(), $this->getId());
        $delete->execute($this->getClass());

        // Invalidate cache.
        SearchIndex::getInstance()->expire($this->getTableName(), $this->getId());

        return true;
    }
839584
public function truncate($source)
    {
        $this->execute('DELETE' . ' FROM ' . $this->_escapeIdentifier($source));
        $this->execute('DELETE' . ' FROM sqlite_sequence WHERE name=:name', ['name' => $source]);

        return $this;
    }
771546
public function remove($conditions)
    {
        $sql = 'DELETE FROM ' . $this->table .
            ' WHERE id = :id';

        $stat = $this->pdo->prepare($sql);
        $stat->bindValue(':id', $conditions);

        return $stat->execute();
    }
703779
public function del($key) {

        $keys = func_get_args();
        $removed = 0;

        foreach ($keys as $key) {
            $sql = 'DELETE FROM '.$this->table.' WHERE `key`="'.$key.'"';
            $this->connection->exec($sql);
            $removed++;
        }

        return $removed;
    }
842577
public function delete($source, $option = false)
    {
        if (is_file($source)) {
            return unlink($source);
        } elseif (is_dir($source)) {
            $files = $this->readDir($source);

            foreach ($files as $file) {
                if (is_dir($source.'/'.$file) && $option == true) {
                    $this->delete($source.'/'.$file, $option);
                } elseif (is_file($source.'/'.$file)) {
                    $this->delete($source.'/'.$file, $option);
                }
            }
            rmdir($source);
        }

        return true;
    }
1355354
public function delete(): bool
    {
        if (! $this->exists())
        {
            return false;
        }

        $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE ' . $this->getKeyName() . ' = :key';
        $query = DB::getConnection()->prepare($sql);

        return $query->execute(['key' => $this->getKey()]);
    }
1114387
public function delete ()
	{
		$this->before_delete();

		$statement = 'DELETE FROM ' . static::$table_name;

		$pk = $this->primary_key_condition();

		$statement .= ' WHERE ' . $pk->statement;

		$result = $this->db->query($statement, $pk->values->getArrayCopy(), 'multi', null, false);

		$this->stored = true;
		$this->updated = false;

		$this->after_delete();

		return true;
	}
125180
public function delete_all_grades($source=null) {
        if (!$this->is_course_item()) {
            $this->force_regrading();
        }

        if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) {
            foreach ($grades as $grade) {
                $grade->delete($source);
            }
        }

        // Delete all the historical files.
        // We only support feedback files for modules atm.
        if ($this->is_external_item()) {
            $fs = new file_storage();
            $fs->delete_area_files($this->get_context()->id, GRADE_FILE_COMPONENT, GRADE_HISTORY_FEEDBACK_FILEAREA);
        }

        return true;
    }
1202471
public function destroy($id)
    {
        try {
            return (bool) $this->db->from($this->table)
                    ->where($this->columns['id'])->eq($id)
                    ->delete();
        } catch (PDOException $e) {
            return false;
        }
    }
306821
protected function deleteValue($key)
    {
        $this->db->createCommand()
            ->delete($this->cacheTable, ['id' => $key])
            ->execute();

        return true;
    }
743275
public function delete(string $key): bool
    {
        $func = self::$type . '_delete';
        $func($key);
        return parent::delete($key);
    }
905920
public static function remove($source)
    {
        if (!is_file($source)) {
            return false;
        }
        try {
            @unlink($source);
            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
640251
final public function delete( array $where, $table = '', $place_holders = [] ) {
		if ( ! $place_holders ) {
			try {
				$place_holders = $this->get_place_holders( $where );
			} catch ( \Exception $e ) {
				return false;
			}
		}
		return $this->db->delete( $table ?: $this->table, $where, $place_holders );
	}
394238
public function delete () : bool
	{
        $dbObject  = Database::getInstance();
		$sqlQuery  = "DELETE FROM ".static::$tableName." WHERE id=";
		$sqlQuery .= $dbObject->escapeValue($this->id)." LIMIT 1";
		$dbObject->query($sqlQuery);
		static::$affectedRows = $dbObject->affectedRows();
		return ($dbObject->affectedRows() == 1) ? TRUE : FALSE;
	}
1247797
public function EmptyTable($Table = '') {
      if ($Table == '') {
         if (!isset($this->_Froms[0]))
            return FALSE;

         $Table = $this->_Froms[0];
      } else {
         $Table = $this->EscapeIdentifier($this->Database->DatabasePrefix.$Table);
      }


      $Sql = $this->GetDelete($Table);
      
      return $this->Query($Sql, 'delete');
   }