Adrian Witas > Persistence-Entity > Persistence::Attribute::AMCAdapter

Download:
Persistence-Entity-0.07.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Persistence::Attribute::AMCAdapter - Adapter to Abstract::Meta::Class meta object protocol.

CLASS HIERARCHY ^

 Persistence::Attribute
    |
    +----Persistence::Attribute::AMCAdapter

SYNOPSIS ^

    package Employee;

    use Abstract::Meta::Class ':all';
    use Persistence::ORM ':all';

    my $orm = entity 'emp';
    $orm->set_mop_attribute_adapter('Persistence::Attribute::AMCAdapter');
    
    column empno => has('$.no') ;
    column ename => has('$.name');

DESCRIPTION ^

Interface to MOP attribute object adapters.

EXPORT ^

None.

ATTRIBUES

object_creation_method

Returns object creation method. Allowed values: bless or new

attribute

Any MOP atrribute.

METHODS

name

Attribute name.

accessor

Accessor name - name of the method that returns value of the attribute.

    my $accessor = $attribute->accessor;
    my $value = $obj->$accessor;
mutator

Accessor name - name of the method that sets value of the attribute.

storage_key

Attribute storage key.

If this option is set and object_creation_method is set to 'bless' then a new object creation will use bless method

    bless { map {($_->storage_key,  $args{$_->name})} @attributes}, $class

otherwise new method will be used.

    $class->new(map {($_->name,  $args{$_->name})} @attributes);
associated_class

Name of the associated class.

For isntance if you have relationship bettwen My::Employee object and My::Dept then associated_class will be My::Dept

class_name

Class to whom the attribute belongs.

get_value

Returns value form object without triggering any events. Takes object as parameter.

set_value

Sets object value without triggering any events. Takes object, value as parameter.

has_value

Returns true if object has value for the attribute.

find_attribute

Returns attribute Takes class name attribute name.

create_meta_attribute

Return a new persisitence attribute object

install_fetch_interceptor

COPYRIGHT AND LICENSE ^

The Persistence::ORM::Attribute module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

AUTHOR ^

Adrian Witas,adrian@webapp.strefa.pl

syntax highlighting: