How to rotate an object both about its own center and another point?

Something like the Earth around the Sun. How can you make an object rotate about its own center while also rotating about another point?


Parent the object to an empty at the middle point. Then rotate the object for spin, and rotate the empty for the orbit.