Code Duplication    Length = 20-24 lines in 2 locations

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

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