public function getTableName() { $model = $this->getModel(); $tableFactory = new Garp_Spawn_MySql_Table_Factory($model); $table = $tableFactory->produceConfigTable(); return $table->name; }
/** * @param Garp_Spawn_Model_Abstract $model */ public function __construct(Garp_Spawn_Model_Abstract $model, Garp_Cli_Ui_Protocol $feedback) { $tableFactory = new Garp_Spawn_MySql_Table_Factory($model); $configTable = $tableFactory->produceConfigTable(); $liveTable = $tableFactory->produceLiveTable(); $this->setSource($configTable); $this->setTarget($liveTable); $this->setModel($model); $this->setFeedback($feedback); }
protected function _getOtherTableName($modelName) { $model = $this->_getModelFromModelName($modelName); if ($model->isMultilingual()) { return $this->_getTranslatedViewName($model); } $factory = new Garp_Spawn_MySql_Table_Factory($model); $table = $factory->produceConfigTable(); return $table->name; }
protected function _getBindingModelTable() { $bindingModel = $this->getRelation()->getBindingModel(); $tableFactory = new Garp_Spawn_MySql_Table_Factory($bindingModel); $table = $tableFactory->produceConfigTable(); return $table; }
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); } */ }
protected function _createBindingModelTableIfNotExists(Garp_Spawn_Relation $relation) { $bindingModel = $relation->getBindingModel(); $tableFactory = new Garp_Spawn_MySql_Table_Factory($bindingModel); $configTable = $tableFactory->produceConfigTable(); $this->_createTableIfNotExists($configTable); }