Closed alok932 closed 5 years ago
Hey, you can use any item in the collection as an object.
$reviso = new \Webleit\RevisoApi\Reviso();
$customers = $reviso->customers->perPage(2)->get();
$customer = $customers->first(); // or $customers->each or foreach ($customers as $customer)
echo $customer->address;
echo "<pre>";
print_r($customers->toArray());
echo "</pre>";
Thanks for the reply. $customers->first() works but not the foreach.
foreach ($customers as $customer) {
echo "<pre>";
print_r($customer);
echo "</pre>";
}
This returns nothing.
Sorry, it's foreach ($customers->toArray() as $customer)
On Tue, Oct 1, 2019 at 2:46 PM Alok notifications@github.com wrote:
Thanks for the reply. $customers->first() works but not the foreach.
foreach ($customers as $customer) { echo "<pre>"; print_r($customer); echo "</pre>"; }
This returns nothing.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Weble/RevisoApi/issues/2?email_source=notifications&email_token=AAINRU3FQOQPA7NOGXHQFSDQMNBEDA5CNFSM4I4I2PJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEABELPY#issuecomment-537019839, or mute the thread https://github.com/notifications/unsubscribe-auth/AAINRU3HWM5CC4MJWIE745LQMNBEDANCNFSM4I4I2PJQ .
-- [image: Logo Weble] Daniele Rosario
CTO Weble Srl Via Enrico Fermi, 265 36100 Vicenza ufficio: +39 0444 1454934 <003904441454934> mobile: +39 3283017134 <00393283017134> weble.it https://www.weble.it/ https://www.facebook.com/pages/Weble/110077192371908?fref=ts https://twitter.com/Webleit?lang=it https://www.linkedin.com/company/2470613?trk=tyah&trkInfo=clickedVertical%3Acompany%2Cidx%3A2-2-7%2CtarId%3A1432717146425%2Ctas%3Aweble https://www.instagram.com/weble.it/
Yes but toArray() has bug that returns only 1 record.
just tagged 1.1.1 that should fix that
On Tue, Oct 1, 2019 at 2:51 PM Alok notifications@github.com wrote:
Yes but toArray() has bug that returns only 1 record.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Weble/RevisoApi/issues/2?email_source=notifications&email_token=AAINRU3XJ4ODFH6UAYJQUWLQMNBVFA5CNFSM4I4I2PJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEABEY3Q#issuecomment-537021550, or mute the thread https://github.com/notifications/unsubscribe-auth/AAINRU5JSMHCIUQP6DJ7A3TQMNBVFANCNFSM4I4I2PJQ .
-- [image: Logo Weble] Daniele Rosario
CTO Weble Srl Via Enrico Fermi, 265 36100 Vicenza ufficio: +39 0444 1454934 <003904441454934> mobile: +39 3283017134 <00393283017134> weble.it https://www.weble.it/ https://www.facebook.com/pages/Weble/110077192371908?fref=ts https://twitter.com/Webleit?lang=it https://www.linkedin.com/company/2470613?trk=tyah&trkInfo=clickedVertical%3Acompany%2Cidx%3A2-2-7%2CtarId%3A1432717146425%2Ctas%3Aweble https://www.instagram.com/weble.it/
yes this fixed it. Thanks for such a quick fix.
You're welcome.
PHP Code to get customers
Response:
Here as all data is in Protected property info we cannot really access it from outside this package. There is not getter for Info in Collection Class.