@@ -811,29 +811,29 @@ discard block |
||
| 811 | 811 | * @throws MemberNotFoundException |
| 812 | 812 | */ |
| 813 | 813 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 814 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
| 814 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
| 815 | 815 | throw new MemberNotFoundException(); |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | - $this->setId($this->get($prefix . 'member_id', $data)); |
|
| 819 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
| 820 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
| 821 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
| 822 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
| 823 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
| 824 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
| 825 | - $this->setStatus($this->get($prefix . 'status', $data)); |
|
| 826 | - $this->setDisplayName($this->get($prefix . 'cached_name', $data)); |
|
| 827 | - $this->setNotes($this->getArray($prefix . 'note', $data)); |
|
| 828 | - $this->setContactId($this->get($prefix . 'contact_id', $data)); |
|
| 829 | - $this->setContactMeta($this->get($prefix . 'contact_meta', $data)); |
|
| 830 | - |
|
| 831 | - $cachedUpdate = $this->get($prefix . 'cached_update', $data); |
|
| 818 | + $this->setId($this->get($prefix.'member_id', $data)); |
|
| 819 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
| 820 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
| 821 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
| 822 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
| 823 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
| 824 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
| 825 | + $this->setStatus($this->get($prefix.'status', $data)); |
|
| 826 | + $this->setDisplayName($this->get($prefix.'cached_name', $data)); |
|
| 827 | + $this->setNotes($this->getArray($prefix.'note', $data)); |
|
| 828 | + $this->setContactId($this->get($prefix.'contact_id', $data)); |
|
| 829 | + $this->setContactMeta($this->get($prefix.'contact_meta', $data)); |
|
| 830 | + |
|
| 831 | + $cachedUpdate = $this->get($prefix.'cached_update', $data); |
|
| 832 | 832 | if ($cachedUpdate !== '') { |
| 833 | 833 | $this->setDisplayUpdate(DateTime::createFromFormat('Y-m-d H:i:s', $cachedUpdate)->getTimestamp()); |
| 834 | 834 | } |
| 835 | 835 | |
| 836 | - $joined = $this->get($prefix . 'joined', $data); |
|
| 836 | + $joined = $this->get($prefix.'joined', $data); |
|
| 837 | 837 | if ($joined !== '') { |
| 838 | 838 | $this->setJoined(DateTime::createFromFormat('Y-m-d H:i:s', $joined)->getTimestamp()); |
| 839 | 839 | } |
@@ -924,7 +924,7 @@ discard block |
||
| 924 | 924 | public static function parseLevelInt(int $level): int { |
| 925 | 925 | if (!array_key_exists($level, self::$DEF_LEVEL)) { |
| 926 | 926 | $all = implode(', ', array_keys(self::$DEF_LEVEL)); |
| 927 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
| 927 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | return $level; |
@@ -943,7 +943,7 @@ discard block |
||
| 943 | 943 | |
| 944 | 944 | if (!$level) { |
| 945 | 945 | $all = implode(', ', array_values(self::$DEF_LEVEL)); |
| 946 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
| 946 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
| 947 | 947 | } |
| 948 | 948 | |
| 949 | 949 | return (int)$level; |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | $type = array_search($typeString, Member::$TYPE); |
| 965 | 965 | if ($type === false) { |
| 966 | 966 | $all = implode(', ', array_values(self::$TYPE)); |
| 967 | - throw new UserTypeNotFoundException('Available types: ' . $all); |
|
| 967 | + throw new UserTypeNotFoundException('Available types: '.$all); |
|
| 968 | 968 | } |
| 969 | 969 | |
| 970 | 970 | return (int)$type; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | if ($circle->getDisplayName() !== '') { |
| 364 | - $this->searchInDBField('display_name', '%' . $circle->getDisplayName() . '%'); |
|
| 364 | + $this->searchInDBField('display_name', '%'.$circle->getDisplayName().'%'); |
|
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | $this->generateRemoteInstanceSelectAlias($aliasRemoteInstance) |
| 378 | 378 | ->leftJoin( |
| 379 | 379 | $alias, CoreRequestBuilder::TABLE_REMOTE, $aliasRemoteInstance, |
| 380 | - $expr->eq($alias . '.instance', $aliasRemoteInstance . '.instance') |
|
| 380 | + $expr->eq($alias.'.instance', $aliasRemoteInstance.'.instance') |
|
| 381 | 381 | ); |
| 382 | 382 | } catch (RequestBuilderException $e) { |
| 383 | 383 | } |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | $expr = $this->expr(); |
| 431 | 431 | $this->leftJoin( |
| 432 | 432 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_REMOTE, $aliasRemote, |
| 433 | - $expr->eq($aliasRemote . '.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
| 433 | + $expr->eq($aliasRemote.'.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
| 434 | 434 | ); |
| 435 | 435 | } |
| 436 | 436 | |
@@ -458,12 +458,12 @@ discard block |
||
| 458 | 458 | $this->leftJoin( |
| 459 | 459 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteMember, |
| 460 | 460 | $expr->andX( |
| 461 | - $expr->eq($aliasRemoteMember . '.circle_id', $aliasCircle . '.unique_id'), |
|
| 461 | + $expr->eq($aliasRemoteMember.'.circle_id', $aliasCircle.'.unique_id'), |
|
| 462 | 462 | $expr->eq( |
| 463 | - $aliasRemoteMember . '.instance', |
|
| 463 | + $aliasRemoteMember.'.instance', |
|
| 464 | 464 | $this->createNamedParameter($remoteInstance->getInstance()) |
| 465 | 465 | ), |
| 466 | - $expr->gte($aliasRemoteMember . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 466 | + $expr->gte($aliasRemoteMember.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 467 | 467 | ) |
| 468 | 468 | ); |
| 469 | 469 | } |
@@ -495,21 +495,21 @@ discard block |
||
| 495 | 495 | $this->leftJoin( |
| 496 | 496 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircle, |
| 497 | 497 | $expr->andX( |
| 498 | - $expr->eq($aliasRemoteCircle . '.single_id', $aliasCircle . '.unique_id'), |
|
| 499 | - $expr->emptyString($aliasRemoteCircle . '.instance'), |
|
| 500 | - $expr->gte($aliasRemoteCircle . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 498 | + $expr->eq($aliasRemoteCircle.'.single_id', $aliasCircle.'.unique_id'), |
|
| 499 | + $expr->emptyString($aliasRemoteCircle.'.instance'), |
|
| 500 | + $expr->gte($aliasRemoteCircle.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 501 | 501 | ) |
| 502 | 502 | ); |
| 503 | 503 | $this->leftJoin( |
| 504 | 504 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircleOwner, |
| 505 | 505 | $expr->andX( |
| 506 | - $expr->eq($aliasRemoteCircle . '.circle_id', $aliasRemoteCircleOwner . '.circle_id'), |
|
| 506 | + $expr->eq($aliasRemoteCircle.'.circle_id', $aliasRemoteCircleOwner.'.circle_id'), |
|
| 507 | 507 | $expr->eq( |
| 508 | - $aliasRemoteCircleOwner . '.instance', |
|
| 508 | + $aliasRemoteCircleOwner.'.instance', |
|
| 509 | 509 | $this->createNamedParameter($remoteInstance->getInstance()) |
| 510 | 510 | ), |
| 511 | 511 | $expr->eq( |
| 512 | - $aliasRemoteCircleOwner . '.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
| 512 | + $aliasRemoteCircleOwner.'.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
| 513 | 513 | ) |
| 514 | 514 | ) |
| 515 | 515 | ); |
@@ -542,16 +542,16 @@ discard block |
||
| 542 | 542 | $expr = $this->expr(); |
| 543 | 543 | $orX = $expr->orX(); |
| 544 | 544 | $orX->add( |
| 545 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
| 545 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
| 546 | 546 | ); |
| 547 | 547 | |
| 548 | 548 | $orExtOrPassive = $expr->orX(); |
| 549 | 549 | $orExtOrPassive->add( |
| 550 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
| 550 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
| 551 | 551 | ); |
| 552 | 552 | if (!$sensitive) { |
| 553 | 553 | $orExtOrPassive->add( |
| 554 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 554 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 555 | 555 | ); |
| 556 | 556 | } else { |
| 557 | 557 | if ($this->getDefaultSelectAlias() === CoreQueryBuilder::MEMBER) { |
@@ -560,8 +560,8 @@ discard block |
||
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | $orInstance = $expr->orX(); |
| 563 | - $orInstance->add($expr->isNotNull($aliasRemoteMember . '.instance')); |
|
| 564 | - $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner . '.instance')); |
|
| 563 | + $orInstance->add($expr->isNotNull($aliasRemoteMember.'.instance')); |
|
| 564 | + $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner.'.instance')); |
|
| 565 | 565 | |
| 566 | 566 | $andExternal = $expr->andX(); |
| 567 | 567 | $andExternal->add($orExtOrPassive); |
@@ -570,13 +570,13 @@ discard block |
||
| 570 | 570 | $orExtOrTrusted = $expr->orX(); |
| 571 | 571 | $orExtOrTrusted->add($andExternal); |
| 572 | 572 | $orExtOrTrusted->add( |
| 573 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
| 573 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
| 574 | 574 | ); |
| 575 | 575 | |
| 576 | 576 | $andTrusted = $expr->andX(); |
| 577 | 577 | $andTrusted->add($orExtOrTrusted); |
| 578 | 578 | $andTrusted->add($this->exprLimitBitwise('config', Circle::CFG_FEDERATED, $aliasCircle)); |
| 579 | - $andTrusted->add($expr->emptyString($aliasOwner . '.instance')); |
|
| 579 | + $andTrusted->add($expr->emptyString($aliasOwner.'.instance')); |
|
| 580 | 580 | $orX->add($andTrusted); |
| 581 | 581 | |
| 582 | 582 | $this->andWhere($orX); |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | } |
| 604 | 604 | $this->leftJoin( |
| 605 | 605 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
| 606 | - $expr->eq($aliasMember . '.circle_id', $alias . '.unique_id') |
|
| 606 | + $expr->eq($aliasMember.'.circle_id', $alias.'.unique_id') |
|
| 607 | 607 | ); |
| 608 | 608 | |
| 609 | 609 | $this->filterDirectMembership($aliasMember, $member); |
@@ -624,30 +624,30 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | if ($member->getUserId() !== '') { |
| 626 | 626 | $andX->add( |
| 627 | - $expr->eq($aliasMember . '.user_id', $this->createNamedParameter($member->getUserId())) |
|
| 627 | + $expr->eq($aliasMember.'.user_id', $this->createNamedParameter($member->getUserId())) |
|
| 628 | 628 | ); |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | if ($member->getSingleId() !== '') { |
| 632 | 632 | $andX->add( |
| 633 | - $expr->eq($aliasMember . '.single_id', $this->createNamedParameter($member->getSingleId())) |
|
| 633 | + $expr->eq($aliasMember.'.single_id', $this->createNamedParameter($member->getSingleId())) |
|
| 634 | 634 | ); |
| 635 | 635 | } |
| 636 | 636 | |
| 637 | 637 | if ($member->getUserType() > 0) { |
| 638 | 638 | $andX->add( |
| 639 | - $expr->eq($aliasMember . '.user_type', $this->createNamedParameter($member->getUserType())) |
|
| 639 | + $expr->eq($aliasMember.'.user_type', $this->createNamedParameter($member->getUserType())) |
|
| 640 | 640 | ); |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | $andX->add( |
| 644 | - $expr->eq($aliasMember . '.instance', $this->createNamedParameter($this->getInstance($member))) |
|
| 644 | + $expr->eq($aliasMember.'.instance', $this->createNamedParameter($this->getInstance($member))) |
|
| 645 | 645 | ); |
| 646 | 646 | |
| 647 | 647 | if ($member->getLevel() > 0) { |
| 648 | 648 | $andX->add( |
| 649 | 649 | $expr->gte( |
| 650 | - $aliasMember . '.level', |
|
| 650 | + $aliasMember.'.level', |
|
| 651 | 651 | $this->createNamedParameter($member->getLevel(), IQueryBuilder::PARAM_INT) |
| 652 | 652 | ) |
| 653 | 653 | ); |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | $helperAlias, |
| 689 | 689 | CoreRequestBuilder::TABLE_CIRCLE, |
| 690 | 690 | $aliasCircle, |
| 691 | - $expr->eq($aliasCircle . '.unique_id', $helperAlias . '.' . $field) |
|
| 691 | + $expr->eq($aliasCircle.'.unique_id', $helperAlias.'.'.$field) |
|
| 692 | 692 | ); |
| 693 | 693 | |
| 694 | 694 | if (!is_null($initiator)) { |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $this->generateCircleSelectAlias($aliasInvitedBy) |
| 720 | 720 | ->leftJoin( |
| 721 | 721 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasInvitedBy, |
| 722 | - $expr->eq($aliasMember . '.invited_by', $aliasInvitedBy . '.unique_id') |
|
| 722 | + $expr->eq($aliasMember.'.invited_by', $aliasInvitedBy.'.unique_id') |
|
| 723 | 723 | ); |
| 724 | 724 | |
| 725 | 725 | $this->leftJoinOwner($aliasInvitedBy); |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | $this->generateCircleSelectAlias($aliasBasedOn) |
| 751 | 751 | ->leftJoin( |
| 752 | 752 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasBasedOn, |
| 753 | - $expr->eq($aliasBasedOn . '.unique_id', $aliasMember . '.single_id') |
|
| 753 | + $expr->eq($aliasBasedOn.'.unique_id', $aliasMember.'.single_id') |
|
| 754 | 754 | ); |
| 755 | 755 | |
| 756 | 756 | if (!is_null($initiator)) { |
@@ -783,9 +783,9 @@ discard block |
||
| 783 | 783 | ->leftJoin( |
| 784 | 784 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
| 785 | 785 | $expr->andX( |
| 786 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $field), |
|
| 786 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$field), |
|
| 787 | 787 | $expr->eq( |
| 788 | - $aliasMember . '.level', |
|
| 788 | + $aliasMember.'.level', |
|
| 789 | 789 | $this->createNamedParameter(Member::LEVEL_OWNER, self::PARAM_INT) |
| 790 | 790 | ) |
| 791 | 791 | ) |
@@ -823,10 +823,10 @@ discard block |
||
| 823 | 823 | ->leftJoin( |
| 824 | 824 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
| 825 | 825 | $expr->andX( |
| 826 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $fieldCircleId), |
|
| 827 | - $expr->eq($aliasMember . '.single_id', $alias . '.' . $fieldSingleId), |
|
| 826 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$fieldCircleId), |
|
| 827 | + $expr->eq($aliasMember.'.single_id', $alias.'.'.$fieldSingleId), |
|
| 828 | 828 | $expr->gte( |
| 829 | - $aliasMember . '.level', |
|
| 829 | + $aliasMember.'.level', |
|
| 830 | 830 | $this->createNamedParameter(Member::LEVEL_MEMBER, self::PARAM_INT) |
| 831 | 831 | ) |
| 832 | 832 | ) |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | |
| 860 | 860 | $this->leftJoin( |
| 861 | 861 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
| 862 | - $expr->eq($aliasMembership . '.circle_id', $alias . '.' . $field) |
|
| 862 | + $expr->eq($aliasMembership.'.circle_id', $alias.'.'.$field) |
|
| 863 | 863 | ); |
| 864 | 864 | |
| 865 | 865 | // if (!$this->getBool('getData', $options, false)) { |
@@ -873,8 +873,8 @@ discard block |
||
| 873 | 873 | ->leftJoin( |
| 874 | 874 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
| 875 | 875 | $expr->andX( |
| 876 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id'), |
|
| 877 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id') |
|
| 876 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id'), |
|
| 877 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id') |
|
| 878 | 878 | ) |
| 879 | 879 | ); |
| 880 | 880 | |
@@ -891,12 +891,12 @@ discard block |
||
| 891 | 891 | $aliasUpstreamMembership = $this->generateAlias($alias, self::UPSTREAM_MEMBERSHIPS, $options); |
| 892 | 892 | $this->leftJoin( |
| 893 | 893 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasUpstreamMembership, |
| 894 | - $expr->eq($aliasUpstreamMembership . '.single_id', $this->createNamedParameter($singleId)) |
|
| 894 | + $expr->eq($aliasUpstreamMembership.'.single_id', $this->createNamedParameter($singleId)) |
|
| 895 | 895 | ); |
| 896 | 896 | |
| 897 | 897 | $orX = $expr->orX( |
| 898 | - $expr->eq($aliasUpstreamMembership . '.circle_id', $alias . '.' . $field), |
|
| 899 | - $expr->eq($alias . '.' . $field, $this->createNamedParameter($singleId)) |
|
| 898 | + $expr->eq($aliasUpstreamMembership.'.circle_id', $alias.'.'.$field), |
|
| 899 | + $expr->eq($alias.'.'.$field, $this->createNamedParameter($singleId)) |
|
| 900 | 900 | ); |
| 901 | 901 | |
| 902 | 902 | $this->andWhere($orX); |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | |
| 917 | 917 | $expr = $this->expr(); |
| 918 | 918 | $aliasMembership = $this->generateAlias($alias, self::MEMBERSHIPS); |
| 919 | - $this->andWhere($expr->eq($aliasMembership . '.circle_id', $this->createNamedParameter($singleId))); |
|
| 919 | + $this->andWhere($expr->eq($aliasMembership.'.circle_id', $this->createNamedParameter($singleId))); |
|
| 920 | 920 | } |
| 921 | 921 | |
| 922 | 922 | |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | $this->leftJoin( |
| 941 | 941 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
| 942 | 942 | // $expr->andX( |
| 943 | - $expr->eq($aliasMembership . '.inheritance_last', $alias . '.' . $field) |
|
| 943 | + $expr->eq($aliasMembership.'.inheritance_last', $alias.'.'.$field) |
|
| 944 | 944 | // $expr->eq($aliasMembership . '.single_id', $alias . '.single_id') |
| 945 | 945 | // ) |
| 946 | 946 | ); |
@@ -954,8 +954,8 @@ discard block |
||
| 954 | 954 | ->leftJoin( |
| 955 | 955 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritanceFrom, |
| 956 | 956 | $expr->andX( |
| 957 | - $expr->eq($aliasMembership . '.circle_id', $aliasInheritanceFrom . '.circle_id'), |
|
| 958 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInheritanceFrom . '.single_id') |
|
| 957 | + $expr->eq($aliasMembership.'.circle_id', $aliasInheritanceFrom.'.circle_id'), |
|
| 958 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInheritanceFrom.'.single_id') |
|
| 959 | 959 | ) |
| 960 | 960 | ); |
| 961 | 961 | } |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | $aliasMembership, |
| 1022 | 1022 | $expr->andX( |
| 1023 | 1023 | $this->exprLimit('single_id', $initiator->getSingleId(), $aliasMembership), |
| 1024 | - $expr->eq($aliasMembership . '.circle_id', $helperAlias . '.' . $field) |
|
| 1024 | + $expr->eq($aliasMembership.'.circle_id', $helperAlias.'.'.$field) |
|
| 1025 | 1025 | ) |
| 1026 | 1026 | ); |
| 1027 | 1027 | |
@@ -1034,8 +1034,8 @@ discard block |
||
| 1034 | 1034 | $this->leftJoin( |
| 1035 | 1035 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInitiator, |
| 1036 | 1036 | $expr->andX( |
| 1037 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInitiator . '.single_id'), |
|
| 1038 | - $expr->eq($aliasMembership . '.circle_id', $aliasInitiator . '.circle_id') |
|
| 1037 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInitiator.'.single_id'), |
|
| 1038 | + $expr->eq($aliasMembership.'.circle_id', $aliasInitiator.'.circle_id') |
|
| 1039 | 1039 | ) |
| 1040 | 1040 | ); |
| 1041 | 1041 | |
@@ -1043,8 +1043,8 @@ discard block |
||
| 1043 | 1043 | $this->leftJoin( |
| 1044 | 1044 | $aliasInitiator, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
| 1045 | 1045 | $expr->andX( |
| 1046 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id'), |
|
| 1047 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id') |
|
| 1046 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id'), |
|
| 1047 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id') |
|
| 1048 | 1048 | ) |
| 1049 | 1049 | ); |
| 1050 | 1050 | |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | $aliasInheritedByMembership = $this->generateAlias($aliasInheritedBy, self::MEMBERSHIPS); |
| 1064 | 1064 | $this->generateMembershipSelectAlias($aliasMembership, $aliasInheritedByMembership); |
| 1065 | 1065 | } catch (RequestBuilderException $e) { |
| 1066 | - \OC::$server->getLogger()->log(3, '-- ' . $e->getMessage()); |
|
| 1066 | + \OC::$server->getLogger()->log(3, '-- '.$e->getMessage()); |
|
| 1067 | 1067 | } |
| 1068 | 1068 | } |
| 1069 | 1069 | |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | $orX = $expr->orX(); |
| 1088 | 1088 | $orX->add( |
| 1089 | 1089 | $expr->andX( |
| 1090 | - $expr->gte($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 1090 | + $expr->gte($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 1091 | 1091 | ) |
| 1092 | 1092 | ); |
| 1093 | 1093 | |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | $orX->add( |
| 1096 | 1096 | $expr->andX( |
| 1097 | 1097 | $this->exprLimitBitwise('config', Circle::CFG_PERSONAL, $alias), |
| 1098 | - $expr->eq($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
| 1098 | + $expr->eq($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
| 1099 | 1099 | ) |
| 1100 | 1100 | ); |
| 1101 | 1101 | } |
@@ -1104,7 +1104,7 @@ discard block |
||
| 1104 | 1104 | } |
| 1105 | 1105 | if ($this->getBool('canBeVisitor', $options, false)) { |
| 1106 | 1106 | // TODO: should find a better way, also filter on remote initiator on non-federated ? |
| 1107 | - $orX->add($expr->gte($alias . '.config', $this->createNamedParameter(0))); |
|
| 1107 | + $orX->add($expr->gte($alias.'.config', $this->createNamedParameter(0))); |
|
| 1108 | 1108 | } |
| 1109 | 1109 | if ($this->getBool('canBeVisitorOnOpen', $options, false)) { |
| 1110 | 1110 | $andOpen = $expr->andX(); |
@@ -1172,21 +1172,21 @@ discard block |
||
| 1172 | 1172 | $expr = $this->expr(); |
| 1173 | 1173 | $andPassive = $expr->andX(); |
| 1174 | 1174 | $andPassive->add( |
| 1175 | - $expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 1175 | + $expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 1176 | 1176 | ); |
| 1177 | 1177 | |
| 1178 | 1178 | $orMemberOrLevel = $expr->orX(); |
| 1179 | 1179 | $orMemberOrLevel->add( |
| 1180 | - $expr->eq($this->getDefaultSelectAlias() . '.instance', $alias . '.instance') |
|
| 1180 | + $expr->eq($this->getDefaultSelectAlias().'.instance', $alias.'.instance') |
|
| 1181 | 1181 | ); |
| 1182 | 1182 | // TODO: do we need this ? (display members from the local instance) |
| 1183 | 1183 | $orMemberOrLevel->add( |
| 1184 | - $expr->emptyString($this->getDefaultSelectAlias() . '.instance') |
|
| 1184 | + $expr->emptyString($this->getDefaultSelectAlias().'.instance') |
|
| 1185 | 1185 | ); |
| 1186 | 1186 | |
| 1187 | 1187 | $orMemberOrLevel->add( |
| 1188 | 1188 | $expr->eq( |
| 1189 | - $this->getDefaultSelectAlias() . '.level', |
|
| 1189 | + $this->getDefaultSelectAlias().'.level', |
|
| 1190 | 1190 | $this->createNamedParameter(Member::LEVEL_OWNER) |
| 1191 | 1191 | ) |
| 1192 | 1192 | ); |
@@ -1224,11 +1224,11 @@ discard block |
||
| 1224 | 1224 | ) |
| 1225 | 1225 | ->leftJoin( |
| 1226 | 1226 | $aliasShare, CoreRequestBuilder::TABLE_FILE_CACHE, $aliasFileCache, |
| 1227 | - $expr->eq($aliasShare . '.file_source', $aliasFileCache . '.fileid') |
|
| 1227 | + $expr->eq($aliasShare.'.file_source', $aliasFileCache.'.fileid') |
|
| 1228 | 1228 | ) |
| 1229 | 1229 | ->leftJoin( |
| 1230 | 1230 | $aliasFileCache, CoreRequestBuilder::TABLE_STORAGES, $aliasStorages, |
| 1231 | - $expr->eq($aliasFileCache . '.storage', $aliasStorages . '.numeric_id') |
|
| 1231 | + $expr->eq($aliasFileCache.'.storage', $aliasStorages.'.numeric_id') |
|
| 1232 | 1232 | ); |
| 1233 | 1233 | } |
| 1234 | 1234 | |
@@ -1250,8 +1250,8 @@ discard block |
||
| 1250 | 1250 | $this->leftJoin( |
| 1251 | 1251 | $aliasShareMemberships, CoreRequestBuilder::TABLE_SHARE, $aliasShareChild, |
| 1252 | 1252 | $expr->andX( |
| 1253 | - $expr->eq($aliasShareChild . '.parent', $aliasShare . '.id'), |
|
| 1254 | - $expr->eq($aliasShareChild . '.share_with', $aliasShareMemberships . '.single_id') |
|
| 1253 | + $expr->eq($aliasShareChild.'.parent', $aliasShare.'.id'), |
|
| 1254 | + $expr->eq($aliasShareChild.'.share_with', $aliasShareMemberships.'.single_id') |
|
| 1255 | 1255 | ) |
| 1256 | 1256 | ); |
| 1257 | 1257 | |
@@ -1301,13 +1301,13 @@ discard block |
||
| 1301 | 1301 | $this->leftJoin( |
| 1302 | 1302 | $aliasMountMemberships, CoreRequestBuilder::TABLE_MOUNTPOINT, $aliasMountpoint, |
| 1303 | 1303 | $expr->andX( |
| 1304 | - $expr->eq($aliasMountpoint . '.mount_id', $aliasMount . '.mount_id'), |
|
| 1305 | - $expr->eq($aliasMountpoint . '.single_id', $aliasMountMemberships . '.single_id') |
|
| 1304 | + $expr->eq($aliasMountpoint.'.mount_id', $aliasMount.'.mount_id'), |
|
| 1305 | + $expr->eq($aliasMountpoint.'.single_id', $aliasMountMemberships.'.single_id') |
|
| 1306 | 1306 | ) |
| 1307 | 1307 | ); |
| 1308 | 1308 | |
| 1309 | - $this->selectAlias($aliasMountpoint . '.mountpoint', $aliasMountpoint . '_mountpoint'); |
|
| 1310 | - $this->selectAlias($aliasMountpoint . '.mountpoint_hash', $aliasMountpoint . '_mountpoint_hash'); |
|
| 1309 | + $this->selectAlias($aliasMountpoint.'.mountpoint', $aliasMountpoint.'_mountpoint'); |
|
| 1310 | + $this->selectAlias($aliasMountpoint.'.mountpoint_hash', $aliasMountpoint.'_mountpoint_hash'); |
|
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | 1313 | |
@@ -1411,10 +1411,10 @@ discard block |
||
| 1411 | 1411 | */ |
| 1412 | 1412 | public function generateAlias(string $base, string $extension, ?array &$options = []): string { |
| 1413 | 1413 | $search = str_replace('_', '.', $base); |
| 1414 | - $path = $search . '.' . $extension; |
|
| 1414 | + $path = $search.'.'.$extension; |
|
| 1415 | 1415 | if (!$this->validKey($path, self::$SQL_PATH) |
| 1416 | 1416 | && !in_array($extension, $this->getArray($search, self::$SQL_PATH))) { |
| 1417 | - throw new RequestBuilderException($extension . ' not found in ' . $search); |
|
| 1417 | + throw new RequestBuilderException($extension.' not found in '.$search); |
|
| 1418 | 1418 | } |
| 1419 | 1419 | |
| 1420 | 1420 | if (!is_array($options)) { |
@@ -1423,15 +1423,15 @@ discard block |
||
| 1423 | 1423 | |
| 1424 | 1424 | $optionPath = ''; |
| 1425 | 1425 | foreach (explode('.', $path) as $p) { |
| 1426 | - $optionPath = trim($optionPath . '.' . $p, '.'); |
|
| 1426 | + $optionPath = trim($optionPath.'.'.$p, '.'); |
|
| 1427 | 1427 | $options = array_merge( |
| 1428 | 1428 | $options, |
| 1429 | - $this->getArray($optionPath . '.' . self::OPTIONS, self::$SQL_PATH), |
|
| 1430 | - $this->getArray($optionPath . '.' . self::OPTIONS, $this->options) |
|
| 1429 | + $this->getArray($optionPath.'.'.self::OPTIONS, self::$SQL_PATH), |
|
| 1430 | + $this->getArray($optionPath.'.'.self::OPTIONS, $this->options) |
|
| 1431 | 1431 | ); |
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | - return $base . '_' . $extension; |
|
| 1434 | + return $base.'_'.$extension; |
|
| 1435 | 1435 | } |
| 1436 | 1436 | |
| 1437 | 1437 | |
@@ -1451,7 +1451,7 @@ discard block |
||
| 1451 | 1451 | } else { |
| 1452 | 1452 | $k = $arr; |
| 1453 | 1453 | } |
| 1454 | - $path[$k] = $prefix . '_' . $k . '_'; |
|
| 1454 | + $path[$k] = $prefix.'_'.$k.'_'; |
|
| 1455 | 1455 | } |
| 1456 | 1456 | |
| 1457 | 1457 | return $path; |
@@ -331,10 +331,10 @@ discard block |
||
| 331 | 331 | protected function generateMember(FederatedEvent $event, Circle $circle, Member $member): Member { |
| 332 | 332 | try { |
| 333 | 333 | if ($member->getSingleId() !== '') { |
| 334 | - $userId = $member->getSingleId() . '@' . $member->getInstance(); |
|
| 334 | + $userId = $member->getSingleId().'@'.$member->getInstance(); |
|
| 335 | 335 | $federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_SINGLE); |
| 336 | 336 | } else { |
| 337 | - $userId = $member->getUserId() . '@' . $member->getInstance(); |
|
| 337 | + $userId = $member->getUserId().'@'.$member->getInstance(); |
|
| 338 | 338 | $federatedUser = |
| 339 | 339 | $this->federatedUserService->getFederatedUser($userId, $member->getUserType()); |
| 340 | 340 | } |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | $this->sendMailExistingShares($template, $author, $recipient); |
| 639 | 639 | $this->sendPasswordExistingShares($author, $recipient, $password); |
| 640 | 640 | } catch (Exception $e) { |
| 641 | - $this->miscService->log('Failed to send mail about existing share ' . $e->getMessage()); |
|
| 641 | + $this->miscService->log('Failed to send mail about existing share '.$e->getMessage()); |
|
| 642 | 642 | } |
| 643 | 643 | } |
| 644 | 644 | |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | $authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author; |
| 791 | 791 | $authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null; |
| 792 | 792 | |
| 793 | - $this->miscService->log("Sending password mail about existing files to '" . $email . "'", 0); |
|
| 793 | + $this->miscService->log("Sending password mail about existing files to '".$email."'", 0); |
|
| 794 | 794 | |
| 795 | 795 | $plainBodyPart = $this->l10n->t( |
| 796 | 796 | "%1\$s shared multiple files with you.\nYou should have already received a separate email with a link to access them.\n", |
@@ -832,7 +832,7 @@ discard block |
||
| 832 | 832 | $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); |
| 833 | 833 | if ($authorEmail !== null) { |
| 834 | 834 | $message->setReplyTo([$authorEmail => $authorName]); |
| 835 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
| 835 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
| 836 | 836 | } else { |
| 837 | 837 | $emailTemplate->addFooter(); |
| 838 | 838 | } |
@@ -186,11 +186,11 @@ discard block |
||
| 186 | 186 | $this->federatedUserService->commandLineInitiator($initiator, $initiatorType, $circleId, true); |
| 187 | 187 | $circle = $this->circleService->getCircle($circleId); |
| 188 | 188 | |
| 189 | - $output->writeln('<info>Name</info>: ' . $circle->getName()); |
|
| 189 | + $output->writeln('<info>Name</info>: '.$circle->getName()); |
|
| 190 | 190 | $owner = $circle->getOwner(); |
| 191 | - $output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance()); |
|
| 191 | + $output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance()); |
|
| 192 | 192 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
| 193 | - $output->writeln('<info>Config</info>: ' . $type); |
|
| 193 | + $output->writeln('<info>Config</info>: '.$type); |
|
| 194 | 194 | $output->writeln(' '); |
| 195 | 195 | |
| 196 | 196 | $tree = new NC22TreeNode(null, new SimpleDataStore(['circle' => $circle])); |
@@ -254,8 +254,7 @@ discard block |
||
| 254 | 254 | ($this->input->getOption('display-name')) ? |
| 255 | 255 | $member->getBasedOn()->getDisplayName() : $member->getUserId(), |
| 256 | 256 | $this->configService->displayInstance($member->getInstance()), |
| 257 | - ($level > 0) ? Member::$DEF_LEVEL[$level] : |
|
| 258 | - '(' . strtolower($member->getStatus()) . ')', |
|
| 257 | + ($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')', |
|
| 259 | 258 | ($member->hasInvitedBy()) ? $this->configService->displayFederatedUser( |
| 260 | 259 | $member->getInvitedBy() |
| 261 | 260 | ) : 'Unknown' |
@@ -417,18 +416,18 @@ discard block |
||
| 417 | 416 | $member = $data->gObj('member', Member::class); |
| 418 | 417 | |
| 419 | 418 | if ($lineNumber === 1) { |
| 420 | - $line .= '<info>' . $member->getSingleId() . '</info>'; |
|
| 419 | + $line .= '<info>'.$member->getSingleId().'</info>'; |
|
| 421 | 420 | if (!$this->configService->isLocalInstance($member->getInstance())) { |
| 422 | - $line .= '@' . $member->getInstance(); |
|
| 421 | + $line .= '@'.$member->getInstance(); |
|
| 423 | 422 | } |
| 424 | - $line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')'; |
|
| 423 | + $line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')'; |
|
| 425 | 424 | |
| 426 | - $line .= ' <info>MemberId</info>: ' . $member->getId(); |
|
| 425 | + $line .= ' <info>MemberId</info>: '.$member->getId(); |
|
| 427 | 426 | $name = ($this->input->getOption('display-name')) ? |
| 428 | 427 | $member->getBasedOn()->getDisplayName() : $member->getUserId(); |
| 429 | - $line .= ' <info>Name</info>: ' . $name; |
|
| 428 | + $line .= ' <info>Name</info>: '.$name; |
|
| 430 | 429 | $source = ($member->hasBasedOn()) ? $member->getBasedOn()->getSource() : ''; |
| 431 | - $line .= ' <info>Source</info>: ' . Circle::$DEF_SOURCE[$source]; |
|
| 430 | + $line .= ' <info>Source</info>: '.Circle::$DEF_SOURCE[$source]; |
|
| 432 | 431 | } |
| 433 | 432 | |
| 434 | 433 | if ($lineNumber === 2) { |
@@ -440,16 +439,16 @@ discard block |
||
| 440 | 439 | return $line; |
| 441 | 440 | } |
| 442 | 441 | $owner = $circle->getOwner(); |
| 443 | - $line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance(); |
|
| 442 | + $line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance(); |
|
| 444 | 443 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
| 445 | - $line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type; |
|
| 444 | + $line .= ($type === '') ? '' : ' <info>Config</info>: '.$type; |
|
| 446 | 445 | } |
| 447 | 446 | |
| 448 | 447 | } else { |
| 449 | 448 | if ($lineNumber === 1 && !is_null($circle)) { |
| 450 | - $line .= '<info>' . $circle->getSingleId() . '</info>'; |
|
| 449 | + $line .= '<info>'.$circle->getSingleId().'</info>'; |
|
| 451 | 450 | if (!$this->configService->isLocalInstance($circle->getInstance())) { |
| 452 | - $line .= '@' . $circle->getInstance(); |
|
| 451 | + $line .= '@'.$circle->getInstance(); |
|
| 453 | 452 | } |
| 454 | 453 | } |
| 455 | 454 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | return $value; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') { |
|
| 179 | + if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') { |
|
| 180 | 180 | return $value; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | if (array_key_exists('port', $loopback)) { |
| 433 | - $loopbackCloudId = $loopback['host'] . ':' . $loopback['port']; |
|
| 433 | + $loopbackCloudId = $loopback['host'].':'.$loopback['port']; |
|
| 434 | 434 | } else { |
| 435 | 435 | $loopbackCloudId = $loopback['host']; |
| 436 | 436 | } |
@@ -459,12 +459,12 @@ discard block |
||
| 459 | 459 | $scheme = $this->getAppValue(self::LOOPBACK_CLOUD_SCHEME); |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | - $base = $scheme . '://' . $instance; |
|
| 462 | + $base = $scheme.'://'.$instance; |
|
| 463 | 463 | if ($route === '') { |
| 464 | 464 | return $base; |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | - return $base . $this->urlGenerator->linkToRoute($route, $args); |
|
| 467 | + return $base.$this->urlGenerator->linkToRoute($route, $args); |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | * @return string |
| 562 | 562 | */ |
| 563 | 563 | public function displayFederatedUser(IFederatedUser $federatedUser): string { |
| 564 | - return $federatedUser->getUserId() . $this->displayInstance($federatedUser->getInstance(), true); |
|
| 564 | + return $federatedUser->getUserId().$this->displayInstance($federatedUser->getInstance(), true); |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | /** |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | return ''; |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | - return (($showAt) ? '@' : '') . $instance; |
|
| 578 | + return (($showAt) ? '@' : '').$instance; |
|
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | $i = 1; |
| 491 | 491 | while (true) { |
| 492 | - $testDisplayName = $baseDisplayName . (($i > 1) ? ' (' . $i . ')' : ''); |
|
| 492 | + $testDisplayName = $baseDisplayName.(($i > 1) ? ' ('.$i.')' : ''); |
|
| 493 | 493 | $test = new Circle(); |
| 494 | 494 | $test->setDisplayName($testDisplayName); |
| 495 | 495 | |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | |
| 523 | 523 | $i = 1; |
| 524 | 524 | while (true) { |
| 525 | - $testSanitizedName = $baseSanitizedName . (($i > 1) ? '-' . $i : ''); |
|
| 525 | + $testSanitizedName = $baseSanitizedName.(($i > 1) ? '-'.$i : ''); |
|
| 526 | 526 | |
| 527 | 527 | $test = new Circle(); |
| 528 | 528 | $test->setSanitizedName($testSanitizedName); |
@@ -84,26 +84,26 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | // specific value |
| 87 | - const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 88 | - const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 89 | - const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 87 | + const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 88 | + const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 89 | + const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 90 | 90 | |
| 91 | 91 | // bitwise |
| 92 | - const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 93 | - const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 94 | - const CFG_OPEN = 16; // Circle is open, people can join |
|
| 95 | - const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 96 | - const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 97 | - const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 98 | - const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 99 | - const CFG_NO_OWNER = 512; // no owner, only members |
|
| 100 | - const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 101 | - const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 102 | - const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 103 | - const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 104 | - const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 105 | - const CFG_FEDERATED = 32768; // Federated |
|
| 106 | - const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 92 | + const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 93 | + const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 94 | + const CFG_OPEN = 16; // Circle is open, people can join |
|
| 95 | + const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 96 | + const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 97 | + const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 98 | + const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 99 | + const CFG_NO_OWNER = 512; // no owner, only members |
|
| 100 | + const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 101 | + const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 102 | + const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 103 | + const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 104 | + const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 105 | + const CFG_FEDERATED = 32768; // Federated |
|
| 106 | + const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 107 | 107 | |
| 108 | 108 | public static $DEF_CFG_MAX = 131071; |
| 109 | 109 | |
@@ -742,23 +742,23 @@ discard block |
||
| 742 | 742 | * @throws CircleNotFoundException |
| 743 | 743 | */ |
| 744 | 744 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 745 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
| 745 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
| 746 | 746 | throw new CircleNotFoundException(); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
| 750 | - ->setName($this->get($prefix . 'name', $data)) |
|
| 751 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
| 752 | - ->setSanitizedName($this->get($prefix . 'sanitized_name', $data)) |
|
| 753 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
| 754 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
| 755 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
| 756 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
| 757 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
| 758 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
| 759 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
| 760 | - |
|
| 761 | - $creation = $this->get($prefix . 'creation', $data); |
|
| 749 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
| 750 | + ->setName($this->get($prefix.'name', $data)) |
|
| 751 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
| 752 | + ->setSanitizedName($this->get($prefix.'sanitized_name', $data)) |
|
| 753 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
| 754 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
| 755 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
| 756 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
| 757 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
| 758 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
| 759 | + ->setDescription($this->get($prefix.'description', $data)); |
|
| 760 | + |
|
| 761 | + $creation = $this->get($prefix.'creation', $data); |
|
| 762 | 762 | $this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp()); |
| 763 | 763 | |
| 764 | 764 | $this->getManager()->manageImportFromDatabase($this, $data, $prefix); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | if ($check) { |
| 394 | 394 | $user = $this->userManager->get($userId); |
| 395 | 395 | if ($user === null) { |
| 396 | - throw new FederatedUserNotFoundException('user ' . $userId . ' not found'); |
|
| 396 | + throw new FederatedUserNotFoundException('user '.$userId.' not found'); |
|
| 397 | 397 | } |
| 398 | 398 | $userId = $user->getUID(); |
| 399 | 399 | } |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | $prefix = ($federatedUser->getUserType() === Member::TYPE_APP) ? 'app' |
| 832 | 832 | : Member::$TYPE[$federatedUser->getUserType()]; |
| 833 | 833 | |
| 834 | - $circle->setName($prefix . ':' . $federatedUser->getUserId() . ':' . $id) |
|
| 834 | + $circle->setName($prefix.':'.$federatedUser->getUserId().':'.$id) |
|
| 835 | 835 | ->setDisplayName($this->getLocalDisplayName($federatedUser)) |
| 836 | 836 | ->setSingleId($id) |
| 837 | 837 | ->setSource($source); |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | $owner = $this->getCurrentApp(); |
| 967 | 967 | |
| 968 | 968 | $circle = new Circle(); |
| 969 | - $circle->setName('group:' . $groupId) |
|
| 969 | + $circle->setName('group:'.$groupId) |
|
| 970 | 970 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
| 971 | 971 | ->setSingleId($this->token(ManagedModel::ID_LENGTH)) |
| 972 | 972 | ->setSource(Member::TYPE_GROUP); |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | $circle = $event->getCircle(); |
| 97 | 97 | $eventType = ($event->getType() === CircleGenericEvent::INVITED) ? 'invited' : 'joined'; |
| 98 | 98 | |
| 99 | - $info = 'A new member have been added (' . $eventType . ') to a Circle. '; |
|
| 99 | + $info = 'A new member have been added ('.$eventType.') to a Circle. '; |
|
| 100 | 100 | |
| 101 | - $info .= 'userId: ' . $member->getUserId() . '; userType: ' . Member::$TYPE[$member->getUserType( |
|
| 101 | + $info .= 'userId: '.$member->getUserId().'; userType: '.Member::$TYPE[$member->getUserType( |
|
| 102 | 102 | )] |
| 103 | - . '; singleId: ' . $member->getSingleId() . '; memberId: ' . $member->getId() |
|
| 104 | - . '; isLocal: ' . json_encode($member->isLocal()) . '; level: ' |
|
| 105 | - . Member::$DEF_LEVEL[$member->getLevel()] . '; '; |
|
| 103 | + . '; singleId: '.$member->getSingleId().'; memberId: '.$member->getId() |
|
| 104 | + . '; isLocal: '.json_encode($member->isLocal()).'; level: ' |
|
| 105 | + . Member::$DEF_LEVEL[$member->getLevel()].'; '; |
|
| 106 | 106 | |
| 107 | 107 | $memberships = array_map( |
| 108 | 108 | function(Membership $membership) { |
@@ -111,22 +111,22 @@ discard block |
||
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | $listMemberships = (count($memberships) > 0) ? implode(', ', $memberships) : 'none'; |
| 114 | - $info .= 'circleName: ' . $circle->getDisplayName() . '; circleId: ' . $circle->getSingleId() |
|
| 115 | - . '; Circle memberships: ' . $listMemberships . '.'; |
|
| 114 | + $info .= 'circleName: '.$circle->getDisplayName().'; circleId: '.$circle->getSingleId() |
|
| 115 | + . '; Circle memberships: '.$listMemberships.'.'; |
|
| 116 | 116 | |
| 117 | 117 | if ($member->getUserType() === Member::TYPE_CIRCLE) { |
| 118 | 118 | $basedOn = $member->getBasedOn(); |
| 119 | 119 | $members = array_map( |
| 120 | 120 | function(Member $member) { |
| 121 | - return $member->getUserId() . ' (' . Member::$TYPE[$member->getUserType()] . ')'; |
|
| 121 | + return $member->getUserId().' ('.Member::$TYPE[$member->getUserType()].')'; |
|
| 122 | 122 | }, $basedOn->getInheritedMembers() |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - $info .= ' Member is a Circle (singleId: ' . $basedOn->getSingleId() |
|
| 126 | - . ') that contains those inherited members: ' . implode(', ', $members); |
|
| 125 | + $info .= ' Member is a Circle (singleId: '.$basedOn->getSingleId() |
|
| 126 | + . ') that contains those inherited members: '.implode(', ', $members); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - $this->log(3, $prefix . $info); |
|
| 129 | + $this->log(3, $prefix.$info); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |