Hi,

I've just been following the model section of the quick start (http://framework.zend.com/docs/quickstart/create-a-model-and-database-table) and had a few questions. If anyone can help me it would be great.

- Where would I apply validation to the guestbook model data?

- How do I ensure the mapper only saves a valid guestbook entry?

I want to add my validation in one place, so one idea I had was adding it to the setter methods in Default_Model_Guestbook. But then I would need something else for the mapper to call to make sure the whole Default_Model_Guestbook was valid. So maybe an isValid() method or similar. Does that sound like the correct direction to be going in?

I'm just thinking things through here so any pointers very welcome :)

Cheers,

Chris

Reply via email to