\CGBetterUploadsCategory

A class to represent a selection of files.

In this module a category is synonymous to a directory. However no hierarchical relationship exists. The directory name when created in the filesystem is obfuscated. There are a number of different types of categories, with different features.

This is an immutable object, properties cannot be directly modified.

Summary

Methods
Properties
Constants
with_name()
with_description()
with_type()
with_allow_upload()
with_allow_feu_delete()
with_expiry_hrs()
with_allowed_feu_groups()
with_allowed_mime_types()
can_upload()
is_upload_expired()
$guid
$name
$description
$type
$allow_upload
$allow_feu_delete
$expiry_hrs
$allowed_feu_groups
$allowed_mime_types
TYPE_PUBLIC
TYPE_YOUSENDIT
TYPE_FEULIMITED
TYPE_HIDDEN
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TYPE_PUBLIC

TYPE_PUBLIC

Indicates a public category.

Public categories can appear in the category list. Files in these categories can be listed by site visitors. Admins can optionally allow site visitors to upload files to these categories, and files can optionally automatically expire.

TYPE_YOUSENDIT

TYPE_YOUSENDIT

Indicates a yousendit category.

These categories do not appear in the category list. Files in these categories cannot be listed by site visotors. Site visitors can upload files in these categories, and files automatically expire.

TYPE_FEULIMITED

TYPE_FEULIMITED

Indicates a category limited to FEU users.

These categories will only appear in the category list if the user is logged in to FEU and authorized to see files in the category. Access to these categories can be limited to members of certain FEU groups. Upload to these categories can be enabled, and optionally files can expire in these categories.

TYPE_HIDDEN

TYPE_HIDDEN

Indicates a hidden category.

Files in these categories can never be listed by site visitors. Upload to these categories by site visitors can be enabled, and files can auto expire.

Properties

$guid

$guid : string

The unique, randomly generated id of this category

Type

string

$name

$name : string

A readable name for this category

Type

string

$description

$description : string

A brief, formatted description for this category.

Type

string

$type

$type : string

The type of category. One of public, yousendit, limittofeu, or hidden.

Type

string

$allow_upload

$allow_upload : boolean

Whether this category allows site visitors to upload files.

Type

boolean

$allow_feu_delete

$allow_feu_delete : boolean

Whether this category allows authorized FEU users to delete files

Type

boolean

$expiry_hrs

$expiry_hrs : integer

The number of hours before files in this category expiry and can be auto removed. Default is 0.

Type

integer

$allowed_feu_groups

$allowed_feu_groups : array<mixed,string>

An array of FEU group names indicating which groups can upload files to this category.

Type

array<mixed,string>

$allowed_mime_types

$allowed_mime_types : string

A comma and newline separated list of mime types (wildcard permitted) that can be uploaded to this category.

Type

string

Methods

with_name()

with_name(string  $name) : \CGBetterUploads\Category

Adjust the name of the category object.

Parameters

string $name

The new name

Returns

\CGBetterUploads\Category

with_description()

with_description(string  $description) : \CGBetterUploads\Category

Adjust the description of the category object.

Parameters

string $description

The new description

Returns

\CGBetterUploads\Category

with_type()

with_type(string  $type) : \CGBetterUploads\Category

Adjust the type of the category object.

Parameters

string $type

Returns

\CGBetterUploads\Category

with_allow_upload()

with_allow_upload(boolean  $flag) : \CGBetterUploads\Category

Whether or not to allow uploads to this category by site visitors.

Parameters

boolean $flag

Returns

\CGBetterUploads\Category

with_allow_feu_delete()

with_allow_feu_delete(boolean  $flag) : \CGBetterUploads\Category

Whether or not authorized FEU users can remove files in this category.

Parameters

boolean $flag

Returns

\CGBetterUploads\Category

with_expiry_hrs()

with_expiry_hrs(integer  $hrs) : \CGBetterUploads\Category

Set the number of hours before files in this category expire and can be auto-removed.

Parameters

integer $hrs

Returns

\CGBetterUploads\Category

with_allowed_feu_groups()

with_allowed_feu_groups(array<mixed,string>  $in = null) : \CGBetterUploads\Category

Set the list of FEU groups that are allowed to view this category.

This property is only used in feulimited categories.

Parameters

array<mixed,string> $in

Returns

\CGBetterUploads\Category

with_allowed_mime_types()

with_allowed_mime_types(string  $data = null) : \CGBetterUploads\Category

Set the list of file types that are allowed to be uploaded to this category.

Parameters

string $data

A comma separated list of mime types, wildcards are permitted.

Returns

\CGBetterUploads\Category

can_upload()

can_upload() : boolean

Whether uploading is permitted to files in this category.

Returns

boolean

is_upload_expired()

is_upload_expired(\CGBetterUploads\Upload  $upload) : boolean

Test whether an upload in this category can be considered to be epxired.

This method does not ensure a match between this categories guid, and the upload's category_guid

Parameters

\CGBetterUploads\Upload $upload

Returns

boolean