@param string $id
@param string $group

@return bool
546349
public function rtcExists(string $id, string $group = '_default'): bool
    {
        if (!$this->rtcGroupExists($group)) {
            return false;
        }

        return array_key_exists($id, $this->runtimeCache[$group]);
    }
147998
public function isEqualTo(GroupInterface $group): bool
    {
        return is_a($group, Production::class) && $this->id === $group->getId();
    }
711138
function remove($id, $group = 'default', $checkbeforeunlink = false)
    {
        $this->_setFileName($id, $group);
        if ($this->_memoryCaching) {
            if (isset($this->_memoryCachingArray[$this->_file])) {
                unset($this->_memoryCachingArray[$this->_file]);
                $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1;
            }
            if ($this->_onlyMemoryCaching) {
                return true;
            }
        }
        if ( $checkbeforeunlink ) {
            if (!file_exists($this->_file)) return true;
        }
        return $this->_unlink($this->_file);
    }
343422
public function hasError($key, $group = null)
    {
        return !empty($this->validator->getErrors($key, $group));
    }
697687
public function findByGroup(Group $group)
    {
        return $this->createQueryBuilder('o')
            ->select('o.id', 'o.name')
            ->join('o.groups', 'g')
            ->where('g = :group')
            ->groupBy('o.id')
            ->setParameter(':group', $group)
            ->getQuery()
            ->getArrayResult();
    }
315990
public function get_group($groupid) {
        $groups = $this->get_all_groups();
        if (!array_key_exists($groupid, $groups)) {
            return false;
        }
        return $groups[$groupid];
    }
98477
public function delete($id)
    {
        if (!is_numeric($id)) {
            $this->setError('参数错误,分组ID不是数字');

            return false;
        }

        $queryStr = [
            'group' => ['id' => $id],
        ];

        $res = $this->_post('delete', $queryStr);

        return $res;
    }
701271
public static function key($group, $id)
    {
        if (!empty($id)) {
            return trim($group, '/') . '/' . trim($id, '/');
        } else {
            return trim($group, '/');
        }
    }
1100502
public function delete($key, $group = self::DEFAULT_GROUP) {
        $this->repository
            ->deleteByKey($key, $group);

        return true;
    }
126329
public function share_with_group(string $id, string $id_group, bool $cancel = false): ?int
  {
    if ( $cfg = $this->get($id) ){

      $id_share = $this->db->select_one($this->class_table, $this->fields['id'], [
        'id_alias' => $id,
        'id_group' => $id_group
      ]);
      if ( $cancel && $id_share ){
        return $this->db->delete($this->class_table, [$this->fields['id'] => $id_share]);
      }
      else if ( !$cancel && !$id_share ){
        return $this->db->insert($this->class_table, [
          'id_option' => $cfg['id_option'],
          'id_alias' => $id,
          'id_group' => $id_group
        ]);
      }
      return 0;
    }
    return null;
  }
682033
public function findByGroup(Group $group)
    {
        $query = $this->createQueryBuilder('a')
                      ->innerjoin('a.groups', 'g')
                      ->where('g.id = :group')
                      ->setParameter('group', $group->getId());
        return $query->getQuery()->getResult();
     }
318287
public function isLeaderOf($group): bool
    {
        $group = $this->resolveGroup($group);

        return $this->leadingGroups()->where('group_id', is_int($group) ? $group : $group->id)->exists();
    }
781832
public function hasGroupPermissionSelected(Group $group)
    {
        $definition = (new Query())->select("inheritance")->from("cms_nav_permission")->where(['group_id' => $group->id, 'nav_id' => $this->id])->one();
        
        if ($definition) {
            return true;
        }
        
        return false;
    }
115751
public function has($id) {
		if(array_key_exists($id, $this->instances)) {
			return true;
		}

		return $this->parent !== null ? $this->parent->has($id) : false;
	}
136043
public function deleteGroup($group_id)
    {
        $url = "https://api.weixin.qq.com/shakearound/device/group/delete?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['group_id' => $group_id]);
    }
1338819
public function inGroup($group = null) {
    if (is_numeric($group)) {
      $group = Group::factory((int) $group);
    }
    if (!isset($group->guid)) {
      return false;
    }
    return ($group->inArray((array) $this->groups) || $group->is($this->group));
  }
557050
public function addGroup($group) {
    if (!$group->inArray((array) $this->groups)) {
      $this->groups[] = $group;
      return $this->groups;
    }
    return true;
  }