/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Collection/Iterator
NameSizeModeActions
BufferedIterator.php47700644editdlrm
ExtractIterator.php29520644editdlrm
FilterIterator.php27390644editdlrm
InsertIterator.php38110644editdlrm
MapReduce.php57540644editdlrm
NestIterator.php22550644editdlrm
NoChildrenIterator.php13680644editdlrm
ReplaceIterator.php28780644editdlrm
SortIterator.php31200644editdlrm
StoppableIterator.php33170644editdlrm
TreeIterator.php34880644editdlrm
TreePrinter.php35180644editdlrm
UnfoldIterator.php26300644editdlrm
ZipIterator.php35840644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Collection/Iterator/ExtractIterator.php (2952B)
['body' => 'cool', 'user' => ['name' => 'Mark']], * ['comment' => ['body' => 'very cool', 'user' => ['name' => 'Renan']] * ]; * $extractor = new ExtractIterator($items, 'comment.user.name''); * ``` * * @param iterable $items The list of values to iterate * @param string|callable $path A dot separated path of column to follow * so that the final one can be returned or a callable that will take care * of doing that. */ public function __construct(iterable $items, $path) { $this->_extractor = $this->_propertyExtractor($path); parent::__construct($items); } /** * Returns the column value defined in $path or null if the path could not be * followed * * @return mixed */ public function current() { $extractor = $this->_extractor; return $extractor(parent::current()); } /** * @inheritDoc */ public function unwrap(): Traversable { $iterator = $this->getInnerIterator(); if ($iterator instanceof CollectionInterface) { $iterator = $iterator->unwrap(); } if (get_class($iterator) !== ArrayIterator::class) { return $this; } // ArrayIterator can be traversed strictly. // Let's do that for performance gains $callback = $this->_extractor; $res = []; foreach ($iterator->getArrayCopy() as $k => $v) { $res[$k] = $callback($v); } return new ArrayIterator($res); } }