Create from data in an array.

@param array $data The data to create from.
@return static The resulting data-structure.
190182
public static function fromArray(array $data): self
    {
        $fixed_list = new static();

        $fixed_list->decorated = SplFixedArray::fromArray($data, false);

        return $fixed_list;
    }
420200
public static function create($data)
    {
        if ($data instanceof self) {
            return $data;
        }

        if (\is_array($data)) {
            return self::_createFromArray($data);
        }

        if (\is_string($data)) {
            $class = self::class === \get_called_class() ? Script::class : \get_called_class();

            return new $class($data);
        }

        throw new InvalidException('Failed to create script. Invalid data passed.');
    }
956281
public static function fromArray(array $data)
    {
        $config = isset($data['config']) ? $data['config'] : [];

        return new static($data['name'], $data['pluralName'], $data['uri'], $config);
    }
479107
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['username'])) {
            $self->setUsername($data['username']);
        }
        if (isset($data['name'])) {
            $self->setName($data['name']);
        }

        return $self;
    }
454917
public static function fromArray(array $data)
    {
        $iniSections = IniParser::i()->parseArray($data);

        return self::fromIniSections($iniSections);
    }
1049096
public function create(array $data){
        $model = $this->model->create($data);
        //check for hasMany
        if($this->validateRelationData($this->withHasMany,'many')){
            $model->{$this->withHasMany['relation']}()->saveMany($this->withHasMany['data']);
        }
        //check for belongsToMany
        if($this->validateRelationData($this->withBelongsToMany,'tomany')){
            $model->{$this->withBelongsToMany['relation']}()->sync($this->withBelongsToMany['data']);
        }
        return $model;
    }
308004
public static function factory(array $data = []): self
    {
        $type = $data['type'];
        // fix for php7 reserved name (scalar type hint)
        if ('number' === $type) {
            $type = 'numbr';
        }

        /** @var Node $class */
        $class = 'Gdbots\QueryParser\Node\\' . StringUtils::toCamelFromSnake($type);
        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Node type [%s] does not exist.', $type));
        }

        return $class::fromArray($data);
    }
1103266
public static function createFromArray(array $data)
    {
        $self = new self();

        foreach ($data as $searchResult) {
            $self->addSearchResult(KeySearchResult::createFromArray($searchResult));
        }

        return $self;
    }
1086447
public static function fromArray(array $data) {
		$ret = new FormOptions();
		foreach($data as $value => $text) {
			$ret->add($value, $text);
		}
		return $ret;
	}
837646
public function fromArray($data)
    {
        foreach ($data as $key => $value) {
            if (is_int($key) || $this->isFillable($key)) {
                $this->set($key, $value);
            }
        }
        return $this;
    }
264442
public function createOne($data)
    {
        $row = $this->getTable()::create();

        $data = $this->filterData($data);

        $row->setFromArray($data);
        return $row->save();
    }
469763
public function create(array $data)
    {
        $url = $this->getUrl('create');
        $request = urldecode(json_encode($data, JSON_UNESCAPED_UNICODE));
        $json = $this->curl->post($url, $request);

        return $json;
    }
658523
public static function fromArray(array $data = [])
    {
        $obj = new static();

        foreach ($data as $v) {
            $obj->addNode(Node::factory($v));
        }

        return $obj;
    }
409696
public function create(array $data)
    {
        if (array_key_exists("image", $data)) {
            if (class_exists('\CURLFile')) {
                $data["image"] = new \CURLFile($data['image']);
            } else {
                $data["image"] = '@' . $data['image'];
            }
        }

        $response = $this->request->post("pins", $data);
        return new Pin($this->master, $response);
    }
1291302
public function create(array $data = [])
	{
		$created = $this->model->create($data);

		if( ! $created)
		{
			return new Payload(null, 'not_created');
		}

		// Cache the newly created model and tag it with table's name.
		Cache::tags($this->model->getTable())->forever($created->getKey(), $created);

		return new Payload($created, 'created');
	}
257355
public function create(array &$data = null) {
		$modelClass = $this->getModelClass();

		$model = $modelClass::factory($data);
		$model->setDatagate($this);

		if ($this->hasLocator()) {
			$model->setLocator($this->getLocator());
		}

		if (empty($data)) {
			$model->forceInsert();
		}

		return $model;
	}
917938
private function createNodeFromArray(array $data = []): Node
    {
        if (null === $this->serializer) {
            $this->serializer = new PhpArraySerializer();
        }

        /** @var Node $node */
        $node = $this->serializer->deserialize($data);
        return $node;
    }