4 use base qw( FS::svc_Common );
5 use FS::Record qw( qsearch qsearchs );
9 FS::svc_dish - Object methods for svc_dish records
15 $record = new FS::svc_dish \%hash;
16 $record = new FS::svc_dish { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::svc_dish object represents a Dish Network service. FS::svc_dish
29 inherits from FS::svc_Common.
31 The following fields are currently supported:
35 =item svcnum - Primary key
37 =item acctnum - DISH account number
39 =item installdate - Installation date (as Unix timestamp)
41 =item note - Installation notes: location on property, physical access, etc.
51 Creates a new svc_dish object.
55 sub table { 'svc_dish'; }
58 my %opts = ( 'type' => 'text',
59 'disable_select' => 1,
60 'disable_inventory' => 1,
63 'name' => 'Dish service',
64 'display_weight' => 58,
65 'cancel_weight' => 85,
67 'svcnum' => { label => 'Service' },
68 'acctnum' => { label => 'DISH account#', %opts },
69 'installdate' => { label => 'Install date', %opts },
70 'note' => { label => 'Installation notes', %opts },
81 my($class, $string) = @_;
82 $class->search_sql_field('acctnum', $string);
87 Adds this record to the database. If there is an error, returns the error,
88 otherwise returns false.
92 Delete this record from the database.
94 =item replace OLD_RECORD
96 Replaces the OLD_RECORD with this one in the database. If there is an error,
97 returns the error, otherwise returns false.
99 # the replace method can be inherited from FS::Record
103 Checks all fields to make sure this is a valid service. If there is
104 an error, returns the error, otherwise returns false. Called by the insert
112 my $x = $self->setfixed;
113 return $x unless ref $x;
116 $self->ut_numbern('svcnum')
117 || $self->ut_text('acctnum')
118 || $self->ut_numbern('installdate')
119 || $self->ut_anything('note')
121 return $error if $error;
130 L<FS::Record>, L<FS::svc_Common>, schema.html from the base documentation.