How to query item sets in php api?

Hello, i am developing a block-layout plugin and, under the view/common/block-layout/item-sets-graph-block.phtml i would like to query item sets based based on the ids i pass through a variable in the form function.

using $this->api() i can easily get the json of an item, e.g. :

$itemSetData = $this->api()->read('items', $itemId)->getContent();

but how can i get the json of an item set? I am missing which additional parameters are needed.

Basically i would like to get a json in the template containing the items included and the information regarding the item set. Just like if i were to query the Rest Api like this:


Thanks in advance!

ah, i can achieve that by $response = $this->api()->search('items', ['item_set_id' => $itemId]);

But will it be paginated?

The PHP API’s search doesn’t paginate by default. You can pass page to get this behavior, or limit.

1 Like