DB_DataObject - Date type generation.
| From: | Yashesh Bhatia | Date: | Thu, 17 Mar 2005 19:17:44 +0000 |
| Subject: | DB_DataObject - Date type generation. | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18122@lists.php.net to get a copy of this message | ||
hello:
i'm using mysql/php5.0/db_dataobject 1.7.10 and am using db_dataobject's generator for automatically generating the databobject files.
my sql table is as follows.
CREATE TABLEand the corresponding generated schema ini file is [user] id = 129 name = 130 dob = 6 income = 129 [user__keys] id = N my question is why does the dob (date of birth) have a generated type of DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE define('DB_DATAOBJECT_STR', 2); // requires '' define('DB_DATAOBJECT_DATE', 4); // is date #TODO also i noticed in the example in. http://pear.php.net/manual/en/package.database.db-dataobject.intro-autobuilding.php the handcoded extended class has a field of type date and is represented as 'bday' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE, (which i'm assuming it to be of type DATE in mysql). would appreciate any input on why this behaviour of generating a date type as date+string. thanks. yashesh. go pre http://www2.localaccess.com/rlalonde/pre.htmuser(idint(10) unsigned NOT NULL auto_increment,namevarchar(64) NOT NULL,dobdate,incomeint(10) unsigned NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB COMMENT='keeps track of income of people';