Apple can issue a loaner phone if repair of the unit requires it be sent off site.
From
iPhone Service Answer Center - Apple Support
Can I get a loaner iPhone?
If you bring your iPhone to an Apple Store or an Apple Authorized Service Provider, we'll try to fix it during your appointment. Some iPhone repairs require precise calibration on specialized equipment. If we need to send your iPhone to an Apple Repair Center, we'll check to see if you can use a loaner while your iPhone gets repaired. A loaner iPhone is available for most repairs that are covered under the Apple Limited Warranty.
Our repair center will return your iPhone to your service location when your repaired iPhone is ready. When you pick up your iPhone, return the loaner to us in the same condition as it was when we lent it to you.