CodeExplorer getCmsPageIds example
public function getDefinition(): string
{ return CategoryDefinition::
class;
} public function generate(int
$numberOfItems, DemodataContext
$context, array
$options =
[]): void
{ $this->faker =
$context->
getFaker();
$rootCategoryId =
$this->
getRootCategoryId($context->
getContext());
$pageIds =
$this->
getCmsPageIds($context->
getContext());
$tags =
$this->
getIds('tag'
);
$payload =
[];
$lastId = null;
for ($i = 0;
$i <
$numberOfItems; ++
$i) { $cat =
$this->
createCategory($context,
$pageIds,
$tags,
$rootCategoryId,
$lastId,
random_int(3, 5
), 1
);
$payload[] =
$cat;
$lastId =
$cat['id'
];
} $console =
$context->
getConsole();