DBIx-Struct
view release on metacpan or search on metacpan
lib/DBIx/Struct.pm view on Meta::CPAN
$data;
}
sub make_object_update {
my ($table, $pk_where, $pk_row_data) = @_;
my $update;
if (not ref $table) {
# means this is just one simple table
$update = <<UPD;
sub update {
my \$self = \$_[0];
if(\@_ > 1 && CORE::ref(\$_[1]) eq 'HASH') {
my (\$set, \$where, \@bind, \@bind_where);
{
no strict 'vars';
local *set_hash = \$_[1];
my \@unknown_columns = CORE::grep {not CORE::exists \$fields{\$_}} CORE::keys %set_hash;
DBIx::Struct::error_message {
result => 'SQLERR',
message => 'unknown columns '.CORE::join(", ", \@unknown_columns).' updating table $table'
lib/DBIx/Struct.pm view on Meta::CPAN
}
}
);
\$#\$self = @{[_row_data]};
}
\$self;
}
UPD
} else {
$update = <<UPD;
sub update {}
UPD
}
$update;
}
sub make_object_delete {
my ($table, $pk_where, $pk_row_data) = @_;
my $delete;
if (not ref $table) {
$delete = <<DEL;
( run in 0.340 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )