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


PHP MUtil_Model_ModelAbstract::getChanged方法代码示例

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


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

示例1: execute

 /**
  * Should handle execution of the task, taking as much (optional) parameters as needed
  *
  * The parameters should be optional and failing to provide them should be handled by
  * the task
  *
  * @param array $row Row to save
  */
 public function execute($row = null)
 {
     if ($row) {
         $batch = $this->getBatch();
         $batch->addToCounter('imported');
         // \MUtil_Echo::track($row);
         $this->targetModel->save($row);
         $batch->addToCounter('changed', $this->targetModel->getChanged());
     }
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:18,代码来源:SaveToModel.php

示例2: transformRowAfterSave

 /**
  * This transform function performs the actual save (if any) of the transformer data and is called after
  * the saving of the data in the source model.
  *
  * @param \MUtil_Model_ModelAbstract $model The parent model
  * @param array $row Array containing row
  * @return array Row array containing (optionally) transformed data
  */
 public function transformRowAfterSave(\MUtil_Model_ModelAbstract $model, array $row)
 {
     if (isset($row[$this->respTrackIdField]) && $row[$this->respTrackIdField]) {
         if (!$this->respTrackIdField || $this->respTrackIdField == 'gr2t_id_respondent_track') {
             // Load && refresh when using standard gems__respondent2track data
             $respTrack = $this->tracker->getRespondentTrack($row);
         } else {
             $respTrack = $this->tracker->getRespondentTrack($row[$this->respTrackIdField]);
         }
         // Field data was already (re)calculated in transformRowBeforeSave
         // and saveFields() extracts the used field data from the row.
         $changed = $respTrack->saveFields($row);
         if ($changed && !$model->getChanged()) {
             $model->addChanged(1);
         }
     }
     // No changes
     return $row;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:27,代码来源:AddTrackFieldsTransformer.php

示例3: transformRowAfterSave

 /**
  * This transform function performs the actual save (if any) of the transformer data and is called after
  * the saving of the data in the source model.
  *
  * @param \MUtil_Model_ModelAbstract $model The parent model
  * @param array $row Array containing row
  * @return array Row array containing (optionally) transformed data
  */
 public function transformRowAfterSave(\MUtil_Model_ModelAbstract $model, array $row)
 {
     if (isset($row[$this->respTrackIdField]) && $row[$this->respTrackIdField]) {
         // Field data was already (re)calculated in transformRowBeforeSave
         // and saveFields() extracts the used field data from the row.
         $changed = $this->fieldsDefinition->saveFields($row[$this->respTrackIdField], $row);
         if ($changed) {
             $tracker = $this->loader->getTracker();
             $respTrack = $tracker->getRespondentTrack($row[$this->respTrackIdField]);
             $userId = $this->loader->getCurrentUser()->getUserId();
             $respTrack->handleFieldUpdate($userId);
             if (!$model->getChanged()) {
                 $model->addChanged(1);
             }
         }
     }
     // No changes
     return $row;
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:27,代码来源:AddTrackFieldsTransformer.php


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