From be12fe9f230a16a97a2d7fbccc7b60208c2e7ced Mon Sep 17 00:00:00 2001 From: wadedvsa <155439365+wadedvsa@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:59:12 +0000 Subject: [PATCH] fix: Message document link --- src/Command/Document/UpdateDocumentLinks.php | 8 +++--- src/Command/Document/Upload.php | 8 +++--- .../Traits/MessagingConversationOptional.php | 28 +++++++++++++++++++ .../Traits/MessagingMessageOptional.php | 28 +++++++++++++++++++ 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 src/FieldType/Traits/MessagingConversationOptional.php create mode 100644 src/FieldType/Traits/MessagingMessageOptional.php diff --git a/src/Command/Document/UpdateDocumentLinks.php b/src/Command/Document/UpdateDocumentLinks.php index eb5b7155..080b09ab 100644 --- a/src/Command/Document/UpdateDocumentLinks.php +++ b/src/Command/Document/UpdateDocumentLinks.php @@ -11,10 +11,10 @@ use Dvsa\Olcs\Transfer\FieldType\Traits\ApplicationOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\BusRegOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\CasesOptional; -use Dvsa\Olcs\Transfer\FieldType\Traits\ConversationOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\IrhpApplicationOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\LicenceOptional; -use Dvsa\Olcs\Transfer\FieldType\Traits\MessageOptional; +use Dvsa\Olcs\Transfer\FieldType\Traits\MessagingConversationOptional; +use Dvsa\Olcs\Transfer\FieldType\Traits\MessagingMessageOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\TransportManagerOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\SurrenderOptional; use Dvsa\Olcs\Transfer\Util\Annotation as Transfer; @@ -35,8 +35,8 @@ final class UpdateDocumentLinks extends AbstractCommand use LicenceOptional; use IrhpApplicationOptional; use SurrenderOptional; - use ConversationOptional; - use MessageOptional; + use MessagingConversationOptional; + use MessagingMessageOptional; /** * @var int diff --git a/src/Command/Document/Upload.php b/src/Command/Document/Upload.php index f6544302..912fc8fe 100644 --- a/src/Command/Document/Upload.php +++ b/src/Command/Document/Upload.php @@ -12,9 +12,9 @@ use Dvsa\Olcs\Transfer\FieldType\Traits\ApplicationOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\BusRegOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\CasesOptional; -use Dvsa\Olcs\Transfer\FieldType\Traits\ConversationOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\LicenceOptional; -use Dvsa\Olcs\Transfer\FieldType\Traits\MessageOptional; +use Dvsa\Olcs\Transfer\FieldType\Traits\MessagingConversationOptional; +use Dvsa\Olcs\Transfer\FieldType\Traits\MessagingMessageOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\SurrenderOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\TransportManagerOptional; use Dvsa\Olcs\Transfer\FieldType\Traits\IrhpApplicationOptional; @@ -34,8 +34,8 @@ final class Upload extends AbstractCommand implements LoggerOmitContentInterface use LicenceOptional; use SurrenderOptional; use IrhpApplicationOptional; - use ConversationOptional; - use MessageOptional; + use MessagingConversationOptional; + use MessagingMessageOptional; /** * @Transfer\Filter("Laminas\Filter\PregReplace", options={"pattern": "/[^a-zA-Z0-9\-\_\.]+/", "replacement": ""}) diff --git a/src/FieldType/Traits/MessagingConversationOptional.php b/src/FieldType/Traits/MessagingConversationOptional.php new file mode 100644 index 00000000..85f68deb --- /dev/null +++ b/src/FieldType/Traits/MessagingConversationOptional.php @@ -0,0 +1,28 @@ +messagingConversation ? (int)$this->messagingConversation : null; + } + + /** @param int $conversationId */ + public function setMessagingConversation($conversationId) + { + $this->messagingConversation = $conversationId ? (int)$conversationId : null; + } +} diff --git a/src/FieldType/Traits/MessagingMessageOptional.php b/src/FieldType/Traits/MessagingMessageOptional.php new file mode 100644 index 00000000..c4c8bce8 --- /dev/null +++ b/src/FieldType/Traits/MessagingMessageOptional.php @@ -0,0 +1,28 @@ +messagingMessage ? (int)$this->messagingMessage : null; + } + + /** @param int $messageId */ + public function setMessagingMessage($messageId) + { + $this->messagingMessage = $messageId ? (int)$messageId : null; + } +}