Zend Framework

Get $_info data from Zend_Db_Table_Select instance

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.5.1
  • Fix Version/s: 1.8.0
  • Component/s: Zend_Db_Select
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

At the moment it's not possible to get $_info data from a Zend_Db_Table_Select instance. A possible solution could be a getInfo() method, which is a slightly modified copy of the getPart() method:

/**
 * Get part of the structured information for the currect query.
 *
 * @param string $part
 * @return mixed
 * @throws Zend_Db_Select_Exception
 */
public function getInfo($info = null)
{
    if ($info === null) {
        return $this->_info;
    }

    $info = strtolower($info);
    if (!array_key_exists($info, $this->_info)) {
        require_once 'Zend/Db/Select/Exception.php';
        throw new Zend_Db_Select_Exception("Invalid Select part '$info'");
    }

    return $this->_info[$info];
}

The idea of fusion getInfo() and getPart() together crossed my mind as well, but the data in $_info is too different. However, there is some info in $_info that does/could belong to $_parts, such as the source table name. Something like getTableName() method for both Db_Select and Db_Table_Select would be nice in this case, because this would provide a generic interface to this data.

Issue Links

Activity

Hide
Wil Sinclair added a comment -

Please evaluate and fix/categorize as necessary.

Show
Wil Sinclair added a comment - Please evaluate and fix/categorize as necessary.
Hide
Wil Sinclair added a comment -

This issue has gone unaddressed for too long. I'm re-assigning to Ralph for re-evaluation and categorization.

Show
Wil Sinclair added a comment - This issue has gone unaddressed for too long. I'm re-assigning to Ralph for re-evaluation and categorization.
Hide
Jurrien Stutterheim added a comment -

Assigned this one to myself, since I'll try and resolve the related ZF-3239 soon. I'll see if this is still a relevant improvement after ZF-3239 has been resolved.

Show
Jurrien Stutterheim added a comment - Assigned this one to myself, since I'll try and resolve the related ZF-3239 soon. I'll see if this is still a relevant improvement after ZF-3239 has been resolved.
Hide
Jurrien Stutterheim added a comment -

This patch won't be applied. It's already possible to grab the table from the select object using getTable(). The same info can be retrieved from that table object.

Show
Jurrien Stutterheim added a comment - This patch won't be applied. It's already possible to grab the table from the select object using getTable(). The same info can be retrieved from that table object.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: