You are here

public function metatag_handler_field_serialized::get_value in Metatag 7

Get the value that's supposed to be rendered.

This api exists so that other modules can easy set the values of the field without having the need to change the render method as well.

Parameters

object $values: An object containing all retrieved values.

string $field: Optional name of the field where the value is stored.

Overrides views_handler_field::get_value

2 calls to metatag_handler_field_serialized::get_value()
metatag_handler_field_serialized::render in views/metatag_handler_field_serialized.inc
Render the field.
metatag_handler_field_serialized_list::render in views/metatag_handler_field_serialized_list.inc
Render the field.

File

views/metatag_handler_field_serialized.inc, line 67

Class

metatag_handler_field_serialized

Code

public function get_value($values, $field = NULL) {
  $value = parent::get_value($values);
  if (!is_null($value)) {
    $value = @unserialize($value);
    $value = $this
      ->get_nested_value($value, $this->definition['path']);
  }
  $this->uses_default = FALSE;
  if (is_null($value) && !empty($this->options['metatag']['use_default'])) {
    $value = $this
      ->get_default_value($values);
    $this->uses_default = TRUE;
  }
  $this->raw_value = $value;
  return $value;
}