Code Duplication    Length = 20-21 lines in 2 locations

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

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

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

@@ 1054-1073 (lines=20) @@
1051
     *
1052
     * @return array
1053
     */
1054
    public function loadVersionInfo($contentId, $versionNo)
1055
    {
1056
        $query = $this->queryBuilder->createVersionInfoFindQuery();
1057
        $query->where(
1058
            $query->expr->lAnd(
1059
                $query->expr->eq(
1060
                    $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_version'),
1061
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
1062
                ),
1063
                $query->expr->eq(
1064
                    $this->dbHandler->quoteColumn('version', 'ezcontentobject_version'),
1065
                    $query->bindValue($versionNo, null, \PDO::PARAM_INT)
1066
                )
1067
            )
1068
        );
1069
        $statement = $query->prepare();
1070
        $statement->execute();
1071
1072
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
1073
    }
1074
1075
    /**
1076
     * Returns data for all versions with given status created by the given $userId.