Code Duplication    Length = 9-14 lines in 3 locations

lib/Doctrine/ODM/CouchDB/DocumentManager.php 3 locations

@@ 196-205 (lines=10) @@
193
     * @param  string $viewName
194
     * @return \Doctrine\ODM\CouchDB\View\ODMQuery
195
     */
196
    public function createQuery($designDocName, $viewName)
197
    {
198
        $designDoc = $this->config->getDesignDocument($designDocName);
199
        if ($designDoc) {
200
            $designDoc = new $designDoc['className']($designDoc['options']);
201
        }
202
        $query = new ODMQuery($this->couchDBClient->getHttpClient(), $this->couchDBClient->getDatabase(), $designDocName, $viewName, $designDoc);
203
        $query->setDocumentManager($this);
204
        return $query;
205
    }
206
207
    /**
208
     * Create a Native query for the view of the specified design document.
@@ 216-224 (lines=9) @@
213
     * @param  string $viewName
214
     * @return \Doctrine\CouchDB\View\Query
215
     */
216
    public function createNativeQuery($designDocName, $viewName)
217
    {
218
        $designDoc = $this->config->getDesignDocument($designDocName);
219
        if ($designDoc) {
220
            $designDoc = new $designDoc['className']($designDoc['options']);
221
        }
222
        $query = new Query($this->couchDBClient->getHttpClient(), $this->couchDBClient->getDatabase(), $designDocName, $viewName, $designDoc);
223
        return $query;
224
    }
225
226
    /**
227
     * Create a CouchDB-Lucene Query.
@@ 233-246 (lines=14) @@
230
     * @param string $viewName
231
     * @return \Doctrine\ODM\CouchDB\View\ODMLuceneQuery
232
     */
233
    public function createLuceneQuery($designDocName, $viewName)
234
    {
235
        $luceneHandlerName = $this->config->getLuceneHandlerName();
236
        $designDoc = $this->config->getDesignDocument($designDocName);
237
        if ($designDoc) {
238
            $designDoc = new $designDoc['className']($designDoc['options']);
239
        }
240
        $query = new ODMLuceneQuery($this->couchDBClient->getHttpClient(),
241
            $this->couchDBClient->getDatabase(), $luceneHandlerName, $designDocName,
242
            $viewName, $designDoc
243
        );
244
        $query->setDocumentManager($this);
245
        return $query;
246
    }
247
248
    public function persist($object)
249
    {