X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FRecord.pm;h=a04ddb9820ea376a0c3d89f0cc85d91835d56b52;hb=4e5a0655072be725acf00394186b93c96bba17ee;hp=3c8e9bac60541fc1427b3b0e04ad357ef0944118;hpb=fd72d2af8120195f96826eb044e217dbfcaee1c7;p=freeside.git diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 3c8e9bac6..a04ddb982 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -227,7 +227,7 @@ sub qsearch { $sth->execute( map $record->{$_}, grep defined( $record->{$_} ) && $record->{$_} ne '', @fields - ) or croak "Error executing \"$statement\": ". $dbh->errstr; + ) or croak "Error executing \"$statement\": ". $sth->errstr; $dbh->commit or croak $dbh->errstr if $FS::UID::AutoCommit; if ( eval 'scalar(@FS::'. $table. '::ISA);' ) { @@ -257,13 +257,15 @@ sub qsearch { } -=item jsearch +=item jsearch TABLE, HASHREF, SELECT, EXTRA_SQL, PRIMARY_TABLE, PRIMARY_KEY Experimental JOINed search method. Using this method, you can execute a single SELECT spanning multiple tables, and cache the results for subsequent method calls. Interface will almost definately change in an incompatible fashion. +Arguments: + =cut sub jsearch { @@ -384,7 +386,7 @@ $record->column('value') is a synonym for $record->set('column','value'); sub AUTOLOAD { my $field = $AUTOLOAD; $field =~ s/.*://; - if ( scalar(@_) == 2 ) { + if ( defined($_[1]) ) { $_[0]->setfield($field, $_[1]); } else { $_[0]->getfield($field); @@ -804,7 +806,7 @@ sub ut_phonen { $phonen .= " x$4" if $4; $self->setfield($field,$phonen); } else { - warn "don't know how to check phone numbers for country $country"; + warn "warning: don't know how to check phone numbers for country $country"; return $self->ut_textn($field); } ''; @@ -1036,12 +1038,12 @@ sub hfields { \%hash; } -#sub _dump { -# my($self)=@_; -# join("\n", map { -# "$_: ". $self->getfield($_). "|" -# } (fields($self->table)) ); -#} +sub _dump { + my($self)=@_; + join("\n", map { + "$_: ". $self->getfield($_). "|" + } (fields($self->table)) ); +} sub DESTROY { return; }