Sets the current visitor ID to a random new one.
@return $this
196618
public function setNewVisitorId()
    {
        $this->randomVisitorId = substr(md5(uniqid(rand(), true)), 0, self::LENGTH_VISITOR_ID);
        $this->userId = false;
        $this->forcedVisitorId = false;
        $this->cookieVisitorId = false;
        return $this;
    }
682118
public function newUuid(){
        $q = Db::query('SELECT REPLACE(UUID(),"-","") as id');

        while($row = $q['result']->fetch_assoc()){
            $this->uuid = strtoupper($row['id']);
        }
        return $this;
    }
498457
public function addDealerBrandId($value)
    {
        $currentArray = $this->getDealerBrandIds();
        $currentArray []= $value;
        $this->setDealerBrandIds($currentArray);

        return $this;
    }
53489
public function random()
    {
        $objReturn = null;

        $intIndex = rand(0, (count($this->collection) - 1));
        if (isset($this->collection[$intIndex])) {
            $objReturn = $this->collection[$intIndex];
        }

        return $objReturn;
    }
803997
public function targetId(): self
    {
        $this->set('target', 'id');

        $this->addBeforeRender(function () {
            $value = (string) $this->get('value');

            if (! ctype_digit($value)) {
                return;
            }

            /** @var Attachment $attach */
            $attach = Dashboard::model(Attachment::class);

            $url = optional($attach::find($value))->url();

            $this->set('url', $url);
        });

        return $this;
    }
98474
public function unsetSessionId()
    {
        $this->clear(self::MAUTIC_SESSION_ID);
        $this->clear(self::MTC_SID);

        return $this;
    }
888539
public function setCustomerId($id)
    {
        if (!isset($this->data->customer)) {
            $this->data->customer = new stdClass();
        }
        $this->data->customer->id = $id;

        return $this;
    }
1271335
protected function setFirstPartyCookies()
    {
        if ($this->configCookiesDisabled) {
            return $this;
        }

        if (empty($this->cookieVisitorId)) {
            $this->loadVisitorIdCookie();
        }

        // Set the 'ref' cookie
        $attributionInfo = $this->getAttributionInfo();
        if (!empty($attributionInfo)) {
            $this->setCookie('ref', $attributionInfo, $this->configReferralCookieTimeout);
        }

        // Set the 'ses' cookie
        $this->setCookie('ses', '*', $this->configSessionCookieTimeout);

        // Set the 'id' cookie
        $visitCount = $this->visitCount + 1;
        $cookieValue = $this->getVisitorId() . '.' . $this->createTs . '.' . $visitCount . '.' . $this->currentTs .
            '.' . $this->lastVisitTs . '.' . $this->ecommerceLastOrderTimestamp;
        $this->setCookie('id', $cookieValue, $this->configVisitorCookieTimeout);

        // Set the 'cvar' cookie
        $this->setCookie('cvar', json_encode($this->visitorCustomVar), $this->configSessionCookieTimeout);
        return $this;
    }
25462
public function refresh()
    {
        if ($this->ID && $this->HailID) {
            try {
                $api_client = new Client();
                $data = $api_client->getOne($this);
            } catch (\Exception $ex) {
                return $this;
            }
            if (count($data) > 0) {
                $this->importHailData($data);
            }
        }

        return $this;
    }
94470
public function refresh() {

		$directory = new Directory($this -> directory -> getPath());
		$this -> directory = $directory -> entity();

		return $this;
	}
790670
public function unsetCurrentUser()
    {
        // Remove if the currentUser still sees itself as the current user.
        if ((self::$currentUser instanceof \Gems_User_User) && self::$currentUser->isCurrentUser()) {
            self::$currentUser->unsetAsCurrentUser(false);
        }
        self::$currentUser = null;
        return $this;
    }
1125715
public function setId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->id !== $v) {
            $this->id = $v;
            $this->modifiedColumns[SmartyFilterI18nTableMap::ID] = true;
        }

        if ($this->aSmartyFilter !== null && $this->aSmartyFilter->getId() !== $v) {
            $this->aSmartyFilter = null;
        }


        return $this;
    }
1128863
public function tryLoadRandom()
    {
        // get ID first
        $id = $this->dsql()->order('rand()')->limit(1)->field($this->getElement($this->id_field))->getOne();
        if ($id) {
            $this->load($id);
        }

        return $this;
    }
416565
public function setId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->id !== $v) {
            $this->id = $v;
            $this->modifiedColumns[DealerFolderVersionTableMap::ID] = true;
        }

        if ($this->aDealerFolder !== null && $this->aDealerFolder->getId() !== $v) {
            $this->aDealerFolder = null;
        }


        return $this;
    }
750518
public function setId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->id !== $v) {
            $this->id = $v;
            $this->modifiedColumns[DealerShedulesVersionTableMap::ID] = true;
        }

        if ($this->aDealerShedules !== null && $this->aDealerShedules->getId() !== $v) {
            $this->aDealerShedules = null;
        }


        return $this;
    }
345320
public function & SetId ($id) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		$this->id = $id;
		self::$instances[$id] = & $this;
		return $this;
	}
235560
public function setId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->id !== $v) {
            $this->id = $v;
            $this->modifiedColumns[PersonFunctionLinkVersionTableMap::ID] = true;
        }

        if ($this->aPersonFunctionLink !== null && $this->aPersonFunctionLink->getId() !== $v) {
            $this->aPersonFunctionLink = null;
        }


        return $this;
    }