protected function _getRowById($id) { if ($id) { $s = $this->_getSelect(); //use same select as for loading to be able to save only rows we can view $s->whereId($id); $row = $this->_model->getRow($s); } else { if (!isset($this->_permissions['add']) || !$this->_permissions['add']) { throw new Kwf_Exception("Add is not allowed."); } $row = $this->_model->createRow(); } return $row; }