system/Entity.php
public function toRawArray(bool $onlyChanged = false): array
	{
		$return = [];

		$properties = get_object_vars($this);

		foreach ($properties as $key => $value)
		{
			if (substr($key, 0, 1) === '_')
			{
				continue;
			}

			if ($onlyChanged && ! $this->hasPropertyChanged($key, $value))
			{
				continue;
			}

			$return[$key] = $this->$key;
		}

		return $return;
	}
public function toRawArray(bool $onlyChanged = false): array
	{
		$return = [];

		$properties = get_object_vars($this);

		foreach ($properties as $key => $value)
		{
			if (substr($key, 0, 1) === '_')
			{
				continue;
			}

			if ($onlyChanged && ! $this->hasPropertyChanged($key, $value))
			{
				continue;
			}

			$return[$key] = $this->$key;
		}

		return $return;
	}
Converts the properties of this class into an array. Unlike toArray()
this will not cast the data or use any magic accessors. It simply
returns the raw data for use when saving to the model, etc.

@param boolean $onlyChanged

@return array