示例#1
0
 /**
  * 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;
 }
示例#2
0
文件: Column.php 项目: ketheriel/ETVA
 /**
  * Utility method to see if the column is text type.
  */
 public function isTextType()
 {
     return PropelTypes::isTextType($this->getType());
 }
示例#3
0
 /**
  * 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;
 }