X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FPK.pm;h=cf8a194cc99f7a1fb51b82594c4cdf680d734163;hb=3ce9dd081d5e76a1d41714da8b77f699342bff7d;hp=bb820e2a2d898e86fa4ec347db20170fa232d331;hpb=ed213e857791d1cfb0f1a0e32674e81358e19564;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/PK.pm b/lib/DBIx/Class/PK.pm index bb820e2..cf8a194 100644 --- a/lib/DBIx/Class/PK.pm +++ b/lib/DBIx/Class/PK.pm @@ -20,28 +20,6 @@ depending on them. =cut -sub _ident_values { - my ($self) = @_; - return (map { $self->{_column_data}{$_} } $self->primary_columns); -} - -=head2 discard_changes - -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 { - my ($self) = @_; - my $storage = $self->result_source->schema->storage; - $storage->reload_row($self); - return $self; -} - =head2 id Returns the primary key(s) for a row. Can't be called as @@ -57,12 +35,28 @@ sub id { return (wantarray ? @pk : $pk[0]); } +sub _ident_values { + my ($self) = @_; + return (map { $self->{_column_data}{$_} } $self->primary_columns); +} + =head2 ID Returns a unique id string identifying a row object by primary key. Used by L and L. +=over + +=item WARNING + +The default C<_create_ID> method used by this function orders the returned +values by the alphabetical order of the primary column names, B +the L method, which follows the same order in which columns were fed +to L. + +=back + =cut sub ID {