NAME

App::RepositoryObject - Interface for data persistence

SYNOPSIS

use App::RepositoryObject;

...

DESCRIPTION

A RepositoryObject is an object whose state is stored in a repository. It is a base class for many business classes.

All RepositoryObjects are created using the $rep->get_object() or $rep->get_objects() methods, and they all have the following attributes.

$self->{_repository} - the Repository which the object came from
$self->{_table}      - the table name associated with the object
$self->{_key}        - the unique identifier of the object in the
                       table in the repository

I am considering adding the following standard attribute, but I have not yet decided whether I should.

$self->{_context}    - the Context the object is running in

Public Methods

get()

* Signature: $value = $obj->get($attrib);
* Signature: $value = $obj->get($attrib, $options);
* Param:     $attrib      string,ARRAY
* Return:    $value       any,ARRAY
* Throws:    App::Exception
* Since:     0.01

Sample Usage: 

$value = $obj->get($attrib);

Gets the value of one or more attributes of an object.

set()

* Signature: $obj->set($attrib, $value);
* Signature: $obj->set($attrib, $value, $options);
* Param:     $attrib      string,ARRAY
* Param:     $value       any,ARRAY
* Param:     $options     any,ARRAY
* Throws:    App::Exception
* Since:     0.01

Sample Usage: 

$obj->set($attrib, $value);

Sets the value of one or more attributes of an object.

delete()

* Signature: $obj->delete();
* Signature: $obj->delete($options);
* Param:     $options        ARRAY
* Throws:    App::Exception
* Since:     0.01

Sample Usage: 

$obj->delete();

Deletes the object out of the repository.

Private Methods

_init()

* Signature: $obj->_init();
* Param:     void
* Return:    void
* Throws:    App::Exception
* Since:     0.01

Sample Usage: 

$obj->_init();

This method initializes the values of a newly created object. The default implementation on the App::RepositoryObject base class does nothing. It is provided so that it may be overridden in a subclass if desired.

ACKNOWLEDGEMENTS

* Author:  Stephen Adkins <spadkins@gmail.com>
* License: This is free software. It is licensed under the same terms as Perl itself.

SEE ALSO

App::Context, App::Repository