34 $this->_callable_cache_checker =
function (
$guid)
use ($entity_cache) {
37 $this->_callable_entity_loader =
function (
$options)
use ($entity_table) {
51 public function preload($objects, array $guid_properties) {
52 $guids = $this->getGuidsToLoad($objects, $guid_properties);
56 call_user_func($this->_callable_entity_loader, array(
58 'limit' => EntityCache::MAX_SIZE,
73 if (!is_array($objects) || count($objects) < 2) {
76 $preload_guids = array();
78 if (is_object($object)) {
79 foreach ($guid_properties as $property) {
80 if (empty($object->{$property})) {
83 $guid = $object->{$property};
84 if (
$guid && !call_user_func($this->_callable_cache_checker,
$guid)) {
85 $preload_guids[] =
$guid;
90 return array_unique($preload_guids);
$object
These two snippets demonstrates triggering an event and how to register for that event.
$guid
Removes an admin notice.
__construct(EntityCache $entity_cache, EntityTable $entity_table)
Constructor.
Volatile cache for entities.
getGuidsToLoad($objects, array $guid_properties)
Get GUIDs that need to be loaded.
getEntities(array $options=array())
Returns an array of entities with optional filtering.
get($guid)
Retrieve a entity from the cache.
preload($objects, array $guid_properties)
Preload entities based on the given objects.
Preload entities based on properties of fetched objects.
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use