From f5382d18d66d066602a5f77e69e9da73185f56d4 Mon Sep 17 00:00:00 2001 From: Lonnie Ezell Date: Sun, 24 Jun 2018 22:33:12 -0500 Subject: [PATCH] Update docs for Entity to include all . Fixes #1061 --- user_guide_src/source/database/entities.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/database/entities.rst b/user_guide_src/source/database/entities.rst index b85eb8cae8..79b4f493fa 100755 --- a/user_guide_src/source/database/entities.rst +++ b/user_guide_src/source/database/entities.rst @@ -248,7 +248,9 @@ simply map the ``full_name`` column in the database to the ``$name`` property, a protected $_options = [ 'datamap' => [ 'full_name' => 'name' - ] + ], + 'dates' => ['created_at', 'updated_at', 'deleted_at'], + 'casts' => [] ]; } @@ -289,6 +291,8 @@ You can define which properties are automatically converted by adding the name t protected $_options = [ 'dates' => ['created_at', 'updated_at', 'deleted_at'], + 'casts' => [], + 'datamap' => [] ]; } @@ -327,7 +331,9 @@ For example, if you had a User entity with an **is_banned** property, you can ca protected $_options = [ 'casts' => [ 'is_banned' => 'boolean' - ] + ], + 'dates' => ['created_at', 'updated_at', 'deleted_at'], + 'datamap' => [] ]; } @@ -349,7 +355,9 @@ you can cast properties into, the **array** cast type will serialize the value w protected $_options = [ 'casts' => [ 'options' => 'array' - ] + ], + 'dates' => ['created_at', 'updated_at', 'deleted_at'], + 'datamap' => [] ]; }