Doctrine object

This PR is to the doctrine branch, not sure what happens when that is merged first into master