$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);' ) {
}
-=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 {
sub AUTOLOAD {
my $field = $AUTOLOAD;
$field =~ s/.*://;
- if ( scalar(@_) == 2 ) {
+ if ( defined($_[1]) ) {
$_[0]->setfield($field, $_[1]);
} else {
$_[0]->getfield($field);
$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);
}
'';
\%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; }