X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSet.pm;h=597eef5e4e900fa67c78ab6fdabfddc466d51e12;hb=87980de749bd86e74b71f708237b9910790a9b87;hp=eae9193ea0ea517f107e11d8607c281b40ef71ef;hpb=958bcea5fcf02c0c13e934dd03103d8421dcc144;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index eae9193..597eef5 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -280,7 +280,7 @@ Which columns should be retrieved. =head2 join -Contains a list of relations that should be joined for this query. Can also +Contains a list of relationships that should be joined for this query. Can also contain a hash reference to refer to that relation's relations. So, if one column in your class C foo and another C bar, you can do C<< join => [qw/ foo bar /] >> to join both (and e.g. use them for C). @@ -288,6 +288,14 @@ If a foo contains many margles and you want to join those too, you can do C<< join => { foo => 'margle' } >>. If you want to fetch the columns from the related table as well, see C below. +=head2 prefetch + +Contains a list of relationships that should be fetched along with the main +query (when they are accessed afterwards they will have already been +"prefetched"). This is useful for when you know you will need the related +object(s), because it saves a query. Currently limited to prefetching +one relationship deep, so unlike C, prefetch must be an arrayref. + =head2 from This attribute can contain a arrayref of elements. Each element can be another