Exemple #1
0
 protected function _getTranslatedViewName(Garp_Spawn_Model_Abstract $model = null)
 {
     if (!$model) {
         $model = $this->getModel();
     }
     $locale = Garp_I18n::getDefaultLocale();
     $i18nView = new Garp_Spawn_MySql_View_I18n($model, $locale);
     $viewName = $i18nView->getName();
     return $viewName;
 }
Exemple #2
0
 public function render()
 {
     $model = $this->getModel();
     $locale = $this->getLocale();
     $parentClass = 'Model_' . $model->id;
     $className = $parentClass . ucfirst($locale);
     $view = new Garp_Spawn_MySql_View_I18n($model, $locale);
     $viewName = $view->getName();
     $out = $this->_rl("<?php") . $this->_rl('/**') . $this->_rl(" * {$className}") . $this->_rl(' * This file was generated by ' . get_class() . ' - do not edit') . $this->_rl(' *') . $this->_rl(' * @package Model') . $this->_rl(' * @author ' . get_class() . ' <*****@*****.**>') . $this->_rl(' */') . $this->_rl("class {$className} extends {$parentClass} {", 0) . $this->_rl("protected \$_name = '{$viewName}';", 1) . $this->_rl("}", 0, 0);
     return $out;
 }
Exemple #3
0
 protected function _createI18nViews(Garp_Spawn_Model_Base $model)
 {
     $locales = Garp_I18n::getLocales();
     foreach ($locales as $locale) {
         $view = new Garp_Spawn_MySql_View_I18n($model, $locale);
         $view->create();
     }
 }