I have a function that is being passed an object that contains other objects that have permission ids in them. I need those permission ids in a foreach loop. Most of my tries give me an array to string conversion or a call to a non-object error.
A formatted var_dump of $permission looks like this...
array (size=1)
0 =>
array (size=2)
0 =>
object(stdClass)[9]
public 'permission_id' => string '1' (length=1)
1 =>
object(stdClass)[11]
public 'permission_id' => string '2' (length=1)
//My function starts off like this...
function checkPermission($permission) {
$db = DB::getInstance();
global $user;
foreach($permission as $key=>$value){
I need to figure out how to setup that foreach loop where every round of the loop passes in that permission_id from the var_dump above.