Skip to content

Commit

Permalink
Throw exception in setInitialApiProducts for edit
Browse files Browse the repository at this point in the history
  • Loading branch information
phdhiren committed Mar 10, 2023
1 parent 2d978d2 commit c396a9a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Api/Management/Entity/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,19 @@ public function getApiProducts(): array
}

/**
* Set Initial API Product while creating App.
* Set Initial API Product while creating App only.
* The method is not supported to update existing App.
*
* @param array $initialApiProducts
*
* @throws \Exception If used to update existing App.
*/
public function setInitialApiProducts(array $initialApiProducts): void
{
$this->initialApiProducts = $initialApiProducts;
if (!$this->appId) {
$this->initialApiProducts = $initialApiProducts;
} else {
throw new \Exception('This method is not supported to update existing App.');
}
}
}

0 comments on commit c396a9a

Please sign in to comment.