4 * @author Marius Orcsik <marius@habarnam.ro>
7 class fooFieldInteger
extends fooFieldA
{
8 const TYPE
= 'integer';
9 protected $maxLength = 11;
10 protected $autoIncrement = false;
12 public function isInt (fooFieldA
$oField) {
13 return ($oField instanceof self
);
16 public function getType () {
20 protected function escape () {
21 return (int) $this->value
;
25 * @param bool $bIsAutoIncrement
28 public function setAutoIncrement ($bIsAutoIncrement) {
29 $this->autoIncrement
= (bool)$bIsAutoIncrement;
32 public function getAutoIncrement () {
33 return $this->autoIncrement
;
36 public function getDefinition () {
37 // this is totally wrong for PostgreSQL
38 return $this->getType() .
39 ($this->getMaxLength() ?
'(' . $this->getMaxLength() . ')' : '') .
40 ($this->getIsNullable() ?
' NULL' : ' NOT NULL') .
41 ($this->getAutoIncrement() ?
' AUTO_INCREMENT' : '');