"Fossies" - the Fresh Open Source Software Archive

Member "grav/system/src/Grav/Framework/Collection/AbstractLazyCollection.php" (19 Mar 2020, 1610 Bytes) of package /linux/www/grav-v1.6.23.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "AbstractLazyCollection.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 /**
    4  * @package    Grav\Framework\Collection
    5  *
    6  * @copyright  Copyright (C) 2015 - 2019 Trilby Media, LLC. All rights reserved.
    7  * @license    MIT License; see LICENSE file for details.
    8  */
    9 
   10 namespace Grav\Framework\Collection;
   11 
   12 use Doctrine\Common\Collections\AbstractLazyCollection as BaseAbstractLazyCollection;
   13 
   14 /**
   15  * General JSON serializable collection.
   16  *
   17  * @package Grav\Framework\Collection
   18  */
   19 abstract class AbstractLazyCollection extends BaseAbstractLazyCollection implements CollectionInterface
   20 {
   21     /**
   22      * The backed collection to use
   23      *
   24      * @var ArrayCollection
   25      */
   26     protected $collection;
   27 
   28     /**
   29      * {@inheritDoc}
   30      */
   31     public function reverse()
   32     {
   33         $this->initialize();
   34         return $this->collection->reverse();
   35     }
   36 
   37     /**
   38      * {@inheritDoc}
   39      */
   40     public function shuffle()
   41     {
   42         $this->initialize();
   43         return $this->collection->shuffle();
   44     }
   45 
   46     /**
   47      * {@inheritDoc}
   48      */
   49     public function chunk($size)
   50     {
   51         $this->initialize();
   52         return $this->collection->chunk($size);
   53     }
   54 
   55     /**
   56      * {@inheritDoc}
   57      */
   58     public function select(array $keys)
   59     {
   60         $this->initialize();
   61         return $this->collection->select($keys);
   62     }
   63 
   64     /**
   65      * {@inheritDoc}
   66      */
   67     public function unselect(array $keys)
   68     {
   69         $this->initialize();
   70         return $this->collection->unselect($keys);
   71     }
   72 
   73     /**
   74      * {@inheritDoc}
   75      */
   76     public function jsonSerialize()
   77     {
   78         $this->initialize();
   79         return $this->collection->jsonSerialize();
   80     }
   81 }