Code Duplication    Length = 39-39 lines in 2 locations

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

@@ 805-843 (lines=39) @@
802
     *
803
     * @return array
804
     */
805
    public function loadAutogeneratedEntry($action, $parentId = null)
806
    {
807
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
808
        $query = $this->dbHandler->createSelectQuery();
809
        $query->select(
810
            '*'
811
        )->from(
812
            $this->dbHandler->quoteTable($this->table)
813
        )->where(
814
            $query->expr->lAnd(
815
                $query->expr->eq(
816
                    $this->dbHandler->quoteColumn('action'),
817
                    $query->bindValue($action, null, \PDO::PARAM_STR)
818
                ),
819
                $query->expr->eq(
820
                    $this->dbHandler->quoteColumn('is_original'),
821
                    $query->bindValue(1, null, \PDO::PARAM_INT)
822
                ),
823
                $query->expr->eq(
824
                    $this->dbHandler->quoteColumn('is_alias'),
825
                    $query->bindValue(0, null, \PDO::PARAM_INT)
826
                )
827
            )
828
        );
829
830
        if (isset($parentId)) {
831
            $query->where(
832
                $query->expr->eq(
833
                    $this->dbHandler->quoteColumn('parent'),
834
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
835
                )
836
            );
837
        }
838
839
        $statement = $query->prepare();
840
        $statement->execute();
841
842
        return $statement->fetch(\PDO::FETCH_ASSOC);
843
    }
844
845
    /**
846
     * Loads all data for the path identified by given $id.
@@ 1055-1093 (lines=39) @@
1052
     *
1053
     * @return array
1054
     */
1055
    public function loadAutogeneratedEntries($parentId, $includeHistory = false)
1056
    {
1057
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
1058
        $query = $this->dbHandler->createSelectQuery();
1059
        $query->select(
1060
            '*'
1061
        )->from(
1062
            $this->dbHandler->quoteTable($this->table)
1063
        )->where(
1064
            $query->expr->lAnd(
1065
                $query->expr->eq(
1066
                    $this->dbHandler->quoteColumn('parent'),
1067
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
1068
                ),
1069
                $query->expr->eq(
1070
                    $this->dbHandler->quoteColumn('action_type'),
1071
                    $query->bindValue('eznode', null, \PDO::PARAM_STR)
1072
                ),
1073
                $query->expr->eq(
1074
                    $this->dbHandler->quoteColumn('is_alias'),
1075
                    $query->bindValue(0, null, \PDO::PARAM_INT)
1076
                )
1077
            )
1078
        );
1079
1080
        if (!$includeHistory) {
1081
            $query->where(
1082
                $query->expr->eq(
1083
                    $this->dbHandler->quoteColumn('is_original'),
1084
                    $query->bindValue(1, null, \PDO::PARAM_INT)
1085
                )
1086
            );
1087
        }
1088
1089
        $statement = $query->prepare();
1090
        $statement->execute();
1091
1092
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
1093
    }
1094
1095
    public function getLocationContentMainLanguageId($locationId)
1096
    {