@param string $position

@return $this

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

        return $this->addManipulation('watermarkPosition', $position);
    }
1080697
public function delete($position, $length = null)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		ArgumentValidator::validateUnsignedIntegerOrNull($length);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		if ($length === null) {
			$this->string = mb_substr($this->string, 0, $position);
		} else {
			$this->string = mb_substr($this->string, 0, $position) . mb_substr($this->string, $position + $length);
		}
		return $this;
	}
656383
protected function toPosition(string $id, $position): self
    {
        $element = $this->find($id);

        return $this
            ->without($id)
            ->insert($element, $position);
    }
426890
public function setSalt(string $salt, string $position = self::SALT_AFTER): self
    {
        $this->checkSaltPositionArgument($position);
        $this->salt = $salt;
        $this->saltPosition = $position;

        return $this;
    }
942814
public function getByPosition($position)
    {
        return isset($this->_entities[$position]) ? $this->_entities[$position] : null;
    }
1360950
public function setPointer($position, $isOffset = false)
    {
        if ($isOffset) {
            $this->pointer += $position;
        } else {
            $this->pointer = $position;
        }
    }
1150369
public function setPosition($position)
    {
        $oldPosition = $this->owner->{$this->positionAttribute};
        $transaction = $this->owner->getDb()->beginTransaction();
        try {
            $isUp = ($position - $oldPosition) > 0;
            $counters = [$this->positionAttribute => $isUp ? -1 : 1];
            $condition = [
                'between',
                $this->positionAttribute,
                $isUp ? $oldPosition : $position,
                $isUp ? $position : $oldPosition,
            ];
            $this->owner->updateAllCounters($counters, $condition);

            $this->owner->{$this->positionAttribute} = $position;
            $this->owner->save();

            $transaction->commit();

            return true;
        } catch (\Exception $e) {
            $transaction->rollBack();
            Yii::error($e);

            return false;
        }
    }
1057765
public function position($position = null)
    {
        return is_null($position) ? $this->position : $this->position = $position;
    }
153482
public function setPosition($position)
	{
		if ( $position == $this->getPosition() ) { return; }

		$this->_values['pos'] = (int) $position;
		$this->setModified();
	}
82629
public function setPosition($position)
    {
        if (in_array($position, [self::ADDON_LEFT, self::ADDON_RIGHT])) {
            $this->position = $position;
        }

        return $this;
    }
158507
public function at(int $position): Utility
    {
        if ($position < 0) {
            return new static('', $this->encoding);
        }

        return $this->substring($position, 1);
    }
1299528
public function offsetGet($position)
    {
        return isset($this->storage[$position]) ? $this->storage[$position] : null;
    }
1368562
protected function generateLocationFix(Position $position) : Signature\LocationFix
    {
        $location = $position->createRandomized();

        $locationFix = new Signature\LocationFix();
        $locationFix->setProvider("network");
        $locationFix->setProviderStatus(3);
        $locationFix->setLocationType(1);
        $locationFix->setTimestampSnapshot(rand(10000,35000));
        $locationFix->setAltitude($location->getAltitude());
        $locationFix->setLongitude($location->getLongitude());
        $locationFix->setLatitude($location->getAltitude());

        return $locationFix;
    }
124019
public static function invalidRoleInstance($role)
    {
        return new self(
            sprintf('Invalid role of type "%s" provided', is_object($role) ? get_class($role) : gettype($role))
        );
    }
281672
public function setTitlePosition($position)
    {
        $allowedValues = array("in", "out", "none");
        
        if (!in_array($position, $allowedValues))
        {
            throw new \Exception("Invalid position: " . $position);
        }
        
        $this->m_options['titlePosition'] = $position;
    }
848406
public function setStatus($position, $value)
    {
        $status = pow(2, $position - 1);
        if ($value) {
            $status = $this['status'] | $status;
        } elseif ($this['status'] !== null) {
            $status = $this['status'] & ~$status;
        } else {
            $status = ~$status;
        }
        $this['status'] = $status & 0xFFFF;

        return $this;
    }
625570
public function position($position, $type)
    {
        if (! in_array($type, $this->types)) {
            throw new InvalidArgumentException("Invalid assets type [${type}]");
        }

        $positions = is_array($position) ? $position : array($position);

        //
        $result = array();

        foreach ($positions as $position) {
            $items = Arr::get($this->positions, "${type}.${position}", array());

            if (! empty($items)) {
                $result = array_merge($result, $this->renderItems($items, $type, true));
            }
        }

        return implode("\n", array_unique($result));
    }