From ec84410d4cf6bb8f45b9c8f4fb3a1b1f9632616d Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 4 Apr 2024 10:36:22 +0900 Subject: [PATCH] docs: add "// ..." to sample code To make it clear that only a part of the code is shown. --- user_guide_src/source/models/model/003.php | 2 ++ user_guide_src/source/models/model/004.php | 2 ++ user_guide_src/source/models/model/027.php | 2 ++ user_guide_src/source/models/model/034.php | 2 ++ user_guide_src/source/models/model/038.php | 2 ++ user_guide_src/source/models/model/040.php | 2 ++ user_guide_src/source/models/model/041.php | 2 ++ user_guide_src/source/models/model/050.php | 2 ++ user_guide_src/source/models/model/051.php | 4 ++++ user_guide_src/source/models/model/052.php | 4 ++++ user_guide_src/source/models/model/054.php | 2 ++ 11 files changed, 26 insertions(+) diff --git a/user_guide_src/source/models/model/003.php b/user_guide_src/source/models/model/003.php index 1b70cea84a84..c2ef0d257efc 100644 --- a/user_guide_src/source/models/model/003.php +++ b/user_guide_src/source/models/model/003.php @@ -6,6 +6,8 @@ class UserModel extends UserAuthModel { + // ... + /** * Called during initialization. Appends * our custom field to the module's model. diff --git a/user_guide_src/source/models/model/004.php b/user_guide_src/source/models/model/004.php index 1ae028acbf7a..1005e6f7f2e7 100644 --- a/user_guide_src/source/models/model/004.php +++ b/user_guide_src/source/models/model/004.php @@ -7,4 +7,6 @@ class UserModel extends Model { protected $DBGroup = 'group_name'; + + // ... } diff --git a/user_guide_src/source/models/model/027.php b/user_guide_src/source/models/model/027.php index 3a039df49465..86a5a5f4c71a 100644 --- a/user_guide_src/source/models/model/027.php +++ b/user_guide_src/source/models/model/027.php @@ -6,6 +6,8 @@ class UserModel extends Model { + // ... + protected $validationRules = [ 'username' => 'required|max_length[30]|alpha_numeric_space|min_length[3]', 'email' => 'required|max_length[254]|valid_email|is_unique[users.email]', diff --git a/user_guide_src/source/models/model/034.php b/user_guide_src/source/models/model/034.php index b18544ee555e..ac8989263ee2 100644 --- a/user_guide_src/source/models/model/034.php +++ b/user_guide_src/source/models/model/034.php @@ -6,5 +6,7 @@ class UserModel extends Model { + // ... + protected $validationRules = 'users'; } diff --git a/user_guide_src/source/models/model/038.php b/user_guide_src/source/models/model/038.php index 5ed40baae0eb..2e61e1fc94f8 100644 --- a/user_guide_src/source/models/model/038.php +++ b/user_guide_src/source/models/model/038.php @@ -6,6 +6,8 @@ class MyModel extends Model { + // ... + protected $validationRules = [ 'id' => 'max_length[19]|is_natural_no_zero', 'email' => 'required|max_length[254]|valid_email|is_unique[users.email,id,{id}]', diff --git a/user_guide_src/source/models/model/040.php b/user_guide_src/source/models/model/040.php index df4d628d1c9d..94de0d042171 100644 --- a/user_guide_src/source/models/model/040.php +++ b/user_guide_src/source/models/model/040.php @@ -6,6 +6,8 @@ class MyModel extends Model { + // ... + protected $validationRules = [ 'id' => 'max_length[19]|is_natural_no_zero', 'email' => 'required|max_length[254]|valid_email|is_unique[users.email,id,4]', diff --git a/user_guide_src/source/models/model/041.php b/user_guide_src/source/models/model/041.php index 94ad48e0effb..d5b73ec3869e 100644 --- a/user_guide_src/source/models/model/041.php +++ b/user_guide_src/source/models/model/041.php @@ -6,5 +6,7 @@ class MyModel extends Model { + // ... + protected $allowedFields = ['name', 'email', 'address']; } diff --git a/user_guide_src/source/models/model/050.php b/user_guide_src/source/models/model/050.php index 9f6d334609f1..5f5a4fdb7278 100644 --- a/user_guide_src/source/models/model/050.php +++ b/user_guide_src/source/models/model/050.php @@ -6,6 +6,8 @@ class MyModel extends Model { + // ... + protected function hashPassword(array $data) { if (! isset($data['data']['password'])) { diff --git a/user_guide_src/source/models/model/051.php b/user_guide_src/source/models/model/051.php index 0ca5ee317a37..28229e22edcb 100644 --- a/user_guide_src/source/models/model/051.php +++ b/user_guide_src/source/models/model/051.php @@ -6,6 +6,10 @@ class MyModel extends Model { + // ... + protected $beforeInsert = ['hashPassword']; protected $beforeUpdate = ['hashPassword']; + + // ... } diff --git a/user_guide_src/source/models/model/052.php b/user_guide_src/source/models/model/052.php index 292b752bdc3c..d049e938c713 100644 --- a/user_guide_src/source/models/model/052.php +++ b/user_guide_src/source/models/model/052.php @@ -6,5 +6,9 @@ class MyModel extends Model { + // ... + protected $allowCallbacks = false; + + // ... } diff --git a/user_guide_src/source/models/model/054.php b/user_guide_src/source/models/model/054.php index 6b72095f087f..c67b4828acfd 100644 --- a/user_guide_src/source/models/model/054.php +++ b/user_guide_src/source/models/model/054.php @@ -6,6 +6,8 @@ class MyModel extends Model { + // ... + protected $beforeFind = ['checkCache']; // ...