Jifty-DBI
view release on metacpan or search on metacpan
lib/Jifty/DBI/Collection.pm view on Meta::CPAN
$self->new_item->_apply_input_filters(
column => $column_obj,
value_ref => \$args{'value'},
) if $column_obj && $column_obj->encode_on_select && $args{operator} !~ /IS/;
# Ensure that the column has nothing fishy going on. We can't
# simply check $column_obj's truth because joins mostly join by
# table name, not class, and we don't track table_name -> class.
if ($args{column} =~ /\W/) {
warn "Possible SQL injection on column '$args{column}' in limit at @{[join(',',(caller)[1,2])]}\n";
%args = (
%args,
column => 'id',
operator => '<',
value => 0,
);
}
if ($args{operator} !~ /^(=|<|>|!=|<>|<=|>=
|(NOT\s*)?LIKE
|(NOT\s*)?(STARTS|ENDS)_?WITH
|(NOT\s*)?MATCHES
|IS(\s*NOT)?
|IN)$/ix) {
warn "Unknown operator '$args{operator}' in limit at @{[join(',',(caller)[1,2])]}\n";
%args = (
%args,
column => 'id',
operator => '<',
value => 0,
);
}
# Set this to the name of the column and the alias, unless we've been
lib/Jifty/DBI/Record.pm view on Meta::CPAN
if ( $args{'handle'} ) {
$self->_handle( $args{'handle'} );
}
}
sub import {
my $class = shift;
my ($flag) = @_;
if ( $class->isa(__PACKAGE__) and defined $flag and $flag eq '-base' ) {
my $descendant = (caller)[0];
unless ( $descendant->isa($class) ) {
no strict 'refs';
push @{ $descendant . '::ISA' }, $class
}
shift;
# run the schema callback
my $callback = shift;
$callback->() if $callback;
}
lib/Jifty/DBI/Schema.pm view on Meta::CPAN
Sorry for the inconvenience.
**********************************************************
.
exit 1;
}
elsif ($_[0] =~ /Undefined subroutine &Jifty::DBI::Schema::column|Can't locate object method "type" via package "(?:is|are)"/) {
my $from = (caller)[0];
$from =~ s/::Schema$//;
my $base = $INC{'Jifty/Record.pm'} ? "Jifty::Record" : "Jifty::DBI::Record";
no strict 'refs';
carp @_, << ".";
*********************************************************
Calling 'column' within a schema class is an error:
package $from\::Schema;
( run in 1.562 second using v1.01-cache-2.11-cpan-1e74a51a04c )