Abstract Class humhub\modules\file\converter\BaseConverter

Inheritancehumhub\modules\file\converter\BaseConverter » yii\base\BaseObject
Subclasseshumhub\modules\file\converter\PreviewImage, humhub\modules\file\converter\TextConverter
Available since version1.2

BaseConverter

Public Methods

Hide inherited methods

MethodDescriptionDefined By
applyFile() Sets file for the converter humhub\modules\file\converter\BaseConverter
getFilename() Returns the filename of the converted file. humhub\modules\file\converter\BaseConverter
getUrl() Returns the url to the converted file humhub\modules\file\converter\BaseConverter
init() humhub\modules\file\converter\BaseConverter

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
canConvert() Returns if the given file can be converted humhub\modules\file\converter\BaseConverter
convert() Convert file humhub\modules\file\converter\BaseConverter

Property Details

$file public property

The file record

$options public property
public array $options = []

Method Details

applyFile() public method

Sets file for the converter

public boolean applyFile ( humhub\modules\file\models\File $file )
$file humhub\modules\file\models\File
return boolean

Returns false if file cannot be converted

canConvert() protected abstract method

Returns if the given file can be converted

protected abstract void canConvert ( humhub\modules\file\models\File $file )
$file
convert() protected abstract method

Convert file

protected abstract void convert ( $fileName )
$fileName
getFilename() public method

Returns the filename of the converted file.

The filename is a hash of used options and converter class.

public string getFilename ( )
return string

The filename of converted file

getUrl() public method

Returns the url to the converted file

public string getUrl ( )
init() public method

public void init ( )