I'm working on fixing bug related to Zend_Db_Table models. The problem that I faced with is that $_primary property of the Zend_Db_Table ancestor mysteriously being changed after you call insert, update etc.
Let's say I have the following value in this field:
Class Model_Book extends App_Base_FileForAcs implements App_Interface_OnixDataSource, App_Interface_ApiDataSource, App_Interface_DbGateway
{
protected $_name = 'book';
protected $_primary = 'book_id';
...
}
If I check $_primary after insert operation it will contain:
array(1) {
[1]=>
string(7) "book_id"
}
This transformation happens in _setupPrimaryKey method of Zend_Db_Table_Abstract class. Could you explain why this field should be transformed to array and why array starts with not 0 index?