PostObjectV4
in package
Uses
SignatureTrait
Encapsulates the logic for getting the data for an S3 object POST upload form
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs the PostObject.
- getBucket() : string
- Gets the bucket name.
- getClient() : S3ClientInterface
- Gets the S3 client.
- getFormAttributes() : array<string|int, mixed>
- Gets the form attributes as an array.
- getFormInputs() : array<string|int, mixed>
- Gets the form inputs as an array.
- setFormAttribute() : mixed
- Set a form attribute.
- setFormInput() : mixed
- Set a form input.
Methods
__construct()
Constructs the PostObject.
public
__construct(S3ClientInterface $client, string $bucket, array<string|int, mixed> $formInputs[, array<string|int, mixed> $options = [] ][, mixed $expiration = '+1 hours' ]) : mixed
The options array accepts the following keys:
Parameters
- $client : S3ClientInterface
-
Client used with the POST object
- $bucket : string
-
Bucket to use
- $formInputs : array<string|int, mixed>
-
Associative array of form input fields.
- $options : array<string|int, mixed> = []
-
Policy condition options
- $expiration : mixed = '+1 hours'
-
Upload expiration time value. By default: 1 hour valid period.
Tags
getBucket()
Gets the bucket name.
public
getBucket() : string
Return values
stringgetClient()
Gets the S3 client.
public
getClient() : S3ClientInterface
Return values
S3ClientInterfacegetFormAttributes()
Gets the form attributes as an array.
public
getFormAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getFormInputs()
Gets the form inputs as an array.
public
getFormInputs() : array<string|int, mixed>
Return values
array<string|int, mixed>setFormAttribute()
Set a form attribute.
public
setFormAttribute(string $attribute, string $value) : mixed
Parameters
- $attribute : string
-
Form attribute to set.
- $value : string
-
Value to set.
setFormInput()
Set a form input.
public
setFormInput(string $field, string $value) : mixed
Parameters
- $field : string
-
Field name to set
- $value : string
-
Value to set.