class ProductEntityRelationshipExtension extends Twig_Extension

Class ProductEntityRelationshipExtension is injected as twig.extension.empire_product_entity_relationship_plugin service. ProductEntityRelationshipExtension handles the logic and provides necessary data for managed entity in twig.

Properties

protected EntityRelationshipManager $manager
protected array $entitiesName

Methods

__construct(EntityRelationshipManager $manager)

ProductEntityRelationshipExtension constructor.

getFunctions()

{@inheritdoc}

getEntityRelationshipForProduct(int $productId)

Find product relationship by product id

array
getSingleEntityRelationshipForProduct(int $productId, int $entityId)

Find product relationship by product and relationship entity id

array
getEntityRelationshipNameForProduct(int $productId)

Find entity relationship name for product id

Details

at line 35
__construct(EntityRelationshipManager $manager)

ProductEntityRelationshipExtension constructor.

Parameters

EntityRelationshipManager $manager

at line 43
getFunctions()

{@inheritdoc}

at line 58
ProductEntityRelationship getEntityRelationshipForProduct(int $productId)

Find product relationship by product id

Parameters

int $productId

Return Value

ProductEntityRelationship

at line 70
array getSingleEntityRelationshipForProduct(int $productId, int $entityId)

Find product relationship by product and relationship entity id

Parameters

int $productId
int $entityId

Return Value

array

at line 81
array getEntityRelationshipNameForProduct(int $productId)

Find entity relationship name for product id

Parameters

int $productId

Return Value

array