NAME

Handel::DBI - Base DBI class used by cart/order objects

SYNOPSIS

use Handel::DBI;

my $newid = Handel::DBI::uuid;

VERSION

$Id: DBI.pm 30 2004-12-31 02:11:29Z claco $

DESCRIPTION

This is the main base class for Handel objects that access the database. There shouldn't be and reason to use this module directly for now.

FUNCTIONS

uuid

Returns a guid/uuid using UUID or Data::UUID depending on the platform.

use Handel::DBI;

my $newid = Handel::DBI::uuid;

Since Handel::Cart and Handel::Cart::Item are subclasses of Handel::DBI, uuid is available within those modules as a method/function as well

use Handel::Cart;

my $newid = Handel::Cart->uuid;

has_wildcard

Inspects the supplied search filter to determine whether it contains wildcard searching. Retuns 1 if the filter contains SQL wildcards, other it returns undef.

has_wildcard({sku => '1234'}); # 1
has_wildcard((sku => '12%'));  # undef

This is used by Handel::Cart->items and Handel::Cart::load to determine which Class::DBI methods to call (search vs. search_like).

ENVIRONMENT VARIABLES

For now, Handel::DBI constructs its connection string using the following variables:

db_driver

The name of the DBD driver. Defailts to mysql.

db_host

The name of the database server. Defaults to localhost.

db_port

The port of the database server. Defaults to 3306.

db_name

The name of the database. Defaults to commerce.

db_user

The user name used to connect to the server. Defaults to commerce.

db_pass

The password used to connect to the server. Defaults to commerce.

At some point, this needs to be reworked into a more generic config loader so we can use $ENV, httpd.conf directives, of config files, etc.

SEE ALSO

UUID, Data::UUID

AUTHOR

Christopher H. Laco
CPAN ID: CLACO
cpan@chrislaco.com
http://today.icantfocus.com/blog/