[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1661] trunk/LedgerSMB/DBObject.pm
- Subject: SF.net SVN: ledger-smb: [1661] trunk/LedgerSMB/DBObject.pm
- From: ..hidden..
- Date: Tue, 25 Sep 2007 22:01:42 -0700
Revision: 1661
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1661&view=rev
Author: einhverfr
Date: 2007-09-25 22:01:35 -0700 (Tue, 25 Sep 2007)
Log Message:
-----------
Applying David Mora's patch to DBObject.pm
Modified Paths:
--------------
trunk/LedgerSMB/DBObject.pm
Modified: trunk/LedgerSMB/DBObject.pm
===================================================================
--- trunk/LedgerSMB/DBObject.pm 2007-09-25 23:38:31 UTC (rev 1660)
+++ trunk/LedgerSMB/DBObject.pm 2007-09-26 05:01:35 UTC (rev 1661)
@@ -54,6 +54,8 @@
$self->exec_method( funcname => "$type" . "_" . $AUTOLOAD, args => ..hidden..);
}
+sub DESTROY {}
+
sub new {
my $class = shift @_;
my %args = (ref($_[0]) eq 'HASH')? %{$_[0]}: @_;
@@ -104,13 +106,14 @@
my @in_args;
@in_args = @{ $args{args}} if $args{args};
my @call_args;
-
+
my $query = "SELECT proname, pronargs, proargnames FROM pg_proc WHERE proname = ?";
my $sth = $self->{dbh}->prepare($query);
$sth->execute($funcname);
my $ref;
$ref = $sth->fetchrow_hashref('NAME_lc');
+
my $args = $ref->{proargnames};
my @proc_args;
$ref->{pronargs} = 0 unless defined $ref->{pronargs};
@@ -118,19 +121,23 @@
$args =~ s/\{(.*)\}/$1/;
@proc_args = split /,/, $args if $args;
}
+
if ( !$ref->{proname} ) { # no such function
- $self->error( "No such function: ", $funcname );
- die;
+
+ $self->error( "No such function: $funcname");
+# die;
}
+
my $m_name = $ref->{proname};
- if ($args) {
- for my $arg (@proc_args) {
- if ( $arg =~ s/^in_// ) {
- push @call_args, $self->{$arg};
- }
- }
- }
+# if ($args) {
+# for my $arg (@proc_args) {
+# if ( $arg =~ s/^in_// ) {
+ # push @call_args, $arg;
+# }
+# }
+# }
+
for (@in_args) { push @call_args, $_ } ;
$self->{call_args} = ..hidden..;
$self->debug({file => '/tmp/dbobject'});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.