-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STI dump seems incorrect #11
Comments
Note, I think a potential fix for this is to change that check in ORMDumper to simply: if ($class->getReflectionClass()->isAbstract() || $class->isMappedSuperclass) { The issue was The |
When i change the check to |
The classes look a little like: class Foo {
private function __construct($a, $b, $c /* ... */) {
/* ... */
}
public static function createBlah(/* ... */) {
return new self(/* .. */);
}
} The point is this class is not directly instantiable (private constructor), it is not abstract - but we still need to include it in the dumped fixtures. |
But in order to create a fixture from this class, the library needs to know how to initialize it and currently I see no way how this might be possible. |
We have two separate STI relationships:
abstract class Sanction
, with various children, one of which isclass Roadworthiness extends Sanction
and
abstract class ChecksiteLocation
, with two childrenTemporary
andPermanent
The data looks correct in the DB, but when dumping the fixtures I encounter an odd issue with each of them:
Sanction
entity is written directly, and theRoadworthiness
entity is not generated at all in the fixturesTemporary
andPermanent
entities are written fine, but an additionalChecksiteLocation
entity (with duplicated data that already exists in one ofTemporary
or `Permanent) is generatedI have a feeling these issues are related, but I can't quite put my finger on it. It seems to me that:
Roadworthiness
entity is not actually being written properly (not sure why)ChecksiteLocation
entity is making it past the check inORMDumper
on Line 25if (!$class->getReflectionClass()->isInstantiable() || $class->isMappedSuperclass) {
Do you have any ideas what might be causing this strange behaviour?
Thanks!
The text was updated successfully, but these errors were encountered: