1 package FS::realestate_subproperty;
8 use FS::Record qw(qsearchs);
12 FS::realestate_subproperty - Object representing a realestate_subproperty record
16 use FS::realestate_subproperty;
18 $record = new FS::realestate_subproperty \%values;
19 $record = new FS::realestate_subproperty {
21 subtitle => 'Box Seat No. 42',
24 $error = $record->insert;
25 $error = new_rec->replace($record);
26 $error = $record->check;
28 $parent = $record->property;
32 An FS::realestate_subproperty object represents a unit of real estate property.
33 Every L<FS::realestate_property> must contain at least one subproperty, or unit,
34 which is the actual unit considered for sale, rent, etc as tied to
35 L<FS::svc_realestate>.
37 FS::realestate_subproperty inherits from FS::Record.
39 The following fields are currently supported:
57 =item new HASHREF (see L<FS::Record>)
61 sub table {'realestate_subproperty';}
63 =item insert (see L<FS::Record>)
67 FS::realestate_subproperty records should never be deleted, only disabled
72 # Once this record has been associated with a customer in any way, it
73 # should not be deleted. todo perhaps, add a is_deletable function that
74 # checks if the record has ever actually been used, and allows deletion
75 # if it hasn't. (entered in error, etc).
76 croak "FS::realestate_subproperty records should never be deleted";
79 =item replace OLD_RECORD (see L<FS::Record>)
81 =item check (see L<FS::Record>)
85 Returns the associated agent, if any, for the parent L<FS::realestate_property>
90 shift->property->agent;
95 Returns the associated parent L<FS::realestate_property> record
101 exists $self->{property}
103 : $self->{property} = qsearchs('realestate_property',$self->propnum);
121 L<FS::record>, L<FS::realestate_property>, L<FS::svc_realestate>