PHP Interface Neos\Flow\ResourceManagement\Storage\WritableStorageInterface

Inheritance: extends Neos\Flow\ResourceManagement\Storage\StorageInterface
显示文件 Open project: neos/flow-development-collection

Public Methods

Method Description
deleteResource ( PersistentResource $resource ) : boolean Deletes the storage data related to the given PersistentResource object
importResource ( string | resource $source, string $collectionName ) : PersistentResource Imports a resource (file) from the given URI or PHP resource stream into this storage.
importResourceFromContent ( string $content, string $collectionName ) : PersistentResource Imports a resource from the given string content into this storage.

Method Details

deleteResource() public method

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!
public deleteResource ( PersistentResource $resource ) : boolean
$resource Neos\Flow\ResourceManagement\PersistentResource The PersistentResource to delete the storage data of
return boolean TRUE if removal was successful

importResource() public method

On a successful import this method returns a PersistentResource object representing the newly imported persistent resource.
public importResource ( string | resource $source, string $collectionName ) : PersistentResource
$source string | resource
$collectionName string Name of the collection the new PersistentResource belongs to
return Neos\Flow\ResourceManagement\PersistentResource A resource object representing the imported resource

importResourceFromContent() public method

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.
public importResourceFromContent ( string $content, string $collectionName ) : PersistentResource
$content string The actual content to import
$collectionName string Name of the collection the new PersistentResource belongs to
return Neos\Flow\ResourceManagement\PersistentResource A resource object representing the imported resource