UserContextServiceAwareTrait.php 770 Bytes
Newer Older
1
2
3
4
<?php

namespace UnicaenAuth\Service\Traits;

Laurent Lécluse's avatar
Laurent Lécluse committed
5
use UnicaenAuth\Service\UserContext;
6
7
8
9
10
11
12
13
14
15
use RuntimeException;

/**
 * Description of UserContextServiceAwareTrait
 *
 * @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
 */
trait UserContextServiceAwareTrait
{
    /**
Laurent Lécluse's avatar
Laurent Lécluse committed
16
     * @var UserContext
17
18
19
20
21
22
     */
    private $serviceUserContext;



    /**
Laurent Lécluse's avatar
Laurent Lécluse committed
23
     * @param UserContext $serviceUserContext
24
25
26
     *
     * @return self
     */
Laurent Lécluse's avatar
Laurent Lécluse committed
27
    public function setServiceUserContext(UserContext $serviceUserContext)
28
29
30
31
32
33
34
35
36
    {
        $this->serviceUserContext = $serviceUserContext;

        return $this;
    }



    /**
Laurent Lécluse's avatar
Laurent Lécluse committed
37
     * @return UserContext
38
39
40
41
42
43
44
     * @throws RuntimeException
     */
    public function getServiceUserContext()
    {
        return $this->serviceUserContext;
    }
}