コード例 #1
0
ファイル: I18nForker.php プロジェクト: grrr-amsterdam/garp3
 protected function _createTableIfNotExists()
 {
     $tableFactory = new Garp_Spawn_MySql_Table_Factory($this->getModel()->getI18nModel());
     $table = $tableFactory->produceConfigTable();
     if (!Garp_Spawn_MySql_Table_Base::exists($table->name)) {
         $table->create();
     } else {
         // Make sure an existing table is updated
         $baseSynchronizer = new Garp_Spawn_MySql_Table_Synchronizer($this->getModel()->getI18nModel(), $this->getFeedback());
         $baseSynchronizer->sync(false);
     }
     /*
             if (
        !Garp_Spawn_MySql_Table_Base::exists($table->name) &&
        !$table->create()
             ) {
        $error = sprintf(self::ERROR_CANT_CREATE_TABLE, $table->name);
        throw new Exception($error);
             }
     */
 }
コード例 #2
0
ファイル: Manager.php プロジェクト: grrr-amsterdam/garp3
 protected function _syncBindingModel(Garp_Spawn_Relation $relation)
 {
     $progress = $this->_getFeedbackInstance();
     $bindingModel = $relation->getBindingModel();
     $progress->display($bindingModel->id . " table comparison");
     $synchronizer = new Garp_Spawn_MySql_Table_Synchronizer($bindingModel, $progress);
     $synchronizer->sync();
 }