public function getRootId()
    {
        if (empty($this->hierarchy)) {
            throw new Exception\LogicException('The root item does not exist.');
        }

        reset($this->hierarchy);
        $id = key($this->hierarchy);

        return $id;
    }