= ?'; private IDatabaseConnection $conn; public function __construct(IDatabaseConnection $conn) { $this->conn = $conn; } public function getKeys(int $minLevel, bool $includeDeprecated = false): array { $query = self::QUERY; if(!$includeDeprecated) $query .= ' AND `key_deprecated` IS NULL'; $query .= ' ORDER BY `key_level` DESC, `key_id`'; $stmt = $this->conn->prepare($query); $stmt->addParameter(1, $minLevel, DbType::INTEGER); $stmt->execute(); $result = $stmt->getResult(); $objs = []; while($result->next()) $objs[] = self::createObject($result); return $objs; } private static function createObject(IDatabaseResult $result): SSHKeyInfo { return new SSHKeyInfo( $result->getString(0), $result->getInteger(1), $result->getString(2), $result->getString(3), $result->getAString(4), $result->getInteger(5), $result->isNull(6) ? null : $result->getInteger(6), ); } }