package NGCP::Schema::Result::reseller_timezone; use Scalar::Util qw(blessed); use base qw/DBIx::Class::Core/; our $VERSION = '2.007'; __PACKAGE__->load_components( "InflateColumn::DateTime", "Helper::Row::ToJSON", "+NGCP::Schema::InflateColumn::DateTime::EpochMicro", ); __PACKAGE__->table("billing.v_reseller_timezone"); __PACKAGE__->add_columns( "contact_id", { data_type => "integer", extra => { unsigned => 1 }, is_nullable => 1, }, "reseller_id", { data_type => "integer", extra => { unsigned => 1 }, is_nullable => 0, }, "name", { data_type => "varchar", size => 80, is_nullable => 1, }, ); __PACKAGE__->belongs_to( "reseller", "NGCP::Schema::Result::resellers", { id => "reseller_id" }, { cascade_copy => 0, cascade_delete => 0 }, ); __PACKAGE__->belongs_to( "contact", "NGCP::Schema::Result::contacts", { id => "contact_id" }, { cascade_copy => 0, cascade_delete => 0 }, ); sub TO_JSON { my ($self) = @_; return { map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } }; } 1;