/** * Extracts the default value for the column. * The value is typecasted to correct PHP type. * @param mixed $defaultValue the default value obtained from metadata */ protected function extractDefault($defaultValue) { if($this->dbType==='timestamp' ) $this->defaultValue=null; else parent::extractDefault(str_replace(array('(',')',"'"), '', $defaultValue)); }
/** * Extracts the default value for the column. * The value is typecasted to correct PHP type. * @param mixed $defaultValue the default value obtained from metadata */ protected function extractDefault($defaultValue) { if (stripos($defaultValue, 'timestamp') !== false) { $this->defaultValue = null; } else { parent::extractDefault($defaultValue); } }
/** * Extracts the default value for the column. * The value is typecasted to correct PHP type. * @param mixed $defaultValue the default value obtained from metadata */ protected function extractDefault($defaultValue) { if ($this->dbType === 'timestamp' && $defaultValue === 'CURRENT_TIMESTAMP') { $this->defaultValue = null; } else { parent::extractDefault($defaultValue); } }
/** * Extracts the default value for the column. * The value is typecasted to correct PHP type. * @param mixed $defaultValue the default value obtained from metadata */ protected function extractDefault($defaultValue) { if (strncmp($this->dbType, 'bit', 3) === 0) { $this->defaultValue = bindec(trim($defaultValue, 'b\'')); } elseif ($this->dbType === 'timestamp' && $defaultValue === 'CURRENT_TIMESTAMP') { $this->defaultValue = null; } else { parent::extractDefault($defaultValue); } }
/** * Extracts the default value for the column. * The value is typecasted to correct PHP type. * @param mixed the default value obtained from metadata */ protected function extractDefault($defaultValue) { /* * handle CURRENT_DATE/TIME/TIMESTAMP with optional precision * @todo handle context variable 'NOW' * ref. http://www.firebirdsql.org/refdocs/langrefupd25-variables.html */ if (preg_match('/(CURRENT_|NULL|TODAY|TOMORROW|YESTERDAY)/i', $defaultValue)) { $this->defaultValue = null; } elseif ($defaultValue == "''") { $this->defaultValue = ''; } else { parent::extractDefault($defaultValue); } }