Set Struct Data From Array

@param array|\Traversable $data
425516
protected function doSetFrom($data)
    {
        foreach ($data as $k => $v)
            $this->set($k, $v);
    }
889175
public function setData(array $data): self
    {
        assert(count($data) == 2);

        [$allowedEvents, $subscribers] = $data;

        assert($this->checkAllSubscribersAreStatic($subscribers) === true);

        return $this->setAllowedEvents($allowedEvents)->setSubscribers($subscribers);
    }
246773
protected function setRequestData(array $data = [])
    {
        if (($this->post instanceof Collection) && (!$this->post->isEmpty())) {
            unset($this->post);
        }

        $this->post = new Collection($data);

        return $this->post;
    }
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;
	}
264178
public function setData($data)
    {
        $this->data = [];
        $data       = self::normalizeArray($data);

        foreach ($data as $offset => $value) $this->offsetSet($offset, $value);

        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;
    }
555268
public function setData(array $data)
    {
        if (isset($data['attachables'])) {
            $this->setAttachables($data['attachables']);
        }

        if (isset($data['groups'])) {
            $this->setGroups($data['groups']);
        }

        if (isset($data['widgets'])) {
            $this->setWidgets($data['widgets']);
        }

        unset($data['attachables'], $data['groups'], $data['widgets']);

        return parent::setData($data);
    }
1216289
public function fromArray($data)
    {
        if (empty($data)) {
            return $this;
        }
        if (isset($data['type']) && $data['type']) {
            $this->setType($data['type']);
        }
        if (isset($data[$this->getType()]) && $data[$this->getType()]) {
            $this->setValue($data[$this->getType()]);
        }
        return $this;
    }
366333
public function setData(array $data): self
    {
        $this->data = \array_merge($this->data, $data);

        return $this;
    }
501043
protected function setData($data = [])
    {
        if (!isset($data[self::RS_KEY_CODE])) {
            $data[self::RS_KEY_CODE] = 0;
        }
        if (!isset($data[self::RS_KEY_MSG])) {
            $data[self::RS_KEY_MSG] = 'Success';
        }
        if (!isset($data[self::RS_KEY_TYPE])) {
            $data[self::RS_KEY_TYPE] = self::RESPONSE_XHTML;
        }

        if (!isset($data[self::RS_KEY_DATA])) {
            $data[self::RS_KEY_DATA] = new \stdClass();
        } else {
            if (!$data instanceof \stdClass) {
                $data[self::RS_KEY_DATA] = new \stdClass();
            }
        }
        $this->data = $data;
    }
1321478
protected function setWithArrayData(array $data)
    {
        if (isset($data[0])) { // multiple rows
            foreach ($data as $row) {
                $this->set($row);
            }
        } else { // multiple values
            foreach ($data as $col => $val) {
                $this->set($col, $val);
            }
            $this->set_row++;
        }
        return $this;
    }
1090576
public function setArray(array $data)
    {
        foreach ($data as $key => $value)
        {
            array_set($this->settings,$key,$value);
        }

        $this->save($this->path, $this->filename);
        $this->load($this->path, $this->filename);
    }
647029
public function setData($data)
    {
        $resultData = $this->hydrateIfJsonToArray($data);
        if (!empty($resultData)) {
            $this->data = $resultData;
        }
        else {
            $this->data = [];
        }
    }
111809
public function setData($data)
    {
        foreach ($data as $field => $value) {
            $this->set($field, $value);
        }
        return $this;
    }
609848
public function setData($data)
    {
        if (!is_string($data)) {
            $data = json_encode($data);
        }

        $this->data = $data;
    }
725448
public function fromArray($data)
    {
        if ($data) {
            if (isset($data['tags'])) {
                $this->setTags($data['tags']);
            }

            if (isset($data['ts'])) {
                $this->setTimestamp($data['ts']);
            }

            if (isset($data['type'])) {
                $this->setType($data['type']);
            }

            if (isset($data['target'])) {
                $this->setTarget($data['target']);
            }
        }
    }
921713
private function setData(array $data = null)
    {
        if (null === $data || count($data) === 0) {
            $data = new \stdClass();
        }

        $this->data = $data;

        return $this;
    }