Doctrine\ODM\CouchDB\Configuration::getDesignDocument PHP Method

getDesignDocument() public method

public getDesignDocument ( string $name ) : array
$name string
return array
    public function getDesignDocument($name)
    {
        if (isset($this->attributes['designDocuments'][$name])) {
            return $this->attributes['designDocuments'][$name];
        }
        return null;
    }

Usage Example

Example #1
0
 /**
  * Create a CouchDB-Lucene Query.
  *
  * @param string $designDocName
  * @param string $viewName
  * @return View\ODMLuceneQuery
  */
 public function createLuceneQuery($designDocName, $viewName)
 {
     $luceneHandlerName = $this->config->getLuceneHandlerName();
     $designDoc = $this->config->getDesignDocument($designDocName);
     if ($designDoc) {
         $designDoc = new $designDoc['className']($designDoc['options']);
     }
     $query = new ODMLuceneQuery($this->couchDBClient->getHttpClient(), $this->couchDBClient->getDatabase(), $luceneHandlerName, $designDocName, $viewName, $designDoc);
     $query->setDocumentManager($this);
     return $query;
 }