PHP Класс ProtectedFile

The followings are the available columns in table 'protected_file':
Наследование: extends BaseActiveRecordVersioned
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_source_path used in model creation
$_stored_path used in model delete
$_thumbnail

Открытые методы

Метод Описание
afterDelete ( ) ensures file is removed from filesystem when deleting.
beforeDelete ( ) : boolean ensure we keep track of path to file before deleting from database.
beforeSave ( ) (non-PHPdoc).
beforeValidate ( ) ensures that mimetype and size are set based on the file that's been stored (unless the file is being copied from elsewhere, in which case this should have been taken care of).
createForWriting ( string $name ) : ProtectedFile create a new protected file object which has properties that can be used for writing an actual file to.
createFromFile ( string $path ) : ProtectedFile Create a new protected file from an existing file.
generateUID ( ) generate the UID for the file from the file name.
getBasePath ( ) : string Path to protected file storage.
getDownloadURL ( ) : string get URL for downloading this file.
getFilePath ( ) : string Path to file without filename.
getPath ( ) : string Path to file.
getThumbnail ( string $dimensions, $regenerate = false ) : boolean | array: Get thumbnail of image (generated automatically if not already created).
hasThumbnail ( ) : boolean Has the file got a thumbnail.
model ( $className = __CLASS__ ) : ProtectedFile Returns the static model of the specified AR class.
relations ( ) : array
rules ( ) : array
setSource ( string $path ) Initialise protected file from a source file.
tableName ( ) : string

Защищенные методы

Метод Описание
generateThumbnail ( string $dimensions ) : boolean Generate a thumbnail.
getThumbnailPath ( string $dimensions ) : string Get the path for a thumbnail.
lookupMimetype ( string $path ) : string Get the mime type of the file.

Описание методов

afterDelete() публичный Метод

ensures file is removed from filesystem when deleting.
public afterDelete ( )

beforeDelete() публичный Метод

ensure we keep track of path to file before deleting from database.
См. также: BaseActiveRecord::beforeDelete()
public beforeDelete ( ) : boolean
Результат boolean (non-PHPdoc)

beforeSave() публичный Метод

(non-PHPdoc).
См. также: BaseActiveRecord::beforeSave()
public beforeSave ( )

beforeValidate() публичный Метод

(non-PHPdoc)
См. также: BaseActiveRecord::beforeSave()
public beforeValidate ( )

createForWriting() публичный статический Метод

create a new protected file object which has properties that can be used for writing an actual file to.
public static createForWriting ( string $name ) : ProtectedFile
$name string
Результат ProtectedFile

createFromFile() публичный статический Метод

Create a new protected file from an existing file.
public static createFromFile ( string $path ) : ProtectedFile
$path string Path to file
Результат ProtectedFile

generateThumbnail() защищенный Метод

Generate a thumbnail.
protected generateThumbnail ( string $dimensions ) : boolean
$dimensions string
Результат boolean

generateUID() публичный Метод

generate the UID for the file from the file name.
public generateUID ( )

getBasePath() публичный статический Метод

Path to protected file storage.
public static getBasePath ( ) : string
Результат string

getDownloadURL() публичный Метод

get URL for downloading this file.
См. также: ProtectedFileController::actionDownload
public getDownloadURL ( ) : string
Результат string

getFilePath() публичный Метод

Path to file without filename.
public getFilePath ( ) : string
Результат string

getPath() публичный Метод

Path to file.
public getPath ( ) : string
Результат string

getThumbnail() публичный Метод

Get thumbnail of image (generated automatically if not already created).
public getThumbnail ( string $dimensions, $regenerate = false ) : boolean | array:
$dimensions string
Результат boolean | array:

getThumbnailPath() защищенный Метод

Get the path for a thumbnail.
protected getThumbnailPath ( string $dimensions ) : string
$dimensions string
Результат string

hasThumbnail() публичный Метод

Has the file got a thumbnail.
public hasThumbnail ( ) : boolean
Результат boolean

lookupMimetype() защищенный Метод

Get the mime type of the file.
protected lookupMimetype ( string $path ) : string
$path string
Результат string

model() публичный статический Метод

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : ProtectedFile
Результат ProtectedFile the static model class

relations() публичный Метод

public relations ( ) : array
Результат array relational rules.

rules() публичный Метод

public rules ( ) : array
Результат array validation rules for model attributes.

setSource() публичный Метод

Initialise protected file from a source file.
public setSource ( string $path )
$path string

tableName() публичный Метод

public tableName ( ) : string
Результат string the associated database table name

Описание свойств

$_source_path защищенное свойство

used in model creation
protected $_source_path

$_stored_path защищенное свойство

used in model delete
protected $_stored_path

$_thumbnail защищенное свойство

protected $_thumbnail