mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
Show the count of the sub categories in the entity admin treeview.
This commit is contained in:
parent
650b388a1d
commit
d04a8626cb
5 changed files with 34 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue