Nextcloud PHP API (master)

IShare

This interface allows to represent a share object.

This interface must not be implemented in your application.

Tags
since
9.0.0

Table of Contents

Constants

STATUS_ACCEPTED  = 1
STATUS_PENDING  = 0
STATUS_REJECTED  = 2
TYPE_CIRCLE  = 7
TYPE_DECK  = 12
TYPE_EMAIL  = 4
TYPE_GROUP  = 1
TYPE_GUEST  = 8
TYPE_LINK  = 3
TYPE_REMOTE  = 6
TYPE_REMOTE_GROUP  = 9
TYPE_ROOM  = 10
TYPE_SCIENCEMESH  = 15
TYPE_USER  = 0

Methods

getAttributes()  : IAttributes|null
Get share attributes
getExpirationDate()  : DateTime|null
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 should be 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)
getNoExpirationDate()  : bool
Get value of overwrite falsy expiry date flag
getNote()  : string
Get note attached to a share
getPassword()  : string|null
Get the password of this share.
getPasswordExpirationTime()  : DateTimeInterface|null
Get the password's expiration time of this share.
getPermissions()  : int
Get the share permissions See \OCP\Constants::PERMISSION_*
getReminderSent()  : bool
Gets a flag that stores whether a reminder via email has been sent
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 ?
newAttributes()  : IAttributes
Create share attributes object
setAttributes()  : IShare
Set share attributes
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 should be informed by mail about the share.
setNode()  : IShare
Set the node of the file/folder that is shared
setNodeCacheEntry()  : void
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)
setNoExpirationDate()  : IShare
Set overwrite flag for falsy expiry date vavlues
setNote()  : IShare
Attach a note to a share
setPassword()  : IShare
Set the password for this share.
setPasswordExpirationTime()  : self
Set the password's expiration time of 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.
setReminderSent()  : self
Sets a flag that stores whether a reminder via email has been sent
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 = 0
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_DECK

public mixed TYPE_DECK = 12
Tags
since
21.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_SCIENCEMESH

public mixed TYPE_SCIENCEMESH = 15
Tags
since
26.0.0

TYPE_USER

public mixed TYPE_USER = 0
Tags
since
17.0.0

Methods

getExpirationDate()

Get the expiration date

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

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 should be 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

getNoExpirationDate()

Get value of overwrite falsy expiry date flag

public getNoExpirationDate() : bool
Tags
since
30.0.0
Return values
bool

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|null

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

Tags
since
9.0.0
Return values
string|null

getPasswordExpirationTime()

Get the password's expiration time of this share.

public getPasswordExpirationTime() : DateTimeInterface|null
Tags
since
24.0.0
Return values
DateTimeInterface|null

getPermissions()

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

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

getReminderSent()

Gets a flag that stores whether a reminder via email has been sent

public getReminderSent() : bool
Tags
since
31.0.0
Return values
bool

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

setAttributes()

Set share attributes

public setAttributes(IAttributes|null $attributes) : IShare
Parameters
$attributes : IAttributes|null
Tags
since
25.0.0
Return values
IShare

The modified object

setExpirationDate()

Set the expiration date

public setExpirationDate(DateTime|null $expireDate) : IShare
Parameters
$expireDate : DateTime|null
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 should be 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) : void
Parameters
$entry : ICacheEntry
Tags
since
11.0.0

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

setNoExpirationDate()

Set overwrite flag for falsy expiry date vavlues

public setNoExpirationDate(bool $noExpirationDate) : IShare
Parameters
$noExpirationDate : bool
Tags
since
30.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|null $password) : IShare

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

Parameters
$password : string|null
Tags
since
9.0.0
Return values
IShare

The modified object

setPasswordExpirationTime()

Set the password's expiration time of this share.

public setPasswordExpirationTime([DateTimeInterface|null $passwordExpirationTime = null ]) : self
Parameters
$passwordExpirationTime : DateTimeInterface|null = null
Tags
since
24.0.0
Return values
self

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

setReminderSent()

Sets a flag that stores whether a reminder via email has been sent

public setReminderSent(bool $reminderSent) : self
Parameters
$reminderSent : bool
Tags
since
31.0.0
Return values
self

The modified object

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


        
On this page

Search results