Show the count of the sub categories in the entity admin treeview.

This commit is contained in:
Jan Böhmer 2019-04-05 18:35:06 +02:00
parent 650b388a1d
commit d04a8626cb
5 changed files with 34 additions and 0 deletions

View file

@ -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;
}
}