X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FRecord.pm;h=6b7e8d5fa3ea63c40ee2d2475d66e2e400a3cff5;hb=f01e2ce0aa6c1925e6266d78797025ec68bfac07;hp=08811a2d4cb833b066e09a678127714bf885c73f;hpb=05686487551e26418c9b2d6b92ea0d89bb100082;p=freeside.git diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 08811a2d4..6b7e8d5fa 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -26,7 +26,7 @@ use Tie::IxHash; #export dbdef for now... everything else expects to find it here @EXPORT_OK = qw(dbh fields hfields qsearch qsearchs dbdef jsearch); -$DEBUG = 0; +$DEBUG = 3; $me = '[FS::Record]'; $nowarn_identical = 0; @@ -563,6 +563,17 @@ sub dbdef_table { dbdef->table($table); } +=item primary_key + +Returns the primary key for the table. + +=cut + +sub primary_key { + my $self = shift; + my $pkey = $self->dbdef_table->primary_key; +} + =item get, getfield COLUMN Returns the value of the column/field/key COLUMN. @@ -688,6 +699,8 @@ sub insert { my $self = shift; my $saved = {}; + warn "$self -> insert" if $DEBUG; + my $error = $self->check; return $error if $error; @@ -784,8 +797,7 @@ sub insert { dbh->rollback if $FS::UID::AutoCommit; return dbh->errstr; }; - #$i_sth->execute($oid) or do { - $i_sth->execute() or do { + $i_sth->execute() or do { #$i_sth->execute($oid) dbh->rollback if $FS::UID::AutoCommit; return $i_sth->errstr; }; @@ -1297,24 +1309,6 @@ null. If there is an error, returns the error, otherwise returns false. =cut -sub ut_floatn { - my($self,$field)=@_ ; - ($self->getfield($field) =~ /^(\d*)$/ || - $self->getfield($field) =~ /^(-?\d+\.\d+)$/ || - $self->getfield($field) =~ /^(-?\d+)$/ || - $self->getfield($field) =~ /^(-?\d+\.\d+e\d+)$/ || - $self->getfield($field) =~ /^(-?\d+e\d+)$/) - or return "Illegal or empty (float) $field: ". $self->getfield($field); - $self->setfield($field,$1); - ''; -} -=item ut_floatn COLUMN - -Check/untaint floating point numeric data: 1.1, 1, 1.1e10, 1e10. May be -null. If there is an error, returns the error, otherwise returns false. - -=cut - #false laziness w/ut_ipn sub ut_floatn { my( $self, $field ) = @_;