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; }