From 225ae6e47889ada3b4b975ab74a16948e9040691 Mon Sep 17 00:00:00 2001 From: Matheus Rocha Date: Wed, 12 Oct 2022 16:13:54 +0100 Subject: [PATCH] add UserCreatedForm entity and add it as a new attribute in InternationalForms --- src/Entity/InternationalForms.php | 29 +++++++++++++ src/Entity/UserCreatedForm.php | 67 +++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 src/Entity/UserCreatedForm.php diff --git a/src/Entity/InternationalForms.php b/src/Entity/InternationalForms.php index 1b526eaa..92241805 100644 --- a/src/Entity/InternationalForms.php +++ b/src/Entity/InternationalForms.php @@ -151,6 +151,11 @@ class InternationalForms implements NodeInterface */ private $eeiFilingOption; + /** + * @var UserCreatedForm + */ + private $userCreatedForm; + /** * @return array */ @@ -295,6 +300,26 @@ public function getProducts() return $this->products; } + /** + * @param $userCreatedForm UserCreatedForm + * + * @return $this + */ + public function setUserCreatedForm(UserCreatedForm $userCreatedForm) + { + $this->userCreatedForm = $userCreatedForm; + + return $this; + } + + /** + * @return UserCreatedForm + */ + public function getUserCreatedForm() + { + return $this->userCreatedForm; + } + /** * @param null|DOMDocument $document * @@ -347,6 +372,10 @@ public function toNode(DOMDocument $document = null) if ($this->getEEIFilingOption() !== null) { $node->appendChild($this->getEEIFilingOption()->toNode($document)); } + if ($this->getUserCreatedForm() !== null) { + $node->appendChild($this->getUserCreatedForm()->toNode($document)); + } + foreach ($this->products as $product) { $node->appendChild($product->toNode($document)); } diff --git a/src/Entity/UserCreatedForm.php b/src/Entity/UserCreatedForm.php new file mode 100644 index 00000000..ea9509ef --- /dev/null +++ b/src/Entity/UserCreatedForm.php @@ -0,0 +1,67 @@ +DocumentID)) { + $this->setDocumentID($attributes->DocumentID); + } + } + } + + /** + * @param null|DOMDocument $document + * + * @return DOMElement + */ + public function toNode(DOMDocument $document = null) + { + if (null === $document) { + $document = new DOMDocument(); + } + + $node = $document->createElement('UserCreatedForm'); + $node->appendChild($document->createElement('DocumentID', $this->getDocumentID())); + + return $node; + } + + /** + * @return string + */ + public function getDocumentID() + { + return $this->documentID; + } + + /** + * @param string $number + * + * @return $this + */ + public function setDocumentID($documentID) + { + $this->documentID = $documentID; + + return $this; + } +}