Re: Boolean datatype in DB_DataObject & DB_DataObject_FormBuilder
| From: | Markus Wolff | Date: | Wed, 10 Dec 2003 14:37:35 +0000 |
| Subject: | Re: Boolean datatype in DB_DataObject & DB_DataObject_FormBuilder | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24322@lists.php.net to get a copy of this message | ||
Norbert Mocsnik schrieb:
I need to use a boolean field with DataObject/FormBuilder (FormBuilder should generate a checkbox but DataObject has to handle boolean types first). I wonder if someone already wrote the code for this. If not, I'm glad to do it and post my solution to the list. I use mysql and I know that: BIT BOOL BOOLEAN These are synonyms for TINYINT(1). (according to the docs).Formbuilder doesn't handle boolean fields automatically yet, currently you'll have to pregenerate the checkbox element in preGenerateForm(). This is due to the incomplete type definitions the createTables script writes into the database.ini file (it currently only distinguishes between numeric and string types). I've been wanting to look at the problem again now that DO has support for cast objects, but I don't know yet whether or not I can use this new feature for generating forms with FormBuilder. A more complete createTables script would really come in handy.
What about other database engines? Anyways, is DataObject compatible with all the engines handled by the DB package?I guess this is best answered by Alan, but from what I know it's at least running just fine with MySQL, PostgreSQL and MSSQL. CU Markus