[Catalyst-commits] r14384 - in CatalystX-CRUD/CatalystX-CRUD/trunk:
. lib/CatalystX/CRUD
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Mon Nov 5 03:08:55 GMT 2012
Author: karpet
Date: 2012-11-05 03:08:55 +0000 (Mon, 05 Nov 2012)
New Revision: 14384
Modified:
CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm
Log:
add Model->put_related() method
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/Changes 2012-11-05 03:06:19 UTC (rev 14383)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/Changes 2012-11-05 03:08:55 UTC (rev 14384)
@@ -259,4 +259,4 @@
* refactor some Controller methods into a Role class
* Model::File->fetch() now returns undef if file does not exist. Add Model::File->prep_new_object().
* add new required method to Object class: is_new()
-
+ * add Model->put_related method
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm 2012-11-05 03:06:19 UTC (rev 14383)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm 2012-11-05 03:08:55 UTC (rev 14384)
@@ -256,6 +256,12 @@
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 remove_related
remove_related() is an alias for rm_related().
@@ -281,6 +287,7 @@
sub rm_related { shift->throw_error("must implement rm_related()") }
*remove_related = \&rm_related;
sub find_related { shift->throw_error("must implement view_related()") }
+sub put_related { shift->throw_error("must implement put_related()") }
sub has_relationship {
shift->throw_error("must implement has_relationship()");
More information about the Catalyst-commits
mailing list