Completed
Push — master ( ac63be...fbf3ff )
by Craig
06:34
created

MockSearchStatRepository::countStats()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Zikula package.
5
 *
6
 * Copyright Zikula Foundation - http://zikula.org/
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 Zikula\SearchModule\Tests\Api\Fixtures;
13
14
use Doctrine\Common\Collections\Criteria;
15
use Zikula\SearchModule\Entity\RepositoryInterface\SearchStatRepositoryInterface;
16
use Zikula\SearchModule\Entity\SearchStatEntity;
17
18
class MockSearchStatRepository implements SearchStatRepositoryInterface
19
{
20
    private $results = [];
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function find($id)
26
    {
27
        // TODO: Implement find() method.
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function findAll()
34
    {
35
        // TODO: Implement findAll() method.
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
42
    {
43
        // TODO: Implement findBy() method.
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function findOneBy(array $criteria)
50
    {
51
        return isset($this->results[$criteria['search']]) ? $this->results[$criteria['search']] : null;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getClassName()
58
    {
59
        // TODO: Implement getClassName() method.
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function countStats()
66
    {
67
        return count($this->results);
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function getStats($filters = [], $sorting = [], $limit = 0, $offset = 0)
74
    {
75
        return $this->results;
76
    }
77
78
    /**
79
     * {@inheritdoc}
80
     */
81
    public function persistAndFlush(SearchStatEntity $entity)
82
    {
83
        $this->results[$entity->getSearch()] = $entity;
84
    }
85
86
    /**
87
     * {@inheritdoc}
88
     */
89
    public function matching(Criteria $criteria)
90
    {
91
        // TODO: Implement matching() method.
92
    }
93
}
94