15 const MAX_PRELOAD = 256;
34 public function preload(array $objects, array $guid_properties):
void {
35 $guids = $this->getGuidsToLoad($objects, $guid_properties);
42 'limit' => self::MAX_PRELOAD,
58 protected function getGuidsToLoad(array $objects, array $guid_properties): array {
59 if (
count($objects) < 2) {
65 if (!is_object($object)) {
69 foreach ($guid_properties as $property) {
70 if (empty($object->{$property})) {
74 $guid = (int) $object->{$property};
75 if (
$guid && is_null($this->entity_cache->load(
$guid))) {
76 $preload_guids[] =
$guid;
81 return array_unique($preload_guids);
__construct(protected EntityCache $entity_cache)
Constructor.
getGuidsToLoad(array $objects, array $guid_properties)
Get GUIDs that need to be loaded.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
preload(array $objects, array $guid_properties)
Preload entities based on the given objects.
Volatile cache for entities.
$guids
Activates all specified installed and inactive plugins.
if($email instanceof\Elgg\Email) $object
Preload entities based on properties of fetched objects.
$guid
Reset an ElggUpgrade.