code: def _getZODBAnalyses(self, objid):
          
          # ars = []
          analyses = []
          searchcriteria = ['getId', 'getClientSampleID']
          allowed_ar_states = self.getAllowedARStates()
          allowed_an_states = self.getAllowedAnalysisStates()
          # allowed_ar_states_msg = [_(s) for s in allowed_ar_states]
          allowed_an_states_msg = [_(s) for s in allowed_an_states]
  
          # Acceleration of searches using priorization
          if self._priorizedsearchcriteria in ['rgid', 'rid', 'ruid']:
              # Look from reference analyses
              analyses = self._getZODBAnalysesFromReferenceAnalyses(
                      objid, self._priorizedsearchcriteria)
          if len(analyses) == 0:
              # Look from ar and derived
              analyses = self._getZODBAnalysesFromAR(objid,
                                                     '',
                                                     searchcriteria,
                                                     allowed_ar_states)
  
          # Discard analyses that don't match with allowed_an_states
          analyses = [analysis for analysis in analyses
                      if analysis.portal_type != 'Analysis' or
                      self.wf.getInfoFor(analysis, 'review_state')
                      in allowed_an_states]
  
          if len(analyses) == 0:
              self.warn(
                  "No analyses '${allowed_analysis_states}' "
                  "states found for ${object_id}",
                  mapping={"allowed_analysis_states": ', '.join(
                      allowed_an_states_msg),
                           "object_id": objid})
  
          return analyses
docs: Searches for analyses from ZODB to be filled with results.
              objid can be either AR ID or Worksheet's Reference Sample IDs.
              Only analyses that matches with getAnallowedAnalysisStates() will
              be returned. If not a ReferenceAnalysis, getAllowedARStates() is
              also checked.
              Returns empty array if no analyses found