Web_Site/cloud.home.yimian.xyz/lib/private/Group/Database.php
/**
	 * is user in group?
	 * @param string $uid uid of the user
	 * @param string $gid gid of the group
	 * @return bool
	 *
	 * Checks whether the user is member of a group or not.
	 */


Checks whether the user is member of a group or not.
Checks whether the user is member of a group or not .
public function inGroup( $uid, $gid ) {
		$this->fixDI();
		$qb = $this->dbConn->getQueryBuilder();
		$cursor = $qb->select('uid')
			->from('group_user')
			->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid)))
			->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($uid)))
			->execute();
		$result = $cursor->fetch();
		$cursor->closeCursor();
		return $result ? true : false;
	}
public function inGroup ( $ uid , $ gid ) { $ this -> fixDI ( ) ; $ qb = $ this -> dbConn -> getQueryBuilder ( ) ; $ cursor = $ qb -> select ( 'uid' ) -> from ( 'group_user' ) -> where ( $ qb -> expr ( ) -> eq ( 'gid' , $ qb -> createNamedParameter ( $ gid ) ) ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'uid' , $ qb -> createNamedParameter ( $ uid ) ) ) -> execute ( ) ; $ result = $ cursor -> fetch ( ) ; $ cursor -> closeCursor ( ) ; return $ result ? true : false ; }
is user in group?
is user in group?
// check