Class humhub\modules\file\models\FileUpload

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

FileUpload model is used for File uploads handled by the UploadAction via ajax.

See also humhub\modules\file\actions\UploadAction.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$uploadedFile \yii\web\UploadedFile The uploaded file humhub\modules\file\models\FileUpload

Public Methods

Hide inherited methods

MethodDescriptionDefined By
afterSave() humhub\modules\file\models\FileUpload
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
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\FileUpload
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
setUploadedFile() Sets uploaded file to this file model humhub\modules\file\models\FileUpload
tableName() humhub\modules\file\models\File
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord

Property Details

$uploadedFile public property

The uploaded file

public \yii\web\UploadedFile $uploadedFile null

Method Details

afterSave() public method

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

public void rules ( )
setUploadedFile() public method

Sets uploaded file to this file model

public void setUploadedFile ( \yii\web\UploadedFile $uploadedFile )
$uploadedFile \yii\web\UploadedFile