1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 06:44:02 +00:00

merge conflicts

This commit is contained in:
Samuel Štancl 2019-10-27 20:19:57 +01:00
commit b734a25fec
3 changed files with 11 additions and 4 deletions

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\StorageDrivers\Database;
use Illuminate\Config\Repository as ConfigRepository;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\StorageDrivers\Database;
use Illuminate\Config\Repository as ConfigRepository;
@ -36,4 +38,4 @@ abstract class Repository
{
return $this->table()->$method(...$parameters);
}
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\StorageDrivers\Database;
use Illuminate\Config\Repository as ConfigRepository;
@ -48,7 +50,7 @@ class TenantRepository extends Repository
$decodedData = $this->decodeFreshDataForTenant($tenant);
$result = [];
foreach ($keys as $key) {
$result[$key] = $decodedData[$key] ?? null;
}
@ -99,6 +101,7 @@ class TenantRepository extends Repository
foreach ($keys as $key => $key) {
if (in_array($key, static::customColumns())) {
$data[$key] = null;
return;
} else {
unset($jsonData[$key]);
@ -122,7 +125,7 @@ class TenantRepository extends Repository
$dataColumn = static::dataColumn();
$decoded = json_decode($columns[$dataColumn], true);
$columns = array_merge($columns, $decoded);
// If $columns[$dataColumn] has been overriden by a value, don't delete the key.
if (! array_key_exists($dataColumn, $decoded)) {
unset($columns[$dataColumn]);
@ -168,4 +171,4 @@ class TenantRepository extends Repository
?? $config->get('tenancy.storage_drivers.db.table_names.tenants')
?? 'tenants';
}
}
}