[Catalyst-commits] r14389 -
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Mon Nov 5 04:57:25 GMT 2012
Author: karpet
Date: 2012-11-05 04:57:25 +0000 (Mon, 05 Nov 2012)
New Revision: 14389
Modified:
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter.pm
Log:
add put_related and find_related to ModelAdapter
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter.pm 2012-11-05 04:46:50 UTC (rev 14388)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter.pm 2012-11-05 04:57:25 UTC (rev 14389)
@@ -155,6 +155,17 @@
It is up to the subclass to implement this method.
+=item put_related( I<obj>, I<rel_name>, I<foreign_value> )
+
+Create new related foreign object. Unlike add_related(),
+the foreign object need not already exist. put_related()
+should be idempotent.
+
+=item find_related( I<obj>, I<rel_name>, I<foreign_value> )
+
+Return related object for I<foreign_value> based on I<rel_name>
+for I<obj>.
+
=head2 has_relationship( I<controller>, I<context>, I<obj>, I<rel_name> )
Should return true or false as to whether I<rel_name> exists for
@@ -165,8 +176,10 @@
=cut
-sub add_related { shift->throw_error("must implement add_related()") }
-sub rm_related { shift->throw_error("must implement rm_related()") }
+sub add_related { shift->throw_error("must implement add_related()") }
+sub rm_related { shift->throw_error("must implement rm_related()") }
+sub put_related { shift->throw_error("must implement put_related()") }
+sub find_related { shift->throw_error("must implement find_related()") }
sub has_relationship {
shift->throw_error("must implement has_relationship()");
More information about the Catalyst-commits
mailing list