Class UploadState
Representation of the multipart upload.
This object keeps track of the state of the upload, including the status and which parts have been uploaded.
Methods Summary
- __construct ( array $id )
-
getId ( )
Get the upload's ID, which is a tuple of parameters that can uniquely identify the upload.
-
setUploadId ( string $key, string $value )
Set's the "upload_id", or 3rd part of the upload's ID. This typically only needs to be done after initiating an upload.
-
getPartSize ( )
Get the part size.
-
setPartSize ( $partSize )
Set the part size.
-
markPartAsUploaded ( int $partNumber, array $partData = [] )
Marks a part as being uploaded.
-
hasPartBeenUploaded ( int $partNumber )
Returns whether a part has been uploaded.
-
getUploadedParts ( )
Returns a sorted list of all the uploaded parts.
-
setStatus ( int $status )
Set the status of the upload.
-
isInitiated ( )
Determines whether the upload state is in the INITIATED status.
-
isCompleted ( )
Determines whether the upload state is in the COMPLETED status.
Methods Details
__construct ( array $id )
Parameters
array | $id | Params used to identity the upload. |
array getId ( )
Get the upload's ID, which is a tuple of parameters that can uniquely identify the upload.
Returns
array |
setUploadId ( string $key, string $value )
Set's the "upload_id", or 3rd part of the upload's ID. This typically only needs to be done after initiating an upload.
Parameters
string | $key | The param key of the upload_id. |
string | $value | The param value of the upload_id. |
integer getPartSize ( )
Get the part size.
Returns
integer |
setPartSize ( $partSize )
Set the part size.
Parameters
$partSize | Size of upload parts. |
markPartAsUploaded ( integer $partNumber, array $partData = [] )
Marks a part as being uploaded.
Parameters
integer | $partNumber | The part number. |
array | $partData = [] | Data from the upload operation that needs to be recalled during the complete operation. |
boolean hasPartBeenUploaded ( integer $partNumber )
Returns whether a part has been uploaded.
Parameters
integer | $partNumber | The part number. |
Returns
boolean |
array getUploadedParts ( )
Returns a sorted list of all the uploaded parts.
Returns
array |
setStatus ( integer $status )
Set the status of the upload.
Parameters
integer | $status | Status is an integer code defined by the constants CREATED, INITIATED, and COMPLETED on this class. |
boolean isInitiated ( )
Determines whether the upload state is in the INITIATED status.
Returns
boolean |
boolean isCompleted ( )
Determines whether the upload state is in the COMPLETED status.
Returns
boolean |
Constants summary
integer |
CREATED
|
#
0
|
integer |
INITIATED
|
#
1
|
integer |
COMPLETED
|
#
2
|