class BlockElementsManager implements BasicEntityManagerInterface, JQGridInterface

Class BlockElementsManager is injected as empire_block_elements.manager service. BlockElementsManager handles the logic for entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Constants

VIEWS_DIR

Path to views directory

GENERATED_TEMPLATES_DIR

Path to directory where generated blocks are stored

Properties

protected BlockElementsRepository $repository
protected BlockElementsEventContainer $eventContainer
protected BlockElementsTemplatesManager $templatesManager

Methods

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(BlockElementsRepository $repository, BlockElementsEventContainer $eventContainer, BlockElementsTemplatesManager $templatesManager)

BlockElementsManager constructor.

getBlockElement(int $id)

Get single BlockElement by id

array
getBlockElementByLocation(string $location, string $entityName)

Find all block elements for location and entity name

array
getBlockElementSimple(int $id)

Get block element data for specified id

array
saveBlockElement(BlockElement $blockElement)

Save and generate BlockElement

array
editBlockElement(BlockElement $newBlockElement)

Edit block element

string
generateFileName(string $entity, string $title, null $algorithmParams = null)

Generate unique file name base on entity, title and algorithm params

bool|string
createLayoutTwig(BlockElement $blockElement, string $generatedName, bool $checkLayoutNameUnique = true)

Create rendered block element

dispatchBlockElementsContentEvent(array $paramBag)

Dispatch event that returns content for block element

bool|string
deleteBlockElements(array $ids)

Delete multiple block elements based on array of ids

array
getAllBlocks()

No description

array
getAvailableTemplates()

Get all templates available for selection

array
getAvailableEntities()

Get all entities available for block elements

array
getPluginsAlgorithms(null|string $entity = null)

Get all available algorithms for entity

array
getAlgorithmParams(mixed $entity, mixed $algorithmKey)

Get params for algorithm and entity

array
getBrands(array $ids)

Get brands for ids

QueryBuilder
searchProducts(mixed $searchParam, mixed $page, mixed $offset, mixed $ignoreIds)

Search all products for params

array
getProductsByIds(array $ids)

Get product from db for ids

mixed
getCurrentThemeName()

No description

array
getProductsByAlgorithm(string $algorithm, int $numberOfProducts)

Get products for specified ids

array
getBrandsFromCache(array $ids)

Get brands for array of ids

array
getCategoriesFromCache(array $ids)

Get categories for array of ids

array
getAttributeValuesFromCache(array $ids)

Get attribute collection for array of ids

array
getPluginEntityNames(string $entity, array $ids)

Get id and name for specified entities

array|mixed
getAllLayouts()

No description

string
getImageLink(string $entity)

get images for entity

array
refreshLayouts()

Refresh all layouts

array
getAllBlocksForPageBuilder()

Get array of all block elements

object|Twig_Environment
getTwigLoader()

Get twig loader

object
getTemplatingEngine()

Get templating engine

array
findByEntity(string $entity)

Get all Block elements for specified entity

BlockElement|string
handleEntityDeletedEvent(BlockElement $blockElement)

Edit Block Element

bool
addNewCustomLayout(string $layout)

Add custom layout

array
findBlocksByTheme(string|int $theme)

Get all blocks for theme, param can be theme name of theme id

array
getBlocksForTmce(array $params)

Get all block elements for defined params

array
findBlockByLayoutTitle(string $title)

Get all Block elements for specified layout title

array
exportBlockElements(array|null $blocks)

Get list of block, active blocks and active plugins for export

bool|string
importBlockElements(string $file, string $name)

Import block elements from file

array
getEntityRelationshipNames()

Get names for all entity relationships

array
getTemplatesForEntity(string $entity)

Get all templates for specified entity

Details

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 65
__construct(BlockElementsRepository $repository, BlockElementsEventContainer $eventContainer, BlockElementsTemplatesManager $templatesManager)

BlockElementsManager constructor.

Parameters

BlockElementsRepository $repository
BlockElementsEventContainer $eventContainer
BlockElementsTemplatesManager $templatesManager

at line 78
BlockElement getBlockElement(int $id)

Get single BlockElement by id

Parameters

int $id

Return Value

BlockElement

at line 90
array getBlockElementByLocation(string $location, string $entityName)

Find all block elements for location and entity name

Parameters

string $location
string $entityName

Return Value

array

at line 103
array getBlockElementSimple(int $id)

Get block element data for specified id

Parameters

int $id

Return Value

array

Exceptions

NonUniqueResultException

at line 116
array saveBlockElement(BlockElement $blockElement)

Save and generate BlockElement

Parameters

BlockElement $blockElement

Return Value

array

Exceptions

NonUniqueResultException

at line 177
array editBlockElement(BlockElement $newBlockElement)

Edit block element

Parameters

