Skip to content

Commit 2820fe4

Browse files
committed
docs: add sub section title and fix section level
1 parent 0d1cba9 commit 2820fe4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

user_guide_src/source/models/entities.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ should be cast to.
203203
Property casting affects both read (get) and write (set), but some types affect
204204
only read (get).
205205

206+
Scalar Type Casting
207+
-------------------
208+
206209
Properties can be cast to any of the following data types:
207210
**integer**, **float**, **double**, **string**, **boolean**, **object**, **array**, **datetime**, **timestamp**, **uri** and **int-bool**.
208211
Add a question mark at the beginning of type to mark property as nullable, i.e., **?string**, **?integer**.
@@ -214,7 +217,7 @@ For example, if you had a User entity with an ``is_banned`` property, you can ca
214217
.. literalinclude:: entities/012.php
215218

216219
Array/Json Casting
217-
==================
220+
------------------
218221

219222
Array/Json casting is especially useful with fields that store serialized arrays or json in them. When cast as:
220223

@@ -235,7 +238,7 @@ the value whenever the property is set:
235238
.. literalinclude:: entities/014.php
236239

237240
CSV Casting
238-
===========
241+
-----------
239242

240243
If you know you have a flat array of simple values, encoding them as a serialized or JSON string
241244
may be more complex than the original structure. Casting as Comma-Separated Values (CSV) is
@@ -251,7 +254,7 @@ Stored in the database as "red,yellow,green":
251254
.. note:: Casting as CSV uses PHP's internal ``implode`` and ``explode`` methods and assumes all values are string-safe and free of commas. For more complex data casts try ``array`` or ``json``.
252255

253256
Custom Casting
254-
==============
257+
--------------
255258

256259
You can define your own conversion types for getting and setting data.
257260

0 commit comments

Comments
 (0)