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


PHP Codendi_Request::validInArray方法代码示例

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


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

示例1: process

 /**
  * Update/Delete action
  *
  * @param Codendi_Request $request The user's request
  *
  * @return void
  */
 public function process(Codendi_Request $request)
 {
     if ($request->getInArray('remove_postaction', $this->id)) {
         $this->getDao()->deletePostAction($this->id);
     } else {
         $field_id = $this->getFieldId();
         $value_type = $this->value_type;
         // Target field
         if ($request->validInArray('workflow_postaction_field_date', new Valid_UInt($this->id))) {
             $new_field_id = $request->getInArray('workflow_postaction_field_date', $this->id);
             $field_id = $this->getFieldIdOfPostActionToUpdate($new_field_id);
         }
         // Value Type
         $valid_value_type = new Valid_WhiteList($this->id, array(self::CLEAR_DATE, self::FILL_CURRENT_TIME));
         if ($request->validInArray('workflow_postaction_field_date_value_type', $valid_value_type)) {
             $value_type = $request->getInArray('workflow_postaction_field_date_value_type', $this->id);
         }
         // Update if something changed
         if ($field_id != $this->getFieldId() || $value_type != $this->value_type) {
             $this->getDao()->updatePostAction($this->id, $field_id, $value_type);
         }
     }
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:30,代码来源:Transition_PostAction_Field_Date.class.php

示例2: process

 /**
  * @see Transition_PostAction
  */
 public function process(Codendi_Request $request)
 {
     if ($request->getInArray('remove_postaction', $this->id)) {
         $this->getDao()->deletePostAction($this->id);
     } else {
         $field_id = $this->getFieldId();
         $value = $request->getInArray('workflow_postaction_field_int_value', $this->id);
         if ($request->validInArray('workflow_postaction_field_int', new Valid_UInt($this->id))) {
             $new_field_id = $request->getInArray('workflow_postaction_field_int', $this->id);
             $field_id = $this->getFieldIdOfPostActionToUpdate($new_field_id);
             //Check if value is an int
             $field = $this->getFormElementFactory()->getUsedFormElementById($field_id);
             if ($field) {
                 $field->validateValue($value);
             }
         }
         // Update if something changed
         if ($field_id != $this->getFieldId() || $value != $this->value) {
             $this->getDao()->updatePostAction($this->id, $field_id, $value);
         }
     }
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:25,代码来源:Transition_PostAction_Field_Int.class.php

示例3: updatePreferences

 /**
  * Update the preferences
  * @param Codendi_Request $request
  * @return boolean true if something has been updated
  */
 function updatePreferences($request)
 {
     $done = false;
     $vContentId = new Valid_UInt('content_id');
     $vContentId->required();
     if (($plugin_docman_widget_embedded = $request->get('plugin_docman_widget_embedded')) && $request->valid($vContentId)) {
         $vItem_id = new Valid_String('item_id');
         if ($request->validInArray('plugin_docman_widget_embedded', $vItem_id)) {
             $item_id = " item_id   = " . db_ei($plugin_docman_widget_embedded['item_id']) . " ";
         } else {
             $item_id = ' item_id = item_id ';
         }
         $vTitle = new Valid_String('title');
         if ($request->validInArray('plugin_docman_widget_embedded', $vTitle)) {
             $title = " title = '" . db_escape_string($plugin_docman_widget_embedded['title']) . "' ";
         } else {
             $title = ' title = title ';
         }
         $sql = "UPDATE plugin_docman_widget_embedded \n                    SET " . $title . ", " . $item_id . " \n                    WHERE owner_id   = " . $this->owner_id . " \n                      AND owner_type = '" . $this->owner_type . "' \n                      AND id         = " . (int) $request->get('content_id');
         $res = db_query($sql);
         $done = true;
     }
     return $done;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:29,代码来源:Docman_Widget_Embedded.class.php


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