Elgg\EntityPreloader::preload PHP Method

preload() public method

Preload entities based on the given objects
public preload ( object[] $objects, array $guid_properties ) : void
$objects object[] Objects--e.g. loaded from an Elgg query--from which we can pluck GUIDs to preload
$guid_properties array e.g. array("owner_guid")
return void
    public function preload($objects, array $guid_properties)
    {
        $guids = $this->getGuidsToLoad($objects, $guid_properties);
        // If only 1 to load, not worth the overhead of elgg_get_entities(),
        // get_entity() will handle it later.
        if (count($guids) > 1) {
            call_user_func($this->_callable_entity_loader, array('guids' => $guids));
        }
    }