public function hasSchema($schemaId)
    {
        $sql = '    SELECT COUNT(resp.id) AS cnt
                      FROM fusio_routes_response resp
                INNER JOIN fusio_routes_method method
                        ON resp.method_id = method.id
                INNER JOIN fusio_routes routes
                        ON routes.id = method.route_id
                     WHERE routes.status = 1
                       AND (method.parameters = :schema_id OR method.request = :schema_id OR resp.response = :schema_id)';

        $count = $this->connection->fetchColumn($sql, [
            'schema_id' => $schemaId,
        ]);

        return $count > 0;
    }
public function hasSchema($schemaId)
    {
        $sql = '    SELECT COUNT(resp.id) AS cnt
                      FROM fusio_routes_response resp
                INNER JOIN fusio_routes_method method
                        ON resp.method_id = method.id
                INNER JOIN fusio_routes routes
                        ON routes.id = method.route_id
                     WHERE routes.status = 1
                       AND (method.parameters = :schema_id OR method.request = :schema_id OR resp.response = :schema_id)';

        $count = $this->connection->fetchColumn($sql, [
            'schema_id' => $schemaId,
        ]);

        return $count > 0;
    }
public function hasSchema ( $ schemaId ) { $ sql = '    SELECT COUNT(resp.id) AS cnt
                      FROM fusio_routes_response resp
                INNER JOIN fusio_routes_method method
                        ON resp.method_id = method.id
                INNER JOIN fusio_routes routes
                        ON routes.id = method.route_id
                     WHERE routes.status = 1
                       AND (method.parameters = :schema_id OR method.request = :schema_id OR resp.response = :schema_id)' ; $ count = $ this -> connection -> fetchColumn ( $ sql , [ 'schema_id' => $ schemaId , ] ) ; return $ count > 0 ; }
Returns whether a schema id is in use by a route. In the worst case this
gets reported by the database constraints but we use this method to
report a proper error message

@param integer $schemaId
@return boolean
Returns whether a schema id is in use by a route . In the worst case this gets reported by the database constraints but we use this method to report a proper error message