can get endpoints raw element, get entity by a separate call

This commit is contained in:
2025-01-04 22:37:16 +01:00
parent 55bad44a22
commit a88bb6d33f
12 changed files with 64 additions and 29 deletions

View File

@ -47,14 +47,20 @@ class SubscriptionProcess extends Model
/**
* @throws BaseException
*/
public function get(string $listId): SubscriptionEntity
public function get(string $listId): array
{
$data = $this->connection->requestAndParse(
return $this->connection->requestAndParse(
'GET',
'list/'.urlencode(trim($listId)).'.json'
);
}
return new SubscriptionEntity($data);
/**
* @throws BaseException
*/
public function getEntity(string $listId): SubscriptionEntity
{
return new SubscriptionEntity($this->get($listId), $this);
}
/**