Ustawia obiekt DTO na podstawie tabeli
@param array $data
@return \Mmi\Model\Api\Dto
171429
public final function setFromArray(array $data)
    {
        //iteracja po danych
        foreach ($data as $key => $value) {
            //własność nie istnieje
            if (!property_exists($this, $key)) {
                continue;
            }
            $this->{$key} = is_string($value) ? trim($value) : $value;
        }
        //iteracja po zamiennikach
        foreach ($this->_replacementFields as $recordKey => $dtoKey) {
            if (!is_array($dtoKey)) {
                $dtoKey = [$dtoKey];
            }
            //obsługa wielu zastąpień z jednego klucza rekordu
            foreach ($dtoKey as $dKey) {
                //własność nie istnieje
                if (!property_exists($this, $dKey)) {
                    continue;
                }
                if (!array_key_exists($recordKey, $data)) {
                    continue;
                }
                $this->$dKey = trim($data[$recordKey]);
            }
        }
        return $this;
    }
630573
public function create(array $data) {
        $this->_checkAcl('create');
        $pk = $this->_model->insert($data);
        return $pk;
    }
154425
public function create(array $data)
  {
    $AccountType = new AccountType();
    $AccountType->setConnection($this->databaseConnectionName);
    $AccountType->fill($data)->save();

    return $AccountType;
  }
669576
public function setRawData(array $data) {

        $this->rawData = $data;

        if (isset($data['message'])) {
            $this->setMessage($data['message']);
        }

        return $this;

    }
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;
	}
299194
public function prepareSiteData(array $data)
    {
        if (!empty($data['languageIso6392t'])) {
            $data['language'] = $this->getLanguage($data['languageIso6392t']);
        }

        if (!empty($data['countryId'])) {
            $data['country'] = $this->getCountry($data['countryId']);
        }

        return $data;
    }
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;
    }
330917
public static function createFromArray(array $data): self
    {
        $obj = new self();
        $obj->name = $data['name'];
        $obj->type = $data['type'];
        $obj->date = date_create_from_format('d.m.y H:i', sprintf('%s %s', $data['date'], $data['time']));

        if (isset($data['routeIdx'])) {
            $obj->routeIdx = $data['routeIdx'];
        }

        if (isset($data['track'])) {
            $obj->track = $data['track'];
        }

        if (isset($data['rtTrack'])) {
            $obj->rtTrack = $data['rtTrack'];
        }

        if (!$obj->track && $obj->rtTrack) {
            $obj->track = $obj->rtTrack;
        }

        if (!$obj->rtTrack && $obj->track) {
            $obj->rtTrack = $obj->track;
        }

        return $obj;
    }
1143044
public function setDataObject($data)
    {
        if (true === is_object($data)) {
            $data = json_encode($data);
        }

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

        $this->data = $data;

        return $this;
    }
921049
public function toObject(array $data)
    {
        $data = json_decode(json_encode($data));

        if ($data === []) {
            $data = new \StdClass();
        }

        return $data;
    }
201862
protected function setIdFromData(array $data)
    {
        $key = $this->key();
        if (isset($data[$key])) {
            $this->setId($data[$key]);
            unset($data[$key]);
        }

        return $data;
    }
1063890
public function create(array $data)
  {
    $VoucherType = new VoucherType();
    $VoucherType->setConnection($this->databaseConnectionName);
    $VoucherType->fill($data)->save();

    return $VoucherType;
  }
822506
public function setData($data)
    {
        foreach ($data as $key => $dtoData) {
            $this->data[$key] = new DetailsDto($dtoData);
        }
    
        return $this;
    }
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;
    }
553795
public function update($table, array $data = [], $where = '', array $whereBind = [])
    {
        $fields = '';
        $bind = [];
        //jeśli brak danych wyjście z metody
        if (empty($data)) {
            return 1;
        }
        //wiązanie parametrów
        foreach ($data as $key => $value) {
            $bindKey = PdoBindHelper::generateBindKey();
            $fields .= $this->prepareField($key) . ' = :' . $bindKey . ', ';
            $bind[$bindKey] = $value;
        }
        //budowanie zapytania aktualizującego
        $sql = 'UPDATE ' . $this->prepareTable($table) . ' SET ' . rtrim($fields, ', ') . ' ' . $where;
        return $this->query($sql, array_merge($bind, $whereBind))->rowCount();
    }
1321470
public function create(array $data)
    {
        $response = $this->request->post("boards", $data);
        return new Board($this->master, $response);
    }