You are here

protected function TaxonomyTermReferenceSelectSynonymsWebTestCase::synonymsSelectOptionPrefix in Synonyms 7

Generate necessary prefix before the main wording of the label in select.

It may be useful to insert some kind of hierarchy indention, for example.

Parameters

object $entity: Fully loaded entity object whose prefix is requested in the option label of the synonyms friendly select widget

string $synonym: If this option comes from a synonym, that synonym will be supplied here

Return value

string Any suitable prefix before the main wording of the option for this particular option

Overrides AbstractSelectSynonymsWebTestCase::synonymsSelectOptionPrefix

File

./synonyms.test, line 1569
Tests for the Synonyms module.

Class

TaxonomyTermReferenceSelectSynonymsWebTestCase
Test synonyms friendly select widget for taxonomy term reference field.

Code

protected function synonymsSelectOptionPrefix($entity, $synonym = NULL) {
  $depth = count(taxonomy_get_parents_all($entity->tid)) - 1;
  return str_repeat('-', $depth) . parent::synonymsSelectOptionPrefix($entity, $synonym);
}