To be honest, I'm not a big fan of the magic getters and setters. But it is not such a bad place to use it here. 

If you would have asked me, I was sure there is a get method in document. But it seems like there isn't. So this is a good addition. I would also add a get(...) function which is public.