Code Duplication    Length = 14-15 lines in 6 locations

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

@@ 134-148 (lines=15) @@
131
     *
132
     * @return string[][]
133
     */
134
    public function loadLanguageData($id)
135
    {
136
        $query = $this->createFindQuery();
137
        $query->where(
138
            $query->expr->eq(
139
                $this->dbHandler->quoteColumn('id'),
140
                $query->bindValue($id, null, \PDO::PARAM_INT)
141
            )
142
        );
143
144
        $statement = $query->prepare();
145
        $statement->execute();
146
147
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
148
    }
149
150
    /**
151
     * Loads data for the Language with Language Code (eg: eng-GB).
@@ 157-171 (lines=15) @@
154
     *
155
     * @return string[][]
156
     */
157
    public function loadLanguageDataByLanguageCode($languageCode)
158
    {
159
        $query = $this->createFindQuery();
160
        $query->where(
161
            $query->expr->eq(
162
                $this->dbHandler->quoteColumn('locale'),
163
                $query->bindValue($languageCode, null, \PDO::PARAM_STR)
164
            )
165
        );
166
167
        $statement = $query->prepare();
168
        $statement->execute();
169
170
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
171
    }
172
173
    /**
174
     * Creates a Language find query.

eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabase.php 3 locations

@@ 55-69 (lines=15) @@
52
     *
53
     * @return array
54
     */
55
    public function loadObjectStateData($stateId)
56
    {
57
        $query = $this->createObjectStateFindQuery();
58
        $query->where(
59
            $query->expr->eq(
60
                $this->dbHandler->quoteColumn('id', 'ezcobj_state'),
61
                $query->bindValue($stateId, null, \PDO::PARAM_INT)
62
            )
63
        );
64
65
        $statement = $query->prepare();
66
        $statement->execute();
67
68
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
69
    }
70
71
    /**
72
     * Loads data for an object state by identifier.
@@ 136-150 (lines=15) @@
133
     *
134
     * @return array
135
     */
136
    public function loadObjectStateGroupData($groupId)
137
    {
138
        $query = $this->createObjectStateGroupFindQuery();
139
        $query->where(
140
            $query->expr->eq(
141
                $this->dbHandler->quoteColumn('id', 'ezcobj_state_group'),
142
                $query->bindValue($groupId, null, \PDO::PARAM_INT)
143
            )
144
        );
145
146
        $statement = $query->prepare();
147
        $statement->execute();
148
149
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
150
    }
151
152
    /**
153
     * Loads data for an object state group by identifier.
@@ 159-173 (lines=15) @@
156
     *
157
     * @return array
158
     */
159
    public function loadObjectStateGroupDataByIdentifier($identifier)
160
    {
161
        $query = $this->createObjectStateGroupFindQuery();
162
        $query->where(
163
            $query->expr->eq(
164
                $this->dbHandler->quoteColumn('identifier', 'ezcobj_state_group'),
165
                $query->bindValue($identifier, null, \PDO::PARAM_STR)
166
            )
167
        );
168
169
        $statement = $query->prepare();
170
        $statement->execute();
171
172
        return $statement->fetchAll(\PDO::FETCH_ASSOC);
173
    }
174
175
    /**
176
     * Loads data for all object state groups, filtered by $offset and $limit.

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

@@ 508-521 (lines=14) @@
505
     *
506
     * @return string[][]
507
     */
508
    public function loadGroupDataByIdentifier($identifier)
509
    {
510
        $q = $this->createGroupLoadQuery();
511
        $q->where(
512
            $q->expr->eq(
513
                $this->dbHandler->quoteColumn('name'),
514
                $q->bindValue($identifier, null, \PDO::PARAM_STR)
515
            )
516
        );
517
        $stmt = $q->prepare();
518
        $stmt->execute();
519
520
        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
521
    }
522
523
    /**
524
     * Returns an array with data about all Group objects.