This is interesting none the less, left me stumped. I have an array of 'order' objects called Workday, if I print_r the array I get the following;
Workday Object
(
[workday] => Array
(
[0] => Order Object
(
[id] => 3
[date] => 2013-08-02
[username] => userXYZ
[number] => 33333333
[duration_start] => 20:51:00
[duration_end] => 21:51:00
[total] => $340.00
)
[1] => Order Object
(
[id] => 3
[date] => 2013-08-03
[username] => userXXA
[number] => 87653212
[duration_start] => 10:51:00
[duration_end] => 11:54:00
[total] => $20.00
)
[2] => Order Object
(
[id] => 3
[date] => 2013-08-01
[username] => userXYD
[number] => 12345678
[duration_start] => 08:37:00
[duration_end] => 10:01:00
[total] => $10.00
)
)
)
The issue seems to be when I try to iterate over the array it only outputs the first result. What am I missing?
$workday = new Workday();
$workday->Get($username, $duration_start, $duration_end);
$i = 0;
if($workday != null)
{
foreach($workday as $orders)
{
echo "ID: " . $orders[$i]->number;
$i++;
}
}
Get()method that returns only one result? Do you pass$username, $duration_start,$duration_endas search parameters because this might add up why you only receive one result.