support tags in invoices (#2526)
This commit is contained in:
@@ -75,6 +75,10 @@ final class InvoiceItem
|
||||
* @var string
|
||||
*/
|
||||
private $category;
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $tags = [];
|
||||
|
||||
public function addAdditionalField(string $name, ?string $value): InvoiceItem
|
||||
{
|
||||
@@ -269,4 +273,23 @@ final class InvoiceItem
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addTag(string $tag): void
|
||||
{
|
||||
foreach ($this->tags as $t) {
|
||||
if (strcasecmp($tag, $t) === 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->tags[] = $tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTags(): array
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user