Code Duplication    Length = 20-24 lines in 2 locations

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

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