summaryrefslogtreecommitdiff
path: root/FS/FS/Agent_Mixin.pm
blob: 0f84ba96a8136023493653ff084013a5250cf11f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;