class BlogCategoryExtension extends Twig_Extension

Class BlogCategoryExtension is injected as twig.extension.blog.category service. BlogCategoryExtension handles the logic and provides necessary data for managed entity in twig.

Properties

protected BlogCategoryManager $categoryManager

Methods

__construct(BlogCategoryManager $categoryManager)

Constructor

getFunctions()

{@inheritdoc}

array|mixed
getTreeCategories(string $locale)

Find and cache blog categories

mixed
getNewsFromCache(string $theme, string $locale)

Find blog posts

setTreeCategoriesToCache(string $locale)

Find and cache blog categories

array
getCategoryWithNPosts(array $ids, int $numbOfPosts)

Find blog category with blog posts

mixed
getIsotopeCategories(int $id, string $locale = null)

Find all blog posts for provided blog category parent id

string
getName()

Returns the name of the extension.

Details

at line 37
__construct(BlogCategoryManager $categoryManager)

Constructor

Parameters

BlogCategoryManager $categoryManager

at line 45
getFunctions()

{@inheritdoc}

at line 63
array|mixed getTreeCategories(string $locale)

Find and cache blog categories

Parameters

string $locale

Return Value

array|mixed

See also

BlogCategory

at line 82
mixed getNewsFromCache(string $theme, string $locale)

Find blog posts

Parameters

string $theme
string $locale

Return Value

mixed

See also

BlogPost

at line 93
setTreeCategoriesToCache(string $locale)

Find and cache blog categories

Parameters

string $locale

See also

BlogCategory

at line 110
array getCategoryWithNPosts(array $ids, int $numbOfPosts)

Find blog category with blog posts

Parameters

array $ids
int $numbOfPosts

Return Value

array

See also

BlogCategory
BlogPost

at line 125
mixed getIsotopeCategories(int $id, string $locale = null)

Find all blog posts for provided blog category parent id

Parameters

int $id
string $locale

Return Value

mixed

See also

BlogCategory
BlogPost

at line 135
string getName()

Returns the name of the extension.

Return Value

string The extension name