@param mixed $object
@param string $type

@return array
764211
public function getFieldsOfType($object, $type) {
		if (!is_object($object)) {
			throw new \InvalidArgumentException('No object provided');
		}
		$fields = array();

		$classMetadata = $this->metadataFactory->getMetadataForClass(get_class($object));

		foreach ($classMetadata->propertyMetadata as $propertyMetadata) {
			if (isset($propertyMetadata->toguType) && $propertyMetadata->toguType === $type) {
				if (!is_object($object)) {
					throw new \InvalidArgumentException('No object provided');
				}
				array_push($fields, $propertyMetadata);
			}
		}

		return $fields;
	}
462634
public static function getInject($type = null) {
        if ($type === null)
            return static::$inject;
        elseif (isset(static::$inject[$type]))
            return static::$inject[$type];

        return array();
    }
139738
public function prepareObject($object)
    {
        $tokenList = $this->getMethodTokenList();

        for ($i = 0, $c = count($tokenList); $i < $c; $i++) {
            if ($this->reflection->hasMethod(self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']))) {
                $m = self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']);
                if ($tokenList[$i]['type'] == RouteMethodAnnotaionParser::TYPE_CLASS) {
                    $value = new $tokenList[$i]['value']();
                } else {
                    $value = $tokenList[$i]['value'];
                }
                $object->$m($value);
            }
        }

        return $object;
    }
773887
public function getData($object)
    {
        return [
            'OXID'          => $object->getId(),
            'OXRATING'      => $object->getRating(),
            'OXTEXT'        => $object->getText(),
            'OXOBJECTID'    => $object->getObjectId(),
            'OXUSERID'      => $object->getUserId(),
            'OXTYPE'        => $object->getType(),
            'OXTIMESTAMP'   => $object->getCreatedAt(),
        ];
    }
297300
public function get(string $type): array
    {
        if (!isset($this->values[$type])) {
            return [];
        }

        return $this->values[$type];
    }
61752
protected function getObjectValues(object $object): array
    {
        $class = new ReflectionClass(get_class($object));
        $constructor = $class->getConstructor();
        if ($constructor instanceof ReflectionMethod) {
            foreach ($constructor->getParameters() as $parameter) {
                $name = $parameter->getName();

                $property = $class->getProperty($name);
                $property->setAccessible(true);

                $value = $property->getValue($object);
                if (is_object($value) === true) {
                    $value = $this->getObjectValues($value);
                }

                $data[$name] = $value;
            }
        }

        return $data ?? [];
    }
566207
public function get($object) : array
    {
        $values = $this->storage->get($object);

        return ($values === null) ? [] : $values;
    }
868379
public static function attrToArray($object){
        if(is_array($object) || is_object($object)) {
            $result = [];
            foreach ($object as $key => $value) {
                $result[$key] = self::attrToArray($value);
            }
            return $result;
        }
        return $object;
    }
1078544
private function serializeObjectRecursively($object): array
    {
        $reflection = new ReflectionClass($object);
        $properties = $reflection->getProperties();

        $data = [];
        foreach ($properties as $property) {
            $name = $property->getName();

            $property->setAccessible(true);
            $value = $property->getValue($object);
            $property->setAccessible(false);

            $data[$name] = $this->serializeValue($value);
        }

        return [
            'class' => get_class($object),
            'payload' => $data,
        ];
    }
1295218
public function getIdentifierValues($object)
    {
        $fields = $this->getReflectionFields();
        return $fields[$this->identifierPropertyName]->getValue($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;
    }
63117
public function toArray($object)
    {
        $result = array();
        $className = $this->getFullClassName($object);
        $metadata = $this->metadataFactory->getMetadataForClass($className);
        foreach ($metadata->getProperties() as $property) {
            if (!$property->isExpose() || $this->propertySkipper->shouldSkip($property)) {
                continue;
            }

            $value = $this->exposeValue($object, $property);
            $value = $this->handleValue($value, $property, self::DIRECTION_SERIALIZE);

            if ($property->isNullSkipped() && $value === null) {
                continue;
            }

            $result[$property->getSerializedName()] = $value;
        }

        return $result;
    }
246905
public static function serialize($object)
	{
		if (is_array($object)) {
			$result = [];
			foreach ($object as $record) {
				$result[] = $record->toArray();
				$record = null;
			}
			$object = null;
			return $result;
		} else {
			return $object != null ? $object->toArray() : null;
		}
	}
392987
protected function createObject($object)
    {
        $type = new ObjectType(['class'=>get_class($object)]);

        foreach (get_object_vars($object) as $property=>$value) {
            $type[$property] = $this->toType($value);
        }

        return $type;
    }
969458
protected function getActorFromObject($object)
    {
        $entryObject = [null, null, null];

        if (is_object($object)) {
            $entryObject[2] = $object->getId();
            $pathParts      = explode('\\', get_class($object));
            $entryObject[1] = array_pop($pathParts);
            foreach ($pathParts as $pathPart) {
                if (strstr($pathPart, 'Bundle')) {
                    $entryObject[0] = $pathPart;
                    break;
                }
            }
        }

        return $entryObject;
    }
19584
public function toArrayFunction($object)
    {
        if (is_string($object)) {
            return json_decode($object, true);
        }

        return json_decode(json_encode($object), true);
    }
249210
public static function to_array($object) {
        if (is_array($object)) return $object;
        if (!is_object($object) && !is_array($object)) return $object;
        if (is_object($object)) $object = get_object_vars($object);

        return array_map([
            __CLASS__,
            'to_array'
        ], $object);
    }