/** * Save * * @throws Exception * @return array */ public final function save() { if (empty($this->_table)) { throw new Exception('Table is not specified'); } // Update if ($this->_stored) { $this->_table->updateRow($this); } else { $this->_table->insertRow($this); } return $this->getPrimaryKey(); }