Most of the library calls which operate on a single entity will return an object of the appropriate type (e.g. Customer, Transaction etc) which you can consume directly.

$customer = Pencepay_Customer::find('customer_uid');
// You can now use the Customer object directly


When searching for objects, or inspecting the list/array properties of objects, you will find them packed inside a Collection object.

The Collection is an useful wrapper, making the list of objects easy to use, and to allow you to perform paginated access to large number of objects (e.g. thousands of transactions).

$collection = Pencepay_Customer::search($search);
foreach ($collection->items as $customer) {

Using the items property you can easily iterate through the returned list of objects.