src/Shell/Task/SyncLdapGroupsTask.php
protected function getGroups(Table $table): array
    {
        /**
         * @var \Cake\ORM\Query $query
         */
        $query = $table->find('all')
            ->where(['remote_group_id IS NOT NULL', 'remote_group_id !=' => ''])
            ->contain(['Users' => function ($q) {
                return $q->select(['Users.username']);
            }]);
        /**
         * @var array $result
         */
        $result = $query->all();

        return $result;
    }
protected function getGroups(Table $table): array
    {
        /**
         * @var \Cake\ORM\Query $query
         */
        $query = $table->find('all')
            ->where(['remote_group_id IS NOT NULL', 'remote_group_id !=' => ''])
            ->contain(['Users' => function ($q) {
                return $q->select(['Users.username']);
            }]);
        /**
         * @var array $result
         */
        $result = $query->all();

        return $result;
    }
protected function getGroups ( Table $ table ) : array { /**
         * @var \Cake\ORM\Query $query
         */ $ query = $ table -> find ( 'all' ) -> where ( [ 'remote_group_id IS NOT NULL' , 'remote_group_id !=' => '' ] ) -> contain ( [ 'Users' => function ( $ q ) { return $ q -> select ( [ 'Users.username' ] ) ; } ] ) ; /**
         * @var array $result
         */ $ result = $ query -> all ( ) ; return $ result ; }
Fetch system groups which are mapped to LDAP group.

@param \Cake\ORM\Table $table Table instance
@return mixed[]
Fetch system groups which are mapped to LDAP group .