コード例 #1
0
ファイル: Column.php プロジェクト: emildev35/processmaker
 /**
  * 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
ファイル: Column.php プロジェクト: DBezemer/server
 /**
  * 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;
 }