Reorganized API exposed entities

This commit is contained in:
Bernd Bestel
2020-12-12 10:10:21 +01:00
parent f07a21b00b
commit d3883ba93a
4 changed files with 34 additions and 45 deletions

View File

@@ -26,7 +26,7 @@ class UserfieldsService extends BaseService
public function GetAllValues($entity)
{
if (!$this->IsValidEntity($entity))
if (!$this->IsValidExposedEntity($entity))
{
throw new \Exception('Entity does not exist or is not exposed');
}
@@ -60,7 +60,7 @@ class UserfieldsService extends BaseService
public function GetFields($entity)
{
if (!$this->IsValidEntity($entity))
if (!$this->IsValidExposedEntity($entity))
{
throw new \Exception('Entity does not exist or is not exposed');
}
@@ -70,7 +70,7 @@ class UserfieldsService extends BaseService
public function GetValues($entity, $objectId)
{
if (!$this->IsValidEntity($entity))
if (!$this->IsValidExposedEntity($entity))
{
throw new \Exception('Entity does not exist or is not exposed');
}
@@ -88,7 +88,7 @@ class UserfieldsService extends BaseService
public function SetValues($entity, $objectId, $userfields)
{
if (!$this->IsValidEntity($entity))
if (!$this->IsValidExposedEntity($entity))
{
throw new \Exception('Entity does not exist or is not exposed');
}
@@ -139,7 +139,7 @@ class UserfieldsService extends BaseService
return $this->OpenApiSpec;
}
private function IsValidEntity($entity)
private function IsValidExposedEntity($entity)
{
return in_array($entity, $this->GetEntities());
}