Rename Model\User::getOwnerDataById parameter to better reflect intent

This commit is contained in:
Hypolite Petovan 2020-12-15 09:41:10 -05:00
parent e4228c6218
commit 8c17a6b4d9

View file

@ -371,11 +371,11 @@ class User
* Get owner data by user id
*
* @param int $uid
* @param boolean $check_valid Test if data is invalid and correct it
* @param boolean $repairMissing Repair the owner data if it's missing
* @return boolean|array
* @throws Exception
*/
public static function getOwnerDataById(int $uid, bool $check_valid = true)
public static function getOwnerDataById(int $uid, bool $repairMissing = true)
{
if ($uid == 0) {
return self::getSystemAccount();
@ -387,7 +387,7 @@ class User
$owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
if (!DBA::isResult($owner)) {
if (!DBA::exists('user', ['uid' => $uid]) || !$check_valid) {
if (!DBA::exists('user', ['uid' => $uid]) || !$repairMissing) {
return false;
}
Contact::createSelfFromUserId($uid);
@ -398,7 +398,7 @@ class User
return false;
}
if (!$check_valid) {
if (!$repairMissing) {
return $owner;
}