InboxProvider::getInboxThreads()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the MilioooMessageBundle package.
5
 *
6
 * (c) Michiel boeckaert <[email protected]>
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Miliooo\Messaging\ThreadProvider\Folder;
12
13
use Miliooo\Messaging\User\ParticipantInterface;
14
use Miliooo\Messaging\Repository\ThreadRepositoryInterface;
15
16
/**
17
 * The inbox provider provides inbox threads for a given participant.
18
 *
19
 * This is an extra layer between the repository
20
 * If you need more logic or alter the logic in the repository you can override this service
21
 *
22
 * @author Michiel Boeckaert <[email protected]>
23
 */
24
class InboxProvider implements InboxProviderInterface
25
{
26
    /**
27
     * A thread repository instance.
28
     *
29
     * @var ThreadRepositoryInterface
30
     */
31
    protected $threadRepository;
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param ThreadRepositoryInterface $threadRepository A threadRepository instance
37
     */
38
    public function __construct(ThreadRepositoryInterface $threadRepository)
39
    {
40
        $this->threadRepository = $threadRepository;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getInboxThreads(ParticipantInterface $participant)
47
    {
48
       return $this->threadRepository->getInboxThreadsForParticipant($participant);
49
    }
50
}
51