Completed
Push — master ( 8386c2...ffd2be )
by Simonas
61:26
created

CountAdapter::getResults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\FilterManagerBundle\Pager\Adapters;
13
14
use ONGR\FilterManagerBundle\Pager\PagerAdapterInterface;
15
16
/**
17
 * Adapter used to simply calculate offset for a given page.
18
 */
19
class CountAdapter implements PagerAdapterInterface
20
{
21
    /**
22
     * @var int
23
     */
24
    private $count;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param int $count
30
     */
31
    public function __construct($count)
32
    {
33
        $this->count = $count;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getTotalResults()
40
    {
41
        return $this->count;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getResults($offset, $limit)
48
    {
49
        return [];
50
    }
51
}
52