ActiveRecord\Errors::add PHP Method

add() public method

Add an error message.
public add ( string $attribute, string $msg )
$attribute string Name of an attribute on the model
$msg string The error message
    public function add($attribute, $msg)
    {
        if (is_null($msg)) {
            $msg = self::$DEFAULT_ERROR_MESSAGES['invalid'];
        }
        if (!isset($this->errors[$attribute])) {
            $this->errors[$attribute] = array($msg);
        } else {
            $this->errors[$attribute][] = $msg;
        }
    }