PHP code example of goldfinch / eagerloading
1. Go to this page and download the library: Download goldfinch/eagerloading library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
goldfinch / eagerloading example snippets
MyModelClass::get()->with(['Relation1','Relation2'])->filter(...);
class MyClass extends DataObject {
use Gurucomkz\EagerLoading\EagerLoaderMultiAccessor;
// ...
}
class YourClass extends DataObject
{
private static $eager_loading = [
'Relation1',
'Relation1.Relation4',
'Relation2',
'Relation3',
];
}