19declare(strict_types=1);
49 $cid_count = count($cid_array);
50 if ($cid_count <= 1) {
53 for ($current = 0, $max = ($cid_count - 1); $current < $max; $current++) {
54 $parent_cid = $cid_array[$current];
55 $child_cid = $cid_array[$current + 1];
56 $child_class = $this->structure->getClassNameByCid($child_cid);
57 $allowed_children = $this->structure->getChildrenByCid($parent_cid) ?? [];
58 if (
null === $child_class || !in_array($child_class, $allowed_children,
true)) {
Class ilCtrlAbstractPath.
ilCtrlStructureInterface $structure
getCidArray(int $order=SORT_DESC)
@inheritDoc
Class ilCtrlExistingPath.
ensureValidCidPath()
Ensures each consecutive pair of CIDs must have a valid parent–child relationship.
__construct(ilCtrlStructureInterface $structure, string $cid_path)
ilCtrlExistingPath Constructor
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc