X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FIntro.pod;h=d6c218d043efa38c7551a2782884da0954a61014;hb=d71502b;hp=46c6686d772ff0bb1aa3aaa6ff0caafe8fb5c77b;hpb=8278b5128660bf9b4d7fb028d47429fcc5a46a99;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Manual/Intro.pod b/lib/DBIx/Class/Manual/Intro.pod index 46c6686..d6c218d 100644 --- a/lib/DBIx/Class/Manual/Intro.pod +++ b/lib/DBIx/Class/Manual/Intro.pod @@ -67,7 +67,7 @@ The important thing to understand: =head2 Search results are returned as Rows Rows of the search from the database are blessed into -L objects. +L objects. =head1 SETTING UP DBIx::Class @@ -156,8 +156,9 @@ of information that it may be useful to have -- just pass C a hash: ); DBIx::Class doesn't directly use most of this data yet, but various related -modules such as L make use of it. Also it allows you to -create your database tables from your Schema, instead of the other way around. +modules such as L make use of it. +Also it allows you to create your database tables from your Schema, +instead of the other way around. See L for details. See L for more details of the possible column @@ -396,7 +397,7 @@ attributes: my @albums = My::Schema->resultset('Album')->search( { artist => 'Bob Marley' }, - { rows => 2, order_by => 'year DESC' } + { rows => 2, order_by => { -desc => 'year' } } ); C<@albums> then holds the two most recent Bob Marley albums. @@ -426,7 +427,7 @@ important to declare a L on all your result sources B. In a pinch one can always declare each row identifiable by all its columns: - __PACKAGE__->set_primary_keys (__PACKAGE__->columns); + __PACKAGE__->set_primary_key(__PACKAGE__->columns); Note that DBIx::Class is smart enough to store a copy of the PK values before any row-object changes take place, so even if you change the values of PK @@ -444,10 +445,10 @@ L For example, the following would not work (assuming C does not have a declared PK): - my $row = $schema->resultset('People') + my $result = $schema->resultset('People') ->search({ last_name => 'Dantes' }) ->next; - $row->update({ children => 2 }); # <-- exception thrown because $row isn't + $result->update({ children => 2 }); # <-- exception thrown because $result isn't # necessarily unique So instead the following should be done: