Skip to content

Commit

Permalink
fix: Issue with double EtlExecution entity being created
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverde8 committed Oct 21, 2024
1 parent c3c7411 commit f629f36
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Controller/EtlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Oliverde8\PhpEtlBundle\Entity\EtlExecution as BaseEtlExecution;
use Oliverde8\PhpEtlBundle\Message\EtlExecutionMessage;
use Oliverde8\PhpEtlBundle\Services\ChainProcessorsManager;
use Oliverde8\PhpEtlSyliusAdminBundle\Entity\Etl\EtlExecution;
use Oliverde8\PhpEtlBundle\Entity\EtlExecution;
use Oliverde8\PhpEtlSyliusAdminBundle\Exception\EtlExecutionException;
use Oliverde8\PhpEtlSyliusAdminBundle\Form\Type\Etl\EtlExecutionType;
use Symfony\Component\HttpFoundation\HeaderUtils;
Expand Down
16 changes: 3 additions & 13 deletions Entity/Etl/EtlExecution.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,14 @@
use \Oliverde8\PhpEtlBundle\Entity\EtlExecution as BaseEtlExecution;
use Oliverde8\PhpEtlSyliusAdminBundle\Repository\Etl\EtlExecutionRepository;
use Sylius\Component\Resource\Model\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass:EtlExecutionRepository::class)]
/**
* This class should nevery be used, it's only necessery to create a sylius resource.
*/
class EtlExecution extends BaseEtlExecution implements ResourceInterface
{
public function __construct()
{
parent::__construct('', '', [], []);
}

public function setName(?string $name): BaseEtlExecution
{
return BaseEtlExecution::setName($name ?? "");
}


public function setDefinition(?string $definition): BaseEtlExecution
{
return BaseEtlExecution::setDefinition($definition ?? "");
}
}
2 changes: 1 addition & 1 deletion Form/Type/Etl/EtlExecutionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Oliverde8\PhpEtlSyliusAdminBundle\Form\Type\Etl;

use Oliverde8\PhpEtlBundle\Services\ChainProcessorsManager;
use Oliverde8\PhpEtlSyliusAdminBundle\Entity\Etl\EtlExecution;
use Oliverde8\PhpEtlBundle\Entity\EtlExecution;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
Expand Down
1 change: 1 addition & 0 deletions Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
_defaults:
autowire: true
autoconfigure: true
public: true

Oliverde8\PhpEtlSyliusAdminBundle\:
resource: '../../'
Expand Down
4 changes: 2 additions & 2 deletions Resources/config/sylius_grid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ sylius_grid:
driver:
name: doctrine/orm
options:
class: Oliverde8\PhpEtlSyliusAdminBundle\Entity\Etl\EtlExecution
class: Oliverde8\PhpEtlBundle\Entity\EtlExecution
repository:
method: createAdminGridQueryBuilder
method: [ expr:service('Oliverde8\\PhpEtlSyliusAdminBundle\\Repository\\Etl\\EtlExecutionRepository'), createAdminGridQueryBuilder ]
fields:
id:
type: string
Expand Down
1 change: 1 addition & 0 deletions Resources/config/sylius_resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ sylius_resource:
classes:
model: Oliverde8\PhpEtlSyliusAdminBundle\Entity\Etl\EtlExecution
form: Oliverde8\PhpEtlSyliusAdminBundle\Form\Type\Etl\EtlExecutionType
repository: Oliverde8\PhpEtlSyliusAdminBundle\Repository\Etl\EtlExecutionRepository
2 changes: 1 addition & 1 deletion Twig/Components/NewEtlComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Oliverde8\PhpEtlSyliusAdminBundle\Twig\Components;

use Oliverde8\PhpEtlBundle\Services\ChainProcessorsManager;
use Oliverde8\PhpEtlSyliusAdminBundle\Entity\Etl\EtlExecution;
use Oliverde8\PhpEtlBundle\Entity\EtlExecution;
use Oliverde8\PhpEtlSyliusAdminBundle\Form\Type\Etl\EtlExecutionType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface;
Expand Down

0 comments on commit f629f36

Please sign in to comment.