Code Duplication    Length = 20-24 lines in 2 locations

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

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