The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Elive::DAO::Singleton - Singleton mixin class

DESCRIPTION

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.

Typical usage is:

    package Elive::Entity::SomeEntity;
    use warnings; use strict;

    use Mouse;

    extends 'Elive::DAO::Singleton', 'Elive::Entity';

METHODS

get

    my $server = Elive::Entity::ServerDetails->get(connection => $connection);

Gets the singleton object.

list

    my $server_list = Elive::Entity::SomeEntity->list();
    my $server_obj = $server_list->[0];

Returns the singleton object in a one element array .