Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "Page body" to response #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/BigCommerce/Api/Pages/PagesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ protected function maxBatchSize(): int
private const PAGE_ENDPOINT = 'content/pages/%d';
private const PAGES_ENDPOINT = 'content/pages';
private const RESOURCE_NAME = 'pages';

public const FILTER_INCLUDE = 'include';

public function batchUpdate(array $resources): PagesResponse
{
Expand All @@ -45,9 +47,14 @@ protected function resourceName(): string
return self::RESOURCE_NAME;
}

public function get(): PageResponse
public function get(?string $include = null): PageResponse
{
return new PageResponse($this->getResource());
$params = [];

if (!is_null($include)) {
$params[self::FILTER_INCLUDE] = $include;
}
return new PageResponse($this->getResource($params));
}

public function getAll(array $filters = [], int $page = 1, int $limit = 250): PagesResponse
Expand Down