Class humhub\modules\file\models\FileCompat

Inheritancehumhub\modules\file\models\FileCompat » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable
Subclasseshumhub\modules\file\models\File, humhub\modules\file\models\FileContent, humhub\modules\file\models\FileUpload
Available since version1.2

FileCompat provides an compatibility layer for older HumHub Version (1.1 and prior).

Public Methods

Hide inherited methods

MethodDescriptionDefined By
attachPrecreated() Attaches a given list of files to an record (HActiveRecord). humhub\modules\file\models\FileCompat
beforeSave() humhub\components\ActiveRecord
getCreatedBy() Relation to User defined in created_by attribute humhub\components\ActiveRecord
getErrorMessage() Returns the errors as string for all attribute or a single attribute. humhub\components\ActiveRecord
getExtension() Returns the extension of the file_name humhub\modules\file\models\FileCompat
getFileManager() Returns the file manager for this record humhub\components\ActiveRecord
getFilename() Returns the filename humhub\modules\file\models\FileCompat
getFilesOfObject() Returns all files belongs to a given HActiveRecord Object. humhub\modules\file\models\FileCompat
getInfoArray() Returns an array with informations about the file humhub\modules\file\models\FileCompat
getMimeBaseType() humhub\modules\file\models\FileCompat
getMimeSubType() humhub\modules\file\models\FileCompat
getPreviewImageUrl() Return the preview image url of the file humhub\modules\file\models\FileCompat
getStoredFilePath() Returns the path of stored file humhub\modules\file\models\FileCompat
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord

Method Details

attachPrecreated() public static method
Deprecated since version 1.2

Attaches a given list of files to an record (HActiveRecord).

This is used when uploading files before the record is created yet.

public static void attachPrecreated ( $object, $files )
$object \yii\db\ActiveRecord

Is a HActiveRecord

$files string

Is a comma seperated list of newly uploaded file guids

throws Exception
getExtension() public method
Deprecated since version 1.2

Returns the extension of the file_name

public string getExtension ( )
return string

The extension

getFilename() public method
Deprecated since version 1.2

Returns the filename

public string getFilename ( $suffix "" )
$suffix string
getFilesOfObject() public static method
Deprecated since version 1.2

Returns all files belongs to a given HActiveRecord Object.

public static array getFilesOfObject ( humhub\components\ActiveRecord $object )
$object humhub\components\ActiveRecord
return array

Of File instances

getInfoArray() public method
Deprecated since version 1.2

Returns an array with informations about the file

public \humhub\modules\file\models\type getInfoArray ( )
getMimeBaseType() public method
Deprecated since version 1.2

public string getMimeBaseType ( )
getMimeSubType() public method
Deprecated since version 1.2

public string getMimeSubType ( )
getPreviewImageUrl() public method
Deprecated since version 1.2

Return the preview image url of the file

public string getPreviewImageUrl ( $maxWidth 1000, $maxHeight 1000 )
$maxWidth integer
$maxHeight integer
getStoredFilePath() public method
Deprecated since version 1.2

Returns the path of stored file

public string getStoredFilePath ( $suffix '' )
$suffix string
return string

Path to file