/** * {@inheritdoc} */ public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { if ($match || $limit) { return parent::getReferenceableEntities($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, NULL, TRUE)) { foreach ($terms as $term) { $options[$vocabulary->id()][$term->id()] = str_repeat('-', $term->depth) . String::checkPlain($term->getName()); } } } } return $options; }