/** * @param BaseDomainModel $model * @return Mapper */ public function insert(BaseDomainModel $model) { $this->db->insert($this->tableName, $model->__toArray()); $id = $this->db->getLastInsertId(); if ($id) { $model->__setIdentity($id); } return $this; }