Code Duplication    Length = 20-24 lines in 2 locations

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

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