25 $this->properties = $guid_properties;
36 $guids = $this->getGuidsToLoad($objects);
40 call_user_func($this->_callable_entity_loader, array(
55 if (!is_array($objects) || count($objects) < 2) {
58 $preload_guids = array();
60 if (is_object($object)) {
61 foreach ($this->properties as $property) {
62 if (empty($object->{$property})) {
65 $guid = $object->{$property};
66 if (
$guid && !call_user_func($this->_callable_cache_checker,
$guid)) {
67 $preload_guids[] =
$guid;
72 return array_unique($preload_guids);
79 public $_callable_cache_checker =
'_elgg_retrieve_cached_entity';
85 public $_callable_entity_loader =
'elgg_get_entities';
$guid
Removes an admin notice.
preload($objects)
Preload entities based on the given objects.
getGuidsToLoad($objects)
Get GUIDs that need to be loaded.
__construct(array $guid_properties)
Configure the preloader to check these properties of fetched objects for GUIDs.