findCollection() public static method

Use this for large datasets.
public static findCollection ( string $type, string $sql = NULL, array $bindings = [] ) : redbeanphp\BeanCollection
$type string the type of bean you are looking for
$sql string SQL query to find the desired bean, starting right after WHERE clause
$bindings array array of values to be bound to parameters in query
return redbeanphp\BeanCollection
Example #1
0
 /**
  * Test empty collections (NULLCursor).
  *
  * @return void
  */
 public function testEmptyCollection()
 {
     R::nuke();
     $page = R::dispense('page');
     $page->content = 'aaa';
     R::store($page);
     $collection = R::findCollection('page');
     asrt(get_class($collection), 'RedBeanPHP\\BeanCollection');
     $collection = R::findCollection('page', ' content  =  ?', array('bbb'));
     asrt(get_class($collection), 'RedBeanPHP\\BeanCollection');
     asrt(is_null($collection->next()), TRUE);
     $collection = R::findCollection('something');
     asrt(get_class($collection), 'RedBeanPHP\\BeanCollection');
     asrt(is_null($collection->next()), TRUE);
     $collection->close();
 }