I suggest that $relation_to_name becomes a static variable. It must be defined in the class that extends Model_DataMany