<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;

class FacDematAdrelec extends QueryBuilder
{
    protected string $table = 'FAC_DEMAT_ADRELEC with (nolock)';
    protected string $primaryKey = 'ID';

    protected function setAutoincrementExpr(array &$entity): void
    {
        if (! empty($entity['ID'])) {
            return;
        }
        $entity['ID'] = [
            'expr' => "SELECT COALESCE( MAX(ID) + 1, 1) FROM FAC_DEMAT_ADRELEC",
            'param' => [],
        ];
    }
}
