def METHOD_NAME(self, tooltip=None, hasLegend=None, searchable=None, geojson=None):
    with self.getSession() as session:
        valNone = None
        query = session.query(distinct(LayersConfig.layerBodId)) \
            .filter(LayersConfig.staging == self.staging) \
            .filter(LayersConfig.parentLayerId == valNone) \
            .filter(LayersConfig.srid != u'4326')
        if tooltip is not None:
            query = query.filter(LayersConfig.tooltip == tooltip)
        if hasLegend is not None:
            query = query.filter(LayersConfig.hasLegend == hasLegend)
        if searchable is not None:
            query = query.filter(LayersConfig.searchable == searchable)
        if geojson is not None:
            if geojson:
                query = query.filter(LayersConfig.type == u'geojson')
            else:
                query = query.filter(LayersConfig.type != u'geojson')
        for q in query:
            if self.onlylayer is None or q[0] == self.onlylayer:
                yield q[0]