From: Rob Kinyon Date: Thu, 26 Mar 2009 01:09:55 +0000 (+0000) Subject: Deprecated search_like() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c44f641a491c0cbcfc927b58b7e4938902030144;p=dbsrgits%2FDBIx-Class-Historic.git Deprecated search_like() --- diff --git a/Changes b/Changes index 4d35ad6..36af8cd 100644 --- a/Changes +++ b/Changes @@ -27,6 +27,7 @@ Revision history for DBIx::Class it is called. (eg ->new({ name => 'foo'})->bar if bar uses bar_id) - Currently skipped. Changed exception to have a more detailed message - Document the known issue and a possible work around. + - search_like() now warns to indicate deprecation in 0.09. (robkinyon) 0.08099_06 2009-01-23 07:30:00 (UTC) - Allow a scalarref to be supplied to the 'from' resultset attribute diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index db03b46..816b374 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -860,10 +860,20 @@ You most likely want to use L with specific operators. For more information, see L. +This method is deprecated and will be removed in 0.09. Use L +instead. An example conversion is: + + ->search_like({ foo => 'bar' }); + + # Becomes + + ->search({ foo => { like => 'bar' } }); + =cut sub search_like { my $class = shift; + carp "search_like() is deprecated and will be removed in 0.09. Use search() instead."; my $attrs = (@_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {}); my $query = ref $_[0] eq 'HASH' ? { %{shift()} }: {@_}; $query->{$_} = { 'like' => $query->{$_} } for keys %$query;