Skip to content

Commit

Permalink
Step 7.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
CNanninga committed Aug 18, 2022
1 parent 8fa0b97 commit 0ffe32b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Expand Up @@ -28,4 +28,8 @@ public function getExportedAt(): ?\DateTime;
public function setExportedAt(\DateTime $exportedAt): OrderExportDetailsInterface;

public function hasBeenExported(): bool;

public function getArchived(): bool;

public function setArchived(bool $archived): OrderExportDetailsInterface;
}
11 changes: 11 additions & 0 deletions src/example-orderexport/Model/OrderExportDetails.php
Expand Up @@ -67,4 +67,15 @@ public function hasBeenExported(): bool
{
return (bool) $this->getData('exported_at');
}

public function getArchived(): bool
{
return (bool)$this->getData('archived');
}

public function setArchived(bool $archived): OrderExportDetailsInterface
{
$this->setData('archived', ($archived) ? 1 : 0);
return $this;
}
}
2 changes: 2 additions & 0 deletions src/example-orderexport/etc/db_schema.xml
Expand Up @@ -10,6 +10,8 @@
<column xsi:type="text" name="merchant_notes" comment="Merchant notes" />
<column xsi:type="timestamp" name="exported_at" nullable="false"
comment="Exported at" />
<column xsi:type="smallint" name="archived" unsigned="true" nullable="false"
default="0" comment="Is Archived" />
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="id"/>
</constraint>
Expand Down
3 changes: 2 additions & 1 deletion src/example-orderexport/etc/db_schema_whitelist.json
Expand Up @@ -5,7 +5,8 @@
"order_id": true,
"ship_on": true,
"merchant_notes": true,
"exported_at": true
"exported_at": true,
"archived": true
},
"constraint": {
"PRIMARY": true,
Expand Down

0 comments on commit 0ffe32b

Please sign in to comment.