Code Duplication    Length = 20-24 lines in 2 locations

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

@@ 570-589 (lines=20) @@
567
     * @param string $textMD5
568
     * @param array $values associative array with column names as keys and column values as values
569
     */
570
    public function updateRow($parentId, $textMD5, array $values)
571
    {
572
        /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */
573
        $query = $this->dbHandler->createUpdateQuery();
574
        $query->update($this->dbHandler->quoteTable($this->table));
575
        $this->setQueryValues($query, $values);
576
        $query->where(
577
            $query->expr->lAnd(
578
                $query->expr->eq(
579
                    $this->dbHandler->quoteColumn('parent'),
580
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
581
                ),
582
                $query->expr->eq(
583
                    $this->dbHandler->quoteColumn('text_md5'),
584
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
585
                )
586
            )
587
        );
588
        $query->prepare()->execute();
589
    }
590
591
    /**
592
     * Inserts new row in urlalias_ml table.
@@ 720-743 (lines=24) @@
717
     *
718
     * @return array
719
     */
720
    public function loadRow($parentId, $textMD5)
721
    {
722
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
723
        $query = $this->dbHandler->createSelectQuery();
724
        $query->select('*')->from(
725
            $this->dbHandler->quoteTable($this->table)
726
        )->where(
727
            $query->expr->lAnd(
728
                $query->expr->eq(
729
                    $this->dbHandler->quoteColumn('parent'),
730
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
731
                ),
732
                $query->expr->eq(
733
                    $this->dbHandler->quoteColumn('text_md5'),
734
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
735
                )
736
            )
737
        );
738
739
        $statement = $query->prepare();
740
        $statement->execute();
741
742
        return $statement->fetch(\PDO::FETCH_ASSOC);
743
    }
744
745
    /**
746
     * Loads complete URL alias data by given array of path hashes.