@param array $data

@throws \InvalidArgumentException

@return $this
775286
protected function setData($data)
    {
        $data = (array) json_decode($data, true);

        if (false === array_key_exists('data', $data)) {
            throw new \InvalidArgumentException('Provided JSON has no `data` member defined');
        }

        $this->data = $data['data'];

        if (!empty($data['included'])) {
            $this->include = $data['included'];
        }
    }
1221588
public function initFromArray(array $data) {

        $this->traitInitFromArray($data);

        $this->setOldestOutstanding((new OldestOutstandingPart())->initFromArray($data['oldest_outstanding']));

        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;
    }
1069423
private function setValues(array $data)
    {
        foreach ($data as $key => $datum) {
            $this->set($key, $datum);
        }
        return $this;
    }
708099
public function setData(array $data)
    {
        if (count($data)) {
            $data = array_combine($data, $data);
        }

        $this->_data = $data;

        return $this;
    }
786531
protected function setParsedBody($data)
    {
        if (! is_null($data) && ! is_array($data) && ! is_object($data)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid parsed body provided; must be an null, or array, '
                . 'or object, "%s" provided.',
                gettype($data)
            ));
        }
        $this->parsedBody = $data;

        return $this;
    }
118236
public function setData(array $data)
    {
        $data = $this->setIdFromData($data);

        parent::setData($data);
        return $this;
    }
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;
    }
64039
public function setData($data)
    {
        if ($data instanceof Collection || $data instanceof Model) {
            $this->data = $data->toArray();
        } elseif (is_array($data) || $data instanceof Repository) {
            $this->data = $data;
        } else {
            throw new \InvalidArgumentException('Data must be an array, a Collection, a Model or a Repository');
        }
    }
593848
public static function normalizeArray($data)
    {
        if ($data instanceof DataObjectInterface) {
            $data = $data->getData();
        } else if ($data instanceof \ArrayObject) {
            $data = $data->getArrayCopy();
        } else if ($data instanceof \Traversable) {
            $data = iterator_to_array($data);
        }

        if (!is_array($data)) throw new \InvalidArgumentException();

        return $data;
    }
255363
public function setData($data)
    {
      if(!is_string($data) && strlen(trim($data)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid data, must be a non empty string');

      $this->data = $data;
    }
307014
public function setData(array $data)
    {
        $this->data = $this->parseData($data);

        $this->setRules($this->initialRules);

        return $this;
    }
193720
public function setData(array $data)
    {
        $this->data = $data;
        
        // Force recreation of collections and properties.
        $this->educations = null;
        $this->employments = null;
        $this->link = null;
        
        return $this;
    }
1288732
public function setData(array $data) {
		$this->data = $data;

		$this->resetFields();

		foreach($data as $name=>$data)
			$this->newField($name, $data);

		$this->updateChilds();

		return $this;
	}
120468
public function setFromArray(array $data)
    {
        $data = array_intersect_key($data, $this->_data);

        foreach ($data as $columnName => $value) {
            $this->__set($columnName, $value);
        }

        return $this;
    }
143069
public function addData($data) {
        if (\is_string($data)) {
            $this->addDataSql($data);
        } elseif (\is_array($data)) {
            $this->addDataArray($data);
        } elseif (\is_object($data)) {
            $this->addDataObjectCollection($data);
        } elseif (\is_resource($data)) {
            $this->addDataQueryResource($data);
        } else {
            throw new InvalidArgumentException('Unsupported data type.');
        }
        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;
	}