File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 62
62
Model
63
63
=====
64
64
65
+ - Added special getter/setter to Entity to avoid method name conflicts.
66
+ See :ref: `entities-special-getter-setter `.
67
+
65
68
Libraries
66
69
=========
67
70
Original file line number Diff line number Diff line change @@ -131,6 +131,25 @@ business logic and create objects that are pleasant to use.
131
131
132
132
.. literalinclude :: entities/007.php
133
133
134
+ .. _entities-special-getter-setter :
135
+
136
+ Special Getter/Setter
137
+ ---------------------
138
+
139
+ .. versionadded :: 4.4.0
140
+
141
+ For example, if your Entity's parent class already has a ``getParent() `` method
142
+ defined, and your Entity also has a column named ``parent ``, when you try to add
143
+ business logic to the ``getParent() `` method in your Entity class, the method is
144
+ already defined.
145
+
146
+ In such a case, you can use the special getter/setter. Instead of ``getX() ``/``setX() ``,
147
+ set ``_getX() ``/``_setX() ``.
148
+
149
+ In the above example, if your Entity has the ``_getParent() `` method, the method
150
+ will be used when you get ``$entity->parent ``, and the ``_setParent() `` method
151
+ will be used when you set `$entity->parent``.
152
+
134
153
Data Mapping
135
154
============
136
155
You can’t perform that action at this time.
0 commit comments