Set the state of multiple messages

@param   integer  $state  State to set
@param   array    $ids    List of message IDs
@return  boolean  True on success
542266
public function setState($state=0, $ids=array())
	{
		if (count($ids) <= 0)
		{
			return false;
		}

		$ids = array_map('intval', $ids);

		return $this->update()
			->set(array('state' => $state))
			->whereIn('id', $ids)
			->execute();
	}
891421
protected function setState(int $state) : bool
    {
        $this->workerState = $state;

        // report idle state to server:
        $this->replySocket->send(json_encode([
            'request' => 'change_state',
            'worker_id' => $this->workerId,
            'state' => $this->workerState
        ]));
        $response = $this->replySocket->recv();
        return ($response === 'ok');
    }
818671
public function setPlatformState(MaintenanceState $state)
    {
        if ($previous = $this->getDriver()->get(self::PREFIX . self::LAST_MODE)) {
            $currentState = new MaintenanceState(json_decode($previous, true));
            $currentState->setEndTime($state->getStartTime());
            $this->getDriver()->set(self::PREFIX . $currentState->getId(), json_encode($currentState->toArray()));

            $state->setId($currentState->getId() + 1);
        }


        $this->getDriver()->set(self::PREFIX . self::LAST_MODE, json_encode($state->toArray()));
    }
1275306
public function setState($state) {
        $statusProp = $this->getProperty(OntologyDeliveryExecution::PROPERTY_STATUS);
        $state = $this->getResource($state);
        $currentStatus = $this->getState();
        if ($currentStatus->getUri() == $state->getUri()) {
            common_Logger::w('Delivery execution '.$this->getIdentifier().' already in state '.$state->getUri());
            return false;
        }
        $this->editPropertyValues($statusProp, $state);
        if ($state->getUri() == DeliveryExecutionInterface::STATE_FINISHED) {
            $this->setPropertyValue($this->getProperty(OntologyDeliveryExecution::PROPERTY_TIME_END), microtime());
        }
        $this->state = $state;
        return true;
    }
372637
private function setStates(array $states)
    {
        foreach ($states as $state) {
            if (!is_string($state) || strlen($state) !== 1) {
                throw new \InvalidArgumentException(
                    'State must be a one character string'
                );
            }
        }

        $this->states = $states;
    }
392891
public function updateFromEmbeddedApiResponse(array $data, StateInterface $state = null): StateInterface
    {
        if (!$state) {
            $state = $this->stateRepository->findOneByExternalId($data['id']);
            if (!$state) {
                // only update when we create a new because this is the embedded method
                $state = new State();
                $state->setExternalId($data['id'])
                    ->setExclStatistics($data['exclStatistics'])
                    ->setIsDefault($data['isDefault'])
                    ->setName($data['name']);
            }
        }

        return $state;
    }
797509
private function stateChanged($states)
    {
        $appID = App::getCurrentID();
        $complementID = self::getCurrentID();

        if (isset($states[$appID][$complementID])) {
            $actualStates = $states[$appID][$complementID];

            if (! count(array_diff_assoc($actualStates, $this->states))) {
                return false;
            }
        }

        return true;
    }
153716
public function addState(\Haven\PersonaBundle\Entity\State $states)
    {
        $this->states[] = $states;

        return $this;
    }
854428
public function setUnsetStatesOnly(array $stateValues)
    {
        foreach ($stateValues as $key => $value) {
            if (null === $this->getState($key, null)) {
                $this->setState($key, $value);
            }
        }
    }
253006
public final function setIds(array $ids): void
    {
        foreach ($ids as $id) {
            $this->ids[] = (int) $id;
        }
    }
1259704
public function changeState($state)
    {
        $availableStates = $this->dbObject('Status')->enumValues();
        if (in_array($state, $availableStates)) {
            $this->Status = $state;
            return true;
        } else {
            user_error(_t('Reservation.STATE_CHANGE_ERROR', 'Selected state is not available'));
            return false;
        }
    }
1050539
public function setMessage($ids, $message)
    {
        $conn = $this->getConnection();
        $conn->update(
            $this->getMainTable(),
            [
                'message' => $message,
                'send_status' => \Dotdigitalgroup\Email\Model\Campaign::FAILED,
                'sent_at' =>  $this->datetime->gmtDate()
            ],
            ["id in (?)" => $ids]
        );
    }
474608
private function getObjectStatesIds(array $states): array
    {
        $statesIds = array_column($states, 'id');

        return array_combine($statesIds, array_fill_keys($statesIds, false));
    }
217962
public function setState($int)
    {
        if (Daemon::$compatMode) {
            return true;
        }
        if (!$this->id) {
            return false;
        }

        if (Daemon::$config->logworkersetstate->value) {
            $this->log('state is ' . Daemon::$wstateRev[$int]);
        }

        $this->state = $int;

        if ($this->reload) {
            $int += 100;
        }
        Daemon::$shm_wstate->write(chr($int), $this->id - 1);
        return true;
    }
1320653
public void setState(S state){
		Integer id = definition.getStateId(state);
		currentStateId.set(id);
	}
346719
protected function setBinaryState($state)
    {
        $service = $this->services['BridgeService']['serviceType'];
        $controlUrl = $this->services['BridgeService']['controlURL'];
        $method = 'SetBinaryState';
        $arguments = [
            'BinaryState' => $state
        ];

        $rs = $this->client->request($controlUrl, $service, $method, $arguments);
        if(!empty($rs)) {
            $rs = $this->unwrapResponse($rs);

            if (isset($rs['s:Fault'])) {
                throw new \Exception('Failed to change switch state. ' . print_r($rs, true));
            }

            return $rs;
        } else {
            $this->saveState($state);

            return true;
        }
    }
1265153
public function setState($state)
    {
        $this->complement['state'] = $state;
        $this->states['state'] = $state;
        $this->setStates();

        return $state;
    }