Checks if a group has the given preference

@param string $id_option
@param string $id_group
@return bool
188328
public function group_has(string $id_option, string $id_group): bool
  {
    return (bool)$this->_retrieve_ids($id_option, null, $id_group);
  }
1332399
public function options(string $id_option = null, string $type = 'page'): ?array
  {
    if (
      ($id_option = $this->_get_id_option($id_option, $type)) &&
      ($os = $this->opt->options(\func_get_args()))
    ){
      $res = [];
      foreach ( $os as $o ){
        if ( $this->pref->has($o['id']) ){
          $res[] = $o;
        }
      }
      return $res;
    }
    return null;
  }
651319
public function has($id)
    {
        // second argument
        $withAutowiring = func_num_args() > 1 ? (bool) func_get_arg(1) :
            $this->autowiring;

        // return FALSE if $id not a string
        return is_string($id) && (
            // found in definitions ?
            isset($this->services[$id])  ||

            // Or in definition providers ?
            $this->hasInProvider($id) ||

            // Or with id autowired ?
            $this->autoWiringId($id, $withAutowiring)
        ) ? true : false;
    }
1338402
public function delete_user_option(string $id_option, string $id_user = null): ?int
  {
    if ( $id_option = $this->_get_id_option($id_option) ){
      return $this->db->delete($this->class_cfg['table'], [
        $this->fields['id_option'] => $id_option,
        $this->fields['id_user'] => $id_user ?: $this->id_user
      ]);
    }
    return null;
  }
947199
public function has($id) {
		foreach($this->values as $container) {
			if($container->has($id)) {
				return true;
			}
		}
		return false;
	}
619656
private function checkOptGroup($options, $class, $style)
    {
        foreach ($options as $option) {
            // If it is an option group, handle it.
            if (!isset($option['value'])) {
                $result = $this->checkOptGroup($option, $class, $style);
                if ($result) {
                    return $result;
                }

                continue;
            }

            // No option group, check if it is selected.
            if ($this->isSelected($option)) {
                return sprintf(
                    '<input type="hidden" id="ctrl_%s" name="%s" value="%s" /><span%s>%s</span>',
                    $this->strId,
                    $this->strName,
                    StringUtil::specialchars($option['value']),
                    $class . $style,
                    $option['label']
                );
            }
        }

        return null;
    }
1199299
public function removeGroup($id_group)
    {
        try {

            $this->db->beginTransaction();

            // Delete usergroup
            $this->db->qb([
                'table' => 'core_groups',
                'method' => 'DELETE',
                'filter' => 'id_group = :id_group',
                'params' => [
                    ':id_group' => $id_group
                ]
            ]);
            $this->db->execute();

            // Delete permissions related to this group
            $this->db->qb([
                'table' => 'core_permissions',
                'method' => 'DELETE',
                'filter' => 'id_group = :id_group',
                'params' => [
                    ':id_group' => $id_group
                ]
            ]);
            $this->db->execute();

            // Remove group from current grouplist
            unset($this->groups[$id_group]);

            $this->db->endTransaction();
        }
        catch (\PDOException $e) {

            $this->db->cancelTransaction();

            Throw new GroupException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }
    }
697158
public function full_options(string $id_option = null, string $type = 'page'): ?array
  {
    if (
      ($id_option = $this->_get_id_option($id_option, $type)) &&
      ($os = $this->opt->full_options(\func_get_args()))
    ){
      $res = [];
      foreach ( $os as $o ){
        if ( ($ids = $this->pref->retrieve_ids($o['id'])) && ($cfg = $this->pref->get($ids[0])) ){
          $res[] = bbn\x::merge_arrays($o, $cfg);
        }
      }
      return $res;
    }
    return null;
  }
660937
public function hasConsumptionPreferenceCategory($preference)
    {
        return ! is_null($this->findConsumptionPreferenceCategoryName($preference)) || ! is_null($this->findConsumptionPreferenceCategoryById($preference));
    }
988972
public function has(string $type, string $id): bool
    {
        return array_key_exists($this->buildArrayKey($type, $id), $this->collection);
    }
929654
public function retrieve_group_ids(string $id_option = null, string $id_group): ?array
  {
    return $this->_retrieve_ids($id_option, null, $id_group);
  }
969547
private boolean isNewGroup(final OptGroup currentOptGroup)
	{
		return (last == null) || !currentOptGroup.getLabel().equals(last.getLabel());
	}
1365799
public function add(string $id_option, string $type = 'page'): ?int
  {
    if ( $id_option = $this->_get_id_option($id_option, $type) ){
      return $this->pref->set_by_option($id_option, []);
    }
    return null;
  }
732044
def is_group_valid(self, groupID):
        
        cur = self.conn.cursor()
        cur.execute('SELECT * FROM groups WHERE id=? LIMIT 1', [groupID])
        results = cur.fetchall()
        cur.close()

        logging.debug('is_group_valid(groupID={}) => {}'.format(groupID, True if len(results) else False))
        return len(results) > 0
836187
function user_ingroup($username,$group,$recursive=NULL){
        if ($username==NULL){ return (false); }
        if ($group==NULL){ return (false); }
        if (!$this->_bind){ return (false); }
        if ($recursive==NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
        
        //get a list of the groups
        $groups=$this->user_groups($username,array($this->_group_attribute),$recursive);
        
        //return true if the specified group is in the group list
        if (in_array($group,$groups)){ return (true); }

        return (false);
    }
402382
public static function group_has_fields($group_id) {
    global $wpdb;

    $sql = $wpdb->prepare("SELECT COUNT(1) FROM ".MF_TABLE_CUSTOM_FIELDS. " WHERE custom_group_id = %d",$group_id);

    return $wpdb->get_var( $sql ) > 0;
  }
1303794
public function isRequired() : Group
    {
        foreach ((array)$this as $el) {
            if (!is_object($el)) {
                continue;
            }
            $el->getElement()->attribute('required', 1);
        }
        return $this->addTest('required', function ($value) {
            foreach ($value as $option) {
                if ($option->getElement() instanceof Radio
                    && $option->getElement()->checked()
                ) {
                    return true;
                }
            }
            return false;
        });
    }