コード例 #1
0
ファイル: Migration.php プロジェクト: rfyio/Radmiraal.CouchDB
 /**
  * @return array
  */
 public function getData()
 {
     $folderDesignDocument = new \Doctrine\CouchDB\View\FolderDesignDocument($this->options['path']);
     return $folderDesignDocument->getData();
 }
コード例 #2
0
 public function testGetViewsBasedOnFileStructure()
 {
     $designDoc = new \Doctrine\CouchDB\View\FolderDesignDocument(__DIR__ . "/../../../Models/CMS/_files/");
     $this->assertEquals(array("rewrites" => array(array("from" => "/from/url", "to" => "/to/url", "query" => array("descending" => "true", "include_docs" => "true")), array("from" => "/from/url2", "to" => "/to/url2", "query" => array("descending" => "true", "include_docs" => "true"))), "views" => array("username" => array("map" => "function(doc) {\n    if (doc.type == 'Doctrine.Tests.Models.CMS.CmsUser') {\n        emit(doc.username, doc._id);\n    }\n}"))), $designDoc->getData());
 }
コード例 #3
0
 public function testGetViewsBasedOnFileStructure()
 {
     $designDoc = new \Doctrine\CouchDB\View\FolderDesignDocument(__DIR__ . "/../../../Models/CMS/_files/");
     $this->assertEquals(array("views" => array("username" => array("map" => "function(doc) {\n    if (doc.type == 'Doctrine.Tests.Models.CMS.CmsUser') {\n        emit(doc.username, doc._id);\n    }\n}"))), $designDoc->getData());
 }