<?php


namespace App\Tables;

/**
 * Utility for allocating & assigning temporary row IDs
 * for rows in a changeset
 */
class DraftRowNumerator extends BaseNumerator
{
    /**
     * Create a numerator for the given number of rows.
     *
     * @param int $capacity - how many
     */
    public function __construct(Changeset $changeset, $capacity)
    {
        parent::__construct([$changeset->nextRowID - $capacity + 1, $changeset->nextRowID]);
        $changeset->nextRowID -= $capacity;
    }
}