/** * Return a string that will give this column a default value. * @return string */ public function getDefaultSetting() { $dflt = ""; if ($this->getDefaultValue() !== null) { $dflt .= "default "; if ($this->getType() == "LONGVARCHAR") { throw new Exception("ERROR: Text cannot have default value (column: '{$this->name}', type: '{$this->getType()}', default: '{$this->getDefaultValue()}')"); } if (PropelTypes::isTextType($this->getType())) { $dflt .= '\'' . $this->getPlatform()->escapeText($this->getDefaultValue()) . '\''; } elseif ($this->getType() == PropelTypes::BOOLEAN) { $dflt .= $this->getPlatform()->getBooleanString($this->getDefaultValue()); } else { $dflt .= $this->getDefaultValue(); } } return $dflt; }
/** * Utility method to see if the column is text type. */ public function isTextType() { return PropelTypes::isTextType($this->getType()); }
/** * Return a string that will give this column a default value. * @return string */ public function getDefaultSetting() { $dflt = ""; if ($this->getDefaultValue() !== null) { $dflt .= "default "; if (PropelTypes::isTextType($this->getType())) { $dflt .= '\'' . $this->getPlatform()->escapeText($this->getDefaultValue()) . '\''; } elseif ($this->getType() == PropelTypes::BOOLEAN) { $dflt .= $this->getPlatform()->getBooleanString($this->getDefaultValue()); } else { $dflt .= $this->getDefaultValue(); } } return $dflt; }