protected function _notice($text, $flags, $name, $class)
{
if ($flags === true) {
$flags = Notice::log;
}
$notice = new $class($text, $flags);
$notice->class = $this->className();
if (is_null($this->_notices[$name])) {
$this->_notices[$name] = new Notices();
}
$this->wire('notices')->add($notice);
if (!($notice->flags & Notice::logOnly)) {
$this->_notices[$name]->add($notice);
}
return $this;
}