|
|
@@ -15,10 +15,10 @@ class OrganizationRepository extends BaseApiRepository
|
|
|
* Get the organization by Id
|
|
|
*
|
|
|
* @param int $id The id of the organization
|
|
|
- * @return array
|
|
|
+ * @return object
|
|
|
* @throws ApiRequestException
|
|
|
*/
|
|
|
- public function findById($id): array
|
|
|
+ public function findById($id): object
|
|
|
{
|
|
|
$params = [];
|
|
|
$params['filter[where][id]'] = $id;
|
|
|
@@ -33,17 +33,17 @@ class OrganizationRepository extends BaseApiRepository
|
|
|
* Get the organization by name
|
|
|
*
|
|
|
* @param string name The name of the organization
|
|
|
- * @return array
|
|
|
+ * @return object
|
|
|
* @throws \Exception
|
|
|
* @throws ApiRequestException
|
|
|
*/
|
|
|
- public function findByName($name): array
|
|
|
+ public function findByName($name): object
|
|
|
{
|
|
|
$params = [];
|
|
|
$params['filter[where][name]'] = $name;
|
|
|
$organization = $this->getApiFirstRecord($this::URI, $params);
|
|
|
if($organization == null) {
|
|
|
- throw new \Exception('Organization with name "' . $name . '" does not exist');
|
|
|
+ throw new ApiRequestException('Organization with name "' . $name . '" does not exist');
|
|
|
}
|
|
|
return $organization;
|
|
|
}
|