I want to fill an array using a while loop. With the following code I only get 1 row of data. But if I print $count it's final value is 432. Any ideas? I've bee trying for days but couldn't figure it out.
// Populate objects array
$count = 1;
while($o_result->nextHit()) {
$t_object = new ca_objects($o_result->get('ca_objects.object_id'));
$o_c_date = $t_object->getCreationTimestamp();
$o_lm_date = $t_object->getLastChangeTimestamp();
$a_objects = array ( array (
'title' => $o_result->get('ca_objects.preferred_labels.name'),
'type' => $o_result->get('ca_objects.type_id',array(
'convertCodesToDisplayText' => true))
)
);
$count++;
}
//print results
foreach ($a_objects as $row) {
echo $row['title']."<br/>";
echo $row['type']."<br/>";
}
echo $count."<br/>\n" ; //This prints 432