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 / Varchar.php
blob7da9a362df0b25d58877a713495be93c8ebb2d3d
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 Varchar extends Column
14 /**
15 * @var int
17 protected $length;
19 /**
20 * @var string
22 protected $specification = '%s VARCHAR(%s) %s %s';
24 /**
25 * @param null|string $name
26 * @param int $length
28 public function __construct($name, $length)
30 $this->name = $name;
31 $this->length = $length;
34 /**
35 * @return array
37 public function getExpressionData()
39 $spec = $this->specification;
40 $params = array();
42 $types = array(self::TYPE_IDENTIFIER, self::TYPE_LITERAL);
43 $params[] = $this->name;
44 $params[] = $this->length;
46 $types[] = self::TYPE_LITERAL;
47 $params[] = (!$this->isNullable) ? 'NOT NULL' : '';
49 $types[] = ($this->default !== null) ? self::TYPE_VALUE : self::TYPE_LITERAL;
50 $params[] = ($this->default !== null) ? $this->default : '';
52 return array(array(
53 $spec,
54 $params,
55 $types,
56 ));