IEntity
in
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
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
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
Return values
stringgetName()
returns a translated name to be presented in the web interface.
public
getName() : string
Example: "File" (en), "Dosiero" (eo)
Tags
Return values
stringisLegitimatedForUserId()
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
Return values
boolprepareRuleMatcher()
public
prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, Event $event) : void
Parameters
- $ruleMatcher : IRuleMatcher
- $eventName : string
- $event : Event