Coder Social home page Coder Social logo

entity-tracker-component's People

Contributors

haroldiedema avatar janlam7 avatar linaori avatar nicoschoenmaker avatar nutama avatar stefanlenselink avatar yannickl88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

entity-tracker-component's Issues

Error with entity that has a primary and foreign key on the same field.

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.

entityChanged event does not fire for new items in collection

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"}.

Add support to detect a tracked annotation on property level

It's desired to use property level annotations. This brings in multiple advantages:

  • You can wish to track only changes in certain properties
  • You don't need an @Tracked at class level when at least 1 property has it

If the properties extend the @Tracked, it will remove the need of the annotation on class level and thus make configuring easier.

Detecting false changes if a database value is null but default value isn't

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.