DB_DataObject: M:N relations
| From: | Mocsnik Norbert | Date: | Mon, 13 Oct 2003 09:59:25 +0000 |
| Subject: | DB_DataObject: M:N relations | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-22637@lists.php.net to get a copy of this message | ||
Hi,
DB_DataObject and DB_DataObject_FormBuilder can save me up to 30% of development time in one of my projects and I'd like to use them in this one as well as in earlier projects. However, this one needs a <select> input in the form with the possibility to select multiple items at the same time.
In relational databases we store this using 1:N - N:1 relations with an additional table between them. (e.g. clients - clients_services - services). My problem is that I don't know if I implement such a feature should it be really in DB_DataObject or another class should be created using multiple DataObject-based components. I think the best would be to implement this in DB_DataObject so it could store the whole "client" form in one turn ($clienttable->insert()), and even DB_DataObject_FormBuilder can use it to generate the corresponding html element..
If anyone could help me on how to do this, I'd be happy to implement it in both DB_DataObject and DB_DataObject_FormBuilder and post it to the list. Any ideas are welcome.
Norbert Mocsnik