diff --git a/config/api_platform/PxeTemplate.yaml b/config/api_platform/PxeTemplate.yaml new file mode 100644 index 0000000..e69de29 diff --git a/src/Controller/OgBoot/AbstractOgLiveController.php b/src/Controller/OgBoot/AbstractOgLiveController.php new file mode 100644 index 0000000..d5e8db5 --- /dev/null +++ b/src/Controller/OgBoot/AbstractOgLiveController.php @@ -0,0 +1,21 @@ +name = $pxeTemplate->getName(); + $this->templateContent = $pxeTemplate->getTemplateContent(); + } + + public function createOrUpdateEntity(?PxeTemplate $pxeTemplate = null): PxeTemplate + { + if (!$pxeTemplate) { + $pxeTemplate = new PxeTemplate(); + } + + $pxeTemplate->setName($this->name); + $pxeTemplate->setTemplateContent($this->templateContent); + + return $pxeTemplate; + } +} \ No newline at end of file diff --git a/src/Dto/Output/PxeTemplateOutput.php b/src/Dto/Output/PxeTemplateOutput.php new file mode 100644 index 0000000..245e007 --- /dev/null +++ b/src/Dto/Output/PxeTemplateOutput.php @@ -0,0 +1,34 @@ +name = $pxeTemplate->getName(); + $this->templateContent = $pxeTemplate->getTemplateContent(); + $this->createdAt = $pxeTemplate->getCreatedAt(); + $this->createdBy = $pxeTemplate->getCreatedBy(); + } +} \ No newline at end of file diff --git a/src/Entity/PxeTemplate.php b/src/Entity/PxeTemplate.php new file mode 100644 index 0000000..ef310ff --- /dev/null +++ b/src/Entity/PxeTemplate.php @@ -0,0 +1,30 @@ +templateContent; + } + + public function setTemplateContent(string $templateContent): static + { + $this->templateContent = $templateContent; + + return $this; + } +} diff --git a/src/Factory/PxeTemplateFactory.php b/src/Factory/PxeTemplateFactory.php new file mode 100644 index 0000000..1ae2601 --- /dev/null +++ b/src/Factory/PxeTemplateFactory.php @@ -0,0 +1,56 @@ + + */ +final class PxeTemplateFactory extends ModelFactory +{ + /** + * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services + * + * @todo inject services if required + */ + public function __construct() + { + parent::__construct(); + } + + /** + * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories + * + * @todo add your default values here + */ + protected function getDefaults(): array + { + return [ + 'createdAt' => self::faker()->dateTime(), + 'name' => self::faker()->text(255), + 'templateContent' => self::faker()->text(255), + 'updatedAt' => self::faker()->dateTime() + ]; + } + + /** + * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization + */ + protected function initialize(): self + { + return $this + // ->afterInstantiate(function(PxeTemplate $pxeTemplate): void {}) + ; + } + + protected static function getClass(): string + { + return PxeTemplate::class; + } +} diff --git a/src/Repository/PxeBootFileRepository.php b/src/Repository/PxeBootFileRepository.php new file mode 100644 index 0000000..f71c3c5 --- /dev/null +++ b/src/Repository/PxeBootFileRepository.php @@ -0,0 +1,43 @@ + + */ +class PxeBootFileRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, PxeBootFile::class); + } + + // /** + // * @return PxeBootFile[] Returns an array of PxeBootFile objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('p') + // ->andWhere('p.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('p.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?PxeBootFile + // { + // return $this->createQueryBuilder('p') + // ->andWhere('p.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/src/Repository/PxeTemplateRepository.php b/src/Repository/PxeTemplateRepository.php new file mode 100644 index 0000000..fb569b8 --- /dev/null +++ b/src/Repository/PxeTemplateRepository.php @@ -0,0 +1,18 @@ + + */ +class PxeTemplateRepository extends AbstractRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, PxeTemplate::class); + } +} diff --git a/src/Service/OgBoot/ConfigService.php b/src/Service/OgBoot/ConfigService.php new file mode 100644 index 0000000..2da2d30 --- /dev/null +++ b/src/Service/OgBoot/ConfigService.php @@ -0,0 +1,8 @@ +