private static function populateIds(&$insertModels, $pks, $lastPk, $insertedCount)
    {
        while($insertedCount > 0 && $insertedCount <= count($insertModels))
        {
            $insertedCount--;
            $model = $insertModels[$insertedCount];
            $model->{$pks[0]} = $lastPk;
            $lastPk = intval($lastPk) - 1;
        }
    }