Code Duplication    Length = 39-39 lines in 2 locations

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

@@ 847-885 (lines=39) @@
844
     *
845
     * @return array
846
     */
847
    public function loadAutogeneratedEntry($action, $parentId = null)
848
    {
849
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
850
        $query = $this->dbHandler->createSelectQuery();
851
        $query->select(
852
            '*'
853
        )->from(
854
            $this->dbHandler->quoteTable($this->table)
855
        )->where(
856
            $query->expr->lAnd(
857
                $query->expr->eq(
858
                    $this->dbHandler->quoteColumn('action'),
859
                    $query->bindValue($action, null, \PDO::PARAM_STR)
860
                ),
861
                $query->expr->eq(
862
                    $this->dbHandler->quoteColumn('is_original'),
863
                    $query->bindValue(1, null, \PDO::PARAM_INT)
864
                ),
865
                $query->expr->eq(
866
                    $this->dbHandler->quoteColumn('is_alias'),
867
                    $query->bindValue(0, null, \PDO::PARAM_INT)
868
                )
869
            )
870
        );
871
872
        if (isset($parentId)) {
873
            $query->where(
874
                $query->expr->eq(
875
                    $this->dbHandler->quoteColumn('parent'),
876
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
877
                )
878
            );
879
        }
880
881
        $statement = $query->prepare();
882
        $statement->execute();
883
884
        return $statement->fetch(\PDO::FETCH_ASSOC);
885
    }
886
887
    /**
888
     * Loads all data for the path identified by given $id.
@@ 1109-1147 (lines=39) @@
1106
     *
1107
     * @return array
1108
     */
1109
    public function loadAutogeneratedEntries($parentId, $includeHistory = false)
1110
    {
1111
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
1112
        $query = $this->dbHandler->createSelectQuery();
1113
        $query->select(
1114
            '*'
1115
        )->from(
1116
            $this->dbHandler->quoteTable($this->table)
1117
        )->where(
1118
            $query->expr->lAnd(
1119
                $query->expr->eq(
1120
                    $this->dbHandler->quoteColumn('parent'),
1121
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
1122
                ),
1123
                $query->expr->eq(
1124
                    $this->dbHandler->quoteColumn('action_type'),
1125
                    $query->bindValue('eznode', null, \PDO::PARAM_STR)
1126
                ),
1127
                $query->expr->eq(
1128
                    $this->dbHandler->quoteColumn('is_alias'),
1129
                    $query->bindValue(0, null, \PDO::PARAM_INT)
1130
                )
1131
            )
1132
        );
1133
1134
        if (!$includeHistory) {
1135
            $query->where(
1136
                $query->expr->eq(
1137
                    $this->dbHandler->quoteColumn('is_original'),
1138
                    $query->bindValue(1, null, \PDO::PARAM_INT)
1139
                )
1140
            );
1141
        }
1142
1143
        $statement = $query->prepare();
1144
        $statement->execute();
1145
1146
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
1147
    }
1148
1149
    public function getLocationContentMainLanguageId($locationId)
1150
    {