That's a lemon law, I assume you're in US. This wasn't Apple's goodwill. I claimed the same, twice. And they didn't restart the warranty for me, if I remember, they just transfered the remainder of what I had.
At least in Colorado, lemon laws only apply to cars. Colorado doesn’t have a lemon law for consumer goods. The federal warranty act _might_ apply, but I don’t believe it specifies a number of repairs and I think says I have to ask. I never did.