NAME

Fey::Meta::Role::Relationship::HasMany - A role for has-many metaclasses

VERSION

version 0.47

DESCRIPTION

This role provides shared functionality for the two has-many metaclasses, Fey::Meta::HasMany::ViaFK and Fey::Meta::HasMany::ViaSelect.

CONSTRUCTOR OPTIONS

This role adds the following constructor options:

METHODS

This role provides the following methods:

$hm->name()

Corresponds to the value passed to the constructor.

$hm->table()

Corresponds to the value passed to the constructor.

$hm->foreign_table()

Corresponds to the value passed to the constructor.

$ho->is_cached()

Corresponds to the value passed to the constructor, or the calculated default.

$hm->iterator_class()

Corresponds to the value passed to the constructor, or the calculated default.

$hm->attach_to_class($class)

This method takes a Fey::Meta::Class::Table object and attaches the relationship to the associated class. Doing so will create a new method in the associated class.

$hm->associated_class()

The class associated with this object. This is undefined until $hm->attach_to_class() is called.

$hm->associated_method()

Returns the method associated with this object, if any.

$hm->detach_from_class()

If this object was attached to a class, it removes the method it made, and unsets the associated_class.

AUTHOR

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 - 2015 by Dave Rolsky.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.