Code Duplication    Length = 14-14 lines in 2 locations

src/Component/Grid/DataSource/Doctrine/MongoDB/DataSourceBuilder.php 1 location

@@ 188-201 (lines=14) @@
185
    /**
186
     * {@inheritdoc}
187
     */
188
    public function createDataSource(array $options = [])
189
    {
190
        $queryBuilder = clone $this->queryBuilder;
191
192
        if (isset($options['all']) && $options['all']) {
193
            return new ArrayDataSource($queryBuilder->getQuery()->getIterator()->toArray());
194
        }
195
196
        $dataSource = new PagerfantaDataSource(new DoctrineODMMongoDBAdapter($queryBuilder));
197
        $dataSource->setMaxPerPage($this->limit);
198
        $dataSource->setCurrentPage($this->page);
199
200
        return $dataSource;
201
    }
202
}
203

src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php 1 location

@@ 197-210 (lines=14) @@
194
    /**
195
     * {@inheritdoc}
196
     */
197
    public function createDataSource(array $options = [])
198
    {
199
        $queryBuilder = clone $this->queryBuilder;
200
201
        if (isset($options['all']) && $options['all']) {
202
            return new ArrayDataSource($queryBuilder->getQuery()->getResult());
203
        }
204
205
        $dataSource = new PagerfantaDataSource(new DoctrineORMAdapter($queryBuilder, false, false));
206
        $dataSource->setMaxPerPage($this->limit);
207
        $dataSource->setCurrentPage($this->page);
208
209
        return $dataSource;
210
    }
211
}
212