isDocumentPoolEmpty() public method

Check if documents are in pool
public isDocumentPoolEmpty ( ) : boolean
return boolean
Example #1
0
 public function testEnableDocumentPool()
 {
     // disable document pool
     $this->collection->disableDocumentPool();
     $this->assertFalse($this->collection->isDocumentPoolEnabled());
     // create documents
     $document = $this->collection->createDocument(array('k' => array('f' => 'F1', 'kk' => 'A')))->save();
     // read document
     $this->collection->getDocument($document->getId());
     // check if document in pool
     $this->assertTrue($this->collection->isDocumentPoolEmpty());
     // enable document pool
     $this->collection->enableDocumentPool();
     $this->assertTrue($this->collection->isDocumentPoolEnabled());
     // read document to pool
     $this->collection->getDocument($document->getId());
     // check if document in pool
     $this->assertFalse($this->collection->isDocumentPoolEmpty());
     // clear document pool
     $this->collection->clearDocumentPool();
     $this->assertTrue($this->collection->isDocumentPoolEmpty());
     // disable document pool
     $this->collection->disableDocumentPool();
     $this->assertFalse($this->collection->isDocumentPoolEnabled());
 }