[CDBI] Searching using a might_have relationship.
Oliver Jeeves <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
Ok, so I have two CDBI classes, with a might_have relationship between
them. Something like:
package MyDB::A;
use base 'MyDB';
__PACKAGE__->table('a');
__PACKAGE__->columns->(Essential => qw(id this that));
__PACKAGE__->might_have->(b => 'MyDB::B' => qw(other));
package MyDB::B;
use base 'MyDB';
__PACKAGE__->table('b');
__PACKAGE__->columns(Essential => qw(id other));
I want to be able to search like this:
MyDB::A->search(other => 'wibble');
Except that that doesn't work.
Basically, I want to use a value from a might_have relationship to
search, and I don't want to have to do multiple SQL queries to do it. Is
there an easy way to do this?
-Oli
_______________________________________________
ClassDBI mailing list
ClassDBI-Ra3b/[email protected]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFNKuJSbWXajvTQ+URAuiBAJ42GAFRFa0CfKB0V90x0ScWBwdRdACfZEpU XFpj1HZcaHq+uabjeH+qT5A= =kozJ -----END PGP SIGNATURE-----