Newscoop\NewscoopBundle\Controller\TopicsController::setAttachedKeysForArticleTopics PHP Метод

setAttachedKeysForArticleTopics() приватный Метод

Adds "attached" and "hasAttachedSubtopic" keys with values to the array of the topic;.
private setAttachedKeysForArticleTopics ( array $nodes, string $articleNumber ) : array
$nodes array Array of topics
$articleNumber string Article number
Результат array
    private function setAttachedKeysForArticleTopics($nodes, $articleNumber)
    {
        $topicsIds = $this->getArticleTopicsIds($articleNumber);
        foreach ($nodes as $key => $topic) {
            if (in_array($topic['id'], $topicsIds)) {
                $topic['attached'] = true;
                $nodes[$key] = $topic;
            }
        }
        return $nodes;
    }