private function addElementByMenuCode(
        $element,
        $menuCode
    ) {
        if (!isset($this->elementsStoredByMenuCode[$menuCode])) {
            $this->elementsStoredByMenuCode[$menuCode] = [];
        }

        $elementId = spl_object_hash($element);
        $this->elementsStoredByMenuCode[$menuCode][$elementId] = $element;

        return $this;
    }