19declare(strict_types=1);
76 $this->structure->getRoot(),
89 $navigator = $this->navigator_factory->structureNavigator(
91 $this->structure->getRoot()
111 int $id_from_parent_table,
115 throw new \ilMDStructureException(
'LOM Structure is nested to deep.');
118 foreach ($this->subElements($struct) as $sub) {
119 $tag = $this->tag($sub);
120 $table = $tag?->table() ??
'';
121 $definition = $this->definition($sub);
124 $parent_id = $id_from_parent_table;
126 if (!is_null($result_row)) {
127 $result_rows = [$result_row];
129 if ($table && $result_row?->table() !== $table) {
130 $parent_id = $result_row?->id() ?? 0;
131 $result_rows = $this->querier->read(
134 ...$this->collectTagsFromSameTable($depth, $table, $sub)
138 foreach ($result_rows as $row) {
139 $value = $row->value($tag?->dataField() ??
'');
141 if ($definition->dataType() !==
Type::NULL && $value ===
'') {
149 $sub_elements = $this->readSubElements(
156 if (!isset($tag) && $sub_elements->current() ===
null) {
160 yield $this->element_factory->element(
179 $unchecked_structs = [$struct];
180 while ($unchecked_structs !== []) {
182 throw new \ilMDStructureException(
'LOM Structure is nested to deep.');
185 $next_unchecked_structs = [];
186 foreach ($unchecked_structs as $unchecked_struct) {
187 $tag = $this->tag($unchecked_struct);
188 if (!is_null($tag) && $table !== $tag?->table()) {
191 if (!is_null($tag)) {
194 $next_unchecked_structs = array_merge(
195 $next_unchecked_structs,
196 iterator_to_array($this->subElements($unchecked_struct))
200 $unchecked_structs = $next_unchecked_structs;
212 $super_step_depths = [];
213 foreach (
$path->steps() as $step) {
216 $super_step_depths[] = $depth;
222 if (empty($super_step_depths)) {
226 $cut_off = min($super_step_depths);
228 $path_builder = $this->path_factory->custom();
229 foreach (
$path->steps() as $step) {
230 if ($depth === $cut_off) {
233 $path_builder = $path_builder->withNextStepFromStep($step);
236 return $path_builder->get();
245 return $struct->getDefinition();
255 yield
from $struct->getSubElements();
258 if ($next_struct = $struct->
nextStep()) {
271 return $this->dictionary->tagForElement($struct);
278 $root_definition = $this->structure->getRoot()->getDefinition();
279 return $this->element_factory->set(
281 $this->element_factory->root(
Component logger with individual log levels by component id.
if(!file_exists('../ilias.ini.php'))