Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d183ece1

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

  • ID d183ece10bbfb9a6aee8ba181ebf493bf7dddcb6
  • Vorgänger 260c52c3
  • Nachfolger 460cd14e

LinkedRecords-Helfer: Dokumentationsupdate

Unterschiede anzeigen:

SL/DB/Helper/LinkedRecords.pm
210 210
all records linked from or to C<$self> are returned.
211 211

  
212 212
The optional parameter C<from> or C<to> (same as C<direction>)
213
contains the package names of Rose models for table limitation. It can
214
be a single model name as a single scalar or multiple model names in
215
an array reference in which case all links matching any of the model
216
names will be returned.
213
contains the package names of Rose models for table limitation (the
214
prefix C<SL::DB::> is optional). It can be a single model name as a
215
single scalar or multiple model names in an array reference in which
216
case all links matching any of the model names will be returned.
217 217

  
218 218
If you only need invoices created from an order C<$order> then the
219 219
call could look like this:
220 220

  
221 221
  my $invoices = $order->linked_records(direction => 'to',
222
                                        to        => 'SL::DB::Invoice');
222
                                        to        => 'Invoice');
223 223

  
224 224
The optional parameter C<query> can be used to limit the records
225 225
returned. The following call limits the earlier example to invoices
226 226
created today:
227 227

  
228 228
  my $invoices = $order->linked_records(direction => 'to',
229
                                        to        => 'SL::DB::Invoice',
229
                                        to        => 'Invoice',
230 230
                                        query     => [ transdate => DateTime->today_local ]);
231 231

  
232 232
The optional parameters C<$params{sort_by}> and C<$params{sort_dir}>

Auch abrufbar als: Unified diff