Elive::DAO::Singleton - Singleton mixin class
This mixin class provides a get method for fetching the singleton object. It also overrides the Elive::DAO list method, to return just the singleton object in a one element array.
get
Typical usage is:
package Elive::Entity::SomeEntity; use warnings; use strict; use Mouse; extends 'Elive::DAO::Singleton', 'Elive::Entity';
my $server = Elive::Entity::ServerDetails->get(connection => $connection);
Gets the singleton object.
my $server_list = Elive::Entity::SomeEntity->list(); my $server_obj = $server_list->[0];
Returns the singleton object in a one element array .
To install Elive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elive
CPAN shell
perl -MCPAN -e shell install Elive
For more information on module installation, please visit the detailed CPAN module installation guide.