-
Notifications
You must be signed in to change notification settings - Fork 0
/
DocumentManager.php
33 lines (29 loc) · 1.05 KB
/
DocumentManager.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace Bangpound\Bundle\CastleSearchBundle;
use Bangpound\Bundle\CastleSearchBundle\View\ListQuery;
/**
* Class DocumentManager
* @package Bangpound\Bundle\CastleSearchBundle
*/
class DocumentManager extends \Doctrine\ODM\CouchDB\DocumentManager
{
/**
* Create a Native query for the view of the specified design document.
*
* A native query will return an array of data from the &include_docs=true parameter.
*
* @param string $designDocName
* @param string $viewName
* @param string $listName
* @return ListQuery
*/
public function createNativeListQuery($designDocName, $viewName, $listName)
{
$designDoc = $this->getConfiguration()->getDesignDocument($designDocName);
if ($designDoc) {
$designDoc = new $designDoc['className']($designDoc['options']);
}
$query = new ListQuery($this->getCouchDBClient()->getHttpClient(), $this->getCouchDBClient()->getDatabase(), $designDocName, $viewName, $listName, $designDoc);
return $query;
}
}