Returns a standard php array from a \SolrObject instance.

@param \SolrObject $obj
@return array The returned document as an array.
196419
public function standarize_solr_obj(\SolrObject $obj) {
        $properties = $obj->getPropertyNames();

        $docdata = array();
        foreach($properties as $name) {
            // http://php.net/manual/en/solrobject.getpropertynames.php#98018.
            $name = trim($name);
            $docdata[$name] = $obj->offsetGet($name);
        }
        return $docdata;
    }
307320
protected function exportObject($obj)
	{
		// Serialize the object
		$str = call_user_func($this->serializer, $obj);

		// Export the object's source
		$str = var_export($str, true);

		return $this->unserializer . '(' . $str . ')';
	}
1033855
public static function object_to_array($obj)
    {
        $obj = (array)$obj;
        foreach ($obj as $k => $v) {
            if (gettype($v) == 'object' || gettype($v) == 'array') {
                $obj[$k] = self::object_to_array($v);
            }
        }
        return $obj;
    }
1032961
private function parseData($obj)
    {
        $data = [
            'temperature' => [
                'now' => [
                    'value' => $obj->temperature->now->getValue(),
                    'unit' => $obj->temperature->now->getUnit()
                ],
                'min' => [
                    'value' => $obj->temperature->min->getValue(),
                    'unit' => $obj->temperature->min->getUnit()
                ],
                'max' => [
                    'value' => $obj->temperature->max->getValue(),
                    'unit' => $obj->temperature->max->getUnit()
                ]
            ],
            'humidity' => [
                'value' => $obj->humidity->getValue(),
                'unit' => $obj->humidity->getUnit()
            ],
            'pressure' => [
                'value' => $obj->pressure->getValue(),
                'unit' => $obj->pressure->getUnit()
            ],
            'wind' => [
                'speed' => [
                    'value' => $obj->wind->speed->getValue(),
                    'unit' => $obj->wind->speed->getUnit(),
                    'description' => $obj->wind->speed->getDescription(),
                    'description_slug' => str_slug($obj->wind->speed->getDescription())
                ],
                'direction' => [
                    'value' => $obj->wind->direction->getValue(),
                    'unit' => $obj->wind->direction->getUnit(),
                    'description' => $obj->wind->direction->getDescription(),
                    'description_slug' => str_slug($obj->wind->direction->getDescription())
                ]
            ],
            'clouds' => [
                'value' => $obj->clouds->getValue(),
                'unit' => $obj->clouds->getUnit(),
                'description' => $obj->clouds->getDescription(),
                'description_slug' => str_slug($obj->clouds->getDescription())
            ],
            'precipitation' => [
                'value' => $obj->precipitation->getValue(),
                'unit' => $obj->precipitation->getUnit(),
                'description' => $obj->precipitation->getDescription(),
                'description_slug' => str_slug($obj->precipitation->getDescription())
            ],
            'weather' => [
                'id' => $obj->weather->id,
                'description' => $obj->weather->description,
                'description_slug' => str_slug($obj->weather->description),
                'icon' => $obj->weather->icon
            ],
        ];

        return $data;
    }
371402
public static function toString($obj)
    {
        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj);
    }
1277971
public static function toArray( $object )
    {
        if ( is_object( $object ) )
        {
            return get_object_vars( $object );
        }

        if ( is_array( $object ) )
        {
            return array_map(
                array(
                    __CLASS__,
                    'toArray'
                ),
                $object
            );
        }

        // Return array
        return $object;
    }
1354396
function objectToArray(obj) {
        if (!validateHelpers.isPlainObject(obj)) {
            throw new Error('\'obj\' must be a plain object');
        }

        return Object.keys(obj).map(function (key) {
            return obj[key];
        });
    }
72903
public function renderAfterScenario($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderAfterScenario($obj);
        }

        return $print;
    }
796302
public static ArrayNode getArray(ObjectNode obj, String fieldName) {
		return obj == null ? null : array(obj.get(fieldName));
	}
1304990
function toArray(obj) {
	if (Array.isArray(obj)) return obj;
	var a = [];
	a.push(obj);
	return a;
}
147190
protected function serialize($obj, $type = 'json')
    {
        $context = new SerializationContext();
        $context->setSerializeNull($this->isSerializeNull());

        $builder = SerializerBuilder::create();
        $builder
            ->configureListeners(function (EventDispatcher $dispatcher) {
                $dispatcher->addListener('serializer.pre_serialize',
                    function (PreSerializeEvent $event) {
                        if ($event->getObject() instanceof EntityCollection) {
                            $event->setType('EntityCollection');
                        }
                    }
                );
            })
            ->configureHandlers(function (HandlerRegistry $registry) {
                $collectionHandler = function (JsonSerializationVisitor $visitor, $obj, array $type, Context $context) {
                    $nav = $visitor->getNavigator();
                    if (count($obj->getCollection()) < 1) {
                        return true;
                    }

                    return $nav->accept($obj->getCollection(), ['name' => 'array'], $context);
                };

                // Entity Array Handler
                $registry->registerHandler(
                    'serialization',
                    'EntityCollection',
                    'json',
                    $collectionHandler);

                // DateTime Handler ISO 8601 date "yyyy-mm-dd'T'HH:mm:ssZ"
                $registry->registerHandler('serialization', 'DateTime', 'json',
                    function ($visitor, \DateTime $obj, array $type, Context $context) {
                        return $obj->format('c');
                    }
                );
            });

        $serializer = $builder->build();

        return $serializer->serialize($obj, $type, $context);
    }
255742
private static function objectToString($obj)
    {
        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_hash($obj);
    }
1020479
public static function ObjectToArray($obj,$fields=[])
    {
        if(is_object($obj)){
            if(empty($fields)){
                return get_object_vars($obj);
            }else{
                $array=[];
                foreach ($fields as $fd){
                    if(property_exists($obj, $fd)){
                        $array[$fd]=$obj->$fd;
                    }
                }
                return $array;
            }
        }
        return [];
    }
932185
public static function recursiveGetObjectVars($obj) {
		$arr = array();
		$_arr = is_object($obj) ? get_object_vars($obj) : $obj;

		foreach ($_arr as $key => $val) {
			$val = (is_array($val) || is_object($val)) ? self::recursiveGetObjectVars($val) : $val;

			// Transform boolean into 1 or 0 to make it safe across all Opauth HTTP transports
			if (is_bool($val)) $val = ($val) ? 1 : 0;

			$arr[$key] = $val;
		}

		return $arr;
	}
157859
function ( obj ) {
		var result = [];

		array.each( obj, function ( i ) {
			array.add( result, i );
		});

		return result;
	}
920350
public function dump($obj)
    {
        if (is_array($obj) || is_object($obj)) {
            $obj = print_r($obj, true);
        }

        $this->append('<pre>' .  htmlentities($obj, ENT_QUOTES) . "</pre><br />\n");

        return $this;
    }
235503
private function get_array_value( $obj ) {
		if ( $obj instanceof \stdClass ) {
			$obj = get_object_vars( $obj );
		} elseif ( ! is_array( $obj ) ) {
			if ( method_exists( $obj, 'to_array' ) ) {
				$obj = $obj->to_array();
			}
		}
		if ( ! is_array( $obj ) || empty( $obj ) ) {
			return [];
		}

		return $obj;
	}