@param int|null $position

@return ProductTaxonInterface
483883
private function createProductTaxon(TaxonInterface $taxon, ProductInterface $product, $position = null)
    {
        /** @var ProductTaxonInterface $productTaxon */
        $productTaxon = $this->productTaxonFactory->createNew();
        $productTaxon->setProduct($product);
        $productTaxon->setTaxon($taxon);

        if (null !== $position) {
            $productTaxon->setPosition($position);
        }

        return $productTaxon;
    }
615482
public function getChild($position)
    {
        if (!isset($this->_children[$this->getRealIndex($position)])) {
            return null;
        }

        return $this->_children[$this->getRealIndex($position)];
    }
411723
public function getChildrenOf($position)
    {
        if (!$this->hasChildren($position)) {
            return null;
        }

        $item = $this->get($position);
        $relation = $item->getChildrenRelationIndex();

        return $item->getRelation($relation);
    }
1106331
public function deleteCharAt($position)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		$this->string = mb_substr($this->string, 0, $position) . mb_substr($this->string, $position + 1);
		return $this;
	}
1068177
public function reposition($position)
    {
        return Basecamp::todoListGroups($this->bucket->id)
                       ->reposition($this->id, $position);
    }
798761
public function setProduct($product = null)
    {
        $productEntity = $product;
        // if api-product - temporarily save
        if ($product instanceof ApiProductInterface) {
            $this->tempProduct = $product;
            $productEntity = $product->getEntity();
        }
        $this->entity->setProduct($productEntity);

        return $this;
    }
877932
private function setNullsPosition($nullsPosition)
    {
        if (!\in_array($nullsPosition, [self::NULLS_FIRST, self::NULLS_LAST])) {
            throw new \InvalidArgumentException('Invalid nulls position: ' . $nullsPosition);
        }

        $this->nullsPosition = $nullsPosition;

        return $this;
    }
323154
public function watermarkPosition(string $position)
    {
        if (! $this->validateManipulation($position, 'position')) {
            throw InvalidManipulation::invalidParameter(
                'watermarkPosition',
                $position,
                $this->getValidManipulationOptions('position')
            );
        }

        return $this->addManipulation('watermarkPosition', $position);
    }
657412
public function rowIndex($position = null)
    {
        if ($position === null) {
            $position = $this->position();
        }

        $i = 0;
        $p = 0;
        foreach ($this->structure as $row_ident => $row) {
            $numCells = count($row['columns']);
            $p += $numCells;
            if ($p > $position) {
                return $i;
            }
            $i++;
        }
        return null;
    }
380871
public function setAncor ( $position = null ) {
        if ( is_null($position) === true ) {
            $position = $this->_currentPosition;
        }
        $this->_ancorPosition = $position;
        return $this;
    }
1120511
@Nullable
    public T getItem(final int position) {
        if (position < 0 || position >= mObjects.size()) {
            return null;
        }
        return mObjects.get(position);
    }
26830
public function prune($position = null)
    {
        if ($position) {
            $this->addUsingAlias(PositionTableMap::COL_ID, $position->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
421953
public function peekTokenAt($position) {
		if ($position < count($this->tokens)) {
			return $this->tokens[$position];
		} else {
			return null;
		}
	}
68927
public function offsetGet($position)
    {
        if (!isset($this->errors[$position])) {
            throw new OutOfBoundsException('The offset '.$position.' does not exist.');
        }

        return $this->errors[$position];
    }
1052213
public function skip(int $position): Pair
    {
        if ($position < 0 || $position >= count($this->pairs)) {
            throw new OutOfRangeException();
        }

        return $this->pairs[$position]->copy();
    }
519908
protected static function handleColumnPosition($position)
    {
        $query = static::getQuery();

        if (!$position) {
            return null;
        }

        $posColumn = '';

        $position = trim($position);

        if (strpos(strtoupper($position), 'AFTER') !== false) {
            list($position, $posColumn) = explode(' ', $position, 2);

            $posColumn = $query->quoteName($posColumn);
        }

        return $position . ' ' . $posColumn;
    }
100462
public function getDirectoryPosition($position)
    {
        if ($position === count($this->info['path'])) {
            return urldecode($this->info['file']);
        }

        return isset($this->info['path'][$position]) ? urldecode($this->info['path'][$position]) : null;
    }