public static function createFromJSON($json_obj) { $result = new self(); // Handle complex and special cases // Then remove them from the data array as not to be reprocessed below if (isset($json_obj->alert)) { $result->alert = Alert::createFromJSON($json_obj->alert); unset($json_obj->alert); } if (isset($json_obj->trigger)) { $result->trigger = Trigger::createFromJSON($json_obj->trigger); unset($json_obj->trigger); } if (isset($json_obj->source)) { $result->source = Source::createFromJSON($json_obj->source); unset($json_obj->source); } if (isset($json_obj->outputFormats)) { $result->outputFormats = $json_obj->outputFormats->outputFormat; unset($json_obj->outputFormats); } if (isset($json_obj->repositoryDestination)) { $result->repositoryDestination = RepositoryDestination::createFromJSON($json_obj->repositoryDestination); unset($json_obj->repositoryDestination); } if (isset($json_obj->mailNotification)) { $result->mailNotification = MailNotification::createFromJSON($json_obj->mailNotification); unset($json_obj->mailNotification); } // Handle the remaining simple attributes foreach ($json_obj as $k => $v) { $result->{$k} = $v; } return $result; }