You are here

public function SynonymsBehavior::synonymsFind in Synonyms 7

Look up entities by their synonyms within a behavior implementation.

You are provided with a SQL condition that you should apply to the storage of synonyms within the provided behavior implementation. And then return result: what entities match by the provided condition through what synonyms.

Parameters

QueryConditionInterface $condition: Condition that defines what to search for. Apart from normal SQL conditions as known in Drupal, it may contain the following placeholders:

For ease of work with these placeholders, you may extend the AbstractSynonymsBehavior class and then just invoke the AbstractSynonymsBehavior->synonymsFindProcessCondition() method, so you won't have to worry much about it. Important note: if you plan on re-using the same $condition object for multiple invocations of this method you must pass in here a clone of your condition object, since the internal implementation of this method will change the condition (will swap the aforementioned placeholders with actual column names)

Return value

Traversable Traversable result set of found synonyms and entity IDs to which those belong. Each element in the result set should be an object and will have the following structure:

  • synonym: (string) Synonym that was found and which satisfies the provided condition
  • entity_id: (int) ID of the entity to which the found synonym belongs
7 methods override SynonymsBehavior::synonymsFind()
AbstractPropertySynonymsBehavior::synonymsFind in synonyms_provider_property/includes/AbstractPropertySynonymsBehavior.class.inc
Look up entities by their synonyms within a behavior implementation.
CommercePriceSynonymsBehavior::synonymsFind in synonyms_commerce/includes/CommercePriceSynonymsBehavior.class.inc
Look up entities by their synonyms within a behavior implementation.
CommerceProductReferenceSynonymsBehavior::synonymsFind in synonyms_commerce/includes/CommerceProductReferenceSynonymsBehavior.class.inc
Look up entities by their synonyms within a behavior implementation.
EntityReferenceSynonymsBehavior::synonymsFind in synonyms_provider_field/includes/EntityReferenceSynonymsBehavior.class.inc
Look up entities by their synonyms within a behavior implementation.
MySynonymsSynonymsBehavior::synonymsFind in ./synonyms.api.php
Look up entities by their synonyms within a behavior implementation.

... See full list

File

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

Class

SynonymsBehavior
General interface of a synonyms behavior.

Code

public function synonymsFind(QueryConditionInterface $condition);