Code Duplication    Length = 20-21 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabase.php 1 location

@@ 81-101 (lines=21) @@
78
     *
79
     * @return array
80
     */
81
    public function loadObjectStateDataByIdentifier($identifier, $groupId)
82
    {
83
        $query = $this->createObjectStateFindQuery();
84
        $query->where(
85
            $query->expr->lAnd(
86
                $query->expr->eq(
87
                    $this->dbHandler->quoteColumn('identifier', 'ezcobj_state'),
88
                    $query->bindValue($identifier, null, \PDO::PARAM_STR)
89
                ),
90
                $query->expr->eq(
91
                    $this->dbHandler->quoteColumn('group_id', 'ezcobj_state'),
92
                    $query->bindValue($groupId, null, \PDO::PARAM_INT)
93
                )
94
            )
95
        );
96
97
        $statement = $query->prepare();
98
        $statement->execute();
99
100
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
101
    }
102
103
    /**
104
     * Loads data for all object states belonging to group with $groupId ID.

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 1 location

@@ 1070-1089 (lines=20) @@
1067
     *
1068
     * @return array
1069
     */
1070
    public function loadVersionInfo($contentId, $versionNo)
1071
    {
1072
        $query = $this->queryBuilder->createVersionInfoFindQuery();
1073
        $query->where(
1074
            $query->expr->lAnd(
1075
                $query->expr->eq(
1076
                    $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_version'),
1077
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
1078
                ),
1079
                $query->expr->eq(
1080
                    $this->dbHandler->quoteColumn('version', 'ezcontentobject_version'),
1081
                    $query->bindValue($versionNo, null, \PDO::PARAM_INT)
1082
                )
1083
            )
1084
        );
1085
        $statement = $query->prepare();
1086
        $statement->execute();
1087
1088
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
1089
    }
1090
1091
    /**
1092
     * Returns the number of all versions with given status created by the given $userId for content which is not in Trash.