예제 #1
0
 /**
  * Changes the column name based on the size of the string.
  * NOTE: If the text is extremely long, "Text" may not be enough
  * for MySQL.
  *
  * @param \Database\Table $table
  * @return \Database\Datatype
  */
 public function loadDataType(\Database\Table $table)
 {
     if (empty($this->column_type)) {
         if ($this->limit <= 500 && $this->limit > 0) {
             $this->column_type = 'Varchar';
         } else {
             $this->column_type = 'Text';
         }
     }
     $dt = parent::loadDataType($table);
     if (strtolower($this->column_type) == 'varchar') {
         $dt->setSize($this->limit);
     }
     return $dt;
 }