TermMergeSynonymsBehavior.interface.inc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @file
  4. * Interface of synonyms behaviors for merging terms.
  5. */
  6. /**
  7. * Interface for merging one term into another.
  8. */
  9. interface TermMergeSynonymsBehavior extends SynonymsBehavior {
  10. /**
  11. * Add an entity as a synonym into another entity.
  12. *
  13. * Basically this method should be called when you want to add some entity as
  14. * a synonym to another entity (for example when you merge one entity into
  15. * another and besides merging want to add synonym of the merged entity into
  16. * the trunk entity). You should update $trunk_entity in such a way that it
  17. * holds $synonym_entity as a synonym (it all depends on how data is stored in
  18. * your behavior implementation, but probably you will store entity label or
  19. * its ID as you cannot literally store an entity inside of another entity).
  20. * If entity of type $synonym_entity_type cannot be converted into a format
  21. * expected by your behavior implementation, just do nothing.
  22. *
  23. * @param object $trunk_entity
  24. * Entity into which another one should be added as synonym
  25. * @param object $synonym_entity
  26. * Fully loaded entity object which has to be added as synonym
  27. * @param string $synonym_entity_type
  28. * Entity type of $synonym_entity
  29. */
  30. public function mergeTerm($trunk_entity, $synonym_entity, $synonym_entity_type);
  31. }