Fork me on GitHub

Migration Guide for 3.0

BC breaks#

The following BC breaks are quite important and you will probably have to deal with them in your code:

  • PHP 7.0: this means you have to add newly added typhints to classes that implemnts interfaces from Orm; practically, only typehints in your repositories and mappers will have to be updated;
  • Collection: removed comparison operator !, use equivalent != operator, e.g. replace findBy(['name!' => 'Jon']) with findBy(['name!=' => 'Jon']);
  • Entity: all datetime properties (types) have to be replaced with \DateTimeImmutable type;
  • Entity: IEntity::toArray() method was moved from interface to Entity, also the related constants were moved to a helper class; commit;
  • Entity: IEntity::setAsModified() method does not return the entity; commit;
  • Entity: IEntity::hasValue() throws an exception when property does not exist; commit;
  • Entity: all event methods are included in the interface definition, therefore if you override them, you will have to changed their visibility modifier to public; commit;
  • Entity relationships: removed duplicit relationship names in property modifiers, supported are only these with letter m, e.g. 1:m, m:1, m:m as abbreviation of Many word; commit;
  • Mapper: proxy calls from repository have to return already ICollection or IEntity|null. To achieve this, use DbalMapper::toCollection() or DbalMapper::toEntity() methods; commit;

The following BC breaks are quite internal, in other words, you probably will not have to do anything because of them:

  • Model: refactored internals to use Repository loader. “commit”:…beff6c393403;
  • Entity: removed serilization support, the support was not tested and well covered. Generally speaking, tray to serialize entities' id and refetch it every time you need it;
  • Entity: method getRepository throws an exception, when entity is not attached to repository; check the state by IEntity::isAttached() method;
  • Entity: virtual properties are never implicitly stored, removed IEntity::SKIP_SET_VALUE; “commit”:…9c221f0f78c7;
  • Entity relationships: refactored iterators and collections internals; commit, commit, commit;
  • Entity|Repository: event handling was refactored to own methods, removed fireEvent() methods and replaced with custom methods for each event.
  • Repository|Mapper|Model: interface changes