Last active
September 15, 2021 23:34
-
-
Save bernard-ng/1c7faf78b74e3faa52382d93abe6a1f3 to your computer and use it in GitHub Desktop.
Revisions
-
bernard-ng revised this gist
Sep 15, 2021 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,14 +12,10 @@ /** * Class DisallowCountryFixtures * @package App\DataFixtures * @author bernard-ng <[email protected]> */ class DisallowCountryFixtures extends Fixture { public function load(ObjectManager $manager): void { $countries = Countries::getNames(); -
bernard-ng created this gist
Feb 28, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ <?php declare(strict_types=1); namespace App\DataFixtures; use App\Domain\Application\Entity\DisallowCountry; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Persistence\ObjectManager; use Symfony\Component\Intl\Countries; /** * Class DisallowCountryFixtures * @package App\DataFixtures * @author bernard-ng <[email protected]> */ class DisallowCountryFixtures extends Fixture { /** * @param ObjectManager $manager * @author bernard-ng <[email protected]> */ public function load(ObjectManager $manager): void { $countries = Countries::getNames(); foreach ($countries as $iso => $name) { $data = (new DisallowCountry()) ->setName($name) ->setIso2($iso) ->setHasAccess(true); $manager->persist($data); } $manager->flush(); } }