[Dbix-class] Dynamic/Flexible DBIC views
Darius Jokilehto
dariusjokilehto at yahoo.co.uk
Sat Nov 22 12:43:09 GMT 2014
> On Friday, 21 November 2014, 15:35, Christian Lackas <lackas at lackas.net> wrote:
[...]
>
> Thus, just adding another bind value that overrules the search for a
> specific customer.
> And this quickly becomes quite complicated if I know also want to add an
> optional 'customer.type = ?' to work on projects belonging to a set of
> customers, and I don't have any idea how I could implement a
> 'me.customer_id in (?)' with a flexible number.
You can implement this by passing an identity instead of a value, i.e. me.customer_id = me.customer_id. So either pass (untested):
{ -ident => 'me.customer_id' }
or if that doesn't work a scalar ref:
\'me.customer_id'
Granted, it's still not pretty, but it should work.
Darius
More information about the DBIx-Class
mailing list