Skip to content

[Bug] Cannot extends Entities #100

@benbd5

Description

@benbd5

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions