rt# 74031 work in progress
[freeside.git] / FS / FS / svc_realestate.pm
1 package FS::svc_realestate;
2 use base qw(FS::svc_Common);
3
4 use strict;
5 use warnings;
6 use vars qw($conf);
7
8 use FS::Record qw(qsearchs qsearch dbh);
9 use Tie::IxHash;
10
11 $FS::UID::callback{'FS::svc_realestate'} = sub {
12   $conf = new FS::Conf;
13 };
14
15 =head1 NAME
16
17 FS::svc_realestate - Object methods for svc_realestate records
18
19 =head1 SYNOPSIS
20
21   {...} TODO
22
23 =head1 DESCRIPTION
24
25 A FS::svc_realestate object represents a billable real estate trasnaction,
26 such as renting a home or office.
27
28 FS::svc_realestate inherits from FS::svc_Common.  The following fields are
29 currently supported:
30
31 =over 4
32
33 =item svcnum - primary key
34
35 =back
36
37 =head1 METHODS
38
39 =over 4
40
41 =item new HASHREF
42
43 Instantiates a new svc_realestate object.
44
45 =cut
46
47 sub table_info {
48   tie my %fields, 'Tie::IxHash',
49     svc_num     => 'Service',
50     description => 'Descriptive label',
51     property    => 'Real estate property';
52
53   {
54     name            => 'Real estate',
55     name_plural     => 'Real estate services',
56     longname_plural => 'Real estate services',
57     display_weight  => 100,
58     cancel_weight   => 100,
59     fields          => \%fields,
60   };
61 }
62
63 sub table {'svc_realestate'};
64
65 # todo- In what context is this called? Mimic stub behavior w/o the warning
66 sub label { $_[0]->svcnum }
67
68 =item search_sql
69
70 I have an unfounded suspicion this method serves no purpose in this context
71
72 =cut
73
74 sub search_sql {die "search_sql called on FS::svc_realestate"}
75
76 =item insert
77
78 Adds this record to the database.  If there is an error, returns the error,
79 otherwise returns false.
80
81 =item delete
82
83 Delete this record from the database.
84
85 =item replace OLD_RECORD
86
87 Replaces the OLD_RECORD with this one in the database.  If there is an error,
88 returns the error, otherwise returns false.
89
90 =item check
91
92 Checks all fields to make sure this is a valid record.  If there is
93 an error, returns the error, otherwise returns false.  Called by the insert
94 and replace methods.
95
96 =back 4
97
98 =head1 BUGS
99
100 =head1 SEE ALSO
101
102 L<FS::Record>, schema.html from the base documentation.
103
104 =cut
105
106 1;