[Dbix-class] chaining search() and +select/+as

BUCHMULLER Norbert norbi.lists at nix.hu
Tue Oct 14 19:34:16 BST 2008


On Thu, 9 Oct 2008 13:15:13 +0200 BUCHMULLER Norbert <norbi.lists at nix.hu>
wrote:

>   $schema->resultset('Artist')->search(
>     {
>     },
>     {
>       '+select' => [ \'1' ],
>       '+as' => [ 'one' ],
>     }
>   )->search(
>     {
>     },
>     {
>       '+select' => [ \'2' ],
>       '+as' => [ 'two' ],
>     }
>   )->first;

No, I'm not a moron, I don't do the above directly. :-) The problem is
real: if I add a method to a custom resultset class to provide 'canned'
queries and that method uses a '+select' attribute in the search(), then
later I cannot use '+select' in search() on the returned resultset. (That
was exactly how I encountered the problem.) Too bad.

Does anybody have any clue? (Or should I start to dig it up in the
code?;-)

norbi



More information about the DBIx-Class mailing list