vendor/friendsofsymfony/elastica-bundle/src/Paginator/TransformedPartialResults.php line 40

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the FOSElasticaBundle package.
  4.  *
  5.  * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace FOS\ElasticaBundle\Paginator;
  11. use Elastica\ResultSet;
  12. use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
  13. /**
  14.  * Partial transformed result set.
  15.  */
  16. class TransformedPartialResults extends RawPartialResults
  17. {
  18.     protected $transformer;
  19.     /**
  20.      * @param ResultSet                                                           $resultSet
  21.      * @param \FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface $transformer
  22.      */
  23.     public function __construct(ResultSet $resultSetElasticaToModelTransformerInterface $transformer)
  24.     {
  25.         parent::__construct($resultSet);
  26.         $this->transformer $transformer;
  27.     }
  28.     /**
  29.      * {@inheritdoc}
  30.      */
  31.     public function toArray()
  32.     {
  33.         return $this->transformer->transform($this->resultSet->getResults());
  34.     }
  35. }