Makes a config object from an array, making the first level keys properties a new object.
Property values are converted to camelCase and are not set if one already exists.
@param array $configArray Config array.
@return stdClass The config object
190276
public function makeConfigFromArray($configArray = [])
    {
        $object = new stdClass;

        if (!is_array($configArray)) {
            return $object;
        }

        foreach ($configArray as $name => $value) {
            $_name = camel_case($name);
            $object->{$name} = $object->{$_name} = $value;
        }

        return $object;
    }
1291944
final public static function getInstance($config = array())
    {
        static $instance;

        if ($instance === NULL)
        {
            if(!$config instanceof KObjectConfig) {
                $config = new KObjectConfig($config);
            }

            $instance = new self($config);
        }

        return $instance;
    }
697653
public function init(array $config) {
		if ($config) {
			foreach ($config as $key => $value) {
				$method = 'set' . ucfirst(camel_case($key));

				if (method_exists($this, $method)) {
					$this->$method($value);
				}
			}
		}

		return $this;
	}
854657
public static function buildObject($array) {
        $obj = new \stdClass();

        foreach ($array as $key => $value) {
            if (is_array($value) || is_object($value)) {
                $obj->{$key} = static::buildObject($value);
            } else {
                $obj->{$key} = static::autobox($value);
            }
        }

        return $obj;
    }
79110
public function arrayKeysSnakeRecursive($array)
    {
        $result = [];

        $array = arrayable($array) ? $array->toArray() : $array;

        array_walk($array, function ($value, $key) use (&$result) {
            $result[snake_case($key)] = arrayable($value) || is_array($value)
                ? $this->arrayKeysSnakeRecursive($value)
                : $value;
        });

        return coollect($result);
    }
480255
public function fromArray($array) {
        if ($array instanceof Record) {
            $array = $array->toArray('', false);
        }
        foreach ($array as $key => $value) {
            if (isset($value)) {
                if($value instanceof Search){
                    $value=$value->value();
                }
                $this->$key = $value;
            }
        }
    }
498786
private function setConfigOptions(array $config_array)
    {
        foreach ($config_array as $type => $value) {
            $this->setConfigOption($type, $value);
        }

        return true;
    }
406952
public static function createFromAttributeArray(array $array)
	{
		$input = array_change_key_case($array, CASE_LOWER);

		$response = new Response();

		foreach (Response::$attributeMapping as $attribute => $localVariable) {
			$loweredAttribute = strtolower($attribute);

			if (array_key_exists($loweredAttribute, $input)) {
				$response->{$localVariable} = $input[$loweredAttribute];
			}
		}

		return $response;
	}
1202589
protected function createArrayType($array)
    {
        $type = new ArrayAccessType;

        foreach ($array as $key=>$value) {
            $type[$key] = $this->toType($value);
        }

        return $type;
    }
1168253
public static function keyToCase($array)
    {
        $result = [];
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $result[Strings::camel2case($key)] = self::keyToCase($value);
            } else {
                $result[Strings::camel2case($key)] = $value;
            }
        }
        return $result;
    }
1372661
protected function doCreateObject(array $array)
    {
        $factor = new Factor($array);

        if (isset($array['factorValues']) && is_array($array['factorValues'])) {

            foreach ($array['factorValues'] as $factorValueData) {
                $mapper = new FactorValuesMapper();
                $factor->values[] = $mapper->createObject($factorValueData);
            }
        }

        return $factor;
    }
1300763
protected function doCreateObject(array $array)
    {
        $this->data = $array;
        $this->document = new Document($this->data);
        $this->setFunctionalNames()
             ->setAttributes()
             ->setMedia();

        return $this->document;
    }
477588
public function recursiveConvertInArray($array)
    {
        $newArray = [];
        foreach ($array as $key => $value) {
            if ($value instanceof \MongoDB\Model\BSONDocument || $value instanceof \MongoDB\Model\BSONArray) {
                $value = (array) $value;
            }

            if (is_array($value)) {
                $value = $this->recursiveConvertInArray($value);
            }

            $newArray[$key] = $value;
        }

        return $newArray;
    }
1011146
public function setConfig(array $config = [])
    {
        $config = $config + $this->config;

        foreach ($this->defaults as $key => $value) {
            if (!array_key_exists($key, $config)) {
                $config[$key] = $value;
            }
        }

        $this->config = $config;

        return $this;
    }
749329
public function arrayToObject(array $array): \stdClass
    {
        $objResult = new \stdClass();

        foreach ($array as $varKey => $varValue) {
            $objResult->{$varKey} = $varValue;
        }

        return $objResult;
    }
1176714
public function getStyleArray($array)
    {
        switch ($this->parentPropertyName) {
            case 'endColor':
                $key = 'endcolor';
                break;
            case 'color':
                $key = 'color';
                break;
            case 'startColor':
                $key = 'startcolor';
                break;

        }
        return $this->parent->getStyleArray(array($key => $array));
    }
79161
public static function convertToOneDimensionalArray($array)
    {
        $newArray = array();
        if (is_array($array))
        {
            foreach ($array as $value)
            {
                $newArray = array_merge($newArray, self::convertToOneDimensionalArray($value));
            }
        } else
        {
            $newArray[] = $array;
        }

        return $newArray;
    }