protected function add_message($level, $msgcode, $a = null) {
        $msg = (object)array(
            'level'     => $level,
            'msgcode'   => $msgcode,
            'addinfo'   => $a,
        );
        $this->messages[] = $msg;
    }
protected function add_message($level, $msgcode, $a = null) {
        $msg = (object)array(
            'level'     => $level,
            'msgcode'   => $msgcode,
            'addinfo'   => $a,
        );
        $this->messages[] = $msg;
    }
protected function add_message ( $ level , $ msgcode , $ a = null ) { $ msg = ( object ) array ( 'level' => $ level , 'msgcode' => $ msgcode , 'addinfo' => $ a , ) ; $ this -> messages [ ] = $ msg ; }
Append the given message to the messages log

@param string $level e.g. self::ERROR
@param string $msgcode may form a string
@param string|array|object $a optional additional info suitable for {@link get_string()}
Append the given message to the messages log