Extract repository classes to read/update box versions

This commit is contained in:
Aztech
2015-07-08 09:51:21 +02:00
committed by Thibaud Fabre
parent 2a134d4bca
commit 5aad5e933e
7 changed files with 168 additions and 52 deletions

View File

@@ -11,6 +11,7 @@
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Connection\ConnectionSettings;
use Alchemy\Phrasea\Core\Version\DataboxVersionRepository;
use Alchemy\Phrasea\Databox\DataboxFieldRepositoryInterface;
use Alchemy\Phrasea\Model\Entities\User;
use Alchemy\Phrasea\Exception\InvalidArgumentException;
@@ -80,6 +81,8 @@ class databox extends base
}
$connectionConfig = $connectionConfigs[$sbas_id];
$connection = $app['db.provider']($connectionConfig);
$connectionSettings = new ConnectionSettings(
$connectionConfig['host'],
$connectionConfig['port'],
@@ -88,9 +91,9 @@ class databox extends base
$connectionConfig['password']
);
$connection = $app['db.provider']($connectionConfig);
$versionRepository = new DataboxVersionRepository($connection);
parent::__construct($app, $connection, $connectionSettings);
parent::__construct($app, $connection, $connectionSettings, $versionRepository);
$this->loadFromRow($row);
}