X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Flib%2FRT%2FObjectTopic.pm;h=732af3e712908feb4350ab33631588fa87b422c6;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=ae5abb35cb52eadde0bcf5cbcf19f47d6f04fd7b;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916;p=freeside.git diff --git a/rt/lib/RT/ObjectTopic.pm b/rt/lib/RT/ObjectTopic.pm index ae5abb35c..732af3e71 100644 --- a/rt/lib/RT/ObjectTopic.pm +++ b/rt/lib/RT/ObjectTopic.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -46,18 +46,10 @@ # # END BPS TAGGED BLOCK }}} -# Autogenerated by DBIx::SearchBuilder factory (by ) -# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST. -# -# !! DO NOT EDIT THIS FILE !! -# - - =head1 NAME RT::ObjectTopic - =head1 SYNOPSIS =head1 DESCRIPTION @@ -66,14 +58,15 @@ RT::ObjectTopic =cut -no warnings 'redefine'; package RT::ObjectTopic; -use RT::Record; -use RT::Topic; - +use strict; +use warnings; +no warnings 'redefine'; use base qw( RT::Record ); +use RT::Topic; + sub _Init { my $self = shift; @@ -100,18 +93,16 @@ Create takes a hash of values and creates a row in the database: sub Create { my $self = shift; - my %args = ( + my %args = ( Topic => '0', ObjectType => '', ObjectId => '0', - - @_); + @_); $self->SUPER::Create( Topic => $args{'Topic'}, ObjectType => $args{'ObjectType'}, ObjectId => $args{'ObjectId'}, -); - + ); } @@ -151,10 +142,10 @@ Returns the Topic Object which has the id returned by Topic =cut sub TopicObj { - my $self = shift; - my $Topic = RT::Topic->new($self->CurrentUser); - $Topic->Load($self->Topic()); - return($Topic); + my $self = shift; + my $Topic = RT::Topic->new($self->CurrentUser); + $Topic->Load($self->Topic()); + return($Topic); } =head2 ObjectType @@ -196,19 +187,44 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. sub _CoreAccessible { { - id => - {read => 1, type => 'int(11)', default => ''}, + {read => 1, type => 'int(11)', default => ''}, Topic => - {read => 1, write => 1, type => 'int(11)', default => '0'}, + {read => 1, write => 1, type => 'int(11)', default => '0'}, ObjectType => - {read => 1, write => 1, type => 'varchar(64)', default => ''}, + {read => 1, write => 1, type => 'varchar(64)', default => ''}, ObjectId => - {read => 1, write => 1, type => 'int(11)', default => '0'}, + {read => 1, write => 1, type => 'int(11)', default => '0'}, } }; +sub FindDependencies { + my $self = shift; + my ($walker, $deps) = @_; + + $self->SUPER::FindDependencies($walker, $deps); + + $deps->Add( out => $self->TopicObj ); + + my $obj = $self->ObjectType->new( $self->CurrentUser ); + $obj->Load( $self->ObjectId ); + $deps->Add( out => $obj ); +} + +sub Serialize { + my $self = shift; + my %args = (@_); + my %store = $self->SUPER::Serialize(@_); + + if ($store{ObjectId}) { + my $obj = $self->ObjectType->new( RT->SystemUser ); + $obj->Load( $store{ObjectId} ); + $store{ObjectId} = \($obj->UID); + } + return %store; +} + RT::Base->_ImportOverlays(); 1;