You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user_guide_src/source/models/entities.rst
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,8 +121,15 @@ make the method recursive, in case of nested Entities.
121
121
Hidden properties
122
122
=================
123
123
124
-
It is possible to set properties that are only available in raw form. The property must start with an underscore. Casting cannot be applied to such fields.
125
-
This is created so that we allow our magic methods a chance to do their thing, but you can use it in another way.
124
+
An Entity may have hidden attributes - their names start with an underscore (``_``). By default, these hidden properties
125
+
are not included when you call ``toArray()``. However, you can still access them directly if needed.
126
+
127
+
If you want hidden properties to appear in the ``toArray()`` output, you'll need to use the ``datamap`` feature - it makes
128
+
those properties "visible".
129
+
130
+
Keep in mind that the smart ``__get()`` and ``__set()`` methods (described in the next section) ignore leading underscores
131
+
in property names. This means that two attributes with the same name (one starting with ``_`` and one without) will both use
132
+
the same getter and setter, so you have to choose which one to handle by default.
0 commit comments