class DeclarationManager extends TranslatableManager implements JQGridInterface

Class DeclarationManager is injected as empire_declaration_plugin.declaration_manager service. DeclarationManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Properties

protected DeclarationRepository $repository

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(DeclarationRepository $repository, DeclarationCategoryRepository $categoryRepository, DeclarationCategoryContainer $container)

DeclarationManager constructor.

mixed
findOneByIdCustom(int $id)

Find declaration(as array) by id

array|string
getAllTreeCategoriesForCategoryAddTree(string $locale = null)

No description

array
categoriesAll()

Find all categories(as array)

mixed
saveItem(Declaration $declaration)

Persist new Declaration

mixed
editItem(Declaration $declaration)

Updating existed Declaration

setNewCategory(DeclarationCategory|null $old, DeclarationCategory|null $new, Declaration $dec)

Change category of declaration

array
deleteItems(array $itemsId)

Remove all declarations that match provided ids

dispatchDecTreeGenerateSignal(string|null $locale)

Dispatch event for re-caching declaration category tree

deleteResultCaches()

Delete all cached results for declarations used in block elements

array
searchDeclarationsByName(string $searchTerm, array $params)

Find declaration(as array) with provided name

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

at line 264
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 55
__construct(DeclarationRepository $repository, DeclarationCategoryRepository $categoryRepository, DeclarationCategoryContainer $container)

DeclarationManager constructor.

Parameters

DeclarationRepository $repository
DeclarationCategoryRepository $categoryRepository
DeclarationCategoryContainer $container

at line 69
mixed findOneByIdCustom(int $id)

Find declaration(as array) by id

Parameters

int $id

Return Value

mixed

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

Parameters

string $locale

Return Value

array|string

at line 89
array categoriesAll()

Find all categories(as array)

Return Value

array

at line 103
mixed saveItem(Declaration $declaration)

Persist new Declaration

Parameters

Declaration $declaration

Return Value

mixed

Exceptions

ORMException

at line 142
mixed editItem(Declaration $declaration)

Updating existed Declaration

Parameters

Declaration $declaration

Return Value

mixed

Exceptions

ORMException

at line 197
setNewCategory(DeclarationCategory|null $old, DeclarationCategory|null $new, Declaration $dec)

Change category of declaration

Parameters

DeclarationCategory|null $old
DeclarationCategory|null $new
Declaration $dec

at line 226
array deleteItems(array $itemsId)

Remove all declarations that match provided ids

Parameters

array $itemsId

Return Value

array

Exceptions

ORMException
OptimisticLockException

at line 254
DecSignalTreeEvent dispatchDecTreeGenerateSignal(string|null $locale)

Dispatch event for re-caching declaration category tree

Parameters

string|null $locale

Return Value

DecSignalTreeEvent

at line 272
deleteResultCaches()

Delete all cached results for declarations used in block elements

at line 285
array searchDeclarationsByName(string $searchTerm, array $params)

Find declaration(as array) with provided name

Parameters

string $searchTerm
array $params

Return Value

array