示例#1
0
 private function getIndexIdByName($indexName)
 {
     if (isset($this->indexes[$indexName])) {
         return $this->indexes[$indexName];
     }
     $schema = new Space($this->client, Space::INDEX);
     $response = $schema->select([$this->id, $indexName], Index::INDEX_NAME);
     $data = $response->getData();
     if (empty($data)) {
         throw new Exception("No index '{$indexName}' is defined in space #{$this->id}");
     }
     return $this->indexes[$indexName] = $response->getData()[0][1];
 }
示例#2
0
 private function getSpaceIdByName($spaceName)
 {
     $schema = new Space($this, Space::SPACE);
     $response = $schema->select([$spaceName], Index::SPACE_NAME);
     $data = $response->getData();
     if (empty($data)) {
         throw new Exception("Space '{$spaceName}' does not exist");
     }
     return $data[0][0];
 }
示例#3
0
 public function testGetId()
 {
     $this->assertSame($this->spaceId, $this->space->getId());
 }