Nextcloud PHP API (stable18)

IShare

Interface IShare

Tags
since
9.0.0

Table of Contents

STATUS_ACCEPTED  = 1
STATUS_PENDING  = 0
STATUS_REJECTED  = 2
TYPE_CIRCLE  = 7
TYPE_EMAIL  = 4
TYPE_GROUP  = 1
TYPE_GUEST  = 8
TYPE_LINK  = 3
TYPE_REMOTE  = 6
TYPE_REMOTE_GROUP  = 9
TYPE_ROOM  = 10
TYPE_USER  = 0
getExpirationDate()  : DateTime
Get the expiration date
getFullId()  : string
Get the full share id. This is the <providerid>:<internalid>.
getHideDownload()  : bool
Gets a shares hide download state This is mainly for public shares. It will signal that the share page should hide download buttons etc.
getId()  : string
Get the internal id of the share.
getLabel()  : string
get label for the share, some shares, e.g. public links can have a label
getMailSend()  : bool
Get if the recipient informed by mail about the share.
getNode()  : File|Folder
Get the node of the file/folder that is shared
getNodeCacheEntry()  : null|ICacheEntry
Get the cache entry for the shared node
getNodeId()  : int
Get the fileid of the node of this share
getNodeType()  : string
Get the type of node (file/folder)
getNote()  : string
Get note attached to a share
getPassword()  : string
Get the password of this share.
getPermissions()  : int
Get the share permissions See \OCP\Constants::PERMISSION_*
getSendPasswordByTalk()  : bool
Get if the recipient can start a conversation with the owner to get the password using Nextcloud Talk.
getSharedBy()  : string
Get share sharer
getSharedWith()  : string
Get the receiver of this share.
getSharedWithAvatar()  : string
Get the avatar of the receiver of this share.
getSharedWithDisplayName()  : string
Get the display name of the receiver of this share.
getShareOwner()  : string
Get the original share owner (who owns the path that is shared)
getShareTime()  : DateTime
Get the timestamp this share was created
getShareType()  : int
Get the shareType
getStatus()  : int
Get the accepted status See self::STATUS_*
getTarget()  : string
Get the target path of this share relative to the recipients user folder.
getToken()  : string
Get the public link token.
isExpired()  : bool
Is the share expired ?
setExpirationDate()  : IShare
Set the expiration date
setHideDownload()  : IShare
Sets a shares hide download state This is mainly for public shares. It will signal that the share page should hide download buttons etc.
setId()  : IShare
Set the internal id of the share It is only allowed to set the internal id of a share once.
setLabel()  : IShare
set a label for a share, some shares, e.g. public links can have a label
setMailSend()  : IShare
Set if the recipient is informed by mail about the share.
setNode()  : IShare
Set the node of the file/folder that is shared
setNodeCacheEntry()  : mixed
Set the cache entry for the shared node
setNodeId()  : IShare
Set file id for lazy evaluation of the node
setNodeType()  : IShare
Set the type of node (file/folder)
setNote()  : IShare
Attach a note to a share
setPassword()  : IShare
Set the password for this share.
setPermissions()  : IShare
Set the permissions.
setProviderId()  : IShare
Set the provider id of the share It is only allowed to set the provider id of a share once.
setSendPasswordByTalk()  : IShare
Set if the recipient can start a conversation with the owner to get the password using Nextcloud Talk.
setSharedBy()  : IShare
Set the sharer of the path.
setSharedWith()  : IShare
Set the receiver of this share.
setSharedWithAvatar()  : IShare
Set the avatar of the receiver of this share.
setSharedWithDisplayName()  : IShare
Set the display name of the receiver of this share.
setShareOwner()  : IShare
Set the original share owner (who owns the path that is shared)
setShareTime()  : IShare
Set the time this share was created
setShareType()  : IShare
Set the shareType
setStatus()  : IShare
Set the accepted status See self::STATUS_*
setTarget()  : IShare
Set the target path of this share relative to the recipients user folder.
setToken()  : IShare
Set the public link token.

Constants

STATUS_ACCEPTED

public mixed STATUS_ACCEPTED = 1
Tags
since
18.0.0

STATUS_PENDING

public mixed STATUS_PENDING = ""
Tags
since
18.0.0

STATUS_REJECTED

public mixed STATUS_REJECTED = 2
Tags
since
18.0.0

TYPE_CIRCLE

public mixed TYPE_CIRCLE = 7
Tags
since
17.0.0

TYPE_EMAIL

public mixed TYPE_EMAIL = 4
Tags
since
17.0.0

TYPE_GROUP

public mixed TYPE_GROUP = 1
Tags
since
17.0.0

TYPE_GUEST

