Exemple #1
0
 public function __construct($name, array $options = array())
 {
     parent::__construct($name, $options);
     if (array_key_exists('limit', $options)) {
         $this->limit = $options['limit'];
     }
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function __construct($name, array $options = array())
 {
     parent::__construct($name, $options);
     if (array_key_exists('precision', $options)) {
         $this->precision = $options['precision'];
         if (array_key_exists('scale', $options)) {
             $this->scale = $options['scale'];
         }
     }
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function __construct($name, $type, array $options = array())
 {
     parent::__construct($name, $options);
     $this->type = $type;
 }
 private function getTypeConstraints(Column $column)
 {
     $typeConstraints = '';
     switch ($column->getType()) {
         case 'string':
             if ($column->getLimit()) {
                 $typeConstraints = sprintf('(%s)', $column->getLimit());
             }
             break;
         case 'decimal':
             if ($column->getPrecision()) {
                 $typeConstraints = sprintf('(%s, %s)', $column->getPrecision(), $column->getScale());
             }
             break;
     }
     return $typeConstraints;
 }