Issues

ZF-3235: Get $_info data from Zend_Db_Table_Select instance

Issue Type: Improvement Created: 2008-05-11T03:39:32.000+0000 Last Updated: 2009-01-07T03:35:08.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Jurrien Stutterheim (norm2782) Assignee: Jurrien Stutterheim (norm2782) Tags: - Zend_Db_Select

Related issues: - ZF-3239

Attachments:

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:

<pre class="highlight">
/**
 * 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.

Comments

Posted by Wil Sinclair (wil) on 2008-06-09T12:17:35.000+0000

Please evaluate and fix/categorize as necessary.

Posted by Wil Sinclair (wil) on 2009-01-06T14:31:04.000+0000

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

Posted by Jurrien Stutterheim (norm2782) on 2009-01-06T22:15:53.000+0000

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.

Posted by Jurrien Stutterheim (norm2782) on 2009-01-07T03:35:08.000+0000

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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts