Delete a file from the database

@link http://php.net/manual/en/mongogridfs.delete.php
@param mixed $id _id of the file to remove
@return boolean Returns true if the remove was successfully sent to the database.
969491
public function delete($id)
    {
        $this->createChunksIndex();

        $this->chunks->remove(['files_id' => $id], ['justOne' => false]);
        return parent::remove(['_id' => $id]);
    }
1117474
public function remove($id)
    {
        if (false === $this->_cache->delete($id)) {
            return $this->_onError('remove');
        }

        return true;
    }
1013343
public function remove($id)
    {
        $file = $this->_file($id);
        $boolRemove   = $this->_remove($file);
        $boolMetadata = $this->_delMetadatas($id);
        return $boolMetadata && $boolRemove;
    }
189448
public function delete($id, $type) {
		$params = array(
			'id' => $id,
			'type' => $type
		);
		return $this->master->call('files/delete', $params);
	}
63752
public function delete($id)
    {
        $files = glob($this->getFilename($id));

        if (count($files)) {
            array_map('unlink', $files);
        }
    }
1310290
public function delete($id)
    {
        $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

        if (method_exists($this, 'beforeDelete')) {
            $this->beforeDelete();
        }

        if ($this->qb->table($this->table)->limit(1)->delete([$primaryKey => $id])) {
            if (method_exists($this, 'afterDelete')) {
                return $this->afterDelete();
            }

            return true;
        }

        return false;
    }
904837
public function delete($id)
    {
        $model = $this->findRecord($id);

        if ($model) {
            return $model->delete();
        }

        return false;

    }
500841
public function destroy($id)
    {
        $return = false;

        $record = \Doctrine::getTable($this->_tableName)->find($id);
        if (false !== $record) {
            if ($record->delete()) {
                $return = true;
            }
        }

        return $return;
    }
944106
public function deleteCustomerById($id): bool
    {
        $record = CustomerRecord::findOne($id);

        if ($record) {
            return (bool)$record->delete();
        }

        return false;
    }
33499
public function remove(string $id){
    if ( \bbn\str::is_uid($id) ){
      if ( $id_menu = $this->get_id_menu($id) ){
        if ( $this->pref->delete_bit($id) ){
          $this->delete_cache($id_menu);
          return true;
        }
      }
      else if ( $this->pref->delete($id) ){
        $this->options->delete_cache($this->from_path('menus'));
        return true;
      }
    }
    return false;
  }
274437
public function destroy($id)
	{
		try
		{
			$query = $this->db->getQuery(true);
			$query->delete($this->db->quoteName('#__session'))
				->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id));

			// Remove a session from the database.
			$this->db->setQuery($query);

			return (boolean) $this->db->execute();
		}
		catch (\Exception $e)
		{
			return false;
		}
	}
1304160
public static function delete($id)
    {
        $db = new DatabaseManager();
        $connection = $db->getDbh();

        $statement = $connection->prepare('DELETE from ' . static::getTableName()  . ' WHERE id=:id');
        $statement->bindParam(':id', $id, \PDO::PARAM_INT);
        $queryWasSuccessful = $statement->execute();
        return $queryWasSuccessful;
    }
774694
public function delete( $id ) {

		if ( $this->contains( $id ) ) {
			$this->count--;
			$this->cacheDeletes++;
			unset( $this->cache[ $id ] );
			unset( $this->ttl[ $id ] );
			return true;
		}

		return false;
	}
698877
public function remove($id)
    {
        if ($this->locked) {
            return false;
        }

        if (strpos($id, '.') !== false) {
            $k = '$this->data' . "['" . str_replace('.', "']['", $id) . "']";
            eval('$has = isset(' . $k . ');');
            if ($has) {
                eval('unset(' . $k . ');');
                return true;
            } else {
                return false;
            }
        } elseif ($this->has($id)) {
            unset($this->data[$id]);
            return true;
        } else {
            return false;
        }
    }
1125235
public function delete($file_id){
        $filename=$this->config['base_path'].DIRECTORY_SEPARATOR.$file_id;
        unlink(ROOT_PATH.$filename);
        $p=explode(DIRECTORY_SEPARATOR,$file_id);
        $name=array_pop($p);
        $name_ext=explode(".",$name);
        $save_name=ROOT_PATH.$this->config['base_path'].DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR,$p).DIRECTORY_SEPARATOR
            .$name_ext[0].DIRECTORY_SEPARATOR;
        $files = (array) glob($save_name . '*');
        var_dump($save_name);
        foreach ($files as $path) {
            if (is_dir($path)) {
                array_map('unlink', glob($path . '/*.php'));
            } else {
                unlink($path);
            }
        }
        rmdir($save_name);
    }
959396
public function delete($id)
    {
        $doctrineMessage = $this->repository->findById($id);
        $doctrineMessage->setDelivered(true);
        $this->em->flush();

        return true;
    }
318389
public function destroy($id)
    {
        // Note: Do NOT delete session data in $_SESSION variable or
        // session cookie here as this method is also called via
        // session_regenerate_id(true)

        // Delete session file on disk
        $file = $this->getPathForSessionId($id);
        if (file_exists($file)) {
            unlink($file);
        }

        return true;
    }