public static function jsonSaveData(\Object\Table $model, array $values, \Object\Form\Base & $form, string $id_column) : bool {
		if (!empty($form->values[$id_column])) {
			$values[$id_column] = $form->values[$id_column];
		}
		$result = $model->collection()->merge($values);
		if (!$result['success']) {
			$form->error(DANGER, $result['error']);
			return false;
		}
		$form->values[$id_column] = $form->values[$id_column] ?? $result['new_serials'][$id_column];
		return true;
	}
public static function jsonSaveData(\Object\Table $model, array $values, \Object\Form\Base & $form, string $id_column) : bool {
		if (!empty($form->values[$id_column])) {
			$values[$id_column] = $form->values[$id_column];
		}
		$result = $model->collection()->merge($values);
		if (!$result['success']) {
			$form->error(DANGER, $result['error']);
			return false;
		}
		$form->values[$id_column] = $form->values[$id_column] ?? $result['new_serials'][$id_column];
		return true;
	}
public static function jsonSaveData ( \ Object \ Table $ model , array $ values , \ Object \ Form \ Base & $ form , string $ id_column ) : bool { if ( ! empty ( $ form -> values [ $ id_column ] ) ) { $ values [ $ id_column ] = $ form -> values [ $ id_column ] ; } $ result = $ model -> collection ( ) -> merge ( $ values ) ; if ( ! $ result [ 'success' ] ) { $ form -> error ( DANGER , $ result [ 'error' ] ) ; return false ; } $ form -> values [ $ id_column ] = $ form -> values [ $ id_column ] ?? $ result [ 'new_serials' ] [ $ id_column ] ; return true ; }
Save json data

@param \Object\Table $model
@param array $values
@param \Object\Form\Base $form
@param string $id_column
@return bool
Save json data