ActiveRecord\Errors::add_on_empty PHP Method

add_on_empty() public method

Adds an error message only if the attribute value is {@link http://www.php.net/empty empty}.
public add_on_empty ( string $attribute, string $msg )
$attribute string Name of an attribute on the model
$msg string The error message
    public function add_on_empty($attribute, $msg)
    {
        if (empty($msg)) {
            $msg = self::$DEFAULT_ERROR_MESSAGES['empty'];
        }
        if (empty($this->model->{$attribute})) {
            $this->add($attribute, $msg);
        }
    }