Re: DB_DataObject, table desc and toArray()
| From: | Brian Clark | Date: | Tue, 12 Dec 2006 21:40:22 +0000 |
| Subject: | Re: DB_DataObject, table desc and toArray() | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26080@lists.php.net to get a copy of this message | ||
On Mon, Dec 11, 2006 at 07:44:26AM -0800, Justin Patrin wrote:
> On 12/9/06, Brian Clark <brianj+nevdull@unwell.org> wrote:
> >Hi there,
> >I've been using this to get a list of the table columns:
> > $db = new DB_DataObject;
> > $db->tableName('mental_patient');
> > $table = $db->toArray();
> $do = DB_DataObject::factory('mental_patient');
> $columns = $do->table();
I used $db = new DB_DataObject; because I plan to not use objects named
after any specific table (do you see that as becoming a problem?).
What you wrote works great. I can't believe I missed that.
Thank you, Justin.
--
Brian Clark