function commerce_file_handler_field_license_property::render in Commerce File 7
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides views_handler_field::render
2 methods override commerce_file_handler_field_license_property::render()
- commerce_file_handler_field_license_duration::render in views/
handlers/ commerce_file_handler_field_license_duration.inc - Render the field.
- commerce_file_handler_field_license_limit::render in views/
handlers/ commerce_file_handler_field_license_limit.inc - Render the field.
File
- views/
handlers/ commerce_file_handler_field_license_property.inc, line 41 - Contains the license entity property field handler.
Class
- commerce_file_handler_field_license_property
- Field handler to provide access to non database entity properties.
Code
function render($values) {
$entity = $this
->_get_entity($values);
if (!empty($entity)) {
if (isset($entity->{$this->real_field})) {
$value = $entity->{$this->real_field};
if ($entity
->check_limit_is_unlimited($value)) {
// unlimited duration
$value = !empty($this->options['unlimited_text']) ? $this->options['unlimited_text'] : NULL;
return $this
->sanitize_value($value);
}
// set value and render
$values->{$this->field_alias} = $value;
return parent::render($values);
}
}
}