getData('request'); $source = $observer->getData('source'); if (!$source instanceof SourceInterface || !$request instanceof RequestInterface) { return; } $general = $request->getParam('general'); if (!is_array($general) || !array_key_exists('lingxing_wid', $general)) { return; } $value = trim((string)$general['lingxing_wid']); $this->warehouseRepository->assignSource( (string)$source->getSourceCode(), $value === '' ? null : (int)$value ); } }