-
-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use typed properties for default metadata
- Loading branch information
Showing
10 changed files
with
372 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# UPGRADE FROM 2.3 to 2.4 | ||
|
||
## Typed properties as default mapping metadata | ||
|
||
When using typed properties on Document classes, Doctrine will use these types to set defaults mapping types. | ||
|
||
If you have defined some properties like: | ||
|
||
```php | ||
#[Field] | ||
private int $myProp; | ||
``` | ||
|
||
This property will be stored in DB as `string` but casted back to `int`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/Doctrine/ODM/MongoDB/Tests/Mapping/xml/Documents74.UserTyped.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping | ||
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd"> | ||
|
||
<document name="Documents74\UserTyped"> | ||
<id field-name="id" /> | ||
|
||
<field name="username"/> | ||
<field name="dateTime"/> | ||
<field name="dateTimeImmutable"/> | ||
<field name="array"/> | ||
<field name="boolean"/> | ||
<field name="float"/> | ||
<field name="int"/> | ||
|
||
<embed-one field="embedOne" /> | ||
<reference-one field="referenceOne" /> | ||
|
||
<embed-many field="embedMany" /> | ||
<reference-many field="referenceMany" /> | ||
</document> | ||
</doctrine-mongo-mapping> |
Oops, something went wrong.