X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FCookbook.pod;h=9b9f9cefc02abe669cf426272be50dd779ac9794;hb=d71502b;hp=8648b7c1032f360fa59c5818fa4cb95e57b22ecf;hpb=3bc50bf9ede81fc810fac966b230ef0f91244fec;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 8648b7c..9b9f9ce 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -428,6 +428,9 @@ literal SQL: # Equivalent SQL: # SELECT * FROM employee WHERE YEAR(date_of_birth) = ? +To include the function as part of a larger search, use the '-and' keyword +to collect the search conditions: + $rs->search({ -and => [ name => 'Bob', \[ 'YEAR(date_of_birth) = ?', 1979 ] @@ -1734,7 +1737,7 @@ methods: numbers => [1, 2, 3] }); - $row->update( + $result->update( { numbers => [1, 2, 3] },