more session related changes
This commit is contained in:
parent
16b9675b0c
commit
024514c549
106 changed files with 1498 additions and 1313 deletions
|
|
@ -37,7 +37,7 @@ Package for interfacing with SQL databases. This package implements Perl DBI fun
|
|||
|
||||
use WebGUI::SQL;
|
||||
|
||||
$db = WebGUI::SQL->connect($dsn, $user, $pass, $session);
|
||||
$db = $self->session->db->connect($dsn, $user, $pass, $session);
|
||||
$db->disconnect;
|
||||
|
||||
$sth = $db->prepare($sql);
|
||||
|
|
@ -63,8 +63,8 @@ Package for interfacing with SQL databases. This package implements Perl DBI fun
|
|||
$dbh = $db->getSlave;
|
||||
|
||||
$id = $db->getNextId("someId");
|
||||
$string = $db->quote($string);
|
||||
$string = $db->quoteAndJoin(\@array);
|
||||
$string = $db->$self->session->db->quote($string);
|
||||
$string = $db->$self->session->db->quoteAndJoin(\@array);
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ The value to search for in the key column.
|
|||
|
||||
sub deleteRow {
|
||||
my ($self, $table, $key, $keyValue) = @_;
|
||||
WebGUI::SQL->write("delete from $table where ".$key."=".$self->quote($keyValue));
|
||||
$self->session->db->write("delete from $table where ".$key."=".$self->$self->session->db->quote($keyValue));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ The value to search for in the key column.
|
|||
|
||||
sub getRow {
|
||||
my ($self, $table, $key, $keyValue) = @_;
|
||||
my $row = WebGUI::SQL->quickHashRef("select * from $table where ".$key."=".$self->quote($keyValue));
|
||||
my $row = $self->session->db->quickHashRef("select * from $table where ".$key."=".$self->$self->session->db->quote($keyValue));
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
|
@ -533,14 +533,14 @@ Any scalar variable that needs to be escaped to be inserted into the database.
|
|||
sub quote {
|
||||
my $self = shift;
|
||||
my $value = shift;
|
||||
return $self->dbh->quote($value);
|
||||
return $self->dbh->$self->session->db->quote($value);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 quoteAndJoin ( arrayRef )
|
||||
|
||||
Returns a comma seperated string quoted and ready for insert/select into/from the database. This is typically used for a statement like "select * from someTable where field in (".quoteAndJoin(\@strings).")".
|
||||
Returns a comma seperated string quoted and ready for insert/select into/from the database. This is typically used for a statement like "select * from someTable where field in (".$self->session->db->quoteAndJoin(\@strings).")".
|
||||
|
||||
B<NOTE:> This is not a regular method, but is an exported subroutine.
|
||||
|
||||
|
|
@ -555,7 +555,7 @@ sub quoteAndJoin {
|
|||
my $arrayRef = shift;
|
||||
my @newArray;
|
||||
foreach my $value (@$arrayRef) {
|
||||
push(@newArray,$self->quote($value));
|
||||
push(@newArray,$self->$self->session->db->quote($value));
|
||||
}
|
||||
return join(",",@newArray);
|
||||
}
|
||||
|
|
@ -650,7 +650,7 @@ sub setRow {
|
|||
my (@pairs);
|
||||
foreach my $key (keys %{$data}) {
|
||||
unless ($key eq $keyColumn) {
|
||||
push(@pairs, $key.'='.$self->quote($data->{$key}));
|
||||
push(@pairs, $key.'='.$self->$self->session->db->quote($data->{$key}));
|
||||
}
|
||||
}
|
||||
if ($pairs[0] ne "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue