You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to implement Loggable and Translatable for my Recipe Entity.
<?php
namespace App\Entity;
use App\Repository\RecipeRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Loggable\Loggable;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: RecipeRepository::class)]
#[Gedmo\Loggable]
class Recipe
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\OneToOne(inversedBy: 'recipe', cascade: ['persist', 'remove'])]
private ?Product $product = null;
#[Gedmo\Loggable]
#[ORM\Column(length: 255, nullable: false)]
private ?string $title = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $timeToCook = null;
public function getId(): ?int
{
return $this->id;
}
}
When I run php bin/console doctrine:mapping:info I get this error:
assert($metadata instanceof DocumentClassMetadata || $metadata instanceof EntityClassMetadata).
This is the stack trace:
[debug] Notified event "console.command" to listener "Symfony\Bundle\FrameworkBundle\EventListener\ConsoleProfilerListener::initialize".
[debug] Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
Found 16 mapped entities:
[critical] Error thrown while running command "doctrine:mapping:info -vvv". Message: "assert($metadata instanceof DocumentClassMetadata || $metadata instanceof EntityClassMetadata)"
[debug] Notified event "console.error" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SuggestMissingPackageSubscriber::onConsoleError".
[debug] Notified event "console.error" to listener "Symfony\Bundle\MakerBundle\Event\ConsoleErrorSubscriber::onConsoleError".
[debug] Notified event "console.error" to listener "Symfony\Component\Console\EventListener\ErrorListener::onConsoleError".
[debug] Notified event "console.error" to listener "Symfony\Bundle\FrameworkBundle\EventListener\ConsoleProfilerListener::catch".
[debug] Command "doctrine:mapping:info -vvv" exited with code "1"
[debug] Notified event "console.terminate" to listener "Symfony\Bundle\MakerBundle\Event\ConsoleErrorSubscriber::onConsoleTerminate".
[debug] Notified event "console.terminate" to listener "Symfony\Component\Console\EventListener\ErrorListener::onConsoleTerminate".
[debug] Notified event "console.terminate" to listener "Symfony\Bundle\FrameworkBundle\EventListener\ConsoleProfilerListener::profile".
[critical] Uncaught Error: assert($metadata instanceof DocumentClassMetadata || $metadata instanceof EntityClassMetadata)
Thank you for any help.
The text was updated successfully, but these errors were encountered:
This particular issue can be closed out. I just checked all of the assert() calls and they are looking for the right ClassMetadata objects for each version of the ORM in the latest release.
There's still work to do for ORM 3.x compat, but this isn't one of the things needing attention it appears.
I am running Symfony 7. These are my settings files.
doctrine.yaml
services.yaml:
composer.json
I want to implement Loggable and Translatable for my Recipe Entity.
When I run php bin/console doctrine:mapping:info I get this error:
assert($metadata instanceof DocumentClassMetadata || $metadata instanceof EntityClassMetadata).
This is the stack trace:
Thank you for any help.
The text was updated successfully, but these errors were encountered: