3 <TITLE>FS::agent_type - Object methods for agent_type records</TITLE>
4 <LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
13 <LI><A HREF="#NAME">NAME</A>
14 <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
15 <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
16 <LI><A HREF="#METHODS">METHODS</A>
17 <LI><A HREF="#VERSION">VERSION</A>
18 <LI><A HREF="#BUGS">BUGS</A>
19 <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
25 <H1><A NAME="NAME">NAME</A></H1>
27 FS::agent_type - Object methods for agent_type records
31 <H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
33 <PRE> use FS::agent_type;
36 <PRE> $record = new FS::agent_type \%hash;
37 $record = new FS::agent_type { 'column' => 'value' };
40 <PRE> $error = $record->insert;
43 <PRE> $error = $new_record->replace($old_record);
46 <PRE> $error = $record->delete;
49 <PRE> $error = $record->check;
52 <PRE> $hashref = $record->pkgpart_hashref;
53 #may purchase $pkgpart if $hashref->{$pkgpart};
56 <PRE> @type_pkgs = $record->type_pkgs;
59 <PRE> @pkgparts = $record->pkgpart;
63 <H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
65 An FS::agent_type object represents an agent type. Every agent (see
66 <A HREF="../FS/agent.html">FS::agent</A>) has an agent type. Agent types define which packages (see
67 <A HREF="../FS/part_pkg.html">FS::part_pkg</A>) may be purchased by customers (see <A HREF="../FS/cust_main.html">FS::cust_main</A>), via FS::type_pkgs records (see <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>). FS::agent_type inherits from FS::Record. The following fields are
71 <DT><STRONG><A NAME="item_typenum">typenum - primary key (assigned automatically for new agent types)</A></STRONG><DD>
72 <DT><STRONG><A NAME="item_atype">atype - Text name of this agent type</A></STRONG><DD>
76 <H1><A NAME="METHODS">METHODS</A></H1>
78 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
80 Creates a new agent type. To add the agent type to the database, see
81 <A HREF="#insert">insert</A>.
83 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
85 Adds this agent type to the database. If there is an error, returns the
86 error, otherwise returns false.
88 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
90 Deletes this agent type from the database. Only agent types with no agents
91 can be deleted. If there is an error, returns the error, otherwise returns
94 <DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
96 Replaces OLD_RECORD with this one in the database. If there is an error,
97 returns the error, otherwise returns false.
99 <DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
101 Checks all fields to make sure this is a valid agent type. If there is an
102 error, returns the error, otherwise returns false. Called by the insert and
105 <DT><STRONG><A NAME="item_pkgpart_hashref">pkgpart_hashref</A></STRONG><DD>
107 Returns a hash reference. The keys of the hash are pkgparts. The value is
108 true iff this agent may purchase the specified package definition. See
109 <A HREF="../FS/part_pkg.html">FS::part_pkg</A>.
111 <DT><STRONG><A NAME="item_type_pkgs">type_pkgs</A></STRONG><DD>
113 Returns all FS::type_pkgs objects (see <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>) for this agent type.
115 <DT><STRONG><A NAME="item_pkgpart">pkgpart</A></STRONG><DD>
117 Returns the pkgpart of all package definitions (see <A HREF="../FS/part_pkg.html">FS::part_pkg</A>) for this agent type.
122 <H1><A NAME="VERSION">VERSION</A></H1>
124 $Id: agent_type.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
128 <H1><A NAME="BUGS">BUGS</A></H1>
131 <H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
133 <A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/agent.html">FS::agent</A>, <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>,
134 <A HREF="../FS/part_pkg.html">FS::part_pkg</A>, schema.html from the base documentation.