| @@ 255-281 (lines=27) @@ | ||
| 252 | * |
|
| 253 | * @return int |
|
| 254 | */ |
|
| 255 | public function countRoleAssignmentsUsingSection($id) |
|
| 256 | { |
|
| 257 | $query = $this->dbHandler->createSelectQuery(); |
|
| 258 | $query->select( |
|
| 259 | $query->expr->count( |
|
| 260 | $this->dbHandler->quoteColumn('id', 'ezuser_role') |
|
| 261 | ) |
|
| 262 | )->from( |
|
| 263 | $this->dbHandler->quoteTable('ezuser_role') |
|
| 264 | )->where( |
|
| 265 | $query->expr->lAnd( |
|
| 266 | $query->expr->eq( |
|
| 267 | $this->dbHandler->quoteColumn('limit_identifier', 'ezuser_role'), |
|
| 268 | $query->bindValue('Section', null, \PDO::PARAM_STR) |
|
| 269 | ), |
|
| 270 | $query->expr->eq( |
|
| 271 | $this->dbHandler->quoteColumn('limit_value', 'ezuser_role'), |
|
| 272 | $query->bindValue($id, null, \PDO::PARAM_INT) |
|
| 273 | ) |
|
| 274 | ) |
|
| 275 | ); |
|
| 276 | ||
| 277 | $statement = $query->prepare(); |
|
| 278 | $statement->execute(); |
|
| 279 | ||
| 280 | return (int)$statement->fetchColumn(); |
|
| 281 | } |
|
| 282 | ||
| 283 | /** |
|
| 284 | * Deletes the Section with $id. |
|
| @@ 579-605 (lines=27) @@ | ||
| 576 | * |
|
| 577 | * @return array |
|
| 578 | */ |
|
| 579 | public function loadObjectStateDataForContent($contentId, $stateGroupId) |
|
| 580 | { |
|
| 581 | $query = $this->createObjectStateFindQuery(); |
|
| 582 | $query->innerJoin( |
|
| 583 | $this->dbHandler->quoteTable('ezcobj_state_link'), |
|
| 584 | $query->expr->eq( |
|
| 585 | $this->dbHandler->quoteColumn('id', 'ezcobj_state'), |
|
| 586 | $this->dbHandler->quoteColumn('contentobject_state_id', 'ezcobj_state_link') |
|
| 587 | ) |
|
| 588 | )->where( |
|
| 589 | $query->expr->lAnd( |
|
| 590 | $query->expr->eq( |
|
| 591 | $this->dbHandler->quoteColumn('group_id', 'ezcobj_state'), |
|
| 592 | $query->bindValue($stateGroupId, null, \PDO::PARAM_INT) |
|
| 593 | ), |
|
| 594 | $query->expr->eq( |
|
| 595 | $this->dbHandler->quoteColumn('contentobject_id', 'ezcobj_state_link'), |
|
| 596 | $query->bindValue($contentId, null, \PDO::PARAM_INT) |
|
| 597 | ) |
|
| 598 | ) |
|
| 599 | ); |
|
| 600 | ||
| 601 | $statement = $query->prepare(); |
|
| 602 | $statement->execute(); |
|
| 603 | ||
| 604 | return $statement->fetchAll(\PDO::FETCH_ASSOC); |
|
| 605 | } |
|
| 606 | ||
| 607 | /** |
|
| 608 | * Returns the number of objects which are in this state. |
|