public function setPickerOptions($value, $dc)
	{
		$db = Database::getInstance();
		
		switch ($value)
		{
			case 'datetime':
				if (!in_array($dc->activeRecord->rgxp, array('date', 'time', 'datim')))
				{
					// Change rgxp in database
					$db->prepare("UPDATE " . $this->table . " SET rgxp=? WHERE id=?")
					   ->execute('date', $dc->activeRecord->id);
				}
				if ($dc->activeRecord->multiple)
				{
					// Reset multiple in database
					$db->prepare("UPDATE " . $this->table . " SET multiple=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;
	
			case 'color':
				if (!in_array($dc->activeRecord->rgxp, array('alnum', 'extnd')))
				{
					// Change rgxp in database
					$db->prepare("UPDATE " . $this->table . " SET rgxp=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;
				
			case 'link':
				if ($dc->activeRecord->rgxp != 'url')
				{
					// Change rgxp in database
					$db->prepare("UPDATE " . $this->table . " SET rgxp=? WHERE id=?")
					   ->execute('url', $dc->activeRecord->id);
				}
				if ($dc->activeRecord->multiple)
				{
					// Reset multiple in database
					$db->prepare("UPDATE " . $this->table . " SET multiple=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;
				
			case 'unit':
				if ($dc->activeRecord->maxLength > 200)
				{
					// Change maxLength in database
					$db->prepare("UPDATE " . $this->table . " SET maxLength=? WHERE id=?")
					   ->execute(200, $dc->activeRecord->id);
				}
				if ($dc->activeRecord->multiple)
				{
					// Change multiple in database
					$db->prepare("UPDATE " . $this->table . " SET multiple=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;

		}
		
		return $value;
	}
public function setPickerOptions($value, $dc)
	{
		$db = Database::getInstance();
		
		switch ($value)
		{
			case 'datetime':
				if (!in_array($dc->activeRecord->rgxp, array('date', 'time', 'datim')))
				{
					// Change rgxp in database
					$db->prepare("UPDATE " . $this->table . " SET rgxp=? WHERE id=?")
					   ->execute('date', $dc->activeRecord->id);
				}
				if ($dc->activeRecord->multiple)
				{
					// Reset multiple in database
					$db->prepare("UPDATE " . $this->table . " SET multiple=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;
	
			case 'color':
				if (!in_array($dc->activeRecord->rgxp, array('alnum', 'extnd')))
				{
					// Change rgxp in database
					$db->prepare("UPDATE " . $this->table . " SET rgxp=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;
				
			case 'link':
				if ($dc->activeRecord->rgxp != 'url')
				{
					// Change rgxp in database
					$db->prepare("UPDATE " . $this->table . " SET rgxp=? WHERE id=?")
					   ->execute('url', $dc->activeRecord->id);
				}
				if ($dc->activeRecord->multiple)
				{
					// Reset multiple in database
					$db->prepare("UPDATE " . $this->table . " SET multiple=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;
				
			case 'unit':
				if ($dc->activeRecord->maxLength > 200)
				{
					// Change maxLength in database
					$db->prepare("UPDATE " . $this->table . " SET maxLength=? WHERE id=?")
					   ->execute(200, $dc->activeRecord->id);
				}
				if ($dc->activeRecord->multiple)
				{
					// Change multiple in database
					$db->prepare("UPDATE " . $this->table . " SET multiple=? WHERE id=?")
					   ->execute('', $dc->activeRecord->id);
				}
				break;

		}
		
		return $value;
	}
public function setPickerOptions ( $ value , $ dc ) { $ db = Database :: getInstance ( ) ; switch ( $ value ) { case 'datetime' : if ( ! in_array ( $ dc -> activeRecord -> rgxp , array ( 'date' , 'time' , 'datim' ) ) ) { // Change rgxp in database $ db -> prepare ( "UPDATE " . $ this -> table . " SET rgxp=? WHERE id=?" ) -> execute ( 'date' , $ dc -> activeRecord -> id ) ; } if ( $ dc -> activeRecord -> multiple ) { // Reset multiple in database $ db -> prepare ( "UPDATE " . $ this -> table . " SET multiple=? WHERE id=?" ) -> execute ( '' , $ dc -> activeRecord -> id ) ; } break ; case 'color' : if ( ! in_array ( $ dc -> activeRecord -> rgxp , array ( 'alnum' , 'extnd' ) ) ) { // Change rgxp in database $ db -> prepare ( "UPDATE " . $ this -> table . " SET rgxp=? WHERE id=?" ) -> execute ( '' , $ dc -> activeRecord -> id ) ; } break ; case 'link' : if ( $ dc -> activeRecord -> rgxp != 'url' ) { // Change rgxp in database $ db -> prepare ( "UPDATE " . $ this -> table . " SET rgxp=? WHERE id=?" ) -> execute ( 'url' , $ dc -> activeRecord -> id ) ; } if ( $ dc -> activeRecord -> multiple ) { // Reset multiple in database $ db -> prepare ( "UPDATE " . $ this -> table . " SET multiple=? WHERE id=?" ) -> execute ( '' , $ dc -> activeRecord -> id ) ; } break ; case 'unit' : if ( $ dc -> activeRecord -> maxLength > 200 ) { // Change maxLength in database $ db -> prepare ( "UPDATE " . $ this -> table . " SET maxLength=? WHERE id=?" ) -> execute ( 200 , $ dc -> activeRecord -> id ) ; } if ( $ dc -> activeRecord -> multiple ) { // Change multiple in database $ db -> prepare ( "UPDATE " . $ this -> table . " SET multiple=? WHERE id=?" ) -> execute ( '' , $ dc -> activeRecord -> id ) ; } break ; } return $ value ; }
Adjust maxlength and multiple settings according to the rgxp settings

@param mixed         $value
@param DataContainer $dc

@return mixed
Adjust maxlength and multiple settings according to the rgxp settings