@@ -71,27 +71,27 @@ discard block |
||
| 71 | 71 | public const FLAGS_LONG = 2; |
| 72 | 72 | |
| 73 | 73 | // specific value |
| 74 | - public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 75 | - public const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 76 | - public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 74 | + public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 75 | + public const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 76 | + public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 77 | 77 | |
| 78 | 78 | // bitwise |
| 79 | - public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 80 | - public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 81 | - public const CFG_OPEN = 16; // Circle is open, people can join |
|
| 82 | - public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 83 | - public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 84 | - public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 85 | - public const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 86 | - public const CFG_NO_OWNER = 512; // no owner, only members |
|
| 87 | - public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 88 | - public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 89 | - public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 90 | - public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 91 | - public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 92 | - public const CFG_FEDERATED = 32768; // Federated |
|
| 93 | - public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 94 | - public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
| 79 | + public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 80 | + public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 81 | + public const CFG_OPEN = 16; // Circle is open, people can join |
|
| 82 | + public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 83 | + public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 84 | + public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 85 | + public const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 86 | + public const CFG_NO_OWNER = 512; // no owner, only members |
|
| 87 | + public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 88 | + public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 89 | + public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 90 | + public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 91 | + public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 92 | + public const CFG_FEDERATED = 32768; // Federated |
|
| 93 | + public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 94 | + public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
| 95 | 95 | public static $DEF_CFG_MAX = 262143; |
| 96 | 96 | |
| 97 | 97 | |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | */ |
| 464 | 464 | public function addInheritedMembers(array $members): self { |
| 465 | 465 | $knownIds = array_map( |
| 466 | - function (Member $member): string { |
|
| 466 | + function(Member $member): string { |
|
| 467 | 467 | return $member->getId(); |
| 468 | 468 | }, $this->inheritedMembers |
| 469 | 469 | ); |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | $initiatorHelper->mustBeAdmin(); |
| 880 | 880 | $arr['settings'] = $this->getSettings(); |
| 881 | 881 | $arr['invitationCode'] = $this->getCircleInvitation()?->getInvitationCode(); |
| 882 | - } catch (MemberHelperException|MemberLevelException $e) { |
|
| 882 | + } catch (MemberHelperException | MemberLevelException $e) { |
|
| 883 | 883 | } |
| 884 | 884 | } |
| 885 | 885 | |
@@ -895,23 +895,23 @@ discard block |
||
| 895 | 895 | * @throws CircleNotFoundException |
| 896 | 896 | */ |
| 897 | 897 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
| 898 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
| 898 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
| 899 | 899 | throw new CircleNotFoundException(); |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
| 903 | - ->setName($this->get($prefix . 'name', $data)) |
|
| 904 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
| 905 | - ->setSanitizedName($this->get($prefix . 'sanitized_name', $data)) |
|
| 906 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
| 907 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
| 908 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
| 909 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
| 910 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
| 911 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
| 912 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
| 913 | - |
|
| 914 | - $creation = $this->get($prefix . 'creation', $data); |
|
| 902 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
| 903 | + ->setName($this->get($prefix.'name', $data)) |
|
| 904 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
| 905 | + ->setSanitizedName($this->get($prefix.'sanitized_name', $data)) |
|
| 906 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
| 907 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
| 908 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
| 909 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
| 910 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
| 911 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
| 912 | + ->setDescription($this->get($prefix.'description', $data)); |
|
| 913 | + |
|
| 914 | + $creation = $this->get($prefix.'creation', $data); |
|
| 915 | 915 | $dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $creation); |
| 916 | 916 | $timestamp = $dateTime ? $dateTime->getTimestamp() : (int)strtotime($creation); |
| 917 | 917 | $this->setCreation($timestamp); |
@@ -186,12 +186,12 @@ |
||
| 186 | 186 | throw new CircleInvitationNotFoundException(); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $this->setId($this->getInt($prefix . 'id', $data)) |
|
| 190 | - ->setCircleId($this->get($prefix . 'circle_id', $data)) |
|
| 191 | - ->setInvitationCode($this->get($prefix . 'invitation_code', $data)) |
|
| 192 | - ->setCreatedBy($this->get($prefix . 'created_by', $data)); |
|
| 189 | + $this->setId($this->getInt($prefix.'id', $data)) |
|
| 190 | + ->setCircleId($this->get($prefix.'circle_id', $data)) |
|
| 191 | + ->setInvitationCode($this->get($prefix.'invitation_code', $data)) |
|
| 192 | + ->setCreatedBy($this->get($prefix.'created_by', $data)); |
|
| 193 | 193 | |
| 194 | - $created = $this->get($prefix . 'created', $data); |
|
| 194 | + $created = $this->get($prefix.'created', $data); |
|
| 195 | 195 | $dateTime = \DateTime::createFromFormat('Y-m-d H:i:s', $created); |
| 196 | 196 | $timestamp = $dateTime ? $dateTime->getTimestamp() : (int)strtotime($created); |
| 197 | 197 | $this->setCreated($timestamp); |