Code Duplication    Length = 20-24 lines in 2 locations

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

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