Set id for the item manually.

@param mixed $id

@return Item|int
773718
public function id($id = null)
    {
        if (is_null($id)) {
            return $this->id;
        }

        $this->id = $id;

        return $this;
    }
1074499
public function getItemById($id)
    {
        $items = $this->getItems();
        if (isset($items[$id])) {
            return $items[$id];
        }

        return null;
    }
502156
public function setId($id = null)
    {
        if ($id !== null) {
            $id = preg_replace("/[^a-z0-9_\\\d]/i", '_', $id);

            $this->id = (string) $id;
        }
    }
755780
public function setId($id)
    {
        $id = (string)$id;

        if(!isset($this->__flywheelInitialId)) {
            $this->__flywheelInitialId = $id;
        }

        $this->__flywheelDocId = $id;

        return $id;
    }
401657
public function getItem($id)
	{
		$result = null;

		if (isset($this->_items[$id]))
		{
			$result =& $this->_items[$id];
		}

		return $result;
	}
627032
public function actionAssign(int $id)
    {
        $items = Yii::$app->getRequest()->post('items', []);
        $assignmentModel = $this->findModel($id);
        $assignmentModel->assign($items);

        return $assignmentModel->getItems();
    }
1036136
public function setId($id)
    {
        $id = (string) $id;

        if (!preg_match('#^[a-zA-Z0-9_.]+$#', $id)) {
            throw new InvalidAlgorithmIdException($id);
        }

        $this->id = mb_strtolower($id);
    }
1000818
public function setAttributeId( $id )
	{
		if ( $id == $this->getAttributeId() ) { return; }

		$this->_values['attrid'] = (string) $id;
		$this->setModified();
	}
1218891
public function setId( $id )
	{
		if ( ( $this->_values['id'] = MShop_Common_Item_Abstract::checkId($this->getId(), $id) ) === null ) {
			$this->_modified = true;
		} else {
			$this->_modified = false;
		}
	}
41637
public function setId($id)
    {
        if (is_integer($id) || is_float($id)) {
            $this->id = $id;
        } else {
            throw new InvalidArgumentException();
        }
    }
182589
public function set_id( $id ) {
		$this->id = $this->is_valid_id( $id ) ? $id : $this->generate_session_id();
	}
577400
public function setActive($id)
	{
		if (isset($this->_items[$id]))
		{
			$this->_active = $id;

			$result =& $this->_items[$id];

			return $result;
		}

		return null;
	}
957
public function setId($id)
    {

        if (!is_null($id) && (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $id))) {
            throw new \InvalidArgumentException("invalid value for $id when calling StackService., must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.");
        }

        $this->container['id'] = $id;

        return $this;
    }
296471
public static function convertKey($id)
    {
        if (is_string($id) && strlen($id) === 24 && ctype_xdigit($id)) {
            return new ObjectID($id);
        }

        return $id;
    }
1051375
public function setId($id)
    {
        $context = $this->_context;

        if (!$context->started) {
            $this->_start();
        }

        $context->session_id = $id;
    }
868640
public function setId(int $id): Phone
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
936297
public function setSiteId( $id )
	{
		if ( $id === $this->getSiteId() ) { return; }

		$this->_values['siteid'] = (int) $id;
		$this->_sitePath = array( (int) $id );
		$this->_siteSubTree = array( (int) $id );

		/** @todo: Wrong site item shouldn't be available any more but causes problems in controller */
		// $this->_site = null;

		$this->setModified();
	}