Skip to content

Commit

Permalink
Do not inherit useless methods from EntityCrudOperationsControllerTrait.
Browse files Browse the repository at this point in the history
  • Loading branch information
mxr576 committed Jul 17, 2018
1 parent 54e518e commit fcddaeb
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions src/Api/Management/Controller/AppCredentialController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Apigee\Edge\Api\Management\Entity\AppCredentialInterface;
use Apigee\Edge\Api\Management\Normalizer\AppCredentialNormalizer;
use Apigee\Edge\Controller\EntityController;
use Apigee\Edge\Controller\EntityCrudOperationsControllerTrait;
use Apigee\Edge\Controller\StatusAwareEntityControllerTrait;
use Apigee\Edge\Denormalizer\AttributesPropertyDenormalizer;
use Apigee\Edge\Denormalizer\CredentialProductDenormalizer;
Expand All @@ -36,12 +35,6 @@
abstract class AppCredentialController extends EntityController implements AppCredentialControllerInterface
{
use AttributesAwareEntityControllerTrait;
use EntityCrudOperationsControllerTrait {
// These methods are not supported on this endpoint in the same way as on the others so do not allow to
// use them here.
create as private privateCreate;
update as private privateUpdate;
}
use StatusAwareEntityControllerTrait;

/**
Expand Down Expand Up @@ -176,6 +169,34 @@ public function overrideScopes(string $consumerKey, array $scopes): AppCredentia
);
}

/**
* {@inheritdoc}
*/
public function load(string $entityId): EntityInterface
{
$response = $this->client->get($this->getEntityEndpointUri($entityId));

return $this->entityTransformer->deserialize(
(string) $response->getBody(),
$this->getEntityClass(),
'json'
);
}

/**
* {@inheritdoc}
*/
public function delete(string $entityId): EntityInterface
{
$response = $this->client->delete($this->getEntityEndpointUri($entityId));

return $this->entityTransformer->deserialize(
(string) $response->getBody(),
$this->getEntityClass(),
'json'
);
}

/**
* @inheritdoc
*/
Expand Down

0 comments on commit fcddaeb

Please sign in to comment.