Documentation

Upload

Upload table stores info about files that have been uploaded.

..

Table of Contents

addData()  : void
Hook for adding extra data to a file save.
canaccess()  : bool
Determine if a user can access the file
delete()  : void
Automatically called by RedBean when you try to trash an upload. Do any cleanup in here
downloaded()  : void
Hook for doing something when a file is downloaded
updateData()  : void
Hook for adding extra data to a file replace.

Methods

addData()

Hook for adding extra data to a file save.

public addData(Context $context, int $index) : void
Parameters
$context : Context

The context object for the site

$index : int

If you are reading data from an array fo files, this is the index in the file. You may have paralleld data arrays and need this index.

Tags
phpcsSuppress

SlevomatCodingStandard.Functions.UnusedParameter

Return values
void

canaccess()

Determine if a user can access the file

public canaccess(OODBBean $user[, string $op = 'r' ]) : bool

At the moment it is either the user or any admin that is allowed. Rewrite the method to add more complex access control schemes.

Parameters
$user : OODBBean

A user object

$op : string = 'r'

r for read, u for update, d for delete

Tags
phpcsSuppress

SlevomatCodingStandard.Functions.UnusedParameter

Return values
bool

delete()

Automatically called by RedBean when you try to trash an upload. Do any cleanup in here

public delete() : void
Tags
throws
Forbidden
Return values
void

downloaded()

Hook for doing something when a file is downloaded

public downloaded(Context $context) : void
Parameters
$context : Context

The context object for the site

Tags
phpcsSuppress

SlevomatCodingStandard.Functions.UnusedParameter

Return values
void

updateData()

Hook for adding extra data to a file replace.

public updateData(Context $context, int $index) : void
Parameters
$context : Context

The context object for the site

$index : int

If you are reading data from an array of files, this is the index in the file. You may have parallel data arrays and need this index.

Tags
phpcsSuppress

SlevomatCodingStandard.Functions.UnusedParameter

Return values
void

Search results