vendor/sulu/sulu/src/Sulu/Component/Webspace/Manager/Dumper/PhpWebspaceCollectionDumper.php line 35

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Component\Webspace\Manager\Dumper;
  11. use Sulu\Component\Webspace\Manager\WebspaceCollection;
  12. class PhpWebspaceCollectionDumper extends WebspaceCollectionDumper
  13. {
  14.     /**
  15.      * @var WebspaceCollection
  16.      */
  17.     private $webspaceCollection;
  18.     public function __construct(WebspaceCollection $webspaceCollection)
  19.     {
  20.         $this->webspaceCollection $webspaceCollection;
  21.     }
  22.     /**
  23.      * Creates a new class with the data from the given collection.
  24.      *
  25.      * @param array $options
  26.      *
  27.      * @return string
  28.      */
  29.     public function dump($options = [])
  30.     {
  31.         return $this->render(
  32.             'WebspaceCollectionClass.php.twig',
  33.             [
  34.                 'cache_class' => $options['cache_class'],
  35.                 'base_class' => $options['base_class'],
  36.                 'collection' => $this->webspaceCollection->toArray(),
  37.             ]
  38.         );
  39.     }
  40. }