@param array $data

@return $this
350863
public function initFromArray(array $data) {

        $this->traitInitFromArray($data);

        if (!empty($data['funding'])) {
            $this->setFunding((new FundingPart())->initFromArray($data['funding']));
        }

        if (!empty($data['margin_call'])) {
            $this->setMarginCall((new MarginCallPart())->initFromArray($data['margin_call']));
        }

        if (!empty($data['accounts'])) {

            $this->setAccounts([]);

            foreach ($data['accounts'] as $currency => $details) {
                $details['currency'] = $currency;
                $this->accounts[] = (new AccountPart())->initFromArray($details);
            }

        }

        if (!empty($data['position'])) {
            $this->setPosition((new PositionPart())->initFromArray($data['position']));
        }

        return $this;

    }
303475
public function fill(array $data)
    {
        /* @var Field $field */
        foreach ($this->fields() as $field) {
            $field->fill($data);
        }

        return $this;
    }
1110102
public function set(array $data)
    {
        foreach ($data as $field => $value) {
            $this->fields[] = $field;
            $this->dataParameters[":{$field}"] = $value;
        }
        return $this;
    }
1069423
private function setValues(array $data)
    {
        foreach ($data as $key => $datum) {
            $this->set($key, $datum);
        }
        return $this;
    }
1315293
public function rows($data)
    {
        if ($data instanceof Arrayable) {
            $data = $data->toArray();
        }

        $this->setRowsData($data);

        return $this;
    }
1144812
public function setDefaultData(array $data)
    {
        foreach ($data as $key => $val) {
            $this->defaultData[$key] = $val;
        }

        return $this;
    }
132967
public function bind(array $data)
	{
		if (null === $this->object)
		{
			$this->object = new Object;
		}

		$this->object->bind($data);

		return $this;
	}
791450
public function set(array $data)
	{
		foreach ($data as $key => $value)
		{
			if (isset(static::$_mass_whitelist))
			{
				in_array($key, static::$_mass_whitelist) and $this->_data[$key] = $value;
			}
			elseif (isset(static::$_mass_blacklist))
			{
				( ! in_array($key, static::$_mass_blacklist)) and $this->_data[$key] = $value;
			}
			else
			{
				// no static::$_mass_whitelist or static::$_mass_blacklist set, proceed with default behavior
				$this->_data[$key] = $value;
			}
		}
		return $this;
	}
1009111
public function merge(array $data)
    {
        $this->items = $this->blueprints()->mergeData($this->items, $data);

        return $this;
    }
139619
public function add_data(array $data)
	{
		$ar = \func_get_args();
		foreach ( $ar as $d ){
			if ( \is_array($d) ){
				$this->data = $this->has_data() ? array_merge($this->data,$d) : $d;
			}
		}
		return $this;
	}
837646
public function fromArray($data)
    {
        foreach ($data as $key => $value) {
            if (is_int($key) || $this->isFillable($key)) {
                $this->set($key, $value);
            }
        }
        return $this;
    }
430888
public function setData($data)
    {
        $this->data = $data instanceof Data ? $data : new Data($data);

        return $this;
    }
783856
public function data(array $data = null)
    {
        if (is_null($data)) {
            return $this->data;
        }

        $this->data = $data;

        return $this;
    }
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;
    }
157820
public function data($data = []) {
		$bind =& $this->_entity;

		if ($data) {
			$bind ? $bind->set($data) : $this->_data = array_merge($this->_data, $data);
			return $this;
		}
		$data = $bind ? $bind->data() : $this->_data;
		return ($list = $this->_config['whitelist']) ? array_intersect_key($data, $list) : $data;
	}
1352436
public function setData(array $data)
    {
        $keys = $this->validDataFromRequest();
        $data = array_intersect_key($data, array_flip($keys));
        $this->mergeData($data);

        return $this;
    }
1253975
public function data(array $data)
    {
        if (!is_array($this->props['data'])) $this->props['data'] = [];
        $this->props['data'] = array_merge($this->props['data'], $data);
        return $this;
    }