\OCPShare_Backend_File_Dependent

Interface for share backends that share content that is dependent on files.

Extends the Share_Backend interface.

Summary

Methods
Constants
isValidSource()
generateTarget()
formatItems()
isShareTypeAllowed()
getFilePath()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

isValidSource()

isValidSource(string  $itemSource, string  $uidOwner) : boolean|null

Check if this $itemSource exist for the user

Parameters

string $itemSource
string $uidOwner

Owner of the item

Returns

boolean|null —

Source

Return false if the item does not exist for the user

generateTarget()

generateTarget(string  $itemSource, string|false  $shareWith, array|null  $exclude = null) : string

Get a unique name of the item for the specified user

Parameters

string $itemSource
string|false $shareWith

User the item is being shared with

array|null $exclude

List of similar item names already existing as shared items @deprecated since version OC7

Returns

string —

Target name

This function needs to verify that the user does not already have an item with this name. If it does generate a new name e.g. name_#

formatItems()

formatItems(array  $items, integer  $format,   $parameters = null) : array

Converts the shared item sources back into the item in the specified format

Parameters

array $items

Shared items

integer $format
$parameters

Returns

array —

The items array is a 3-dimensional array with the item_source as the first key and the share id as the second key to an array with the share info.

The key/value pairs included in the share info depend on the function originally called: If called by getItem(s)Shared: id, item_type, item, item_source, share_type, share_with, permissions, stime, file_source

If called by getItem(s)SharedWith: id, item_type, item, item_source, item_target, share_type, share_with, permissions, stime, file_source, file_target

This function allows the backend to control the output of shared items with custom formats. It is only called through calls to the public getItem(s)Shared(With) functions.

isShareTypeAllowed()

isShareTypeAllowed(integer  $shareType) : boolean

Check if a given share type is allowd by the back-end

Parameters

integer $shareType

share type

Returns

boolean —

The back-end can enable/disable specific share types. Just return true if the back-end doesn't provide any specific settings for it and want to allow all share types defined by the share API

getFilePath()

getFilePath(string  $itemSource, string  $uidOwner) : string|false

Get the file path of the item

Parameters

string $itemSource
string $uidOwner

User that is the owner of shared item

Returns

string|false