示例#1
0
 protected function _syncI18nModel(Garp_Spawn_Model_Base $model)
 {
     if (!$model->isMultilingual()) {
         return;
     }
     $progress = $this->_getFeedbackInstance();
     $progress->display($model->id . " i18n comparison");
     $i18nModel = $model->getI18nModel();
     $synchronizer = new Garp_Spawn_MySql_Table_Synchronizer($i18nModel, $progress);
     $synchronizer->sync();
     try {
         $this->onI18nTableFork($model);
     } catch (Exception $e) {
     }
 }
示例#2
0
 /**
  * Registers this relation as a Field in the Model.
  *
  * @return void
  */
 protected function _addRelationFieldInLocalModel()
 {
     if (!$this->isSingular()) {
         return;
     }
     $column = Garp_Spawn_Relation_Set::getRelationColumn($this->name);
     $fieldParams = array('model' => $this->model, 'type' => 'numeric', 'editable' => true, 'visible' => true, 'primary' => $this->primary, 'required' => $this->required, 'relationAlias' => $this->name, 'relationType' => $this->type);
     if ($this->multilingual && $this->_localModel->isMultilingual()) {
         // The relation is added to the i18n model by Garp_Spawn_Config_Model_I18n
         return;
     }
     $this->_localModel->fields->add('relation', $column, $fieldParams);
 }