getArrayCopy(); array_unshift($array, $mItem); $this->exchangeArray($array); } else { parent::append($mItem); } } public function Add($mItem, bool $bToTop = false) : self { $this->append($mItem, $bToTop); return $this; } public function AddArray(array $aItems) : self { foreach ($aItems as $mItem) { $this->append($mItem); } return $this; } public function Clear() : void { $this->exchangeArray([]); } public function Slice(int $offset, int $length = null, bool $preserve_keys = false) { return new static( array_slice($this->getArrayCopy(), $offset, $length, $preserve_keys) ); } public function MapList(callable $cCallback) : array { $aResult = array(); if (\is_callable($cCallback)) { foreach ($this as $oItem) { $aResult[] = \call_user_func($cCallback, $oItem); } } return $aResult; } public function FilterList(callable $cCallback) : array { $aResult = array(); if (\is_callable($cCallback)) { foreach ($this as $oItem) { if (\call_user_func($cCallback, $oItem)) { $aResult[] = $oItem; } } } return $aResult; } public function ForeachList(callable $cCallback) : void { if (\is_callable($cCallback)) { foreach ($this as $oItem) { \call_user_func($cCallback, $oItem); } } } }