File "Timezone_Formatter.php"
Full Path: /home/romayxjt/public_html/wp-content/plugins/the-events-calendar/src/Events/Custom_Tables/V1/Models/Formatters/Timezone_Formatter.php
File size: 499 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
namespace TEC\Events\Custom_Tables\V1\Models\Formatters;
class Timezone_Formatter implements Formatter {
/**
* @var Text_Formatter
*/
private $formatter;
public function __construct( Text_Formatter $formatter ) {
$this->formatter = $formatter;
}
public function format( $value ) {
if ( $value instanceof \DateTimeZone ) {
return sanitize_text_field( $value->getName() );
}
return $this->formatter->format( $value );
}
public function prepare() {
return '%s';
}
}