X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRow.pm;h=995b37b660494b3497aa3fc3cb84ea154f573196;hb=47d7b769c034e04989840b1efc2f5991518cff23;hp=0a2cf4a14be7c09d08b844a8cf09e09076c467a4;hpb=78f7b20c350ff5c2672d6bf49a7260e915e6110f;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 0a2cf4a..995b37b 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -66,9 +66,9 @@ objects. Refer to L for more info. =head2 new - my $row = My::Class->new(\%attrs); + my $result = My::Class->new(\%attrs); - my $row = $schema->resultset('MySource')->new(\%colsandvalues); + my $result = $schema->resultset('MySource')->new(\%colsandvalues); =over @@ -279,18 +279,18 @@ sub new { # Each pair does the same thing # (un-inflated, regular column) - my $val = $row->get_column('first_name'); - my $val = $row->first_name; + my $val = $result->get_column('first_name'); + my $val = $result->first_name; - $row->set_column('first_name' => $val); - $row->first_name($val); + $result->set_column('first_name' => $val); + $result->first_name($val); # (inflated column via DBIx::Class::InflateColumn::DateTime) - my $val = $row->get_inflated_column('last_modified'); - my $val = $row->last_modified; + my $val = $result->get_inflated_column('last_modified'); + my $val = $result->last_modified; - $row->set_inflated_column('last_modified' => $val); - $row->last_modified($val); + $result->set_inflated_column('last_modified' => $val); + $result->last_modified($val); =over @@ -312,7 +312,7 @@ is called on the row. =head2 insert - $row->insert; + $result->insert; =over @@ -464,8 +464,8 @@ sub insert { =head2 in_storage - $row->in_storage; # Get value - $row->in_storage(1); # Set value + $result->in_storage; # Get value + $result->in_storage(1); # Set value =over @@ -486,7 +486,7 @@ calling L on one, sets it to false. =head2 update - $row->update(\%columns?) + $result->update(\%columns?) =over @@ -497,7 +497,7 @@ calling L on one, sets it to false. =back Throws an exception if the result object is not yet in the database, -according to L. +according to L. Returns the object itself. This method issues an SQL UPDATE query to commit any changes to the object to the database if required (see L). @@ -516,9 +516,9 @@ to C, e.g. ( { %{ $href } } ) If the values passed or any of the column values set on the object contain scalar references, e.g.: - $row->last_modified(\'NOW()')->update(); + $result->last_modified(\'NOW()')->update(); # OR - $row->update({ last_modified => \'NOW()' }); + $result->update({ last_modified => \'NOW()' }); The update will pass the values verbatim into SQL. (See L docs). The values in your Result object will NOT change @@ -526,7 +526,7 @@ as a result of the update call, if you want the object to be updated with the actual values from the database, call L after the update. - $row->update()->discard_changes(); + $result->update()->discard_changes(); To determine before calling this method, which column values have changed and will be updated, call L. @@ -564,7 +564,7 @@ sub update { =head2 delete - $row->delete + $result->delete =over @@ -630,7 +630,7 @@ sub delete { =head2 get_column - my $val = $row->get_column($col); + my $val = $result->get_column($col); =over @@ -651,7 +651,7 @@ will be deflated and returned. Note that if you used the C or the C