| @@ 51-62 (lines=12) @@ | ||
| 48 | 'businessUnits' => [] |
|
| 49 | ]; |
|
| 50 | ||
| 51 | if (!empty($options['businessUnits'])) { |
|
| 52 | if (is_array($options['businessUnits'])) { |
|
| 53 | /** @var BusinessUnit $businessUnit */ |
|
| 54 | foreach ($options['businessUnits'] as $businessUnit) { |
|
| 55 | if ($businessUnit instanceof BusinessUnit) { |
|
| 56 | $owners['businessUnits'][] = $businessUnit->getId(); |
|
| 57 | $needUpdate = true; |
|
| 58 | } |
|
| 59 | } |
|
| 60 | } |
|
| 61 | unset($options['businessUnits']); |
|
| 62 | } |
|
| 63 | ||
| 64 | if (!empty($options['owners'])) { |
|
| 65 | if (is_array($options['owners'])) { |
|
| @@ 64-75 (lines=12) @@ | ||
| 61 | unset($options['businessUnits']); |
|
| 62 | } |
|
| 63 | ||
| 64 | if (!empty($options['owners'])) { |
|
| 65 | if (is_array($options['owners'])) { |
|
| 66 | /** @var User $user */ |
|
| 67 | foreach ($options['owners'] as $user) { |
|
| 68 | if ($user instanceof User) { |
|
| 69 | $owners['users'][] = $user->getId(); |
|
| 70 | $needUpdate = true; |
|
| 71 | } |
|
| 72 | } |
|
| 73 | } |
|
| 74 | unset($options['owners']); |
|
| 75 | } |
|
| 76 | ||
| 77 | if ($needUpdate) { |
|
| 78 | $options['owners'] = $owners; |
|