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


PHP Participant::getAdapter方法代码示例

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


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

示例1: applySettingsToParticipants

 private function applySettingsToParticipants()
 {
     //only checked attributes are processed
     //returns FALSE if no attribute and/or no participant is checked
     //works only for single-Select-Inputs!
     //checked value = COL_NAME
     //form control name = COL_NAME
     //form control value = CELL_VALUE
     $partAttrs = $this->getRequest()->getParam('participantAttributeChecked');
     if ($partAttrs == NULL) {
         //no attribute checked
         return FALSE;
     }
     $data = array();
     foreach ($partAttrs as $attr => $attrName) {
         $attrValue = $this->getRequest()->getParam($attrName);
         //boolean: write 1 instead of "on" to database
         if ($attrName == Participant::COL_STOCK_ASSESSMENT && $attrValue == "on") {
             $attrValue = 1;
         }
         $data = $data + array($attrName => $attrValue);
     }
     //echo $data;
     $partIds = $this->getRequest()->getParam(Participant::COL_ID);
     if ($partIds == NULL) {
         //no participant checked
         return FALSE;
     }
     $part = new Participant();
     foreach ($partIds as $partId) {
         $where = $part->getAdapter()->quoteInto(Participant::COL_ID . ' = ?', $partId);
         $part->update($data, $where);
     }
     $this->redirectTo('index');
     return TRUE;
 }
开发者ID:blackskaarj,项目名称:webgr,代码行数:36,代码来源:EditparticipantsController.php

示例2: replicateAction

 public function replicateAction()
 {
     $ceTable = new CalibrationExercise();
     $partTable = new Participant();
     $cehimTable = new CeHasImage();
     $imagesetTable = new ImagesetAttributes();
     $shownAtTable = new CeHasAttributeDescriptor();
     /**
      * calibration exercises
      */
     $ceArray = $ceTable->find($this->callingCeId)->current()->toArray();
     /**
      * participants
      */
     $partSelect = $partTable->getAdapter()->select();
     $partSelect->from(Participant::TABLE_NAME);
     $partSelect->where(Participant::COL_CE_ID . '=?', $this->callingCeId);
     $partArray = $partTable->getAdapter()->fetchAll($partSelect);
     /**
      * imageset
      */
     $cehimSelect = $cehimTable->getAdapter()->select();
     $cehimSelect->from(CeHasImage::TABLE_NAME);
     $cehimSelect->where(CeHasImage::COL_CALIBRATION_EXERCISE_ID . '=?', $this->callingCeId);
     $cehimArray = $cehimTable->getAdapter()->fetchAll($cehimSelect);
     /**
      * imageset definition
      */
     $imagesetSelect = $imagesetTable->getAdapter()->select();
     $imagesetSelect->from(ImagesetAttributes::TABLE_NAME);
     $imagesetSelect->where(ImagesetAttributes::COL_CE_ID . '=?', $this->callingCeId);
     $imagesetArray = $imagesetTable->getAdapter()->fetchAll($imagesetSelect);
     /**
      * shown attributes
      */
     $shownAtSelect = $shownAtTable->getAdapter()->select();
     $shownAtSelect->from(CeHasAttributeDescriptor::TABLE_NAME);
     $shownAtSelect->where(CeHasAttributeDescriptor::COL_CAEX_ID . '=?', $this->callingCeId);
     $shownAtArray = $shownAtTable->getAdapter()->fetchAll($shownAtSelect);
     /**
      * insert all data
      */
     $ceData = array(CalibrationExercise::COL_COMPAREABLE => $ceArray[CalibrationExercise::COL_COMPAREABLE], CalibrationExercise::COL_DESCRIPTION => $ceArray[CalibrationExercise::COL_DESCRIPTION], CalibrationExercise::COL_EXPERTISE_ID => $ceArray[CalibrationExercise::COL_EXPERTISE_ID], CalibrationExercise::COL_KEY_TABLE_ID => $ceArray[CalibrationExercise::COL_KEY_TABLE_ID], CalibrationExercise::COL_NAME => $ceArray[CalibrationExercise::COL_NAME], CalibrationExercise::COL_RANDOMIZED => $ceArray[CalibrationExercise::COL_RANDOMIZED], CalibrationExercise::COL_WORKSHOP_ID => $ceArray[CalibrationExercise::COL_WORKSHOP_ID]);
     $newCeId = $ceTable->insert($ceData);
     foreach ($partArray as $part) {
         $partData = array(Participant::COL_CE_ID => $newCeId, Participant::COL_EXPERTISE_LEVEL => $part[Participant::COL_EXPERTISE_LEVEL], Participant::COL_NUMBER => $part[Participant::COL_NUMBER], Participant::COL_ROLE => $part[Participant::COL_ROLE], Participant::COL_STOCK_ASSESSMENT => $part[Participant::COL_STOCK_ASSESSMENT], Participant::COL_USER_ID => $part[Participant::COL_USER_ID]);
         $partTable->insert($partData);
     }
     foreach ($cehimArray as $cehim) {
         $cehimData = array(CeHasImage::COL_CALIBRATION_EXERCISE_ID => $newCeId, CeHasImage::COL_IMAGE_ID => $cehim[CeHasImage::COL_IMAGE_ID]);
         $cehimTable->insert($cehimData);
     }
     foreach ($imagesetArray as $imageSet) {
         $imageSetData = array(ImagesetAttributes::COL_ATTRIBUTE_DESCRIPTOR_ID => $imageSet[ImagesetAttributes::COL_ATTRIBUTE_DESCRIPTOR_ID], ImagesetAttributes::COL_CE_ID => $newCeId, ImagesetAttributes::COL_FROM => $imageSet[ImagesetAttributes::COL_FROM], ImagesetAttributes::COL_TO => $imageSet[ImagesetAttributes::COL_TO], ImagesetAttributes::COL_VALUE => $imageSet[ImagesetAttributes::COL_VALUE]);
         $imagesetTable->insert($imageSetData);
     }
     foreach ($shownAtArray as $shownAt) {
         $shownAtData = array(CeHasAttributeDescriptor::COL_ATDE_ID => $shownAt[CeHasAttributeDescriptor::COL_ATDE_ID], CeHasAttributeDescriptor::COL_CAEX_ID => $newCeId);
         $imagesetTable->insert($imageSetData);
     }
     $this->redirectTo('index', array(CalibrationExercise::COL_ID => $newCeId));
 }
开发者ID:blackskaarj,项目名称:webgr,代码行数:62,代码来源:EditController.php


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