public function checksGroups(array $config)
    {
        $this->writeln('<info>Updating groups and their rights.</info>', OutputInterface::VERBOSITY_VERBOSE);

        foreach ($config as $identifier => $rights) {
            $group = $this->em->getRepository(Group::class)->findOneBy(['_name' => $identifier]);
            if (null === $group) {
                $group = new Group();
                $group->setName($identifier)
                    ->setDescription(Collection::get($rights, 'description', $identifier));
                $this->em->persist($group);
                $this->em->flush($group);
            }

            $this->writeln(sprintf(' - Group `%s`', $identifier), OutputInterface::VERBOSITY_VERY_VERBOSE);
            $this->updateRights($group, $rights);
        }

        return $this;
    }
public function checksGroups(array $config)
    {
        $this->writeln('<info>Updating groups and their rights.</info>', OutputInterface::VERBOSITY_VERBOSE);

        foreach ($config as $identifier => $rights) {
            $group = $this->em->getRepository(Group::class)->findOneBy(['_name' => $identifier]);
            if (null === $group) {
                $group = new Group();
                $group->setName($identifier)
                    ->setDescription(Collection::get($rights, 'description', $identifier));
                $this->em->persist($group);
                $this->em->flush($group);
            }

            $this->writeln(sprintf(' - Group `%s`', $identifier), OutputInterface::VERBOSITY_VERY_VERBOSE);
            $this->updateRights($group, $rights);
        }

        return $this;
    }
public function checksGroups ( array $ config ) { $ this -> writeln ( '<info>Updating groups and their rights.</info>' , OutputInterface :: VERBOSITY_VERBOSE ) ; foreach ( $ config as $ identifier => $ rights ) { $ group = $ this -> em -> getRepository ( Group :: class ) -> findOneBy ( [ '_name' => $ identifier ] ) ; if ( null === $ group ) { $ group = new Group ( ) ; $ group -> setName ( $ identifier ) -> setDescription ( Collection :: get ( $ rights , 'description' , $ identifier ) ) ; $ this -> em -> persist ( $ group ) ; $ this -> em -> flush ( $ group ) ; } $ this -> writeln ( sprintf ( ' - Group `%s`' , $ identifier ) , OutputInterface :: VERBOSITY_VERY_VERBOSE ) ; $ this -> updateRights ( $ group , $ rights ) ; } return $ this ; }
Checks for groups, creates them if they don't exist.

@param  array $config

@return UpdateUsersRightsCommand
Checks for groups creates them if they don t exist .