Elgg  Version master
Public Member Functions | Public Attributes | List of all members
Elgg\FileService\File Class Reference

File service. More...

Public Member Functions

 setFile (\ElggFile $file)
 Set file object. More...
 
 getFile ()
 Returns file object. More...
 
 setExpires (string $expires= '+2 hours')
 Sets URL expiration. More...
 
 setDisposition (string $disposition=self::ATTACHMENT)
 Sets content disposition. More...
 
 bindSession (bool $use_cookie=true)
 Bind URL to current user session. More...
 
 getURL ()
 Returns publicly accessible URL. More...
 

Public Attributes

const INLINE = 'inline'
 
const ATTACHMENT = 'attachment'
 

Detailed Description

File service.

Definition at line 14 of file File.php.

Member Function Documentation

Elgg\FileService\File::bindSession ( bool  $use_cookie = true)

Bind URL to current user session.

Parameters
bool$use_cookieUse cookie
Returns
void

Definition at line 92 of file File.php.

Elgg\FileService\File::getFile ( )

Returns file object.

Returns
|null

Definition at line 54 of file File.php.

Elgg\FileService\File::getURL ( )

Returns publicly accessible URL.

Returns
string|null

Definition at line 101 of file File.php.

Elgg\FileService\File::setDisposition ( string  $disposition = self::ATTACHMENT)

Sets content disposition.

Parameters
string$dispositionContent disposition ('inline' or 'attachment')
Returns
void
Exceptions

Definition at line 77 of file File.php.

Elgg\FileService\File::setExpires ( string  $expires = '+2 hours')

Sets URL expiration.

Parameters
string$expiresString suitable for strtotime()
Returns
void

Definition at line 65 of file File.php.

Elgg\FileService\File::setFile ( \ElggFile  $file)

Set file object.

Parameters
\ElggFile$fileFile object
Returns
void

Definition at line 45 of file File.php.

Member Data Documentation

const Elgg\FileService\File::ATTACHMENT = 'attachment'

Definition at line 17 of file File.php.

const Elgg\FileService\File::INLINE = 'inline'

Definition at line 16 of file File.php.


The documentation for this class was generated from the following file: