private static function validateAttributes($model, $name, &$attributes)
    {
        // Should be an array.
        if (!is_array($attributes)) {
            $attributes = [$attributes];
        }

        // Is empty, use the name of the table + name.
        if (empty($attributes)) {
            $attributes = [sprintf('%s.%s', $model->getTable(), $name)];
        }

        // Check each of the attribute values.
        // Convert any prepended with a curly to an expression.
        foreach ($attributes as &$value) {
            if (substr($value, 0, 1) === '#' || substr($value, 0, 1) === '{') {
                $value = new Expression(substr($value, 1));
            }
        }
    }