NAME
Fey::Meta::HasMany - A parent for has-many metaclasses
DESCRIPTION
This class exists to provide a common parent for the two has-many metaclasses, Fey::Meta::HasMany::ViaFK and Fey::Meta::HasMany::ViaSelect.
CONSTRUCTOR OPTIONS
This class accepts the following constructor options:
is_cached
Defaults to false for this class.
iterator_class
This is the class used for iterators over the objects in this relationship. By default, if this relationship is cached, it uses Fey::Object::Iterator::Caching, otherwise it uses Fey::Object::Iterator
METHODS
This 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>
BUGS
See Fey::ORM for details.
COPYRIGHT & LICENSE
Copyright 2006-2009 Dave Rolsky, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module.