diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-08-27 13:27:29 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-08-27 13:27:29 +0200 |
commit | adad6ca280f2284a0ea4a1c41c8adea4ae1b141a (patch) | |
tree | f9f6d05832b4b57c6c07837c6e988f71dd04954a /db | |
parent | c88b300bad389fd0ddb888111a8bc56f71782d3c (diff) |
clean up app container
Diffstat (limited to 'db')
-rw-r--r-- | db/mapperfactory.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/db/mapperfactory.php b/db/mapperfactory.php index 6704842e4..adcde6c4a 100644 --- a/db/mapperfactory.php +++ b/db/mapperfactory.php @@ -13,21 +13,23 @@ namespace OCA\News\Db; -use \OCP\IDBConnection; -use \OCA\News\Db\Mysql\ItemMapper as MysqlItemMapper; +use OCP\IDBConnection; -class MapperFactory { +use OCA\News\Db\Mysql\ItemMapper as MysqlItemMapper; +use OCA\News\DependencyInjection\IFactory; + + +class MapperFactory implements IFactory { private $dbType; private $db; - public function __construct($DatabaseType, IDBConnection $db) { - $this->dbType = $DatabaseType; + public function __construct(IDBConnection $db, $databaseType) { + $this->dbType = $databaseType; $this->db = $db; } - - public function getItemMapper() { + public function build() { switch($this->dbType) { case 'mysql': return new MysqlItemMapper($this->db); @@ -36,5 +38,4 @@ class MapperFactory { } } - } |