Load settings from an array.
@param array $arr Settings array.
517000
public function load($arr) {
        foreach($arr as $key=>$value) {
            if(array_key_exists($key, self::$KEYS)) {
                if($this->valid(self::$KEYS[$key], $value)) {
                    $this->$key = $value;
                }
            }
        }
    }
18716
public function loadFromArray(array $entries)
     {
         foreach ($entries as $var=>$val) {
             switch ($var) {
                case 'name': $this->setName($val); break;
                case 'version': $this->setVersion($val); break;
                case 'relative_path': $this->setRelativePath($val); break;
                case 'assets_path':
                case 'path':
                    $this->setAssetsPath($val); break;
                case 'assets_presets': $this->setAssetsPresets($val); break;
            }
         }
         return $this;
     }
1313343
private function loadSettings()
    {

        $settings = $this->manage_settings->getSetting($this);

        if (isset($settings['extensions'])) {
            //loading all extensions
            try {
                $this->loadExtensions($settings['extensions']);
            } catch (\Exception $ex) {
                throw new \OWeb\Exception('Failed to load all Extensions in' . OWEB_CONFIG, 0, $ex);
            }
        }
    }
402582
protected function to2DArray($arr)
    {
        if (empty($arr) || !is_array($arr)) {
            return [];
        }
        if (count($arr) == count($arr, COUNT_RECURSIVE)) {
            return [$arr];
        }
        return $arr;
    }
299950
public static function setSettings( array $values )
	{
		foreach ($values as $name => $value)
			self::setSetting($name, $value);
	}
1317715
public static function Deserialize($arr){
		if(is_null($arr))
			return null;
		$res=Array();
		$i=-1;
		$len=sizeof($arr);
		while(++$i<$len)
			$res[$arr[$i]->Key]=$arr[$i]->Value;
		return $res;
	}
746639
public function fromArray($arr)
    {
        if (!empty($arr)) {
            // Iterate over each element in array
            foreach ($arr as $k => $v) {
                // If the value is an array, it means, it is an object after conversion
                if (is_array($v)) {
                    // Determine the class of the object
                    if (($clazz = ReflectionHelper::getPropertyClass(get_class($this), $k)) != null) {
                        // If the value is an associative array, it means, its an object. Just make recursive call to it.
                        if (empty($v)) {
                            if (ReflectionHelper::isPropertyClassArray(get_class($this), $k)) {
                                // It means, it is an array of objects.
                                $this->assignValue($k, array());
                                continue;
                            }
                            $o = new $clazz();
                            //$arr = array();
                            $this->assignValue($k, $o);
                        } elseif (ArrayHelper::isAssocArray($v)) {
                            /** @var self $o */
                            $o = new $clazz();
                            $o->fromArray($v);
                            $this->assignValue($k, $o);
                        } else {
                            // Else, value is an array of object/data
                            $arr = array();
                            // Iterate through each element in that array.
                            foreach ($v as $nk => $nv) {
                                if (is_array($nv)) {
                                    $o = new $clazz();
                                    $o->fromArray($nv);
                                    $arr[$nk] = $o;
                                } else {
                                    $arr[$nk] = $nv;
                                }
                            }
                            $this->assignValue($k, $arr);
                        }
                    } else {
                        $this->assignValue($k, $v);
                    }
                } else {
                    $this->assignValue($k, $v);
                }
            }
        }
        return $this;
    }
1161562
function SetStylesArray($arr)
	{
		$style = '';
		foreach (['B', 'I'] as $s) {
			if (isset($arr[$s])) {
				if ($arr[$s]) {
					$this->$s = true;
					$style .= $s;
				} else {
					$this->$s = false;
				}
			} elseif ($this->$s) {
				$style .= $s;
			}
		}
		$this->currentfontstyle = $style;
		$this->SetFont('', $style, 0, false);
	}
1250703
static public function multi_stripslashes(&$arr) 
    {
        foreach($arr as $k => $v) {
            if(is_array($v)) {
                self::multi_stripslashes($arr[$k]);
            } else {
                $arr[$k] = stripslashes($v);
            }
        }
    }
361323
public static void loadArrayA(
			Object[] arr,
			int idx,
			Object val,
			String calleeClass,
			String callerMethod,
			String callerClass,
			int callerValKind,
			Object caller) {
		final String elementType = calleeClass.substring(1);	
		NativeInterface.loadFieldA(val, SPECIAL_VAL_NORMAL, arr, calleeClass, "_"+idx, elementType, callerClass, callerMethod, callerValKind, caller);
	}
16928
public function loadDataFromRequest(array $request)
    {
        foreach ($request as $key => $value) {
            if (in_array($key, $this->requestVariables)) {
                $this->data[$key] = $value;
            }
        }
    }
1126423
public function mergeArray(array $arr): DataMap
    {
        $this->data = array_merge($this->data, $arr);
        return $this;
    }
1162492
public function fromArray(array $array) {
        $rows = count($array);
        for ($i=$rows;$i-->0;) {
            $this[$i]->fromArray($array[$i]);
        }
    }
698889
public function fromArray($arr)
    {
        $obj  = $this->getWorkerObject();
        foreach ($arr as $element) {
            $obj->clear();
            $obj->fromArray($element);
            $this->append($obj->toArray());
        }
    }
1293817
protected function load(array $defaults)
	{
		if ( file_exists($this->filename) ) {
			$stored_settings = json_decode(file_get_contents($this->filename), true);
			$new_defaults = array_diff_key($defaults, $stored_settings);

			if ( $new_defaults ) {
				$this->settings = array_merge($stored_settings, $new_defaults);
				$this->store();
			}
			else {
				$this->settings = $stored_settings;
			}

			return;
		}

		$this->settings = $defaults;
		$this->store();
	}
595106
public function setTimeoutsFromArray($arr) {
    /*
     * Validation is lax in here because this should only ever be used with
     * getTimeouts() return values. If people are using it by hand then there
     * might be something wrong with the API.
     */
    if(!is_array($arr)) {
      throw SagException('Expected an array and got something else.');
    }

    if(is_int($arr['open'])) {
      $this->setOpenTimeout($arr['open']);
    }

    if(is_int($arr['rwSeconds'])) {
      if(is_int($arr['rwMicroseconds'])) {
        $this->setRWTimeout($arr['rwSeconds'], $arr['rwMicroseconds']);
      }
      else {
        $this->setRWTimeout($arr['rwSeconds']);
      }
    }
  }
890764
function Read($arr)
	{
		foreach (get_object_vars($this) as $prop)
		{
			if (array_key_exists($prop,$arr))
			{
				$this->$prop = $arr[$prop];
			}
		}
	}