I'm trying to figure out a good way to keep all of my data for a particular table centralized. I started out by using a dataobject that had all of the usual methods (update, insert, delete...) and then started adding object variables that held the field names, field labels etc.. After some thought, I concluded that a good approach would be to seperate things like field labels and validation rules (etc) to different classes... How do some of you go about handling this sort of thing? What about things like foreign table dependancies? Here is a rough way of explaining the idea that I had:
It seems to me that a lot of things (labels, form inputs etc..) should be attached to the name of the database table field name (firstname in the above example).
$metadata = array(
'fields' => array(
'firstname => array(
'label' => 'First Name'
'rules' => array(),
'input_type_attributes' => array(
'length' => 30