当前位置: 首页>>代码示例>>PHP>>正文


PHP Gems_Loader::getModels方法代码示例

本文整理汇总了PHP中Gems_Loader::getModels方法的典型用法代码示例。如果您正苦于以下问题:PHP Gems_Loader::getModels方法的具体用法?PHP Gems_Loader::getModels怎么用?PHP Gems_Loader::getModels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gems_Loader的用法示例。


在下文中一共展示了Gems_Loader::getModels方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createModel

 /**
  * Creates the model
  *
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel()
 {
     if (!$this->model instanceof LogModel) {
         $this->model = $this->loader->getModels()->createLogModel();
         $this->model->applyDetailSettings();
     }
     return $this->model;
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:13,代码来源:LogShowSnippet.php

示例2: createModel

 /**
  * Creates a model for getModel(). Called only for each new $action.
  *
  * The parameters allow you to easily adapt the model to the current action. The $detailed
  * parameter was added, because the most common use of action is a split between detailed
  * and summarized actions.
  *
  * @param boolean $detailed True when the current action is not in $summarizedActions.
  * @param string $action The current action.
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel($detailed, $action)
 {
     $model = $this->loader->getModels()->createLogModel();
     if ($detailed) {
         $model->applyDetailSettings();
     } else {
         $model->applyBrowseSettings();
     }
     return $model;
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:21,代码来源:LogAction.php

示例3: createModel

 /**
  * Creates the model
  *
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel()
 {
     if ($this->model instanceof \Gems_Model_StaffModel) {
         $model = $this->model;
     } else {
         $model = $this->loader->getModels()->getStaffModel();
         $model->applyBrowseSettings();
     }
     return $model;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:15,代码来源:StaffTableSnippet.php

示例4: getControllerTargetModel

 /**
  * The model to use with a controller
  *
  * @param string $controller Name of controller (or other id)
  * @return \MUtil_Model_ModelAbstract or null when not found
  */
 protected function getControllerTargetModel($controller)
 {
     switch ($controller) {
         case 'respondent':
             $model = $this->loader->getModels()->getRespondentModel(true);
             $model->applyEditSettings();
             return $model;
         case 'calendar':
             $model = $this->loader->getModels()->createAppointmentModel();
             $this->applySource($model);
             $model->applyEditSettings(null);
             return $model;
         default:
             return null;
     }
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:22,代码来源:ImportLoader.php

示例5: _scanForms

 protected function _scanForms()
 {
     $messages = array();
     $formCnt = 0;
     $addCnt = 0;
     $eDir = $this->_checkDir($this->formDir);
     if ($eDir !== false) {
         $model = $this->loader->getModels()->getOpenRosaFormModel();
         while (false !== ($filename = $eDir->read())) {
             if (substr($filename, -4) == '.xml') {
                 $formCnt++;
                 $form = new \OpenRosa_Tracker_Source_OpenRosa_Form($this->formDir . $filename);
                 $filter['gof_form_id'] = $form->getFormID();
                 $filter['gof_form_version'] = $form->getFormVersion();
                 $forms = $model->load($filter);
                 if (!$forms) {
                     $newValues = array();
                     $newValues['gof_id'] = null;
                     $newValues['gof_form_id'] = $form->getFormID();
                     $newValues['gof_form_version'] = $form->getFormVersion();
                     $newValues['gof_form_title'] = $form->getTitle();
                     $newValues['gof_form_xml'] = $filename;
                     $newValues = $model->save($newValues);
                     if (\Gems_Tracker::$verbose) {
                         \MUtil_Echo::r($newValues, 'added form');
                     }
                     $addCnt++;
                 }
             }
         }
     }
     $cache = GemsEscort::getInstance()->cache;
     $cache->clean();
     $messages[] = sprintf('Checked %s forms and added %s forms', $formCnt, $addCnt);
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:35,代码来源:OpenRosa.php

示例6: createModel

 /**
  * Creates the model
  *
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel()
 {
     if (!$this->model instanceof \Gems_Model_StaffModel) {
         $this->model = $this->loader->getModels()->getStaffModel(false);
         $this->model->applyOwnAccountEdit();
     }
     return $this->model;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:13,代码来源:OwnAccountEditSnippet.php

示例7: createModel

 /**
  * Creates the model
  *
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel()
 {
     if (!$this->model instanceof \Gems_Model_RespondentModel) {
         $this->model = $this->loader->getModels()->createRespondentModel();
         $this->model->applyBrowseSettings();
     }
     return $this->model;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:13,代码来源:RespondentTableSnippet.php

示例8: afterRegistry

 /**
  * Called after the check that all required registry values
  * have been set correctly has run.
  *
  * @return void
  */
 public function afterRegistry()
 {
     parent::afterRegistry();
     $this->model = $this->loader->getModels()->getRespondentModel(true);
     if ($this->addLoginCheck) {
         $this->model->addLoginCheck();
     }
     // Load the data
     $this->refresh();
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:16,代码来源:Respondent.php

示例9: createModel

 /**
  * Creates the model
  *
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel()
 {
     if (!$this->model instanceof \Gems_Model_AppointmentModel) {
         $this->model = $this->loader->getModels()->createAppointmentModel();
         $this->model->applyBrowseSettings();
     }
     $this->model->addColumn(new \Zend_Db_Expr("CONVERT(gap_admission_time, DATE)"), 'date_only');
     $this->model->set('date_only', 'dateFormat', \Zend_Date::WEEKDAY . ' ' . \Zend_Date::DAY_SHORT . ' ' . \Zend_Date::MONTH_NAME . ' ' . \Zend_Date::YEAR);
     $this->model->set('gap_admission_time', 'label', $this->_('Time'), 'dateFormat', 'HH:mm');
     $this->model->set('gr2o_patient_nr', 'label', $this->_('Respondent nr'));
     \Gems_Model_RespondentModel::addNameToModel($this->model, $this->_('Name'));
     // \MUtil_Model::$verbose = true;
     return $this->model;
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:19,代码来源:CalendarTableSnippet.php

示例10: createModel

 /**
  * Creates a model for getModel(). Called only for each new $action.
  *
  * The parameters allow you to easily adapt the model to the current action. The $detailed
  * parameter was added, because the most common use of action is a split between detailed
  * and summarized actions.
  *
  * @param boolean $detailed True when the current action is not in $summarizedActions.
  * @param string $action The current action.
  * @return \MUtil_Model_ModelAbstract
  */
 public function createModel($detailed, $action)
 {
     if ($this->escort instanceof \Gems_Project_Layout_MultiLayoutInterface) {
         $styles = \MUtil_Lazy::call(array($this->escort, 'getStyles'));
     } else {
         $styles = array();
     }
     $model = $this->loader->getModels()->getOrganizationModel($styles);
     if ($detailed) {
         if ('create' == $action || 'edit' == $action) {
             $model->applyEditSettings();
         } else {
             $model->applyDetailSettings();
         }
     } else {
         $model->applyBrowseSettings();
     }
     return $model;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:30,代码来源:OrganizationAction.php

示例11: _exportRespondent

 /**
  * Exports a single respondent
  *
  * @param string $respondentId
  */
 protected function _exportRespondent($respondentId)
 {
     $respondentModel = $this->loader->getModels()->getRespondentModel(false);
     //Insert orgId when set
     if (is_array($respondentId) && isset($respondentId['gr2o_id_organization'])) {
         $filter['gr2o_id_organization'] = $respondentId['gr2o_id_organization'];
         $respondentId = $respondentId['gr2o_patient_nr'];
     } else {
         // Or accept to find in current organization
         // $filter['gr2o_id_organization'] = $this->currentUser->getCurrentOrganizationId();
         // Or use any allowed organization?
         $filter['gr2o_id_organization'] = array_keys($this->currentUser->getAllowedOrganizations());
     }
     $filter['gr2o_patient_nr'] = $respondentId;
     $respondentModel->setFilter($filter);
     $respondentData = $respondentModel->loadFirst();
     $this->html->snippet($this->_respondentSnippet, 'model', $respondentModel, 'data', $respondentData, 'respondentId', $respondentId);
     $tracker = $this->loader->getTracker();
     $tracks = $tracker->getRespondentTracks($respondentData['gr2o_id_user'], $respondentData['gr2o_id_organization']);
     foreach ($tracks as $trackId => $track) {
         $this->_exportTrack($track);
     }
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:28,代码来源:RespondentExport.php

示例12: createModel

 /**
  * Creates a model for getModel(). Called only for each new $action.
  *
  * The parameters allow you to easily adapt the model to the current action. The $detailed
  * parameter was added, because the most common use of action is a split between detailed
  * and summarized actions.
  *
  * @param boolean $detailed True when the current action is not in $summarizedActions.
  * @param string $action The current action.
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel($detailed, $action)
 {
     $model = $this->loader->getModels()->createRespondentModel();
     if (!$detailed) {
         return $model->applyBrowseSettings();
     }
     switch ($action) {
         case 'create':
         case 'edit':
         case 'import':
             return $model->applyEditSettings();
         case 'delete':
         default:
             return $model->applyDetailSettings();
     }
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:27,代码来源:RespondentNewAction.php

示例13: getRelation

 /**
  * Get the relation object if any
  *
  * @return Gems_Model_RespondentRelationInstance
  */
 public function getRelation()
 {
     if (is_null($this->_relation) || $this->_relation->getRelationId() !== $this->getRelationId()) {
         $model = $this->loader->getModels()->getRespondentRelationModel();
         $relationObject = $model->getRelation($this->getRespondentId(), $this->getRelationId());
         $this->_relation = $relationObject;
     }
     return $this->_relation;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:14,代码来源:Token.php

示例14: createModel

 /**
  * Get the comm Model
  */
 public function createModel()
 {
     return $this->loader->getModels()->getCommTemplateModel();
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:7,代码来源:MailFormSnippet.php


注:本文中的Gems_Loader::getModels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。