Thruway\Exception\WampErrorException::__construct PHP Метод

__construct() публичный Метод

public __construct ( string $errorUri, array | null $arguments = null, stdClass | null $argumentsKw = null, stdClass | null $details = null )
$errorUri string
$arguments array | null
$argumentsKw stdClass | null
$details stdClass | null
    public function __construct($errorUri, $arguments = null, $argumentsKw = null, $details = null)
    {
        $this->setErrorUri($errorUri);
        $this->setArguments($arguments);
        $this->setArgumentsKw($argumentsKw);
        $this->setDetails($details);
        $exceptionMessage = $errorUri;
        if (is_array($arguments) && isset($arguments[0]) && is_string($arguments[0])) {
            $exceptionMessage = $arguments[0];
        }
        parent::__construct($exceptionMessage);
    }

Usage Example

Пример #1
0
 function __construct(\yii\base\Model $model)
 {
     parent::__construct('model.validation.error', null, $model->getErrors());
 }