@@ -151,54 +151,60 @@ potential mass assignment vulnerabilities.
151151
152152.. note :: The ``$primaryKey`` field should never be an allowed field.
153153
154+ Dates
155+ -----
156+
154157$useTimestamps
155- --------------
158+ ^^^^^^^^^^^^^^
156159
157160This boolean value determines whether the current date is automatically added to all inserts
158161and updates. If true, will set the current time in the format specified by ``$dateFormat ``. This
159162requires that the table have columns named **created_at **, **updated_at ** and **deleted_at ** in the appropriate
160163data type.
161164
162165$dateFormat
163- -----------
166+ ^^^^^^^^^^^
164167
165168This value works with ``$useTimestamps `` and ``$useSoftDeletes `` to ensure that the correct type of
166169date value gets inserted into the database. By default, this creates DATETIME values, but
167170valid options are: ``'datetime' ``, ``'date' ``, or ``'int' `` (a PHP timestamp). Using **useSoftDeletes ** or
168171useTimestamps with an invalid or missing dateFormat will cause an exception.
169172
170173$createdField
171- -------------
174+ ^^^^^^^^^^^^^
172175
173176Specifies which database field to use for data record create timestamp.
174177Leave it empty to avoid updating it (even if ``$useTimestamps `` is enabled).
175178
176179$updatedField
177- -------------
180+ ^^^^^^^^^^^^^
178181
179182Specifies which database field should use for keep data record update timestamp.
180183Leave it empty to avoid update it (even ``$useTimestamps `` is enabled).
181184
182185$deletedField
183- -------------
186+ ^^^^^^^^^^^^^
184187
185188Specifies which database field should use for soft deletions. See :ref: `model-use-soft-deletes `.
186189
190+ Validation
191+ ----------
192+
187193$validationRules
188- ----------------
194+ ^^^^^^^^^^^^^^^^
189195
190196Contains either an array of validation rules as described in :ref: `validation-array `
191197or a string containing the name of a validation group, as described in the same section.
192198Described in more detail below.
193199
194200$validationMessages
195- -------------------
201+ ^^^^^^^^^^^^^^^^^^^
196202
197203Contains an array of custom error messages that should be used during validation, as
198204described in :ref: `validation-custom-errors `. Described in more detail below.
199205
200206$skipValidation
201- ---------------
207+ ^^^^^^^^^^^^^^^
202208
203209Whether validation should be skipped during all **inserts ** and **updates **. The default
204210value is ``false ``, meaning that data will always attempt to be validated. This is
@@ -208,7 +214,7 @@ this model will never validate.
208214.. _clean-validation-rules :
209215
210216$cleanValidationRules
211- ---------------------
217+ ^^^^^^^^^^^^^^^^^^^^^
212218
213219Whether validation rules should be removed that do not exist in the passed data.
214220This is used in **updates **.
@@ -220,23 +226,30 @@ You can also change the value by the ``cleanRules()`` method.
220226
221227.. note :: Prior to v4.2.7, ``$cleanValidationRules`` did not work due to a bug.
222228
229+ Callbacks
230+ ---------
231+
223232$allowCallbacks
224- ---------------
233+ ^^^^^^^^^^^^^^^
225234
226235Whether the callbacks defined below should be used.
227236
228237$beforeInsert
229- -------------
238+ ^^^^^^^^^^^^^
230239$afterInsert
231- ------------
240+ ^^^^^^^^^^^^
232241$beforeUpdate
233- -------------
242+ ^^^^^^^^^^^^^
234243$afterUpdate
235- ------------
244+ ^^^^^^^^^^^^
245+ $beforeFind
246+ ^^^^^^^^^^^
236247$afterFind
237- ----------
248+ ^^^^^^^^^^
249+ $beforeDelete
250+ ^^^^^^^^^^^^^
238251$afterDelete
239- ------------
252+ ^^^^^^^^^^^^
240253
241254These arrays allow you to specify callback methods that will be run on the data at the
242255time specified in the property name.
0 commit comments