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 / Decimal.php
blob1983099ac2de5d9cd3bf7469cc682793a3353038
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 Decimal extends Column
14 /**
15 * @var int
17 protected $precision;
19 /**
20 * @var int
22 protected $scale;
24 /**
25 * @var string
27 protected $specification = '%s DECIMAL(%s) %s %s';
29 /**
30 * @param null|string $name
31 * @param int $precision
32 * @param null|int $scale
34 public function __construct($name, $precision, $scale = null)
36 $this->name = $name;
37 $this->precision = $precision;
38 $this->scale = $scale;
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->precision;
53 if ($this->scale !== null) {
54 $params[1] .= ', ' . $this->scale;
57 $types[] = self::TYPE_LITERAL;
58 $params[] = (!$this->isNullable) ? 'NOT NULL' : '';
60 $types[] = ($this->default !== null) ? self::TYPE_VALUE : self::TYPE_LITERAL;
61 $params[] = ($this->default !== null) ? $this->default : '';
63 return array(array(
64 $spec,
65 $params,
66 $types,
67 ));