Code Duplication    Length = 16-18 lines in 4 locations

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

@@ 130-145 (lines=16) @@
127
     *
128
     * @return string[][]
129
     */
130
    public function loadAllSectionData()
131
    {
132
        $query = $this->dbHandler->createSelectQuery();
133
        $query->select(
134
            $this->dbHandler->quoteColumn('id'),
135
            $this->dbHandler->quoteColumn('identifier'),
136
            $this->dbHandler->quoteColumn('name')
137
        )->from(
138
            $this->dbHandler->quoteTable('ezsection')
139
        );
140
141
        $statement = $query->prepare();
142
        $statement->execute();
143
144
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
145
    }
146
147
    /**
148
     * Loads data for section with $identifier.

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

@@ 394-409 (lines=16) @@
391
     *
392
     * @param string $hash
393
     */
394
    public function expireUserToken($hash)
395
    {
396
        $query = $this->handler->createUpdateQuery();
397
        $query
398
            ->update($this->handler->quoteTable('ezuser_accountkey'))
399
            ->set(
400
                $this->handler->quoteColumn('time'),
401
                $query->bindValue(0)
402
            )->where(
403
                $query->expr->eq(
404
                    $this->handler->quoteColumn('hash_key'),
405
                    $query->bindValue($hash, null, \PDO::PARAM_STR)
406
                )
407
            );
408
        $query->prepare()->execute();
409
    }
410
411
    /**
412
     * Assigns role to user with given limitation.

eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.php 2 locations

@@ 466-483 (lines=18) @@
463
     * @param string $pathString
464
     * @param bool $isHidden
465
     */
466
    private function setNodeHiddenStatus(string $pathString, bool $isHidden): void
467
    {
468
        $query = $this->handler->createUpdateQuery();
469
        $query
470
            ->update($this->handler->quoteTable('ezcontentobject_tree'))
471
            ->set(
472
                $this->handler->quoteColumn('is_hidden'),
473
                $query->bindValue((int) $isHidden)
474
            )
475
            ->where(
476
                $query->expr->eq(
477
                    $this->handler->quoteColumn('path_string'),
478
                    $query->bindValue($pathString)
479
                )
480
            );
481
482
        $query->prepare()->execute();
483
    }
484
485
    /**
486
     * Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree.
@@ 986-1001 (lines=16) @@
983
     * @param mixed $contentId
984
     * @param mixed $versionNo
985
     */
986
    public function updateLocationsContentVersionNo($contentId, $versionNo)
987
    {
988
        $query = $this->handler->createUpdateQuery();
989
        $query->update(
990
            $this->handler->quoteTable('ezcontentobject_tree')
991
        )->set(
992
            $this->handler->quoteColumn('contentobject_version'),
993
            $query->bindValue($versionNo, null, \PDO::PARAM_INT)
994
        )->where(
995
            $query->expr->eq(
996
                $this->handler->quoteColumn('contentobject_id'),
997
                $contentId
998
            )
999
        );
1000
        $query->prepare()->execute();
1001
    }
1002
1003
    /**
1004
     * Searches for the main nodeId of $contentId in $versionId.