diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Agent_Mixin.pm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/FS/FS/Agent_Mixin.pm b/FS/FS/Agent_Mixin.pm new file mode 100644 index 000000000..0f84ba96a --- /dev/null +++ b/FS/FS/Agent_Mixin.pm @@ -0,0 +1,42 @@ +package FS::Agent_Mixin; + +use strict; +use FS::Record qw( qsearchs ); +use FS::agent; + +=head1 NAME + +FS::Agent_Mixin - Mixin class for objects that have an agent. + +=over 4 + +=item agent + +Returns the agent (see L<FS::agent>) for this object. + +=cut + +sub agent { + my $self = shift; + qsearchs( 'agent', { 'agentnum' => $self->agentnum } ); +} + +=item agent_name + +Returns the agent name (see L<FS::agent>) for this object. + +=cut + +sub agent_name { + my $self = shift; + $self->agent->agent; +} + +=back + +=head1 BUGS + +=cut + +1; + |