context = DB::i()->getContext(); $this->aliases = $this->context->table("aliases"); } private function toAlias(?ActiveRow $ar): ?Alias { return is_null($ar) ? NULL : new Alias($ar); } function get(int $id): ?Alias { return $this->toAlias($this->aliases->get($id)); } function getByShortcode(string $shortcode): ?Alias { return $this->toAlias($this->aliases->where("shortcode", $shortcode)->fetch()); } }