application/Espo/Core/Utils/Util.php
public static function objectToArray($object)
    {
        if (is_object($object)) {
            $object = (array) $object;
        }

        return is_array($object) ? array_map("static::objectToArray", $object) : $object;
    }
public static function objectToArray($object)
    {
        if (is_object($object)) {
            $object = (array) $object;
        }

        return is_array($object) ? array_map("static::objectToArray", $object) : $object;
    }
public static function objectToArray ( $ object ) { if ( is_object ( $ object ) ) { $ object = ( array ) $ object ; } return is_array ( $ object ) ? array_map ( "static::objectToArray" , $ object ) : $ object ; }
Convert object to array format recursively

@param object $object
@return array
Convert object to array format recursively