| Rose-HTMLx-Form-Related documentation | view source | Contained in the Rose-HTMLx-Form-Related distribution. |
Rose::HTMLx::Form::Related::Metadata - RHTMLO Form class metadata
Rose::HTMLx::Form::Related::Metadata interrogates and caches interrelationships between Form and ORM classes.
You typically access an instance of this class via the metadata() method in your Form class.
Overrides base init() method to build metadata.
Get/set the Rose::HTMLx::Related::Form object.
Get/set the hash ref of RelInfo objects, keyed by the RelInfo->name value.
Boolean indicating whether the View should provide links to related tables based on RDBO relationship method names that do not have corresponding field names.
The default is undef.
Should return a hashref of method (field) names to labels. Useful for giving labels to non-fields like relationship names.
Should return a hashref of method (field) names to any strings that should be prefixed to the name for sorting. This is to support (for example) sorts on multi-table joins.
Default is empty hashref.
Should return the name of the ORM object class the Form class represents.
Default is the Form class name less the ::Form part.
Should return a hashref of field name to a URI value.
Should return the name of the field to sort by in (for example) search results.
Default is null (empty string).
Should return the name of the relationship to show as initially active in an interface.
Default is null (emptry string).
Set hash ref of ORM method names in foreign_class that take the related ORM object as a single argument.
Returns the value from field_uris() for key field_name if such a key exists. Otherwise, returns undef.
Returns array of method names to use for rendering form. Default is form->field_names().
You may want to override this value, especially for large forms, in order to show only a subset of the most meaningful field values.
You may define the Form relationships as an array ref using this method in your subclass, or via the "relationships" key/value pair in new().
If you define this value explicitly, the value must be an array ref of either Rose::HTMLx::Form::Related::RelInfo objects, or hash refs (which will be blessed into Rose::HTMLx::Form::Related::RelInfo objects).
If not defined, discover_relationships() is automatically called internally in new(). The default return value is undef, triggering discover_relationships. You can turn off relationships altogether if you set it to an empty array ref, although that begs the question of why you are using Rose::HTMLx::Form::Related in the first place.
Returns the default value 'Rose::HTMLx::Form::Related::RelInfo'.
This method must be overriden by model-specific subclasses. The method should interrogate object_class() and set the array ref of relinfo_class() objects via the relationships() mutator method.
Returns true if relationship information is known.
Returns the same RelInfo object as related_field(), only using a relationship object or name instead of a field name.
Returns the value from the foreign object related to object for the foreign column related to field_name.
Returns undef if (a) there is no foreign field related to field_name or (b) if there is no foreign object.
Example:
my $username = $form->foreign_field_value( 'email_address', $person ); # $username comes from a $user record related to $person
Peter Karman, <karman at cpan.org>
Please report any bugs or feature requests to
bug-rose-htmlx-form-related at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Rose-HTMLx-Form-Related.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Rose::HTMLx::Form::Related
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Rose-HTMLx-Form-Related
The Minnesota Supercomputing Institute http://www.msi.umn.edu/
sponsored the development of this software.
Copyright 2008 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Rose-HTMLx-Form-Related documentation | view source | Contained in the Rose-HTMLx-Form-Related distribution. |