public function objectToArray($object)
    {
        if (!is_object($object) && !is_array($object)) {
            return $object;
        }
        if (is_object($object)) {
            $object = get_object_vars($object);
        }

        return array_map([get_class(), 'objectToArray'], $object);
    }
public function objectToArray($object)
    {
        if (!is_object($object) && !is_array($object)) {
            return $object;
        }
        if (is_object($object)) {
            $object = get_object_vars($object);
        }

        return array_map([get_class(), 'objectToArray'], $object);
    }
public function objectToArray ( $ object ) { if ( ! is_object ( $ object ) && ! is_array ( $ object ) ) { return $ object ; } if ( is_object ( $ object ) ) { $ object = get_object_vars ( $ object ) ; } return array_map ( [ get_class ( ) , 'objectToArray' ] , $ object ) ; }
Converts a bowl of object to an array.

@todo: replace with function that only shows accessible properties of the object

@param $object

@return array
Converts a bowl of object to an array .