Class humhub\modules\file\models\FileContent

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

FileContent model is used to set a file by string

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$newFileContent string File content humhub\modules\file\models\FileContent

Public Methods

Hide inherited methods

MethodDescriptionDefined By
afterSave() humhub\modules\file\models\FileContent
attachPrecreated() Attaches a given list of files to an record (HActiveRecord). humhub\modules\file\models\FileCompat
beforeDelete() humhub\modules\file\models\File
beforeSave() humhub\components\ActiveRecord
beforeValidate() humhub\modules\file\models\FileContent
behaviors() humhub\modules\file\models\File
canDelete() Checks if given file can deleted. humhub\modules\file\models\File
canRead() Checks if given file can read. humhub\modules\file\models\File
findByRecord() Returns all attached Files of the given $record. humhub\modules\file\models\File
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
getStore() Returns the StorageManager humhub\modules\file\models\File
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
getUrl() Returns the url to this file humhub\modules\file\models\File
isAssigned() Checks if this file record is already attached to record. humhub\modules\file\models\File
isAssignedTo() Checks if this file is attached to the given record humhub\modules\file\models\File
rules() humhub\modules\file\models\FileContent
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
tableName() humhub\modules\file\models\File
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
setFileSize() Sets the file size by newFileContent humhub\modules\file\models\FileContent

Property Details

$newFileContent public property

File content

public string $newFileContent null

Method Details

afterSave() public method

public void afterSave ( $insert, $changedAttributes )
$insert
$changedAttributes
beforeValidate() public method

public void beforeValidate ( )
rules() public method

public void rules ( )
setFileSize() protected method

Sets the file size by newFileContent

protected void setFileSize ( )