protected function encodeValue($column)
	{
		/// @todo for compatibility
		$val = in_array($column, static::$jsons) ? to_json($this->$column) : $this->$column;

		// Convert jsons into valid json strings
		if (isset(static::$casts[$column]) && (static::$casts[$column] === "object" || static::$casts[$column] === "array"))
			$val = to_json($this->$column);

		// Convert bools to ints
		if (is_bool($val)) $val = (int)$val;

		return $val;
	}