示例#1
0
 /**
  * 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;
 }
示例#2
0
 public function setUp()
 {
     parent::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();
         $this->platform->setIdentifierQuoting(true);
         $generatorConfig = new QuickGeneratorConfig();
         $this->platform->setGeneratorConfig($generatorConfig);
         $this->parser->setGeneratorConfig(new QuickGeneratorConfig());
         $this->parser->setPlatform($this->platform);
     }
 }
示例#3
0
 /**
  * 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;
 }