Feed a contact to a campaign. If real-time is enabled, skip event dispatching to prevent recursion.

@return $this

@throws \Exception
976437
public function addContactToCampaign()
    {
        if ($this->contact->getId()) {
            // Add the contact directly to the campaign without duplicate checking.
            // Passing manuallyAdded as true is important, prevents cron from immediately removing the contacts.
            $this->addContactsToCampaign($this->campaign, [$this->contact], true);
        }

        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;
    }
737706
final public function begin()
    {
        if (!$this->pdo) {
            throw  new Exception('您还没有连接数据库', Exception::CODE_DATABASE_ERROR);
        }
        if ($this->_begintransaction) {
            throw new Exception("已经开启了一个事务，请勿重新开启", Exception::CODE_DATABASE_ERROR);
        }
        $this->pdo->beginTransaction();
        $this->_begintransaction = true;
        return $this;
    }
1284080
public function noWait()
	{
		$this->type = 'noWait';

		if ($this->noWait === null)
		{
			$this->noWait = new QueryElement('NOWAIT', null);
		}

		return $this;
	}
238353
private function doTransitionFromY() : self
    {
        if ($this->getToken() !== '$') {
            throw (new Exception('Invalid Roman', Exception::INVALID_ROMAN))
                ->setPosition($this->getPosition())
                ->setToken($this->getToken());
        }

        // done!
        $this->setState(self::STATE_Z);
        return $this;
    }
338667
public function startApproval() {
		$this->Status = 'Started';
		$this->log("Starting {$this->Title}...");
		// Determine if we should use delayed notification
		$recipientGroup = 'all';
		if($this->getConfigSetting('RecipientsDelay')) {
			$this->NotifiedGroup = $recipientGroup = 0;
		}
		// Send to selected group
		$this->sendMessage(self::ALERT_REQUEST, $recipientGroup);
		$this->write();
		return true;
	}
311692
public function adapt()
    {
        if (method_exists($this, $this->adaptMethodName) && $this->data) {
            call_user_func([$this, $this->adaptMethodName]);
        }

        return $this;
    }
951979
protected function startListening()
	{
		foreach ($this->eventsToListenFor as $event) {
			if (is_callable([$this, $event])) {
				$this->connection->eventManager()->bind($event, [$this, $event]);
			}
		}
		return $this;
	}
878036
protected function executeNextWaitingRequest()
    {
        if (($this->numberOfParallelRequests === 0 || count($this->runningRequests) < $this->numberOfParallelRequests)
            && count($this->waitingRequests) > 0
        ) {
            $this->executeRequest(reset($this->waitingRequests));
        }
        return $this;
    }
3436
public function refresh()
    {
        if (! $this->exists) {
            return $this;
        }

        $this->setRawAttributes(
            static::newQueryWithoutScopes()->findOrFail($this->getKey())->attributes
        );

        $this->load(collect($this->relations)->except('pivot')->keys()->toArray());

        $this->syncOriginal();

        return $this;
    }
1354185
public function notify(): SubjectInterface
    {
        foreach ($this->observer as $value) {
            $value->update($this);
        }
        return $this;
    }
1321856
public function run()
	{
		$this->connect();

		try
		{
			while (!$this->feof())
			{
				$data = $this->irc_read(60); // We wait 60 seconds but it's arbitrary and can be safely modified...
				if ($data === false)
				{
					continue;
				}

				$this->callListeners($data);
			}
		}
		catch (SocketDisconnectedException $e)
		{
			return $this;
		}

		return $this;
	}
1161387
public function treat()
    {
        if (!$this->isTreated) {
            $this->initFetchValues();
            $this->isTreated = TRUE;
            if ($this->isActive()) {
                $this->validFetchValues();
            }
        }
        return $this;
    }
1069150
protected function throttle()
    {
        if ($this->isThrottled($this->conn, 'onOpen')) {
            $this->console->info(sprintf('Connection throttled: %d', $this->conn->resourceId));
            $this->conn->send(trans('ratchet::messages.tooManyConnectionAttempts'));
            $this->throttled = true;
            $this->conn->close();
        }

        return $this;
    }
706431
protected function subscribeAtPubnub()
    {

        if (!$this->alive()) {
            throw new Exception('Subscription is not alive');
        }

        $pnconf = new PNConfiguration();

        $pnconf->setSubscribeKey($this->_subscription['deliveryMode']['subscriberKey']);
        $pnconf->setPublishKey('convince-pubnub-its-okay');
        $pnconf->setSubscribeTimeout(self::SUBSCRIBE_TIMEOUT);

        $subscribeCallback = new PubnubCallback($this);

        $this->_pubnub = new PubNub($pnconf);
        $this->_pubnub->addListener($subscribeCallback);

        if (!$this->_skipSubscribe) {
            $this->_pubnub->subscribe()
                          ->channels($this->_subscription['deliveryMode']['address'])
                          ->execute();
        }

        return $this;

    }
261608
public function send()
    {
        if (!$this->from) {
            throw new \Exception('Message sender has not been set');
        }

        if (!$this->body) {
            throw new \Exception('Message body has not been set');
        }

        if (!$this->to) {
            throw new \Exception('Message receiver has not been set');
        }

        $command = new SendMessageCommand($this->to, $this->body, $this->from, $this->type);

        return $this->commandBus->execute($command);
    }
317316
public function updateHref() {
		if ( $this->href !== null && !$this->isDisabled() ) {
			$this->button->setAttributes( [ 'href' => $this->href ] );
		} else {
			$this->button->removeAttributes( [ 'href' ] );
		}
		return $this;
	}