protected function insertEntry(MenuEntry $entry, $ndx = NULL) {

		if($entry instanceof DynamicMenuEntry) {
			$this->dynamicEntries[] = $entry;
		}

		if(!isset($ndx) || $ndx >= count($this->entries)) {
			$this->entries[] = $entry;
		}
		else {
			array_splice($this->entries, $ndx, 0, [$entry]);
		}

		$entry->setMenu($this);
		
		return $this;

	}
protected function insertEntry(MenuEntry $entry, $ndx = NULL) {

		if($entry instanceof DynamicMenuEntry) {
			$this->dynamicEntries[] = $entry;
		}

		if(!isset($ndx) || $ndx >= count($this->entries)) {
			$this->entries[] = $entry;
		}
		else {
			array_splice($this->entries, $ndx, 0, [$entry]);
		}

		$entry->setMenu($this);
		
		return $this;

	}
protected function insertEntry ( MenuEntry $ entry , $ ndx = NULL ) { if ( $ entry instanceof DynamicMenuEntry ) { $ this -> dynamicEntries [ ] = $ entry ; } if ( ! isset ( $ ndx ) || $ ndx >= count ( $ this -> entries ) ) { $ this -> entries [ ] = $ entry ; } else { array_splice ( $ this -> entries , $ ndx , 0 , [ $ entry ] ) ; } $ entry -> setMenu ( $ this ) ; return $ this ; }
insert or append menu entry

@param MenuEntry $entry
@param int $ndx
@return Menu
insert or append menu entry