| @@ 108-114 (lines=7) @@ | ||
| 105 | $user = $this->getUserContext()->getCurrentUser(); |
|
| 106 | $organization = $this->findOrganizationByName($name,false); |
|
| 107 | $repo = $this->getRepository('Organizations/Organization'); |
|
| 108 | if(!$organization instanceof Organization){ |
|
| 109 | ||
| 110 | $organization = new Organization(); |
|
| 111 | $organizationName = new OrganizationName($name); |
|
| 112 | $organization->setOrganizationName($organizationName); |
|
| 113 | $organization->setIsDraft(false); |
|
| 114 | } |
|
| 115 | /* @var OrganizationReference $orgReference */ |
|
| 116 | $orgReference = $user->getOrganization(); |
|
| 117 | $parent = $orgReference->getOrganization(); |
|
| @@ 295-299 (lines=5) @@ | ||
| 292 | $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization'); |
|
| 293 | $result = $repoOrganization->findByName($orgName); |
|
| 294 | $organization = count($result) > 0 ? $result[0]:null; |
|
| 295 | if(!$organization instanceof Organization){ |
|
| 296 | $organization = new Organization(); |
|
| 297 | $organizationName = new OrganizationName($orgName); |
|
| 298 | $organization->setOrganizationName($organizationName); |
|
| 299 | } |
|
| 300 | $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE); |
|
| 301 | $permissions = $organization->getPermissions(); |
|
| 302 | $permissions->grant($user,Permissions::PERMISSION_ALL); |
|