@param $object

@return LabeledPropertyMetadata[]
962055
public function getLabeledPropertiesToBeSet($object)
    {
        return array_filter($this->getLabeledProperties(), function (LabeledPropertyMetadata $labeledPropertyMetadata) use ($object) {
            return true === $labeledPropertyMetadata->getValue($object);
        });
    }
423310
public static function getRelationFieldNames($object)
    {
        $class = BeanFactory::getObjectClass($object);
        if(!isset(static::$relationFieldsNames[$class]))
        {
            $relations = AnnotationManager::getPropertiesAnnotations($class, RelationBase::class);
            $result = array_keys($relations);
            foreach($relations as $annotations)
            {
                $annotation = $annotations[0];
                if(($annotation instanceof ManyToMany || $annotation instanceof PolymorphicManyToMany) && $annotation->rightMany)
                {
                    $result[] = $annotation->rightMany;
                }
            }
            static::$relationFieldsNames[$class] = $result;
        }
        return static::$relationFieldsNames[$class];
    }
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 ?? [];
    }
1295218
public function getIdentifierValues($object)
    {
        $fields = $this->getReflectionFields();
        return $fields[$this->identifierPropertyName]->getValue($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];
    }
716694
protected function parseToArray($object): array
    {
        if (!is_array($object)) {
            $attributes = method_exists($object, 'getAttributes')
                ? $object->getAttributes()
                : get_object_vars($object);

            return $attributes;
        }

        return $object;
    }
1285087
public static function serialize($object) : array
    {
        $serializer = new static();
        $data = $serializer->serializeObject($object);

        if (sizeof($serializer->referencesUsed)) {
            foreach ($serializer->referencesUsed as $index) {
                $data['@references'][$index] = $serializer->references[$index];
            }
        }

        return $data;
    }
497554
public function getGettablePropertiesOfObject($object)
    {
        $className = get_class($object);

        if (false === isset($this->gettablePropertiesOfObjects[$className])) {
            $this->gettablePropertiesOfObjects[$className] = [];
            $properties = $this->getReflectionService()->getClassPropertyNames($className);

            foreach ($properties as $propertyName) {
                if (true === $this->isPropertyGettable($object, $propertyName)) {
                    $this->gettablePropertiesOfObjects[$className][] = $propertyName;
                }
            }
        }

        return $this->gettablePropertiesOfObjects[$className];
    }
123689
public function normalize($object) : array
    {
        return $this->asArray ? $this->normalizeAsArray($object) : $this->normalizeAsAttributes($object);
    }
97499
protected function normalizeAsAttributes($object) : array
    {
        if (is_null($object)) {
            return $this->nullObjectAttributes();
        }

        $attributesMap = $this->getAttributesDictionnary();

        $wrapper = $this->factory->make($object);

        $normalizedAttributes = [];

        foreach ($attributesMap as $embedKey => $parentKey) {
            $normalizedAttributes[$parentKey] = $wrapper->getEntityAttribute($embedKey);
        }

        return $normalizedAttributes;
    }
983158
protected function getObjectParams(DOMElement $object)
	{
		$params      = [];
		$settingName = strtolower($this->settingName);
		foreach ($object->getElementsByTagName('param') as $param)
		{
			$paramName = strtolower($param->getAttribute('name'));
			if ($paramName === $settingName && $param->parentNode->isSameNode($object))
			{
				$params[] = $param;
			}
		}

		return $params;
	}
295807
private function setArray($object): array
    {
        $data = [];
        $configurationObject = $this->configuration->getConfigurationObjectForClass(new ClassName(get_class($object)));

        $identifier = $configurationObject->getIdentifier();
        if ($identifier !== '') {
            $data[$this->configuration->getIdentifierAttribute()] = $identifier;
        }

        foreach ($configurationObject->getAttributes() as $attribute) {
            $type = $configurationObject->getTypeForAttribute($attribute);
            $data = $this->processSerializeForType($type, $object, $data, $attribute);
        }

        return $data;
    }
699435
private static function getReflectionProperties($object)
    {
        $class = get_class($object);

        if (!isset(self::$reflectionProperties[$class])) {
            $reflection = new \ReflectionClass($object);
            $reflectionProperties = array_filter($reflection->getProperties(), function($property) {
                // We only need object context properties???
                return !$property->isStatic();
            });
            self::$reflectionProperties[$class] = [];

            foreach ($reflectionProperties as $property) {
                // Is it always necessary?
                $property->setAccessible(true);

                self::$reflectionProperties[$class][$property->getName()] = $property;
            }
        }

        return self::$reflectionProperties[$class];
    }
908168
public function extract($object)
    {
        return [
            'name' => $object->getFileName(),
            'type' => $object->getType(),
            'size' => $object->getSize(),
            'tmp_name' => $object->getTempName(),
            'error' => $object->getError(),
            'size' => [
                0 => $object->getWidth(),
                1 => $object->getHeight(),
                2 => $object->getMimeType(),
            ],
        ];
    }
1075557
public function toArray($object = null): array
    {
        Assert::nullOrObject($object);

        if ($object === null) {
            $object = $this;
        }

        $ignoredProperties = array();
        if ($object instanceof ArrayableInterface) {
            $ignoredProperties = $object->getIgnoredProperties();
        }
        $arr = get_object_vars($object);

        $func = function ($var) {
            if ($var instanceof ArrayableInterface) {
                return $var->toArray();
            } elseif ($var instanceof DateTime) {
                return $var->format(\DateTime::ISO8601);
            } elseif ($var instanceof ArrayAccess) {
                return (array) $var;
            } elseif (class_exists('\Sylius\Component\Resource\Model\ResourceInterface')) {
                if ($var instanceof \Sylius\Component\Resource\Model\ResourceInterface) {
                    return get_class($var).'#'.$var->getId();
                }
            }

            return get_class($var);
        };

        foreach ($arr as $k => $v) {
            if (substr($k, 0, 2) == '__') {
                unset($arr[$k]);
            } elseif (in_array($k, $ignoredProperties)) {
                unset($arr[$k]);
            } elseif (is_resource($v)) {
                unset($arr[$k]);
            } elseif (is_object($v)) {
                if (interface_exists('\Doctrine\Common\Collections\Collection')) {
                    if ($v instanceof \Doctrine\Common\Collections\Collection) {
                        $list = array();
                        foreach ($v as $v2) {
                            $list[] = $func($v2);
                        }
                        $arr[$k] = $list;

                        continue;
                    }
                }

                $arr[$k] = $func($v);
            }
        }

        return $arr;
    }
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;
    }
580944
protected function getSetProps($object = null) {
    $object = $object ?: $this->value;
    if (gettype($object) !== 'object') {
      return [];
    }

    return array_keys((array) $object);
  }