$pageId) { $token = $matches[0][$key]; if (!empty($tokens[$token])) { continue; } $page = $this->model->getEntity($pageId); if (!$page) { continue; } $tokens[$token] = $this->model->generateUrl($page, true, $clickthrough); } unset($matches); } return $tokens; } }