Revision 913348ce
Von Moritz Bunkus vor mehr als 7 Jahren hinzugefügt
SL/DB/Object.pm | ||
---|---|---|
324 | 324 |
caches them for the duration of the current request (see |
325 | 325 |
L<SL::Request/cache>). |
326 | 326 |
|
327 |
If you know in advance that you will likely need all objects of a |
|
328 |
particular type then you can pre-cache them by calling the manager's |
|
329 |
C<cache_all> function. For example, if you expect to need all unit |
|
330 |
objects, you can use C<SL::DB::Manager::Unit-E<gt>cache_all> before |
|
331 |
you start the actual work. Later you can use |
|
332 |
C<SL::DB::Unit-E<gt>load_cached> to retrieve individual objects and be |
|
333 |
sure that they're already cached. |
|
334 |
|
|
327 | 335 |
This method can be called both as an instance method and a class |
328 | 336 |
method. It loads objects for the corresponding class (e.g. both |
329 | 337 |
C<SL::DB::Part-E<gt>load_cached(…)> and |
Auch abrufbar als: Unified diff
SL::DB::Helper::Manager: neue Funktion zum Pre-Cachen aller Einträge einer Tabelle