No duplicates 🥲.
What happened?
Hi,
In a scenario where some sort of BaseEntity is used to contain Columns appearing across multiple Entitys, those columns are not registered into the Entitys extending this base class.
abstract class EmployedPerson
{
#[Column(type: 'integer')]
protected int $id;
}
#[Entity]
class Developer extends EmployedPerson {
#[Column(type: 'integer')]
protected int $salary;
}
In the example above, the id column is not added to the Developer entity.
This is probably caused by Configurator:115:
$field->setEntityClass($property->getDeclaringClass()->getName());
where the field is set to entity by a declaring class, but this class is not an entity.
This should work also in combination with JTI, where a following hierarchy could be used:
#[Entity]
class Person {
#[Column(type: 'primary')]
protected int $id;
}
abstract class EmployedPerson extends Person
{
#[Column(type: 'integer')]
protected int $salary;
}
#[Entity]
#[JoinedTable]
class Developer extends EmployedPerson {
#[Column(type: 'integer')]
protected int $foo;
}
In the example above, the Developer table should contain columns id, salary and foo, but currently the salary is ignored.
Version
- OS: PopOS
- PHP version: 8.3.7
- Package version:
- annotated: 4.1
- database: 2.11
- orm: 2.8
- schema-builder: 2.8
ORM Schema
No response
No duplicates 🥲.
What happened?
Hi,
In a scenario where some sort of
BaseEntityis used to containColumns appearing across multipleEntitys, those columns are not registered into theEntitys extending this base class.In the example above, the
idcolumn is not added to theDeveloperentity.This is probably caused by
Configurator:115:where the field is set to entity by a declaring class, but this class is not an entity.
This should work also in combination with JTI, where a following hierarchy could be used:
In the example above, the Developer table should contain columns
id,salaryandfoo, but currently thesalaryis ignored.Version
ORM Schema
No response