diff --git a/modules/apigee_edge_teams/src/Entity/Controller/TeamAppController.php b/modules/apigee_edge_teams/src/Entity/Controller/TeamAppController.php index 9f747338..cd341bcf 100644 --- a/modules/apigee_edge_teams/src/Entity/Controller/TeamAppController.php +++ b/modules/apigee_edge_teams/src/Entity/Controller/TeamAppController.php @@ -20,6 +20,7 @@ namespace Drupal\apigee_edge_teams\Entity\Controller; +use Apigee\Edge\Api\ApigeeX\Controller\AppByOwnerControllerInterface as XAppByOwnerControllerInterface; use Apigee\Edge\Api\ApigeeX\Controller\AppGroupAppController as EdgeAppGroupAppController; use Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface as EdgeAppByOwnerControllerInterface; use Apigee\Edge\Api\Management\Controller\CompanyAppController as EdgeCompanyAppController; @@ -28,14 +29,14 @@ /** * Definition of the Team app controller service. * - * We call company apps as team apps in Drupal. + * We call company/appgroup apps as team apps in Drupal. */ final class TeamAppController extends AppByOwnerController implements TeamAppControllerInterface { /** * {@inheritdoc} */ - protected function decorated(): EdgeAppByOwnerControllerInterface { + protected function decorated(): EdgeAppByOwnerControllerInterface|XAppByOwnerControllerInterface { if (!isset($this->instances[$this->owner])) { // Checks whether the organization is Edge or ApigeeX organization. if ($this->organizationController->isOrganizationApigeeX()) { @@ -57,4 +58,13 @@ public function getCompanyName(): string { return $decorated->getCompanyName(); } + /** + * {@inheritdoc} + */ + public function getAppGroup(): string { + /** @var \Apigee\Edge\Api\ApigeeX\Controller\AppGroupAppControllerInterface $decorated */ + $decorated = $this->decorated(); + return $decorated->getAppGroup(); + } + } diff --git a/src/Entity/Controller/AppByOwnerController.php b/src/Entity/Controller/AppByOwnerController.php index d45d3ecb..c31c3127 100644 --- a/src/Entity/Controller/AppByOwnerController.php +++ b/src/Entity/Controller/AppByOwnerController.php @@ -20,6 +20,7 @@ namespace Drupal\apigee_edge\Entity\Controller; +use Apigee\Edge\Api\ApigeeX\Controller\AppByOwnerControllerInterface as XAppByOwnerControllerInterface; use Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface; use Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface as EdgeAppByOwnerControllerInterface; use Apigee\Edge\Entity\EntityInterface; @@ -31,7 +32,7 @@ use Drupal\apigee_edge\SDKConnectorInterface; /** - * Base class for developer- and company app controller services in Drupal. + * Base class for developer- and company/appgroup app controller services in Drupal. */ abstract class AppByOwnerController extends AppControllerBase implements AppByOwnerControllerInterface { @@ -51,7 +52,7 @@ abstract class AppByOwnerController extends AppControllerBase implements AppByOw /** * The owner of an app. * - * It could be a developer's email address, uuid or a company's company name. + * It could be a developer's email address, uuid or a company's or appgroup's company/appgroup name. * * @var string */ @@ -75,7 +76,7 @@ abstract class AppByOwnerController extends AppControllerBase implements AppByOw * AppByOwnerController constructor. * * @param string $owner - * A developer's email address, uuid or a company's company name. + * A developer's email address, uuid or a company's or appgroup's company/appgroup name. * @param \Drupal\apigee_edge\SDKConnectorInterface $connector * The SDK connector service. * @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller @@ -95,12 +96,12 @@ public function __construct(string $owner, SDKConnectorInterface $connector, Org } /** - * Returns the decorated developer- or company app controller. + * Returns the decorated developer- or company/appgroup app controller. * - * @return \Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface - * The initialized developer- or company app controller. + * @return \Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface|Apigee\Edge\Api\ApigeeX\Controller\AppByOwnerControllerInterface + * The initialized developer- or company/appgroup app controller. */ - abstract protected function decorated() : EdgeAppByOwnerControllerInterface; + abstract protected function decorated() : EdgeAppByOwnerControllerInterface|XAppByOwnerControllerInterface; /** * {@inheritdoc}