예제 #1
0
	public function valueForSql()
	{
		if(!is_null($this->value) && $this->value==='' && !$this->allowNull)
			$this->value = '';	//In case of string we do not throw an exception, we can use '' as value
		else
			return parent::valueForSql();
	}
예제 #2
0
	public function valueForSql()
	{
		$value = parent::valueForSql();
		if(is_string($value) && !isset($this->options['enumValues'][$value]))
			$this->throwErrorValue();
		return $value;
	}
예제 #3
0
	public function valueForSql()
	{
		$value = parent::valueForSql();
		if(!is_numeric($this->value))
			$this->throwErrorValue();
		return $value;
	}
예제 #4
0
	public function valueForSql()
	{	//A password theoretically may be an empty string, so we need to hash it
		if(!is_null($this->value) && $this->value==='' && !$this->allowNull)
			$this->value = '';
		else
			return parent::valueForSql();
	}
예제 #5
0
	public function valueForSql()
	{
		if(!$this->value)
			return parent::valueForSql();
		return $this->value;
	}
예제 #6
0
	public function valueForSql()
	{
		if(!$this->value)
			return parent::valueForSql();
		return $this->value->format('Y-m-d');
	}