From: Alexander Hartmaier Date: Tue, 16 Apr 2013 18:02:39 +0000 (+0200) Subject: Clarify how to use SQL functions as part of a larger search X-Git-Tag: v0.08250~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d05ca4691cacad276c21edc1e40f1375aefe2568;hp=3bc50bf9ede81fc810fac966b230ef0f91244fec;p=dbsrgits%2FDBIx-Class.git Clarify how to use SQL functions as part of a larger search --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 8648b7c..588c315 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 ]