context = DB::i()->getContext(); $this->users = $this->context->table("chandlerusers"); } private function toUser(?ActiveRow $ar): ?ChandlerUser { return is_null($ar) ? NULL : (new User($ar))->getChandlerUser(); } function get(int $id): ?ChandlerUser { return (new Users)->get($id)->getChandlerUser(); } function getById(string $UUID): ?ChandlerUser { return new ChandlerUser($this->users->where("id", $UUID)->fetch()); } function getList(int $page = 1): \Traversable { foreach($this->users as $user) yield new ChandlerUser($user); } }