Create from array.

@param array $array

@return self
320456
public static function createFromArray(array $array): self
    {
        $config = new self(
            ($array['language'] ?? null),
            ($array['store_searchable_metadata'] ?? true)
        );

        $config->synonyms = array_map(function (array $synonym) {
            return Synonym::createFromArray($synonym);
        }, $array['synonyms'] ?? []);
        $config->shards = (int) ($array['shards'] ?? self::DEFAULT_SHARDS);
        $config->replicas = (int) ($array['replicas'] ?? self::DEFAULT_REPLICAS);

        return $config;
    }
317744
public static function fromArray(array $file): self
    {
        $url = $file['file_ext'] === 'zip'
            ? $file['large_file_url']
            : $file['file_url'];

        return new self(
            $file['file_size'],
            $url,
            self::getFileTypeByExtension($file['file_ext']),
            $file['image_width'],
            $file['image_height']
        );
    }
788908
protected function doCreateObject(array $array)
    {
        $this->data    = $array;
        $this->product = new Product($this->data);
        $this->setBrands()
             ->setFunctionalNames()
             ->setPromotions()
             ->setProductsToPromotions()
             ->setOptions()
             ->setAttributes()
             ->setMedia();

        return $this->product;
    }
673869
public static function createFromArray(array $array): self
    {
        if (empty($array['name'])) {
            throw InvalidFormatException::queryFormatNotValid($array);
        }

        return self::create(
            $array['name'],
            $array['field'] ?? 'uuid.type',
            (int) ($array['application_type'] ?? Filter::AT_LEAST_ONE),
            $array['filter_type'] ?? Filter::TYPE_FIELD,
            $array['subgroup'] ?? [],
            $array['sort'] ?? self::SORT_BY_COUNT_DESC,
            $array['limit'] ?? self::NO_LIMIT
        );
    }
76968
public static function expandFromDotNotatedKeys(array $array) {
    $data = new Data();

    // @todo Make this work at all levels of array.
    foreach ($array as $key => $value) {
      $data->set($key, $value);
    }

    return $data->export();
  }
1005376
public static function arrayToObject($array)
    {
        $obj = new \stdClass();
        foreach($array as $k => $v)
        {
            if(strlen($k))
            {
                if(is_array($v) && count($v) > 0)
                {
                    // recursive
                    $instance = new static;
                    $obj->{$k} = $instance->arrayToObject($v);
                }
                else
                {
                    $obj->{$k} = $v;
                }
            }
        }
        return $obj;
    }
898143
protected function doCreateObject(array $array)
    {
        $this->data     = $array;
        $this->category = new Category($this->data);
        $this->setMedia()
             ->setAttributes();

        return $this->category;
    }
336383
final public function fromArray(Array $data): self
    {
        foreach ($data as $key => $value) {
            $method = 'set' . ucfirst($key);

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

        return $this;
    }
269952
public function copyToArray(array &$array)
    {
        $array['name']         = $this->name;
        $array['defaultEntry'] = $this->defaultEntry;
        $array['description']  = $this->description;
        $array['descriptions'] = LanguageUtility::convertArrayOfArrayCopyableToArray($this->descriptions);
        $array['attributes']   = LanguageUtility::convertArrayOfArrayCopyableToArray($this->attributes);
    }
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;
    }
381666
protected function doCreateObject(array $array)
    {
        $this->data        = $array;
        $this->entityGroup = new EntityGroup($this->data);
        $this->setMedia()
             ->setAttributes();

        return $this->entityGroup;
    }
1040187
public function fromArray($array) {
		$array=parent::fromArray($array);
		foreach ( $array as $key => $value ) {
			$this->setProperty($key, $value);
		}
		return $array;
	}
18408
function fromArray($array) {
		if (!is_array($array) && !is_object($array)) {
			throw new RuntimeException('Argument must be array or object');
		}
		foreach ($array as $column => &$v) {
			if (
				is_string($column) === false
				|| !isset(static::$_columns[$column])
			) {
				continue;
			}
			$this->{'set' . $column}($v);
		}
		return $this;
	}
1230029
public function merge($array)
    {
        if ($this->isInstanceOf($array, $this)) {
            $array = $array->val();
        }

        $this->val(array_merge($this->val(), $array));

        return $this;
    }
1002384
public function fromArray(array $array, $clear = false)
  {
    if ($clear) {
      $this->vars = array();
    }

    foreach ($array as $key => $val) {
      $this->set($key, $val);
    }

    return $this;
  }
656206
protected function fromArray(array $array)
    {
        if (is_array($array)) {
            foreach ($array as $index => $element) {
                if (is_array($element)) {
                    $this->xmlWriter->startElement($index);
                    $this->fromArray($element);
                    $this->xmlWriter->endElement();
                } else {
                    $this->xmlWriter->startElement($index);
                    $this->xmlWriter->text($element);
                    $this->xmlWriter->endElement();
                }
            }
        }
    }
1175650
protected function createModelFromArray(array $array)
    {
        $model = new Saldo();
        $saldoDeg = $this->splitDeg($array[3]);

        $amount = str_replace(',', '.', $saldoDeg[1]);
        $creditDebit = trim($saldoDeg[0]);

        if (static::SALDO_DEBIT == $creditDebit) {
            $amount = - (float) $amount;
        } elseif (static::SALDO_CREDIT == $creditDebit) {
            $amount = (float) $amount;
        } else {
            throw new \Exception('Invalid Soll-Haben-Kennzeichen: ' . $creditDebit);
        }

        $model->setAmount($amount);
        $model->setCurrency($saldoDeg[2]);

        $valutaDate = $saldoDeg[3];
        preg_match('/(\d{4})(\d{2})(\d{2})/', $valutaDate, $m);
        $valutaDate = new \DateTime($m[1] . '-' . $m[2] . '-' . $m[3]);
        $model->setValuta($valutaDate);

        return $model;
    }