* @package Mammut\DB\Dialect */ class Db2 extends Sql92 implements iDialect { protected $identSeparator = '.'; public function __construct($identSeparator = '.') { $this->$identSeparator = $identSeparator; } public function getName() { return DB::DIALECT_DB2; } public function isOffsetSupported() { return true; } public function getDdl() { if(!is_null($this->ddlInstance)) return $this->ddlInstance; $name = '\\' . self::clazz() . 'Ddl'; $this->ddlInstance = new \Mammut\DB\Sql\Dialect\Ddl\Db2Ddl($this->con); return $this->ddlInstance; } public function quoteIdent($identifier) { if($this->quoteIdentifiers === false) return $identifier; return parent::quoteIdent($identifier); } public function quoteValue($value) { if(function_exists('db2_escape_string')) { return '\'' . db2_escape_string($value) . '\''; } return '\'' . str_replace("'", "''", $value) . '\''; } public function escapeString($value) { if(function_exists('db2_escape_string')) return db2_escape_string($value); return str_replace("'", "''", $value); } }