Page 1 of 1

add values into class file

Posted: Tue Jan 03, 2012 5:20 pm
by srdva59
hi,
i have a class file that have all values from a database fields.
for example:


class mospedidos extends mosDBTable {
id = null;
date =null;
}

class mosunder extends mosDBTable {
id = null;
name =null;
}

each time i creat a new field in the database i need add the same field in the
class file, what i want is a way using php to add that new field to the class file.
i just need a way to open the file and the class name that i give and add the value
and save the file.
how can i do this?
thanks for your help
:)

Re: add values into class file

Posted: Wed Jan 04, 2012 12:46 am
by Christopher
Look at __get() and __set() in the manual.

Re: add values into class file

Posted: Wed Jan 04, 2012 4:37 am
by srdva59
hi,
ok i will see that thanks :)