PHP Class OphCoTherapyapplication_FileCollection

A File Collection points to one or more PDF that can be attached to a therapy application
Inheritance: extends BaseActiveRecordVersioned
Datei anzeigen Open project: openeyes/openeyes Class Usage Examples

Public Methods

Method Description
behaviors ( )
checkMimeType ( string $file ) : boolean function to check if a file is the right type to become part of a collection.
defaultScope ( ) set the ordering based on the name of the collections.
getDownloadURL ( ) : string return the download url for the compressed file of this collection.
getZipFile ( ) : ProtectedFile get a compressed zip file containing all the files in the collection.
model ( $className = __CLASS__ ) : the Returns the static model of the specified AR class.
relations ( ) : array
removeFileById ( $file_id ) : boolean removes a protected file associated with the collection.
rules ( ) : array
tableName ( ) : string
updateFiles ( int[] $file_ids ) update the files for this collection.

Protected Methods

Method Description
cleanCompressedFile ( ) removes the compressed file association for this collection. Should be called when the files for it are changed so that a new compressed file is created when needed.

Method Details

behaviors() public method

public behaviors ( )

checkMimeType() public static method

function to check if a file is the right type to become part of a collection.
public static checkMimeType ( string $file ) : boolean
$file string
return boolean

cleanCompressedFile() protected method

will also call the delete function on the protected file itself to remove orphaned files
protected cleanCompressedFile ( )

defaultScope() public method

(non-PHPdoc)
See also: CActiveRecord::defaultScope()
public defaultScope ( )

getDownloadURL() public method

return the download url for the compressed file of this collection.
public getDownloadURL ( ) : string
return string URL

getZipFile() public method

get a compressed zip file containing all the files in the collection.
public getZipFile ( ) : ProtectedFile
return ProtectedFile

model() public static method

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : the
return the static model class

relations() public method

public relations ( ) : array
return array relational rules.

removeFileById() public method

removes a protected file associated with the collection.
public removeFileById ( $file_id ) : boolean
$file_id
return boolean

rules() public method

public rules ( ) : array
return array validation rules for model attributes.

tableName() public method

public tableName ( ) : string
return string the associated database table name

updateFiles() public method

update the files for this collection.
public updateFiles ( int[] $file_ids )
$file_ids int[] - array of ProtectedFile ids to assign to the collection