1 package FS::router_field;
5 use FS::Record qw( qsearchs );
6 use FS::part_router_field;
10 @ISA = qw( FS::Record );
14 FS::router_field - Object methods for router_field records
20 $record = new FS::router_field \%hash;
21 $record = new FS::router_field { 'column' => 'value' };
23 $error = $record->insert;
25 $error = $new_record->replace($old_record);
27 $error = $record->delete;
29 $error = $record->check;
33 FS::router_field contains values of router xfields. See FS::part_sb_field
34 for details on the xfield mechanism.
38 =item routerfieldpart - Type of router_field as defined by
41 =item routernum - The FS::router to which this value belongs.
43 =item value - The contents of the field.
54 Create a new record. To add the record to the database, see "insert".
58 sub table { 'router_field'; }
62 Adds this record to the database. If there is an error, returns the error,
63 otherwise returns false.
67 Deletes this record from the database. If there is an error, returns the
68 error, otherwise returns false.
70 =item replace OLD_RECORD
72 Replaces OLD_RECORD with this one in the database. If there is an error,
73 returns the error, otherwise returns false.
77 Checks all fields to make sure this is a valid record. If there is an error,
78 returns the error, otherwise returns false. Called by the insert and replace
86 return "routernum must be defined" unless $self->routernum;
87 return "routerfieldpart must be defined" unless $self->routerfieldpart;
89 my $part_router_field = $self->part_router_field;
92 my $check_block = $part_router_field->check_block;
95 my $error = (eval($check_block) or $@);
96 return $error if $error;
97 $self->setfield('value' => $_);
103 =item part_router_field
105 Returns a reference to the FS:part_router_field that defines this
110 sub part_router_field {
113 return qsearchs('part_router_field',
114 { routerfieldpart => $self->routerfieldpart });
119 Returns a reference to the FS::router to which this FS::router_field
127 return qsearchs('router', { routernum => $self->routernum });
140 FS::svc_broadband, FS::router, FS::router_block, FS::router_field,
141 schema.html from the base documentation.