4 * @author Marius Orcsik <marius@habarnam.ro>
7 class fooFieldVarChar
extends fooFieldA
{
8 const TYPE
= 'varchar';
9 protected $maxLength = 255;
10 protected $encoding = 'UTF-8';
12 public function isVarChar (fooFieldA
$oField) {
13 return ($oField instanceof self
);
16 public function getType () {
20 protected function escape () {
21 // need a mechanism based on the connection type
26 public function getEncoding () {
27 return $this->encoding
;
30 public function setEncoding ($sEncoding) {
31 $this->encoding
= $sEncoding;
34 public function getDefinition () {
35 // this is totally wrong for PostgreSQL
36 return $this->getType() .
37 ($this->getMaxLength() ?
'(' . $this->getMaxLength() . ')' : '') .
38 ($this->getIsNullable() ?
' NULL' : ' NOT NULL');