Results
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
Lists
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) {
$customer->uid;
}
Using the items
property you can easily iterate through the returned list of objects.