Overview

Namespaces

  • None
  • RedBeanPHP
    • Adapter
    • BeanHelper
    • Cursor
    • Driver
    • Logger
      • RDefault
    • QueryWriter
    • RedException
    • Repository
    • Util

Classes

  • AssociationManager
  • BeanCollection
  • DuplicationManager
  • Facade
  • Finder
  • Jsonable
  • LabelMaker
  • Observable
  • OODB
  • OODBBean
  • R
  • Repository
  • SimpleModel
  • SimpleModelHelper
  • TagManager
  • ToolBox

Interfaces

  • Adapter
  • BeanHelper
  • Cursor
  • Driver
  • Logger
  • Observer
  • Plugin
  • QueryWriter

Exceptions

  • RedException
  • Overview
  • Namespace
  • Class

Class BeanCollection

BeanCollection.

The BeanCollection represents a collection of beans and makes it possible to use database cursors. The BeanCollection has a method next() to obtain the first, next and last bean in the collection. The BeanCollection does not implement the array interface nor does it try to act like an array because it cannot go backward or rewind itself.

Use the BeanCollection for large datasets where skip/limit is not an option. Keep in mind that ID-marking (querying a start ID) is a decent alternative though.

Namespace: RedBeanPHP
Copyright:

copyright (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community This source file is subject to the BSD/GPLv2 License that is bundled with this source code in the file license.txt.


License: BSD/GPLv2
Author: Gabor de Mooij and the RedBeanPHP community
File: RedBeanPHP/BeanCollection.php
Located at BeanCollection.php
Methods summary
public
# __construct( string $type, RedBeanPHP\Repository $repository, RedBeanPHP\Cursor $cursor )

Constructor, creates a new instance of the BeanCollection.

Constructor, creates a new instance of the BeanCollection.

Parameters

$type
type of beans in this collection
$repository
repository to use to generate bean objects
$cursor
cursor object to use
public RedBeanPHP\OODBBean|null
# next( )

Returns the next bean in the collection. If called the first time, this will return the first bean in the collection. If there are no more beans left in the collection, this method will return NULL.

Returns the next bean in the collection. If called the first time, this will return the first bean in the collection. If there are no more beans left in the collection, this method will return NULL.

Returns

RedBeanPHP\OODBBean|null
public
# close( )

Closes the underlying cursor (needed for some databases).

Closes the underlying cursor (needed for some databases).

Properties summary
protected RedBeanPHP\Cursor $cursor
# NULL
protected RedBeanPHP\Repository $repository
# NULL
protected string $type
# NULL
API documentation generated by ApiGen