>>>>> "Bill" == Bill Moseley <[email protected]> writes:
Bill> Sorry, perhaps I am misunderstanding your suggestion. My question
was:
Bill> For any resultset "$rs", determine if it's joined to (or
Bill> selects from) table "foo", and if so, what is the alias for
Bill> that table.
Bill> The idea is to have a single place that can add in the
Bill> criteria to all resultsets that join to a given table.
The suggestion is that you drop that approach altogether and use proper
OO instead. If you join via ->related_resultset, you'll get the
appropriate resultset object and you can run methods on it without
resorting to monkey-patching against the DBIC internals, i.e.:
$rs->related_resultset('foo')
vs
$rs->search({}, {join => 'foo'})
And then you can spread out the "check" logic in each resultset class
appropriately.
Of course, this doesn't work for multiple joins, and I'd suggest a view
for that anyway.
--
Eden Cardim Need help with your perl Catalyst or DBIx::Class
project?
Software Engineer http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment
platform?
http://blog.edencardim.com http://www.shadowcat.co.uk/servers/
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]