Code Duplication    Length = 20-24 lines in 2 locations

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

@@ 549-568 (lines=20) @@
546
     * @param string $textMD5
547
     * @param array $values associative array with column names as keys and column values as values
548
     */
549
    public function updateRow($parentId, $textMD5, array $values)
550
    {
551
        /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */
552
        $query = $this->dbHandler->createUpdateQuery();
553
        $query->update($this->dbHandler->quoteTable($this->table));
554
        $this->setQueryValues($query, $values);
555
        $query->where(
556
            $query->expr->lAnd(
557
                $query->expr->eq(
558
                    $this->dbHandler->quoteColumn('parent'),
559
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
560
                ),
561
                $query->expr->eq(
562
                    $this->dbHandler->quoteColumn('text_md5'),
563
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
564
                )
565
            )
566
        );
567
        $query->prepare()->execute();
568
    }
569
570
    /**
571
     * Inserts new row in urlalias_ml table.
@@ 699-722 (lines=24) @@
696
     *
697
     * @return array
698
     */
699
    public function loadRow($parentId, $textMD5)
700
    {
701
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
702
        $query = $this->dbHandler->createSelectQuery();
703
        $query->select('*')->from(
704
            $this->dbHandler->quoteTable($this->table)
705
        )->where(
706
            $query->expr->lAnd(
707
                $query->expr->eq(
708
                    $this->dbHandler->quoteColumn('parent'),
709
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
710
                ),
711
                $query->expr->eq(
712
                    $this->dbHandler->quoteColumn('text_md5'),
713
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
714
                )
715
            )
716
        );
717
718
        $statement = $query->prepare();
719
        $statement->execute();
720
721
        return $statement->fetch(\PDO::FETCH_ASSOC);
722
    }
723
724
    /**
725
     * Loads complete URL alias data by given array of path hashes.