Deletes file and all thumbnails by name
@param null $name
@return bool
14125
public function deleteFile($name = null)
    {
        foreach ($this->getAllFields() as $field) {
            $path = $this->getFilePath($field, $name);
            if (!$path || !is_file($path) || !file_exists($path)) {
                continue;
            }
            unlink($path);
        }
        if ($name == $this->owner->getAttribute($this->fileField)
           && ($files = $this->getFileList())     
        ) {
            $this->owner->updateAttributes([$this->fileField => reset($files)]);
        }
        return true;
    }
139181
public function delete($name)
    {
        if ($this->cookies[$name]) {
            unset($this->cookies[$name]);

            return true;
        }

        return false;
    }
752025
public function destroySingleton($name = null)
    {
        if (is_null($name)) {
            $this->singletons = [];
        }

        if (isset($this->singletons[$name])) {
            unset($this->singletons[$name]);
        }

        $this->makeLog('Destroy singleton: ' . (is_null($name) ? 'all' : $name));

        return $this;
    }
603849
public function exists(?string $name = null): bool
    {
        if ($name != null) {
            $fileInfo = new MFileInfo($name);
            return $fileInfo->exists();
        }

        return $this->fileInfo->exists();
    }
967877
public function remove($name)
    {
        $this->instance->unlock();
        $result = $this->instance->remove($name);
        $this->instance->lock();
        return $result;
    }
1087561
public function removeData($name=null)
    {
        $remove_names = \is_array($name) ? $name : explode(' ', $name);
        $doc_hash = spl_object_hash($this->document);

        if (!isset(self::$node_data[$doc_hash])) {
            return;
        }

        foreach ($this->getElements() as $node) {
            if (!$node->hasAttribute('dqn_tmp_id')) {
                continue;
            }

            $node_id = self::getElementId($node);

            if (isset(self::$node_data[$doc_hash][$node_id])) {
                if ($name === null) {
                    self::$node_data[$doc_hash][$node_id] = null;
                } else {
                    foreach ($remove_names as $remove_name) {
                        if (isset(self::$node_data[$doc_hash][$node_id]->$remove_name)) {
                            self::$node_data[$doc_hash][$node_id]->$remove_name = null;
                        }
                    }
                }
            }
        }
    }
905494
public function remove($name = null)
    {
        $plugins = $this->_list($name);

        foreach ($plugins as $plugin => $config) {
            $this->out();
            $this->out('For plugin: ' . $plugin);
            $this->hr();

            $this->_remove($config);
        }

        $this->out();
        $this->out('Done');
    }
178173
final public function delete($name) {

        if ( array_key_exists($name, $this->rpc_methods) ) {

            unset($this->rpc_methods[$name]);

            $this->logger->debug("Deleted method $name");

            return true;

        } else {

            $this->logger->warning("Cannot delete method $name: entry not found");

            return false;

        }

    }
532969
public function rm($name) {
        $name  = $this->options['prefix'].sqlite_escape_string($name);
        $sql  = 'DELETE FROM '.$this->options['table'].' WHERE var=\''.$name.'\'';
        sqlite_query($this->handler, $sql);
        return true;
    }
696334
public function prune($name) {

        if ($this->name == $name) {
            return false;  //can not remove itself
        }

        foreach($this->children as $precedence => $child) {
            if ($child->name == $name) {
                // clear cache and delete self
                while($this->category_cache) {
                    // delete the cache, but keep the original array address
                    array_pop($this->category_cache);
                }
                unset($this->children[$precedence]);
                return true;
            } else if ($this->children[$precedence]->prune($name)) {
                return true;
            }
        }
        return false;
    }
40173
public function hasFiles($name = null)
    {
        if (!empty($this->files)) {
            // if $name is null, then a global checking must be done
            return $this->getFilesbag()->hasFiles($name);
        }

        // By default
        return false;
    }
820292
public function remove($name)
    {
        if(array_key_exists($name, $this->data))
        {
            unset($this->data[$name]);
            return true;
        }
        else
        {
            return false;
        }
    }
1116147
public static function delCache($name)
    {
        if (is_callable(self::$cache_callable['del'])) {
            return call_user_func_array(self::$cache_callable['del'], func_get_args());
        }
        $file = self::_getCacheName($name);
        return file_exists($file) ? unlink($file) : true;
    }
676592
public function delete($name)
	{
		$templates = $this->getTemplates();
		$templates->delete($name, $this->plugin->name);
	}
297880
public function delete($name){

		try{

			$file = $this->_getFileName($name);
		}
		catch(CacheException $e){

			return false;
		}

		return @unlink($this->_cache_path . $file);
	}
688517
public function uninstall($name)
    {
        $name = Container::get('hooks')->fire('model.plugin.uninstall.name', $name);
        $activePlugins = $this->manager->getActivePlugins();

        // Check if plugin is disabled, for security
        if (!in_array($name, $activePlugins)) {
            $plugin = DB::forTable('plugins')->where('name', $name)->find_one();

            if ($plugin) {
                $plugin->delete();
            }

            // Allow additional uninstalling functions
            $this->manager->uninstall($name);

            if (file_exists(ForumEnv::get('FORUM_ROOT').'plugins'.DIRECTORY_SEPARATOR.$name)) {
                AdminUtils::deleteFolder(ForumEnv::get('FORUM_ROOT').'plugins'.DIRECTORY_SEPARATOR.$name);
            }

            $this->manager->setActivePlugins();
        }
        return true;
    }
458310
public function deleteCookie($name = null)
    {
        if (isset($name)) {

            if (isset($this->request['cookie'][$name])) {
                unset($this->request['cookie'][$name]);
                return setcookie($name, '', GC_TIME - 3600, '/');
            }

            return false;
        }

        foreach (array_keys($this->request['cookie']) as $key) {
            $this->deleteCookie($key);
        }

        return true;
    }