public static function FieldHelper::getValues in Helper 7
5 calls to FieldHelper::getValues()
File
- lib/
FieldHelper.php, line 5
Class
Code
public static function getValues($entity_type, $entity, $field_name, $column = NULL) {
if (!empty($entity->{$field_name}) && ($items = field_get_items($entity_type, $entity, $field_name))) {
if (isset($column)) {
$value_parents = is_array($column) ? $column : array(
$column,
);
$items = ArrayHelper::extractNestedValuesToArray($items, $value_parents);
}
return $items;
}
return array();
}