Attempts to map array data to object properties.

@param array $data Key value data to populate object properties.

@return void
773594
protected function loadData(array $data = [])
    {
        foreach ($data as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }
1242834
public function setData($data)
	{
		if( is_null($data) )
		{
			$data = new stdClass();
		}

		if( $data instanceof stdClass )
		{
			$this->data = $data;
		}
		else
		{
			$this->data = (object) $data;
		}
		
		$this->id = $this->data->{$this->idKey};
		$this->type = $this->data->{$this->typeKey};

		$dataVars = get_object_vars($this->data);
		foreach ($this->guarded as $guardedProperty)
		{
			if( array_key_exists($guardedProperty, $dataVars) )
			{
				$this->protected[$guardedProperty] = $this->data->$guardedProperty;
				unset($this->data->$guardedProperty);
			}
		}
	}
231677
public function unserialize($data) {
		$vars = unserialize($data);
		parent::_init();

		foreach ($vars as $key => $value) {
			$this->{$key} = $value;
		}
	}
975608
public function fill(array $data)
    {
        $this->attributes = array_merge($this->attributes, $this->filterFillable($data));
    }
49452
public function unserialize(/* mixed */ $data): void 
    {
        $values = unserialize($data);
        foreach ($values as $key=>$value) {
                $this->$key = $value;
        }
    }
1165428
public function set_data($data) {
        $purpose = $this->get_persistent();

        $count = 0;
        foreach ($this->existingoverrides as $override) {
            $overridedata = $this->convert_existing_data_to_values($override->to_record());
            foreach ($overridedata as $key => $value) {
                $keyname = "roleoverride_{$key}[{$count}]";
                $data->$keyname = $value;
            }
            $count++;
        }

        parent::set_data($data);
    }
427723
public function initialize(array $data = array())
    {
        if($this->exe->flash->has('form_data'))
            $this->set($this->exe->flash->get('form_data'));

        parent::initialize($data);
    }
1374919
public function populate($data = array())
    {
        if (isset($data['name']) && $data['name'] !== null) {
            $this->name = $data['name'];
        }

        if (isset($data['type']) && $data['type'] !== null) {
            $this->type = $data['type'];
        }
    }
183322
public function populate($data = array())
    {
        $this->appId = (isset($data['appId'])) ? $data['appId'] : null;
        $this->appSecret = (isset($data['appSecret'])) ? $data['appSecret'] : null;

    }
387387
public function set(array $data)
    {
        foreach ($data as $name => $value) {
            $this->setField($name, $value);
        }
    }
1268766
protected function setMapDefaults(array $data)
    {
        $defaults = ['tokens', 'defaults', 'host', 'accepts'];
        foreach ($data as $name => $value) {
            if (in_array($name, $defaults)) {
                $this->map->$name($value);
            }
        }
    }
58708
public function unserialize($data)
    {
        $data = unserialize($data);

        foreach (static::$keys as $key) {
            $this->{$key} = $data[$key];
        }
    }
404128
public function SetData($Data) {
      if (is_object($Data) === TRUE) {
         // If this is a result object (/garden/library/database/class.dataset.php)
         // retrieve it's values as arrays
         if ($Data instanceof DataSet) {
            $ResultSet = $Data->ResultArray();
            if (count($ResultSet) > 0)
               $this->_DataArray = $ResultSet[0];
               
         } else {
            // Otherwise assume it is an object representation of a data row.
            $this->_DataArray = Gdn_Format::ObjectAsArray($Data);
         }
      } else if (is_array($Data)) {
         $this->_DataArray = $Data;
      }
   }
52910
protected function convert($data)
    {
        foreach ($data[0] as $key => $value) {
            if (!$this->_kept && !$this->_stashed) {
                $this->$key = $value;
                $this->setKey($key, $value);
            } else {
                if ($this->_kept) {
                    $this->_keptData[$key] = $value;
                }
                if ($this->_stashed) {
                    $this->_stashedData[$key] = $value;
                }
            }

            $this->data[$key] = $value;
        }
    }
1081089
public function populate($data = array())
    {
        if (isset($data['id']) && $data['id'] != null) {
            $this->id    = $data['id'];
        }

        if (isset($data['roleId']) && $data['roleId'] != null) {
            $this->roleId    = $data['roleId'];
        }
        if (isset($data['parent']) && $data['parent'] != null) {
            $this->parent    = $data['parent'];
        }
    }
928646
public function populate($data = array())
    {
        if (isset($data['title']) && $data['title'] !== null) {
            $this->title = $data['title'];
        }
        if (isset($data['description']) && $data['description'] !== null) {
            $this->description = $data['description'];
        }
        if (isset($data['formjsonified']) && $data['formjsonified'] !== null) {
            $this->formjsonified = $data['formjsonified'];
        }
        if (isset($data['formtemplate']) && $data['formtemplate'] !== null) {
            $this->formtemplate = $data['formtemplate'];
        }
        if (isset($data['active']) && $data['active'] !== null) {
            $this->active = $data['active'];
        }
    }
1215989
public function populate($data = array())
    {
        $this->value = (isset($data['value']) && $data['value'] !== null) ? $data['value'] : null;
        $this->active = (isset($data['active']) && $data['active'] !== null) ? $data['active'] : null;
        $this->winning = (isset($data['winning']) && $data['winning'] !== null) ? $data['winning'] : null;
    }