@param object $object

@return array
341926
public function getPropertyValuesArray($object)
    {
        $values = [];
        foreach ($this->entityPropertiesMetadata as $entityPropertyMetadata) {
            $v = $entityPropertyMetadata->getValue($object);
            if (is_object($v)) {
                switch (get_class($v)) {
                    case \DateTime::class:
                        $v = $v->getTimestamp();
                        break;
                }
            }
            $values[$entityPropertyMetadata->getPropertyName()] = $v;
        }

        return $values;
    }
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;
    }
1190405
protected function normalizeAsArray($object) : array
    {
        $wrapper = $this->factory->make($object);

        $value = $wrapper->getEntityAttributes();

        if ($this->asJson) {
            $value = json_encode($value);
        }

        return [$this->relation => $value];
    }
190642
public function extract($object)
    {
        $data = [
            'login' => $object->getLogin(),
            'name' => $object->getName(),
            'email' => $object->getEmail(),
            'role' => $object->getRole(),
        ];
        if ($object->getId() !== null) {
            $data['id'] = $object->getId();
        }
        return $data;
    }
1037621
public static function keys($object)
    {
        if ($object instanceof \stdClass)
            $object = (array)$object;

        if (is_array($object))
            return array_keys($object);

        $result = [];
        static::each($object, function ($item, $key) use (& $result) {
            $result[] = $key;
        });

        return $result;
    }
1130061
public static function getLabels($object)
    {
        $labels    = null;
        $labelsRaw = $object->getDataValue('stitky');

        if (strlen($labelsRaw)) {
            $labels = is_array($labelsRaw) ? $labelsRaw : self::listToArray($labelsRaw);
        }
        return $labels;
    }
945565
public function extract($object)
    {
        return [
            'type' => $object->getType(),
            'data' => $object->getData(),
            'store' => $object->getStore(),
            'download' => $object->isDownload(),
            'output_filename' => $object->getOutputFilename(),
            'category' => $object->getCategory(),
        ];
    }
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;
	}
1027765
public function getCustomFields($object)
    {
        $customFields = [];
        foreach ($object->getCustomFields() as $field) {
            $customFields[$field->getInternalFieldName()] = $field->getValue();
        }

        return $customFields;
    }
317130
public static function ObjectAsArray($Object) {
      if (!is_object($Object))
         return $Object;

      $Return = array();
      foreach(get_object_vars($Object) as $Property => $Value) {
         $Return[$Property] = $Value;
      }
      return $Return;
   }
801902
protected static function objectToArray($object)
    {
        if (!\is_object($object)) {
            return $object;
        }

        if (\is_object($object)) {
            $object = \get_object_vars($object);
        }

        return \array_map(['static', 'objectToArray'], $object);
    }
959967
public static function getFields($object)
    {
        $objectClass = BeanFactory::getObjectClass($object);
        if(!isset(static::$fields[$objectClass]))
        {
            $annotationsSet = AnnotationManager::getPropertiesAnnotations($objectClass, Column::class);
            $fields = [];
            foreach($annotationsSet as $propertyName => $annotations)
            {
                $annotation = $annotations[0];
                $fields[$annotation->name ?? $propertyName] = $annotation;
            }
            static::$fields[$objectClass] = $fields;
        }
        return static::$fields[$objectClass];
    }
1026854
public static function object2array($object)
    {
        $result = null;
        if (is_object($object)) {
            $objectData = get_object_vars($object);
            if (is_array($objectData) && count($objectData)) {
                $result = array_map('self::object2array', $objectData);
            }
        } else {
            if (is_array($object)) {
                foreach ($object as $item => $value) {
                    $result[$item] = self::object2array($value);
                }
            } else {
                $result = $object;
            }
        }

        return $result;
    }
962059
private function getObjectState($object)
    {
        $class = new \ReflectionClass($object);
        $visibility = \ReflectionProperty::IS_PRIVATE | \ReflectionProperty::IS_PROTECTED;
        $values = [];

        do {
            foreach ($class->getProperties($visibility) as $property) {
                $property->setAccessible(true);
                $values[$property->getName()] = $property->getValue($object);
            }

            $class = $class->getParentClass();
            $visibility = \ReflectionProperty::IS_PRIVATE;
        } while ($class);

        return get_object_vars($object) + $values;
    }
718647
private static function objectProperties($object): array
    {
        if ($object instanceof Serializable) {
            return ['$' => $object->serialize()];
        }

        $class = get_class($object);
        $properties = [];

        do {
            try {
                $properties += Closure::bind(function () use ($object) {
                    return get_object_vars($object);
                }, null, $class)->__invoke();
            } catch (Throwable $e) {
                return get_object_vars($object);
            }
        } while ($class = get_parent_class($class));

        return method_exists($object, '__sleep')
            ? array_intersect_key($properties, array_flip($object->__sleep()))
            : $properties;
    }
563078
public static function objectArray($object)
    {
        if (is_object($object)) {
            $reflectionClass = new \ReflectionClass(get_class($object));
            $array = [];
            foreach ($reflectionClass->getProperties() as $property) {
                $property->setAccessible(true);
                $array[$property->getName()] = $property->getValue($object);
                $property->setAccessible(false);
            }

            //If above method failed? try, this one.
            $array = (empty($array)) ? json_decode(json_encode($object), true) : $array;

            return $array;
        }

        return false;
    }
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;
        }
    }