Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00015 class StringType extends BasePropertyType
00016 {
00017 public function getPrimitiveName()
00018 {
00019 return 'string';
00020 }
00021
00026 public function setDefault($default)
00027 {
00028 Assert::isString(
00029 $default,
00030 "strange default value given - '{$default}'"
00031 );
00032
00033 $this->default = $default;
00034
00035 return $this;
00036 }
00037
00038 public function getDeclaration()
00039 {
00040 if ($this->hasDefault())
00041 return "'{$this->default}'";
00042
00043 return 'null';
00044 }
00045
00046 public function isMeasurable()
00047 {
00048 return true;
00049 }
00050
00051 public function toColumnType($length = null)
00052 {
00053 return
00054 $length
00055 ? 'DataType::create(DataType::VARCHAR)'
00056 : 'DataType::create(DataType::TEXT)';
00057 }
00058 }
00059 ?>