public function getName()
{
$name = $this->getBaseName();
if ($this->index !== null) {
if ($this->index) {
foreach ($this->index as $part) {
$name .= '[' . $part . ']';
}
} else {
$name .= '[]';
}
}
if ($this->hook !== null) {
$hook = $this->hook;
return $hook($name);
} else {
return $name;
}
}