erLhcoreClassModelUser::removeFile PHP Method

removeFile() public method

public removeFile ( )
    public function removeFile()
    {
        if ($this->filename != '') {
            if (file_exists($this->filepath . $this->filename)) {
                unlink($this->filepath . $this->filename);
            }
            if ($this->filepath != '') {
                erLhcoreClassFileUpload::removeRecursiveIfEmpty('var/userphoto/', str_replace('var/userphoto/', '', $this->filepath));
            }
            erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.remove_photo', array('user' => &$this));
            $this->filepath = '';
            $this->filename = '';
            $this->saveThis();
        }
    }