public function saveTree($serialize) { $tree = json_decode($serialize, true); if (json_last_error() != JSON_ERROR_NONE) { throw new \InvalidArgumentException(json_last_error_msg()); } $this->model->saveTree($tree); return true; }