datatable.directory codebase https://datatable.directory/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
datatable.directory/app/Tables/DraftRowNumerator.php

22 lines
504 B

<?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;
}
}