add cleanup method to cleanup a single row

This commit is contained in:
Evan Prodromou 2010-01-01 11:02:56 -10:00
parent 727978332a
commit b0527801d9

View File

@ -253,6 +253,18 @@ class Memcached_DataObject extends DB_DataObject
return new ArrayWrapper($cached);
}
function cleanup()
{
global $_DB_DATAOBJECT;
if (isset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid])) {
unset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid]);
}
if (isset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid])) {
unset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]);
}
}
// We overload so that 'SET NAMES "utf8"' is called for
// each connection