X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2FMaypole%2FModel%2FBase.pm;h=580e6e1c942cb7cbfd3be63dae9f1cd4c6a74590;hb=5e9b1336d1f20d57953e3e419fa7d68e79723528;hp=0d534a542559e0ec5448c29ffe805bb729317a05;hpb=72ebd12372713c17bb79d6510f3da7c7b4561338;p=maypole.git diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index 0d534a5..580e6e1 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -15,9 +15,7 @@ sub process { return if $r->{template}; # Authentication has set this, we're done. $r->{template} = $method; - $r->objects( [] ); - my $obj = $class->retrieve( $r->{args}->[0] ); - $r->objects( [$obj] ) if $obj; + $r->objects([ $class->fetch_objects($r) ]); $class->$method( $r, $obj, @{ $r->{args} } ); } @@ -65,9 +63,9 @@ C. This maps between a table name and its associated class. -=head2 retrieve +=head2 fetch_objects -This turns an ID into an object of the appropriate class. +This method should populate $r->objects from $r->{args}. =head2 adopt @@ -87,6 +85,7 @@ This is the name of the table. sub class_of { die "This is an abstract method" } sub setup_database { die "This is an abstract method" } +sub fetch_objects { die "This is an abstract method" } =head2 Commands