projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow spaces in zip codes, for (at least) canada. pointed out by
[freeside.git]
/
site_perl
/
table_template.pm
diff --git
a/site_perl/table_template.pm
b/site_perl/table_template.pm
index
5b560a2
..
0173bc5
100644
(file)
--- a/
site_perl/table_template.pm
+++ b/
site_perl/table_template.pm
@@
-1,10
+1,8
@@
package FS::table_name;
use strict;
package FS::table_name;
use strict;
-use vars qw (@ISA);
-use Exporter;
-#use FS::UID qw(getotaker);
-use FS::Record qw(hfields qsearch qsearchs);
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
@ISA = qw(FS::Record);
@ISA = qw(FS::Record);
@@
-16,8
+14,8
@@
FS::table_name - Object methods for table_name records
use FS::table_name;
use FS::table_name;
- $record =
create
FS::table_name \%hash;
- $record =
create
FS::table_name { 'column' => 'value' };
+ $record =
new
FS::table_name \%hash;
+ $record =
new
FS::table_name { 'column' => 'value' };
$error = $record->insert;
$error = $record->insert;
@@
-42,7
+40,7
@@
FS::Record. The following fields are currently supported:
=over 4
=over 4
-=item
create
HASHREF
+=item
new
HASHREF
Creates a new example. To add the example to the database, see L<"insert">.
Creates a new example. To add the example to the database, see L<"insert">.
@@
-51,12
+49,9
@@
points to. You can ask the object for a copy with the I<hash> method.
=cut
=cut
-sub create {
- my($proto,$hashref)=@_;
+# the new method can be inherited from FS::Record, if a table method is defined
- $proto->new('table_name',$hashref);
-
-}
+sub table { 'table_name'; }
=item insert
=item insert
@@
-65,19
+60,7
@@
otherwise returns false.
=cut
=cut
-sub insert {
- my($self)=@_;
-
- #local $SIG{HUP} = 'IGNORE';
- #local $SIG{INT} = 'IGNORE';
- #local $SIG{QUIT} = 'IGNORE';
- #local $SIG{TERM} = 'IGNORE';
- #local $SIG{TSTP} = 'IGNORE';
-
- $self->check or
- $self->add;
-}
-
+# the insert method can be inherited from FS::Record
=item delete
=item delete
@@
-85,11
+68,7
@@
Delete this record from the database.
=cut
=cut
-sub delete {
- my($self)=@_;
-
- $self->del;
-}
+# the delete method can be inherited from FS::Record
=item replace OLD_RECORD
=item replace OLD_RECORD
@@
-98,41
+77,38
@@
returns the error, otherwise returns false.
=cut
=cut
-sub replace {
- my($new,$old)=@_;
- return "(Old) Not a table_name record!" unless $old->table eq "table_name";
-
- return "Can't change keyfield!"
- unless $old->getfield('keyfield') eq $new->getfield('keyfield');
-
- $new->check or
- $new->rep($old);
-}
-
+# the replace method can be inherited from FS::Record
=item check
Checks all fields to make sure this is a valid example. If there is
an error, returns the error, otherwise returns false. Called by the insert
=item check
Checks all fields to make sure this is a valid example. If there is
an error, returns the error, otherwise returns false. Called by the insert
-and rep
al
ce methods.
+and rep
la
ce methods.
=cut
=cut
-sub check {
- my($self)=@_;
- return "Not a table_name record!" unless $self->table eq "table_name";
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+sub check {
+ my $self = shift;
''; #no error
}
''; #no error
}
+=back
+
+=head1 VERSION
+
+$Id: table_template.pm,v 1.4 1998-12-29 11:59:57 ivan Exp $
+
=head1 BUGS
The author forgot to customize this manpage.
=head1 SEE ALSO
=head1 BUGS
The author forgot to customize this manpage.
=head1 SEE ALSO
-L<FS::Record>
+L<FS::Record>
, schema.html from the base documentation.
=head1 HISTORY
=head1 HISTORY
@@
-142,7
+118,13
@@
added hfields
ivan@sisd.com 97-nov-13
$Log: table_template.pm,v $
ivan@sisd.com 97-nov-13
$Log: table_template.pm,v $
-Revision 1.2 1998-11-15 03:48:49 ivan
+Revision 1.4 1998-12-29 11:59:57 ivan
+mostly properly OO, some work still to be done with svc_ stuff
+
+Revision 1.3 1998/11/15 04:33:00 ivan
+updates for newest versoin
+
+Revision 1.2 1998/11/15 03:48:49 ivan
update for current version
update for current version