\CGBetterUploadsUpload

A class to represent an uploaded file.

This is an immutable class.

Summary

Methods
Properties
Constants
__construct()
get()
fieldVal()
withCategory()
withSummary()
withDisplayName()
withDescription()
withField()
$guid
$category_guid
$filename
$display_name
$author
$summary
$description
$created
$size
$fields
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$guid

$guid : string

A unique, randomly generated identifier.

Type

string

$category_guid

$category_guid : string

The guid of the category that this file is associated with.

Type

string

$filename

$filename : string

The original name of the uploaded file.

Type

string

$display_name

$display_name : string

A name to use when displaying this file (usually the same as the file name).

Type

string

$author

$author : string

An optional string to identify the uploader.

Type

string

$summary

$summary : string

A brief description of this file. In text.

Type

string

$description

$description : string

Longer, formatted text for htis file.

Type

string

$created

$created : integer

The unix timestamp of the time when this record was created.

Type

integer

$size

$size : integer

the size of the uploaded file

Type

integer

$fields

$fields : array|null

An associative array of field names and values. May be null.

Type

array|null

Methods

__construct()

__construct(array  $in = null) 

Constructor

Parameters

array $in

An array of properties and values to construct the object with.

get()

get(string  $key) : mixed

Get a property value.

See the properties of this object for valid values for $key

Parameters

string $key

Returns

mixed

fieldVal()

fieldVal(string  $key) : string|null

Get the value of a single field, if it exists.

Parameters

string $key

The field name

Returns

string|null

withCategory()

withCategory(string  $guid) : \CGBetterUploads\UploadWriteInterface

Adjust the category of this upload.

No checks are done to ensure that the category guid is valid, and no files are moved.

Parameters

string $guid

Returns

\CGBetterUploads\UploadWriteInterface

withSummary()

withSummary(string  $text = null) : \CGBetterUploads\UploadWriteInterface

Adjust the summary of this upload.

Parameters

string $text

Returns

\CGBetterUploads\UploadWriteInterface

withDisplayName()

withDisplayName(string  $text = null) : \CGBetterUploads\UploadWriteInterface

Adjust the display name of this file.

No checks are performed to ensure that the data is valid.

Parameters

string $text

The new display name.

Returns

\CGBetterUploads\UploadWriteInterface

withDescription()

withDescription(string  $text = null) : \CGBetterUploads\UploadWriteInterface

Adjust the formatted description for this file.

Parameters

string $text

The new display name.

Returns

\CGBetterUploads\UploadWriteInterface

withField()

withField(string  $field, string  $val) : \CGBetterUploads\UploadWriteInterface

set a field value for the upload.

Parameters

string $field

The field name.

string $val

Returns

\CGBetterUploads\UploadWriteInterface