Code Duplication    Length = 12-13 lines in 2 locations

eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php 1 location

@@ 291-302 (lines=12) @@
288
     *
289
     * @return \Doctrine\DBAL\Driver\Statement
290
     */
291
    private function getStatementContentSince(DateTime $since, $count = false)
292
    {
293
        $q = $this->connection->createQueryBuilder()
294
            ->select($count ? 'count(c.id)' : 'c.id')
295
            ->from('ezcontentobject', 'c')
296
            ->where('c.status = :status')->andWhere('c.modified >= :since')
297
            ->orderBy('c.modified')
298
            ->setParameter('status', ContentInfo::STATUS_PUBLISHED, PDO::PARAM_INT)
299
            ->setParameter('since', $since->getTimestamp(), PDO::PARAM_INT);
300
301
        return $q->execute();
302
    }
303
304
    /**
305
     * @param mixed $locationId

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

@@ 650-662 (lines=13) @@
647
        return $query;
648
    }
649
650
    private function markContentAsPublished(int $contentId, int $versionNo): void
651
    {
652
        $query = $this->connection->createQueryBuilder();
653
        $query
654
            ->update('ezcontentobject')
655
            ->set('status', ':status')
656
            ->set('current_version', ':versionNo')
657
            ->where('id =:contentId')
658
            ->setParameter('status', ContentInfo::STATUS_PUBLISHED, ParameterType::INTEGER)
659
            ->setParameter('versionNo', $versionNo, ParameterType::INTEGER)
660
            ->setParameter('contentId', $contentId, ParameterType::INTEGER);
661
        $query->execute();
662
    }
663
664
    /**
665
     * Inserts a new field.