Code Duplication    Length = 27-27 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/Section/Gateway/DoctrineDatabase.php 1 location

@@ 254-280 (lines=27) @@
251
     *
252
     * @return int
253
     */
254
    public function countRoleAssignmentsUsingSection($id)
255
    {
256
        $query = $this->dbHandler->createSelectQuery();
257
        $query->select(
258
            $query->expr->count(
259
                $this->dbHandler->quoteColumn('id', 'ezuser_role')
260
            )
261
        )->from(
262
            $this->dbHandler->quoteTable('ezuser_role')
263
        )->where(
264
            $query->expr->lAnd(
265
                $query->expr->eq(
266
                    $this->dbHandler->quoteColumn('limit_identifier', 'ezuser_role'),
267
                    $query->bindValue('Section', null, \PDO::PARAM_STR)
268
                ),
269
                $query->expr->eq(
270
                    $this->dbHandler->quoteColumn('limit_value', 'ezuser_role'),
271
                    $query->bindValue($id, null, \PDO::PARAM_INT)
272
                )
273
            )
274
        );
275
276
        $statement = $query->prepare();
277
        $statement->execute();
278
279
        return (int)$statement->fetchColumn();
280
    }
281
282
    /**
283
     * Deletes the Section with $id.

eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabase.php 1 location

@@ 577-603 (lines=27) @@
574
     *
575
     * @return array
576
     */
577
    public function loadObjectStateDataForContent($contentId, $stateGroupId)
578
    {
579
        $query = $this->createObjectStateFindQuery();
580
        $query->innerJoin(
581
            $this->dbHandler->quoteTable('ezcobj_state_link'),
582
            $query->expr->eq(
583
                $this->dbHandler->quoteColumn('id', 'ezcobj_state'),
584
                $this->dbHandler->quoteColumn('contentobject_state_id', 'ezcobj_state_link')
585
            )
586
        )->where(
587
            $query->expr->lAnd(
588
                $query->expr->eq(
589
                    $this->dbHandler->quoteColumn('group_id', 'ezcobj_state'),
590
                    $query->bindValue($stateGroupId, null, \PDO::PARAM_INT)
591
                ),
592
                $query->expr->eq(
593
                    $this->dbHandler->quoteColumn('contentobject_id', 'ezcobj_state_link'),
594
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
595
                )
596
            )
597
        );
598
599
        $statement = $query->prepare();
600
        $statement->execute();
601
602
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
603
    }
604
605
    /**
606
     * Returns the number of objects which are in this state.