Exemplo n.º 1
0
 /**
  * @test
  */
 public function openIndexForWriteWithFilter()
 {
     $this->_writeStream->setResponse("0\t2\tcolumn1\tcolumn2");
     $result = $this->_driver->openIndex(Ext_HandlerSocket_Driver::MODE_WRITE, 1, 'database', 'table', 'index', array('field1', 'field2'), array('filter' => array('field1', 'field2')));
     $this->assertEquals("P\t1\tdatabase\ttable\tindex\tfield1,field2\tfield1,field2", $this->_writeStream->getLastRequest());
     $this->assertTrue($result);
 }
Exemplo n.º 2
0
Arquivo: Index.php Projeto: rusnak/Ext
 /**
  * @return int
  * @throws Exception
  */
 public function getWriteIndex()
 {
     if (!$this->_writeIndexOpened) {
         $openIndexResult = $this->_driverInstance->openIndex(Ext_HandlerSocket_Driver::MODE_WRITE, $this->_writeIndexId, $this->_databaseName, $this->_tableName, $this->_indexName, $this->_fields, $this->_options);
         if (!$openIndexResult) {
             throw new Exception();
         }
         $this->_writeIndexOpened = true;
     }
     return $this->_writeIndexId;
 }