Db_DataCollection

The Db_DataCollection class represents a collection of database objects. When multiple records are returned from a find_all() method, they will be returned as a data collection.

Class fields

  • $count - returns a number of objects in the collection
  • $object_array - an array containing collection elements. You can use this array for reading the collection content.

You can use the foreach loop for iterating over elements of the data collection, as if it was a regular array:

foreach ($request->images as $image)
{
    ...
}