| @@ 283-297 (lines=15) @@ | ||
| 280 | * @param boolean|string $pretty_schema true to display pretty, a string to use a specific "Schema", or false to NOT display pretty |
|
| 281 | * @return string |
|
| 282 | */ |
|
| 283 | protected function _prepare_value_from_db_for_display( $model, $field_name, $raw_db_value, $pretty_schema = true ) { |
|
| 284 | $field_obj = $model->field_settings_for( $field_name ); |
|
| 285 | $value_on_model_obj = $field_obj->prepare_for_set_from_db( $raw_db_value ); |
|
| 286 | if( $field_obj instanceof EE_Datetime_Field ) { |
|
| 287 | $field_obj->set_date_format( EE_CSV::instance()->get_date_format_for_csv( $field_obj->get_date_format( $pretty_schema ) ), $pretty_schema ); |
|
| 288 | $field_obj->set_time_format( EE_CSV::instance()->get_time_format_for_csv( $field_obj->get_time_format( $pretty_schema ) ), $pretty_schema ); |
|
| 289 | } |
|
| 290 | if( $pretty_schema === true){ |
|
| 291 | return $field_obj->prepare_for_pretty_echoing( $value_on_model_obj ); |
|
| 292 | }elseif( is_string( $pretty_schema ) ) { |
|
| 293 | return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema ); |
|
| 294 | }else{ |
|
| 295 | return $field_obj->prepare_for_get( $value_on_model_obj ); |
|
| 296 | } |
|
| 297 | } |
|
| 298 | ||
| 299 | /** |
|
| 300 | * Export a custom CSV of registration info including: A bunch of the reg fields, the time of the event, the price name, |
|
| @@ 132-146 (lines=15) @@ | ||
| 129 | * @param boolean|string $pretty_schema true to display pretty, a string to use a specific "Schema", or false to NOT display pretty |
|
| 130 | * @return string |
|
| 131 | */ |
|
| 132 | public static function prepare_value_from_db_for_display( $model, $field_name, $raw_db_value, $pretty_schema = true ) { |
|
| 133 | $field_obj = $model->field_settings_for( $field_name ); |
|
| 134 | $value_on_model_obj = $field_obj->prepare_for_set_from_db( $raw_db_value ); |
|
| 135 | if( $field_obj instanceof EE_Datetime_Field ) { |
|
| 136 | $field_obj->set_date_format( EEH_Export::get_date_format_for_export( $field_obj->get_date_format( $pretty_schema ) ), $pretty_schema ); |
|
| 137 | $field_obj->set_time_format( EEH_Export::get_time_format_for_export( $field_obj->get_time_format( $pretty_schema ) ), $pretty_schema ); |
|
| 138 | } |
|
| 139 | if( $pretty_schema === true){ |
|
| 140 | return $field_obj->prepare_for_pretty_echoing( $value_on_model_obj ); |
|
| 141 | }elseif( is_string( $pretty_schema ) ) { |
|
| 142 | return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema ); |
|
| 143 | }else{ |
|
| 144 | return $field_obj->prepare_for_get( $value_on_model_obj ); |
|
| 145 | } |
|
| 146 | } |
|
| 147 | ||
| 148 | ||
| 149 | ||