[Catalyst-commits] r8208 - in
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk: .
lib/CatalystX/CRUD/ModelAdapter
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Mon Aug 11 14:52:48 BST 2008
Author: karpet
Date: 2008-08-11 14:52:48 +0100 (Mon, 11 Aug 2008)
New Revision: 8208
Modified:
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/MANIFEST
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm
Log:
add missing pod and update MANIFEST
Modified: CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/MANIFEST
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/MANIFEST 2008-08-11 13:39:36 UTC (rev 8207)
+++ CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/MANIFEST 2008-08-11 13:52:48 UTC (rev 8208)
@@ -8,3 +8,14 @@
t/01-dbic.t
t/pod-coverage.t
t/pod.t
+t/example.sql
+t/insertdb.pl
+t/lib/MyApp.pm
+t/lib/MyApp/Controller/CRUD.pm
+t/lib/MyApp/Model/Main.pm
+t/lib/MyForm.pm
+t/lib/MyModelAdapter.pm
+t/MyDB/Main.pm
+t/MyDB/Main/Artist.pm
+t/MyDB/Main/Cd.pm
+t/MyDB/Main/Track.pm
Modified: CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm 2008-08-11 13:39:36 UTC (rev 8207)
+++ CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm 2008-08-11 13:52:48 UTC (rev 8208)
@@ -35,6 +35,13 @@
=cut
+=head2 new_object( I<controller>, I<context>, I<moniker> )
+
+Implement required method. Returns empty new_result() object
+from resultset() of I<moniker>.
+
+=cut
+
sub new_object {
my $self = shift;
my $controller = shift;
@@ -44,6 +51,14 @@
->new_result( {} );
}
+=head2 fetch( I<controller>, I<context>, I<moniker> [, I<args>] )
+
+Implements required method. Returns new_object() matching I<args>.
+I<args> is passed to the find() method of the resultset() for I<moniker>.
+If I<args> is not passed, fetch() acts the same as calling new_object().
+
+=cut
+
sub fetch {
my $self = shift;
my $controller = shift;
@@ -70,6 +85,13 @@
}
}
+=head2 search( I<controller>, I<context>, I<args> )
+
+Implements required method. Returns array or array ref, based
+on calling context, for a search() in resultset() for I<args>.
+
+=cut
+
sub search {
my ( $self, $controller, $c, @arg ) = @_;
my $query = shift(@arg) || $self->make_query( $c, $controller );
@@ -89,6 +111,13 @@
return $moniker;
}
+=head2 iterator( I<controller>, I<context>, I<args> )
+
+Implements required method. Returns iterator
+for a search() in resultset() for I<args>.
+
+=cut
+
sub iterator {
my ( $self, $controller, $c, @arg ) = @_;
my $query = shift(@arg) || $self->make_query( $c, $controller );
@@ -99,6 +128,12 @@
return $rs;
}
+=head2 count( I<controller>, I<context>, I<args> )
+
+Implements required method. Returns count() in resultset() for I<args>.
+
+=cut
+
sub count {
my ( $self, $controller, $c, @arg ) = @_;
my $query = shift(@arg) || $self->make_query( $c, $controller );
@@ -106,6 +141,13 @@
->resultset( $self->_get_moniker( $controller, $c ) )->count(@$query);
}
+=head2 make_query( I<context>, I<controller>, I<field_names> )
+
+Returns an array ref of query data based on request params in I<context>,
+using param names that match I<field_names>.
+
+=cut
+
sub make_query {
my $self = shift;
my $c = shift;
@@ -158,22 +200,46 @@
return \@fields;
}
+=head2 create( I<context>, I<dbic_object> )
+
+Calls insert() on I<dbic_object>.
+
+=cut
+
sub create {
my ( $self, $c, $object ) = @_;
$object->insert;
}
+=head2 read( I<context>, I<dbic_object> )
+
+Calls find() on I<dbic_object>.
+
+=cut
+
sub read {
my ( $self, $c, $object ) = @_;
$object->find; # TODO is this right?
}
+=head2 update( I<context>, I<dbic_object> )
+
+Calls update() on I<dbic_object>.
+
+=cut
+
sub update {
my ( $self, $c, $object ) = @_;
$object->update;
}
+=head2 delete( I<context>, I<dbic_object> )
+
+Calls delete() on I<dbic_object>.
+
+=cut
+
sub delete {
my ( $self, $c, $object ) = @_;
$object->delete;
More information about the Catalyst-commits
mailing list