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(); }
public function valueForSql() { $value = parent::valueForSql(); if(is_string($value) && !isset($this->options['enumValues'][$value])) $this->throwErrorValue(); return $value; }
public function valueForSql() { $value = parent::valueForSql(); if(!is_numeric($this->value)) $this->throwErrorValue(); return $value; }
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(); }
public function valueForSql() { if(!$this->value) return parent::valueForSql(); return $this->value; }
public function valueForSql() { if(!$this->value) return parent::valueForSql(); return $this->value->format('Y-m-d'); }