remove IEntity's getId in favor of class name

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2019-08-27 17:40:00 +02:00
parent 4c2fdbb908
commit 26b19b73a4
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
4 changed files with 2 additions and 20 deletions

View File

@ -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');
}

View 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 {

View File

@ -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,

View File

@ -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.
*