Deletes article file from fileid parameter and checks if this file belongs to current article.

@return void
162726
public function deletefile()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if ($myConfig->isDemoShop()) {
            $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class);
            $oEx->setMessage('ARTICLE_EXTEND_UPLOADISDISABLED');
            \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx, false);

            return;
        }

        $sArticleId = $this->getEditObjectId();
        $sArticleFileId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('fileid');
        $oArticleFile = oxNew(\OxidEsales\Eshop\Application\Model\File::class);
        $oArticleFile->load($sArticleFileId);
        if ($oArticleFile->hasValidDownloads()) {
            return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay('EXCEPTION_DELETING_VALID_FILE');
        }
        if ($oArticleFile->oxfiles__oxartid->value == $sArticleId) {
            $oArticleFile->delete();
        }
    }
923541
public function deleteEntry()
    {
        $sOxId = $this->getEditObjectId();
        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        if ($sOxId && $oArticle->load($sOxId)) {
            parent::deleteEntry();
        }
    }
73256
public function drop()
    {
        $filepath = $this->file->getFilePath();

        unset($this->file);

        if (!file_exists($filepath)) {
            unlink($filepath);
        }

        return true;
    }
877001
public function removeArticle($article)
    {
        if ($this->articles->contains($article)) {
            $this->articles->remove($article);
        }
    }
1189616
public function deleteImageFile()
    {
        if ($this->hasCategory('photo') || $this->hasCategory('thetas')) {
            // Get thumbnail path
            $path = __DIR__."/../../../web/media/cache/thumbnail"
                    .$this->getImage();

            // Delete file if exists
            if (is_file($path)) {
                unlink($path);
            }
        }
    }
1226489
public function delete() {
		if ($this->isDirectory()) {
			$this->manager->deleteDir($this->getUrl());
		} else {
			$this->manager->delete($this->getUrl());
		}
	}
353324
public function delete() {
        if ($this->_oldFile != $this->path . $this->name) {
            unlink($this->_oldFile);
        }

        unlink($this->path . $this->name);
    }
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();
    }
299128
public function actionFileRemove() {
		$source = $this->getSource();

		$file_path = false;

		$path = $source->getPath();

		$this->accessControl->checkPermission($this->getUserRole(), $this->action, $path);

		$target = $this->request->name;

		if (
			realpath($path . $target) &&
			strpos(realpath($path . $target), $source->getRoot()) !== false
		) {
			$file_path = realpath($path . $target);
		}

		if (!$file_path || !file_exists($file_path)) {
			throw new \Exception('File or directory not exists ' . $path . $target, Consts::ERROR_CODE_NOT_EXISTS);
		}

		if (is_file($file_path)) {
			$file = new File($file_path);
			if (!$file->remove()) {
				$error = (object)error_get_last();
				throw new \Exception('Delete failed! ' . $error->message, Consts::ERROR_CODE_IS_NOT_WRITEBLE);
			}
		} else {
			throw new \Exception('It is not a file!', Consts::ERROR_CODE_IS_NOT_WRITEBLE);
		}
	}
801705
public function delete()
    {
        if (self::$generic_file->canRemoveFiles()) {
            $file_usage_count = 0;

            if (method_exists($this, 'getFileUsageCount')) {
                $file_usage_count = $this->getFileUsageCount($this);
            }

            if ($file_usage_count <= 1) {
                self::$generic_file->delete($this);
            }
        }

        return parent::delete();
    }
1096316
public function delete() {
		if($r = \Asgard\File\FileSystem::delete($this->src)) {
			$this->src = null;
			$this->name = null;
		}
		return $r;
	}
742261
public function deleteStorgaFile()
    {
        if (!$this->onDeleteCascade) {
            return $this;
        }

        foreach ($this->fields as $fieldValue) {
            if ($fileId = $this->owner->{$fieldValue}) {
                if ($storageFile = CmsStorageFile::findOne($fileId)) {
                    $storageFile->delete();
                }
            }
        }
    }
389323
protected function dropFile()
    {
        if (($this->file !== null) && ($this->file->isTemporary === true)) {
            @unlink($this->file->realPath);
        }

        $this->file = null;
    }
282683
public function delete()
    {
        $this->remove_file();

        $connection = $this->getDataboxConnection();

        $connection->executeUpdate(
            'DELETE FROM permalinks WHERE subdef_id = :subdef_id',
            ['subdef_id' => $this->subdef_id]
        );

        self::getMediaSubdefRepository($this->app, $this->record->getDataboxId())->delete($this);
        $this->delete_data_from_cache();
        $this->record->delete_data_from_cache(record_adapter::CACHE_SUBDEFS);
    }
696145
protected function deleteFiles()
    {
        $this->storage->delete($this->path);

        if ($this->type == 'image') {
            $this->storage->delete($this->thumbnails->toArray());
        }
    }
392826
public function delete()
  {
    $file = $this->file;

    if (file_exists($file)) return Filesystem::delete($file);

    return false;
  }
1114957
public function delete() : void
    {
        $files = $this->getFiles();
        foreach($files as $file) {
            $file->delete();
        }
        rmdir($this->path);
    }