But the category class would have to be passed something to check the database against.
lets say we have 2 categories in the category table
If, from the class I am instantiating the category class (in this case it's called Incident), I want to find out which c_id relates to the c_name that has been entered by a user, calling $category->catId won't work as the class won't know which ID to return. The class will have to be passed the c_name so that itcan check the database and return the c_id.
I'm just wondering what the most efficient way of doing this is. I could easily make a single method for this which is passed the name as an argument and then returns $this->catId as this is a small class but the larger it gets I can't cover every eventuality.
Maybe a method which takes the value and also the mysql column name to check against?
Feck it I'll give it a bash and see what happens but if anyone is able to decode my ramblings, any input would be appreciated (Just like yours was Chazzy! ). It's hard to put this one into words without writing a novel about it.