Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion lib/Model/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* later. See the COPYING file.
*
* @author Maxence Lange <[email protected]>
* @author René Gieling <[email protected]>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
Expand Down Expand Up @@ -45,6 +46,7 @@
use OCA\Circles\Exceptions\UserTypeNotFoundException;
use OCA\Circles\IFederatedUser;
use OCA\Circles\IMemberships;
use OCA\Circles\Model\DeprecatedMember;
use OCA\Circles\Model\Federated\RemoteInstance;


Expand Down Expand Up @@ -295,6 +297,23 @@ public function getUserType(): int {
return $this->userType;
}

/**
* @return int
* @deprecated 22.0.0 - Use `$this->getUserType()` instead
*/
public function getType(): int {
switch ($this->getUserType()) {
case (self::TYPE_USER):
return DeprecatedMember::TYPE_USER;
case (self::TYPE_GROUP):
return DeprecatedMember::TYPE_GROUP;
case (self::TYPE_MAIL):
return DeprecatedMember::TYPE_MAIL;
case (self::TYPE_CONTACT):
return DeprecatedMember::TYPE_CONTACT;
}
return $this->getUserType();
}

/**
* @param string $instance
Expand Down Expand Up @@ -971,4 +990,3 @@ public static function parseTypeString(string $typeString): int {
}

}