Elive::DAO::Singleton - Singleton mixin class


Elive documentation  | view source Contained in the Elive distribution.

Index


NAME

Top

Elive::DAO::Singleton - Singleton mixin class

DESCRIPTION

Top

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

Top

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 .


Elive documentation  | view source Contained in the Elive distribution.