public mixed TYPE_GUEST = 8
Tags
since
17.0.0
public mixed TYPE_LINK = 3
Tags
since
17.0.0

TYPE_REMOTE

public mixed TYPE_REMOTE = 6
Tags
since
17.0.0

TYPE_REMOTE_GROUP

public mixed TYPE_REMOTE_GROUP = 9
Tags
since
17.0.0

TYPE_ROOM

public mixed TYPE_ROOM = 10
Tags
since
17.0.0

TYPE_USER

public mixed TYPE_USER = ""
Tags
since
17.0.0

Methods

getExpirationDate()

Get the expiration date

public getExpirationDate() : DateTime
Tags
since
9.0.0
Return values
DateTime

getFullId()

Get the full share id. This is the <providerid>:<internalid>.

public getFullId() : string

The full id is unique in the system.

Tags
since
9.0.0
throws
UnexpectedValueException

If the fullId could not be constructed

Return values
string

getHideDownload()

Gets a shares hide download state This is mainly for public shares. It will signal that the share page should hide download buttons etc.

public getHideDownload() : bool
Tags
since
15.0.0
Return values
bool

getId()

Get the internal id of the share.

public getId() : string
Tags
since
9.0.0
Return values
string

getLabel()

get label for the share, some shares, e.g. public links can have a label

public getLabel() : string
Tags
since
15.0.0
Return values
string

getMailSend()

Get if the recipient informed by mail about the share.

public getMailSend() : bool
Tags
since
9.0.0
Return values
bool

getNodeCacheEntry()

Get the cache entry for the shared node

public getNodeCacheEntry() : null|ICacheEntry
Tags
since
11.0.0
Return values
null|ICacheEntry

getNodeId()

Get the fileid of the node of this share

public getNodeId() : int
Tags
since
9.0.0
throws
NotFoundException
Return values
int

getNodeType()

Get the type of node (file/folder)

public getNodeType() : string
Tags
since
9.0.0
throws
NotFoundException
Return values
string

getNote()

Get note attached to a share

public getNote() : string
Tags
since
14.0.0
Return values
string

getPassword()

Get the password of this share.

public getPassword() : string

If this share is obtained via a shareprovider the password is hashed.

Tags
since
9.0.0
Return values
string

getPermissions()

Get the share permissions See \OCP\Constants::PERMISSION_*

public getPermissions() : int
Tags
since
9.0.0
Return values
int

getSendPasswordByTalk()

Get if the recipient can start a conversation with the owner to get the password using Nextcloud Talk.

public getSendPasswordByTalk() : bool

The returned value does not take into account other factors, like Talk being enabled for the owner of the share or not; it just cover whether the option is enabled for the share itself or not.

Tags
since
14.0.0
Return values
bool

getSharedBy()

Get share sharer

public getSharedBy() : string
Tags
since
9.0.0
Return values
string

getSharedWith()

Get the receiver of this share.

public getSharedWith() : string
Tags
since
9.0.0
Return values
string

getSharedWithAvatar()

Get the avatar of the receiver of this share.

public getSharedWithAvatar() : string
Tags
since
14.0.0
Return values
string

getSharedWithDisplayName()

Get the display name of the receiver of this share.

public getSharedWithDisplayName() : string
Tags
since
14.0.0
Return values
string

getShareOwner()

Get the original share owner (who owns the path that is shared)

public getShareOwner() : string
Tags
since
9.0.0
Return values
string

getShareTime()

Get the timestamp this share was created

public getShareTime() : DateTime
Tags
since
9.0.0
Return values
DateTime

getShareType()

Get the shareType

public getShareType() : int
Tags
since
9.0.0
Return values
int

getStatus()

Get the accepted status See self::STATUS_*

public getStatus() : int
Tags
since
18.0.0
Return values
int

getTarget()

Get the target path of this share relative to the recipients user folder.

public getTarget() : string
Tags
since
9.0.0
Return values
string

getToken()

Get the public link token.

public getToken() : string
Tags
since
9.0.0
Return values
string

isExpired()

Is the share expired ?

public isExpired() : bool
Tags
since
18.0.0
Return values
bool

setExpirationDate()

Set the expiration date

public setExpirationDate(null|DateTime $expireDate) : IShare
Parameters
$expireDate : null|DateTime
Tags
since
9.0.0
Return values
IShare

The modified object

setHideDownload()

Sets a shares hide download state This is mainly for public shares. It will signal that the share page should hide download buttons etc.

public setHideDownload(bool $hide) : IShare
Parameters
$hide : bool
Tags
since
15.0.0
Return values
IShare

setId()

Set the internal id of the share It is only allowed to set the internal id of a share once.

