Generates number
This commit is contained in:
parent
defbae832b
commit
21edcdf919
1 changed files with 16 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ trait GeneratesNumberCounter
|
|||
{
|
||||
|
||||
$counter = $this->getCounter($entity);
|
||||
$prefix = $this->getNumberPrefix($entityType);
|
||||
|
||||
$check = false;
|
||||
|
||||
do {
|
||||
|
|
@ -87,6 +89,20 @@ trait GeneratesNumberCounter
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNumberPrefix($entity)
|
||||
{
|
||||
|
||||
$field = $this->entityName($entity) . "_number_prefix";
|
||||
|
||||
return $this->getSettingsByKey( $field )->{$field};
|
||||
}
|
||||
|
||||
|
||||
private function incrementCounter($entity)
|
||||
{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue