mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 21:24:02 +00:00
Add array support to the storage. (#27)
* Add array support to the storage. (Existing tests have been modified, but only in a way that makes them more correct than they were, making this a backwards compatible feature.)
This commit is contained in:
parent
cd803cbb47
commit
83d272007d
3 changed files with 60 additions and 24 deletions
|
|
@ -20,7 +20,7 @@ class RedisStorageDriver implements StorageDriver
|
|||
if (! $id) {
|
||||
throw new \Exception("Tenant could not be identified on domain {$domain}");
|
||||
}
|
||||
return array_merge(['uuid' => $id], $this->getTenantById($id));
|
||||
return $this->getTenantById($id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -49,7 +49,7 @@ class RedisStorageDriver implements StorageDriver
|
|||
public function createTenant(string $domain, string $uuid): array
|
||||
{
|
||||
$this->redis->hmset("domains:$domain", 'tenant_id', $uuid);
|
||||
$this->redis->hmset("tenants:$uuid", 'uuid', $uuid, 'domain', $domain);
|
||||
$this->redis->hmset("tenants:$uuid", 'uuid', json_encode($uuid), 'domain', json_encode($domain));
|
||||
return $this->redis->hgetall("tenants:$uuid");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue