WIP: porting 865511af2dcb8a6c752779fa3902a5fae8c20e91 to Propel2.

I started porting over the analogous pull request from the propel project (https://github.com/propelorm/Propel/issues/267).

I need to port my test code up to 5.3 but I don't have it running on this box yet. I just wanted to do the PR now so that it wouldn't get forgotten about.