[Dbix-class] Extending 'find' to include constant value for search query

Charlie Garrison garrison at zeta.org.au
Thu Jun 21 23:42:46 GMT 2007


Good morning,

For one of my classes I want to extend the 'find' method so that 
only records belonging to current user will be found. I could 
use 'search' and compose the query, but I would prefer to keep 
semantics of 'find' (cleaner code and all that).

I have tried overriding 'find' in the specific class, but it's 
not getting called. I'm still wrapping my head around 
differences in schema, result_source, result_set, row, etc. and 
which methods each uses. I'm not sure where to put the 
overriding methods for each of those.

So, first my question is, what is the best way to extend find so 
that I can restrict records using an additional (constant) value 
in the query? And if I should just override 'find', where do I 
put my 'find' method?

Thanks,
Charlie

-- 
    Charlie Garrison  <garrison at zeta.org.au>
    PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt



More information about the Dbix-class mailing list