src/Classes/AdldapGroups.php
public function search($sAMAaccountType = Adldap::ADLDAP_SECURITY_GLOBAL_GROUP, $select = [], $sorted = true)
    {
        $search = $this->adldap->search()
            ->select($select)
            ->where('objectCategory', '=', 'group');

        if ($sAMAaccountType !== null) {
            $search->where('samaccounttype', '=', $sAMAaccountType);
        }

        if ($sorted) {
            $search->sortBy('samaccountname', 'asc');
        }

        return $search->get();
    }
public function search($sAMAaccountType = Adldap::ADLDAP_SECURITY_GLOBAL_GROUP, $select = [], $sorted = true)
    {
        $search = $this->adldap->search()
            ->select($select)
            ->where('objectCategory', '=', 'group');

        if ($sAMAaccountType !== null) {
            $search->where('samaccounttype', '=', $sAMAaccountType);
        }

        if ($sorted) {
            $search->sortBy('samaccountname', 'asc');
        }

        return $search->get();
    }
public function search ( $ sAMAaccountType = Adldap :: ADLDAP_SECURITY_GLOBAL_GROUP , $ select = [ ] , $ sorted = true ) { $ search = $ this -> adldap -> search ( ) -> select ( $ select ) -> where ( 'objectCategory' , '=' , 'group' ) ; if ( $ sAMAaccountType !== null ) { $ search -> where ( 'samaccounttype' , '=' , $ sAMAaccountType ) ; } if ( $ sorted ) { $ search -> sortBy ( 'samaccountname' , 'asc' ) ; } return $ search -> get ( ) ; }
Returns a complete list of the groups in AD based on a SAM Account Type.

@param int   $sAMAaccountType The account type to return
@param array $select          The fields you want to retrieve for each
@param bool  $sorted          Whether to sort the results

@return array|bool
Returns a complete list of the groups in AD based on a SAM Account Type .