Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cannot extends Entities #100

Open
benbd5 opened this issue Jul 31, 2024 · 1 comment
Open

[Bug] Cannot extends Entities #100

benbd5 opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@benbd5
Copy link

benbd5 commented Jul 31, 2024

Describe the bug
I want to extends the Command Entity (synolia_commands table) but I can't. Doctrine want to create another table indeed.

To Reproduce
Steps to reproduce the behavior:

  1. Create the Entity
<?php

declare(strict_types=1);

namespace App\Scheduler\Entity;

use Doctrine\ORM\Mapping as ORM;
use Synolia\SyliusSchedulerCommandPlugin\Entity\Command as BaseCommand;

/**
 * @ORM\Entity
 */
#[ORM\Entity]
class Command extends BaseCommand
{
}
  1. Add this Entity in config (_sylius.yaml)
synolia_sylius_scheduler_command:
    resources:
        synolia.command:
            driver: doctrine/orm
            classes:
                model: App\Scheduler\Entity\Command
  1. Add this Entity in config (doctrine.yaml)
App\Scheduler:
    is_bundle: false
    type: annotation
    dir: '%kernel.project_dir%/src/Scheduler/Entity'
    prefix: 'App\Scheduler\Entity'
    alias: App\Scheduler
  1. See error
    Launch bin/console d:s:v -vv
    It returns:
CREATE TABLE Command (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, command VARCHAR(255) NOT NULL, arguments VARCHAR(255) DEFAULT NULL, cronExpression VARCHAR(255) NOT NULL, logFilePrefix VARCHAR(255) DEFAULT NULL, priority INT NOT NULL, executeImmediately TINYINT(1) NOT NULL, enabled TINYINT(1) NOT NULL, timeout INT DEFAULT NULL, idleTimeout INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;

Expected behavior
Is it possible to change Entity to MappedSuperclass?

@benbd5 benbd5 added the bug Something isn't working label Jul 31, 2024
@benbd5 benbd5 changed the title [Bug] [Bug] Cannot extends Entities Jul 31, 2024
@oallain
Copy link
Member

oallain commented Aug 2, 2024

Hello,

Do you want to propose a Pull Request ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants