/** * Getter for the platform property * * @return PlatformInterface */ public function getPlatform() { if (null === $this->platform) { $this->platform = new SqlitePlatform(); } $this->platform->setIdentifierQuoting($this->identifierQuoting); return $this->platform; }
public function setUp() { if (!$this->con) { require_once __DIR__ . '/../../../../Fixtures/migration/build/conf/migration-conf.php'; $this->con = Propel::getConnection('migration'); $adapterClass = Propel::getServiceContainer()->getAdapterClass('migration'); $this->database = new Database(); $schemaParserClass = sprintf('\\%s\\%sSchemaParser', 'Propel\\Generator\\Reverse', ucfirst($adapterClass)); $platformClass = sprintf('\\%s\\%sPlatform', 'Propel\\Generator\\Platform', ucfirst($adapterClass)); $this->parser = new $schemaParserClass($this->con); $this->platform = new $platformClass(); $generatorConfig = new QuickGeneratorConfig(); $generatorConfig->setBuildProperty('mysqlTableType', 'InnoDB'); $this->platform->setGeneratorConfig($generatorConfig); $this->parser->setGeneratorConfig(new QuickGeneratorConfig()); $this->parser->setPlatform($this->platform); } }
public function isDefaultSqlType(PlatformInterface $platform = null) { if (null === $this->domain || null === $this->domain->getSqlType() || null === $platform) { return true; } $defaultSqlType = $platform->getDomainForType($this->getType())->getSqlType(); return $defaultSqlType === $this->getDomain()->getSqlType(); }
/** * Returns the schema delimiter character. * * For example, the dot character with mysql when * naming tables. For instance: schema.the_table. * * @return string */ public function getSchemaDelimiter() { return $this->platform->getSchemaDelimiter(); }
/** * Convenience method to returns the Platform class for this table (database). * @return PlatformInterface */ public function getPlatform() { if (null === $this->platform) { // try to load the platform from the table $table = $this->getTable(); if ($table && ($database = $table->getDatabase())) { $this->setPlatform($database->getPlatform()); } } if (!$this->table->isIdentifierQuotingEnabled()) { $this->platform->setIdentifierQuoting(false); } return $this->platform; }