public function __construct($name, array $options = array()) { parent::__construct($name, $options); if (array_key_exists('limit', $options)) { $this->limit = $options['limit']; } }
/** * {@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']; } } }
/** * {@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; }