本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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;
}