public setId(string $id) : IShare

Attempts to override the internal id will result in an IllegalIDChangeException

Parameters
$id : string
Tags
throws
IllegalIDChangeException
throws
InvalidArgumentException
since
9.1.0
Return values
IShare

setLabel()

set a label for a share, some shares, e.g. public links can have a label

public setLabel(string $label) : IShare
Parameters
$label : string
Tags
since
15.0.0
Return values
IShare

The modified object

setMailSend()

Set if the recipient is informed by mail about the share.

public setMailSend(bool $mailSend) : IShare
Parameters
$mailSend : bool
Tags
since
9.0.0
Return values
IShare

The modified object

setNode()

Set the node of the file/folder that is shared

public setNode(Node $node) : IShare
Parameters
$node : Node
Tags
since
9.0.0
Return values
IShare

The modified object

setNodeCacheEntry()

Set the cache entry for the shared node

public setNodeCacheEntry(ICacheEntry $entry) : mixed
Parameters
$entry : ICacheEntry
Tags
since
11.0.0
Return values
mixed

setNodeId()

Set file id for lazy evaluation of the node

public setNodeId(int $fileId) : IShare
Parameters
$fileId : int
Tags
since
9.0.0
Return values
IShare

The modified object

setNodeType()

Set the type of node (file/folder)

public setNodeType(string $type) : IShare
Parameters
$type : string
Tags
since
9.0.0
Return values
IShare

The modified object

setNote()

Attach a note to a share

public setNote(string $note) : IShare
Parameters
$note : string
Tags
since
14.0.0
Return values
IShare

The modified object

setPassword()

Set the password for this share.

public setPassword(string $password) : IShare

When the share is passed to the share manager to be created or updated the password will be hashed.

Parameters
$password : string
Tags
since
9.0.0
Return values
IShare

The modified object

setPermissions()

Set the permissions.

public setPermissions(int $permissions) : IShare

See \OCP\Constants::PERMISSION_*

Parameters
$permissions : int
Tags
since
9.0.0
Return values
IShare

The modified object

setProviderId()

Set the provider id of the share It is only allowed to set the provider id of a share once.

public setProviderId(string $id) : IShare

Attempts to override the provider id will result in an IllegalIDChangeException

Parameters
$id : string
Tags
throws
IllegalIDChangeException
throws
InvalidArgumentException
since
9.1.0
Return values
IShare

setSendPasswordByTalk()

Set if the recipient can start a conversation with the owner to get the password using Nextcloud Talk.

public setSendPasswordByTalk(bool $sendPasswordByTalk) : IShare
Parameters
$sendPasswordByTalk : bool
Tags
since
14.0.0
Return values
IShare

The modified object

setSharedBy()

Set the sharer of the path.

public setSharedBy(string $sharedBy) : IShare
Parameters
$sharedBy : string
Tags
since
9.0.0
Return values
IShare

The modified object

setSharedWith()

Set the receiver of this share.

public setSharedWith(string $sharedWith) : IShare
Parameters
$sharedWith : string
Tags
since
9.0.0
Return values
IShare

The modified object

setSharedWithAvatar()

Set the avatar of the receiver of this share.

public setSharedWithAvatar(string $src) : IShare
Parameters
$src : string
Tags
since
14.0.0
Return values
IShare

The modified object

setSharedWithDisplayName()

Set the display name of the receiver of this share.

public setSharedWithDisplayName(string $displayName) : IShare
Parameters
$displayName : string
Tags
since
14.0.0
Return values
IShare

The modified object

setShareOwner()

Set the original share owner (who owns the path that is shared)

public setShareOwner(string $shareOwner) : IShare
Parameters
$shareOwner : string
Tags
since
9.0.0
Return values
IShare

The modified object

setShareTime()

Set the time this share was created

public setShareTime(DateTime $shareTime) : IShare
Parameters
$shareTime : DateTime
Tags
since
9.0.0
Return values
IShare

The modified object

setShareType()

Set the shareType

public setShareType(int $shareType) : IShare
Parameters
$shareType : int
Tags
since
9.0.0
Return values
IShare

The modified object

setStatus()

Set the accepted status See self::STATUS_*

public setStatus(int $status) : IShare
Parameters
$status : int
Tags
since
18.0.0
Return values
IShare

The modified object

setTarget()

Set the target path of this share relative to the recipients user folder.

public setTarget(string $target) : IShare
Parameters
$target : string
Tags
since
9.0.0
Return values
IShare

The modified object

setToken()

Set the public link token.

public setToken(string $token) : IShare
Parameters
$token : string
Tags
since
9.0.0
Return values
IShare

The modified object

Search results