public function deleteRowAndFiles(Zend_Db_Table_Row_Abstract $row) { try { $row = $row->toArray(); $where = self::FIELD_ID . ' = ' . $this->getAdapter()->quote($row[self::FIELD_ID]); $affectedRows = $this->getAdapter()->delete($this->_name, $where); if ($affectedRows > 0) { foreach ($this->_files as $fileId => $v) { if ($row[$fileId . self::FILETAG_NAME]) { #$key = $this->_configs[$fileId]['prefix'].'/'.$row[$fileId.self::FILETAG_NAME]; #$object = $this->_configs[$fileId]['object']; require_once 'Sitengine/Amazon/S3/Object.php'; $object = new Sitengine_Amazon_S3_Object($this->_configs[$fileId]['connection'], $this->_configs[$fileId]['bucket'], $this->_configs[$fileId]['prefix'] . '/' . $row[$fileId . self::FILETAG_NAME], $this->_configs[$fileId]['cname'], $this->_configs[$fileId]['ssl']); $response = $object->delete(); } } } return $affectedRows; } catch (Exception $exception) { require_once 'Sitengine/Exception.php'; throw new Sitengine_Exception('delete row and s3 files error', $exception); } }