Hi guys, I've come up with a situation in my application where serializing a
select object to store it in a session variable would be remarkably useful,
but it isn't working. It's just throwing the usual "can't serialize a PDO
object" error. This was apparently fixed in
http://framework.zend.com/issues/browse/ZF-4600. Here's my basic code.

class DbTable_Candidates extends Zend_Db_Table_Abstract
{
    /**
     * @var string Table name
     */
    public $_name = 'candidates';

    /**
     * @var string Primary key
     */
    public $_primary = 'id';
}

...then, later on...

function fetchList($criteria) {
   $table = new DbTable_Candidates();
   $adapter = $table->getAdapter();
   $select  = $adapter->select();

... a bunch of stuff gets added to the $select object....

   $serialize = serialize($select);
}

and the error: You cannot serialize or unserialize PDO instances

This is on 1.7.8 of the framework, by the way.

Reply via email to