[Bast-commits] r3726 - in DBIx-Class: . 0.08/trunk/lib/DBIx/Class 0.08/trunk/lib/DBIx/Class/Manual

semifor at dev.catalyst.perl.org semifor at dev.catalyst.perl.org
Sat Sep 8 17:58:57 GMT 2007


Author: semifor
Date: 2007-09-08 17:58:56 +0100 (Sat, 08 Sep 2007)
New Revision: 3726

Modified:
   DBIx-Class/
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod
   DBIx-Class/0.08/trunk/lib/DBIx/Class/PK.pm
Log:
 r1191 at titanic:  mjm | 2007-09-08 09:20:32 -0700
 discard_changes is also "refresh from storage"



Property changes on: DBIx-Class
___________________________________________________________________
Name: svk:merge
   - d61e1e54-d1c0-42ab-944f-1b6a4b221ec0:/local/dbix-class:1185
   + d61e1e54-d1c0-42ab-944f-1b6a4b221ec0:/local/dbix-class:1191

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod	2007-09-07 16:54:00 UTC (rev 3725)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod	2007-09-08 16:58:56 UTC (rev 3726)
@@ -285,6 +285,18 @@
 If supported by the database, slice will use LIMIT/OFFSET to hint to the database that we
 really only need one row. This can result in a significant speed improvement.
 
+=item .. refresh a row from storage?
+
+Use L<DBIx::Class::PK/discard_changes>.
+
+  $row->discard_changes
+
+Discarding changes and refreshing from storage are two sides fo the same coin.  When you
+want to discard your local changes, just re-fetch the row from storage.  When you want
+to get a new, fresh copy of the row, just re-fetch the row from storage.
+L<DBIx::Class::PK/discard_changes> does just that by re-fetching the row from storage
+using the row's primary key.
+
 =back
 
 =head2 Inserting and updating data

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/PK.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/PK.pm	2007-09-07 16:54:00 UTC (rev 3725)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/PK.pm	2007-09-08 16:58:56 UTC (rev 3726)
@@ -30,6 +30,9 @@
 Re-selects the row from the database, losing any changes that had
 been made.
 
+This method can also be used to refresh from storage, retrieving any
+changes made since the row was last read from storage.
+
 =cut
 
 sub discard_changes {




More information about the Bast-commits mailing list