RelatedItemsTrait
This is the main Related items trait.
The way a object should connect to the API and get related items will be stted in this trait.
Tags
Table of Contents
addGetRelatedItems() | Add the request to get the related items assigned to the given item id | : void |
---|---|---|
getRelatedItems() | Returns the related items assigned to the given item id | : ElementCollection|null |
Methods
addGetRelatedItems()
Add the request to get the related items assigned to the given item id
public
addGetRelatedItems(BatchRequests $batchRequests, string $batchName, int $id[, string $type = '' ][, RelatedItemsParametersGroup $params = null ]) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $id : int
- $type : string = ''
-
Optional. This param will set the kind of related we want to retrieve. Valid values are inside RelatedItemsType class. If not given all the related items will be returned inside the RelatedItems object.
- $params : RelatedItemsParametersGroup = null
-
object with the needed filters to send to the API resource
Tags
Return values
void —getRelatedItems()
Returns the related items assigned to the given item id
public
getRelatedItems(int $id[, string $type = '' ][, RelatedItemsParametersGroup $params = null ]) : ElementCollection|null
Parameters
- $id : int
- $type : string = ''
-
Optional. This param will set the kind of related we want to retrieve. Valid values are inside RelatedItemsType class. If not given all the related items will be returned inside the RelatedItems object.
- $params : RelatedItemsParametersGroup = null
-
object with the needed filters to send to the API resource