Login
Register
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Login
Register
Object return
Search
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Recommend
this page to a friend!
Simple MySQL handler
>
All threads
>
Object return
>
(Un) Subscribe thread alerts
Subject:
Object return
Summary:
Arrays from execute() work better than objects
Messages:
2
Author:
Gerry Danen
Date:
2016-03-29 20:19:58
1. Object return
Reply
Report abuse
Gerry Danen - 2016-03-29 20:19:58
I am using this method to convert objects from the execute method to arrays.
It may enhance the dbase class.
private(or public) function _objectToArray($objectIn)
{
$arrayOut = array();
if ( $objectIn )
{
foreach ( $objectIn AS $key => $item )
{
if ( is_array($item) OR is_object($item) )
{
$arrayOut[$key] = $this->_objectToArray($item);
}
else
{
$arrayOut[$key] = $item;
}
}
}
return $arrayOut;
}
2. Re: Object return
Reply
Report abuse
Matthew Boyle - 2016-03-29 20:40:07 -
In reply to
message 1
from Gerry Danen
Thanks for the suggestion. That's a clever function.
About us
Advertise on this site
Site map
Newsletter
Statistics
Site tips
Privacy policy
Contact
Copyright (c)
Icontem
1999-2024
For more information send a message to
info at phpclasses dot org
.
image/svg+xml
image/svg+xml
Contact us using Messenger