| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function register() { |
||
| 22 | |||
| 23 | global $__AR2, $CONST; |
||
|
|
|||
| 24 | |||
| 25 | $db = new \SimpleORM\Adapter\CodeigniterQueryBuilder(get_instance()->db); |
||
| 26 | |||
| 27 | $this->getContainer()->add('UserMapper','Test\Domain\User\UserMapper') |
||
| 28 | ->withArgument($this->getContainer()) |
||
| 29 | ->withArgument($db) |
||
| 30 | ->withArgument($__AR2['autoresource_db']); |
||
| 31 | |||
| 32 | $this->getContainer()->add('UserGroupMapper','Test\Domain\UserGroup\UserGroupMapper') |
||
| 33 | ->withArgument($this->getContainer()) |
||
| 34 | ->withArgument($db) |
||
| 35 | ->withArgument($__AR2['autoresource_db']); |
||
| 36 | $this->getContainer()->add('UserAddressMapper','Test\Domain\UserAddress\UserAddressMapper') |
||
| 37 | ->withArgument($this->getContainer()) |
||
| 38 | ->withArgument($db) |
||
| 39 | ->withArgument($__AR2['autoresource_db']); |
||
| 40 | $this->getContainer()->add('CityMapper','Test\Domain\City\CityMapper') |
||
| 41 | ->withArgument($this->getContainer()) |
||
| 42 | ->withArgument($db) |
||
| 43 | ->withArgument($__AR2['autoresource_db']); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
Instead of relying on
globalstate, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state