StorageObject
class StorageObject implements ResourceMetaDataInterface (View source)
An Object which is stored in a Storage
This class is used internally as a representation of the actual storage data.
The main purpose for Object is to transfer data and meta data from a storage to a publishing target. It must not be used outside the resource management framework.
Properties
protected string | $mediaType | The IANA media type of the stored data |
|
protected string | $filename | The suggested filename |
|
protected int | $fileSize | The size of this object's data |
|
protected string | $relativePublicationPath | A suggested relative path for publication of this data |
|
protected string | $sha1 | SHA1 hash identifying this object's data |
|
protected string | $md5 | MD5 hash identifying this object's data |
|
protected Closure|resource | $stream | A stream (or, before it is used the first time, a Closure which returns a stream) which can deliver the data of this Object |
Methods
Set the IANA media type of this Object
Retrieve the IANA media type of this Object
Set the suggested filename of this Object
Retrieve the suggested filename of this Object
Set the suggested relative publication path
Retrieve the suggested relative publication path
Returns the size of the content of this storage object
Sets the size of the content of this storage object
Set the SHA1 hash identifying the data of this Object
Retrieve the SHA1 hash identifying the data of this object
Returns the data stream which can deliver the content of this storage object
Details
void
setMediaType(string $mediaType)
Set the IANA media type of this Object
string
getMediaType()
Retrieve the IANA media type of this Object
void
setFilename(string $filename)
Set the suggested filename of this Object
string
getFilename()
Retrieve the suggested filename of this Object
void
setRelativePublicationPath(string $relativePublicationPath)
Set the suggested relative publication path
string
getRelativePublicationPath()
Retrieve the suggested relative publication path
string
getFileSize()
Returns the size of the content of this storage object
void
setFileSize(string $fileSize)
Sets the size of the content of this storage object
void
setSha1(string $sha1)
Set the SHA1 hash identifying the data of this Object
string
getSha1()
Retrieve the SHA1 hash identifying the data of this object
string
getMd5()
deprecated
deprecated
Returns the md5 hash of the content of this storage object
void
setMd5(string $md5)
deprecated
deprecated
Sets the md5 hash of the content of this storage object
void
setStream(resource|Closure $stream)
Sets the data stream which can deliver the content of this storage object
Instead of providing a stream (PHP resource), you can also pass a Closure which returns a stream when it is evaluated.
resource
getStream()
Returns the data stream which can deliver the content of this storage object