19 declare(strict_types=1);
30 protected ilImportStatusFactoryInterface
$status;
40 ilImportStatusFactoryInterface $status,
45 $this->is_numbering_enabled =
false;
70 $clone->elements[] = $import_status;
84 $clone->elements = array_merge($this->
toArray(), $other->
toArray());
93 public function next(): void
105 return $this->minIndex <= $this->index && $this->index < $this->
count();
115 return count($this->elements);
128 $clone = clone $this;
129 $clone->is_numbering_enabled = $enabled;
135 $collection = $this->status->collection();
136 $msg =
"<br>Listing status messages (of type(s)";
137 foreach ($types as $type) {
138 $msg .=
" " . $type->name;
142 $elements = $collection->toArray();
143 for($i = 0; $i <
count($elements); $i++) {
144 $faied_status = $elements[$i];
146 $msg .= $this->is_numbering_enabled
149 $msg .= $faied_status->getContent()->toString();
156 bool $at_front =
true 158 $clone = clone $this;
160 foreach ($clone->toArray() as $element) {
161 $new_elements[] = $at_front
162 ? $this->status->handler()
163 ->withType($element->getType())
164 ->withContent($content->mergeWith($element->getContent()))
165 : $this->status->handler()
166 ->withType($element->getType())
167 ->withContent($element->getContent()->mergeWith($content));
169 $clone->elements = $new_elements;
ilImportStatusFactoryInterface $status
mergeContentToElements(ilImportStatusContentHandlerInterface $content, bool $at_front=true)
getMergedCollectionWith(ilCollectionInterface $other)
getCollectionOfAllByType(StatusType $type)
bool $is_numbering_enabled
hasStatusType(StatusType $type)
__construct(ilImportStatusFactoryInterface $status,)
getArrayOfElementsWithType(StatusType $type)
withAddedStatus(ilHandlerInterface $import_status)
withNumberingEnabled(bool $enabled)
toString(StatusType ... $types)