2 namespace TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu;
41 use MenuViewHelperTrait;
50 $this->
registerArgument(
'categoryUids',
'array',
'The categories assigned',
true);
51 $this->
registerArgument(
'as',
'string',
'Name of the template variable that will contain resolved pages',
true);
52 $this->
registerArgument(
'relationField',
'string',
'The category field for MM relation table',
true);
53 $this->
registerArgument(
'table',
'string',
'The table to which categories are assigned (source table)',
true);
63 $categoryUids = (array)$this->arguments[
'categoryUids'];
64 $as = (string)$this->arguments[
'as'];
65 if (empty($categoryUids)) {
69 return $this->renderChildrenWithVariables(array(
70 $as => $this->
findByCategories($categoryUids, $this->arguments[
'relationField'], $this->arguments[
'table'])
83 protected function findByCategories($categoryUids, $relationField, $tableName =
'pages')
87 foreach ($categoryUids as $categoryUid) {
95 if ($collection->count() > 0) {
96 foreach ($collection as $record) {
97 $result[$record[
'uid']] = $record;
100 }
catch (\RuntimeException $e) {