remove IEntity's getId in favor of class name
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
4c2fdbb908
commit
26b19b73a4
|
@ -41,10 +41,6 @@ class File implements IEntity {
|
|||
$this->urlGenerator = $urlGenerator;
|
||||
}
|
||||
|
||||
public function getId(): string {
|
||||
return 'WorkflowEngine_Entity_File';
|
||||
}
|
||||
|
||||
public function getName(): string {
|
||||
return $this->l10n->t('File');
|
||||
}
|
||||
|
|
|
@ -570,7 +570,7 @@ class Manager implements IManager, IEntityAware {
|
|||
* @since 18.0.0
|
||||
*/
|
||||
public function registerEntity(IEntity $entity): void {
|
||||
$this->registeredEntities[$entity->getId()] = $entity;
|
||||
$this->registeredEntities[get_class($entity)] = $entity;
|
||||
}
|
||||
|
||||
public function registerOperation(IOperation $operator): void {
|
||||
|
|
|
@ -131,7 +131,7 @@ abstract class ASettings implements ISettings {
|
|||
}, $entity->getEvents());
|
||||
|
||||
return [
|
||||
'id' => $entity->getId(),
|
||||
'id' => get_class($entity),
|
||||
'icon' => $entity->getIcon(),
|
||||
'name' => $entity->getName(),
|
||||
'events' => $events,
|
||||
|
|
|
@ -38,20 +38,6 @@ namespace OCP\WorkflowEngine;
|
|||
*/
|
||||
interface IEntity {
|
||||
|
||||
/**
|
||||
* returns a unique ID of the entity.
|
||||
*
|
||||
* It can be, but does not need to be the class name of the entitiy. Beware
|
||||
* that it will be referenced in the database when rules are established,
|
||||
* so it should not change over the course of the app life.
|
||||
*
|
||||
* Example 1: "OCA/MyApp/Entity/Cat"
|
||||
* Example 2: "myapp_Cats"
|
||||
*
|
||||
* @since 18.0.0
|
||||
*/
|
||||
public function getId(): string;
|
||||
|
||||
/**
|
||||
* returns a translated name to be presented in the web interface.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue