NAME

Peace::DAO::Customer - The database access object of customer.

SYNOPSIS

my $customer_dao = Peace::DAO::Customer->new(
  dbh => $dbh,
);

$customer_dao->create( customer => $customer );

my $customer = $customer_dao->recover_by_uuid(
  uuid => $uuid,
);

DESCRIPTION

Peace::DAO::Customer allows you to make database operations over the customers table like recover or create.

INSTANCE METHODS

Peace::DAO::Customer implements the following instance methods:

new

my $customer_dao = Peace::DAO::Customer->new(
   dbh => $dbh,
);

Takes a database handle and instances a Peace::DAO::Customer object.

METHODS

create

$customer_dao->create(
  customer => $customer,
);

Takes a Peace::Model::Customer object and creates its database representation.

As a side effect sets the fields uuid and date_creation in the passed object.

recover_by_uuid

my $customer = $customer_dao->recover_by_uuid(
  uuid => $uuid,
);

SEE ALSO

Peace::DB, DBI, Peace::Model::Customer