Overrides SelectionBase::getReferencableEntities().
Overrides SelectionBase::getReferencableEntities
public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) {
if ($match || $limit) {
return parent::getReferencableEntities($match, $match_operator, $limit);
}
$options = array();
$bundles = entity_get_bundles('taxonomy_term');
$bundle_names = !empty($this->instance['settings']['handler_settings']['target_bundles']) ? $this->instance['settings']['handler_settings']['target_bundles'] : array_keys($bundles);
foreach ($bundle_names as $bundle) {
if ($vocabulary = entity_load('taxonomy_vocabulary', $bundle)) {
if ($terms = taxonomy_get_tree($vocabulary
->id(), 0)) {
foreach ($terms as $term) {
$options[$vocabulary
->id()][$term
->id()] = str_repeat('-', $term->depth) . check_plain($term->name);
}
}
}
}
return $options;
}