Fey::Meta::Role::Relationship::HasOne - A role for has-one metaclasses
version 0.47
This role provides functionality for the two has-one metaclasses, Fey::Meta::HasOne::ViaFK and Fey::Meta::HasOne::ViaSelect.
This role adds the following constructor options:
handles
This will simply be passed on when an attribute for this has-one relationship is created. Note that this is ignored if is_cached is false.
is_cached
allows_undef
A boolean indicating whether or not the relationship's value can be undef.
undef
Defaults to true for this class.
This role provides the following methods:
Corresponds to the value passed to the constructor.
Corresponds to the value passed to the constructor, or the calculated default.
This method takes a Fey::Meta::Class::Table object and attaches the relationship to the associated class. If this relationship is cached, it creates a new attribute, otherwise it creates a new method.
The method/attribute returns an object belonging to the class associated with the foreign table. It can return undef if allows_undef is true.
The class associated with this object. This is undefined until $ho->attach_to_class() is called.
$ho->attach_to_class()
Returns the attribute associated with this object, if any.
Returns the method associated with this object, if any.
If this object was attached to a class, it removes any attribute or method it made, and unsets the associated_class.
associated_class
Dave Rolsky <autarch@urth.org>
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.
To install Fey::ORM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fey::ORM
CPAN shell
perl -MCPAN -e shell install Fey::ORM
For more information on module installation, please visit the detailed CPAN module installation guide.