src/Shell/Task/SyncLdapGroupsTask.php
protected function syncGroupUsers(Table $table, EntityInterface $group, array $users): bool
    {
        $userIds = [];
        foreach ($users as $user) {
            $userIds[] = $user->id;
        }

        if (!empty($group->users)) {
            foreach ($group->users as $user) {
                $userIds[] = $user->id;
            }
        }

        $data = [
            'users' => [
                '_ids' => $userIds
            ]
        ];

        $group = $table->patchEntity($group, $data);
        $result = empty($table) ? false : true;

        return $result;
    }
protected function syncGroupUsers(Table $table, EntityInterface $group, array $users): bool
    {
        $userIds = [];
        foreach ($users as $user) {
            $userIds[] = $user->id;
        }

        if (!empty($group->users)) {
            foreach ($group->users as $user) {
                $userIds[] = $user->id;
            }
        }

        $data = [
            'users' => [
                '_ids' => $userIds
            ]
        ];

        $group = $table->patchEntity($group, $data);
        $result = empty($table) ? false : true;

        return $result;
    }
protected function syncGroupUsers ( Table $ table , EntityInterface $ group , array $ users ) : bool { $ userIds = [ ] ; foreach ( $ users as $ user ) { $ userIds [ ] = $ user -> id ; } if ( ! empty ( $ group -> users ) ) { foreach ( $ group -> users as $ user ) { $ userIds [ ] = $ user -> id ; } } $ data = [ 'users' => [ '_ids' => $ userIds ] ] ; $ group = $ table -> patchEntity ( $ group , $ data ) ; $ result = empty ( $ table ) ? false : true ; return $ result ; }
Synchronizes group users based on mapped LDAP group users.

@param \Cake\ORM\Table $table Table instance
@param \Cake\Datasource\EntityInterface $group Group entity
@param mixed[] $users Group users
@return bool
Synchronizes group users based on mapped LDAP group users .