neos / flow-development-collection

The unified repository containing the Flow core packages, used for Flow development.
https://flow.neos.io/
MIT License
137 stars 188 forks source link

Not possible to name an entity model class "Package" #2610

Open runner78 opened 3 years ago

runner78 commented 3 years ago

Description

I am currently upgrade a flow 4.3 application to version 7.2, but i got an error message on cache warmup:

No identifier/primary key specified for Entity "Inwento\InwentoID\Domain\Model\Package\Package".
Every Entity must have an identifier/primary key.

  Type: Doctrine\ORM\Mapping\MappingException
  File:
Packages/Libraries/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.p
        hp
  Line: 48

if i call the command "./flow flow:doctrine:compileproxies" manually, or rename the class, it works. It looks like Flow 7.2 does not like it if you have a entity class "Package". Or is that intended? With 4.3 I have no problems.

Affected Versions

Neos:

Flow: 7.2

sorenmalling commented 3 years ago

@runner78 How does your model look?

runner78 commented 3 years ago

Basically so. I deleted the properties and getter / setter, the original class has about 1000 lines.

<?php
declare(strict_types=1);

namespace Inwento\InwentoID\Domain\Model\Package;

use DateTime;
use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Neos\Flow\Annotations as Flow;

/**
 * @Flow\Entity
 * @ORM\Table(name="inwento_inwentoid_domain_model_package")
 * @package Inwento\InwentoID\Domain\Model\Package
 */
#[Flow\Entity]
#[ORM\Table("inwento_inwentoid_domain_model_package")]
class Package
{
    /** elements **/
}