Class yeesoft\media\models\Media

Inheritanceyeesoft\media\models\Media » yeesoft\db\ActiveRecord » yii\db\ActiveRecord
Implementsyeesoft\models\OwnerAccess
Subclassesyeesoft\media\models\MediaSearch

This is the model class for table "media".

Public Methods

Hide inherited methods

MethodDescriptionDefined By
attributeLabels() yeesoft\media\models\Media
behaviors() yeesoft\media\models\Media
createDefaultThumb() Create default thumbnail yeesoft\media\models\Media
createThumbs() Create thumbs for this image yeesoft\media\models\Media
deleteFile() Delete file yeesoft\media\models\Media
deleteThumbs() Delete thumbnails for current image yeesoft\media\models\Media
find() yeesoft\media\models\Media
findAll() yeesoft\media\models\Media
findByTypes() Search models by file types yeesoft\media\models\Media
findByUrl() Find model by url yeesoft\media\models\Media
findOne() yeesoft\media\models\Media
getAuthor() Return created_by user instance yeesoft\media\models\Media
getCreatedDate() yeesoft\media\models\Media
getCreatedDatetime() yeesoft\media\models\Media
getCreatedTime() yeesoft\media\models\Media
getDefaultThumbUrl() yeesoft\media\models\Media
getFileSize() yeesoft\media\models\Media
getFullAccessPermission() Get permission to check whether the access is denied to users who are not authors of item. yeesoft\media\models\Media
getImagesList() yeesoft\media\models\Media
getLastChanges() yeesoft\media\models\Media
getOriginalImageSize() This method wrap getimagesize() function yeesoft\media\models\Media
getOriginalImageSizes() This method wrap getimagesize() function yeesoft\media\models\Media
getOwnerField() Returns name of field in the model indicating the author's id. Is used only when $ownerAccessPermission is set yeesoft\media\models\Media
getThumbImage() Thumbnail image html tag yeesoft\media\models\Media
getThumbUrl() yeesoft\media\models\Media
getThumbs() yeesoft\media\models\Media
isImage() yeesoft\media\models\Media
isMultilingual() Returns TRUE if model support multilingual behavior. yeesoft\db\ActiveRecord
rules() yeesoft\media\models\Media
saveUploadedFile() Save just uploaded file yeesoft\media\models\Media
tableName() yeesoft\media\models\Media

Property Details

$file public property
public $file null
$imageFileTypes public static property
public static $imageFileTypes = ['image/gif''image/jpeg''image/png']

Method Details

attributeLabels() public method

public void attributeLabels ( )
behaviors() public method

public void behaviors ( )
createDefaultThumb() public method

Create default thumbnail

public void createDefaultThumb ( array $routes )
$routes array

See routes in module config

createThumbs() public method

Create thumbs for this image

public bool createThumbs ( array $routes, array $presets )
$routes array

See routes in module config

$presets array

Thumbs presets. See in module config

deleteFile() public method

Delete file

public bool deleteFile ( array $routes )
$routes array

See routes in module config

deleteThumbs() public method

Delete thumbnails for current image

public void deleteThumbs ( array $routes )
$routes array

See routes in module config

find() public static method

public static void find ( )
findAll() public static method

public static static findAll ( $condition )
$condition
return static

An array of ActiveRecord instances, or an empty array if nothing matches.

findByTypes() public static method

Search models by file types

public static array|yeesoft\db\ActiveRecord[] findByTypes ( array $types )
$types array

File types

findByUrl() public static method

Find model by url

public static static findByUrl ( $url )
$url
findOne() public static method

public static static|null findOne ( $condition )
$condition
return static|null

ActiveRecord instance matching the condition, or null if nothing matches.

getAuthor() public method

Return created_by user instance

public \yii\db\ActiveQuery getAuthor ( )
getCreatedDate() public method

public void getCreatedDate ( )
getCreatedDatetime() public method

public void getCreatedDatetime ( )
getCreatedTime() public method

public void getCreatedTime ( )
getDefaultThumbUrl() public method

public string getDefaultThumbUrl ( $baseUrl '' )
$baseUrl
return string

Default thumbnail for image

getFileSize() public method

public string getFileSize ( )
return string

File size

getFullAccessPermission() public static method

Get permission to check whether the access is denied to users who are not authors of item.

public static void getFullAccessPermission ( )
getImagesList() public method

public array getImagesList ( yeesoft\media\MediaModule $module )
$module yeesoft\media\MediaModule
return array

Images list

getLastChanges() public method

public int getLastChanges ( )
return int

Last changes timestamp

getOriginalImageSize() public method

This method wrap getimagesize() function

public string getOriginalImageSize ( array $routes, $delimiter ' × ' )
$routes array

See routes in module config

$delimiter string

Delimiter between width and height

return string

Image size like '1366x768'

getOriginalImageSizes() public method

This method wrap getimagesize() function

public array getOriginalImageSizes ( array $routes )
$routes array

See routes in module config

getOwnerField() public static method

Returns name of field in the model indicating the author's id. Is used only when $ownerAccessPermission is set

public static void getOwnerField ( )
getThumbImage() public method

Thumbnail image html tag

public string getThumbImage ( $alias, $options = [] )
$alias string

Thumbnail alias

$options array

Html options

return string

Html image tag

getThumbUrl() public method

public string getThumbUrl ( $alias )
$alias string

Thumb alias

return string

Thumb url

getThumbs() public method

public array getThumbs ( )
return array

Thumbnails

isImage() public method

public bool isImage ( )
return bool

If type of this media file is image, return true;

rules() public method

public void rules ( )
saveUploadedFile() public method

Save just uploaded file

public bool saveUploadedFile ( array $routes, $rename false, $allowedFileTypes null )
$routes array

Routes from module settings

$rename
$allowedFileTypes
tableName() public static method

public static void tableName ( )