original_string: protected function checkGroups( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupcodes )
  	{
  		$manager = \Aimeos\MShop::create( $context, 'customer/group' );
  
  		$search = $manager->createSearch();
  		$search->setConditions( $search->compare( '==', 'customer.group.code', (array) $groupcodes ) );
  		$groupItems = $manager->searchItems( $search );
  
  
  		$manager = \Aimeos\MShop::create( $context, 'customer/lists' );
  
  		$search = $manager->createSearch();
  		$expr = array(
  			$search->compare( '==', 'customer.lists.parentid', $userid ),
  			$search->compare( '==', 'customer.lists.refid', array_keys( $groupItems ) ),
  			$search->compare( '==', 'customer.lists.domain', 'customer/group' ),
  		);
  		$search->setConditions( $search->combine( '&&', $expr ) );
  		$search->setSlice( 0, 1 );
  
  		return (bool) count( $manager->searchItems( $search ) );
  	}
code: protected function checkGroups( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupcodes )
  	{
  		$manager = \Aimeos\MShop::create( $context, 'customer/group' );
  
  		$search = $manager->createSearch();
  		$search->setConditions( $search->compare( '==', 'customer.group.code', (array) $groupcodes ) );
  		$groupItems = $manager->searchItems( $search );
  
  
  		$manager = \Aimeos\MShop::create( $context, 'customer/lists' );
  
  		$search = $manager->createSearch();
  		$expr = array(
  			$search->compare( '==', 'customer.lists.parentid', $userid ),
  			$search->compare( '==', 'customer.lists.refid', array_keys( $groupItems ) ),
  			$search->compare( '==', 'customer.lists.domain', 'customer/group' ),
  		);
  		$search->setConditions( $search->combine( '&&', $expr ) );
  		$search->setSlice( 0, 1 );
  
  		return (bool) count( $manager->searchItems( $search ) );
  	}
code_tokens: protected function checkGroups ( \ Aimeos \ MShop \ Context \ Item \ Iface $ context , $ userid , $ groupcodes ) { $ manager = \ Aimeos \ MShop :: create ( $ context , 'customer/group' ) ; $ search = $ manager -> createSearch ( ) ; $ search -> setConditions ( $ search -> compare ( '==' , 'customer.group.code' , ( array ) $ groupcodes ) ) ; $ groupItems = $ manager -> searchItems ( $ search ) ; $ manager = \ Aimeos \ MShop :: create ( $ context , 'customer/lists' ) ; $ search = $ manager -> createSearch ( ) ; $ expr = array ( $ search -> compare ( '==' , 'customer.lists.parentid' , $ userid ) , $ search -> compare ( '==' , 'customer.lists.refid' , array_keys ( $ groupItems ) ) , $ search -> compare ( '==' , 'customer.lists.domain' , 'customer/group' ) , ) ; $ search -> setConditions ( $ search -> combine ( '&&' , $ expr ) ) ; $ search -> setSlice ( 0 , 1 ) ; return ( bool ) count ( $ manager -> searchItems ( $ search ) ) ; }
docstring: Checks if one of the groups is associated to the given user ID
  
  @param \Aimeos\MShop\Context\Item\Iface $context Context item
  @param string $userid ID of the logged in user
  @param string[] $groupcodes List of group codes to check against
  @return boolean True if the user is in one of the groups, false if not
docstring_tokens: Checks if one of the groups is associated to the given user ID