Initial revision
[freeside.git] / htdocs / docs / man / agent_type.txt
1 NAME
2     FS::agent_type - Object methods for agent_type records
3
4 SYNOPSIS
5       use FS::agent_type;
6
7       $record = create FS::agent_type \%hash;
8       $record = create FS::agent_type { 'column' => 'value' };
9
10       $error = $record->insert;
11
12       $error = $new_record->replace($old_record);
13
14       $error = $record->delete;
15
16       $error = $record->check;
17
18 DESCRIPTION
19     An FS::agent_type object represents an agent type. Every agent
20     (see the FS::agent manpage) has an agent type. Agent types
21     define which packages (see the FS::part_pkg manpage) may be
22     purchased by customers (see the FS::cust_main manpage), via
23     FS::type_pkgs records (see the FS::type_pkgs manpage).
24     FS::agent_type inherits from FS::Record. The following fields
25     are currently supported:
26
27     typenum - primary key (assigned automatically for new agent types)
28     atype - Text name of this agent type
29 METHODS
30     create HASHREF
31         Creates a new agent type. To add the agent type to the
32         database, see the section on "insert".
33
34     insert
35         Adds this agent type to the database. If there is an error,
36         returns the error, otherwise returns false.
37
38     delete
39         Deletes this agent type from the database. Only agent types
40         with no agents can be deleted. If there is an error, returns
41         the error, otherwise returns false.
42
43     replace OLD_RECORD
44         Replaces OLD_RECORD with this one in the database. If there
45         is an error, returns the error, otherwise returns false.
46
47     check
48         Checks all fields to make sure this is a valid agent type.
49         If there is an error, returns the error, otherwise returns
50         false. Called by the insert and replace methods.
51
52 BUGS
53     It doesn't properly override FS::Record yet.
54
55 SEE ALSO
56     the FS::Record manpage, the FS::agent manpage, the FS::type_pkgs
57     manpage, the FS::cust_main manpage, the FS::part_pkg manpage,
58     schema.html from the base documentation.
59
60 HISTORY
61     Class for the different sets of allowable packages you can
62     assign to an agent.
63
64     ivan@sisd.com 97-nov-13
65
66     ut_ FS::Record methods ivan@sisd.com 97-dec-10
67
68     Changed 'type' to 'atype' because Pg6.3 reserves the type word
69     bmccane@maxbaud.net 98-apr-3
70
71     pod, added check in delete ivan@sisd.com 98-sep-21
72