3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Db\Sql\Ddl\Column
;
12 class Float extends Column
27 protected $specification = '%s DECIMAL(%s) %s %s';
30 * @param null|string $name
34 public function __construct($name, $digits, $decimal)
37 $this->digits
= $digits;
38 $this->decimal
= $decimal;
44 public function getExpressionData()
46 $spec = $this->specification
;
49 $types = array(self
::TYPE_IDENTIFIER
, self
::TYPE_LITERAL
);
50 $params[] = $this->name
;
51 $params[] = $this->digits
;
52 $params[1] .= ', ' . $this->decimal
;
54 $types[] = self
::TYPE_LITERAL
;
55 $params[] = (!$this->isNullable
) ?
'NOT NULL' : '';
57 $types[] = ($this->default !== null) ? self
::TYPE_VALUE
: self
::TYPE_LITERAL
;
58 $params[] = ($this->default !== null) ?
$this->default : '';