Rename Model\User::getOwnerDataById parameter to better reflect intent
This commit is contained in:
parent
e4228c6218
commit
8c17a6b4d9
|
@ -370,12 +370,12 @@ class User
|
|||
/**
|
||||
* Get owner data by user id
|
||||
*
|
||||
* @param int $uid
|
||||
* @param boolean $check_valid Test if data is invalid and correct it
|
||||
* @param int $uid
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue