mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-20 22:28:49 +01:00
Show the count of the sub categories in the entity admin treeview.
This commit is contained in:
@@ -42,6 +42,8 @@ class TreeViewNode
|
||||
|
||||
protected $state;
|
||||
|
||||
protected $tags;
|
||||
|
||||
/**
|
||||
* Creates a new TreeView node with the given parameters.
|
||||
* @param string $text The text that is shown in the node. (e.g. the name of the node)
|
||||
@@ -144,4 +146,21 @@ class TreeViewNode
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTags() : ?array
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
public function addTag(string $new_tag) : self
|
||||
{
|
||||
//Lazy loading tags
|
||||
if ($this->tags == null) {
|
||||
$this->tags = array();
|
||||
}
|
||||
|
||||
$this->tags[] = $new_tag;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user