Insert an item at a position
@param mixed $item
@param int $position
@return HtmlDropdownItem
517776
public function insertItem($item,$position=0){
		$itemO=$this->beforeAddItem($item);
		 $start = array_slice($this->items, 0, $position);
		 $end = array_slice($this->items, $position);
		 $start[] = $item;
		 $this->items=array_merge($start, $end);
		 return $itemO;
	}
134694
public void insertChild(CmsTreeItem item, int position) {

        m_children.insert(item, position);
        adopt(item);
    }
718351
private function order($position, $item)
    {
        $category = $this->categoryRepository->find($item['id']);
        $this->savePosition($category, $position);
        $this->makeItemChildOf($category, null);

        if ($this->hasChildren($item)) {
            $this->handleChildrenForParent($category, $item['children']);
        }
    }
1196736
public ModelAdapter<?, Item> add(int position, List<Item> items) {
        if (mOriginalItems != null && items.size() > 0) {
            if (mItemAdapter.isUseIdDistributor()) {
                mItemAdapter.getIdDistributor().checkIds(items);
            }
            mOriginalItems.addAll(getAdapterPosition(mItemAdapter.getAdapterItems().get(position)) - mItemAdapter.getFastAdapter().getPreItemCount(position), items);
            publishResults(mConstraint, performFiltering(mConstraint));
            return mItemAdapter;
        } else {
            return mItemAdapter.addInternal(position, items);
        }
    }
1333250
public function getItem(int $position): ?APIItem
    {
        foreach ($this->items as $item) {
            if ($item->getPosition() === $position) {
                return $item;
            }
        }

        return null;
    }
656383
protected function toPosition(string $id, $position): self
    {
        $element = $this->find($id);

        return $this
            ->without($id)
            ->insert($element, $position);
    }
1256520
public function fillAction(Item $item)
    {
        // do fill
        $this->get('anime_db.item_folder_filler.filler_folder')->fillFolder($item);

        return $this->render('AnimeDbItemFolderFillerBundle:Filler:fill.html.twig', [
            'item' => $item
        ]);
    }
1352921
public function setItem(Item $item = null)
    {
        if ($this->item !== $item) {
            // romove link on this item for old item
            if ($this->item instanceof Item) {
                $tmp = $this->item;
                $this->item = null;
                $tmp->removeName($this);
            }
            $this->item = $item;
            // add link on this item
            if ($item instanceof Item) {
                $this->item->addName($this);
            }
        }

        return $this;
    }
772719
public function addDropdown($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false){
		return $this->addItem(new HtmlFormDropdown($identifier,$items,$label,$value,$multiple));
	}
362991
public function appendItem(Node $item) {
    if ($this->getItems()->isEmpty()) {
      $this->append($item);
    }
    else {
      $this->append([
        Token::comma(),
        Token::space(),
        $item,
      ]);
    }
    return $this;
  }
560147
public FastAdapterDialog<Item> add(int position, Item item) {
        mItemAdapter.add(position, item);
        return this;
    }
936082
function Insert($item, $parent = null, $previous = null)
    {
        if ($previous)
        {
            $parent = $this->provider->ParentOf($previous);
        }
        $oldNext = $this->provider->NextOf($item);
        $oldPrev = $this->provider->PreviousOf($item);
        $oldFirst = $this->provider->FirstChildOf($parent);
        if (!($oldPrev && $previous && $this->provider->Equals($oldPrev, $previous)))
        {
            $this->CloseCutGap($oldPrev, $oldNext, $item);
        }
        $this->UpdateInsertItem($item, $parent, $previous);
        
        if (!$previous)
        {
            $this->AssureFirstChild($item, $oldFirst);
        }
    }
1029173
public static function array_insert(&$array, $item, $position) {
        if ($position == 0) {
            /* Prepend the item */
            array_unshift($array, $item);
        } else {
            if (count($array) == $position) {
                $array[] = $item;
            } else {
                array_splice($array, $position, 0, array($item));
            }
        }
    }
166058
public function addAt(Item $item, $position = null)
    {
        if (0 === $position) {
            array_unshift($this->items, $item);
        } else if (null === $position) {
            $this->items[] = $item;
        } else if (count($this->items) <= $position) {
            $this->items[] = $item;
        } else {
            array_splice($this->items, $position, 0, [$item]);
        }

        $this->isUpdated = true;

        return $this;
    }
961498
public ModelAdapter<?, Item> set(int position, Item item) {
        if (mOriginalItems != null) {
            if (mItemAdapter.isUseIdDistributor()) {
                mItemAdapter.getIdDistributor().checkId(item);
            }
            mOriginalItems.set(getAdapterPosition(mItemAdapter.getAdapterItems().get(position)) - mItemAdapter.getFastAdapter().getPreItemCount(position), item);
            publishResults(mConstraint, performFiltering(mConstraint));
            return mItemAdapter;
        } else {
            return mItemAdapter.setInternal(position, item);
        }
    }
1057126
public function addItem(Item $item)
	{
		$item->source = $this->link;

		$this->items[] = $item;

		return $this;
	}
988088
public function add_item( $item ) {
		if ( is_array( $item ) ) {
			foreach ( $item as $single_item ) {
				$this->add_item( $single_item );
			}
		} else {
			$priority                   = $item->get_priority();
			$this->items[ $priority ][] = $item;
		}
	}