DBomb::Tie::PrimaryKeyList - A list of primary keys that auto creates objects when fetched.


DBomb documentation  | view source Contained in the DBomb distribution.

Index


NAME

Top

DBomb::Tie::PrimaryKeyList - A list of primary keys that auto creates objects when fetched.

SYNOPSIS

Top

  tie @ids, 'DBomb::Tie::PrimaryKeyList', 'MyPackage::Customer';

  ## store plain ids, or PrimaryKey objects in the list
  for (@{$dbh->selectrow_arrayref("SELECT id FROM Customer")){
      push @ids, $_; ## Stores the [id] key.
  }

  ## Later, fetch the ids as objects.
  $customer = $ids[0];
  print $customer-name;


DBomb documentation  | view source Contained in the DBomb distribution.