PHP Schema::typeAndSize Examples

PHP Schema::typeAndSize - 2 examples found. These are the top rated real world PHP examples of Schema::typeAndSize extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 function typeAndSize($column)
 {
     if ($column['type'] == 'enum') {
         $vals = array_map(array($this, 'quote'), $column['enum']);
         return 'enum(' . implode(',', $vals) . ')';
     } else {
         if ($this->_isString($column)) {
             $col = parent::typeAndSize($column);
             if (!empty($column['charset'])) {
                 $col .= ' CHARSET ' . $column['charset'];
             }
             if (!empty($column['collate'])) {
                 $col .= ' COLLATE ' . $column['collate'];
             }
             return $col;
         } else {
             return parent::typeAndSize($column);
         }
     }
 }
Example #2
0
 function typeAndSize($column)
 {
     if ($column['type'] == 'enum') {
         $vals = array_map(array($this, 'quote'), $column['enum']);
         return "text check ({$name} in " . implode(',', $vals) . ')';
     } else {
         return parent::typeAndSize($column);
     }
 }