PHP 클래스 pendalf89\filemanager\models\Mediafile

상속: extends yii\db\ActiveRecord
파일 보기 프로젝트 열기: pendalf89/yii2-filemanager 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$file
$imageFileTypes

보호된 프로퍼티들

프로퍼티 타입 설명
$tagIds array | null

공개 메소드들

메소드 설명
addOwner ( integer $owner_id, string $owner, string $owner_attribute ) : boolean Add owner to mediafiles table
afterDelete ( )
afterSave ( $insert, $changedAttributes )
attributeLabels ( )
beforeDelete ( )
behaviors ( )
createDefaultThumb ( array $routes ) Create default thumbnail
createThumbs ( array $routes, array $presets ) : boolean Create thumbs for this image
deleteFile ( array $routes ) : boolean Delete file
deleteThumbs ( array $routes ) Delete thumbnails for current image
findByTypes ( array $types ) : array | ActiveRecord[] Search models by file types
findByUrl ( $url ) : static Find model by url
getDefaultThumbUrl ( $baseUrl = '' ) : string
getDefaultUploadThumbUrl ( $baseUrl = '' ) : string
getFileSize ( ) : string
getImagesList ( Module $module ) : array
getLastChanges ( ) : integer
getOriginalImageSize ( array $routes, string $delimiter = ' × ' ) : string This method wrap getimagesize() function
getOriginalImageSizes ( array $routes ) : array This method wrap getimagesize() function
getOwners ( ) : ActiveQuery
getTagIds ( ) : array | null
getTags ( ) : ActiveQuery
getThumbImage ( string $alias, array $options = [] ) : string Thumbnail image html tag
getThumbUrl ( string $alias ) : string
getThumbs ( ) : array
init ( )
isImage ( ) : boolean
loadOneByOwner ( $owner, $owner_id, $owner_attribute )
removeOwner ( integer $owner_id, string $owner, string $owner_attribute ) : boolean Remove this mediafile owner
rules ( )
saveUploadedFile ( array $routes, boolean $rename = false ) : boolean Save just uploaded file
setTagIds ( $value )
tableName ( )

보호된 메소드들

메소드 설명
getThumbFilename ( $original, $extension, $alias, $width, $height ) : string Returns thumbnail name

메소드 상세

addOwner() 공개 메소드

Add owner to mediafiles table
public addOwner ( integer $owner_id, string $owner, string $owner_attribute ) : boolean
$owner_id integer owner id
$owner string owner identification name
$owner_attribute string owner identification attribute
리턴 boolean save result

afterDelete() 공개 메소드

public afterDelete ( )

afterSave() 공개 메소드

public afterSave ( $insert, $changedAttributes )

attributeLabels() 공개 메소드

public attributeLabels ( )

beforeDelete() 공개 메소드

public beforeDelete ( )

behaviors() 공개 메소드

public behaviors ( )

createDefaultThumb() 공개 메소드

Create default thumbnail
public createDefaultThumb ( array $routes )
$routes array see routes in module config

createThumbs() 공개 메소드

Create thumbs for this image
public createThumbs ( array $routes, array $presets ) : boolean
$routes array see routes in module config
$presets array thumbs presets. See in module config
리턴 boolean

deleteFile() 공개 메소드

Delete file
public deleteFile ( array $routes ) : boolean
$routes array see routes in module config
리턴 boolean

deleteThumbs() 공개 메소드

Delete thumbnails for current image
public deleteThumbs ( array $routes )
$routes array see routes in module config

findByTypes() 공개 정적인 메소드

Search models by file types
public static findByTypes ( array $types ) : array | ActiveRecord[]
$types array file types
리턴 array | yii\db\ActiveRecord[]

findByUrl() 공개 정적인 메소드

Find model by url
public static findByUrl ( $url ) : static
$url
리턴 static

getDefaultThumbUrl() 공개 메소드

public getDefaultThumbUrl ( $baseUrl = '' ) : string
$baseUrl
리턴 string default thumbnail for image

getDefaultUploadThumbUrl() 공개 메소드

public getDefaultUploadThumbUrl ( $baseUrl = '' ) : string
$baseUrl
리턴 string default thumbnail for image

getFileSize() 공개 메소드

public getFileSize ( ) : string
리턴 string file size

getImagesList() 공개 메소드

public getImagesList ( Module $module ) : array
$module pendalf89\filemanager\Module
리턴 array images list

getLastChanges() 공개 메소드

public getLastChanges ( ) : integer
리턴 integer last changes timestamp

getOriginalImageSize() 공개 메소드

This method wrap getimagesize() function
public getOriginalImageSize ( array $routes, string $delimiter = ' × ' ) : string
$routes array see routes in module config
$delimiter string delimiter between width and height
리턴 string image size like '1366x768'

getOriginalImageSizes() 공개 메소드

This method wrap getimagesize() function
public getOriginalImageSizes ( array $routes ) : array
$routes array see routes in module config
리턴 array

getOwners() 공개 메소드

public getOwners ( ) : ActiveQuery
리턴 yii\db\ActiveQuery

getTagIds() 공개 메소드

public getTagIds ( ) : array | null
리턴 array | null

getTags() 공개 메소드

public getTags ( ) : ActiveQuery
리턴 yii\db\ActiveQuery

getThumbFilename() 보호된 메소드

Returns thumbnail name
protected getThumbFilename ( $original, $extension, $alias, $width, $height ) : string
$original
$extension
$alias
$width
$height
리턴 string

getThumbImage() 공개 메소드

Thumbnail image html tag
public getThumbImage ( string $alias, array $options = [] ) : string
$alias string thumbnail alias
$options array html options
리턴 string Html image tag

getThumbUrl() 공개 메소드

public getThumbUrl ( string $alias ) : string
$alias string thumb alias
리턴 string thumb url

getThumbs() 공개 메소드

public getThumbs ( ) : array
리턴 array thumbnails

init() 공개 메소드

public init ( )

isImage() 공개 메소드

public isImage ( ) : boolean
리턴 boolean if type of this media file is image, return true;

loadOneByOwner() 공개 정적인 메소드

public static loadOneByOwner ( $owner, $owner_id, $owner_attribute )

removeOwner() 공개 정적인 메소드

Remove this mediafile owner
public static removeOwner ( integer $owner_id, string $owner, string $owner_attribute ) : boolean
$owner_id integer owner id
$owner string owner identification name
$owner_attribute string owner identification attribute
리턴 boolean delete result

rules() 공개 메소드

public rules ( )

saveUploadedFile() 공개 메소드

Save just uploaded file
public saveUploadedFile ( array $routes, boolean $rename = false ) : boolean
$routes array routes from module settings
$rename boolean
리턴 boolean

setTagIds() 공개 메소드

public setTagIds ( $value )
$value

tableName() 공개 정적인 메소드

public static tableName ( )

프로퍼티 상세

$file 공개적으로 프로퍼티

public $file

$imageFileTypes 공개적으로 정적으로 프로퍼티

public static $imageFileTypes

$tagIds 보호되어 있는 프로퍼티

protected array|null $tagIds
리턴 array | null