Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Db / Sql / Ddl / Column / Float.php
blob6fe3751bb98269794a13a9d65d0bb81ae65c7a4d
1 <?php
2 /**
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
8 */
10 namespace Zend\Db\Sql\Ddl\Column;
12 class Float extends Column
14 /**
15 * @var int
17 protected $decimal;
19 /**
20 * @var int
22 protected $digits;
24 /**
25 * @var string
27 protected $specification = '%s DECIMAL(%s) %s %s';
29 /**
30 * @param null|string $name
31 * @param int $digits
32 * @param int $decimal
34 public function __construct($name, $digits, $decimal)
36 $this->name = $name;
37 $this->digits = $digits;
38 $this->decimal = $decimal;
41 /**
42 * @return array
44 public function getExpressionData()
46 $spec = $this->specification;
47 $params = array();
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 : '';
60 return array(array(
61 $spec,
62 $params,
63 $types,
64 ));