Re: DataObjects: how to manage SET type ?
| From: | Alan Knowles | Date: | Fri, 21 Mar 2003 00:53:24 +0000 |
| Subject: | Re: DataObjects: how to manage SET type ? | ||
| References: | 1 2 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-4346@lists.php.net to get a copy of this message | ||
The Php_kid wrote:
Hi friends, I've read DataObjects package and really it's very useful...! Now, I've a question ... How DataObjects manage a SET column type? how to access or set it ? from the mysql manual it works pretty much like a string as far as setting/fetching goes.and how to ask to
DataObject class if something value is on SET or not ?ATM no, the long term aim is to use a richer data definition file (although even MDB's schema doesnt support this by the looks of it.) For the time being, the best way to do it is just create an additional method in the extended dataobject - eg. getSetsMyCol() { return array( 'a','b','c','d' ); }
Of course, I would use FIND_IN_SET mysql funcion with query() method, but I don't want put SQL sentences on Class code. There is a DataObjects method to do it ?just use whereAdd - If you use it alot - create a method in the extended dataobject to build the whereAdd.. Regards Alan
Regards Mac ...The PHP_Kid. "Hey Einstein!... There is a easier way to do it." (Rasmus Ledorf)