Fix a filter/single issue
[catagits/Reaction.git] / lib / Reaction / InterfaceModel / Collection.pm
index 05e0c50..068e1c0 100644 (file)
@@ -1,11 +1,12 @@
 package Reaction::InterfaceModel::Collection;
 
-use Reaction::InterfaceModel::ObjectClass;
+use Reaction::Class;
 use Scalar::Util qw/refaddr blessed/;
+use aliased 'Reaction::Meta::InterfaceModel::Object::DomainModelAttribute';
 
 # WARNING - DANGER: this is just an RFC, please DO NOT USE YET
 
-class Collection, which {
+class Collection is "Reaction::InterfaceModel::Object", which {
 
   # consider supporting slice, first, iterator, last etc.
   # pager functionality should probably be a role
@@ -24,10 +25,17 @@ class Collection, which {
   # THEM CORRECT, OR FINAL. JUST A ROUGH DRAFT.
 
   #domain_models are 'ro' unless otherwise specified
-  domain_model _collection_store => (is => 'rw', isa => 'ArrayRef',
-                                     lazy_build => 1, clearer => "_clear_collection_store");
+  has _collection_store => (
+                            is  => 'rw',
+                            isa => 'ArrayRef',
+                            lazy_build => 1,
+                            clearer    => "_clear_collection_store",
+                            metaclass  => DomainModelAttribute,
+                           );
 
-  implements _build_collection_store => as { [] };
+  has 'member_type' => (is => 'ro', isa => 'ClassName');
+
+  implements _build__collection_store => as { [] };
 
   implements members => as {
     my $self = shift;
@@ -70,7 +78,7 @@ class Collection, which {
 =head1 NAME
 
 Reaction::InterfaceModel::Collection - Generic collections of
-C<Reaction::InterfaceModel::Object>s
+L<Reaction::InterfaceModel::Object>s
 
 =head1 DESCRIPTION
 
@@ -106,7 +114,7 @@ presently stored. Has a clearer of C<_clear_collection_store> and a predicate of
 
 =head1 PRIVATE METHODS
 
-_build_collection_store
+_build__collection_store
 
 Builder method for attribute_collection_store, returns an empty arrayref