public function savetreeAction() { if ($this->getRequest()->isPost()) { foreach ($this->getParam('tree') as $row) { $where = $this->_modelMenu->getAdapter()->quoteInto('item_id = ?', $row['id']); $this->_modelMenu->updateSection(array('parent_id' => $row['parent_id'] ? $row['parent_id'] : new Zend_Db_Expr('NULL'), 'sort' => $row['sort']), $where); } } }