Currently I am looking to refactor my code in php to use Active Record or DataMapper. I have a complex sql query where one table is the base and to it I join multiple tables