PHP code example of gurucomkz / eagerloading

1. Go to this page and download the library: Download gurucomkz/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/ */

    

gurucomkz / 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',
    ];
}