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
Table of Contents
- getEvents() : \OCP\WorkflowEngine\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() : \OCP\WorkflowEngine\IEntityEvent[]
Tags
Return values
\OCP\WorkflowEngine\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
string —getName()
returns a translated name to be presented in the web interface.
public
getName() : string
Example: "File" (en), "Dosiero" (eo)
Tags
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
Return values
bool —prepareRuleMatcher()
public
prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, Event $event) : void
Parameters
- $ruleMatcher : IRuleMatcher
- $eventName : string
- $event : Event