ServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 22
rs 9.2
cc 1
eloc 18
nc 1
nop 0
1
<?php
2
3
namespace Test;
4
5
use League\Container\ServiceProvider\AbstractServiceProvider;
6
7
/**
8
 * Description of ServiceProvider
9
 *
10
 * @author d.lanec
11
 */
12
class ServiceProvider extends AbstractServiceProvider {
13
	
14
	protected $provides = [
15
		'UserMapper',
16
		'UserGroupMapper',
17
		'UserGroupMapper',
18
		'CityMapper'
19
	];
20
	
21
	public function register() {
22
		
23
		$db = new \SimpleORM\Adapter\CodeigniterQueryBuilder(get_instance()->db);
24
		
25
		$this->getContainer()->add('UserMapper','Test\Domain\User\UserMapper')
26
				->withArgument($this->getContainer())
27
				->withArgument($db)
28
				->withArgument('test_db');
29
		
30
		$this->getContainer()->add('UserGroupMapper','Test\Domain\UserGroup\UserGroupMapper')
31
				->withArgument($this->getContainer())
32
				->withArgument($db)
33
				->withArgument('test_db');	
34
		$this->getContainer()->add('UserAddressMapper','Test\Domain\UserAddress\UserAddressMapper')
35
				->withArgument($this->getContainer())
36
				->withArgument($db)
37
				->withArgument('test_db');	
38
		$this->getContainer()->add('CityMapper','Test\Domain\City\CityMapper')
39
				->withArgument($this->getContainer())
40
				->withArgument($db)
41
				->withArgument('test_db');	
42
	}	
43
}
44