/**
  * _get_registrations
  *
  * @access private
  * @param EE_Transaction $transaction
  * @return EE_Cart
  */
 private function _get_registrations(EE_Transaction $transaction)
 {
     // first step: grab the registrants  { : o
     $registrations = $transaction->registrations($this->checkout->reg_cache_where_params, true);
     // verify registrations have been set
     if (empty($registrations)) {
         // if no cached registrations, then check the db
         $registrations = $transaction->registrations($this->checkout->reg_cache_where_params, false);
         // still nothing ? well as long as this isn't a revisit
         if (empty($registrations) && !$this->checkout->revisit) {
             // generate new registrations from scratch
             $registrations = $this->_initialize_registrations($transaction);
         }
     }
     // sort by their original registration order
     usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
     // then loop thru the array
     foreach ($registrations as $registration) {
         // verify each registration
         if ($registration instanceof EE_Registration) {
             // we display all attendee info for the primary registrant
             if ($this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant()) {
                 $this->checkout->primary_revisit = TRUE;
                 break;
             } else {
                 if ($this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link()) {
                     // but hide info if it doesn't belong to you
                     $transaction->clear_cache('Registration', $registration->ID());
                 }
             }
             $this->checkout->set_reg_status_updated($registration->ID(), false);
         }
     }
 }