Trying to get Doctrine to encode entities to JSON