You are here

public function SynonymsBehavior::mergeEntityAsSynonym in Synonyms 7

Add an entity as a synonym into another entity.

Basically this method should be called when you want to add some entity as a synonym to another entity (for example when you merge one entity into another and besides merging want to add synonym of the merged entity into the trunk entity). You should update $trunk_entity in such a way that it holds $synonym_entity as a synonym (it all depends on how data is stored in your behavior implementation, but probably you will store entity label or its ID as you cannot literally store an entity inside of another entity). If entity of type $synonym_entity_type cannot be converted into a format expected by your behavior implementation, just do nothing.

Parameters

object $trunk_entity: Entity into which another one should be added as synonym

object $synonym_entity: Fully loaded entity object which has to be added as synonym

string $synonym_entity_type: Entity type of $synonym_entity

7 methods override SynonymsBehavior::mergeEntityAsSynonym()
AbstractPropertySynonymsBehavior::mergeEntityAsSynonym in synonyms_provider_property/includes/AbstractPropertySynonymsBehavior.class.inc
Add an entity as a synonym into another entity.
CommercePriceSynonymsBehavior::mergeEntityAsSynonym in synonyms_commerce/includes/CommercePriceSynonymsBehavior.class.inc
Add an entity as a synonym into another entity.
CommerceProductReferenceSynonymsBehavior::mergeEntityAsSynonym in synonyms_commerce/includes/CommerceProductReferenceSynonymsBehavior.class.inc
Add an entity as a synonym into another entity.
EntityReferenceSynonymsBehavior::mergeEntityAsSynonym in synonyms_provider_field/includes/EntityReferenceSynonymsBehavior.class.inc
Add an entity as a synonym into another entity.
MySynonymsSynonymsBehavior::mergeEntityAsSynonym in ./synonyms.api.php
Add an entity as a synonym into another entity.

... See full list

File

includes/SynonymsBehavior.interface.inc, line 49
Interfaces of synonyms behaviors that are shipped with Synonyms module.

Class

SynonymsBehavior
General interface of a synonyms behavior.

Code

public function mergeEntityAsSynonym($trunk_entity, $synonym_entity, $synonym_entity_type);