protected function filter_nlastype($n) { if ($this->parent === null) { return false; } else { return count($this->parent->getChildrenByTag($this->tag, 'total', false)) - $this->typeIndex() === (int) $n; } }