Skip to content

Commit

Permalink
docs: add "// ..." to sample code
Browse files Browse the repository at this point in the history
To make it clear that only a part of the code is shown.
  • Loading branch information
kenjis committed Apr 4, 2024
1 parent 9bf27a1 commit ec84410
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/003.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class UserModel extends UserAuthModel
{
// ...

/**
* Called during initialization. Appends
* our custom field to the module's model.
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/004.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
class UserModel extends Model
{
protected $DBGroup = 'group_name';

// ...
}
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/027.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]',
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/034.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

class UserModel extends Model
{
// ...

protected $validationRules = 'users';
}
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/038.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}]',
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/040.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]',
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/041.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

class MyModel extends Model
{
// ...

protected $allowedFields = ['name', 'email', 'address'];
}
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/050.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class MyModel extends Model
{
// ...

protected function hashPassword(array $data)
{
if (! isset($data['data']['password'])) {
Expand Down
4 changes: 4 additions & 0 deletions user_guide_src/source/models/model/051.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

class MyModel extends Model
{
// ...

protected $beforeInsert = ['hashPassword'];
protected $beforeUpdate = ['hashPassword'];

// ...
}
4 changes: 4 additions & 0 deletions user_guide_src/source/models/model/052.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@

class MyModel extends Model
{
// ...

protected $allowCallbacks = false;

// ...
}
2 changes: 2 additions & 0 deletions user_guide_src/source/models/model/054.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class MyModel extends Model
{
// ...

protected $beforeFind = ['checkCache'];

// ...
Expand Down

0 comments on commit ec84410

Please sign in to comment.