hostnet / entity-tracker-component Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
An error occurs when saving an entity that has a primary key and a foreign key on the same field. The joined object is cast to a string and compared against the original value that was fetched from the database, which obviously isn't equal.
A workaround is to implement a __toString()
in the joined object to return the primary key to make sure the comparison works.
When I configure a OneToMany
or ManyToMany
relation with a cascade={"persist"}
, and add an item to that collection, the entityChanged event is not fired. Causing for me that the setRevision()
method is not called.
A workaround is to call $em->persist($new_item_in_collection)
, that does work. But does not match the expected behaviour of cascade={"persist"}
.
I have an entity with a foreign key as a primary key.
This gives me an error in version 1.0.0 as in
Object of class Entity could not be converted to string in EntityMutationMetadataProvider.php line 111
array_diff always converts everything into string
It's desired to use property level annotations. This brings in multiple advantages:
@Tracked
at class level when at least 1 property has itIf the properties extend the @Tracked
, it will remove the need of the annotation on class level and thus make configuring easier.
When an entity has a default value in the class, but the database values is NULL
and hydrated as such, it will detect a change as the custom hydration of the object with the old state doesn't update the value.
The problem lies in usage of isset()
vs array_key_exists()
. isset()
returns false because the original value is NULL
and therefore skips setting the value. This causes the Entity's default property value to be set. When comparing the new and old entity, this causes a false positive on a changed property.
The isset()
in question can be found here: https://github.com/hostnet/entity-tracker-component/blob/master/src/Provider/EntityMutationMetadataProvider.php#L47
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.