Relation loader in PHP