/** * Render the form. * * @return string * @api */ public function render() { $categories = array(); if ($this->arguments['categoryArr'] !== NULL) { foreach ($this->arguments['categoryArr'] as $categoryId) { $category = $this->newsCategoryRepository->findByIdentifier($categoryId); if ($category !== NULL) { $categories[] = $category; } } } $this->templateVariableContainer->add($this->arguments['as'], $categories); return $this->renderChildren(); }