Add an alert.

@param string $alert  The alert string.
@param string $type   The alert type.
183682
public function add($alert, $type = null)
    {
        $this->_alert = new stdClass;
        $this->_alert->alert = $alert;
        if (!is_null($type)) {
            $this->_alert->type = $type;
        }

        $this->notify();
    }
1264487
public function alert($title = '', $text = '', $type = null)
    {
        $this->config['title'] = $title;

        $this->config['text'] = $text;

        if (!is_null($type)) {
            $this->config['type'] = $type;
        }

        $this->flash();

        return $this;
    }
887599
public synchronized <T extends EventListener> void add(Class<T> type, T listener) {
		assert listener != null;
		if (this.listeners == NULL) {
			// if this is the first listener added,
			// initialize the lists
			this.listeners = new Object[] {type, listener};
		} else {
			// Otherwise copy the array and add the new listener
			final int i = this.listeners.length;
			final Object[] tmp = new Object[i + 2];
			System.arraycopy(this.listeners, 0, tmp, 0, i);

			tmp[i] = type;
			tmp[i + 1] = listener;

			this.listeners = tmp;
		}
	}
285748
public function add($message, $type)
    {
        $this->messages[$type][] = $message;

        $this->getSessionBag()->set($type, $this->messages[$type]);
    }
432547
public function addColumn( $table, $column, $type) {
		$column = $this->check($column);
		$table = $this->check($table);
		$type=$this->typeno_sqltype[$type];
		$sql = "ALTER TABLE `$table` ADD `$column` $type ";
		$this->adapter->exec( $sql );
	}
322784
public function addMessage($message, $type = 'success')
    {
        Events::dispatch('onMessageDisplay', array('message' => $message, 'type' => $type));
        $this->messages[] = array('message' => $message, 'type' => $type);
    }
54165
public function addIndex($type, $index)
    {
        if (!isset($this->indexes[$type])) {
            $this->indexes[$type] = [];
        }

        $this->indexes[$type][] = $index;
    }
437817
public function addListener(string $event, $listener)
    {
        if (!isset($this->listeners[$event])) {
            $this->listeners[$event] = [];
        }
        $this->listeners[$event][] = $listener;
    }
762834
public function setFlashAlert(Alert $alert)
    {
        $this->session->getFlashBag()->set(self::FLASH_BAG_KEY, $alert->all());
    }
1312664
function alert(title, content, callback, type) {
  const opt = defaultOption.alert;
  const argLen = arguments.length;
  if (argLen === 1) {
    content = title;
    title = null;
  }
  if (argLen === 2) {
    if (typeof content === 'function') {
      callback = content;
      content = title;
      title = null;
    }
  }
  title = title || opt.title;
  if (opt.actions[0]) {
    opt.actions[0].onPress = callback;
  }
  tip(title, content, opt.actions, type);
}
605075
public function setByType($type)
    {
        if (isset(self::$typeList[$type])) {
            $this->value = self::$typeList[$type];
        } else {
            throw new Exception("undefined index $type");
        }
    }
1354025
public function addFlash( $message, $type = 'error' )
    {
        if ( 'error' === $type )
        {
            $this->flash[ 'errors' ][ ] = $message;
        }
        else
        {
            $this->flash[ 'success' ][ ] = $message;
        }

        //$this[ 'session' ]->add( 'messages', $this->flash );
    }
417948
public function addMessage($type, $content)
	{
		if(isset($_SESSION[$this->sessionKey])) {
			$messages = $_SESSION[$this->sessionKey];
		}
		
		$messages[] = [
			'content' => $content,
			'type' => $type,
		];
		
		$_SESSION[$this->sessionKey] = $messages;
	}
830855
static function notify( $message, $type )
    {
        $nots = State::get( 'notifications' );
        array_push( $nots, array( 'message' => $message, 'type' => $type ) );
        State::set( 'notifications', $nots );
    }
256643
public function add($message = null, $type = 'notice')
    {
        if (!isset($this->messages[$type]) || !is_array($this->messages[$type])) {
            $this->messages[$type] = [];
        }
        if ($message) {
            $this->messages[$type][] = $message;
        }
        $this->writeToSession();
        return $this;
    }
346115
public function onAddedToType(TypeInterface &$type)
    {
        parent::onAddedToType($type);

        if ($this->getAddIndex()) {
            $type->addIndex(new Index($this->name));
        }

        $type->addTrait(CreatedAtInterface::class, CreatedAtInterfaceImplementation::class)->serialize($this->name);
    }
1087243
final public function addEvent($description, $type='notice', $subtext=NULL) {
		
		if (!$this->isEnabled()) return;
		
		$now = $this->getMicrotime();
		
		$event				= new \stdClass();
		$event->description = $description;
		$event->type		= $type;
		$event->subtext		= $subtext;
		$event->chrono		= abs($now - $this->lastChrono);
		
		$this->events[]		= $event;
		
		$this->lastChrono	= $now;
		
	}