Record the content of given config object

@param  array|Dictionary $object Original object
@return array|Dictionary         Modified object containing ConfigValue instances
978364
protected function recordObjectContent($object)
	{
		foreach ($object as $k => $v)
		{
			if ($this->canDeduplicate($v) && !$this->shouldPreserve($v))
			{
				$object[$k] = $this->recordObject($v);
			}
		}

		return $object;
	}
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;
    }
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;
    }
40912
public function save($object, $values)
    {
        $value = isset($values[$this->id])
            ? apply_filters('cuztom_field_save_value', $this->parseValue($values[$this->id]), $this)
            : false;

        // Do
        do_action('cuztom_field_save', $this);

        // Save to respective content-type
        switch ($this->metaType) {
            case 'user':
                return (bool) update_user_meta($object, $this->id, $value);
            case 'term':
                return (bool) update_term_meta($object, $this->id, $value);
            case 'post':
                return (bool) update_post_meta($object, $this->id, $value);
        }

        // Default
        return false;
    }
1113762
public function save($object)
    {

        if (is_array($object)) {
            $objectData = $object;
            $newPassword = "";
            if (isset($object['id']) && $object['id'] > 0) {
                $object = $this->find($object['id']);
            } else {
                $object = new User();
            }
            if (isset($objectData['password'])) {
                $newPassword = $objectData['password'];
            }
            if (isset($objectData['enabled']) && $objectData['enabled']) {
                $object->enable();
            } else {
                $object->disable();
            }
            unset($objectData['enabled']);
            if (isset($objectData['groups'])) {
                $groups = $objectData['groups'];
                $groups = array_unique($groups);
                $object->setGroups(array());
                foreach ($groups as $groupId) {
                    $group = $this->groupManager->find($groupId);
                    $object->addGroup($group);
                }
                unset($objectData['groups']);
            }
            $this->assignArrayToObject($object, $objectData);
        } else if (!($object instanceof UserInterface)) {
            $this->addErrorMessage(self::ERROR_WRONG_OBJECT);
        }

        if (!$this->hasError()) {
            if (!empty($newPassword)) {
                $check = $this->userManager->changeUserPassword($object, $newPassword);
                if ($check !== true) {
                    foreach ($check as $pwError) {
                        $this->addErrorMessage($pwError);
                    }
                    $check = false;
                }
            } else {
                $check = $this->userManager->updateUser($object);
            }
            if ($check === true) {
                $this->addSuccessMessage(self::SUCCESS_SAVED);
            }
        }

        return $object;
    }
892794
protected function encodeObject($object)
	{
		foreach ($this->objectEncoders as $className => $callback)
		{
			if ($object instanceof $className)
			{
				return $callback($object);
			}
		}

		throw new RuntimeException('Cannot encode instance of ' . get_class($object));
	}
41406
public function persistObject($object) : array
    {
        $data = $this->preparePersistChangeSet($object);

        $class = $this->getClassMetadata();

        if (! isset($data[$class->getIdentifier()[0]])) {
            $data[$class->getIdentifier()[0]] = $this->generateNextId($class);
        }

        $this->objects[$data[$class->getIdentifier()[0]]] = $data;

        return $data;
    }
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;
  }
284751
public function routeByObject($object) : array
    {
        Assert::isObject($object, "Passed non object value to Commmand Bus: " . TypeDescriptor::createFromVariable($object)->toString() . ". Did you wanted to use convertAndSend?");

        $className = get_class($object);
        if (!array_key_exists($className, $this->classNameToChannelNameMapping)) {
            throw ConfigurationException::create("Can't send command to {$className}. No Command Handler defined for it. Have you forgot to add @CommandHandler to method or @MessageEndpoint to class?");
        }

        return $this->classNameToChannelNameMapping[$className];
    }
488823
public function extract($object)
    {
        $data = $object->getArrayCopy();
        $extractedData = [];

        foreach ($data as $key => $value) {
            $extractName = $this->extractName($key);

            if (array_key_exists($extractName, $this->map)) {
                $value = $this->extractValue($key, $value, $data);
                $extractedData[$extractName] = $value;
            }
        }

        return $extractedData;
    }
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,
        ];
    }
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;
    }
484564
protected function getValueForColumns($object, array $columns)
    {
        $value = $object;

        foreach ($columns as $eachKeyColumn) {
            $keyGetterMethod = 'get' . $eachKeyColumn;
            $value = $value->$keyGetterMethod();
        }

        return $value;
    }
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;
    }
626091
public function mergeProperties($object)
    {
        $defaultValues = get_class_vars(get_class($this));
        $currentValues = get_object_vars($this);
        foreach ($object as $property => $value) {
            if ($property === '_context') {
                continue;
            }
            if ($currentValues[$property] === $defaultValues[$property]) { // Overwrite default values
                $this->$property = $value;
                continue;
            }
            if ($property === '_unmerged') {
                $this->_unmerged = array_merge($this->_unmerged, $value);
                continue;
            }
            if ($currentValues[$property] !== $value) { // New value is not the same?
                if ($defaultValues[$property] === $value) { // but is the same as the default?
                    continue; // Keep current, no notice
                }
                $identity = method_exists($object, 'identity') ? $object->identity() : get_class($object);
                $context1 = $this->_context;
                $context2 = property_exists($object, '_context') ? $object->_context : 'unknown';
                if (is_object($this->$property) && $this->$property instanceof AbstractAnnotation) {
                    $context1 = $this->$property->_context;
                }
                Logger::warning('Multiple definitions for ' . $identity . '->' . $property . "\n     Using: " . $context1 . "\n  Skipping: " . $context2);
            }
        }
    }
1181256
private function _setFields($object, $fields)
    {
        $fields = is_array($fields) ? $fields : [];
        foreach ($fields as $sKey => $sValue) {
            $object->$sKey = oxNew('oxField', $sValue);
        }

        return $object;
    }
953126
protected function _getObjectFieldValues($object)
    {
        $result = array();
        $fields = $object->getFieldNames();
        $tableName = $object->getCoreTableName();
        foreach ($fields as $field) {
            $fieldName = $tableName.'__'.$field;
            $result[$field] = $object->$fieldName->value;
        }

        return $result;
    }