r62507@cain (orig r402): groditi | 2007-11-14 18:33:11 +0000
[catagits/Reaction.git] / lib / Reaction / InterfaceModel / Collection / DBIC / Role / Base.pm
index 2da485c..ee32997 100644 (file)
@@ -30,14 +30,14 @@ role Base, which {
   #};
 
   #Oh man. I have a bad feeling about this one.
-  implements _build_im_class => as {
+  implements _build__im_class => as {
     my $self = shift;
-    my $class = blessed $self || $self;
+    my $class = blessed($self) || $self;
     $class =~ s/::Collection$//;
     return $class;
   };
 
-  implements _build_collection_store => as {
+  implements _build__collection_store => as {
     my $self = shift;
     my $im_class = $self->_im_class;
     [ $self->_source_resultset->search({}, {result_class => $im_class})->all ];
@@ -66,6 +66,21 @@ role Base, which {
     confess "Not yet implemented";
   };
 
+
+  implements page => as {
+    my $self = shift;
+    my $rs = $self->_source_resultset->page(@_);
+    return (blessed $self)->new(
+                                _source_resultset => $rs,
+                                _im_class => $self->_im_class,
+                               );
+  };
+
+  implements pager => as {
+    my $self = shift;
+    return $self->_source_resultset->pager(@_);
+  };
+
 };
 
 1;