BlockElement $newBlockElement

Return Value

array

Exceptions

NonUniqueResultException

at line 270
string generateFileName(string $entity, string $title, null $algorithmParams = null)

Generate unique file name base on entity, title and algorithm params

Parameters

string $entity
string $title
null $algorithmParams

Return Value

string

at line 283
bool|string createLayoutTwig(BlockElement $blockElement, string $generatedName, bool $checkLayoutNameUnique = true)

Create rendered block element

Parameters

BlockElement $blockElement
string $generatedName
bool $checkLayoutNameUnique

Return Value

bool|string

at line 371
EventWithResult dispatchBlockElementsContentEvent(array $paramBag)

Dispatch event that returns content for block element

Parameters

array $paramBag

Return Value

EventWithResult

at line 382
bool|string deleteBlockElements(array $ids)

Delete multiple block elements based on array of ids

Parameters

array $ids

Return Value

bool|string

at line 425
array getAllBlocks()

Return Value

array

at line 434
array getAvailableTemplates()

Get all templates available for selection

Return Value

array

at line 472
array getAvailableEntities()

Get all entities available for block elements

Return Value

array

at line 495
array getPluginsAlgorithms(null|string $entity = null)

Get all available algorithms for entity

Parameters

null|string $entity

Return Value

array

at line 507
array getAlgorithmParams(mixed $entity, mixed $algorithmKey)

Get params for algorithm and entity

Parameters

mixed $entity
mixed $algorithmKey

Return Value

array

at line 518
array getBrands(array $ids)

Get brands for ids

Parameters

array $ids

Return Value

array

at line 532
QueryBuilder searchProducts(mixed $searchParam, mixed $page, mixed $offset, mixed $ignoreIds)

Search all products for params

Parameters

mixed $searchParam
mixed $page
mixed $offset
mixed $ignoreIds

Return Value

QueryBuilder

at line 545
array getProductsByIds(array $ids)

Get product from db for ids

Parameters

array $ids

Return Value

array

at line 553
mixed getCurrentThemeName()

Return Value

mixed

at line 565
array getProductsByAlgorithm(string $algorithm, int $numberOfProducts)

Get products for specified ids

Parameters

string $algorithm
int $numberOfProducts

Return Value

array

at line 576
array getBrandsFromCache(array $ids)

Get brands for array of ids

Parameters

array $ids

Return Value

array

at line 587
array getCategoriesFromCache(array $ids)

Get categories for array of ids

Parameters

array $ids

Return Value

array

at line 598
array getAttributeValuesFromCache(array $ids)

Get attribute collection for array of ids

Parameters

array $ids

Return Value

array

at line 610
array getPluginEntityNames(string $entity, array $ids)

Get id and name for specified entities

Parameters

string $entity
array $ids

Return Value

array

at line 625
array|mixed getAllLayouts()

Return Value

array|mixed

get images for entity

Parameters

string $entity

Return Value

string

at line 659
array refreshLayouts()

Refresh all layouts

Return Value

array

at line 684
array getAllBlocksForPageBuilder()

Get array of all block elements

Return Value

array

at line 693
object|Twig_Environment getTwigLoader()

Get twig loader

Return Value

object|Twig_Environment

at line 702
object getTemplatingEngine()

Get templating engine

Return Value

object

at line 713
array findByEntity(string $entity)

Get all Block elements for specified entity

Parameters

string $entity

Return Value

array

at line 724
BlockElement|string handleEntityDeletedEvent(BlockElement $blockElement)

Edit Block Element

Parameters

BlockElement $blockElement

Return Value

BlockElement|string

at line 740
bool addNewCustomLayout(string $layout)

Add custom layout

Parameters

string $layout

Return Value

bool

Exceptions

NonUniqueResultException

at line 758
array findBlocksByTheme(string|int $theme)

Get all blocks for theme, param can be theme name of theme id

Parameters

string|int $theme

Return Value

array

at line 769
array getBlocksForTmce(array $params)

Get all block elements for defined params

Parameters

array $params

Return Value

array

at line 780
array findBlockByLayoutTitle(string $title)

Get all Block elements for specified layout title

Parameters

string $title

Return Value

array

at line 791
array exportBlockElements(array|null $blocks)

Get list of block, active blocks and active plugins for export

Parameters

array|null $blocks List of block for export. If null, export all blocks

Return Value

array

at line 809
bool|string importBlockElements(string $file, string $name)

Import block elements from file

Parameters

string $file
string $name

Return Value

bool|string

Exceptions

NonUniqueResultException

at line 907
array getEntityRelationshipNames()

Get names for all entity relationships

Return Value

array

at line 918
array getTemplatesForEntity(string $entity)

Get all templates for specified entity

Parameters

string $entity

Return Value

array