public function save()
{
$version = get_object_vars($this->model);
foreach ($version as $key => $value) {
if (in_array($key, $this->getValidTableColumns("edit_lock"))) {
$data[$key] = $value;
}
}
//var_dump($data);exit;
$this->db->insertOrUpdate("edit_lock", $data);
$lastInsertId = $this->db->lastInsertId();
if (!$this->model->getId() && $lastInsertId) {
$this->model->setId($lastInsertId);
}
return true;
}