Nextcloud PHP API (master)

IEntity

Interface IEntity

This interface represents an entity that supports events the workflow engine can listen to. For example a file with the create, update, etc. events.

Ensure to listen to 'OCP/WorkflowEngine::loadEntities' for registering your entities.

Tags
since
18.0.0

Table of Contents

Methods

getEvents()  : array<string|int, IEntityEvent>
returns a list of supported events
getIcon()  : string
returns the URL to the icon of the entity for display in the web interface.
getName()  : string
returns a translated name to be presented in the web interface.
isLegitimatedForUserId()  : bool
returns whether the provided user id is allowed to run a flow against the known context
prepareRuleMatcher()  : void

Methods

getEvents()

returns a list of supported events

public getEvents() : array<string|int, IEntityEvent>
Tags
since
18.0.0
Return values
array<string|int, IEntityEvent>

getIcon()

returns the URL to the icon of the entity for display in the web interface.

public getIcon() : string

Usually, the implementation would utilize the imagePath() method of the \OCP\IURLGenerator instance and simply return its result.

Example implementation: return $this->urlGenerator->imagePath('myApp', 'cat.svg');

Tags
since
18.0.0
Return values
string

getName()

returns a translated name to be presented in the web interface.

public getName() : string

Example: "File" (en), "Dosiero" (eo)

Tags
since
18.0.0
Return values
string

isLegitimatedForUserId()

returns whether the provided user id is allowed to run a flow against the known context

public isLegitimatedForUserId(string $userId) : bool
Parameters
$userId : string
Tags
since
18.0.0
Return values
bool

prepareRuleMatcher()

public prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, Event $event) : void
Parameters
$ruleMatcher : IRuleMatcher
$eventName : string
$event : Event
Tags
since
18.0.0

        
On this page

Search results