Set the collection id

This will throw if the id of an existing collection gets updated to some other id

@throws ClientException

@param mixed $id - collection id

@return bool
426282
public function setId($id)
    {
        if ($this->_id !== null && $this->_id !== $id) {
            throw new ClientException('Should not update the id of an existing collection');
        }

        return $this->_id = (string) $id;
    }
1324834
public static function update(array $id = [], array $data = [], ClientInterface $client = null)
    {
        return (new RequestService($client))
            ->setResourceClass(static::class)
            ->setResourcePath(static::RESOURCE_PATH . "/:" . static::RESOURCE_ID)
            ->update($id, $data);
    }
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;
		}
	}
1137522
public function setId($id = null)
    {
        if ($id == null) {
            $this->id = mt_rand(0, 255);
        } else {
            $this->id = (int)$id;
        }

        return $this;
    }
508790
public function setDatatableId($id)
    {
        if (!array_key_exists($id, self::$instances)) {
            self::$instances[$id] = $this;
        } else {
            throw new \Exception('Identifer already exists');
        }

        return $this;
    }
31283
public function setId($id)
    {
        if (isset($this->id)) {
            throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::id');
        }
        $this->id = $id;
    }
424449
public function setUserId(int $id)
    {

        // Has the id changed?
        if ($id !== $this->userId) {
            // Invalidate existing user
            if ($this->user !== null && $this->user->getId() !== $id) {
                $this->user = null;
            };

            $this->userId = $id;
        }

        return $this;
    }
1179971
public function setId($id)
    {
        // blacklist
        if (!(is_string($id) and filter_var($id, \FILTER_VALIDATE_INT) !== false)
        and !is_int($id)) {
            throw new \InvalidArgumentException( "Integer ID expected." );
        }

        $this->id = (int) trim($id);

        return $this;
    }
292244
public static function setCurrentID($id)
    {
        $type = self::getType();
        $appID = App::getCurrentID();
        if (array_key_exists($id, self::$instances[$appID][$type])) {
            self::$id = $id;

            return true;
        }

        return false;
    }
983463
public function setId($id)
    {
        if ($this->hasData(self::P_ID)) {
            throw new JobException('Cant set id cause it is already sets!');
        }

        return $this->setData(self::P_ID, $id);
    }
160331
public function load($collection)
    {
        $collectionId = $this->getCollectionId($collection);

        if ($this->isValidCollectionId($collectionId)) {
            throw new ClientException('Cannot alter a collection without a collection id');
        }

        $result = $this->getConnection()->put(
            UrlHelper::buildUrl(Urls::URL_COLLECTION, [$collectionId, self::OPTION_LOAD]),
            ''
        );

        return $result;
    }
479048
public function setID($id)
    {
        /*
         * TODO validate/tokenize the actual ID
         */
        if (empty((string) $id)) {
            throw new ConfigurationException(
                'The configuration must specify a non-empty (and globally unique) ID for the Tool Provider.',
                ConfigurationException::TOOL_PROVIDER
            );
        } else {
            $this->id = (string) $id;
        }
    }
177788
public function setId($id)
    {
        $this->id = (string)$id;

        if (!$this->isIdValid($this->id)) {
            throw new InvalidIdException($this);
        }

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

            $this->id = (string) $id;
        }
    }
166710
public function setId($id)
    {
        if ($this->id) {
            return;
        }
        if (strlen($id) >= 20) {
            $this->id = $id;

            return;
        }
        list($a, $b) = explode(' ', microtime());
        $this->id = preg_replace("/[^\d]/", '', $b.$a.$id);
    }
757895
public function setId($id)
    {
       	if ($id !== null && is_numeric($id)) {
            $id = (int) $id;
        }
        $this->id = $id;

        return $this;
    }
380166
public function setId($id)
    {
        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker id after worker has started working');
        }

        $this->id = $id;
    }