- /**
- * Returns a list of status messages of the given type, with message and
- * params left untouched, like a sane version of getStatusArray
- *
- * Each entry is a map of:
- * - message: string message key or MessageSpecifier
- * - params: array list of parameters
- *
- * @param string $type
- * @return array
- */
- public function getErrorsByType( $type ) {
- return $this->sv->getErrorsByType( $type );
- }
-
- /**
- * Returns true if the specified message is present as a warning or error
- *
- * @param string|Message $message Message key or object to search for
- *
- * @return bool
- */
- public function hasMessage( $message ) {
- return $this->sv->hasMessage( $message );
- }
-
- /**
- * If the specified source message exists, replace it with the specified
- * destination message, but keep the same parameters as in the original error.
- *
- * Note, due to the lack of tools for comparing Message objects, this
- * function will not work when using a Message object as the search parameter.
- *
- * @param Message|string $source Message key or object to search for
- * @param Message|string $dest Replacement message key or object
- * @return bool Return true if the replacement was done, false otherwise.
- */
- public function replaceMessage( $source, $dest ) {
- return $this->sv->replaceMessage( $source, $dest );
- }
-
- /**
- * @return mixed
- */
- public function getValue() {
- return $this->sv->getValue();
- }
-
- /**
- * Backwards compatibility logic
- *
- * @param string $name
- */
- function __get( $name ) {
- if ( $name === 'ok' ) {
- return $this->sv->isOK();
- } elseif ( $name === 'errors' ) {
- return $this->sv->getErrors();
- }
- throw new Exception( "Cannot get '$name' property." );
- }
-
- /**
- * Backwards compatibility logic
- *
- * @param string $name
- * @param mixed $value
- */
- function __set( $name, $value ) {
- if ( $name === 'ok' ) {
- $this->sv->setOK( $value );
- } elseif ( !property_exists( $this, $name ) ) {
- // Caller is using undeclared ad-hoc properties
- $this->$name = $value;
- } else {
- throw new Exception( "Cannot set '$name' property." );
- }
- }
-
- /**
- * @return string
- */
- public function __toString() {
- return $this->sv->__toString();
- }
-