current() instanceof RoleInterface; } /** * @return bool */ public function hasChildren() { $current = $this->current(); if (!$current instanceof HierarchicalRoleInterface) { return false; } return $current->hasChildren(); } /** * @return RecursiveRoleIterator */ public function getChildren() { return new RecursiveRoleIterator($this->current()->getChildren()); } }