PHP Class Elgg\EntityPreloader

Show file Open project: elgg/elgg

Public Properties

Property Type Description
$_callable_cache_checker DO NOT USE. For unit test mocking
$_callable_entity_loader DO NOT USE. For unit test mocking

Public Methods

Method Description
__construct ( EntityCache $entity_cache, EntityTable $entity_table ) Constructor
preload ( object[] $objects, array $guid_properties ) : void Preload entities based on the given objects

Protected Methods

Method Description
getGuidsToLoad ( object[] $objects, array $guid_properties ) : int[] Get GUIDs that need to be loaded

Method Details

__construct() public method

Constructor
public __construct ( EntityCache $entity_cache, EntityTable $entity_table )
$entity_cache Elgg\Cache\EntityCache Entity cache
$entity_table Elgg\Database\EntityTable Entity service

getGuidsToLoad() protected method

To simplify the user API, this function accepts non-arrays and arrays containing non-objects
protected getGuidsToLoad ( object[] $objects, array $guid_properties ) : int[]
$objects object[] Objects from which to pluck GUIDs
$guid_properties array e.g. array("owner_guid")
return int[]

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

Property Details

$_callable_cache_checker public property

DO NOT USE. For unit test mocking
public $_callable_cache_checker

$_callable_entity_loader public property

DO NOT USE. For unit test mocking
public $_callable_entity_loader