Skip to content

Commit 632476a

Browse files
Clarification on Money object storage inside entities
1 parent a544ae5 commit 632476a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,8 +2737,8 @@ Also this would make understanding structure, debugging and testing harder.
27372737

27382738
#### We do not store Money objects themselves
27392739

2740-
As money object is 1) immutable 2) never compared by reference, we do not store the object itself in Entity.
2741-
We store only it's internal fields and recreate it when needed. This makes code simpler.
2740+
As money object is 1) immutable 2) never compared by reference, we do not store the object itself in Doctrine-persisted Entities.
2741+
We store only it's internal fields and recreate it when needed. This makes the code simpler.
27422742

27432743
```php
27442744
<?php
@@ -2771,6 +2771,8 @@ class Entity
27712771
}
27722772
```
27732773

2774+
If Entity is not persisted by Doctrine, we just store Money object itself as usual.
2775+
27742776
#### We store amount as decimal
27752777

27762778
Inside Doctrine configuration:

0 commit comments

Comments
 (0)