Use temporary negative IDs for rows created in a draft Changeset
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
|
||||
namespace App\Tables;
|
||||
|
||||
|
||||
/**
|
||||
* Sequential ID assigner
|
||||
*/
|
||||
abstract class BaseNumerator
|
||||
{
|
||||
/** @var int */
|
||||
@@ -39,10 +41,18 @@ abstract class BaseNumerator
|
||||
throw new \OutOfBoundsException("Column numerator has run out of allocated GCID slots");
|
||||
|
||||
$key = $this->getKey($this->next);
|
||||
$this->next++;
|
||||
$this->advance();
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Advance to the next ID
|
||||
*/
|
||||
protected function advance()
|
||||
{
|
||||
$this->next++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert numeric index to a key
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user