-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from gerMdz/agregando_types_block
Agregando una opción más para imágenes half size
- Loading branch information
Showing
3 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace App\DataFixtures; | ||
|
||
use App\Entity\TypeBlock; | ||
use Doctrine\Bundle\FixturesBundle\Fixture; | ||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface; | ||
use Doctrine\Persistence\ObjectManager; | ||
|
||
class TypeBlockFixture extends Fixture implements FixtureGroupInterface | ||
{ | ||
|
||
public const TYPE_BLOCK = [ | ||
['page', 'Página visible, landing', 'page', true], | ||
['seccion', 'Partes de una page, secciones', 'seccion', true], | ||
['entrada', 'Parte de una sección, normalmente donde se escribe', 'entrada', true], | ||
]; | ||
|
||
public function load(ObjectManager $manager): void | ||
{ | ||
foreach (self::TYPE_BLOCK as $typeBlock) { | ||
$tB = new TypeBlock(); | ||
$tB->setName($typeBlock[0]) | ||
->setIdentifier($typeBlock[2]) | ||
->setDescription($typeBlock[1]) | ||
->setIsActive($typeBlock[3]); | ||
$manager->persist($tB); | ||
} | ||
$manager->flush(); | ||
} | ||
|
||
public static function getGroups(): array | ||
{ | ||
return ['groupTypeBlock']; | ||
} | ||
} |
This file contains 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 characters