*/ public function all(): array { if ($this->all === null) { $this->all = Mongo::collection('stores')->find([], ['sort' => ['kind' => 1, 'name' => 1]])->toArray(); } return $this->all; } /** @return array code => store */ public function map(): array { $map = []; foreach ($this->all() as $s) { $map[$s['code']] = $s; } return $map; } }