BlogService
extends BlogService
in package
Uses
ServiceTrait, SetRelatedItemsTrait
This is the BlogService class.
Remember that a service is an extension of a SDK model that allows to add additional actions to a model request or create new methods to simplify some common requests. In this case, the BlogService extends the SDK\Services\BlogService.
Tags
Table of Contents
addGetBlogCategoryById() | This method adds the batch request to get the blog post whose id matches the given one. | : void |
---|---|---|
addGetBlogPostById() | This method adds the batch request to get the blog post whose id matches the given one. | : void |
addGetBlogPostByPId() | This method adds the batch request to get the blog post whose pId matches the given one. | : void |
addGetBlogPostsByIdList() | This method adds the batch request to get those blog spots whose id matches any of the given idList. | : void |
buildElementCollection() | This method returns and ElementCollection from the given data and class | : bool |
generateParametersGroupFromArray() | This method sets a parametersGroup object with the filters indicated in params (array key=>value). | : array<string|int, mixed> |
getAllTags() | Returns all blog tags filtered with the given parameters | : ElementCollection|null |
getBlogCategoryById() | This method returns the Dto of the blog category whose Id matches the given one. | : BlogCategory|null |
getBlogPostById() | This method returns the Dto of the blog post whose id matches the given one. | : BlogPost|null |
getBlogPostByPId() | This method returns the Dto of the blog post whose pId matches the given one. | : BlogPost|null |
getBlogPostsByIdList() | This method returns the Dtos of those blog posts whose id matches any of the given list. | : ElementCollection|null |
validateParameterGroup() | This method validates the given parametersGroup. Returns true if valid, false otherwise. | : bool |
getAllElementCollectionItems() | Returns all available items filtered with the given parameters | : ElementCollection|null |
Methods
addGetBlogCategoryById()
This method adds the batch request to get the blog post whose id matches the given one.
public
addGetBlogCategoryById(BatchRequests $batchRequests, string $batchName, int $id) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $id : int
Return values
void —addGetBlogPostById()
This method adds the batch request to get the blog post whose id matches the given one.
public
addGetBlogPostById(BatchRequests $batchRequests, string $batchName, int $id) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $id : int
Return values
void —addGetBlogPostByPId()
This method adds the batch request to get the blog post whose pId matches the given one.
public
addGetBlogPostByPId(BatchRequests $batchRequests, string $batchName, string $pId) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $pId : string
Return values
void —addGetBlogPostsByIdList()
This method adds the batch request to get those blog spots whose id matches any of the given idList.
public
addGetBlogPostsByIdList(BatchRequests $batchRequests, string $batchName, string $idList) : void
Parameters
- $batchRequests : BatchRequests
- $batchName : string
-
the name that will identify the request on the batch return.
- $idList : string
Return values
void —buildElementCollection()
This method returns and ElementCollection from the given data and class
public
buildElementCollection(array<string|int, mixed> $data, string $class) : bool
Parameters
- $data : array<string|int, mixed>
- $class : string
Return values
bool —generateParametersGroupFromArray()
This method sets a parametersGroup object with the filters indicated in params (array key=>value).
public
generateParametersGroupFromArray(ParametersGroup &$parametersGroup, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $parametersGroup : ParametersGroup
- $params : array<string|int, mixed>
Return values
array<string|int, mixed> —with the applied filters
getAllTags()
Returns all blog tags filtered with the given parameters
public
getAllTags([BlogTagParametersGroup $params = null ]) : ElementCollection|null
Parameters
- $params : BlogTagParametersGroup = null
-
object with the needed filters to send to the API blogs resource
Return values
ElementCollection|null —getBlogCategoryById()
This method returns the Dto of the blog category whose Id matches the given one.
public
getBlogCategoryById(int $pId) : BlogCategory|null
Parameters
- $pId : int
Return values
BlogCategory|null —getBlogPostById()
This method returns the Dto of the blog post whose id matches the given one.
public
getBlogPostById(int $id) : BlogPost|null
Parameters
- $id : int
Return values
BlogPost|null —getBlogPostByPId()
This method returns the Dto of the blog post whose pId matches the given one.
public
getBlogPostByPId(string $pId) : BlogPost|null
Parameters
- $pId : string
Return values
BlogPost|null —getBlogPostsByIdList()
This method returns the Dtos of those blog posts whose id matches any of the given list.
public
getBlogPostsByIdList(string $idList) : ElementCollection|null
Parameters
- $idList : string
Return values
ElementCollection|null —validateParameterGroup()
This method validates the given parametersGroup. Returns true if valid, false otherwise.
public
validateParameterGroup(ParametersGroup $parametersGroup) : bool
Parameters
- $parametersGroup : ParametersGroup
Return values
bool —getAllElementCollectionItems()
Returns all available items filtered with the given parameters
protected
getAllElementCollectionItems(string $elementClass, string $resource, ParametersGroup $params) : ElementCollection|null
Parameters
- $elementClass : string
- $resource : string
- $params : ParametersGroup
-
object with the needed filters to send to the API resource