public function reference_table_formatter_entityreference::get_bundles in Reference Table Formatter 7
Get a list of bundles which can be referenced by this field.
Return value
array A list of bundles.
Overrides reference_table_formatter_base_type::get_bundles
1 call to reference_table_formatter_entityreference::get_bundles()
- reference_table_formatter_entityreference::get_entity_property_label in plugins/
reference_types/ entityreference.inc
File
- plugins/
reference_types/ entityreference.inc, line 19
Class
- reference_table_formatter_entityreference
- Class reference_table_formatter_field_collection
Code
public function get_bundles() {
// If we are using the base selection, the bundles are easy to find.
if ($this->field['settings']['handler'] == 'base' && isset($this->field['settings']['handler_settings']['target_bundles']) && count($this->field['settings']['handler_settings']['target_bundles']) > 0) {
return array_keys($this->field['settings']['handler_settings']['target_bundles']);
}
else {
// Otherwise use all bundles since it's not possible to say for certain
// which bundles will appear for the field.
$info = entity_get_info($this
->entity_name());
return array_keys($info['bundles']);
}
}