X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FCookbook.pod;fp=lib%2FDBIx%2FClass%2FManual%2FCookbook.pod;h=3270f035c67ae51e40e939762fab40098a2e4cd1;hb=10e72c6e2d60efceb8c64ef008a9fbdeb1f43852;hp=7c2c58e7e53458843b396cbfdcdc84ced6bbcf7c;hpb=795c37a39e8807b69a1212275c951e0f750d8001;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 7c2c58e..3270f03 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -1740,27 +1740,28 @@ methods: numbers => [1, 2, 3] }); - $result->update( - { - numbers => [1, 2, 3] - }, - { - day => '2008-11-24' - } - ); + $result->update({ + numbers => [1, 2, 3] + day => '2008-11-24' + }); In conditions (e.g. C<\%cond> in the L family of methods) you cannot directly use array references (since this is interpreted as a list of values to be Ced), but you can use the following syntax to force passing them as bind values: - $resultset->search( - { - numbers => \[ '= ?', [numbers => [1, 2, 3]] ] - } - ); + $resultset->search({ + numbers => { -value => [1, 2, 3] }, + }); + +Alternatively: + + $resultset->search({ + numbers => \[ '= ?', [numbers => [1, 2, 3]] ] + }); + -See L and L and L for more explanation. Note that L sets L to C, so you must pass the bind values (the C<[1, 2, 3]> arrayref in the above example) wrapped in