Jinya CMS

BlogCategory extends Entity
in package
implements JsonSerializable

This class contains a blog category, blog categories can have child categories and have blog posts.

Categories can contain a webhook URL, this URL is triggered with a POST request whenever a post is created or updated.

Tags

Interfaces, Classes, Traits and Enums

JsonSerializable

Table of Contents

$description  : string|null
$id  : int
$name  : string
$parentId  : int|null
$webhookEnabled  : bool
$webhookUrl  : string|null
format()  : array<string, int|string|null|mixed|bool>
Formats the blog category
getBlogPosts()  : Iterator<string|int, BlogPost>
Gets all blog posts in the current category
getParent()  : BlogCategory|null
Gets the category parent category, if it has no parent, the result is null
jsonSerialize()  : mixed

Properties

$description

public string|null $description = null

The description of the category

Tags

$name

public string $name = ''

The name of the category

Tags

$parentId

public int|null $parentId = null

The ID of the parent category

Tags

$webhookEnabled

public bool $webhookEnabled = false

Indicates whether the blog post triggers a webhook on create and update

Tags

$webhookUrl

public string|null $webhookUrl = ''

The URL for the webhook to trigger

Tags

Methods

format()

Formats the blog category

public format() : array<string, int|string|null|mixed|bool>
Tags
Return values
array<string, int|string|null|mixed|bool>

getBlogPosts()

Gets all blog posts in the current category

public getBlogPosts([bool $includeChildCategories = false ][, bool $onlyPublic = false ]) : Iterator<string|int, BlogPost>
Parameters
$includeChildCategories : bool = false

If true, also posts from child categories are selected

$onlyPublic : bool = false

If true, only public posts are selected

Tags
Return values
Iterator<string|int, BlogPost>

jsonSerialize()

public jsonSerialize() : mixed
Tags
Return values
mixed

Search results