ZF-2666: Add isIdentity() method


On a few occasions I had to check if a column was the primary key (with auto-increment) in a table. One of these occasions was when I wanted to automate the creating/updating of a row after a form has been submitted and validated. The identity column needed to be ignored, because a value shouldn't be explicitly set. I ended up writing the following method in a custom Zend_Db_Table class:

public function isIdentity($column)
    if (!isset($this->_metadata[$column])) {
        return false;

    return (bool) $this->_metadata[$column]['IDENTITY'];

I'd like to see this method added to Zend_Db_Table_Abstract if possible for 1.5 :)


Please categorize/fix as needed.

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

It seems that in general ZDTA likes to throw exceptions when a non-existing column is specified. In my own SVN I changed the return false to throw an exception.

Fixed in revision 12428 and 12429 for bughuntday

Changing issues in preparation for the 1.7.0 release.

Fix from bughuntday wasn't merged with trunk.

Resolved in r.13554