Skip to content

Commit

Permalink
Added getDocumentCodeType to ObjectHelper, Use in Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Oct 5, 2023
1 parent 4b2961f commit a2f9283
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/OrderDocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function setDocumentName(string $documentName): OrderDocumentBuilder
*/
public function setDocumentTypeCode(string $documentTypeCode): OrderDocumentBuilder
{
$this->objectHelper->tryCall($this->orderObject->getExchangedDocument(), "setTypeCode", $this->objectHelper->getCodeType($documentTypeCode));
$this->objectHelper->tryCall($this->orderObject->getExchangedDocument(), "setTypeCode", $this->objectHelper->getDocumentCodeType($documentTypeCode));
return $this;
}

Expand Down
15 changes: 15 additions & 0 deletions src/OrderObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ public function __construct(int $profile)
$this->profiledef = OrderProfiles::PROFILEDEF[$profile];
}

/**
* Creates an instance of DocumentCodeType
*
* @param string|null $value
* @return object|null
*/
public function getDocumentCodeType(?string $value = null): ?object
{
if (self::isAllNullOrEmpty(func_get_args())) {
return null;
}

return $this->createClassInstance('qdt\DocumentCodeType', $value);
}

/**
* Creates an instance of IDType
*
Expand Down

0 comments on commit a2f9283

Please sign in to comment.