@param mixed $object

@return array
192849
private static function getPropertyMapping($object)
    {
        $mapping = array();
        $reflection = new \ReflectionClass($object);

        // Create a default property mapping by getting the properties
        foreach ($reflection->getProperties() as $property) {
            $name = $property->getName();
            $setterMethod = 'set' . ucfirst($name);

            if (method_exists($object, $setterMethod) || $property->isPublic()) {
                $mapping[$name] = $name;
            }
        }

        // If the getPropertyMapping method exists, merge it with the
        // existing mapping.
        //
        // This comes last because it has higher priority than the default
        // mapping.
        if (method_exists($object, 'getPropertyMapping')) {
            $mapping = array_merge($mapping, $object->getPropertyMapping());
        }

        // Filter any properties that are mapped to null
        foreach ($mapping as $destination => $source) {
            if (!$source) {
                unset($mapping[$destination]);
            }
        }

        return $mapping;
    }
1113649
public function extract( $object )
    {
        $result = array();
        $type   = $object->paragraph->type;

        $result['paragraph-' . $type] = $this->getParagraphMapper()
                                             ->extract( $object->paragraph );

        $propertyHydrator = $this->getHydrateSimpleProperties();

        foreach ( $object->rules as $key => $rule )
        {
            $result['customize-' . $key] = $propertyHydrator->extract( $rule )
                                                              [ 'properties' ];
        }

        return $result;
    }
652016
public function getMappedObjectType($object): ?string
    {
        foreach ($this->typesMapping as $type => $typeClass) {
            if (is_a($object, $typeClass)) {
                return $type;
            }
        }

        return null;
    }
1103067
public function toArray($object)
    {
        $this->assertObjectInstance($object);

        return array_map(
            function (Field $field) use ($object) {
                return $field->get($object);
            },
            $this->getFields()
        );
    }
422868
private function getObjectPropertiesValues($object)
    {
        $properties = Core::get()->getGettablePropertiesOfObject($object);
        $finalProperties = [];

        foreach ($properties as $property) {
            $finalProperties[$property] = Core::get()->getObjectService()->getObjectProperty($object, $property);
        }

        return $finalProperties;
    }
864829
private function convert(Array $object): Array {
    $parse = Array();
    foreach ($object as $key => $value) {
      if ($value instanceof stdClass) {
        $parse[$key] = $this->convert((Array) $value);
      } else {
        $parse[$key] = $value;
      }
    }
    return $parse;
  }
38802
public function extract($object)
    {
        $pdfConverterHydrator = new PdfConverterHydrator();

        return [
            'responseStatus' => $object->getResponseStatus(),
            'sourceContainer' => $pdfConverterHydrator->extract($object->getSourceContainer()),
            'url' => $object->getUrl(),
        ];
    }
629312
protected function objectToArray($object) 
    {
        if (is_object($object)) {
            // Gets the properties of the given object
            // with get_object_vars function
            $object = get_object_vars($object);
        }

        if (is_array($object)) {
            /*
            * Return array converted to object
            * Using __FUNCTION__ (Magic constant)
            * for recursive call
            */
            return array_map(__METHOD__, $object);
        } else {
            // Return array
            return $object;
        }
    }
19584
public function toArrayFunction($object)
    {
        if (is_string($object)) {
            return json_decode($object, true);
        }

        return json_decode(json_encode($object), true);
    }
123689
public function normalize($object) : array
    {
        return $this->asArray ? $this->normalizeAsArray($object) : $this->normalizeAsAttributes($object);
    }
914699
private function innerSerialize($object)
    {
        if (is_array($object)) {
            $serializedArray = [];
            foreach ($object as $key => $value) {
                $serializedArray[$key] = $this->innerSerialize($value);
            }

            return $serializedArray;
        } elseif (is_object($object)) {
            return $this->serializeObject($object);
        } else {
            return $object;
        }
    }
52304
protected function getUrlAliases($object)
    {
        try {
            $internalUrl = $this->provider->url($object);
        } catch (UnsupportedException $exception) {
            return [];
        }

        return $this
            ->doctrine
            ->getRepository('ZichtUrlBundle:UrlAlias')
            ->findAllByInternalUrl($internalUrl);
    }
1116974
public static function toArray($object)
    {
        $object = AnConfig::unbox($object);

        if (is($object, 'AnObjectArray') || is($object, 'AnObjectSet')) {
            return $object->toArray();
        }

        return (array) $object;
    }
1028541
private function _recursiveGetObjectVars($object)
    {
        $vars = $object;
        if ( is_object($object) ) {
            $vars = get_object_vars($object);
            foreach ($vars as $key => $value) {
                $vars[$key] = $this->_recursiveGetObjectVars($value);
            }
        }

        return $vars;
    }
1027765
public function getCustomFields($object)
    {
        $customFields = [];
        foreach ($object->getCustomFields() as $field) {
            $customFields[$field->getInternalFieldName()] = $field->getValue();
        }

        return $customFields;
    }
1147984
public static function toArray($object)
	{
		if(is_array($object))
			return $object;
		elseif(!is_object($object))
			return (array) $object;
		elseif ($object instanceof IlluminateCollection)
			return $object->all();
		elseif ($object instanceof IlluminateArrayable)
			return $object->toArray();
		elseif(method_exists($object, '__toString'))
			return [$object];
		elseif ($object instanceof IlluminateJsonable)
			return (array) json_decode($object->toJson(), true);
		elseif ($object instanceof JsonSerializable)
			return (array) $object->jsonSerialize();
		elseif ($object instanceof Traversable)
			return iterator_to_array($object);
		else
			return (array) $object;
	}
415478
public function extract($object)
    {
        return [
            'newsId'        => $object->getNewsId(),
            'userId'        => $object->getUserId(),
            'title'         => $object->getTitle(),
            'slug'          => $object->getSlug(),
            'content'       => $object->getContent(),
            'description'   => $object->getDescription(),
            'pageHits'      => $object->getPageHits(),
            'image'         => $object->getImage(),
            'layout'        => $object->getLayout(),
            'lead'          => $object->getLead(),
            'dateCreated'   => $this->extractValue('dateCreated', $object->getDateCreated()),
            'dateModified'  => $this->extractValue('dateModified', $object->getDateModified()),
        ];
    }