NAME

DB::Object::Operator - Operator Object

SYNOPSIS

my $op = $dbh->AND( login => 'joe', status => 'active' );
# will produce:
WHERE login = 'joe' AND status = 'active'

my $op = $dbh->AND( login => 'joe', status => $dbh->NOT( 'active' ) );
# will produce:
WHERE login = 'joe' AND status != 'active'

my $op = $dbh->OR( login => 'joe', login => 'john' );
# will produce:
WHERE login = 'joe' OR login = 'john'

DESCRIPTION

This is a base class for operator objects like DB::Object::AND, DB::Object::OR, and DB::Object::NOT

METHODS

new

Takes a list of values that are saved in the newly created object returned.

operator

Returns nothing by default. The actual value returned is provided by the inheriting package.

value

In list context, returns an array of those values passed to "new" and in scalar context, it returns those value as array reference.

SEE ALSO

DBI, Apache::DBI

AUTHOR

Jacques Deguest <jack@deguest.jp>

COPYRIGHT & LICENSE

Copyright (c) 2019-2021 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.