{FR} - 3.7.2.3 "created" et "modified" (ou "updated")
Ces deux champs sont automatiquement gérés lors des appels à la méthode save() du modèle CakePHP. A la création d'une nouvelle ligne, son champ created sera automatiquement rempli et son champ modified est mis à jour chaque fois que des changements sont faits. Notez qu'un champ nommé updated aura le même comportement que le champ modified.
Ces deux champs spéciaux doivent être de type DATETIME avec NULL comme valeur par défaut.
{EN} - 3.7.2.3 created and modified
By defining a created or modified field in your database table as datetime fields, CakePHP will recognize those fields and populate them automatically whenever a record is created or saved to the database.
The created and modified fields will be set to the current date and time when the record is initially added. The modified field will be updated with the current date and time whenever the existing record is saved.
Note: A field named updated will exhibit the same behavior as modified. These fields need to be datetime fields with the default value set to NULL to be recognized by CakePHP.
Differences
| Lines: 1-7 | Lines: 1-6 | ||
| - | <title>created and modified</title> <p>By defining a <code>created</code> or <code>modified</code> field in your database table as <code>datetime</code> fields, CakePHP will recognize those fields and populate them automatically whenever a record is created or saved to the database.</p> <p>The <code>created</code> and <code>modified</code> fields will be set to the current date and time when the record is initially added. The <code>modified</code> field will be updated with the current date and time whenever the existing record is saved.</p> /> <p class="note">Note: A field named <code>updated</code> will exhibit the same behavior as <code>modified</code>. These fields need to be datetime fields with the default value set to NULL to be recognized by CakePHP.</p> |
+ | <title>"created" et "modified" (ou "updated")</title> <p>Ces deux champs sont automatiquement gérés lors des appels à la méthode save() du modèle CakePHP. A la création d'une nouvelle ligne, son champ <code>created</code> sera automatiquement rempli et son champ <code>modified</code> est mis à jour chaque fois que des changements sont faits. Notez qu'un champ nommé <code>updated</code> aura le même comportement que le champ <code>modified</code>. /></p> /><p>Ces deux champs spéciaux doivent être de type DATETIME avec NULL comme valeur par défaut. </p> |
