The CoreAlert class collects and returns alerts triggered from the various modules. In addition to the standard alerts there are also sticky alerts which persist in the session until they've been retrieved by the getAlerts() method.
The alerts are displayed in the alert node in CoreController however if that node is excluded or CoreControllerLite is used then the alerts have to be displayed manually.
The alert class is a singleton meaning there can only be one instance of it at a time.
//trigger a standard alert
CoreAlert::alert('This is an alert');
//trigger a sticky alert
CoreAlert::alert('This is a sticky alert', true);
//retrieve the alerts
$arrAlerts = CoreAlert::getAlerts();