Zend Framework

Zend_Db_Table: map SQL datatypes to PHP native datatypes

Details

  • Type: New Feature New Feature
  • Status: Postponed Postponed
  • Priority: N/A N/A
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: Next Minor Release
  • Component/s: Zend_Db_Table
  • Labels:
    None

Description

Tabe definition:
id int(10)
name varchar(255)
pass varchar(255)
pass_hash_id
language_id smallint(5)

on use:
$this->_data = $this->find($id);

the php data types can be:
$this->id : int
$this->name : string
$this->pass : string
$this->pass_hash_id : int
$this->language_id : int

But i don't now whether php can ask all databases for the data types

Greatz

Issue Links

Activity

Hide
Bill Karwin added a comment -

Changing fix version to 0.8.0.

Show
Bill Karwin added a comment - Changing fix version to 0.8.0.
Hide
Bill Karwin added a comment -

Hi Marc, I am taking a look at this issue report. I am not understanding what your request is. PHP does not support distinct datatypes corresponding to the different SQL datatypes. What behavior are you asking for, that is different from the behavior today?

Show
Bill Karwin added a comment - Hi Marc, I am taking a look at this issue report. I am not understanding what your request is. PHP does not support distinct datatypes corresponding to the different SQL datatypes. What behavior are you asking for, that is different from the behavior today?
Hide
Bill Karwin added a comment -

Recategorize as Zend_Db_Table component.

Show
Bill Karwin added a comment - Recategorize as Zend_Db_Table component.
Hide
Marc Bennewitz (GIATA mbH) added a comment -

Sorry my english is't the best.

If I write a object using Zend_Db_Table i can define which columns have which sql data types.
than on get the data from database with e.g. "$this->find($id)" Zend_Db_Table can automatic cast the sql data types to php

e.g.
int, smallint ... can cast to integer on php.
On now these are string values.

Show
Marc Bennewitz (GIATA mbH) added a comment - Sorry my english is't the best. If I write a object using Zend_Db_Table i can define which columns have which sql data types. than on get the data from database with e.g. "$this->find($id)" Zend_Db_Table can automatic cast the sql data types to php e.g. int, smallint ... can cast to integer on php. On now these are string values.
Hide
Bill Karwin added a comment -

Hi Marc, thank you for your explanation. We may have time to implement this in Zend Framework 0.9.

Show
Bill Karwin added a comment - Hi Marc, thank you for your explanation. We may have time to implement this in Zend Framework 0.9.
Hide
Wil Sinclair added a comment -

Please categorize/fix as needed.

Show
Wil Sinclair added a comment - Please categorize/fix as needed.
Hide
Wil Sinclair added a comment -

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Show
Wil Sinclair added a comment - This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Hide
Wil Sinclair added a comment -

Reassigning to Ralph since he's the new maintainer of Zend_Db

Show
Wil Sinclair added a comment - Reassigning to Ralph since he's the new maintainer of Zend_Db
Hide
Ralph Schindler added a comment -

Should this be done at the Zend_Db_Table level or perhaps a feature of Zend_Db_Adapter? ALso, should this be an opt-in feature? It seems like explicit casting of every property in a result set might incur quite a cost.

-ralph

Show
Ralph Schindler added a comment - Should this be done at the Zend_Db_Table level or perhaps a feature of Zend_Db_Adapter? ALso, should this be an opt-in feature? It seems like explicit casting of every property in a result set might incur quite a cost. -ralph
Hide
Marc Bennewitz (GIATA mbH) added a comment -

The table definition information are needed for this. Therefore it must be done in Zend_Db_Table.

Show
Marc Bennewitz (GIATA mbH) added a comment - The table definition information are needed for this. Therefore it must be done in Zend_Db_Table.
Hide
Ralph Schindler added a comment -

After discussing with several people, it seems like this issue would require several major archtectual changes to be done correctly. I'd like to do this for ZF 2.0, and will be put on the 2.0 roadmap

Show
Ralph Schindler added a comment - After discussing with several people, it seems like this issue would require several major archtectual changes to be done correctly. I'd like to do this for ZF 2.0, and will be put on the 2.0 roadmap
Hide
Thomas Weidner added a comment -

Reassigned to component maintainer

Show
Thomas Weidner added a comment - Reassigned to component maintainer

People

Vote (6)
Watch (5)

Dates

  • Created:
    Updated:

Time Tracking

Estimated:
2d
Original Estimate - 2 days
Remaining:
2d
Remaining Estimate - 2 days
Logged:
Not Specified
Time Spent - Not Specified