/** * Returns an array that holds the field data, suitable for JSON representation. * In addition to default data, option value and label are added. * This data will be available in the Underscore template and the Backbone Model. * * @param bool $load Should the value be loaded from the database or use the value from the current instance. * @return array */ public function to_json($load) { $field_data = parent::to_json($load); $field_data = array_merge($field_data, array('option_value' => $this->option_value, 'option_label' => parent::get_label())); return $field_data; }