Вячеслав Тихановский > ObjectDB-0.990103 > ObjectDB::Relationship::ManyToOne

Download:
ObjectDB-0.990103.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

ObjectDB::Relationship::ManyToOne - many to one relationship for ObjectDB

SYNOPSIS ^

    package Article;

    use strict;
    use warnings;

    use base 'ObjectDB';

    __PACKAGE__->schema(
        table          => 'article',
        columns        => [qw/ id author_id title /],
        primary_keys   => ['id'],
        auto_increment => 'id',

        relationships => {
            author => {
                type  => 'many to one',
                class => 'Author',
                map   => {author_id => 'id'}
            }
        }
    );

    1;

DESCRIPTION ^

Many to one relationship for ObjectDB.

ATTRIBUTES ^

map

Hash reference holding columns mappings.

METHODS ^

new

Returns new ObjectDB::Relationship::ManyToOne instance.

to_source

Returns generated join arguments that are passed to the sql generator. Used internally.

AUTHOR ^

Viacheslav Tykhanovskyi, vti@cpan.org.

COPYRIGHT ^

Copyright (C) 2009, Viacheslav Tykhanovskyi.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.

syntax highlighting: