2 FS::agent - Object methods for agent records
7 $record = create FS::agent \%hash;
8 $record = create FS::agent { 'column' => 'value' };
10 $error = $record->insert;
12 $error = $new_record->replace($old_record);
14 $error = $record->delete;
16 $error = $record->check;
19 An FS::agent object represents an agent. Every customer has an
20 agent. Agents can be used to track things like resellers or
21 salespeople. FS::agent inherits from FS::Record. The following
22 fields are currently supported:
24 agemtnum - primary key (assigned automatically for new agents)
25 agent - Text name of this agent
26 typenum - Agent type. See the FS::agent_type manpage
27 prog - For future use.
28 freq - For future use.
31 Creates a new agent. To add the agent to the database, see
32 the section on "insert".
35 Adds this agent to the database. If there is an error,
36 returns the error, otherwise returns false.
39 Deletes this agent from the database. Only agents with no
40 customers can be deleted. If there is an error, returns the
41 error, otherwise returns false.
44 Replaces OLD_RECORD with this one in the database. If there
45 is an error, returns the error, otherwise returns false.
48 Checks all fields to make sure this is a valid agent. If
49 there is an error, returns the error, otherwise returns
50 false. Called by the insert and replace methods.
53 It doesn't properly override FS::Record yet.
56 the FS::Record manpage, the FS::agent_type manpage, the
57 FS::cust_main manpage, schema.html from the base documentation.
60 Class dealing with agent (resellers)
62 ivan@sisd.com 97-nov-13, 97-dec-10
64 pod, added check in ->delete ivan@sisd.com 98-sep-22