Property | Type | Description | |
---|---|---|---|
$_source_path | used in model creation | ||
$_stored_path | used in model delete | ||
$_thumbnail |
Method | Description | |
---|---|---|
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 |
Method | Description | |
---|---|---|
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. |
public afterDelete ( ) |
public beforeDelete ( ) : boolean | ||
return | boolean | (non-PHPdoc) |
public static createForWriting ( string $name ) : ProtectedFile | ||
$name | string | |
return | ProtectedFile |
public static createFromFile ( string $path ) : ProtectedFile | ||
$path | string | Path to file |
return | ProtectedFile |
protected generateThumbnail ( string $dimensions ) : boolean | ||
$dimensions | string | |
return | boolean |
public generateUID ( ) |
public static getBasePath ( ) : string | ||
return | string |
public getDownloadURL ( ) : string | ||
return | string |
public getFilePath ( ) : string | ||
return | string |
public getThumbnail ( string $dimensions, $regenerate = false ) : boolean | array: | ||
$dimensions | string | |
return | boolean | array: |
protected getThumbnailPath ( string $dimensions ) : string | ||
$dimensions | string | |
return | string |
public hasThumbnail ( ) : boolean | ||
return | boolean |
protected lookupMimetype ( string $path ) : string | ||
$path | string | |
return | string |
public static model ( $className = __CLASS__ ) : ProtectedFile | ||
return | ProtectedFile | the static model class |