DBIx::StORM::Class

DBIx::StORM::Class
Summary
DBIx::StORM::Class
DBIx::StORM::ClassA base class that can be used to turn a DBIx::StORM::Table into a class in another package.
Functions
config (protected static)Configure this class to specify connection and table information
__dbix_storm_get_config_glob (private static/instance)Fetch the glob which contains the configuration hash
__dbix_storm_get_config (private static/instance)Fetch the configuration hash
__dbix_storm_make_connect (private static/instance)Return an active DBIx::StORM object for this class.
all (public static)Fetch a RecordSet of all the records in the table this class back on to.
connection
grep (public static)Fetch a RecordSet of all the records in the table this meet the criteria of the filter $sub.
_init (protected instance)Initialise a newly created object of this class.
serialise (public instance)Serialise an object to a string description which can be used to fetch it back from the database later.
unserialise (public static)Recreate an object using the string obtained from serialise() and the database.
new (public static)Create a new record object blessed into this class which will be stored in the underlying table.
_stash (protected static)As objects in this class are DBIx::StORM::Records too, you cannot directly change the hash entries as this would change the database.

DBIx::StORM::Class

DBIx::StORM::Class

A base class that can be used to turn a DBIx::StORM::Table into a class in another package.

This class inherits from DBIx::StORM::Record and adds methods to access the records in a given table.  Any records accessed will be automatically blessed into this class.

=end NaturalDocs

Summary
Functions
config (protected static)Configure this class to specify connection and table information
__dbix_storm_get_config_glob (private static/instance)Fetch the glob which contains the configuration hash
__dbix_storm_get_config (private static/instance)Fetch the configuration hash
__dbix_storm_make_connect (private static/instance)Return an active DBIx::StORM object for this class.
all (public static)Fetch a RecordSet of all the records in the table this class back on to.
connection
grep (public static)Fetch a RecordSet of all the records in the table this meet the criteria of the filter $sub.
_init (protected instance)Initialise a newly created object of this class.
serialise (public instance)Serialise an object to a string description which can be used to fetch it back from the database later.
unserialise (public static)Recreate an object using the string obtained from serialise() and the database.
new (public static)Create a new record object blessed into this class which will be stored in the underlying table.
_stash (protected static)As objects in this class are DBIx::StORM::Records too, you cannot directly change the hash entries as this would change the database.

Functions

config (protected static)

sub config

Configure this class to specify connection and table information

Parameters

HashConfiguration information for this class

Returns

Nothing

=end NaturalDocs

__dbix_storm_get_config_glob (private static/instance)

sub __dbix_storm_get_config_glob

Fetch the glob which contains the configuration hash

Parameters

None

Returns

GlobRefthe glob containing the configuration hash

=end NaturalDocs

__dbix_storm_get_config (private static/instance)

sub __dbix_storm_get_config

Fetch the configuration hash

Parameters

None

Returns

HashRefconfiguration information as passed to config()

=end NaturalDocs

__dbix_storm_make_connect (private static/instance)

sub __dbix_storm_make_connect

Return an active DBIx::StORM object for this class.  This may have been cached from an earlier call.

Parameters

None

Returns

ObjectDBIx::StORM connection

=end NaturalDocs

all (public static)

sub all

Fetch a RecordSet of all the records in the table this class back on to.

Parameters

None

Returns

ObjectDBIx::StORM::RecordSet of the records in the table

=end NaturalDocs

connection

sub connection

grep (public static)

sub grep

Fetch a RecordSet of all the records in the table this meet the criteria of the filter $sub.

Parameters

CodeRef $subA filter subroutine that returns true for rows to be included

Returns

ObjectDBIx::StORM::RecordSet of the records in the table that match

=end NaturalDocs

_init (protected instance)

sub _init

Initialise a newly created object of this class.  This differs to new in that new is called only for newly-created records that start life outside the database, while _init is called for all records including those fetched from the database.

Currently is does nothing, but is here so that it can be subclassed.

Parameters

None

Returns

Nothing

=end NaturalDocs

serialise (public instance)

sub serialise

Serialise an object to a string description which can be used to fetch it back from the database later.

By default, it serialises to the value of the primary key columns, joined with a comma.  Any commas or backslashes in these values are backslash-escaped

Parameters

None

Returns

Stringa serialised representation of this object

=end NaturalDocs

unserialise (public static)

sub unserialise

Recreate an object using the string obtained from serialise() and the database.

Currently not implemented.

Parameters

String $stringthe serialised representation of the object

Returns

Objecta record blessed into this package

=end NaturalDocs

new (public static)

sub new

Create a new record object blessed into this class which will be stored in the underlying table.

Parameters

None

Returns

Objecta record blessed into this package

=end NaturalDocs

_stash (protected static)

sub _stash

As objects in this class are DBIx::StORM::Records too, you cannot directly change the hash entries as this would change the database.  This method returns a hash scratchpad which can be edited to store data.  It will not be saved between sessions.

Parameters

None

Returns

HashRefan in-memory scratchpad for this object

=end NaturalDocs

sub config
Configure this class to specify connection and table information
sub __dbix_storm_get_config_glob
Fetch the glob which contains the configuration hash
sub __dbix_storm_get_config
Fetch the configuration hash
sub __dbix_storm_make_connect
Return an active DBIx::StORM object for this class.
sub all
Fetch a RecordSet of all the records in the table this class back on to.
sub connection
sub grep
Fetch a RecordSet of all the records in the table this meet the criteria of the filter $sub.
sub _init
Initialise a newly created object of this class.
sub serialise
Serialise an object to a string description which can be used to fetch it back from the database later.
sub unserialise
Recreate an object using the string obtained from serialise() and the database.
sub new
Create a new record object blessed into this class which will be stored in the underlying table.
sub _stash
As objects in this class are DBIx::StORM::Records too, you cannot directly change the hash entries as this would change the database.
Close