SyliusSchedulerCommandPlugin icon indicating copy to clipboard operation
SyliusSchedulerCommandPlugin copied to clipboard

[Bug] Cannot extends Entities

Open benbd5 opened this issue 1 year ago • 1 comments

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 avatar Jul 31 '24 10:07 benbd5

Hello,

Do you want to propose a Pull Request ?

oallain avatar Aug 02 '24 15:08 oallain