Bolt\Storage\Query\QueryResultset::add PHP Method

add() public method

public add ( array $results, string $type = null )
$results array A set of results
$type string An optional label to partition results
    public function add($results, $type = null)
    {
        if ($type) {
            $this->results[$type] = $results;
        } else {
            $this->results = array_merge($this->results, $results);
        }
        $this->append(new ArrayIterator($results));
    }

Usage Example

コード例 #1
0
ファイル: QueryResultsetTest.php プロジェクト: atiarda/bolt
 public function testNoLabelFetch()
 {
     $array1 = ['test1', 'test2', 'test3'];
     $array2 = ['test4', 'test5', 'test6'];
     $set = new QueryResultset();
     $set->add($array1);
     $set->add($array2);
     $this->assertEquals(6, count($set->get()));
 }
All Usage Examples Of Bolt\Storage\Query\QueryResultset::add
QueryResultset