MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/help.cafsindia.com/vendor/uvdesk/core-framework/Fixtures/AgentGroups.php
<?php

namespace Webkul\UVDesk\CoreFrameworkBundle\Fixtures;

use Doctrine\Persistence\ObjectManager;
use Webkul\UVDesk\CoreFrameworkBundle\Entity as CoreEntities;
use Doctrine\Bundle\FixturesBundle\Fixture as DoctrineFixture;
use Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportGroup;

class AgentGroups extends DoctrineFixture
{
    private static $seeds = [
        [
            'name' => 'Default',
            'description' => 'Account Owner',
            'isActive' => true,
        ],
    ];

    public function load(ObjectManager $entityManager)
    {
        $availableSupportGroups = $entityManager->getRepository(SupportGroup::class)->findAll();

        if (empty($availableSupportGroups)) {
            foreach (self::$seeds as $supportGroupSeed) {
                $supportGroup = new CoreEntities\SupportGroup();
                $supportGroup->setName($supportGroupSeed['name']);
                $supportGroup->setDescription($supportGroupSeed['description']);
                $supportGroup->setIsActive($supportGroupSeed['isActive']);
    
                $entityManager->persist($supportGroup);
            }
    
            $entityManager->flush();
        }
    }
}