Skip to content

Commit 9b5e64b

Browse files
committed
refactor: Apply suggestions (revert)
1 parent e3826f8 commit 9b5e64b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

deptrac.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ deptrac:
209209
- I18n
210210
Model:
211211
- Database
212+
- DataCaster
212213
- DataConverter
213214
- Entity
214215
- I18n

system/BaseModel.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ abstract class BaseModel
212212
protected bool $updateOnlyChanged = true;
213213

214214
/**
215-
* Rules used to validate data
216-
* in $this->insert(), $this->update(), $this->save() methods.
215+
* Rules used to validate data in insert(), update(), save(),
216+
* insertBatch(), and updateBatch() methods.
217217
*
218218
* The array must match the format of data passed to the `Validation`
219219
* library.
@@ -973,7 +973,6 @@ public function update($id = null, $row = null): bool
973973
throw new InvalidArgumentException('update(): argument #1 ($id) should not be boolean.');
974974
}
975975

976-
// if (is_numeric($id) || is_string($id)) {
977976
if (! in_array($id, [null, 0, '0'], true) && (is_numeric($id) || is_string($id))) {
978977
$id = [$id];
979978
}

system/Model.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,9 @@ public function countAllResults(bool $reset = true, bool $test = false)
506506
$this->builder()->where($this->table . '.' . $this->deletedField, null);
507507
}
508508

509+
// When $reset === false, the $tempUseSoftDeletes will be
510+
// dependent on $useSoftDeletes value because we don't
511+
// want to add the same "where" condition for the second time.
509512
$this->tempUseSoftDeletes = $reset
510513
? $this->useSoftDeletes
511514
: ($this->useSoftDeletes ? false : $this->useSoftDeletes);

0 commit comments

Comments
 (0)