1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 19:04:03 +00:00

getMany now returns only values

This commit is contained in:
Samuel Štancl 2019-08-16 12:54:48 +02:00
parent fbd600a670
commit 405e3148bd

View file

@ -80,13 +80,10 @@ class Tenant extends Model
return $this->$key ?? $this->getFromData($key) ?? null; return $this->$key ?? $this->getFromData($key) ?? null;
} }
/** @todo In v2, this should return an associative array. */
public function getMany(array $keys): array public function getMany(array $keys): array
{ {
return array_reduce($keys, function ($keys, $key) { return array_map([$this, 'get'], $keys);
$keys[$key] = $this->get($key);
return $keys;
}, []);
} }
public function put(string $key, $value) public function put(string $key, $value)