lib/Elastica/Param.php
protected function _convertArrayable(array $array)
    {
        $arr = [];

        foreach ($array as $key => $value) {
            if ($value instanceof ArrayableInterface) {
                $arr[$value instanceof NameableInterface ? $value->getName() : $key] = $value->toArray();
            } elseif (\is_array($value)) {
                $arr[$key] = $this->_convertArrayable($value);
            } else {
                $arr[$key] = $value;
            }
        }

        return $arr;
    }
protected function _convertArrayable(array $array)
    {
        $arr = [];

        foreach ($array as $key => $value) {
            if ($value instanceof ArrayableInterface) {
                $arr[$value instanceof NameableInterface ? $value->getName() : $key] = $value->toArray();
            } elseif (\is_array($value)) {
                $arr[$key] = $this->_convertArrayable($value);
            } else {
                $arr[$key] = $value;
            }
        }

        return $arr;
    }
protected function _convertArrayable ( array $ array ) { $ arr = [ ] ; foreach ( $ array as $ key => $ value ) { if ( $ value instanceof ArrayableInterface ) { $ arr [ $ value instanceof NameableInterface ? $ value -> getName ( ) : $ key ] = $ value -> toArray ( ) ; } elseif ( \ is_array ( $ value ) ) { $ arr [ $ key ] = $ this -> _convertArrayable ( $ value ) ; } else { $ arr [ $ key ] = $ value ; } } return $ arr ; }
Cast objects to arrays.

@param array $array

@return array
Cast objects to arrays .