Fill the forum cache.

@param   int[]       $forumids
353953
protected function fill_forum_cache($forumids) {
        global $DB;

        $requiredfields = [
                'id',
                'course',
                'forcesubscribe',
                'type',
            ];
        list($in, $params) = $DB->get_in_or_equal($forumids);
        $this->forums = $DB->get_records_select('forum', "id $in", $params, '', implode(', ', $requiredfields));
        foreach ($this->forums as $id => $forum) {
            \mod_forum\subscriptions::fill_subscription_cache($id);
            \mod_forum\subscriptions::fill_discussion_subscription_cache($id);
        }
    }
582447
public function cleanup( array $siteids )
	{
		$path = 'mshop/customer/manager/lists/type/submanagers';
		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) {
			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
		}

		$this->cleanupBase( $siteids, 'mshop/customer/manager/lists/type/fosuser/delete' );
	}
479354
public function addParticipants($userIds)
    {
        if (is_array($userIds)) {
            foreach ($userIds as $id) {
                $this->users()->attach($id);
            }
        } else {
            $this->users()->attach($userIds);
        }

        if (Chat::makeThreeOrMoreUsersPublic() && $this->fresh()->users->count() > 2) {
            $this->private = false;
            $this->save();
        }

        return $this;
    }
1037072
private void fillCache()
   {
      Collection<NodeTypeData> ntTypes = registry.getAllNodeTypes();
      for (NodeTypeData nodeTypeData : ntTypes)
      {
         nodeTypeRegistered(nodeTypeData.getName());
      }
   }
643441
public function flushCaches(bool $flushPersistentCaches = false): void
    {
        $this->createAllCaches();
        /** @var FrontendInterface $cache */
        foreach ($this->caches as $identifier => $cache) {
            if (!$flushPersistentCaches && $this->isCachePersistent($identifier)) {
                continue;
            }
            $cache->flush();
        }
        $this->configurationManager->flushConfigurationCache();
        $dataTemporaryPath = $this->environment->getPathToTemporaryDirectory();
        Files::unlink($dataTemporaryPath . 'AvailableProxyClasses.php');
    }
624261
public function search($forumId, $threadId)
    {
        $dataProvider = new ActiveDataProvider([
            'query' => static::find()->where(['forum_id' => $forumId, 'thread_id' => $threadId]),
            'pagination' => [
                'defaultPageSize' => 10,
                'pageSizeLimit' => false,
                'forcePageParam' => false
            ],
        ]);
        $dataProvider->sort->defaultOrder = ['id' => SORT_ASC];
        return $dataProvider;
    }
565479
public function to_legacy_objects(array $forums) : array {
        return array_map(function(forum_entity $forum) {
            return (object) [
                'id' => $forum->get_id(),
                'course' => $forum->get_course_id(),
                'type' => $forum->get_type(),
                'name' => $forum->get_name(),
                'intro' => $forum->get_intro(),
                'introformat' => $forum->get_intro_format(),
                'assessed' => $forum->get_rating_aggregate(),
                'assesstimestart' => $forum->get_assess_time_start(),
                'assesstimefinish' => $forum->get_assess_time_finish(),
                'scale' => $forum->get_scale(),
                'maxbytes' => $forum->get_max_bytes(),
                'maxattachments' => $forum->get_max_attachments(),
                'forcesubscribe' => $forum->get_subscription_mode(),
                'trackingtype' => $forum->get_tracking_type(),
                'rsstype' => $forum->get_rss_type(),
                'rssarticles' => $forum->get_rss_articles(),
                'timemodified' => $forum->get_time_modified(),
                'warnafter' => $forum->get_warn_after(),
                'blockafter' => $forum->get_block_after(),
                'blockperiod' => $forum->get_block_period(),
                'completiondiscussions' => $forum->get_completion_discussions(),
                'completionreplies' => $forum->get_completion_replies(),
                'completionposts' => $forum->get_completion_posts(),
                'displaywordcount' => $forum->should_display_word_count(),
                'lockdiscussionafter' => $forum->get_lock_discussions_after(),
                'duedate' => $forum->get_due_date(),
                'cutoffdate' => $forum->get_cutoff_date()
            ];
        }, $forums);
    }
7342
protected function removeIds(array $itemIds): void
    {
        $queryBuilder = $this->entityManager->createQueryBuilder();
        $queryBuilder->delete(Item::class, 'i')
                     ->andWhere('i.id IN (:itemIds)')
                     ->setParameter('itemIds', array_values($itemIds));

        $queryBuilder->getQuery()->execute();
    }
982219
private function fill_defaults()
	{
		if ( ! array_key_exists('ID', $this->attributes) ) {

			$this->attributes['post_type'] = $this->type;

			$this->attributes['post_status'] = $this->status;

		}
	}
243364
public function fill($attributes)
    {
        foreach ($attributes as $key => $value) {
            if (in_array($key, $this->fillable)) {
                $this->{$key} = $value;
            }
        }
    }
547311
public function openAction(Forum $forum)
    {
        $em = $this->getDoctrine()->getManager();
        $this->checkAccess($forum);
        $categories = $em->getRepository('ClarolineForumBundle:Forum')->findCategories($forum);
        $user = $this->tokenStorage->getToken()->getUser();
        $hasSubscribed = $user === 'anon.' ?
            false :
            $this->manager->hasSubscribed($user, $forum);
        $isModerator = $this->authorization->isGranted(
            'moderate',
            new ResourceCollection(array($forum->getResourceNode()))
        ) && $user !== 'anon.';

        return array(
            'search' => null,
            '_resource' => $forum,
            'isModerator' => $isModerator,
            'categories' => $categories,
            'hasSubscribed' => $hasSubscribed,
            'workspace' => $forum->getResourceNode()->getWorkspace()
        );
    }
120086
private function reindex($productIds)
    {
        $this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID)->reindexList($productIds);
    }
86605
private function fill(array $args)
    {
        $properties = array_keys(get_object_vars($this));
        foreach ($args as $key => $value) {
            if (in_array($key, $properties)) {
                $this->{$key} = $value;
            }
        }
    }
656909
protected function fill_course_cache($courseids) {
        global $DB;

        list($in, $params) = $DB->get_in_or_equal($courseids);
        $this->courses = $DB->get_records_select('course', "id $in", $params);
    }
357858
public function fill_links($links) {
	foreach ($links as $key => $link) {
		$this->add_link($key, $link);
	}
}
1014820
public function flushMemberCache($memberIDs = null)
    {
        if (!$this->cacheService) {
            return;
        }

        // Hard flush, e.g. flush=1
        if (!$memberIDs) {
            $this->cacheService->clear();
        }

        if ($memberIDs && is_array($memberIDs)) {
            foreach ([self::VIEW, self::EDIT, self::DELETE] as $type) {
                foreach ($memberIDs as $memberID) {
                    $key = $this->generateCacheKey($type, $memberID);
                    $this->cacheService->delete($key);
                }
            }
        }
    }
1161766
private function initStores($storeIds)
    {
        if (!is_array($storeIds)) {
            $storeIds = explode(',', $storeIds);
        }

        $availableStores = $this->storeManager->getStores(true);

        foreach ($availableStores as $availableStore) {
            if (in_array($availableStore->getId(), $storeIds)) {
                $this->storeIds[$availableStore->getId()] = $availableStore;
            }
        }

        return $this;
    }