public static function insertList($list_id, $name, $board_id) { $update = true; $model = Lists::getListbyListID($list_id); if ($model === null) { $model = new Lists(); $update = false; } $model->list_id = $list_id; $model->name = $name; $model->board_id = $board_id; if ($update) { if ($model->save()) { } } else { $model->insert(); } }