Renamed DBIx::Class::PK's retrieve() as find()
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Relationship.pm
index 569de9b..14741b0 100644 (file)
@@ -104,18 +104,18 @@ sub _cond_value {
 
 sub search_related {
   my $self = shift;
-  $self->_from_sql_related('retrieve', @_);
+  return $self->_literal_related('search', @_);
 }
 
 sub count_related {
   my $self = shift;
-  $self->_from_sql_related('count', @_);
+  return $self->_literal_related('count', @_);
 }
 
-sub _from_sql_related {
+sub _literal_related {
   my $self = shift;
   my $op = shift;
-  my $meth = "${op}_from_sql";
+  my $meth = "${op}_literal";
   my $rel = shift;
   my $attrs = { };
   if (@_ > 1 && ref $_[$#_] eq 'HASH') {
@@ -134,6 +134,7 @@ sub _from_sql_related {
                                  # to merge into the AST really?
   my ($cond) = $self->_cond_resolve($rel_obj->{cond}, $attrs);
   $cond = "${s_cond} AND ${cond}" if $s_cond;
+  #warn $rel_obj->{class}." $meth $cond ".join(', ', @{$attrs->{bind}});
   return $rel_obj->{class}->$meth($cond, @{$attrs->{bind} || []}, $attrs);
 }