Skip to content

Commit 2a50358

Browse files
WedgeSamaBenjamin Georgeault
and
Benjamin Georgeault
authored
Add doc to explain how to access nested property from relation. (#1129)
I thinks the right syntaxe must be something like `@self->created_by->info->created`, but like said it #1116 and refered in #1019, it does not work for now. Using this syntax `@self->created_by.info.created`, it works. Co-authored-by: Benjamin Georgeault <[email protected]>
1 parent 048e4fb commit 2a50358

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/fixtures-refactoring.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,23 @@ Nelmio\Entity\Group:
136136
As you can see, we make sure that the update date is between the creation
137137
date and the current time, which ensure the data will look real enough.
138138

139+
If you need to access a property from another object that is a property of your current object, you can do as following:
140+
141+
```yaml
142+
Nelmio\Entity\User:
143+
user1:
144+
# ...
145+
created: '<dateTimeBetween("-200 days", "now")>'
146+
147+
Nelmio\Entity\Group:
148+
group1:
149+
# ...
150+
created_by: '@user1'
151+
created: '<dateTimeBetween(@self->created_by.created, "now")>'
152+
updated: '<dateTimeBetween($created, "now")>'
153+
```
154+
155+
You can also multi depth with more `.` like `@self->created_by.info.created`.
139156

140157
## Parameters
141158

0 commit comments

Comments
 (0)