NAME
DBIx::Class::Relationship::Predicate - Predicates for relationship accessors
SYNOPSIS
package My::Schema::Result::Foo;
__PACKAGE__->load_components(qw( Relationship::Predicate ... Core ));
...
__PACKAGE__->belongs_to('baz' => 'My::Schema::Result::Baz', 'baz_id');
__PACKAGE__->might_have('buzz' => 'My::Schema::Result::Buzz', 'foo_id');
__PACKAGE__->has_many('bars' => 'My::Schema::Result::Bar', 'foo_id');
DESCRIPTION
DBIx::Class component to automatically create predicates for relationship accessors in a result class. By default, it creates "has_${rel_accessor_name}"
methods and injects into the class, thus for that case we would have 'has_baz', 'has_buzz' and 'has_bars' methods on $foo
row object. You can define the name for each one (or also disable its creation using undef
as value) by setting 'predicate' key in the relationship's attrs hashref.
__PACKAGEE_->might_have(
'buzz' => 'My::Schema::Result::Buzz', 'foo_id',
{ 'predicate' => 'got_a_buzz' }
);
or
__PACKAGEE_->might_have(
'buzz' => 'My::Schema::Result::Buzz', 'foo_id',
{ 'predicate' => undef }
);
AUTHOR
Wallace Reis, <wreis at cpan.org>
BUGS
Please report any bugs or feature requests to bug-dbix-class-relationship-predicate at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-Relationship-Predicate. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc DBIx::Class::Relationship::Predicate
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-Relationship-Predicate
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
http://cpanratings.perl.org/d/DBIx-Class-Relationship-Predicate
Search CPAN
http://search.cpan.org/dist/DBIx-Class-Relationship-Predicate/
COPYRIGHT
Copyright 2009 Wallace Reis.
LICENSE
This library is free software and may be distributed under the same terms as perl itself.