MetaModel, or model creation on-the-fly?

Hey everyone,

i have little problem ;)

Is there a way to achieve something like MetaModel for many tables, or to create models for tables on-the-fly, with different column-sets, but with the same parametrized methods?

I have something like this scenario:

-Most of business logic lays into DB, as procedures/functions/triggers, Yii app shod be only a GUI for this logic

-Moving logic to GUI isn’t possible

-in DB there is many tables that are the same from logic point of view, but holds different set of columns (ie. many tables representing different user service types), but all of them share set of procedures, to operate on them

I want something like ‘Service’ class, witch will be meta model for all of this tables, or will create models for tables on-the-fly and propagate this models with set of methods.

Any tips in how to implement that scenario?

Big thx for any help!

PS app will be using php 5.3 so new php features introduced in 5.3 are welcome ;)

Bump, anyone?