/**
	 * Set the value from the application/userspace for this column
	 *
	 * Handles all translations and conversions as necessary.
	 *
	 * @param mixed $val
	 */
	public function setValueFromApp($val){
		$this->valueTranslated = $val;


		if($this->encrypted){
			// Decrypt the value last.
			$val = \Model::EncryptValue($val);
		}

		$this->value = $val;
	}
	/**
	 * Set the value from the application/userspace for this column
	 *
	 * Handles all translations and conversions as necessary.
	 *
	 * @param mixed $val
	 */
	public function setValueFromApp($val){
		$this->valueTranslated = $val;

		if($val === '' || $val === '0000-00-00 00:00:00' || $val === null){
			$val = $this->null ? null : $this->default;
		}

		if($this->encrypted){
			// Decrypt the value last.
			$val = \Model::EncryptValue($val);
		}

		$this->value = $val;
	}
	/**
	 * Set the value from the application/userspace for this column
	 *
	 * Handles all translations and conversions as necessary.
	 *
	 * @param mixed $val
	 */
	public function setValueFromApp($val){
		$this->valueTranslated = $val;

		if($this->encoding == \Model::ATT_ENCODING_JSON){
			$val = json_encode($val);
		}
		elseif($this->encoding == \Model::ATT_ENCODING_GZIP){
			$val = gzcompress($val);
		}
		
		if($this->encrypted){
			// Encrypt the value last
			$val = \Model::EncryptValue($val);
		}

		$this->value = $val;
	}