Pimcore\Model\Version::delete PHP Method

delete() public method

public delete ( ) : void
return void
    public function delete()
    {
        \Pimcore::getEventManager()->trigger("version.preDelete", $this);
        foreach ([$this->getFilePath(), $this->getLegacyFilePath()] as $path) {
            if (is_file($path)) {
                @unlink($path);
            }
            $compressed = $path . ".gz";
            if (is_file($compressed)) {
                @unlink($compressed);
            }
        }
        if (is_file($this->getBinaryFilePath())) {
            @unlink($this->getBinaryFilePath());
        }
        $this->getDao()->delete();
        \Pimcore::getEventManager()->trigger("version.postDelete", $this);
    }