protected static function validate($data, $full)
    {
        $columns = array_keys($data);

        /*
         * Check missing columns
         */
        if ($full) {
            $missing = array_diff(static::getRequiredColumns(), $columns);
            if (!empty($missing)) {
                throw new MissingColumnException(static::class, $missing);
            }
        }

        static::checkUnknownColumn($columns);

        /*
         * Expanded validation
         */
        $result = static::onValidate($data);
        if ($result === false) {
            $message = static::class . ' has invalid data';
            throw new \UnexpectedValueException($message);
        } elseif (is_array($result)) {
            $data = (empty(Utils::arrayUniqueDiffKey($data, $result)))
                ? $result
                : array_replace($data, $result);
        }

        return $data;
    }