Completed
Pull Request — 3.x (#202)
by
unknown
16:06 queued 13:05
created

MessageManagerMock::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
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 Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[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 Sonata\NotificationBundle\Tests\Entity;
13
14
use Sonata\NotificationBundle\Entity\MessageManager;
15
16
/**
17
 * @author Kevin Nedelec <[email protected]>
18
 *
19
 * Class MessageManagerMock
20
 */
21
class MessageManagerMock extends MessageManager
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
27
    {
28
        $result = array();
29
        while ($limit !== null && $limit > 0) {
30
            $result[$limit] = new Message();
31
            --$limit;
32
        }
33
34
        return $result;
35
    }
36
37
    public function findByTypes(array $types, $state, $batchSize)
38
    {
39
        $result = array();
40
        while ($batchSize !== null && $batchSize > 0) {
41
            $result[$batchSize] = new Message();
42
            --$batchSize;
43
        }
44
45
        return $result;
46
    }
47
48
    public function save($message, $andFlush = true)
49
    {
50
        return;
51
    }
52
}
53