getDocumentsFromDocumentPool() public method

Get documents from pool if they stored
public getDocumentsFromDocumentPool ( array $ids = null )
$ids array
Esempio n. 1
0
 public function testGetDocumentsFromDocumentPool()
 {
     $document1 = $this->collection->createDocument(array('field' => 'value1'))->save();
     $document2 = $this->collection->createDocument(array('field' => 'value2'))->save();
     $this->assertEquals(2, $this->collection->documentPoolCount());
     // without arguments
     $documents = $this->collection->getDocumentsFromDocumentPool();
     $this->assertEquals(2, count($documents));
     $this->assertArrayHasKey((string) $document1->getId(), $documents);
     $this->assertArrayHasKey((string) $document2->getId(), $documents);
     // with arguments
     $documents = $this->collection->getDocumentsFromDocumentPool(array($document1->getId()));
     $this->assertEquals(1, count($documents));
     $this->assertArrayHasKey((string) $document1->getId(), $documents);
 }