ModelException

Used when validation fails. Contains the invalid model for easy analysis.

 class Winter\Storm\Database\ModelException
extends Winter\Storm\Exception\ValidationException

Properties

protected $model : Model

The invalid model.

protected $errors : Illuminate\Support\MessageBag

Inherited from ValidationException

The message bag instance containing validation error messages

protected $fields : array

Inherited from ValidationException

Collection of invalid fields.

Methods

public __construct (Winter\Storm\Database\Model $model)

Receives the invalid model and sets the {@link model} and {@link errors} properties.

Parameters
Property Description
$model
Winter\Storm\Database\Model

The troublesome model.

Returns
mixed

public getModel () : Model

Returns the model with invalid attributes.

Returns
Model

public getErrors () : Illuminate\Support\MessageBag

Inherited from ValidationException

Returns directly the message bag instance with the model's errors.

Returns
Illuminate\Support\MessageBag

public getFields ()

Inherited from ValidationException

Returns invalid fields.

Returns
mixed

protected evalErrors ()

Inherited from ValidationException

Evaluate errors.

Returns
mixed
Copyright © 2024 Winter CMS