Set flash alert.

@param Alert $alert
762834
public function setFlashAlert(Alert $alert)
    {
        $this->session->getFlashBag()->set(self::FLASH_BAG_KEY, $alert->all());
    }
829818
public static function alert($message, array $context = [], string $channel = self::DEFAULT_CHANNEL): void
    {
        self::log(LogLevel::ALERT, $message, $context, $channel);
    }
579825
public function setEventEmitter($emitter = null)
    {
        if ($emitter === null) {
            $this->eventEmitter = new Emitter();
        } else {
            $this->eventEmitter = $emitter;
        }
    }
566351
function sendClientAlertMessage(ws, alert) {
  var msg = JSON.stringify({
    custom: {
      alert: alert
    }
  });
  ws.write(msg);
}
857997
public function setCoreUploadFlash($value)
    {
        $this->setFieldName('upload_flash');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
179520
protected function renderSingleAlert($alert, $context, $alertText) {
		
		$classes = array('alert in');

		if (!isset($alert['fade'])) {
			$alert['fade'] = $this->fade;
		}

		if ($alert['fade'] === true) {
			$classes[] = 'fade';
		}

		if ($this->isValidContext($context)) {
			$classes[] = 'alert-' . $this->getContextClass($context);
		}

		if (!isset($alert['htmlOptions'])) {
			$alert['htmlOptions'] = array();
		}

		$classes = implode(' ', $classes);
		if (isset($alert['htmlOptions']['class'])) {
			$alert['htmlOptions']['class'] .= ' ' . $classes;
		} else {
			$alert['htmlOptions']['class'] = $classes;
		}

		echo CHtml::openTag('div', $alert['htmlOptions']);

		// Logic is this: if no type-specific `closeText` was defined, let's show `$this->closeText`.
		// Else, show type-specific `closeText`. Treat 'false' differently.
		if (!isset($alert['closeText'])) {
			$alert['closeText'] = (isset($this->closeText) && $this->closeText !== false)
				? $this->closeText
				: false;
		}

		// If `closeText` which is in effect now is `false` then do not show button.
		if ($alert['closeText'] !== false) {
			echo '<a href="#" class="close" data-dismiss="alert">' . $alert['closeText'] . '</a>';
		}

		echo $alertText;
		echo CHtml::closeTag('div');
	}
1042669
public function setAlert($alert): Payload
    {
        if ($alert instanceof Alert || is_string($alert)) {
            $this->alert = $alert;
        }

        return $this;
    }
518323
@Override
    public void setEnabled(boolean enabled) {
        if (this.enabled != enabled) {
            this.enabled = enabled;
            setProperty("enabled", Boolean.toString(enabled));
            if (enabled && getAlertThreshold() == AlertThreshold.OFF) {
                setAlertThreshold(AlertThreshold.DEFAULT);
            }
        }
    }
239208
protected void applyOverrides(Alert alert) {
        if (this.alertOverrides.isEmpty()) {
            // Nothing to do
            return;
        }
        String changedName = this.alertOverrides.getProperty(alert.getPluginId() + ".name");
        if (changedName != null) {
            alert.setName(applyOverride(alert.getName(), changedName));
        }
        String changedDesc = this.alertOverrides.getProperty(alert.getPluginId() + ".description");
        if (changedDesc != null) {
            alert.setDescription(applyOverride(alert.getDescription(), changedDesc));
        }
        String changedSolution = this.alertOverrides.getProperty(alert.getPluginId() + ".solution");
        if (changedSolution != null) {
            alert.setSolution(applyOverride(alert.getSolution(), changedSolution));
        }
        String changedOther = this.alertOverrides.getProperty(alert.getPluginId() + ".otherInfo");
        if (changedOther != null) {
            alert.setOtherInfo(applyOverride(alert.getOtherInfo(), changedOther));
        }
        String changedReference = this.alertOverrides.getProperty(alert.getPluginId() + ".reference");
        if (changedReference != null) {
            alert.setReference(applyOverride(alert.getReference(), changedReference));
        }
    }
181120
private boolean _shouldEvaluateAlert(Alert alert, BigInteger alertId) {
		if (alert == null) {
			_logger.warn(MessageFormat.format("Could not find alert ID {0}", alertId));
			return false;
		}
		if(!alert.isEnabled()) {
			_logger.warn(MessageFormat.format("Alert {0} has been disabled. Will not evaluate.", alert.getId().intValue()));
			return false;
		}

		return true;
	}
941415
public void addAlert(String alertMessage) throws JSONException {
		String previousAlert = getCompatibleProperty("alert", String.class, "A custom alert (\"%s\") was already added to this payload");
		logger.debug("Adding alert [" + alertMessage + "]" + (previousAlert != null ? " replacing previous alert [" + previousAlert + "]" : ""));
		put("alert", alertMessage, this.apsDictionary, false);
	}
1295431
public function setEvents($events)
    {
        $events = (array)$events;
        foreach ($events as $event) {
            $this->addEvent($event);
        }
    }
739053
public function setFlash($type, Subject $subject)
    {
        $subject->set($this->message($type));
        $event = $this->_trigger('setFlash', $subject);
        if ($event->isStopped()) {
            return;
        }

        $this->_controller()->Flash->set($subject->text, [
            'element' => $subject->element,
            'params' => $subject->params,
            'key' => $subject->key
        ]);
    }
85211
public function setEvent($event)
  {
    if ($event === '?' || $event === '') {
      $this->event = null;
    } else {
      $event = Util::foreignLettersToEnglishLetters($event);
      $event = Util::titleCaseIfCurrentlyAllCaps($event);
      $this->event = $event === '?' ? null : $event;
    }
  }
125691
private void setCalculateHighestAlertIfSameAlert(Alert alert) {
        if (highestAlert != null && highestAlert.getAlertId() == alert.getAlertId()) {
            calculateHighestAlert = true;
            highestAlert = null;
        }
    }
231
public function alert($string, $event)
    {
        $this->comment(str_repeat('*', strlen($string) + 12), $event);
        $this->comment('*     ' . $string . '     *', $event);
        $this->comment(str_repeat('*', strlen($string) + 12), $event);
    }
1129662
protected function registerAlerts()
    {
        $this->app->singleton('alerts', function($app) {
            $config = $this->app['config']->get('cartalyst.alerts');

            $alerts = $this->app->make('Cartalyst\Alerts\Alerts');

            $viewNotifier  = new Notifier('view', $config['classes']);
            $flashNotifier = new FlashNotifier('flash', $config['classes'], $this->app['Cartalyst\Alerts\Storage\StorageInterface']);

            $alerts->addNotifier($viewNotifier);
            $alerts->addNotifier($flashNotifier);

            $alerts->setDefaultNotifier($config['default']);

            return $alerts;
        });
    }