From: Roland Häder Date: Mon, 26 Oct 2020 15:13:26 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a056f376d67406bfdcee3b8f681eb086dac2f314;p=hub.git Continued: - recipientId is the proper one - also commented out Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index 770107d9b..1a495ee3a 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -1363,12 +1363,9 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: rawPackageContent()=%d - CALLED!', strlen($rawPackageContent))); $decodedArray = explode(self::PACKAGE_DATA_SEPARATOR, $rawPackageContent); - // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: decodedArray=' . print_r($decodedArray, TRUE)); - // Assert on count (should be always 3) assert(count($decodedArray) == self::DECODED_DATA_ARRAY_SIZE); - /* PRINTR-DIE: */ die(sprintf('[%s:%d] decodedArray=%s', __METHOD__, __LINE__, print_r($decodedArray, TRUE))); + //* DEBUG-DIE: */ die(sprintf('[%s:%d] decodedArray=%s', __METHOD__, __LINE__, print_r($decodedArray, TRUE))); // Create package instance $packageInstance = ObjectFactory::createObjectByConfiguredName('package_data_class'); @@ -1376,7 +1373,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei // Set all data $packageInstance->setSenderAddress($decodedArray[self::INDEX_PACKAGE_SENDER_ADDRESS]); $packageInstance->setSenderPort($decodedArray[self::INDEX_PACKAGE_SENDER_PORT]); - $packageInstance->setRecipient($decodedArray[self::INDEX_PACKAGE_RECIPIENT]); + $packageInstance->setRecipientId($decodedArray[self::INDEX_PACKAGE_RECIPIENT]); $packageInstance->setPackageContent($decodedArray[self::INDEX_PACKAGE_CONTENT]); $packageInstance->setStatus(self::PACKAGE_STATUS_DECODED); $packageInstance->setContentHash($decodedArray[self::INDEX_PACKAGE_HASH]); diff --git a/application/hub/classes/package/deliverable/class_PackageData.php b/application/hub/classes/package/deliverable/class_PackageData.php index c848eb38d..0dcbb84fd 100644 --- a/application/hub/classes/package/deliverable/class_PackageData.php +++ b/application/hub/classes/package/deliverable/class_PackageData.php @@ -66,6 +66,11 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera */ private $recipientType; + /** + * Recipient id + */ + private $recipientId; + /** * Recipient UNL */ @@ -209,6 +214,25 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera $this->recipientType = $recipientType; } + /** + * Getter for recipient id + * + * @return $recipientId Recipient id + */ + public function getRecipientId () { + return $this->recipientId; + } + + /** + * Setter for recipient id + * + * @param $recipientId Recipient id + * @return void + */ + public function setRecipientId ($recipientId) { + $this->recipientId = $recipientId; + } + /** * Getter for recipient UNL * diff --git a/application/hub/classes/tags/package/class_PackageTags.php b/application/hub/classes/tags/package/class_PackageTags.php index b348edfaf..2bc5ba9a9 100644 --- a/application/hub/classes/tags/package/class_PackageTags.php +++ b/application/hub/classes/tags/package/class_PackageTags.php @@ -124,7 +124,7 @@ class PackageTags extends BaseTag implements Tagable { $contentData = explode(NetworkPackageHandler::PACKAGE_MASK_SEPARATOR, $packageInstance->getPackageContent()); // Get the tags and store them locally - //* PRINTR-DIE: */ die(sprintf('[%s:%d]: contentData(%d)=%s', __METHOD__, __LINE__, count($contentData), print_r($contentData, TRUE))); + //* DEBUG-DIE: */ die(sprintf('[%s:%d]: contentData(%d)=%s', __METHOD__, __LINE__, count($contentData), print_r($contentData, TRUE))); $this->setTags(explode(NetworkPackageHandler::PACKAGE_TAGS_SEPARATOR, $contentData[NetworkPackageHandler::INDEX_TAGS])); } @@ -156,7 +156,7 @@ class PackageTags extends BaseTag implements Tagable { * the entry is invalid. */ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TAGS: entry[]=%s', gettype($entry))); - //* PRINTR-DIE: */ die(sprintf('[%s:%d] entry=%s', __METHOD__, __LINE__, print_r($entry, TRUE))); + //* DEBUG-DIE: */ die(sprintf('[%s:%d] entry=%s', __METHOD__, __LINE__, print_r($entry, TRUE))); if ((!is_array($entry)) || (count($entry) == 0) || (!isset($entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_PROTOCOL])) || (!isset($entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_RECIPIENT_TYPE]))) { // Invalid entry found throw new InvalidTagException(array($this, $tag), self::EXCEPTION_INVALID_TAG);