Elgg  Version master
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Elgg\EntityPreloader Class Reference

Preload entities based on properties of fetched objects. More...

Public Member Functions

 __construct (EntityCache $entity_cache)
 Constructor. More...
 
 preload ($objects, array $guid_properties)
 Preload entities based on the given objects. More...
 

Public Attributes

const MAX_PRELOAD = 256
 
 $_callable_cache_checker
 
 $_callable_entity_loader
 

Protected Member Functions

 getGuidsToLoad ($objects, array $guid_properties)
 Get GUIDs that need to be loaded. More...
 

Detailed Description

Preload entities based on properties of fetched objects.

Definition at line 13 of file EntityPreloader.php.

Constructor & Destructor Documentation

Elgg\EntityPreloader::__construct ( EntityCache  $entity_cache)

Constructor.

Parameters
EntityCache$entity_cacheEntity cache

Definition at line 34 of file EntityPreloader.php.

Member Function Documentation

Elgg\EntityPreloader::getGuidsToLoad (   $objects,
array  $guid_properties 
)
protected

Get GUIDs that need to be loaded.

To simplify the user API, this function accepts non-arrays and arrays containing non-objects

Parameters
object[]$objects Objects from which to pluck GUIDs
string[]$guid_properties e.g. array("owner_guid")
Returns
int[]

Definition at line 76 of file EntityPreloader.php.

Elgg\EntityPreloader::preload (   $objects,
array  $guid_properties 
)

Preload entities based on the given objects.

Parameters
object[]$objects Objects–e.g. loaded from an Elgg query–from which we can pluck GUIDs to preload
string[]$guid_properties e.g. array("owner_guid")
Returns
void

Definition at line 52 of file EntityPreloader.php.

Member Data Documentation

Elgg\EntityPreloader::$_callable_cache_checker

Definition at line 21 of file EntityPreloader.php.

Elgg\EntityPreloader::$_callable_entity_loader

Definition at line 27 of file EntityPreloader.php.

const Elgg\EntityPreloader::MAX_PRELOAD = 256

Definition at line 15 of file EntityPreloader.php.


The documentation for this class was generated from the following file: