|
@@ 251-265 (lines=15) @@
|
| 248 |
|
/** |
| 249 |
|
* @param IQueryBuilder $qb |
| 250 |
|
*/ |
| 251 |
|
protected function linkToCircleOwner(IQueryBuilder &$qb) { |
| 252 |
|
$expr = $qb->expr(); |
| 253 |
|
|
| 254 |
|
$qb->selectAlias('mo.user_id', 'circle_owner'); |
| 255 |
|
/** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 256 |
|
$qb->leftJoin( |
| 257 |
|
'c', CoreRequestBuilder::TABLE_MEMBERS, 'mo', $expr->andX( |
| 258 |
|
$expr->eq( |
| 259 |
|
'mo.circle_id', |
| 260 |
|
$qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')') |
| 261 |
|
), $expr->eq('mo.user_type', $qb->createNamedParameter(Member::TYPE_USER)), |
| 262 |
|
$expr->eq('mo.level', $qb->createNamedParameter(Member::LEVEL_OWNER)) |
| 263 |
|
) |
| 264 |
|
); |
| 265 |
|
} |
| 266 |
|
|
| 267 |
|
|
| 268 |
|
/** |
|
@@ 327-347 (lines=21) @@
|
| 324 |
|
* |
| 325 |
|
* @return \OCP\DB\QueryBuilder\ICompositeExpression |
| 326 |
|
*/ |
| 327 |
|
private function exprLinkToMemberAsGroupMember(IQueryBuilder &$qb, $userId) { |
| 328 |
|
$expr = $qb->expr(); |
| 329 |
|
|
| 330 |
|
/** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 331 |
|
$qb->leftJoin( |
| 332 |
|
'c', CoreRequestBuilder::TABLE_GROUPS, 'g', |
| 333 |
|
$expr->andX( |
| 334 |
|
$expr->eq( |
| 335 |
|
'g.circle_id', |
| 336 |
|
$qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')') |
| 337 |
|
) |
| 338 |
|
) |
| 339 |
|
); |
| 340 |
|
|
| 341 |
|
$qb->leftJoin( |
| 342 |
|
'g', CoreRequestBuilder::NC_TABLE_GROUP_USER, 'ncgu', |
| 343 |
|
$expr->eq('ncgu.gid', 'g.group_id') |
| 344 |
|
); |
| 345 |
|
|
| 346 |
|
return $expr->andX($expr->eq('ncgu.uid', $qb->createNamedParameter($userId))); |
| 347 |
|
} |
| 348 |
|
|
| 349 |
|
|
| 350 |
|
/** |