class BlogPostManager extends TranslatableManager implements JQGridInterface

Class BlogPostManager is injected as alligator.blog_post_manager service. BlogPostManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Properties

protected BlogPostRepository $repository
protected ContainerInterface $container
protected BlogCategoryRepository $blogCategoryRepository
protected BlogPostContainer $blogPostContainer

Methods

setRepositoryLocale(ContainerInterface|null $container)

Sets the repository request default locale

setRepository(mixed $repository)

No description

mixed
getLanguagesForIds(array $ids)

No description

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

No description

array
getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

array
getEntityNamesForIds(array $ids)

Get id and name of entity

__construct(BlogPostRepository $repository, ContainerInterface $container, BlogCategoryRepository $blogCategoryRepository, BlogPostContainer $blogPostContainer)

No description

object
saveBlogPost(BlogPost $blogPost)

Check for all preconditions, create references to all foreign entities and persist new blog post

array
findAllCustomForFrontendByCategory(int $page, int $offset, int $categoryId, int|null $lft = null, int|null $rgt = null)

Find all blog post for blog category using pagination

mixed
findOneById(int $id)

Find blog post by id

object
getCache()

Find cache instance

mixed
findThreeByIdCustomForSingleBlog(int $blogPostId, string $locale = null)

Find previous and next blog posts

mixed
findPrevNextCustomForIds(int $prevId, int $nextId)

Find blog posts for provided ids

editBlogPost(BlogPost $blogPost)

Check for all preconditions, create references to all foreign entities and merge blog post

array
findOneBySlugCustomForSingleBlog(string $slug, string|null $locale = null)

Find blog post by slug

array
findAll()

Find all blog posts

setNewBlogCategory(BlogPost $blogPost, BlogPost $blogPostTemp)

Change current blog category on blog post

array
deleteBlogPosts(array $blogPostIds)

Remove blog post from provided array of ids

mixed
findAllCustomForFrontend(int $page, int $offset)

Find all blog posts using pagination

array
countPostsPagination()

Count all visible blog posts

array
countPostsPaginationByCategory(int $id, int|null $lft = null, int|null $rgt = null)

Count all visible blog posts for blog category

mixed
getLastNPosts(string $theme, string $locale)

Find cached or set to cache last 3 blog posts

mixed
setLastNBlogPostForFrontend(mixed $theme, string $locale)

Find and set to cache last 3 blog posts

array
getLastNPostsFromDB(int $itemsNumber, mixed $locale = null)

Find $itemsNumber number of last blog posts

dispatchTeeGenerateSignal(string $locale)

Dispatch signal to re-cache blog category tree structure

dispatchSidebarBlogsEvent(string $theme, string $locale)

Dispatch signal to re-cache sidebar blog posts

dispatchBlogNewsSignalEvent(string $theme, string $locale)

Dispatch signal to re-cache blog posts

array|string
getAllTreeCategoriesForCategoryAddTree(string|null $locale = null)

Find blog category tree structure

array
getAllLocales()

Find all locales

setDataToCache(string $data, string $locale)

Set data to cache

dispatchMenuUpdateRemoveSignal(int $id, string $slug, string|null $name = null)

Dispatch signal to re-cache menu items

mixed
findCategoryBySlug(string $slug, string|null $locale = null)

Find blog category by slug

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

Find all blog posts for provided blog category parent id

dispatchBlogPostActionEvent(BlogPost $blogPost)

Dispatch blog post action (save, edit) event

getLanguageRelatedEntity($slug, $locale)

No description

Details

in TranslatableManager at line 30
setRepositoryLocale(ContainerInterface|null $container)

Sets the repository request default locale

Parameters

ContainerInterface|null $container

Exceptions

InvalidArgumentException if repository is not an instance of TranslatableRepository

in TranslatableManager at line 63
setRepository(mixed $repository)

Parameters

mixed $repository

in TranslatableManager at line 73
mixed getLanguagesForIds(array $ids)

Parameters

array $ids

Return Value

mixed

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 53
mixed getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

Parameters

array|null $searchParams
array|null $sortParams
array|null $additionalParams
JQGridWrapper|null $jqGridWrapper

Return Value

mixed

array getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

Parameters

array $ids

Return Value

array

array getEntityNamesForIds(array $ids)

Get id and name of entity

Parameters

array $ids

Return Value

array

at line 63
__construct(BlogPostRepository $repository, ContainerInterface $container, BlogCategoryRepository $blogCategoryRepository, BlogPostContainer $blogPostContainer)

Parameters

BlogPostRepository $repository
ContainerInterface $container
BlogCategoryRepository $blogCategoryRepository
BlogPostContainer $blogPostContainer

at line 79
object saveBlogPost(BlogPost $blogPost)

Check for all preconditions, create references to all foreign entities and persist new blog post

Parameters

BlogPost $blogPost

Return Value

object

Exceptions

ORMException

