Code Duplication    Length = 78-78 lines in 2 locations

src/PlaygroundCore/Service/Locale.php 1 location

@@ 10-87 (lines=78) @@
7
use PlaygroundCore\Options\ModuleOptions;
8
use Zend\ServiceManager\ServiceLocatorInterface;
9
10
class Locale extends EventProvider
11
{
12
13
    /**
14
     * @var localeMapper
15
     */
16
    protected $localeMapper;
17
18
    /**
19
     * @var UserServiceOptionsInterface
20
     */
21
    protected $options;
22
23
    /**
24
     *
25
     * @var ServiceManager
26
     */
27
    protected $serviceLocator;
28
29
    public function __construct(ServiceLocatorInterface $locator)
30
    {
31
        $this->serviceLocator = $locator;
32
    }
33
34
    /**
35
     * getLocaleMapper
36
     *
37
     * @return LocaleMapper
38
     */
39
    public function getLocaleMapper()
40
    {
41
        if (null === $this->localeMapper) {
42
            $this->localeMapper = $this->serviceLocator->get('playgroundcore_locale_mapper');
43
        }
44
45
        return $this->localeMapper;
46
    }
47
48
    /**
49
     * setLocaleMapper
50
     * @param  LocaleMapper $localeMapper
51
     *
52
     * @return PlaygroundCore\Entity\Locale Locale
53
     */
54
    public function setLocaleMapper($localeMapper)
55
    {
56
        $this->localeMapper = $localeMapper;
57
58
        return $this;
59
    }
60
61
    /**
62
     * setOptions
63
     * @param  ModuleOptions $options
64
     *
65
     * @return PlaygroundCore\Service\Locale $this
66
     */
67
    public function setOptions(ModuleOptions $options)
68
    {
69
        $this->options = $options;
70
71
        return $this;
72
    }
73
74
    /**
75
     * getOptions
76
     *
77
     * @return ModuleOptions $optins
78
     */
79
    public function getOptions()
80
    {
81
        if (!$this->options instanceof ModuleOptions) {
82
            $this->setOptions($this->serviceLocator->get('playgroundcore_module_options'));
83
        }
84
85
        return $this->options;
86
    }
87
}
88

src/PlaygroundCore/Service/Website.php 1 location

@@ 10-87 (lines=78) @@
7
use PlaygroundCore\Options\ModuleOptions;
8
use Zend\ServiceManager\ServiceLocatorInterface;
9
10
class Website extends EventProvider
11
{
12
13
    /**
14
     * @var websiteMapper
15
     */
16
    protected $websiteMapper;
17
18
    /**
19
     * @var UserServiceOptionsInterface
20
     */
21
    protected $options;
22
23
    /**
24
     *
25
     * @var ServiceManager
26
     */
27
    protected $serviceLocator;
28
29
    public function __construct(ServiceLocatorInterface $locator)
30
    {
31
        $this->serviceLocator = $locator;
32
    }
33
34
    /**
35
     * getWebsiteMapper
36
     *
37
     * @return websiteMapper
38
     */
39
    public function getWebsiteMapper()
40
    {
41
        if (null === $this->websiteMapper) {
42
            $this->websiteMapper = $this->serviceLocator->get('playgroundcore_website_mapper');
43
        }
44
45
        return $this->websiteMapper;
46
    }
47
48
    /**
49
     * setWebsiteMapper
50
     * @param  Mapper/Website $websiteMapper
51
     *
52
     * @return PlaygroundCore\Entity\WebsiteMapper websiteMapper
53
     */
54
    public function setWebsiteMapper($websiteMapper)
55
    {
56
        $this->websiteMapper = $websiteMapper;
57
58
        return $this;
59
    }
60
61
    /**
62
     * setOptions
63
     * @param  ModuleOptions $options
64
     *
65
     * @return PlaygroundCore\Service\Website $this
66
     */
67
    public function setOptions(ModuleOptions $options)
68
    {
69
        $this->options = $options;
70
71
        return $this;
72
    }
73
74
    /**
75
     * getOptions
76
     *
77
     * @return ModuleOptions $optins
78
     */
79
    public function getOptions()
80
    {
81
        if (!$this->options instanceof ModuleOptions) {
82
            $this->setOptions($this->serviceLocator->get('playgroundcore_module_options'));
83
        }
84
85
        return $this->options;
86
    }
87
}
88