@@ -184,8 +184,8 @@ |
||
| 184 | 184 | $qb->filterCircles(CoreQueryBuilder::CIRCLE, $probe); |
| 185 | 185 | if (!is_null($initiator)) { |
| 186 | 186 | $qb->limitToInitiator(CoreQueryBuilder::CIRCLE, $initiator); |
| 187 | - $qb->orderBy($qb->generateAlias(CoreQueryBuilder::CIRCLE, CoreQueryBuilder::INITIATOR) . '.level', 'desc'); |
|
| 188 | - $qb->addOrderBy(CoreQueryBuilder::CIRCLE . '.display_name', 'asc'); |
|
| 187 | + $qb->orderBy($qb->generateAlias(CoreQueryBuilder::CIRCLE, CoreQueryBuilder::INITIATOR).'.level', 'desc'); |
|
| 188 | + $qb->addOrderBy(CoreQueryBuilder::CIRCLE.'.display_name', 'asc'); |
|
| 189 | 189 | } |
| 190 | 190 | if ($probe->hasFilterMember()) { |
| 191 | 191 | $qb->limitToDirectMembership(CoreQueryBuilder::CIRCLE, $probe->getFilterMember()); |
@@ -90,27 +90,27 @@ discard block |
||
| 90 | 90 | public const FLAGS_LONG = 2; |
| 91 | 91 | |
| 92 | 92 | // specific value |
| 93 | - public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 94 | - public const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 95 | - public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 93 | + public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 94 | + public const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 95 | + public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 96 | 96 | |
| 97 | 97 | // bitwise |
| 98 | - public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 99 | - public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 100 | - public const CFG_OPEN = 16; // Circle is open, people can join |
|
| 101 | - public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 102 | - public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 103 | - public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 104 | - public const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 105 | - public const CFG_NO_OWNER = 512; // no owner, only members |
|
| 106 | - public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 107 | - public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 108 | - public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 109 | - public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 110 | - public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 111 | - public const CFG_FEDERATED = 32768; // Federated |
|
| 112 | - public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 113 | - public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
| 98 | + public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 99 | + public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 100 | + public const CFG_OPEN = 16; // Circle is open, people can join |
|
| 101 | + public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 102 | + public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 103 | + public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 104 | + public const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 105 | + public const CFG_NO_OWNER = 512; // no owner, only members |
|
| 106 | + public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 107 | + public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 108 | + public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 109 | + public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 110 | + public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 111 | + public const CFG_FEDERATED = 32768; // Federated |
|
| 112 | + public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 113 | + public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
| 114 | 114 | public static $DEF_CFG_MAX = 262143; |
| 115 | 115 | |
| 116 | 116 | |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | */ |
| 480 | 480 | public function addInheritedMembers(array $members): self { |
| 481 | 481 | $knownIds = array_map( |
| 482 | - function (Member $member): string { |
|
| 482 | + function(Member $member): string { |
|
| 483 | 483 | return $member->getId(); |
| 484 | 484 | }, $this->inheritedMembers |
| 485 | 485 | ); |
@@ -893,25 +893,25 @@ discard block |
||
| 893 | 893 | * @throws CircleNotFoundException |
| 894 | 894 | */ |
| 895 | 895 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
| 896 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
| 896 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
| 897 | 897 | throw new CircleNotFoundException(); |
| 898 | 898 | } |
| 899 | 899 | |
| 900 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
| 901 | - ->setName($this->get($prefix . 'name', $data)) |
|
| 902 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
| 903 | - ->setSanitizedName($this->get($prefix . 'sanitized_name', $data)) |
|
| 904 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
| 905 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
| 906 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
| 907 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
| 908 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
| 909 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
| 910 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
| 911 | - |
|
| 912 | - $creation = $this->get($prefix . 'creation', $data); |
|
| 900 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
| 901 | + ->setName($this->get($prefix.'name', $data)) |
|
| 902 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
| 903 | + ->setSanitizedName($this->get($prefix.'sanitized_name', $data)) |
|
| 904 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
| 905 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
| 906 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
| 907 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
| 908 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
| 909 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
| 910 | + ->setDescription($this->get($prefix.'description', $data)); |
|
| 911 | + |
|
| 912 | + $creation = $this->get($prefix.'creation', $data); |
|
| 913 | 913 | $dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $creation); |
| 914 | - $timestamp = $dateTime ? $dateTime->getTimestamp() : (int) strtotime($creation); |
|
| 914 | + $timestamp = $dateTime ? $dateTime->getTimestamp() : (int)strtotime($creation); |
|
| 915 | 915 | $this->setCreation($timestamp); |
| 916 | 916 | |
| 917 | 917 | $this->setPopulation($this->getInt('population', $this->getSettings())); |