The following BC breaks are quite important and you will probably have to deal with them in your code:
We have added scalar types to Orm interfaces; your repository and mapper will have to be probably updated;
!
We have removed !
comparison operator that has been a duplicated
of !=
; use equivalent !=
operator;
$collection->findBy(['name!' => 'Jon']);
// replace with
$collection->findBy(['name!=' => 'Jon']);
datetime
property types have to be replaced with
\DateTimeImmutable
type;
We have dropped support for simple DateTime
, in fact, there is
no useful usecase for the mutable type.
During the entity parsing all places will be checked and exception will be thrown if you use the muttable date time.
/**
* @property DateTime $born
*/
class MyEntity extends Nextras\Orm\Entity\Entity {}
// replace with
/**
* @property DateTimeImmutable $born
*/
class MyEntity extends Nextras\Orm\Entity\Entity {}
The Nextras\Orm\Entity\Entity
still contains
toArray()
method; The conversion type constants were moved to the
helper.
See the [commit];
See the [commit];
See the [commit];
The events method are currently included in th interface and are called directly when the event should be fixed; Therefore if you override the methods, you will have to changed their visibility modifier to public; [commit];
We have cleaned up the relationship names, currently supported are only these
with the letter m
, e.g. 1:m
, m:1
,
m:m
as abbreviation of the Many word; [commit];
We have dropped the magic; the proxied methods on mapper have to return already converted results as ICollection or IEntity|null; to achieve this, use DbalMapper::toCollection() or DbalMapper::toEntity() methods; [commit];
Orm 3.0 requires Nextras Dbal 3.0. Dbal brings datetime handling changes, generally speaking, if you use columns with timezone support, you should be pretty safe to upgrade. See Dbal 3.0.0 release notes.
The following BC breaks are quite internal, in other words, you probably will not have to do anything because of them:
See the [commit];
We encourage to serialize entity id and refetch the entity every time you need it;
To check the state use the IEntity::isAttached()
method;
We have removed IEntity::SKIP_SET_VALUE
; [commit];