at line 125
array findAllCustomForFrontendByCategory(int $page, int $offset, int $categoryId, int|null $lft = null, int|null $rgt = null)

Find all blog post for blog category using pagination

Parameters

int $page
int $offset
int $categoryId
int|null $lft
int|null $rgt

Return Value

array

See also

BlogPost

at line 138
mixed findOneById(int $id)

Find blog post by id

Parameters

int $id

Return Value

mixed

See also

BlogPost

at line 147
object getCache()

Find cache instance

Return Value

object

at line 161
mixed findThreeByIdCustomForSingleBlog(int $blogPostId, string $locale = null)

Find previous and next blog posts

Parameters

int $blogPostId
string $locale

Return Value

mixed

See also

BlogPost

at line 184
mixed findPrevNextCustomForIds(int $prevId, int $nextId)

Find blog posts for provided ids

Parameters

int $prevId
int $nextId

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

See also

BlogPost

at line 197
stdClass editBlogPost(BlogPost $blogPost)

Check for all preconditions, create references to all foreign entities and merge blog post

Parameters

BlogPost $blogPost

Return Value

stdClass

Exceptions

ORMException

at line 262
array findOneBySlugCustomForSingleBlog(string $slug, string|null $locale = null)

Find blog post by slug

Parameters

string $slug
string|null $locale

Return Value

array

See also

BlogPost

at line 273
array findAll()

Find all blog posts

Return Value

array

See also

BlogPost

at line 288
BlogPost setNewBlogCategory(BlogPost $blogPost, BlogPost $blogPostTemp)

Change current blog category on blog post

Parameters

BlogPost $blogPost
BlogPost $blogPostTemp

Return Value

BlogPost

See also

BlogPost
BlogCategory

at line 311
array deleteBlogPosts(array $blogPostIds)

Remove blog post from provided array of ids

Parameters

array $blogPostIds

Return Value

array

Exceptions

ORMException
OptimisticLockException

See also

BlogPost

at line 344
mixed findAllCustomForFrontend(int $page, int $offset)

Find all blog posts using pagination

Parameters

int $page
int $offset

Return Value

mixed

See also

BlogPost

at line 355
array countPostsPagination()

Count all visible blog posts

Return Value

array

See also

BlogPost

at line 371
array countPostsPaginationByCategory(int $id, int|null $lft = null, int|null $rgt = null)

Count all visible blog posts for blog category

Parameters

int $id
int|null $lft
int|null $rgt

Return Value

array

See also

BlogPost
BlogCategory

at line 387
mixed getLastNPosts(string $theme, string $locale)

Find cached or set to cache last 3 blog posts

Parameters

string $theme
string $locale

Return Value

mixed

Exceptions

Error

See also

BlogPost

at line 407
mixed setLastNBlogPostForFrontend(mixed $theme, string $locale)

Find and set to cache last 3 blog posts

Parameters

mixed $theme
string $locale

Return Value

mixed

Exceptions

Error

See also

BlogPost

at line 438
array getLastNPostsFromDB(int $itemsNumber, mixed $locale = null)

Find $itemsNumber number of last blog posts

Parameters

int $itemsNumber
mixed $locale

Return Value

array

See also

BlogPost

at line 447
dispatchTeeGenerateSignal(string $locale)

Dispatch signal to re-cache blog category tree structure

Parameters

string $locale

at line 457
dispatchSidebarBlogsEvent(string $theme, string $locale)

Dispatch signal to re-cache sidebar blog posts

Parameters

string $theme
string $locale

at line 468
dispatchBlogNewsSignalEvent(string $theme, string $locale)

Dispatch signal to re-cache blog posts

Parameters

string $theme
string $locale

at line 479
array|string getAllTreeCategoriesForCategoryAddTree(string|null $locale = null)

Find blog category tree structure

Parameters

string|null $locale

Return Value

array|string

at line 488
array getAllLocales()

Find all locales

Return Value

array

at line 498
setDataToCache(string $data, string $locale)

Set data to cache

Parameters

string $data
string $locale

at line 509
dispatchMenuUpdateRemoveSignal(int $id, string $slug, string|null $name = null)

Dispatch signal to re-cache menu items

Parameters

int $id
string $slug
string|null $name

at line 526
mixed findCategoryBySlug(string $slug, string|null $locale = null)

Find blog category by slug

Parameters

string $slug
string|null $locale

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

See also

BlogCategory

at line 542
mixed getIsotopeCategories(int $id, string $locale, object|null $additionalData = null)

Find all blog posts for provided blog category parent id

Parameters

int $id
string $locale
object|null $additionalData

Return Value

mixed

See also

BlogPost
BlogCategory

at line 551
dispatchBlogPostActionEvent(BlogPost $blogPost)

Dispatch blog post action (save, edit) event

Parameters

BlogPost $blogPost

at line 559
getLanguageRelatedEntity($slug, $locale)

Parameters

$slug
$locale