Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 597-617 (lines=21) @@
594
     *
595
     * @return int
596
     */
597
    public function getContentCount($stateId)
598
    {
599
        $query = $this->dbHandler->createSelectQuery();
600
        $query->select(
601
            $query->alias($query->expr->count('*'), 'count')
602
        )->from(
603
            $this->dbHandler->quoteTable('ezcobj_state_link')
604
        )->where(
605
            $query->expr->eq(
606
                $this->dbHandler->quoteColumn('contentobject_state_id'),
607
                $query->bindValue($stateId, null, \PDO::PARAM_INT)
608
            )
609
        );
610
611
        $statement = $query->prepare();
612
        $statement->execute();
613
614
        $count = $statement->fetchColumn();
615
616
        return $count !== null ? (int)$count : 0;
617
    }
618
619
    /**
620
     * Updates the object state priority to provided value.

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

@@ 1224-1244 (lines=21) @@
1221
     *
1222
     * @return array
1223
     */
1224
    public function loadTrashByLocation($locationId)
1225
    {
1226
        $query = $this->handler->createSelectQuery();
1227
        $query
1228
            ->select('*')
1229
            ->from($this->handler->quoteTable('ezcontentobject_trash'))
1230
            ->where(
1231
                $query->expr->eq(
1232
                    $this->handler->quoteColumn('node_id'),
1233
                    $query->bindValue($locationId)
1234
                )
1235
            );
1236
        $statement = $query->prepare();
1237
        $statement->execute();
1238
1239
        if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
1240
            return $row;
1241
        }
1242
1243
        throw new NotFound('trash', $locationId);
1244
    }
1245
1246
    /**
1247
     * List trashed items.