If you want to add temporary data to the row object such that it doesn't actually get saved with the row, don't use attributes, use a setter method in your row class:
protected $customData = null;
public function getCustomData()
{
return $this->customData;
}
public function setCustomData($data)
{
$this->customData = $data;
return $this;
}
Then just call that from your code:
$row->setCustomData($data);
Alternately, if you want to do this for many classes, you can override the __set() method of Zend_Db_Table_Row_Abstract such that instead of throwing an exception, it stores the value in a separate area:
protected $extraFields = [];
function __set($columnName, $value)
{
$columnName = $this->_transformColumn($columnName);
if (array_key_exists($columnName, $this->_data)) {
$this->_data[$columnName] = $value;
$this->_modifiedFields[$columnName] = true;
} else {
$this->extraFields[$columnName] = $value;
}
}
public function __get($columnName)
{
$columnName = $this->_transformColumn($columnName);
if (array_key_exists($columnName, $this->_data)) {
return $this->_data[$columnName];
} else {
return $this->extraFields[$columnName];
}
}