remove db prefix

This commit is contained in:
Dennis Eichhorn 2020-03-12 18:03:50 +01:00
parent 4f1a645fb5
commit f0eade1781
4 changed files with 6 additions and 18 deletions

View File

@ -40,7 +40,6 @@ final class Installer extends InstallerAbstract
$sqlite = new SQLiteConnection([
'db' => 'sqlite',
'prefix' => '',
'database' => __DIR__ . '/../../../phpOMS/Localization/Defaults/localization.sqlite',
]);
@ -66,8 +65,7 @@ final class Installer extends InstallerAbstract
$con = $dbPool->get();
$query = new Builder($con);
$query->prefix($con->getPrefix())
->insert('country_name', 'country_code2', 'country_code3', 'country_numeric')
$query->insert('country_name', 'country_code2', 'country_code3', 'country_numeric')
->into('country');
$querySqlite = new Builder($sqlite);
@ -100,8 +98,7 @@ final class Installer extends InstallerAbstract
$con = $dbPool->get();
$query = new Builder($con);
$query->prefix($con->getPrefix())
->insert('language_name', 'language_native', 'language_639_1', 'language_639_2T', 'language_639_2B', 'language_639_3')
$query->insert('language_name', 'language_native', 'language_639_1', 'language_639_2T', 'language_639_2B', 'language_639_3')
->into('language');
$querySqlite = new Builder($sqlite);
@ -136,8 +133,7 @@ final class Installer extends InstallerAbstract
$con = $dbPool->get();
$query = new Builder($con);
$query->prefix($con->getPrefix())
->insert('currency_id', 'currency_name', 'currency_code', 'currency_number', 'currency_symbol', 'currency_subunits', 'currency_decimal', 'currency_countries')
$query->insert('currency_id', 'currency_name', 'currency_code', 'currency_number', 'currency_symbol', 'currency_subunits', 'currency_decimal', 'currency_countries')
->into('currency');
$querySqlite = new Builder($sqlite);

View File

@ -158,8 +158,7 @@ final class AccountMapper extends DataMapperAbstract
$result = null;
$query = new Builder(self::$db);
$result = $query->prefix(self::$db->getPrefix())
->select('account_id', 'account_login', 'account_password', 'account_password_temp', 'account_tries')
$result = $query->select('account_id', 'account_login', 'account_password', 'account_password_temp', 'account_tries')
->from('account')
->where('account_login', '=', $login)
->execute()->fetchAll();

View File

@ -45,18 +45,12 @@ final class AddressMapper extends DataMapperAbstract
/**
* Has one relation.
*
* @todo Orange-Management/phpOMS#224
* Implement composite models.
* If a column is defined only that column value should get populated in the model and not the full model!
* OwnsOne, HasOne, use single value instead of full model defined in the mapper.
*
* @var array<string, array{mapper:string, self:string, by?:string}>
* @since 1.0.0
*/
protected static array $ownsOne = [
'country' => [
'mapper' => CountryMapper::class,
//'column' => '',
'self' => 'address_country',
],
];

View File

@ -145,15 +145,14 @@ final class LocalizationMapper extends DataMapperAbstract
*
* @param mixed $primaryKey Key
* @param int $relations Load relations
* @param mixed $fill Object to fill
* @param int $depth Relation depth
*
* @return mixed
*
* @since 1.0.0
*/
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null, int $depth = 1)
public static function get($primaryKey, int $relations = RelationType::ALL, int $depth = 1)
{
return parent::get($primaryKey, $relations, $fill, 1);
return parent::get($primaryKey, $relations, 1);
}
}