|
@@ 281-290 (lines=10) @@
|
| 278 |
|
* @param User $user |
| 279 |
|
* @return array |
| 280 |
|
*/ |
| 281 |
|
public function getBlocksSet(Project $project, User $user) |
| 282 |
|
{ |
| 283 |
|
$ipblocksTable = $this->getTableName($project->getDatabaseName(), 'ipblocks'); |
| 284 |
|
$sql = "SELECT * FROM $ipblocksTable WHERE ipb_by = :userId"; |
| 285 |
|
$resultQuery = $this->getProjectsConnection()->prepare($sql); |
| 286 |
|
$userId = $user->getId($project); |
| 287 |
|
$resultQuery->bindParam('userId', $userId); |
| 288 |
|
$resultQuery->execute(); |
| 289 |
|
return $resultQuery->fetchAll(); |
| 290 |
|
} |
| 291 |
|
|
| 292 |
|
/** |
| 293 |
|
* Get data for all blocks set on the given user. |
|
@@ 298-307 (lines=10) @@
|
| 295 |
|
* @param User $user |
| 296 |
|
* @return array |
| 297 |
|
*/ |
| 298 |
|
public function getBlocksReceived(Project $project, User $user) |
| 299 |
|
{ |
| 300 |
|
$ipblocksTable = $this->getTableName($project->getDatabaseName(), 'ipblocks'); |
| 301 |
|
$sql = "SELECT * FROM $ipblocksTable WHERE ipb_user = :userId"; |
| 302 |
|
$resultQuery = $this->getProjectsConnection()->prepare($sql); |
| 303 |
|
$userId = $user->getId($project); |
| 304 |
|
$resultQuery->bindParam('userId', $userId); |
| 305 |
|
$resultQuery->execute(); |
| 306 |
|
return $resultQuery->fetchAll(); |
| 307 |
|
} |
| 308 |
|
|
| 309 |
|
/** |
| 310 |
|
* Get a user's total edit count on all projects. |