class EmpireBlogPluginExtension extends Twig_Extension

Class EmpireBlogPluginExtension is injected as alligator.blog_post_extension service. EmpireBlogPluginExtension handles the logic and provides necessary data for managed entity in twig.

Constants

YOUTUBE_EMBED_CODE

Properties

protected BlogPostManager $blogPostManager

Methods

__construct(BlogPostManager $blogPostManager)

EmpireBlogPluginExtension constructor.

getFunctions()

{@inheritdoc}

mixed
getLastNPosts(mixed $theme, mixed $locale)

Find and cache 3 last blog posts

mixed
getLastNPostsFromDB(int $numberOfItems, string|null $locale = null)

Find and cache $numberOfItems last blog posts

mixed
getEntitiesForBlockElementsExtension(array $ids)

Find blog post by array of ids

string
formatYoutubeLink(string $link)

Format YouTube link

string
getName()

Returns the name of the extension.

Details

at line 32
__construct(BlogPostManager $blogPostManager)

EmpireBlogPluginExtension constructor.

Parameters

BlogPostManager $blogPostManager

at line 40
getFunctions()

{@inheritdoc}

at line 61
mixed getLastNPosts(mixed $theme, mixed $locale)

Find and cache 3 last blog posts

Parameters

mixed $theme
mixed $locale

Return Value

mixed

See also

BlogPost

at line 75
mixed getLastNPostsFromDB(int $numberOfItems, string|null $locale = null)

Find and cache $numberOfItems last blog posts

Parameters

int $numberOfItems
string|null $locale

Return Value

mixed

See also

BlogPost

at line 88
mixed getEntitiesForBlockElementsExtension(array $ids)

Find blog post by array of ids

Parameters

array $ids

Return Value

mixed

See also

BlogPost

Format YouTube link

Parameters

string $link

Return Value

string

at line 118
string getName()

Returns the name of the extension.

Return Value

string The extension name