WritableStorageInterface
interface WritableStorageInterface implements StorageInterface (View source)
Interface of a PersistentResource Storage which provides import functionality.
Methods
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
Retrieve all Objects stored in this storage, filtered by the given collection name
Imports a resource (file) from the given URI or PHP resource stream into this storage.
Imports a resource from the given string content into this storage.
Deletes the storage data related to the given PersistentResource object
Details
string
getName()
Returns the instance name of this storage
resource|bool
getStreamByResource(PersistentResource $resource)
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
resource|bool
getStreamByResourcePath(string $relativePath)
Returns a stream handle which can be used internally to open / copy the given resource stored in this storage.
StorageObject>
getObjects()
Retrieve all Objects stored in this storage.
StorageObject>
getObjectsByCollection(CollectionInterface $collection)
Retrieve all Objects stored in this storage, filtered by the given collection name
PersistentResource
importResource(string|resource $source, string $collectionName)
Imports a resource (file) from the given URI or PHP resource stream into this storage.
On a successful import this method returns a PersistentResource object representing the newly imported persistent resource.
PersistentResource
importResourceFromContent(string $content, string $collectionName)
Imports a resource from the given string content into this storage.
On a successful import this method returns a PersistentResource object representing the newly imported persistent resource.
The specified filename will be used when presenting the resource to a user. Its file extension is important because the resource management will derive the IANA Media Type from it.
bool
deleteResource(PersistentResource $resource)
Deletes the storage data related to the given PersistentResource object
Note: Implementations of this method are triggered by a pre-remove event of the persistence layer whenever a PersistentResource object is going to be removed. Therefore this method must not remove the PersistentResource object from the PersistentResource Repository itself!