setName($name); $this->setLength($length); $this->setNullable($nullable); $this->setDefault($default); $this->setOptions($options); } /** * @param int $length * @return self */ public function setLength($length) { $this->length = $length; return $this; } /** * @return int */ public function getLength() { return $this->length; } /** * @return array */ public function getExpressionData() { $spec = $this->specification; $params = array(); $params[] = $this->name; $params[] = $this->type; if ($this->length) { $params[1] .= ' ' . $this->length; } $types = array(self::TYPE_IDENTIFIER, self::TYPE_LITERAL); if (!$this->isNullable) { $params[1] .= ' NOT NULL'; } if ($this->default !== null) { $spec .= ' DEFAULT %s'; $params[] = $this->default; $types[] = self::TYPE_VALUE; } return array(array( $spec, $params, $types, )); } }