Completed
Push — master ( 702095...b9dfd2 )
by Aimeos
02:26
created

Ezpublish   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 1
cbo 0
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setEzUserService() 0 5 1
A getEzUserService() 0 8 2
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2016
6
 * @package MShop
7
 * @subpackage Context
8
 */
9
10
11
namespace Aimeos\MShop\Context\Item;
12
13
14
/**
15
 * Common objects which must to be available for all manager objects
16
 *
17
 * @package MShop
18
 * @subpackage Context
19
 */
20
class Ezpublish extends \Aimeos\MShop\Context\Item\Standard
21
{
22
	private $ezUserService;
23
24
25
	/**
26
	 * Sets the eZ user service object
27
	 *
28
	 * @param \eZ\Publish\API\Repository\UserService $service eZ user service object
29
	 * @return \Aimeos\MShop\Context\Item\Iface Context item for chaining method calls
30
	 */
31
	public function setEzUserService( \eZ\Publish\API\Repository\UserService $service )
32
	{
33
		$this->ezUserService = $service;
34
		return $this;
35
	}
36
37
38
	/**
39
	 * Returns the eZ user service object
40
	 *
41
	 * @return \eZ\Publish\API\Repository\UserService eZ user service object
42
	 */
43
	public function getEzUserService()
44
	{
45
		if( !isset( $this->ezUserService ) ) {
46
			throw new \Aimeos\MShop\Exception( sprintf( 'eZ user service not available' ) );
47
		}
48
49
		return $this->ezUserService;
50
	}
51
}
52