PHP 클래스 ProtectedFile

The followings are the available columns in table 'protected_file':
상속: extends BaseActiveRecordVersioned
파일 보기 프로젝트 열기: openeyes/openeyes 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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