public function setValue($value) {

		// special behavior for DateTime
		if (is_a($value, 'DateTime') and is_a($this, 'Pair\FormControlInput')) {

			// if UTC date, set user timezone
			if (defined('UTC_DATE') and UTC_DATE) {
				$app = Application::getInstance();
				$value->setTimezone($app->currentUser->getDateTimeZone());
			}

			// can be datetime or just date
			$format = (isset($this->type) and 'date'==$this->type) ? $this->dateFormat : $this->datetimeFormat;
			$this->value = $value->format($format);

		} else {

			$this->value = $value;

		}

		return $this;

	}
public function setValue($value) {

		// special behavior for DateTime
		if (is_a($value, 'DateTime') and is_a($this, 'Pair\FormControlInput')) {

			// if UTC date, set user timezone
			if (defined('UTC_DATE') and UTC_DATE) {
				$app = Application::getInstance();
				$value->setTimezone($app->currentUser->getDateTimeZone());
			}

			// can be datetime or just date
			$format = (isset($this->type) and 'date'==$this->type) ? $this->dateFormat : $this->datetimeFormat;
			$this->value = $value->format($format);

		} else {

			$this->value = $value;

		}

		return $this;

	}
public function setValue ( $ value ) { // special behavior for DateTime if ( is_a ( $ value , 'DateTime' ) and is_a ( $ this , 'Pair\FormControlInput' ) ) { // if UTC date, set user timezone if ( defined ( 'UTC_DATE' ) and UTC_DATE ) { $ app = Application :: getInstance ( ) ; $ value -> setTimezone ( $ app -> currentUser -> getDateTimeZone ( ) ) ; } // can be datetime or just date $ format = ( isset ( $ this -> type ) and 'date' == $ this -> type ) ? $ this -> dateFormat : $ this -> datetimeFormat ; $ this -> value = $ value -> format ( $ format ) ; } else { $ this -> value = $ value ; } return $ this ; }
Sets value for this control subclass.

@param	mixed		Value for this control.

@return	FormControl
Sets value for this control subclass .