query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
desc: creates an box param: name, array['val']="display" of data, default selected, extra parameters returns: html of box and options | public function create_selectbox($name, $data, $default = '', $param = '', $def_option = '', $disable = '') {
$out = '<select name="' . $name . '"' . (!empty($param) ? ' ' . $param : '') . ">\n";
if (!empty($def_option)) {
$out .= "<option value=''>" . $def_option . "</option>\n";
}
foreach ($data as $key => $val) {
$out.='<option value="' . $key . '"' . ($default == $key ? ' selected="selected"' : '') . ' ' . ($disable == $key ? 'disabled="disabled"' : '') . '>';
$out.=$val;
$out.="</option>\n";
}
$out.="</select>\n";
return $out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function html_selectbox($name, $values, $selected=NULL, $attributes=array()) {\n\t$attr_html = '';\n\tif(is_array($attributes) && !empty($attributes))\n\t{\n\t\tforeach ($attributes as $k=>$v)\n\t\t{\n\t\t\t$attr_html .= ' '.$k.'=\"'.$v.'\"';\n\t\t}\n\t}\n\n\t$output = '<select name=\"'.$name.'\" id=\"'.$name.'\"'.$attr_html.'>'.\"\\n\";\n\tif(is_array($values) && !empty($values))\n\t{\n\t\tforeach($values as $key=>$value)\n\t\t{\n\t\t\tif(is_array($value))\n\t\t\t{\n\t\t\t\t$output .= '<optgroup label=\"'.$key.'\">'.\"\\n\";\n\t\t\t\tforeach($value as $k=>$v)\n\t\t\t\t{\n\t\t\t\t\t$sel = $selected==$v ? ' selected=\"selected\"' : '';\n\t\t\t\t\t$output .= '<option value=\"'.$k.'\"'.$sel.'>'.$v.'</option>'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t$output .= '</optgroup>'.\"\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sel = $selected==$value ? ' selected' : '';\n\t\t\t\t$output .= '<option'.$sel.' value=\"'.$value.'\">'.$value.'</option>'.\"\\n\";\n \n\t\t\t}\n\t\t}\n\t}\n\t$output .= \"</select>\\n\";\n\n\treturn $output;\n}",
"function createSelect($name, $label, $options)\n{\n $html = \"<label>\" . $label . \"</label>\";\n $html .= \"<select>'\" . $name . \"'>\";\n foreach ($options as $key => $value)\n {\n $html .= \"<option value ='\" . $value['value'] . \"'>\" . $value['content'] . \"</option>\";\n }\n $html .= \"</select>\";\n return $html;\n}",
"function createSelect($name, $label, $options)\n{\n\n $html = \"<label>\". $label . \"</label>\";\n $html = \"<select name='\" . $name .\"'>\";\n foreach ($options as $key => $value)\n {\n $html .= \"<option value='\". $value['value'] . \"'>\" . $value['content'] . \"</option>\";\n }\n $html .= \"</select>\";\n return $html;\n}",
"function selector($name,$valueArray,$size=\"\",$format=\"\",$selected=\"\",$prefix=\"\",$postfix=\"\",$help=\"\",$helpfree=\"\")\r\n {\r\n if (right::field_view($help) and is_array($valueArray))\r\n {\r\n if ($prefix) echo \"<span class='normal'>$prefix</span> \";\r\n $retString = \"\";\r\n\r\n \t\t$retString .= \"<select $format size='$size' name='$name' \";\r\n \r\n \tif ($help or $helpfree) $retString .= help::show($help,$helpfree);\r\n \t\t\r\n if (right::field_edit($help) or $type == \"hidden\") // editable: enable edit\r\n {\r\n $retString .= \">\";\r\n }\r\n else // display only\r\n {\r\n $retString .= \" disabled>\";\r\n }\r\n \r\n $retString .= \"<option value=''></option>\";\r\n foreach($valueArray as $entry)\r\n {\r\n $retString .= \"<option value='\" . $entry[value] . \"'\";\r\n if ($selected == $entry[value]) $retString .= \" selected\";\r\n $retString .= \">\" . $entry[text] . \"</option>\";\r\n } \r\n $retString .= \"</select>\";\r\n \r\n if ($postfix) $retString .= \" <span class='normal'>$postfix</span>\";\r\n }\r\n return ($retString);\r\n }",
"function osc_draw_selection_field($name, $type, $values, $default = null, $parameters = null, $separator = ' ') {\n\t\tif (!is_array($values)) {\n\t\t\t$values = array($values);\n\t\t}\n\t\t\n\t\tif ( strpos($name, '[') !== false ) {\n\t\t\t$name_string = substr($name, 0, strpos($name, '['));\n\t\t\t\n\t\t\tif ( isset($_GET[$name_string]) ) {\n\t\t\t\t$default = $_GET[$name_string];\n\t\t\t\t} elseif ( isset($_POST[$name_string]) ) {\n\t\t\t\t$default = $_POST[$name_string];\n\t\t\t}\n\t\t\t} else {\n\t\t\tif ( isset($_GET[$name]) ) {\n\t\t\t\t$default = $_GET[$name];\n\t\t\t\t} elseif ( isset($_POST[$name]) ) {\n\t\t\t\t$default = $_POST[$name];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$field = '';\n\t\t\n\t\t$counter = 0;\n\t\t\n\t\tforeach ($values as $key => $value) {\n\t\t\t$counter++;\n\t\t\t\n\t\t\tif (is_array($value)) {\n\t\t\t\t$selection_value = $value['id'];\n\t\t\t\t$selection_text = ' ' . $value['text'];\n\t\t\t\t} else {\n\t\t\t\t$selection_value = $value;\n\t\t\t\t$selection_text = '';\n\t\t\t}\n\t\t\t\n\t\t\t$field .= '<input type=\"' . tep_output_string($type) . '\" name=\"' . tep_output_string($name) . '\"';\n\t\t\t\n\t\t\tif (strpos($parameters, 'id=') === false) {\n\t\t\t\t$field .= ' id=\"' . tep_output_string($name) . (sizeof($values) > 1 ? '_' . $counter : '') . '\"';\n\t\t\t\t} elseif (sizeof($values) > 1) {\n\t\t\t\t$offset = strpos($parameters, 'id=\"');\n\t\t\t\t$field .= ' id=\"' . tep_output_string(substr($parameters, $offset+4, strpos($parameters, '\"', $offset+4)-($offset+4))) . '_' . $counter . '\"';\n\t\t\t}\n\t\t\t\n\t\t\tif (trim($selection_value) != '') {\n\t\t\t\t$field .= ' value=\"' . tep_output_string($selection_value) . '\"';\n\t\t\t}\n\t\t\t\n\t\t\tif ((is_bool($default) && $default === true) || ((is_string($default) && (trim($default) == trim($selection_value))) || (is_array($default) && in_array(trim($selection_value), $default)))) {\n\t\t\t\t$field .= ' checked=\"checked\"';\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($parameters)) {\n\t\t\t\t$field .= ' ' . $parameters;\n\t\t\t}\n\t\t\t\n\t\t\t$field .= ' />';\n\t\t\t\n\t\t\tif (!empty($selection_text)) {\n\t\t\t\t$field .= '<label for=\"' . tep_output_string($name) . (sizeof($values) > 1 ? $counter : '') . '\" class=\"fieldLabel\">' . $selection_text . '</label>';\n\t\t\t}\n\t\t\t\n\t\t\t$field .= $separator;\n\t\t}\n\t\t\n\t\tif (!empty($field)) {\n\t\t\t$field = substr($field, 0, strlen($field)-strlen($separator));\n\t\t}\n\t\t\n\t\treturn $field;\n\t}",
"function selectBox($name,$sel,$class=0,$valuesArray=0, $select_one=0, $onchange=0){\n\t$html = '<select id=\"'.$name.'\" name=\"'.$name.'\"';\n\tif($class) $html .= ' class=\"'.$class.'\"';\n\tif($onchange) $html .= ' onChange=\"'.$onchange.'\"';\n\t$html .= '>';\n\tif(!$select_one) $select_one = 'Select One';\n\tif($select_one && !is_int($select_one)) $html .= '<option value=\"\" style=\"color:#999\">'.$select_one.'</option>';\n\tforeach($valuesArray AS $key => $val){\n\t\t$html .= '<option value=\"'.$key.'\"';\n\t\tif(strtoupper($key) == strtoupper($sel) || $key == $sel) $html .= ' selected'; \n\t\t$html .= '> '.$val.'</option>';\n\t}\t\n\t$html .= '</select>';\n\treturn $html;\n}",
"function select_box($selected, $options, $input_name, $input_id = FALSE, $use_lang = TRUE, $key_is_value = TRUE, $attributes = array())\n\t{\n\t\tglobal $LANG;\n\n\t\t$input_id = ($input_id === FALSE) ? str_replace(array(\"[\", \"]\"), array(\"_\", \"\"), $input_name) : $input_id;\n\n\t\t$attributes = array_merge(array(\n\t\t\t\"name\" => $input_name,\n\t\t\t\"id\" => strtolower($input_id)\n\t\t), $attributes);\n\n\t\t$attributes_str = \"\";\n\t\tforeach ($attributes as $key => $value)\n\t\t{\n\t\t\t$attributes_str .= \" {$key}='{$value}' \";\n\t\t}\n\n\t\t$ret = \"<select{$attributes_str}>\";\n\n\t\tforeach($options as $option_value => $option_label)\n\t\t{\n\t\t\tif (!is_int($option_value))\n\t\t\t\t$option_value = $option_value;\n\t\t\telse\n\t\t\t\t$option_value = ($key_is_value === TRUE) ? $option_value : $option_label;\n\n\t\t\t$option_label = ($use_lang === TRUE) ? $LANG->line($option_label) : $option_label;\n\t\t\t$checked = ($selected == $option_value) ? \" selected='selected' \" : \"\";\n\t\t\t$ret .= \"<option value='{$option_value}'{$checked}>{$option_label}</option>\";\n\t\t}\n\n\t\t$ret .= \"</select>\";\n\t\treturn $ret;\n\t}",
"function select_box($selected, $options, $input_name, $input_id = FALSE, $use_lang = TRUE, $key_is_value = TRUE, $attributes = array())\n\t{\n\t\tglobal $LANG;\n\n\t\t$input_id = ($input_id === FALSE) ? str_replace(array(\"[\", \"]\"), array(\"_\", \"\"), $input_name) : $input_id;\n\n\t\t$attributes = array_merge(array(\n\t\t\t\"name\" => $input_name,\n\t\t\t\"id\" => strtolower($input_id)\n\t\t), $attributes);\n\n\t\t$attributes_str = \"\";\n\t\tforeach ($attributes as $key => $value)\n\t\t{\n\t\t\t$attributes_str .= \" {$key}='{$value}' \";\n\t\t}\n\n\t\t$ret = \"<select{$attributes_str}>\";\n\n\t\tforeach($options as $option_value => $option_label)\n\t\t{\n\t\t\tif (!is_int($option_value))\n\t\t\t\t$option_value = $option_value;\n\t\t\telse\n\t\t\t\t$option_value = ($key_is_value === TRUE) ? $option_value : $option_label;\n\n\t\t\t$option_label = ($use_lang === TRUE) ? $LANG->line($option_label) : $option_label;\n\t\t\t$checked = ($selected == $option_value) ? \" selected='selected' \" : \"\";\n\t\t\t$ret .= \"<option value='{$option_value}'{$checked}>{$option_label}</option>\";\n\t\t}\n\n\t\t$ret .= \"</select>\";\n\t\treturn $ret;\n\t}",
"function htmlobject_select($name, $value, $title = '', $selected = array()) {\n\n\t\t$html = new htmlobject_select();\n\t\t$html->id = 'p'.uniqid();\n\t\t$html->name = $name;\n\t\t$html->title = $title;\n\t\t$html->selected = $selected;\n\t\t$html->text_index = array(\"value\" => \"value\", \"text\" => \"label\");\n\t\t$html->text = $value;\n\n\t\treturn htmlobject_box_from_object($html, ' select');\n}",
"static function buildSelect($title,$name,$id,$mod,$foreignTable,$curVal,$foreignscheme=\"\",$event=\"\",$disabled=\"\") {\r\n\t\t\techo '<LABEL>';\r\n \t\techo '<SPAN>'.$title.' :</SPAN>';\r\n\t\t\tif ($event != \"\") {\r\n\t\t\t\t$event = 'onchange=\"'.$event.'\"';\r\n\t\t\t}\r\n\t\t\techo '<SELECT '.$disabled.' name=\"'.$name.'\" id=\"'.$id.'\" '.$event.' >';\r\n\t\t\t$mod->fillForeignTableCombo($foreignTable,$curVal,$foreignscheme);\r\n\t\t\techo '</SELECT>';\r\n\t\t\techo '</LABEL>';\r\n\t\t}",
"function selectWidget($name, $text, $optiontext, $data)\n {\n while ($row = $data->fetchRow(DB_FETCHMODE_ASSOC))\n {\n $this->setCurrentBlock(\"option\");\n $this->setVariable(\"OPTIONTEXT\", $row[\"{$optiontext}\"]);\n $this->setVariable(\"OPTIONVALUE\", $row[\"{$name}\"]);\n if (isset($_SESSION[\"{$this->formVars}\"][\"{$name}\"]) && \n $_SESSION[\"{$this->formVars}\"][\"{$name}\"] == $row[\"{$name}\"])\n $this->setVariable(\"SELECTED\", \" selected\"); \n $this->parseCurrentBlock(\"option\");\n }\n $this->setCurrentBlock(\"select\");\n $this->setVariable(\"SELECTNAME\", \"{$name}\");\n $this->setVariable(\"SELECTTEXT\", \"{$text}\");\n $this->parseCurrentBlock(\"select\"); \n $this->setCurrentBlock(\"widget\");\n $this->parseCurrentBlock(\"widget\"); \n }",
"protected function loadSelectBox($field, $metadata_render=False){\n\n\t\t$field['required'] = $field['required'] == 'checked' ? ' required' : false;\n\n\t\t$html = '';\n \n if($metadata_render == False) {\n \t $html .= sprintf('<li class=\"%s%s\" id=\"fld-%s\">' . \"\\n\", $this->elemId($field['cssClass']), $field['required'], $this->elemId($field['title'])); \n } else { \n \t $html .= sprintf('<div class=\"%s%s form-field-block\" id=\"fld-%s\">' . \"\\n\", $this->elemId($field['cssClass']), $field['required'], $this->elemId($field['title']));\n }\n\t\n\t\tif(isset($field['title']) && !empty($field['title'])){\n //$html .= sprintf('<label for=\"%s\">%s</label><br/>' . \"\\n\", $this->elemId($field['title']), $field['title']);\n // added ucfirst here. becuase title becomes lower case.\n // and replaced underscore with space.\n $title = str_replace('_', ' ', $this->elemId($field['title']));\n $title = ucfirst($title);\n\t\t\t$html .= sprintf('<div class=\"title\">%s</div><br/>' . \"\\n\", $title, $field['title']);\n\t\t}\n\n\t\t$field['values'] = (array)$field['values'];\n\t\tif(isset($field['values']) && is_array($field['values'])){\n\t\t\t$multiple = $field['multiple'] == \"checked\" ? ' multiple=\"multiple\"' : '';\n\t\t\t$html .= sprintf('<select name=\"%s\" id=\"%s\"%s class=\"regular-custom-field\">' . \"\\n\", $this->elemId($field['title']), $this->elemId($field['title']), $multiple);\n\t\t\tif($field['required']){ $html .= '<option value=\"\">Selection Required</label>'; }\n\t\t\t\n\t\t\tforeach($field['values'] as $item){\n\t\t\t\t\n\t\t\t\t$item = (array)$item;\n\n\t\t\t\t// set the default checked value\n\t\t\t\t//$checked = $item['default'] == 'true' ? true : false;\n\t\t\t\t$checked_multiple = $item['baseline'] == 'checked' ? true : false;\n\t\t\t\t// load post value\n\t\t\t\t$val = $this->getPostValue($this->elemId($field['title']));\n\t\t\t\t$checked = !empty($val);\n\n\t\t\t\t// if checked, set html\n\t\t\t\t$checked = $checked_multiple ? ' selected' : '';\n \n // add \"selected\" class to the selected option. to be used in reseting metadata in fullpage form.\n $checked .= ( $checked_multiple ? ' class=\"selected\"' : '' );\n\n\t\t\t\t$option \t= '<option value=\"%s\"%s>%s</option>' . \"\\n\";\n\t\t\t\t$html .= sprintf($option, $item['value'], $checked, $item['value']);\n\t\t\t}\n\n\t\t\t$html .= '</select>' . \"\\n\";\n\n if($metadata_render == False) { \n \t $html .= '</li>' . \"\\n\"; \n } else {\n \t $html .= '</div>' . \"\\n\"; \n\n }\n\t\t}\n\n\t\treturn $html;\n\n\t}",
"function wic_layout_type_box_markup( $object, $box ) {\n\twp_nonce_field( basename( __FILE__ ), 'wic_layout_type_nonce' );\n\t\n\t$obj_field = get_post_meta( $object->ID, 'wic_layout_type', true );\n?>\n\n\t<p>\n\t <label for=\"wic-post-class\"><?php _e( \"Choose layout type, which will be applied the layout into article page.\", 'example' ); ?></label>\n\t <br /><br />\n\t <select class=\"widefat\" name=\"wic-layout-type\" id=\"wic-layout-type\">\n\t\t\t<option value=\"type-1\" <?php echo ( empty($obj_field) || $obj_field == 'type-1' ) ? 'selected' : ''; ?>>Image on right-hand-side</option>\n\t\t\t<option value=\"type-2\" <?php echo ( $obj_field == 'type-2' ) ? 'selected' : ''; ?>>Image on top</option>\n\t\t</select>\n\t</p>\n<?php\t\n}",
"public function makeSelect(){\r\n echo \"<select name=\\\"\" .$this->getName(). \"\\\">\\n\";\r\n //Create options.\r\n $this->makeOptions($this->getValue());\r\n echo \"</select>\" ;\r\n }",
"function hlextra_inner_custom_box( $post ) {\n\n // Use nonce for verification\n wp_nonce_field( plugin_basename( __FILE__ ), 'hlextra_nonce' );\n\n // The actual fields for data entry\n // Use get_post_meta to retrieve an existing value from the database and use the value for the form\n \n \techo '<table><tr><td style=\"vertical-align: top;\"><p>Select multiple authors by holding Ctrl while clicking on required names</p><p>Selections made here will override the normal Post Author</p></td><td>';\n\t$a_authors = get_post_meta( $post->ID, 'multiple_authors' );\n\t$a_users = get_users();\n\techo '<select name=\"hlextra_authors[]\" size=30 multiple>';\n\tforeach( $a_users as $user ) {\n\t\tif( is_array($a_authors[0]) ) $selected = ( in_array($user->ID, $a_authors[0]) ? 'selected' : '' );\n\t\techo '<option '.$selected.' value=\"'.$user->ID.'\">'.$user->display_name.'</option>';\n\t}\n\techo '</select></td></tr></table>'; \n}",
"function edit_field_callback_1($value, $row)\n{\n\n return ' <select id=\"tipo\" name=\"tipo\">\n <option value=\"2\" selected>Automatica (Consumo)</option>\n <option value=\"1\">Automatica (Stock Minimo)</option>\n <option value=\"0\">Manual</option>\n <option value=\"3\">Ingreso</option>\n </select>';\n \n\n \n}",
"function optionField($value='',$label='',$selected=false){\n\treturn '<option value=\"'. $value .'\" '. ($selected ? 'selected = \"selected\"' : '') .'>'. $label .'</option>';\n}",
"function draw_select_element($name, $option_array, $selected_value = '', $onChange = '', $params = ''){\n\t$r = '<select name=\"'.$name.'\" onChange=\"'.$onChange.'\" '.$params.'>';\n\tfor($i = 0; $i < count($option_array); $i++){\n\t\t$value = $option_array[$i]['value'];\n\t\t$label = $option_array[$i]['label'];\n\t\t$r .= \"\\n\\t\\t\\t\".'<option value=\"'.$value.'\"';\n\t\tif($value == $selected_value){\n\t\t\t$r .= ' selected=\"selected\"';\n\t\t}\n\t\t$r .= '>'.$label.'</option>';\n\t}\n\t$r .= \"\\n\\t\\t\".'</select>';\n\treturn $r;\n}",
"function form_select($title, $name, $value, $options, $description = NULL, $extra = 0, $multiple = FALSE, $required = FALSE) {\n $select = '';\n foreach ($options as $key => $choice) {\n if (is_array($choice)) {\n $select .= '<optgroup label=\"'. $key .'\">';\n foreach ($choice as $key => $choice) {\n $select .= '<option value=\"'. $key .'\"'. (is_array($value) ? (in_array($key, $value) ? ' selected=\"selected\"' : '') : ($value == $key ? ' selected=\"selected\"' : '')) .'>'. check_plain($choice) .'</option>';\n }\n $select .= '</optgroup>';\n }\n else {\n $select .= '<option value=\"'. $key .'\"'. (is_array($value) ? (in_array($key, $value) ? ' selected=\"selected\"' : '') : ($value == $key ? ' selected=\"selected\"' : '')) .'>'. check_plain($choice) .'</option>';\n }\n }\n return theme('form_element', $title, '<select name=\"edit['. $name .']'. ($multiple ? '[]' : '') .'\"'. ($multiple ? ' multiple=\"multiple\" ' : '') . ($extra ? ' '. $extra : '') .' id=\"edit-'. form_clean_id($name) .'\">'. $select .'</select>', $description, 'edit-'. $name, $required, _form_get_error($name));\n}",
"function mytheme_show_box() {\n global $meta_box, $post;\n \n // Use nonce for verification\n echo '<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n \n foreach ($meta_box['fields'] as $field) {\n // get current post meta data\n $meta = get_post_meta($post->ID, $field['id'], true);\n\n switch ($field['type']) {\n case 'text':\n echo '<div id=\"'.$field['id'].'\" class=\"mssbox '.$field['font_class'].'\"><label>'.$field['desc'].'</label><input type=\"text\" name=\"', $field['id'], '\" value=\"', $meta ? $meta : $field['std'], '\"/></div>';\n break;\n case 'textarea':\n echo '<div id=\"'.$field['id'].'\" class=\"mssbox '.$field['font_class'].'\"><label>'.$field['desc'].'</label><textarea name=\"', $field['id'], '\" cols=\"60\" rows=\"4\" >', $meta ? $meta : $field['std'], '</textarea></div>';\n break;\n case 'select':\n echo '<select name=\"', $field['id'], '\" id=\"', $field['id'], '\">';\n foreach ($field['options'] as $option) {\n echo '<option', $meta == $option ? ' selected=\"selected\"' : '', '>', $option, '</option>';\n }\n echo '</select>';\n break;\n case 'radio':\n foreach ($field['options'] as $option) {\n echo '<input type=\"radio\" name=\"', $field['id'], '\" value=\"', $option['value'], '\"', $meta == $option['value'] ? ' checked=\"checked\"' : '', ' />', $option['name'];\n }\n break;\n case 'checkbox':\n echo '<input type=\"checkbox\" name=\"', $field['id'], '\" id=\"', $field['id'], '\"', $meta ? ' checked=\"checked\"' : '', ' />';\n break;\n }\n }\n echo '<br clear=\"all\"/>';\n}",
"static function buildSelectParam($title,$name,$id,$mod,$foreignTable,$curVal,$foreignscheme=\"\",$event=\"\",$disabled=\"\",$param) {\r\n echo '<LABEL>';\r\n echo '<SPAN>'.$title.' :</SPAN>';\r\n if ($event != \"\") {\r\n $event = 'onchange=\"'.$event.'\"';\r\n \r\n }\r\n echo '<SELECT '.$disabled.' name=\"'.$name.'\" id=\"'.$id.'\" '.$event.' >';\r\n $mod->fillForeignTableComboParam($foreignTable,$curVal,$foreignscheme,$param);\r\n echo '</SELECT>';\r\n echo '</LABEL>';\r\n }",
"function labeloption($formavisual,$tipoedicion,$Label,$Labe2,$value,$optname,$row,$jump,$tableabre='',$tablecierra='',$err_objeto='')\n{\nif($formavisual==1 or ($formavisual==5 && $tipoedicion==5) or ($formavisual==3 && $tipoedicion!=1) or ($formavisual==2 && $tipoedicion!=5)) {\n \n // busco valores iniciales\n $pos_fin=strpos($optname,\"=\");\n $value_ini=0;\n if($pos_fin)\n\t{ \n\t $namefield=substr($optname,3,$pos_fin-3); \n\t $value_ini=strval(substr($optname,$pos_fin+1));\n\t $optname=substr($optname,0,$pos_fin);\n\t}\n else\n $namefield=substr($optname,3); \n\t$namecbsearch='_busq'.$namefield; \n\t\n\tif ($tableabre=='' or $tableabre=='[') { \n\t\thtml_iniobj($err_objeto,$optname,$Label);\n\n\t\t\tif($tipoedicion==5) {//busqueda\n\t\t\t?>\n\t\t\t<select name=\"<? echo $namecbsearch ?>\" class=\"cajatexto\" onKeyPress=\"return formato(event,form,this)\" >\n\t\t <option value=\"=\" <? if(strcmp($_POST[$namecbsearch],\"=\")==0) {echo \"SELECTED\";} ?>>= </option>\t \t\t\t\n\t\t <option value=\"!=\" <? if(strcmp($_POST[$namecbsearch],\"!=\")==0) {echo \"SELECTED\";} ?>>EXc</option>\t \t\t\t\t\t\t \n\t\t\t</select>\n\t\t\t<? }\t\n\n\t\t} \n\t\t\n\t\t?>\n\n\t <span class=\"etiqueta objeto\"><?php echo $Labe2?></span>\n\n\t\t<? if($_POST[$optname]) $valopt=$_POST[$optname];\n\t\t else\tif($row[$namefield]) $valopt=$row[$namefield];\n\t\t else if($value_ini) $valopt=$value_ini;\n\t\t else $valopt=''; \t\n\t\t?>\n\t\t<input type=\"radio\" name=\"<? echo $optname ?>\" class=\"cajatexto\" id=\"<? echo $Label?>\" value=\"<? echo $value?>\" <? if(strcmp($valopt,$value)==0) {echo \"CHECKED\";} ?> <? if($tipoedicion==3) echo \"DISABLED\" ?>\t\n\t\t<? if($jump) {?>\t\t\n\t\tonClick=\"MM_jumpMenu(form,this,'<? echo PAGE ?>')\"\n\t\t<? }?>\t\t\t\t\n\t\t >\t\n\t\t<? \n\t\t\t//CREO EL CAMPO OCULTO CUANDO SE ESTA TRABAJANDO CON TABLAS DINAMICAS\n\t\t\tif(strpos($optname,\"XX\")){ ?>\n\t\t\t\t<input name=\"<? echo substr($optname,2) ?>\" type=\"hidden\" >\t\n\t\t\t<? }\n\n\tif ($tablecierra=='' or $tablecierra==']') { \n\t\thtml_endobj(); \n\t\t} \n\t}\n}",
"function iver_select_create_meta_box( $attributes ) {\n\t\t$scope = array();\n\t\t$title = '';\n\t\t$name = '';\n\t\t\n\t\textract( $attributes );\n\t\t\n\t\tif ( ! empty( $scope ) && $title !== '' && $name !== '' ) {\n\t\t\t$meta_box_obj = new IverSelectMetaBox( $scope, $title, $name );\n\t\t\tiver_select_framework()->qodeMetaBoxes->addMetaBox( $name, $meta_box_obj );\n\t\t\t\n\t\t\treturn $meta_box_obj;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function snt_def_top_form() {\n\n $options = array(\n\t\t'' => ' ' . _x( 'Select Default Top Value...', 'Setting option', 'snt-en' ),\n\t\t'region' => _x( 'Region', 'Top meta-data option in Taxonomy/Meta Defaults screen', 'snt-en' ),\n\t\t'topic' => _x( 'Topic', 'Top meta-data option in Taxonomy/Meta Defaults screen', 'snt-en' ),\n\t\t'none' => _x( 'Nowhere', 'Top meta-data option in Taxonomy/Meta Defaults screen', 'snt-en' )\n\t);\n\t$opt_name = 'snt_def_top_meta_user_' . get_current_user_id();\n\t$sel = get_option( $opt_name );\n\t$html = \"<div><select title='$opt_name' name='$opt_name' class='def-tax-input' id='$opt_name'>\";\n\tforeach ( $options as $val => $txt ) :\n $html .= \"<option value='$val' \" . ( $val === $sel ? 'selected' : '' ) . \">$txt</option>\";\n\tendforeach;\n $html .= \"</select></div>\";\n\n echo $html;\n\n}",
"function createOptBox() {\n\t if (DEBUG&&DEBUGLEVEL&1) debug('Start method frontend::createOptBox()');\n\t global $languageXML;\n\t $this->site[] = ' <TABLE BORDER=\"0\" CLASS=\"optBox\">';\n\t $this->site[] = ' <FORM METHOD=\"get\" ACTION=\"./index.php\">';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" CLASS=\"optBoxItem\">'.$languageXML['LANG']['HEADER']['OPTBOX']['SELECTTRAP'].':</TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" class=\"optBoxItem\">';\n\t $this->site[] = ' <SELECT NAME=\"trapSelect\">';\n\t $this->site[] = ' <OPTION VALUE=\"all\" '.common::selected(\"all\",$_REQUEST['trapSelect'],\"selected\").' >'.$languageXML['LANG']['HEADER']['OPTBOX']['SELECTTRAPVALUE']['TRAPACTUEL'].'</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"ARCHIVED\" '.common::selected(\"ARCHIVED\",$_REQUEST['trapSelect'],\"selected\").' >'.$languageXML['LANG']['HEADER']['OPTBOX']['SELECTTRAPVALUE']['TRAPARCHIVED'].'</OPTION>';\n\t $this->site[] = common::checkIfEnableUnknownTraps($this->configINI['global']['useUnknownTraps']);\n\t $this->site[] = ' </SELECT>';\n\t $this->site[] = ' </TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" CLASS=\"optBoxItem\">'.$languageXML['LANG']['HEADER']['OPTBOX']['SEVERITYDETAIL'].':</TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" COLSPAN=\"2\" class=\"optBoxItem\">';\n\t $this->site[] = ' <SELECT NAME=\"severity\">';\n\t $this->site[] = ' <OPTION VALUE=\"\" '.common::selected(\"\",$_REQUEST['severity'],\"selected\").' >'.$languageXML['LANG']['HEADER']['OPTBOX']['OPTION']['VALUEALL'].'</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"OK\" '.common::selected(\"OK\",$_REQUEST['severity'],\"selected\").' >Traps ok</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"WARNING\" '.common::selected(\"WARNING\",$_REQUEST['severity'],\"selected\").' >Traps warning</OPTION>';\n\t $this->site[] = ' <OPTION VALUE=\"CRITICAL\" '.common::selected(\"CRITICAL\",$_REQUEST['severity'],\"selected\").' >Traps critical</OPTION>';\n\t $this->site[] = ' </SELECT>';\n\t $this->site[] = ' </TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = common::createCategoryFilter();\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" CLASS=\"optBoxItem\">'.$languageXML['LANG']['HEADER']['OPTBOX']['OLDERENTRIESFIRST'].':</TD>';\n\t $this->site[] = ' <TD></TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" VALIGN=\"bottom\" CLASS=\"optBoxItem\"><INPUT TYPE=\"checkbox\" name=\"oldestfirst\" '.common::selected(\"on\",$_REQUEST['oldestfirst'],\"checked\").' ></TD>';\n\t $this->site[] = ' <TD ALIGN=\"right\" CLASS=\"optBoxItem\"><INPUT TYPE=\"submit\" VALUE=\"'.$languageXML['LANG']['HEADER']['OPTBOX']['UPDATEBUTTON'].'\"></TD>';\n\t $this->site[] = ' <INPUT TYPE=\"hidden\" NAME=\"hostname\" VALUE=\"'.$_GET['hostname'].'\">';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = ' </FORM>';\n\t $this->site[] = ' </TABLE>';\n\t if (DEBUG&&DEBUGLEVEL&1) debug('End method frontend::createOptBox()');\n\t}",
"function wp_sto_print_select($arr_data, $name, $value)\n{\n\t$print_select = \"\";\n\t$print_select.= \"<select name='$name'>\";\n\n\tforeach ($arr_data as $data) \n\t{\n\t\t$selected = $data['value'] == $value ? 'selected' : '';\n\n\t\t$print_select.= \"<option value='{$data['value']}' $selected >{$data['label']}</option>\";\n\t}\n\n\t$print_select.= \"</select>\";\n\n\techo $print_select;\n}",
"public function combo_box($table, $name, $value, $name_value, $pilihan, $js='', $label='', $width=''){\r\n\t\techo \"<select name='$name' id='$name' onchange='$js' required class='form-control input-sm' style='width:$width'>\";\r\n\t\techo \"<option value=''>\".$label.\"</option>\";\r\n\t\t$query = $this->db->query($table);\r\n\t\tforeach ($query->result() as $row){\r\n\t\t\tif ($pilihan == $row->$value){\r\n\t\t\t\techo \"<option value='\".$row->$value.\"' selected>\".$row->$name_value.\"</option>\";\r\n\t\t\t} else {\r\n\t\t\t\techo \"<option value='\".$row->$value.\"'>\".$row->$name_value.\"</option>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\techo \"</select>\";\r\n\t}",
"function dropdownDisplay($name, $value, $arr, $opt=\"\") {\n\n \n $string = \"<select class=\\\"inputbox\\\" name=\\\"$name\\\" id=\\\"$name\\\" $opt>\\n\";\n\n\n foreach($arr as $key => $val) {\n if(strcmp($value, $key) == 0) {\n $string .= \"<option value=\\\"$key\\\" SELECTED>$val\\n\";\n }\n else {\n $string .= \"<option value=\\\"$key\\\">$val</option>\\n\";\n }\n }\n\n $string .= \"</SELECT>\\n\";\n\n return $string;\n }",
"function pulldown_menu_2($label, $options, $selected, $js='') {\n\t$str = '<select name=\"'.$label.'\" id=\"'.$label.'\" '.$js.'>';\n\tforeach ( $options as $o=>$v ) {\n\t\t$s = ( $selected == $o ? ' selected=\"selected\"' : '' );\n\t\t$str .= '<option'.$s.' value=\"'.$o.'\">'.$v.'</option>';\n\t}\n\t$str .= '</select>';\n\treturn $str;\n}",
"function resources_meta_box_callback( $post ) {\r\n\r\n\t// Add an nonce field so we can check for it later.\r\n\twp_nonce_field( 'resources_meta_box', 'resources_meta_box_nonce' );\r\n\r\n\t/*\r\n\t * Use get_post_meta() to retrieve an existing value\r\n\t * from the database and use the value for the form.\r\n\t */\r\n\t$_color = get_post_meta( $post->ID, 'resources_meta_color', true );\r\n\t$_template = get_post_meta( $post->ID, 'resources_meta_template', true );\r\n\r\n\t// select color\r\n\techo '<label for=\"resources_page[color]\">';\r\n\t_e( 'Color', 'resources_textdomain' );\r\n\techo '</label> ';\r\n\techo '<select id=\"resources_page[color]\" name=\"resources_page[color]\" >\r\n\t\t<option value=\"blue\" '.($_color == 'blue' ? 'selected=\"selected\"' : '').'>Blue</option>\r\n\t\t<option value=\"blue-dark\" '.($_color == 'dark-blue' ? 'selected=\"selected\"' : '').'>Dark Blue</option>\r\n\t\t<option value=\"gray\" '.($_color == 'gray' ? 'selected=\"selected\"' : '').'>Gray</option>\r\n\t\t<option value=\"green\" '.($_color == 'green' ? 'selected=\"selected\"' : '').'>Green</option>\r\n\t\t<option value=\"maroon\" '.($_color == 'maroon' ? 'selected=\"selected\"' : '').'>Maroon</option>\r\n\t\t</select><br />';\r\n\r\n\t// select template\r\n\techo '<label for=\"resources_page[template]\">';\r\n\t_e( 'Type', 'resources_textdomain' );\r\n\techo '</label> ';\r\n\techo '<select id=\"resources_page[template]\" name=\"resources_page[template]\" >\r\n\t\t<option value=\"plumbing\" '.($_template == 'plumbing' ? 'selected=\"selected\"' : '').'>Plumbing</option>\r\n\t\t<option value=\"heating\" '.($_template == 'heating' ? 'selected=\"selected\"' : '').'>Heating</option>\r\n\t\t<option value=\"ac\" '.($_template == 'ac' ? 'selected=\"selected\"' : '').'>Air Conditionaing</option>\r\n\t\t<option value=\"flood\" '.($_template == 'flood' ? 'selected=\"selected\"' : '').'>Restoration and Flood</option>\r\n\t\t</select><br />';\r\n\r\n}"
] | [
"0.66493934",
"0.6374434",
"0.6359291",
"0.63332736",
"0.6321098",
"0.62361383",
"0.6233263",
"0.6233263",
"0.6185869",
"0.61500734",
"0.61386865",
"0.61076224",
"0.60910636",
"0.60853934",
"0.60614115",
"0.6038145",
"0.5999872",
"0.5999626",
"0.59833896",
"0.59686506",
"0.59612066",
"0.59453195",
"0.59408563",
"0.59406435",
"0.59392256",
"0.5937756",
"0.5901948",
"0.589558",
"0.58917475",
"0.58900565"
] | 0.67560786 | 0 |
check if the current search pattern is valid or not | public function isValidPattern()
{
set_error_handler(array($this, "_patternErrorHandler"));
self::$_validPattern = true;
preg_match($this->_searchTerm, "test");
restore_error_handler();
return self::$_validPattern;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isLegal($pattern)\r\n\t {\r\n\t \tif (strlen($pattern) == 0 )\r\n\t \t\treturn true;\r\n\t if (Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL')) {\r\n\t return preg_match(Tools::cleanNonUnicodeSupport('/^[_a-zA-Z0-9 \\,\\;\\\"\\(\\)\\.{}:\\/\\pL\\pS-]+$/u'), $pattern);\r\n\t }\r\n\t return preg_match('/^[_a-zA-Z0-9 áéíóúÁÉÍÓÚäëïöüçñÑàèìòù#\\,\\;\\(\\)\\.{}:\\/\\-]+$/', $pattern);\r\n\t }",
"protected function validate()\n {\n if (!CommonUtils::isRegexExpr($this->pattern)) {\n return false;\n }\n\n return (bool) preg_match(\n $this->pattern,\n $this->getRequestValue()\n );\n }",
"private function\tcheck_sanity() {\n\n\t\tif(!count($this->list)) {\n\t\t\tthrow new pattern_matcher_exception(\"matcher cannot be empty\");\n\t\t}\n/*\n\t\t//TODO: There's no need, actually, maybe we could just extend.\n\t\t$names=[];\n\t\tforeach($this->list as $k => $v) {\n\n\t\t\t$curname=$v->get_name();\n\t\t\tif(false!==array_search($curname, $names)) {\n\t\t\t\tthrow new pattern_matcher_exception(\"pattern names cannot be repeated in matcher ('$curname'\");\n\t\t\t}\n\t\t\t$names[]=$curname;\n\t\t}\n*/\n\t}",
"function validatePattern(&$errors, $field_list, $field_name, $pattern) {\n\n\t\t# if the user has not entered anything in the field in the form, set error message to reflect that the field is a required field\n\t\tif (!isset($field_list[$field_name]) || $field_list[$field_name] == '') {\n\t\t\tsetErrorMessage($errors, 'Required', $field_name);\n\t\t\treturn false;\n\t\t} else if (!preg_match($pattern, $field_list[$field_name])) {\n\t\t\t\n\t\t\t# if user has entered a value for the field that does not follow the regex, set error message to invalid\n\t\t\tsetErrorMessage($errors, 'Invalid', $field_name);\n\t\t\treturn false;\n\t\t} else {\n\n\t\t\t# if no errors, then return true\n\t\t\treturn true;\n\t\t}\n\t}",
"public function isValid(): bool\n {\n return (bool) preg_match($this->pattern, $this->getValue());\n }",
"public function isPattern()\n {\n return true;\n }",
"private static function onRegex($pattern, $str) {\n if ($str != \"\") {\n if (preg_match($pattern, $str)) {\n return true;\n }\n }\n return false;\n }",
"public function validate()\n {\n return !($this->hasError = !preg_match($this->additionalParams['pattern'], $this->checkValue));\n }",
"function patternIsFound($pattern) {\n $page_text = $this->getSession()->getPage()->getText();\n var_export($page_text);\n if (!preg_match($this->patternRegex($pattern), $page_text, $matches)) {\n throw new Exception(\"No text matching the regex pattern \\\"$pattern\\\" was found.\");\n }\n }",
"function validate_pattern( $pattern, $input ) {\n $pattern = array('options' => array('regexp' => $pattern));\n return filter_var($input, FILTER_VALIDATE_REGEXP, $pattern);\n}",
"function isValid($value) {\n return mb_ereg($this->pattern, $value);\n }",
"function patternIsNotFound($pattern) {\n $page_text = $this->getSession()->getPage()->getText();\n if (preg_match($this->patternRegex($pattern), $page_text, $matches)) {\n throw new Exception(\"Text matching the regex pattern \\\"$pattern\\\" was found, and should not have been.\");\n }\n }",
"public function testPatternRecognition()\n {\n }",
"public function isValid()\n\t{\n\t\t//return if allready checked\n\t\tif (true === $this->isValidated && null !== $this->matchedSomething) {\n\t\t\treturn $this->matchedSomething;\n\t\t}\n\t\t//allow to validate from the peaces set from setter (like setPath()) or if not available from $this->urlString\n\t\tif (!empty($this->parts)) {\n\t\t\t//avoid memory allocation limit excess\n\t\t\t$this->skipToStringValidation = true;\n\t\t\t$this->getRegex()->setInputString($this->toString());\n\t\t\t$this->skipToStringValidation = false;\n\t\t}\n\t\tif ($this->matchedSomething = $this->getRegex()->match()) {\n\t\t\t//call subclass function to set each part from the regex object matches\n\t\t\t$this->setParts();//modifies $this->matchedSomething to false when one part is not valid (does not match anything)\n\t\t} else if (!$this->getRegex()->isValid()) {\n\t\t\tthrow new Exception('The regex return by class : ' . get_class($this->getRegex()) . ' is not valid.');\n\t\t}\n\t\t$this->isValidated = true;\n\t\t//set parts will alter the is valid value so make sure we dont overwrite it\n\t\treturn $this->matchedSomething;\n\t}",
"protected function _testRegex($pattern)\n\t{\n\t\tif(@preg_match('`'.$pattern.'`', '') === false)\n\t\t{\n\t\t\t$error = error_get_last();\n\t\t\treturn substr($error['message'], 14);\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"protected function isWellFormed ( ) {\n\n return (bool) preg_match($this->pattern, $this->address);\n }",
"public function validate($url) {\n return (bool)preg_match($this->pattern, $url);\n }",
"public function isValid(): bool {\r\n\r\n if(true === is_string($this -> value) || true === is_numeric($this -> value)) {\r\n\r\n $pattern = true === $this -> getParameter('alphanumeric') ? '/[a-zA-Z0-9]{'. $this -> getParameter('minCharacters') .',}/' : '/[^ ]{'. $this -> getParameter('minCharacters') .',}/';\r\n\r\n if(true === (bool) preg_match_all($pattern, (string) $this -> value, $match)) {\r\n return count($match[0]) === $this -> getParameter('words');\r\n }\r\n }\r\n\r\n return true;\r\n }",
"public function testMatch()\n {\n $validator = new RegexValidator('/TEST/');\n $this->assertTrue($validator->isMatch(\"TEST.com\"));\n $this->assertFalse($validator->isMatch(\"xxx.com\"));\n }",
"private function validation(): bool\n {\n $_POST['search'] = trim($_POST['search']);\n $_POST['search'] = stripslashes($_POST['search']);\n $_POST['search'] = strip_tags($_POST['search']);\n if ($_POST['search'] === '') {\n return false;\n }\n return (preg_replace(\"/[a-zA-Zа-яА-Я0-9 ієїё+\\-№#$]{3,}/iu\", '', $_POST['search']) === '');\n }",
"public function hasRegex($url);",
"function matches_pattern($str, $pattern)\n {\n $characters = array(\n '#', '?', '~', '@' // Our additional characters\n , '$'\n , '%'\n );\n\n $regex_characters = array(\n '[0-9]', '[a-zA-Z]', '.', '[a-zA-Z0-9\\-\\_]' // Our additional characters\n , '[\\`\\!\\@\\%\\^\\&\\*\\#\\?\\~\\&\\*\\(\\)\\_\\-\\+\\=\\<\\>\\,\\.\\'\\\"\\:\\;]'\n , '\\d+(.\\d+){0, 1}'\n );\n $pattern = str_replace($characters, $regex_characters, $pattern);\n if (preg_match('/^' . $pattern . '$/', $str)) return TRUE;\n return FALSE;\n }",
"public function validate()\n {\n \n if((($this->value === null || strlen($this->value) === 0) && $this->required) || \n !preg_match_all($this->expVal, $this->value))\n {\n throw $this->getError();\n }\n }",
"public function verify($data, $pattern){ /* TODO: Build Verify */ }",
"public function valid()\n\t{\n\t\t$value = htmlentities( $this->value, ENT_QUOTES, 'UTF-8');\n\n\t\t$this->value = str_replace(\"\\n\", \"<br />\", $value);\n\n\t\tif( $this->pattern )\n\t\t{\n\t\t\tif (preg_match('/'.$this->pattern.'/', $this->value))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function valid()\n {\n return $this->properString() && $this->hasAllSegments();\n }",
"function regex_test (string $pattern, string $text, int $flags = 0) : bool\n{\n return (bool) preg_match($pattern, $text, $matches, $flags);\n}",
"function _validateByRules() {\n\t\tforeach($this->controller->configurations->get($this->pathToRules) as $rule) {\n\t\t\tif(!preg_match($rule['pattern'], $this->get($rule['field']))) {\n\t\t\t\t$this->errors[] = array_merge(array('.type' => 'rule'), $rule);\n\t\t\t}\n\t\t}\n\t}",
"public function isValid($value)\n {\n $valueString = (string) $value;\n $this->_setValue($valueString);\n\n //if match is false => string has conflict with given pattern\n if (!preg_match($this->_pattern, $valueString)) {\n $this->_error(self::INVALID_CHARS);\n return false;\n } \n\n return true;\n }",
"public function validate() {\r\n $pattern=\r\n \"/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/\";\r\n if(!preg_match($pattern,$this->email)){\r\n $this->setError('Invalid email address');\r\n }\r\n if (strlen($this->email)>255){\r\n $this->setError('Address is too long');\r\n }\r\n }"
] | [
"0.69327444",
"0.6689172",
"0.6451661",
"0.6451419",
"0.6349292",
"0.6329368",
"0.62910897",
"0.6290992",
"0.6240223",
"0.6211228",
"0.62052757",
"0.6165954",
"0.6146206",
"0.61389524",
"0.6136199",
"0.612706",
"0.60821146",
"0.6070575",
"0.60500354",
"0.6026977",
"0.5988612",
"0.5975877",
"0.59295326",
"0.5919986",
"0.5897325",
"0.58840644",
"0.58298415",
"0.5807958",
"0.5804317",
"0.57974494"
] | 0.7764102 | 0 |
set shipping status of the order table | function updateShippingStatus($item, $id){
$this->db->where('id', $id);
$this->db->update('tbl_order', $item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShipmentStatus($orderId, $shippingStatus);",
"public function actionOrderToggleShipped() {\n\n\t\t$id = $this->getvars['id'];\n\t\t$order = $this->Order->findById($id);\n\n\t\tif (!empty($order)) {\n\t\t\tif ($order['order_shipping_status'] == 'shipped') {\n\t\t\t\t$order['order_shipping_status'] = 'open';\n\t\t\t\t$order['order_shipping_date'] = '';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$order['order_shipping_status'] = 'shipped';\n\t\t\t\t$order['order_shipping_date'] = strftime('%F %T');\n\t\t\t}\n\t\t\t$this->Order->save($order);\n\t\t}\n\n\t\t$this->changeAction('default');\n\t}",
"private function setShippingInformation()\n {\n if ($this->_checkoutSession->getLastRealOrder()->getIsVirtual()) {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('false');\n } else {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('true');\n $shipping = $this->_checkoutSession->getLastRealOrder()->getShippingAddress();\n if ($shipping) {\n if (count($shipping->getStreet()) === 4) {\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $shipping->getStreetLine(1),\n $shipping->getStreetLine(2),\n $shipping->getStreetLine(4),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $shipping->getStreetLine(3)\n );\n } else {\n $address = \\UOL\\PagSeguro\\Helper\\Data::addressConfig($shipping['street']);\n\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $this->getShippingAddress($address[0], $shipping),\n $this->getShippingAddress($address[1]),\n $this->getShippingAddress($address[3]),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $this->getShippingAddress($address[2])\n );\n }\n\n $this->_paymentRequest->setShipping()->setType()\n ->withParameters(\\PagSeguro\\Enum\\Shipping\\Type::NOT_SPECIFIED); //Shipping Type\n $this->_paymentRequest->setShipping()->setCost()\n ->withParameters(number_format($this->getShippingAmount(), 2, '.', '')); //Shipping Coast\n }\n }\n }",
"public function setShippingStatusService(ShippingStatusServiceInterface $service)\n {\n $this->shippingStatusService = $service;\n }",
"public function edit(ShippingStatus $shippingStatus)\n {\n //\n }",
"public function setShipping()\n {\n $weight = (\\Session::has('noShipping') ? null : $this->orderWeight);\n\n $this->orderShipping = $this->shipping->getShipping($weight);\n\n return $this;\n }",
"protected function buildShippingStatusFields(): void\n {\n $isLogistic = $this->isLogisticMode();\n //====================================================================//\n // Order Shipment Status\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"shipping_status\")\n ->name(\"Shipping Status\")\n ->microData(\n \"http://schema.org/Order\",\n $isLogistic ? \"orderStatus\" : \"shippingStatus\"\n )\n ->addChoice(OrderStatus::CANCELED, \"Cancelled\")\n ->addChoice(OrderStatus::PROCESSING, \"Ready\")\n ->addChoice(OrderStatus::DELIVERED, \"Shipped\")\n ->isReadOnly(!$isLogistic)\n ;\n }",
"function register_ia_shipped_order_status()\n {\n register_post_status('wc-ia-shipped', array(\n 'label' => 'Shipped',\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop('Shipped (%s)', 'Shipped (%s)')\n ));\n }",
"public function setShipmentStatus($value) \n {\n $this->_fields['ShipmentStatus']['FieldValue'] = $value;\n return $this;\n }",
"function setShippingMethod() {\n global $total_count, $total_weight;\n // ensure that cart contents is calculated properly for weight and value\n if (!isset($total_weight)) $total_weight = $_SESSION['cart']->show_weight();\n if (!isset($total_count)) $total_count = $_SESSION['cart']->count_contents();\n // set the shipping method if one is not already set\n // defaults to the cheapest shipping method\n if ( !$_SESSION['shipping'] || ( $_SESSION['shipping'] && ($_SESSION['shipping'] == false) && (zen_count_shipping_modules() > 1) ) ) {\n require_once(DIR_WS_CLASSES . 'http_client.php');\n require_once(DIR_WS_CLASSES . 'shipping.php');\n $shipping_Obj = new shipping;\n\n // generate the quotes\n $shipping_Obj->quote();\n\n // set the cheapest one\n $_SESSION['shipping'] = $shipping_Obj->cheapest();\n }\n }",
"public function setShippingMethod(Order $order, Orderable $shipping)\n\t{\n\t\t$this->deleteExistingShippingItem($order, $shipping);\n\n\t\t$order->addItem($shipping);\n\t}",
"public function setShippingAmount($amount);",
"public function setShippingCompleted()\n {\n /** @var Collection $orderCollection */\n $orderCollection = $this->shopgateOrderFactory->create()->getCollection();\n $orderCollection->filterByUnsynchronizedOrders();\n $orderCollection->setPageSize(100);\n $this->logger->debug(\"# Found {$orderCollection->getSize()} potential orders to send\");\n\n /** @var ShopgateOrderModel $shopgateOrder */\n foreach ($orderCollection as $shopgateOrder) {\n $magentoOrder = $this->orderRepository->get($shopgateOrder->getOrderId());\n $this->shippingHelper->sendShippingForOrder($shopgateOrder, $magentoOrder);\n }\n }",
"public function update(Request $request, ShippingStatus $shippingStatus)\n {\n //\n }",
"private static function change_shipping_methods_status( $status = 1 ) {\n\t\tglobal $wpdb;\n\n\t\tforeach ( static::get_shipping_method_map() as $item ) {\n\t\t\t$instance_id = $item->getWoocommerceShippingMethodId();\n\t\t\t$method = new Packlink_Shipping_Method( $instance_id );\n\n\t\t\tif ( $wpdb->update( \"{$wpdb->prefix}woocommerce_shipping_zone_methods\", array( 'is_enabled' => $status ), array( 'instance_id' => absint( $instance_id ) ) ) ) {\n\t\t\t\tdo_action( 'woocommerce_shipping_zone_method_status_toggled', $instance_id, $method->id, $item->getZoneId(), $status );\n\t\t\t}\n\t\t}\n\t}",
"public function withShipmentStatus($value)\n {\n $this->setShipmentStatus($value);\n return $this;\n }",
"function set_shipment_data() {\n\t\tif (!$this->check_return_shipment()) { // create an empty record if there is no shipment data\n\t\t\t$this->insert_new_shipment();\n\t\t}\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE order_id = %d\", SHIP_ADDRESS, $_SESSION['order_id']);\n\t\tif ($result = mysql_query($sql)) {\n\t\t\t$obj = mysql_fetch_object($result);\n\t\t\t$this->ship_name = $obj->FirstName;\n\t\t\t$this->ship_name2 = $obj->LastName;\n\t\t\t$this->ship_address = $obj->address;\n\t\t\t$this->ship_address2 = $obj->address2;\n\t\t\t$this->ship_zipcode = $obj->ZipCode;\n\t\t\t$this->ship_city = $obj->City;\n\t\t\t$this->ship_state = $obj->State;\n\t\t\t$this->ship_phone = $obj->phone;\n\t\t\t$this->ship_msg = $obj->message;\n\t\t} else {\n\t\t\t$this->error = $this->messages(1);\n\t\t}\n\t}",
"public function setShippingAddress($address)\n {\n $this->data['shipping']['x_ship_to_address'] = $address;\n }",
"private function makeBillingSameAsShipping() {\n $shippingAddress = $this->getQuote()->getShippingAddress();\n //Only the followng fields need to be set\n $billingData = array();\n $billingData['city'] = $shippingAddress->getCity();\n $billingData['street'] = $shippingAddress->getStreet();\n $billingData['region'] = $shippingAddress->getRegion();\n $billingData['region_id'] = $shippingAddress->getRegionId();\n $billingData['postcode'] = $shippingAddress->getPostcode();\n $billingData['country_id'] = $shippingAddress->getCountryId();\n $billingData['telephone'] = $shippingAddress->getTelephone();\n $billingData['fax'] = $shippingAddress->getFax();\n\n $this->getQuote()\n ->getBillingAddress()\n ->addData($billingData)\n ->save();\n }",
"public function updateOrder($id, Request $request)\n {\n $shipped = $request->input('shipped');\n if ($shipped == 'on'){\n DB::table('orders')\n ->where('id','=', $id)\n ->update(['orders.status' => 1]);\n return redirect('admin/orders_list');\n } else {\n return redirect('admin/orders_list');\n }\n }",
"public function setShippingService(ShippingServiceInterface $service)\n {\n $this->shippingService = $service;\n }",
"private function updateShippingStatus(string $current, string $new): void\n {\n //====================================================================//\n // Create State Machine\n $stateMachine = $this->stateMachine->get($this->object, OrderShippingTransitions::GRAPH);\n //====================================================================//\n // Cancelled => Ready [FORCED]\n if (OrderStatus::isCanceled($current) && !OrderStatus::isCanceled($new)) {\n //====================================================================//\n // Force Order State to Ready\n $this->object->setShippingState(OrderShippingStates::STATE_READY);\n //================================s====================================//\n // Force Set First Shipment State to Ready\n if ($shipment = $this->getFirstShipment()) {\n $shipment->setState(ShipmentInterface::STATE_READY);\n }\n $current = ShippingStatusIdentifier::toSplash($this->object);\n $this->needUpdate();\n }\n //====================================================================//\n // Ready => Cancelled\n if (OrderStatus::isCanceled($new)) {\n //====================================================================//\n // Move Order State to Ready by State Machine\n $stateMachine->apply(OrderShippingTransitions::TRANSITION_CANCEL);\n //====================================================================//\n // Force Set First Shipment State to Ready\n if ($shipment = $this->getFirstShipment()) {\n $shipment->setState(ShipmentInterface::STATE_CANCELLED);\n }\n $this->needUpdate();\n\n return;\n }\n //====================================================================//\n // Ready => Shipped\n if (OrderStatus::isShipped($new) || OrderStatus::isDelivered($new)) {\n $stateMachine->apply(OrderShippingTransitions::TRANSITION_SHIP);\n //====================================================================//\n // Force Set First Shipment State to Ready\n if ($shipment = $this->getFirstShipment()) {\n $shipment->setState(ShipmentInterface::STATE_SHIPPED);\n $shipment->setShippedAt(new \\DateTime());\n }\n $this->needUpdate();\n }\n }",
"public function saveShipment()\n {\n $status = false;\n\n if ($this->_orderModel->canShip()) {\n $shipment = $this->_convertOrder->toShipment($this->_orderModel);\n\n foreach ($this->_orderModel->getAllItems() as $item) {\n if (!$item->getQtyToShip() || $item->getIsVirtual()) {\n continue;\n }\n\n $shipmentItem = $this->_convertOrder->itemToShipmentItem($item)->setQty($item->getQtyToShip());\n $shipment->addItem($shipmentItem);\n }\n\n $shipment->register();\n $shipment->save();\n $this->_shipmentService->notify($shipment->getId());\n $status = true;\n }\n\n return $status;\n }",
"public function setShippingAddress($address) {\n\t\t$this->shipping_address = $address;\n\t}",
"public function update_shipping()\n\t{\n\t\n\t if($this->ion_auth->logged_in()==1)\n\t\t\t{\n\t $adorder = new App();\n\t $this->app = new App();\n\t \n\t\t \n\t\t $customerid=$_POST['customer'];\n\t\t \n\t\t \n\t\t \n\t\t\n\t\t\t\t \n\t \n\n\t//---shipping address---------------------\t\t\t\t \n\n\t\t\t\t$shippingaddress= $adorder->getshippingaddress($customerid);\n\t\t \n\t\t //print_r($shippingaddress);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$shiphtml=\"\";\n\t\t $shiphtml.='<option value=\"\">Select Address</option>';\n\t\t\t\tforeach ($shippingaddress as $items){\n\n $shiphtml.='<option value=\"'.$items[id].'\">'.$items[address].'</option>';\n\n\t\t\t\t\t}\n\t\t \n\t\t $shiphtml.='<option value=\"-1\">New Address</option>';\n\t\t\t\t\n\t\t\techo $shiphtml;\t\n\t\t\n\t\t \n\t }\n\t\telse\n\t\t{\n\n\t\t\t$this->template->load('login_master','content');\n\n\t\t}\n\t \n}",
"public function updateFromShipping($data)\n {\n $table = $this->getMainTable();\n $this->_getWriteAdapter()->update(\n $table, array(\n 'quote_id' => $data['quote_id'],\n 'w3w' => $data['w3w'],\n 'address_id' => $data['address_id']\n ), 'quote_id = ' . $data['quote_id']\n );\n }",
"public function editshippingAction() {\n\t\t// get the logged in user's info from the database\n\t\t\t$this->getLoggedInUser();\n\t\t\n\t\t$addressMapper = new Application_Model_Mapper_Users_ShippingAddressesMapper;\n\t\t\n\t\t// if editing an existing shipping address\n\t\tif($this->_request->getQuery('shippingAddressID')) {\n\t\t\t$address = $addressMapper->find($this->_request->getQuery('shippingAddressID'));\n\t\t\t// if the address doesn't belong to logged in user\n\t\t\t\tif(!$this->_acl->isAllowed($this->user, $address, 'update')) $this->errorAndRedirect('You can only edit your own addresses!', 'details');\n\t\t}\n\t\t// if creating a new address\n\t\telse {\n\t\t\t$address = new Application_Model_Users_ShippingAddress(array('userID' => $this->user->userID));\n\t\t\tif(!$this->_acl->isAllowed($this->user, $address, 'create')) $this->errorAndRedirect('You cannot create new addresses', 'details');\n\t\t}\n\t\t\n\t\t// process the form if it was submitted\n\t\tif($this->_request->isPost()) {\n\t\t\t$request = $this->getRequest();\n\t\t\t$address->setOptions($request->getPost());\n\t\t\t$form = new Application_Form_Account_ShippingAddress;\n\n\t\t\tif($form->isValid($request->getPost())) {\n \t// save the address and get the ID\n \t$addressID = $addressMapper->save($address);\n \tif(isset($address->shippingAddressID)) $addressID = $address->shippingAddressID;\n\n \t// if chosen as default shipping address\n \tif(isset($request->defaultShipping)) {\n \t\t$this->user->setOptions(array('defaultShippingAddressID' => $addressID));\n \t\t$this->usersMapper->save($this->user);\n \t}\n \t// display success message and redirect\n \t$this->msg('Your address has been saved!'); \n // redirect to account details page \n \t$this->_helper->redirector('details', 'account'); \t\n }\n\t\t\telse $this->msg(array('error' => 'Your submission was not valid')); // If form is NOT valid\t\n\t\t}\n\t\t\n\t\t$this->view->address = $address;\n\t}",
"public function modelDelivery($id){\n DB::table(\"orders\")->where(\"id\",\"=\",$id)->update(array(\"status\"=>\"1\"));\n }",
"protected function saveOrderShippings( $values=null )\r\n\t{\r\n\t $order = $this->_order;\n\t if (empty($values)) {\n\t $values = $this->_values;\n\t }\r\n\t \r\n\t JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\r\n\t $row = JTable::getInstance('OrderShippings', 'TiendaTable');\r\n\t $row->order_id = $order->order_id;\r\n\t $row->ordershipping_type = $values['shipping_plugin'];\r\n\t $row->ordershipping_price = $values['shipping_price'];\r\n\t $row->ordershipping_name = $values['shipping_name'];\r\n\t $row->ordershipping_code = $values['shipping_code'];\r\n\t $row->ordershipping_tax = $values['shipping_tax'];\r\n\t $row->ordershipping_extra = $values['shipping_extra'];\r\n\t\r\n\t if (!$row->save())\r\n\t {\r\n\t $this->setError( $row->getError() );\r\n\t return false;\r\n\t }\r\n\t\r\n\t // Let the plugin store the information about the shipping\r\n\t $dispatcher = JDispatcher::getInstance();\r\n\t $dispatcher->trigger( \"onPostSaveShipping\", array( $values['shipping_plugin'], $row ) );\r\n\t\r\n\t return true;\r\n\t}",
"public function testSetShippingMethod() {\n\t\t$expected = array(\n\t\t\t'shop-list-bob-cart' => 'shop-list-bob-cart',\n\t\t\t'shop-list-bob-wish' => 'shop-list-bob-wish',\n\t\t\t'shop-list-guest-1-cart' => 'shop-list-guest-1-cart',\n\t\t\t'shop-list-sally-cart' => 'shop-list-sally-cart',\n\t\t);\n\t\t$result = $this->{$this->modelClass}->find('list');\n\t\t$this->assertEquals($expected, $result);\n\t\t$this->assertTrue((bool)$this->{$this->modelClass}->setShippingMethod('royal-mail-1st'));\n\n\t\t$id = $this->{$this->modelClass}->id;\n\t\t$expected = array(\n\t\t\t'shop-list-bob-cart' => 'shop-list-bob-cart',\n\t\t\t'shop-list-bob-wish' => 'shop-list-bob-wish',\n\t\t\t'shop-list-guest-1-cart' => 'shop-list-guest-1-cart',\n\t\t\t'shop-list-sally-cart' => 'shop-list-sally-cart',\n\t\t\t$id => null\n\t\t);\n\t\t$result = $this->{$this->modelClass}->find('list');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$this->assertTrue((bool)$this->{$this->modelClass}->setShippingMethod('royal-mail-2nd'));\n\t\t$this->assertEquals($id, $this->{$this->modelClass}->id);\n\t}"
] | [
"0.7374971",
"0.69498086",
"0.6785506",
"0.66243917",
"0.6573966",
"0.654654",
"0.6418646",
"0.63911",
"0.6348385",
"0.6212511",
"0.6144539",
"0.6137565",
"0.6136658",
"0.6133557",
"0.60927",
"0.6034708",
"0.60323405",
"0.60241145",
"0.6003267",
"0.5998459",
"0.59928274",
"0.5980798",
"0.5980059",
"0.59763575",
"0.59075093",
"0.589662",
"0.5889936",
"0.58733124",
"0.5861246",
"0.5858628"
] | 0.69620264 | 1 |
Initializes server context object to test. | public function setUp()
{
$this->requestContext = new RequestContext();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUp()\n {\n // initialize the configuration\n $configuration = $this->getAppserverConfiguration();\n\n // replace the base directory\n $appserverConfiguration = new Configuration();\n $appserverConfiguration->setNodeName('appserver');\n $baseDirectoryConfiguration = new Configuration();\n $baseDirectoryConfiguration->setNodeName('baseDirectory');\n $baseDirectoryConfiguration->setValue(__DIR__);\n $appserverConfiguration->addChild($baseDirectoryConfiguration);\n $configuration->merge($appserverConfiguration);\n\n // initialize the server instance\n $this->server = new Server($configuration);\n }",
"public function testGetInitialContext()\n {\n $this->assertInstanceOf('TechDivision\\ApplicationServer\\InitialContext', $this->server->getInitialContext());\n }",
"public function setUp()\n {\n $this->context = new CommonContext($this->getKernelMock());\n $this->context->setBuilder($this->getPageObjectBuilderMock());\n $this->context->setParentContext($this->getParentContextMock());\n }",
"public function init($context)\n {\n $this->context = $context;\n }",
"protected function setUp()\n {\n $this->object = new Context_Template('context', 'getter');\n }",
"protected function setUp()\n {\n $this->uri = \"/core/hello\";\n $this->headers['Content-Type'] = \"application/json\";\n //$this->endPoint = \"styl.dev\";\n //$this->serverName = 'styl.dev';\n //$this->basePath = \"/api/public\";\n //$this->env['HTTP_ACCEPT'] = \"application/json\";\n }",
"public static function setUpBeforeClass()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_SERVER['REMOTE_ADDR'] = '127.0.0.1';\n $_SERVER['SCRIPT_NAME'] = '/';\n $_SERVER['REQUEST_URI'] = '/';\n $_SERVER['SERVER_NAME'] = 'localhost';\n $_SERVER['SERVER_PORT'] = 443;\n $_SERVER['HTTPS'] = true;\n }",
"function init() {\n $server_list = $this->getServerList();\n if(count($server_list) === 0) {\n $this->addServer('localhost', 11211);\n }\n }",
"protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$reg = Registry::getInstance();\n\n\t\t//Request\n\t\t$request = new Request($_GET, $_POST, $_SERVER, $_COOKIE);\n\t\t$reg->setRequest($request);\n\t}",
"public function initializeContext(Context $context)\n {\n if ($context instanceof BehatDbAwareContext) {\n $context->setBehatDb($this->db_maintainer->getBehatDb(), $this->db_maintainer->getTestDataManager());\n }\n }",
"function setUp() {\n\t\tglobal $wp_json_server;\n\n\t\tparent::setUp();\n\n\t\t// Allow for a plugin to insert a different class to handle requests.\n\t\t$wp_json_server_class = apply_filters('wp_json_server_class', 'WP_JSON_Server');\n\t\t$wp_json_server = new $wp_json_server_class;\n\t}",
"public function testSetServerVarToRequestContextObject()\n {\n $this->requestContext->setServerVar(ServerVars::HTTP_HOST, 'unittest.local:9080');\n $this->requestContext->setServerVar(ServerVars::HTTP_CONNECTION, 'keep-alive');\n $this->requestContext->setServerVar(ServerVars::HTTP_ACCEPT_ENCODING, 'gzip, deflate');\n\n $this->assertSame('unittest.local:9080', $this->requestContext->getServerVar(ServerVars::HTTP_HOST));\n $this->assertSame('keep-alive', $this->requestContext->getServerVar(ServerVars::HTTP_CONNECTION));\n $this->assertSame('gzip, deflate', $this->requestContext->getServerVar(ServerVars::HTTP_ACCEPT_ENCODING));\n }",
"public function initialize($ctx = 'web');",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp()\n\t {\n\t\t$this->_db = new MySQLdatabase($GLOBALS[\"DB_HOST\"], $GLOBALS[\"DB_DBNAME\"], $GLOBALS[\"DB_USER\"], $GLOBALS[\"DB_PASSWD\"]);\n\t\t$this->_db->execUntilSuccessful(\"DROP TABLE IF EXISTS `HTTPcache`\");\n\n\t\t$this->remotepath = $this->webserverURL();\n\t\t$this->object = new HTTPclientWithCache($this->_db, $this->remotepath . \"/HTTPclientResponder.php\");\n\n\t\tparent::setUp();\n\t }",
"public function initializeServer()\n {\n trigger_error(\"Not implemented\");\n }",
"public function __construct()\r\n\t{\r\n\t\t$this->context = Context::getContext();\r\n\t}",
"public function init() {\n $ajaxContext = $this->_helper->getHelper('AjaxContext');\n $ajaxContext->addActionContext('clientconfig', array('json', 'html'))\n ->addActionContext('nodeconfig', array('json', 'html'))\n ->addActionContext('domainconfig', array('json', 'html'))\n ->initContext();\n }",
"public function __construct()\n {\n $this->app = new Bootstrap('test');\n $this->app['debug'] = true;\n unset($this->app['exception_handler']);\n\n $this->client = new Client($this->app);\n }",
"protected function init()\n {\n $this->client = new Client(\n $this->getHttpClientConfig()\n );\n\n $this->continents = Continents::load();\n }",
"public function setUp()\n {\n $this->site = new Site();\n }",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$_SERVER['HTTP_USER_AGENT'] = 'browser';\n\n\t\tTiton::router()->initialize();\n\n\t\t$this->object = new CsrfProtectionListener();\n\t\t$this->object->startup();\n\t}",
"public function setUp()\n\t{\n\t\t$_SERVER['view.started'] = null;\n\t}",
"protected function _initContext()\r\n {\r\n if(isset($this->contexts)) {\r\n $this->_helper->contextSwitch->initContext();\r\n $this->_context = $this->_helper->contextSwitch->getCurrentContext();\r\n }\r\n }",
"protected function setUp() {\r\n\t\tparent::setUp();\r\n\t\t$basedir = dirname(dirname(dirname(__FILE__)));\r\n\t\t$this->testendpoint = 'http://'.$GLOBALS['TEST_WEBSERVER'].'/csvwebservice.php';\r\n\t\t$this->prepareLocalConfigFile($basedir.'/localconfig.php');\r\n\t\t$this->serverhandle = proc_open('php -S '.$GLOBALS['TEST_WEBSERVER'].' -t '.$basedir, array(), $this->serverpipes);\r\n\t\t$this->assertTrue(is_resource($this->serverhandle), 'Could not start internal webserver');\r\n\t\t$this->serverpid = proc_get_status($this->serverhandle)['pid'];\r\n\t}",
"protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }",
"protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }",
"protected function setUp() {\n\t\tob_start ();\n\t\t\n\t\t$this->object = new vmwareServiceInstance ( false, \"TESTS vmwareServiceInstance\" );\n\t}"
] | [
"0.7365111",
"0.6954945",
"0.6751526",
"0.67445767",
"0.6678804",
"0.66748774",
"0.6661518",
"0.6628002",
"0.6569481",
"0.65644413",
"0.6534368",
"0.65243155",
"0.65099674",
"0.64676434",
"0.64676434",
"0.64676434",
"0.6435417",
"0.64254695",
"0.64091057",
"0.6407822",
"0.640401",
"0.64021343",
"0.63999516",
"0.6373166",
"0.6367664",
"0.6367106",
"0.63658327",
"0.6360667",
"0.6360667",
"0.635948"
] | 0.7089144 | 1 |
Test set server var functionality on RequestContext object. | public function testSetServerVarToRequestContextObject()
{
$this->requestContext->setServerVar(ServerVars::HTTP_HOST, 'unittest.local:9080');
$this->requestContext->setServerVar(ServerVars::HTTP_CONNECTION, 'keep-alive');
$this->requestContext->setServerVar(ServerVars::HTTP_ACCEPT_ENCODING, 'gzip, deflate');
$this->assertSame('unittest.local:9080', $this->requestContext->getServerVar(ServerVars::HTTP_HOST));
$this->assertSame('keep-alive', $this->requestContext->getServerVar(ServerVars::HTTP_CONNECTION));
$this->assertSame('gzip, deflate', $this->requestContext->getServerVar(ServerVars::HTTP_ACCEPT_ENCODING));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setContextVars () {\r\n\t\t\t$_phpself = @$GLOBALS['HTTP_SERVER_VARS']['PHP_SELF'];\r\n\t\t\t$_pathinfo = @$GLOBALS['HTTP_SERVER_VARS']['PATH_INFO'];\r\n\t\t\t$_request_uri = @$GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI'];\r\n\t\t\t$_qs = @$GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'];\r\n\r\n\t\t\t// the following fixes bug of $PHP_SELF on Win32 CGI and IIS.\r\n\t\t\t$_self = (!empty($_pathinfo)) ? $_pathinfo : $_phpself;\r\n\t\t\t$_uri = (!empty($_request_uri)) ? $_request_uri : $_self.'?'.$_qs;\r\n\r\n\t\t\t$this->setvar('__SELF__', $_self);\r\n\t\t\t$this->setvar('__REQUEST_URI__', $_uri);\r\n\t\t\treturn true;\r\n\t\t}",
"public function setUp()\n {\n $this->requestContext = new RequestContext();\n }",
"function set_request(ServerRequestInterface $request): void\n{\n Container::set('request', $request, true);\n}",
"public function testGettingSpecificServerParam()\n {\n $_SERVER['fusionHttp'] = 'PSR-7';\n $this->serverRequest = $this->buildRequestWithAllFields();\n $this->assertEquals('PSR-7', $this->serverRequest->getServerParams()['fusionHttp']);\n }",
"public function setFrontendVars(Zend_Controller_Request_Http $request)\n {\n }",
"public function getServerVars();",
"protected function setUp()\r\n {\r\n $_SERVER['REMOTE_ADDR'] = \"REMOTE_ADDR\";\r\n $_SERVER['HTTP_USER_AGENT'] = \"HTTP_USER_AGENT\";\r\n $_SERVER['HTTP_ACCEPT'] = \"HTTP_ACCEPT\";\r\n $_COOKIE['crystalpure-user'] = \"mcsiljcincklsdncvklsdvisdn\";\r\n }",
"function initCustomRequestVars() {\n\t}",
"public function testFromGlobalsUrlModRewrite(): void\n {\n Configure::write('App.baseUrl', false);\n\n $server = [\n 'DOCUMENT_ROOT' => '/cake/repo/branches',\n 'PHP_SELF' => '/urlencode me/webroot/index.php',\n 'REQUEST_URI' => '/posts/view/1',\n ];\n $res = ServerRequestFactory::fromGlobals($server);\n\n $this->assertSame('/urlencode%20me', $res->getAttribute('base'));\n $this->assertSame('/urlencode%20me/', $res->getAttribute('webroot'));\n $this->assertSame('/posts/view/1', $res->getUri()->getPath());\n\n $request = ServerRequestFactory::fromGlobals([\n 'DOCUMENT_ROOT' => '/cake/repo/branches',\n 'PHP_SELF' => '/1.2.x.x/webroot/index.php',\n 'PATH_INFO' => '/posts/view/1',\n ]);\n $this->assertSame('/1.2.x.x', $request->getAttribute('base'));\n $this->assertSame('/1.2.x.x/', $request->getAttribute('webroot'));\n $this->assertSame('/posts/view/1', $request->getRequestTarget());\n\n $request = ServerRequestFactory::fromGlobals([\n 'DOCUMENT_ROOT' => '/cake/repo/branches/1.2.x.x/test/',\n 'PHP_SELF' => '/webroot/index.php',\n ]);\n\n $this->assertSame('', $request->getAttribute('base'));\n $this->assertSame('/', $request->getAttribute('webroot'));\n\n $request = ServerRequestFactory::fromGlobals([\n 'DOCUMENT_ROOT' => '/some/apps/where',\n 'PHP_SELF' => '/webroot/index.php',\n ]);\n\n $this->assertSame('', $request->getAttribute('base'));\n $this->assertSame('/', $request->getAttribute('webroot'));\n\n Configure::write('App.dir', 'auth');\n\n $request = ServerRequestFactory::fromGlobals([\n 'DOCUMENT_ROOT' => '/cake/repo/branches',\n 'PHP_SELF' => '/demos/webroot/index.php',\n ]);\n\n $this->assertSame('/demos', $request->getAttribute('base'));\n $this->assertSame('/demos/', $request->getAttribute('webroot'));\n\n Configure::write('App.dir', 'code');\n\n $request = ServerRequestFactory::fromGlobals([\n 'DOCUMENT_ROOT' => '/Library/WebServer/Documents',\n 'PHP_SELF' => '/clients/PewterReport/webroot/index.php',\n ]);\n\n $this->assertSame('/clients/PewterReport', $request->getAttribute('base'));\n $this->assertSame('/clients/PewterReport/', $request->getAttribute('webroot'));\n }",
"public function testGetReturnsNullWithNonGetRequest() {\n\n $server['REQUEST_METHOD'] = 'POST';\n\n $request = ServerRequestFactory::fromGlobals($server, ['var' => 'set']);\n $this->assertNull($request->get('var'));\n }",
"public function setUp()\n\t{\n\t\t$_SERVER['view.started'] = null;\n\t}",
"public static function setUpBeforeClass()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_SERVER['REMOTE_ADDR'] = '127.0.0.1';\n $_SERVER['SCRIPT_NAME'] = '/';\n $_SERVER['REQUEST_URI'] = '/';\n $_SERVER['SERVER_NAME'] = 'localhost';\n $_SERVER['SERVER_PORT'] = 443;\n $_SERVER['HTTPS'] = true;\n }",
"public function setUp()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';\n }",
"protected function setServer()\n {\n if (Arr::get($this->config, 'sandbox', false)) {\n $this->serverUrl = self::SERVER_SANDBOX_URL;\n } else {\n $this->serverUrl = self::SERVER_URL;\n }\n }",
"public function testPutPostDeleteAndPatchSetReturnsForGet() {\n\n $server['REQUEST_METHOD'] = 'POST';\n\n $request = ServerRequestFactory::fromGlobals($server, null, ['var' => 'set']);\n $this->assertEquals('set', $request->get('var'));\n\n $server['REQUEST_METHOD'] = 'PUT';\n\n $request = ServerRequestFactory::fromGlobals($server, null, ['var' => 'set']);\n $this->assertEquals('set', $request->get('var'));\n\n $server['REQUEST_METHOD'] = 'PATCH';\n\n $request = ServerRequestFactory::fromGlobals($server, null, ['var' => 'set']);\n $this->assertEquals('set', $request->get('var'));\n }",
"public function test_context_param() {\n\t}",
"public function setUp() {\n\t\tRouter::connect('/{:controller}/{:action}/{:args}');\n\n\t\t$this->request = new Request();\n\t\t$this->request->params = ['controller' => 'post', 'action' => 'index'];\n\t\t$this->request->persist = ['controller'];\n\t\t$this->context = new MockRenderer(['request' => $this->request]);\n\t}",
"public function testFromGlobalsUrlModRewriteRootDir(): void\n {\n $server = [\n 'DOCUMENT_ROOT' => '/cake/repo/branches/1.2.x.x/webroot',\n 'PHP_SELF' => '/index.php',\n 'REQUEST_URI' => '/posts/add',\n ];\n $res = ServerRequestFactory::fromGlobals($server);\n\n $this->assertSame('', $res->getAttribute('base'));\n $this->assertSame('/', $res->getAttribute('webroot'));\n $this->assertSame('/posts/add', $res->getUri()->getPath());\n }",
"public function testGetWithHttpGet() {\n\n $server['REQUEST_METHOD'] = 'GET';\n\n $request = ServerRequestFactory::fromGlobals($server, ['var' => 'set']);\n $this->assertEquals('set', $request->get('var'));\n }",
"public function testFromGlobalsUrlBaseDefined(): void\n {\n Configure::write('App.base', 'basedir');\n $server = [\n 'DOCUMENT_ROOT' => '/cake/repo/branches/1.2.x.x/webroot',\n 'PHP_SELF' => '/index.php',\n 'REQUEST_URI' => '/posts/add',\n ];\n $res = ServerRequestFactory::fromGlobals($server);\n $this->assertSame('basedir', $res->getAttribute('base'));\n $this->assertSame('basedir/', $res->getAttribute('webroot'));\n $this->assertSame('/posts/add', $res->getUri()->getPath());\n }",
"public function setUp() {\n $this->request = new Request();\n }",
"public function onSetServer(\\swoole_server $server)\r\n {\r\n $this->server = $server;\r\n }",
"protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$reg = Registry::getInstance();\n\n\t\t//Request\n\t\t$request = new Request($_GET, $_POST, $_SERVER, $_COOKIE);\n\t\t$reg->setRequest($request);\n\t}",
"public function setServer($server);",
"public static function setUpBeforeClass(): void\n {\n global $_SERVER;\n $_SERVER['REQUEST_URI'] = '';\n }",
"public function getServerContext()\n {\n return $this->serverContext;\n }",
"public function testFromGlobalsUrlNoModRewrite(): void\n {\n Configure::write('App', [\n 'dir' => 'app',\n 'webroot' => 'webroot',\n 'base' => false,\n 'baseUrl' => '/cake/index.php',\n ]);\n $server = [\n 'DOCUMENT_ROOT' => '/Users/markstory/Sites',\n 'SCRIPT_FILENAME' => '/Users/markstory/Sites/cake/index.php',\n 'PHP_SELF' => '/cake/index.php/posts/index',\n 'REQUEST_URI' => '/cake/index.php/posts/index',\n ];\n $res = ServerRequestFactory::fromGlobals($server);\n\n $this->assertSame('/cake/webroot/', $res->getAttribute('webroot'));\n $this->assertSame('/cake/index.php', $res->getAttribute('base'));\n $this->assertSame('/posts/index', $res->getUri()->getPath());\n }",
"protected function setUp() {\n $this->object = new RequestHelper;\n }",
"private function setEnvironment()\n {\n if (isset($_SERVER['PAYPLUG_API_URL'])) {\n $this->api_url = $_SERVER['PAYPLUG_API_URL'];\n } else {\n $this->api_url = 'https://api.payplug.com';\n }\n\n if (isset($_SERVER['PAYPLUG_SITE_URL'])) {\n $this->site_url = $_SERVER['PAYPLUG_SITE_URL'];\n } else {\n $this->site_url = 'https://www.payplug.com';\n }\n }",
"public function setUp()\n {\n $_SERVER['StubBaseController@setupFilters'] = false;\n }"
] | [
"0.67804503",
"0.6701447",
"0.6355989",
"0.62861186",
"0.6285924",
"0.6240865",
"0.6217268",
"0.6164761",
"0.6072662",
"0.60562533",
"0.6018758",
"0.5996324",
"0.5965639",
"0.5928571",
"0.5904502",
"0.58952063",
"0.58763045",
"0.58188975",
"0.5771079",
"0.5744026",
"0.5735159",
"0.5717072",
"0.571165",
"0.570136",
"0.5695983",
"0.56569374",
"0.5593532",
"0.55527294",
"0.555137",
"0.5540137"
] | 0.77405256 | 0 |
Of the provided guild ids, return those id's that has not been synched, or hasn't been synched in a while | public static function getGuildsAlreadySynched($guildIds, $checkLastSynched = true) {
global $gw2i_db_prefix, $gw2i_refresh_guild_data_interval;
if ($checkLastSynched) {
$addonQuery = 'WHERE g_last_synched > NOW() - INTERVAL ? SECOND AND g_uuid IN("' . implode('","', $guildIds) . '")';
$params = array($gw2i_refresh_guild_data_interval);
} else {
$addonQuery = 'WHERE g_uuid IN("' . implode('","', $guildIds) . '")';
$params = array();
}
$pqs = 'SELECT g_uuid FROM ' . $gw2i_db_prefix . 'guilds ' . $addonQuery;
$ps = Persistence::getDBEngine()->prepare($pqs);
$ps->execute($params);
$guildsAlreadySynched = $ps->fetchAll(PDO::FETCH_COLUMN, 0);
return $guildsAlreadySynched;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function _orphaned_ids() {\n\t\tglobal $wpdb;\n\n\t\t$ids = array();\n\n\t\tif ( is_multisite() ) {\n\t\t\t$keys = $wpdb->get_col(\n\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\tSELECT meta_key\n\t\t\t\t\tFROM {$wpdb->sitemeta}\n\t\t\t\t\tWHERE site_id = %d\n\t\t\t\t\tAND meta_key LIKE %s\n\t\t\t\t\tAND meta_key NOT LIKE %s\n\t\t\t\t\tAND meta_key NOT IN (\n\t\t\t\t\t\tSELECT CONCAT(%s, SUBSTR(meta_key, %d))\n\t\t\t\t\t\tFROM {$wpdb->sitemeta}\n\t\t\t\t\t\tWHERE site_id = %d\n\t\t\t\t\t\tAND meta_key LIKE %s\n\t\t\t\t\t)\n\t\t\t\t\t\",\n\t\t\t\t\t$wpdb->siteid,\n\t\t\t\t\taddcslashes( self::OPTION_PREFIX, '_' ) . '%',\n\t\t\t\t\taddcslashes( self::TIMEOUT_PREFIX, '_' ) . '%',\n\t\t\t\t\tself::OPTION_PREFIX,\n\t\t\t\t\tstrlen( self::TIMEOUT_PREFIX ) + 1,\n\t\t\t\t\t$wpdb->siteid,\n\t\t\t\t\taddcslashes( self::TIMEOUT_PREFIX, '_' ) . '%'\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$keys = $wpdb->get_col(\n\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\tSELECT option_name\n\t\t\t\t\tFROM $wpdb->options\n\t\t\t\t\tWHERE option_name LIKE %s\n\t\t\t\t\tAND option_name NOT LIKE %s\n\t\t\t\t\tAND option_name NOT IN (\n\t\t\t\t\t\tSELECT CONCAT(%s, SUBSTR(option_name, %d))\n\t\t\t\t\t\tFROM $wpdb->options\n\t\t\t\t\t\tWHERE option_name LIKE %s\n\t\t\t\t\t)\n\t\t\t\t\t\",\n\t\t\t\t\taddcslashes( self::OPTION_PREFIX, '_' ) . '%',\n\t\t\t\t\taddcslashes( self::TIMEOUT_PREFIX, '_' ) . '%',\n\t\t\t\t\tself::OPTION_PREFIX,\n\t\t\t\t\tstrlen( self::TIMEOUT_PREFIX ) + 1,\n\t\t\t\t\taddcslashes( self::TIMEOUT_PREFIX, '_' ) . '%'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $keys ) ) {\n\t\t\t$id_start = strlen( self::OPTION_PREFIX );\n\n\t\t\tforeach ( $keys as $key ) {\n\t\t\t\t$ids[] = substr( $key, $id_start );\n\t\t\t}\n\t\t}\n\n\t\treturn $ids;\n\t}",
"function bbp_get_excluded_forum_ids()\n{\n}",
"protected function getIdsOfMultiShifts()\n {\n $query = <<<SQL\nSELECT\n d.id,\n COUNT(temp.id) AS made,\n d.desired_diy_shifts\nFROM\n deltagere AS d\nLEFT JOIN (\n SELECT\n d.id\n FROM\n deltagere AS d\n JOIN deltagere_gdsvagter AS dg ON dg.deltager_id = d.id\n WHERE\n dg.noshow = 0\n) AS temp ON d.id = temp.id\nWHERE\n d.desired_diy_shifts <> 1\nGROUP BY d.id\nHAVING made < d.desired_diy_shifts\nSQL;\n\n $ids = array(0);\n foreach ($this->db->query($query) as $row) {\n $ids[] = $row['id'];\n }\n\n return $ids;\n }",
"public function isUserInGuilds(array $guilds): bool\n {\n // Verify if the user is in all the specified guilds if strict mode is enabled.\n if (config('larascord.guilds_strict')) {\n return empty(array_diff(config('larascord.guilds'), array_column($guilds, 'id')));\n }\n\n // Verify if the user is in any of the specified guilds if strict mode is disabled.\n return !empty(array_intersect(config('larascord.guilds'), array_column($guilds, 'id')));\n }",
"public function hasGuildid(){\n return $this->_has(4);\n }",
"function ignoreWorks($orcid, $localWorkIDs, $accessToken)\n{\n\tglobal $ioi;\n\t\n\t// message to display to the user\n\t$message = '';\n\n\tforeach($localWorkIDs as $localWorkID)\n\t{\n\t\t// if the unselected record is in ORCID \n\t\t$localSourceRecordID = \"repository_\".$localWorkID;\n\t\t\n\t\t// check if there is an existing entry in the userSelections table\n\t\t$existingEntryRowID = getValues($ioi, \"SELECT `rowID` FROM `userSelections` WHERE `orcid` = '$orcid' AND `localSourceRecordID` = '$localSourceRecordID' AND `ignored` IS NOT NULL AND `deleted` IS NULL\", array('rowID'), 'singleValue');\n\n\t\t// if it's in the userSelections table already, leave it unchanged, a new entry will not be saved if the user resubmits the form\n\t\tif(empty($existingEntryRowID))\n\t\t{\n\t\t\t$update = $ioi->query(\"INSERT INTO `userSelections`(`orcid`, `type`, `localSourceRecordID`, `ignored`) VALUES ('$orcid','work','$localSourceRecordID','\".date(\"Y-m-d H:i:s\").\"')\");\t\t\t\t\n\t\t}\n\t\n\t\tif(ORCID_MEMBER)\n\t\t{\n\t\t\t$existingPutCode = getValues($ioi, \"SELECT `putCode` FROM `putCodes` WHERE `orcid` = '$orcid' AND `type` = 'work' AND `localSourceRecordID` = '$localSourceRecordID' AND deleted IS NULL\", array('putCode'), 'singleValue');\t\n\n\t\t\tif(!empty($existingPutCode))\n\t\t\t{\t\t\t\n\t\t\t\t// delete the entry from the ORCID record\n\t\t\t\tdeleteFromORCID($orcid, $accessToken, 'work', $existingPutCode);\n\n\t\t\t\t// mark the putCode as deleted in the putCodes table \n\t\t\t\t$deleted = $ioi-> query(\"UPDATE `putCodes` SET deleted = '\".date(\"Y-m-d H:i:s\").\"' WHERE `orcid` = '$orcid' AND `localSourceRecordID` = '$localSourceRecordID' AND `putCode` ='$existingPutCode' AND `deleted` IS NULL\");\n\t\t\t}\n\t\t}\n\t}\n\n\t$message .= '<li style=\"font-color:Black;\">'.count($localWorkIDs).' records for works in the '.INSTITUTION_ABBREVIATION.' repository were ignored.</li>';\n\t\n\treturn $message;\n}",
"public function orphaned()\n {\n return array_diff($this->current(), $this->monitoring());\n }",
"protected function getIdsOfNoshows()\n {\n $query = <<<SQL\nSELECT\n dg.deltager_id,\n COUNT(temp1.id) AS missed,\n COUNT(temp2.id) AS made\nFROM\n deltagere_gdsvagter AS dg\nLEFT JOIN (\n SELECT\n d.id\n FROM\n deltagere AS d\n JOIN deltagere_gdsvagter AS dg ON dg.deltager_id = d.id\n WHERE\n dg.noshow = 1\n) AS temp1 ON temp1.id = dg.deltager_id\nLEFT JOIN (\n SELECT\n d.id\n FROM\n deltagere AS d\n JOIN deltagere_gdsvagter AS dg ON dg.deltager_id = d.id\n WHERE\n dg.noshow = 0\n) AS temp2 ON dg.deltager_id = temp2.id\nGROUP BY dg.deltager_id\nHAVING missed > made\nSQL;\n \n $ids = array(0);\n foreach ($this->db->query($query) as $row) {\n $ids[] = $row['deltager_id'];\n }\n\n return $ids;\n }",
"public function checkCommandsNotInCommandset() {\n\n $cerrList = array();\n\n $query = \"SELECT id, name, reference FROM `codev_command_table` \".\n \"WHERE team_id = $this->teamId \".\n \"AND id NOT IN (SELECT command_id FROM `codev_commandset_cmd_table`) \";\n $result = SqlWrapper::getInstance()->sql_query($query);\n if (!$result) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n exit;\n }\n while($row = SqlWrapper::getInstance()->sql_fetch_object($result)) {\n\n $cerr = new ConsistencyError2(NULL, NULL, NULL, NULL,\n T_(\"Command\").\" \\\"$row->reference $row->name\\\" \".T_(\"is not referenced in any CommandSet\"));\n $cerr->severity = ConsistencyError2::severity_info;\n $cerrList[] = $cerr;\n }\n\n return $cerrList;\n }",
"protected function findShiftSuggestions(DBObject $shift, array $noshow_ids, array $multishift_ids)\n {\n $noshow_ids_clause = implode(', ', $noshow_ids);\n $multishift_ids_clause = implode(', ', $multishift_ids);\n\n $query = <<<SQL\nSELECT\n d.id,\n CONCAT(d.fornavn, ' ', d.efternavn) AS name,\n d.mobiltlf,\n d.medbringer_mobil,\n d.desired_diy_shifts,\n d.contacted_about_diy,\n CASE WHEN d.id IN ({$noshow_ids_clause}) THEN 'no-show' WHEN d.id IN ({$multishift_ids_clause}) THEN 'multi-gds' ELSE '' END AS cause,\n COUNT(temp.deltager_id) AS shifts_assigned\nFROM\n deltagere AS d\n LEFT JOIN (\n SELECT dgc.deltager_id, COUNT(*)\n FROM deltagere_gdsvagter AS dgc\n WHERE noshow = 0\n GROUP BY dgc.deltager_id\n ) AS temp ON temp.deltager_id = d.id\nWHERE\n d.id NOT IN (\n SELECT p.deltager_id\n FROM pladser AS p\n JOIN hold AS h ON h.id = p.hold_id\n JOIN afviklinger AS a ON a.id = h.afvikling_id\n JOIN aktiviteter AS ak ON ak.id = a.aktivitet_id\n LEFT JOIN afviklinger_multiblok AS am ON am.afvikling_id = a.id\n WHERE ((a.start <= ? AND a.slut >= ?) OR (a.start <= ? AND a.slut >= ?) OR (a.start >= ? AND a.slut <= ?))\n AND ak.tids_eksklusiv = 'ja'\n )\n AND d.id NOT IN (\n SELECT dg.deltager_id\n FROM deltagere_gdsvagter AS dg \n JOIN gdsvagter AS g ON g.id = dg.gdsvagt_id\n WHERE ((g.start <= ? AND g.slut >= ?) OR (g.start <= ? AND g.slut >= ?) OR (g.start >= ? AND g.slut <= ?))\n )\n AND (d.id IN ({$noshow_ids_clause}) OR d.id IN ({$multishift_ids_clause}))\n AND d.checkin_time > '0000-00-00'\n AND d.medbringer_mobil = 'ja'\n AND d.udeblevet = 'nej'\nGROUP BY\n d.id,\n name,\n d.mobiltlf,\n d.medbringer_mobil,\n d.desired_diy_shifts,\n d.contacted_about_diy,\n cause\nORDER BY\n CASE WHEN cause = 'no-show' THEN 2 WHEN cause = 'multi-gds' THEN 1 ELSE 0 END,\n d.contacted_about_diy,\n RAND()\nSQL;\n\n return $this->db->query($query, array($shift->start, $shift->start, $shift->slut, $shift->slut, $shift->start, $shift->slut, $shift->start, $shift->start, $shift->slut, $shift->slut, $shift->start, $shift->slut));\n }",
"public function getIdsNotMatchingTags($tags = []);",
"function CheckraidForce($raid_force, $guild_id) {\n global $db_raid;\n global $phpraid_config;\n if ($raid_force != 'All') {\n\n $sql = sprintf(\"SELECT * FROM \" . $phpraid_config['db_prefix'] . \"raid_force\n WHERE raid_force_name=%s\", quote_smart($raid_force));\n $raid_force_result = $db_raid->sql_query($sql) or print_error($sql, $db_raid->sql_error(), 1);\n while ($raid_force_data = $db_raid->sql_fetchrow($raid_force_result, true)) {\n if ($raid_force_data['guild_id'] != $guild_id) {\n $show_signup = 0;\n } else {\n $show_signup = 1;\n }\n }\n if ($show_signup) {\n return 1;\n } else {\n return 0;\n }\n } else {\n return 1;\n }\n}",
"function sync_cache($forums_ids, $topics_ids)\n\t{\n\t\tglobal $db, $cache, $config, $lang;\n\n\t\tempty_cache_folders(POSTS_CACHE_FOLDER);\n\t\tempty_cache_folders(FORUMS_CACHE_FOLDER);\n\n\t\tif (!empty($forums_ids) && is_array($forums_ids))\n\t\t{\n\t\t\t$forums_processed = array();\n\t\t\tfor ($i = 0; $i < sizeof($forums_ids); $i++)\n\t\t\t{\n\t\t\t\tif (!empty($forums_ids[$i]) && !in_array($forums_ids[$i], $forums_processed))\n\t\t\t\t{\n\t\t\t\t\t$forums_processed[] = $forums_ids[$i];\n\t\t\t\t\t$this->sync('forum', $forums_ids[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($topics_ids) && is_array($topics_ids))\n\t\t{\n\t\t\t$topics_processed = array();\n\t\t\tfor ($i = 0; $i < sizeof($topics_ids); $i++)\n\t\t\t{\n\t\t\t\tif (!empty($topics_ids[$i]) && !in_array($topics_ids[$i], $topics_processed))\n\t\t\t\t{\n\t\t\t\t\t$topics_processed[] = $topics_ids[$i];\n\t\t\t\t\t$this->sync('topic', $topics_ids[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function hasGuildid(){\n return $this->_has(26);\n }",
"protected function how_many_both_matched_not_seen(){\n $matched_me = Matching::where('user_2','=',auth()->user()->profile->id)\n ->where(\"seen\", 0)\n ->pluck('user_1')->toArray();\n\n $my_matches = Matching::where('user_1','=', auth()->user()->profile->id)->pluck('user_2')->toArray();\n \n $both_matched = array_intersect($matched_me, $my_matches);\n \n return $both_matched;\n }",
"public function getIgnoredUsers() {\n\t\tif ($this->ignoredUserIDs === null) {\n\t\t\t$this->ignoredUserIDs = array();\n\t\t\t\n\t\t\tif ($this->userID) {\n\t\t\t\t// load storage data\n\t\t\t\tUserStorageHandler::getInstance()->loadStorage(array($this->userID));\n\t\t\t\t\n\t\t\t\t// get ids\n\t\t\t\t$data = UserStorageHandler::getInstance()->getStorage(array($this->userID), 'ignoredUserIDs');\n\t\t\t\t\n\t\t\t\t// cache does not exist or is outdated\n\t\t\t\tif ($data[$this->userID] === null) {\n\t\t\t\t\t$sql = \"SELECT\tignoreUserID\n\t\t\t\t\t\tFROM\twcf\".WCF_N.\"_user_ignore\n\t\t\t\t\t\tWHERE\tuserID = ?\";\n\t\t\t\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t\t\t\t$statement->execute(array($this->userID));\n\t\t\t\t\twhile ($row = $statement->fetchArray()) {\n\t\t\t\t\t\t$this->ignoredUserIDs[] = $row['ignoreUserID'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// update storage data\n\t\t\t\t\tUserStorageHandler::getInstance()->update($this->userID, 'ignoredUserIDs', serialize($this->ignoredUserIDs));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->ignoredUserIDs = unserialize($data[$this->userID]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->ignoredUserIDs;\n\t}",
"public static function _getSome(\\Gb_Db $db, array $ids) {\n // get the rows that are not in the buffer\n $ids = array_unique($ids);\n $fetchIds = array_diff($ids, array_keys(static::$_buffer));\n self::_fetch($db, $fetchIds); // fetch them\n }",
"public static function quiz_ungraded($courseids, $since = null) {\n global $DB;\n\n if ($since === null) {\n $since = time() - (12 * WEEKSECS);\n }\n\n $ungraded = array();\n\n foreach ($courseids as $courseid) {\n\n // Get people who are typically not students (people who can view grader report) so that we can exclude them!\n list($graderids, $params) = get_enrolled_sql(\\context_course::instance($courseid), 'moodle/grade:viewall');\n $params['courseid'] = $courseid;\n\n $sql = \"-- Snap SQL\n SELECT cm.id AS coursemoduleid, q.id AS instanceid, q.course,\n q.timeopen AS opentime, q.timeclose AS closetime,\n count(DISTINCT qa.userid) AS ungraded\n FROM {quiz} q\n JOIN {course} c ON c.id = q.course AND q.course = :courseid\n JOIN {modules} m ON m.name = 'quiz'\n JOIN {course_modules} cm ON cm.module = m.id AND cm.instance = q.id\n\n-- Get ALL ungraded attempts for this quiz\n\n\t\t\t\t\t JOIN {quiz_attempts} qa ON qa.quiz = q.id\n\t\t\t\t\t AND qa.sumgrades IS NULL\n\t\t\t\t\t AND qa.preview = 0\n\n-- Exclude those people who can grade quizzes and suspended users\n\n \t\t JOIN {enrol} en ON en.courseid = q.course\n JOIN {user_enrolments} ue ON en.id = ue.enrolid\n AND qa.userid = ue.userid\n WHERE ue.status = 0\n AND qa.userid NOT IN ($graderids)\n AND qa.state = 'finished'\n AND (q.timeclose = 0 OR q.timeclose > $since)\n GROUP BY instanceid, q.course, opentime, closetime, coursemoduleid\n ORDER BY q.timeclose ASC\";\n\n $rs = $DB->get_records_sql($sql, $params);\n $ungraded = array_merge($ungraded, $rs);\n }\n\n return $ungraded;\n }",
"function gmirror_get_unused_consumers() {\n\t$consumerlist = \"\";\n\t$disklist = gmirror_get_disks();\n\t/* Get a list of consumers, exclude existing mirrors and diskid entries */\n\texec(\"/sbin/geom part status -s | /usr/bin/egrep -v '(mirror|diskid)' | /usr/bin/awk '{print $1, $3;}'\", $consumerlist);\n\t$all_consumers = array();\n\tforeach ($consumerlist as $cl) {\n\t\t$parts = explode(\" \", $cl);\n\t\tforeach ($parts as $part) {\n\t\t\t$all_consumers[] = $part;\n\t\t}\n\t}\n\tforeach ($disklist as $d) {\n\t\tif (!is_consumer_used($d) && !in_array($d, $all_consumers)) {\n\t\t\t$all_consumers[] = $d;\n\t\t}\n\t}\n\treturn $all_consumers;\n}",
"public function getSongIds()\n {\n // starts a database transaction\n $this->db->transaction(function () {\n\n // lets get the currently featured songs\n $featured = $this->db->table($this->table)\n ->select('song_id as id', 'expires')\n ->get();\n\n if (count($featured) > 0) {\n // If we have songs already being featured\n foreach ($featured as $song) {\n // lets check to see if they have expired\n if ($this->hasExpired($song->expires)) {\n\n // lets add the artist to the cooldown\n $entity_id = $this->songs->getArtistBySongId($song->id)->id;\n $this->addArtistToCooldown($entity_id);\n\n // we get the rank of the expired song so\n // that we can assign it to the new song\n $rank = $this->getRank($song->id);\n\n // then remove it from the featured table\n $this->removeSong($song->id);\n\n // and add a new random song with the expired songs rank!\n $this->addRandomSong($rank);\n }\n }\n } else {\n // if we don't have songs featured\n for ($i = 1; $i <= 5; $i++) {\n $rank = $i;\n // lets randomly populate some to get us started\n // the rank is determined by the iteration number\n // the first pulled is ranked #1\n $this->addRandomSong($rank);\n }\n }\n });\n\n // and finally, lets return all the updated featured song id's\n return $this->db->table($this->table)\n ->pluck('song_id')\n ->sortBy('rank')\n ->toArray();\n }",
"public function getUsers(){\n $userIds = array();\n foreach( $this->members as $member ){\n if( !empty( $member->id) ){\n $userIds[] = $member->id;\n }\n }\n foreach( $this->pending as $member ){\n if( !empty( $member->id) ){\n $userIds[] = $member->id;\n }\n }\n foreach( $this->blocked as $member ){\n if( !empty( $member->id) ){\n $userIds[] = $member->id;\n }\n }\n $userIds[] = $this->owner->id;\n return array_unique($userIds);\n }",
"function get_events_not_attended($user_id, $connection)\n{\n\t$sql = \"SELECT id FROM event\n\t\tWHERE event.id <> ALL (\n\t\t\t\tSELECT DISTINCT event.id as id\n\t\t\t\tFROM event, IsAttending\n\t\t\t\tWHERE event.id = IsAttending.event_id\n\t\t\t\tAND facebook_id ='$user_id')\";\n\t\t\t\t\n\t$result = $connection->query($sql);\n\t$id_array = array();\n\n\tif ($result->num_rows > 0) \n\t{\n\t\t$i = 0;\n\t \twhile($row = $result->fetch_assoc()) \n\t \t{\n\t\t $id_array[$i++] = $row['id'];\n\t \t}\n\t}\n\n\treturn $id_array;\n}",
"function resynch_relevant_containers( $only_return = false ) {\n\t\tglobal $blclog;\n\t\t$blclog->log( sprintf( '...... Parser \"%s\" is marking relevant items as unsynched', $this->module_id ) );\n\n\t\t$last_deactivated = $this->module_manager->get_last_deactivation_time( $this->module_id );\n\n\t\t$formats = array();\n\t\tforeach ( $this->supported_formats as $format ) {\n\t\t\t$formats[ $format ] = $last_deactivated;\n\t\t}\n\n\t\t$container_types = array();\n\t\tforeach ( $this->supported_containers as $container_type ) {\n\t\t\t$container_types[ $container_type ] = $last_deactivated;\n\t\t}\n\n\t\tif ( $only_return ) {\n\t\t\treturn array( $formats, $container_types );\n\t\t} else {\n\t\t\tblcContainerHelper::mark_as_unsynched_where( $formats, $container_types );\n\t\t}\n\t}",
"public function getJournalsToPing() {\n $blacklist = $this->getEntityManager()->getRepository(Blacklist::class)\n ->createQueryBuilder('bl')\n ->select('bl.uuid')\n ;\n\n $whitelist = $this->getEntityManager()->getRepository(Whitelist::class)\n ->createQueryBuilder('wl')\n ->select('wl.uuid')\n ;\n\n $qb = $this->createQueryBuilder('j');\n $qb->andWhere('j.status != :status');\n $qb->setParameter('status', 'ping-error');\n $qb->andWhere($qb->expr()->notIn('j.uuid', $blacklist->getDQL()));\n $qb->andWhere($qb->expr()->notIn('j.uuid', $whitelist->getDQL()));\n\n return $qb->getQuery()->execute();\n }",
"public function modulosOut(){\n $modulos1=$this->modulos()->pluck('modulos.id');\n //esto me devuelve los ids de modulos 1 en el caso de tenerlo o que le faltan\n $modulos2=Modulo::whereNotIn('id', $modulos1)->get();\n\n return $modulos2;\n }",
"public function getMatchingIds()\n {\n return array();\n }",
"function get_unasked () {\n\t\t$unasked = array();\n\t\tforeach ( $this->entries as $entry )\n\t\t\tif ( !$entry->has_been_asked() ) $unasked[] = $entry;\n\t\treturn $unasked;\n\t}",
"function hideSameFlights() {\n\t\t// AND are from the same user (using pilot's mapping table to find that out)\n\n\t\t// addition: 2008/07/21 we search for all flight no only from same user/server\n\t\tglobal $db,$flightsTable;\n\n\t\t$query=\"SELECT serverID,ID,externalFlightType, FROM $flightsTable\n\t\t\t\t\tWHERE hash='\".$this->hash.\"' AND userID=\".$this->userID.\" AND userServerID=\".$this->userServerID.\n\t\t\t\t\t\" ORDER BY serverID ASC, ID ASC\";\n\n\t\t$query=\"SELECT serverID,ID,externalFlightType,userID,userServerID FROM $flightsTable\n\t\t\tWHERE hash='\".$this->hash.\"' ORDER BY serverID ASC, ID ASC\";\n\n\t\t// echo $query;\n\t\t$res= $db->sql_query($query);\n\t\tif ($res<=0) {\n\t\t\tDEBUG(\"FLIGHT\",1,\"flightData: Error in query: $query<br>\");\n\t\t\treturn array(); // no duplicate found\n\t\t}\n\n\t\t// we must disable all flights BUT one\n\t\t// rules:\n\t\t// 1. locally submitted flights have priority\n\t\t// 2. between external flights , the full synced have priority over simple links\n\t\t// 3. between equal cases the first submitted has priority.\n\n\t\t$i=0;\n\t\twhile ( $row = $db->sql_fetchrow($res) ) {\n\t\t\t$fList[$i]=$row;\n\t\t\t$i++;\n\t\t}\n\n\t\tif ($i==0) {\n\t\t\treturn array(); // no duplicate found\n\t\t}\n\n\t\tusort($fList, \"sameFlightsCmp\");\n\n\t\t$i=0;\n\t\t$msg='';\n\t\tforeach($fList as $i=>$fEntry) {\n\t\t\tif (0) {\n\t\t\t\techo \"<pre>\";\n\t\t\t\techo \"-------------------------<BR>\";\n\t\t\t\tprint_r($fEntry);\n\t\t\t\techo \"-------------------------<BR>\";\n\t\t\t\techo \"</pre>\";\n\t\t\t}\n\n\t\t\tif ($i==0) {// enable\n\t\t\t\t$msg.= \" Enabling \";\n\t\t\t\t$query=\"UPDATE $flightsTable SET private = private & (~0x02 & 0xff ) WHERE ID=\".$fEntry['ID'];\n\t\t\t} else {// disable\n\t\t\t\t$msg.= \" Disabling \";\n\t\t\t\t$query=\"UPDATE $flightsTable SET private = private | 0x02 WHERE ID=\".$fEntry['ID'];\n\t\t\t}\n\t\t\t$msg.= \" <a href='http://\".$_SERVER['SERVER_NAME'].\n\t\t\t\tgetLeonardoLink(array('op'=>'show_flight','flightID'=>$fEntry['ID'])).\n\t\t\t\t\"'>Flight \".$fEntry['ID'].\n\t\t\t\"</a> from <a href='http://\".$_SERVER['SERVER_NAME'].\n\t\t\t\tgetLeonardoLink(array('op'=>'pilot_profile','pilotIDview'=>$fEntry['userServerID'].'_'.$fEntry['userID'])).\n\t\t\t\t\"'>PILOT \".\n\t\t\t$fEntry['userServerID'].'_'.$fEntry['userID'].\"</a><BR>\\n\";\n\n\t\t\t$res= $db->sql_query($query);\n\t\t\t# Error checking\n\t\t\tif($res <= 0){\n\t\t\t\techo(\"<H3> Error in query: $query</H3>\\n\");\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\n\n\t\t// now also make a test to see if all flights are from same user (alien mapped to local)\n\t\t// if not , send a mail to admin to warn him and suggest a new mapping\n\t\t$pList=array();\n\t\tforeach($fList as $i=>$fEntry) {\n\t\t\t$pList[$fEntry['userServerID'].'_'.$fEntry['userID']]++;\n\t\t}\n\n\t\tif ( count($pList) > 1 ) { // more than one pilot involved in this\n\t\t\tsendMailToAdmin(\"Duplicate flights\",$msg);\n\t\t\t//echo \"Duplicate flights\".$msg;\n\t\t}\n\n\t\t/*\n\t\tforeach ($disableFlightsList as $dFlightID=>$num) {\n\t\t\t$query=\"UPDATE $flightsTable SET private = private | 0x02 WHERE ID=$dFlightID \";\n\t\t\t$res= $db->sql_query($query);\n\t\t\t# Error checking\n\t\t\tif($res <= 0){\n\t\t\t\techo(\"<H3> Error in query: $query</H3>\\n\");\n\t\t\t}\n\t\t}\n\t\tforeach ($enableFlightsList as $dFlightID=>$num) {\n\t\t\t$query=\"UPDATE $flightsTable SET private = private & (~0x02 & 0xff ) WHERE ID=$dFlightID \";\n\t\t\t$res= $db->sql_query($query);\n\t\t\t# Error checking\n\t\t\tif($res <= 0){\n\t\t\t\techo(\"<H3> Error in query: $query</H3>\\n\");\n\t\t\t}\n\t\t}*/\n\n\t}",
"protected function resyncAllMembers()\n {\n $tsMember = \\IPS\\teamspeak\\Member::i();\n\n try\n {\n /* Get the members who have a UUID set */\n foreach ( \\IPS\\Db::i()->select( 's_member_id, s_uuid', 'teamspeak_member_sync' ) as $info )\n {\n try\n {\n $member = \\IPS\\Member::load( $info['s_member_id'] );\n }\n catch ( \\OutOfRangeException $e )\n {\n continue;\n }\n\n /* Previous bug caused entries with an empty UUID, which now results in an exception being thrown */\n if ( isset( $info['s_uuid'] ) && !empty( $info['s_uuid'] ) )\n {\n $tsMember->resyncGroups( $member, $info['s_uuid'] );\n }\n }\n }\n catch ( \\IPS\\teamspeak\\Exception\\ClientNotFoundException $e )\n {\n /* Ignore invalid UUIDs */\n }\n catch ( \\Exception $e )\n {\n \\IPS\\Output::i()->error( $e->getMessage(), '4P100/3' );\n }\n\n /* Redirect back to the table with a message that the UUIDs have been re-synced */\n \\IPS\\Output::i()->redirect(\n \\IPS\\Http\\Url::internal( 'app=teamspeak&module=members&controller=members' ), 'teamspeak_members_resynced'\n );\n }",
"function bbp_get_hidden_forum_ids()\n{\n}"
] | [
"0.5569382",
"0.5472614",
"0.5114548",
"0.5016845",
"0.5009449",
"0.49396166",
"0.4901195",
"0.4868374",
"0.48620713",
"0.48435456",
"0.47956192",
"0.478709",
"0.47804108",
"0.4710303",
"0.47089303",
"0.470718",
"0.46783546",
"0.46668074",
"0.4650891",
"0.464334",
"0.46394703",
"0.4634982",
"0.46324584",
"0.4620244",
"0.46067134",
"0.4603878",
"0.45982853",
"0.45972988",
"0.45900947",
"0.45773745"
] | 0.73959655 | 0 |
Persist details about a guild in the database | public static function persistGuildDetails($guildDetails) {
global $gw2i_db_prefix;
$pqs = 'INSERT INTO ' . $gw2i_db_prefix . 'guilds (g_uuid, g_name, g_tag, g_last_synched) '
. 'VALUES(?, ?, ?, CURRENT_TIMESTAMP) '
. 'ON DUPLICATE KEY UPDATE '
. 'g_tag = VALUES(g_tag), '
. 'g_last_synched = VALUES(g_last_synched) ';
$params = array(
$guildDetails["guild_id"],
$guildDetails["guild_name"],
$guildDetails["tag"]
);
$ps = Persistence::getDBEngine()->prepare($pqs);
$ps->execute($params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store(Request $request)\n {\n if(!$this->canCreate(Auth::getUser())){\n abort('403', 'You have a guild');\n }\n\n $guild = new Guild();\n $guild->name = $request->input('name');\n $guild->icon_path = $request->input('icon_path');\n $guild->server_id = $this->server()->id;\n $guild->save();\n GuildMember::create(['user_id' => Auth::getUser()->id, 'guild_id' => $guild->id, 'role' => 'master']);\n return redirect()->route('guilds.index', $this->server()->slug);\n }",
"public function create()\n {\n if(!$this->canCreate(Auth::getUser())){\n abort('403', 'You have a guild');\n }\n\n return view('guilds.create');\n }",
"public function save() {\r\n $db = Db::instance();\r\n // omit id and any timestamps\r\n $db_properties = array(\r\n 'username' => $this->username,\r\n 'pw' => $this->pw,\r\n 'email' => $this->email,\r\n 'first_name' => $this->first_name,\r\n 'last_name' => $this->last_name,\r\n 'role' => $this->role,\r\n 'description' => $this->description,\r\n 'gender' => $this->gender\r\n );\r\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\r\n }",
"public function guild()\n {\n return $this->guildMember->guild();\n }",
"protected function storeInfo() {\n db_merge('rules_web_remote_info')\n ->key(array('name' => $this->name))\n ->fields(array(\n 'info' => serialize($this->info),\n 'token' => $this->token,\n ))\n ->execute();\n }",
"function save()\n\t\t{\n\t\t\t$GLOBALS['DB']->exec(\"INSERT INTO leagues (league_name, sport_id, price, skill_level, description, location, website, email, org_id) VALUES ('{$this->getLeagueName()}', {$this->getSportId()}, {$this->getPrice()}, '{$this->getSkillLevel()}', '{$this->getDescription()}', '{$this->getLocation()}', '{$this->getWebsite()}', '{$this->getEmail()}', {$this->getOrgId()});\");\n\t\t\t$this->id = $GLOBALS['DB']->lastInsertId();\n\t\t}",
"public function persist();",
"private function databaseSave()\n {\n if (! $this->post->validate(array(\n 'type' => 'required',\n 'username' => 'required',\n 'password' => 'required',\n 'database' => 'required',\n 'host' => 'required',\n 'port' => 'required|type:port'\n ))) {\n return;\n }\n \n $s_type = $this->post['type'];\n $this->setValue('SQL/prefix', $this->post['prefix']);\n $this->setValue('SQL/type', $s_type);\n $this->setValue('SQL/' . $s_type . '/username', $this->post['username']);\n $this->setValue('SQL/' . $s_type . '/password', $this->post['password']);\n $this->setValue('SQL/' . $s_type . '/database', $this->post['database']);\n $this->setValue('SQL/' . $s_type . '/host', $this->post['host']);\n $this->setValue('SQL/' . $s_type . '/port', $this->post['port']);\n \n $this->settings->save();\n }",
"protected function getGuildAttribute(): ?Guild\n {\n return $this->discord->guilds->get('id', $this->guild_id);\n }",
"protected function getGuildAttribute(): ?Guild\n {\n return $this->discord->guilds->get('id', $this->guild_id);\n }",
"public function saveDatabase()\n\t{\n\t\t$this->save();\n\t}",
"public function create(array $data)\n {\n $guild = $this->getNew();\n $guild->name = $data['name'];\n $guild->master = $data['owner'];\n $guild->level = $data['level'];\n $guild->save();\n\n return $this->toArray($guild);\n }",
"public function store()\n {\n $this->log->debug(\"Storing \".count($this->champions).\" new/updated champions' stats\");\n\n foreach ($this->champions as $champion) {\n $stats = $this->convertStatsToArray($champion);\n\n foreach ($stats as $key => $value) {\n $select = 'SELECT champion_id FROM champion_stats WHERE champion_id = :champion_id '\n . 'AND version = :version AND stat_name = :stat_name AND region = :region';\n $where = $champion->getKeyData();\n $where['stat_name'] = $key;\n $data = array_merge($where, ['stat_value' => $value]);\n\n if ($this->dbConn->fetchAll($select, $where)) {\n $this->dbConn->update('champion_stats', $data, $where);\n\n continue;\n }\n\n $this->dbConn->insert('champion_stats', $data);\n }\n }\n }",
"function _store() {\n\t\t$sql = \"UPDATE dbm_user_groups SET name=?, description=?, canManageClasses=?, canManageUsers=?, canManageImgLib=?, restrictNodeEdit=?, isModerator=? WHERE id=?\";\n\t\tDBUtils::execUpdate($sql, array($this->name, $this->description, $this->canManageClasses, $this->canManageUsers, $this->canManageImgLib, $this->restrictNodeEdit, $this->isModerator, $this->id));\n\t}",
"public function save() {\n\n\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'post_id' => $this->postId,\n 'user_id' => $this->userId\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function saveMemberData()\n {\n $query = DB::query( Database::SELECT, 'SELECT save_user(:id,:name,:surname,:email,:pcode,:address,:country,:city)');\n $query->parameters(array(\n \":id\" => ( int ) $this->id,\n \":name\" => $this->name,\n \":surname\" => $this->surname,\n \":email\" => $this->email,\n \":pcode\" => $this->personal_code,\n \":address\" => $this->address,\n \":country\" => $this->country,\n \":city\" => $this->city\n ));\n \n $user_id = ( int ) $query->execute()->get( \"save_user\" );\n \n if( !empty( $user_id ) ){\n $this->set( 'id', $user_id );\n }\n }",
"public function save() {\n $db = Db::instance();\n\n\t\t// omit id and any timestamps\n $db_properties = array(\n 'id' => $this->id,\n 'follower' => $this->follower,\n 'followee' => $this->followee,\n 'created' => $this->created\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function persist(){\n $key = 'loco_'.$this->getKey();\n return update_option( $key, $this->getSerializable(), false );\n }",
"function save_server() {\n //$this->server->apollo_search_server = 1;\n }",
"private function persistData()\n {\n\n\n $data = [\n 'time' => $this->meta['time'],\n 'ip' => $this->meta['ip'],\n 'method' => $this->meta['method'],\n 'uri' => $this->meta['uri'],\n 'data' => $this->data,\n ];\n\n return SongshenzongLog::create($data);\n }",
"public function save()\n {\n // make an Array from the attributes of this Shot\n $params = array(\n 'holeID' => $this->holeID(),\n 'club' => $this->club(),\n 'shotNumber' => $this->shotNumber(),\n 'aimLatitude' => $this->aimLatitude(),\n 'aimLongitude' => $this->aimLongitude(),\n 'startLatitude' => $this->startLatitude(),\n 'startLongitude' => $this->startLongitude(),\n 'endLatitude' => $this->endLatitude(),\n 'endLongitude' => $this->endLongitude()\n );\n\n // call DBObject::saveToDB and either insert or update the Shot.\n // Return the return value of DBObject::saveToDB\n return parent::saveToDB($params);\n }",
"public function save()\r\n {\r\n global $master_db_handle;\r\n\r\n // set the last updated time to now\r\n $this->setUpdated(time());\r\n\r\n // Prepare it\r\n $statement = $master_db_handle->prepare('UPDATE Server SET Players = :Players, Country = :Country, ServerVersion = :ServerVersion, Hits = :Hits, Created = :Created WHERE ID = :ID');\r\n\r\n // Execute\r\n $statement->execute(array(':ID' => $this->id, ':Players' => $this->players, ':Country' => $this->country,\r\n ':ServerVersion' => $this->serverVersion, ':Hits' => $this->hits, ':Created' => $this->created));\r\n\r\n // update the plugin part of it\r\n $this->updatePlugin();\r\n $this->modified = false;\r\n }",
"public function persist()\n\t{\n\t}",
"public function save()\r\n {\r\n global $pdo;\r\n\r\n // set the last updated time to now\r\n $this->setUpdated(time());\r\n\r\n // Prepare it\r\n $statement = $pdo->prepare('UPDATE Server SET Plugin = :Plugin, GUID = :GUID, Players = :Players, Country = :Country, ServerVersion = :ServerVersion, Hits = :Hits, Created = :Created WHERE ID = :ID');\r\n\r\n // Execute\r\n $statement->execute(array(':ID' => $this->id, ':Plugin' => $this->plugin, ':Players' => $this->players, ':Country' => $this->country, ':GUID' => $this->guid,\r\n ':ServerVersion' => $this->serverVersion, ':Hits' => $this->hits, ':Created' => $this->created));\r\n\r\n // update the plugin part of it\r\n $this->updatePlugin();\r\n }",
"public function save()\n {\n if ($this->state === 'unset') {\n // Insert the new Campaign to Database\n $this->insert_new();\n // Build Empty Ad Units\n $this->buildAdUnits();\n } else {\n $this->update_db();\n // Remove Old Ad Units\n $this->destroyAdUnits();\n // Rebuild the Ad Units\n $this->buildAdUnits();\n }\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'title' => $this->title,\n 'brand' => $this->brand,\n 'speed' => $this->speed,\n 'weight' => $this->weight,\n 'basic_description' => $this->basic_description,\n 'secondary_desc' => $this->secondary_desc,\n 'price' => $this->price,\n 'price_range' => $this->price_range,\n 'size' => $this->size,\n 'hard_drive' => $this->hard_drive,\n 'image_url' => $this->img_url,\n 'user_id' => $this->user_id\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"function save_player_data()\n\t{\n\t\tglobal $database;\n\t\t$database->update_where('lg_game_players',\n\t\t\t\"game_id = '\".$database->escape($this->player_data['game_id']).\"' \n\t\t\tAND player_id = '\".$this->player_data['player_id'].\"'\"\n\t\t\t,$this->player_data);\t\n\t}",
"protected abstract function saveEntityToDatabase();",
"public function save()\n {\n if ($this->id)\n {\n $query = sprintf('UPDATE FORUM SET NAME = \"%s\", DESCRIPTION = \"%s\" WHERE ID = %d',\n mysql_real_escape_string($this->name, $GLOBALS['DB']),\n mysql_real_escape_string($this->description, $GLOBALS['DB']),\n $this->id);\n//\t\t\techo sprintf(\"Forum->save(): query='%s'\", $query);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO FORUM (NAME, DESCRIPTION) VALUES (\"%s\", \"%s\")',\n mysql_real_escape_string($this->name, $GLOBALS['DB']),\n mysql_real_escape_string($this->description, $GLOBALS['DB']));\n//\t\t\techo sprintf(\"Forum->save(): query='%s'\", $query);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->id = mysql_insert_id($GLOBALS['DB']);\n }\n }",
"public function save()\n {\n\t\t// Connexion to the DB\n\t\t$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;\n\t\ttry {\n\t\t\t$bdd = new PDO(DSN, DB_USERNAME, DB_PASSWORD, $pdo_options);\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\techo 'Connexion Failed : ' . $e->getMessage();\n\t\t\texit();\n\t\t}\n\t\t// If the member hasn't been saved yet\n\t\tif($this->idMember == 0) {\n\t\t\t// Insert the current member in the DB \n\t\t\t$req = $bdd->prepare('INSERT INTO Member(username, email, password, sex, isAdmin, description, image, website) VALUES (:username, :email, :password, :sex, :isAdmin, :description, :image, :website)');\t\n\n\t\t\t$req->execute(array(\n\t\t\t\t\t'username'\t\t=> $this->username,\n\t\t\t\t\t'email'\t\t\t=> $this->email,\n\t\t\t\t\t'password'\t\t=> $this->password,\n\t\t\t\t\t'sex'\t\t\t=> $this->sex,\n\t\t\t\t\t'isAdmin'\t\t=> $this->isAdmin,\n\t\t\t\t\t'description'\t=> $this->desc,\n\t\t\t\t\t'image'\t\t\t=> $this->image, \n\t\t\t\t\t'website'\t\t=> $this->website\n\t\t\t\t\t));\n\t\t\t// Update the idMember attribute\n\t\t\t$req->closeCursor;\n\t\t\t$req = $bdd->prepare('SELECT idMember From Member WHERE username = ?');\n\t\t\t$req->execute(array($this->username));\n\t\t\t$data = $req->fetch();\n\t\t\t$this->idMember = $data['idMember'];\n\n\t\t}\n\t\t// If the current member already is in the DB\n\t\telse {\n\t\t\t// Update his informations\n\t\t\t$req = $bdd->prepare('UPDATE Member SET username = :username, email = :email, password = :password, sex = :sex, isAdmin = :isAdmin, description = :description, image = :image, website = :website WHERE idMember = :idMember');\n\n\t\t\t$req->execute(array(\n\t\t\t\t\t'username'\t\t=> $this->username,\n\t\t\t\t\t'email'\t\t\t=> $this->email,\n\t\t\t\t\t'password'\t\t=> $this->password,\n\t\t\t\t\t'sex'\t\t\t=> $this->sex,\n\t\t\t\t\t'isAdmin'\t\t=> $this->isAdmin,\n\t\t\t\t\t'description'\t=> $this->desc,\n\t\t\t\t\t'image'\t\t\t=> $this->image,\n\t\t\t\t\t'website'\t\t=> $this->website,\n\t\t\t\t\t'idMember'\t\t=> $this->idMember\n\t\t\t\t\t));\n\t\t}\n\t\t$req->closeCursor();\n }"
] | [
"0.6079286",
"0.5577011",
"0.5550732",
"0.5412803",
"0.53767306",
"0.5376569",
"0.534804",
"0.5244341",
"0.52232695",
"0.52232695",
"0.51833117",
"0.5178799",
"0.5142664",
"0.5140012",
"0.51333463",
"0.51235914",
"0.5121152",
"0.5097712",
"0.5097047",
"0.50791883",
"0.5071428",
"0.5058335",
"0.5023451",
"0.5007615",
"0.49988163",
"0.4986301",
"0.49584877",
"0.49570963",
"0.4948143",
"0.49375498"
] | 0.70605105 | 0 |
mostrar template del administrador | function showAdminPage(){
$this->smarty->display('./templates/administrador/adminPage.tpl');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function templates() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/templates.php';\n\t}",
"function _template ($page,$contents, $admin_folder='admin/user management/'){\n\t\t\t$this->load->helper('form');\n\t\t\t$this->load->view(\"admin_header\",$contents);\n\t\t\t$this->load->view($admin_folder.$page, $contents);\n\t\t\t$this->load->view(\"admin_footer\");\n\t\t}",
"function afficherChoix() {\n\t\tglobal $utilisateur;\n\t\t$twig = new Twig_Environment(new Twig_Loader_Filesystem(\"./tpl\"));\n\t\t$tpl = $twig->loadTemplate(\"menuAdmin.tpl\");\n\t\techo $tpl->render(array(\n\t\t\t\"titre\" =>\"Menu Administrateur\",\n\t\t\t\"css\" => array(\"stylePageAdmin\"),\n\t\t\t\"user\" => $utilisateur\n\t\t));\n\t}",
"public function adminTools() {\n $tpl = \"home\";\n return $tpl;\n }",
"public function show_menu()\n {\n echo get_oc_template($this->config['template_name']);\n }",
"public function administrationAction()\n {\n return $this->render(\n $this->getTemplatePath().'administration.html.twig',\n array(\n 'instance' => $this->getCurrentInstance(),\n )\n );\n }",
"public function display($template = 'default'){\r\n \r\n //Verifica se um templete foi realmente atribuido\r\n if(empty($template)) $template = 'default';\r\n \r\n //Obtém o sufixo do mostrador\r\n $shower = strtolower( str_replace( 'Shower', '', get_class($this) ) );\r\n \r\n //Obtém o caminho do arquivo que define o template selecionado \r\n $path_template = Config::importSRC( 'shower.'.$shower.'.template.'.$template, true );\r\n \r\n //Verificando a existência do tamplete\r\n if($path_template instanceof Exception){\r\n throw new Exception('Fail to load template this shower');\r\n }\r\n \r\n //Obtém o código definido no template\r\n $content = trim( file_get_contents($path_template) );\r\n \r\n //Ajustando a codificação PHP para a execução do template\r\n if( strrpos($content, '<?') === 0 ) {\r\n \r\n //Ajustando a exibição quando o template inicia com as tags php\r\n $content = Config::replaceFirst('<?php', '', $content);\r\n $content = Config::replaceLast('?>', '', $content);\r\n \r\n \r\n } else {\r\n \r\n //Ajustando a exibição quando o templete inicia com HTML\r\n $content = '?> '.$content.' <?php ';\r\n \r\n }\r\n eval($content);\r\n \r\n }",
"public function admin()\n {\n return $this->render('admin/admin.html.twig');\n }",
"public function processaTemplateParziale() {\n $this->display('registrazione_'.$this->_layout.'.tpl');\n }",
"public function template(){\n\n\t\tinclude_once \"views/template.php\";\n\n\t}",
"protected function action_admin() {\n\t\t$user = $this->_authenticate();\n\t\t$data = $this->_getData();\n\n\t\t$privateTemplate = CAPT_DIR . DS . $this->_name . DS . $this->_adminTemplate;\n\t\tif( file_exists($privateTemplate) )\n\t\t\treturn include( $privateTemplate );\n\t\tinclude( TMPL_DIR . DS . $this->_adminTemplate );\n\t}",
"public function admintoolAction(){\n \treturn $this->render('FfblAdminBundle:User:admintool.html.twig');\n }",
"public function pagina(){\t\n\t\t//llama al archivo template.php\n\t\tinclude \"views/template.php\";\n\t\n\t}",
"public function admin()\n {\n $this->smarty->view('auth/admin.tpl');\n }",
"public static function tools_page_template() {\n\t\trequire_once( WPRM_DIR . 'templates/admin/tools.php' );\n\t}",
"public function action_index()\n\t{\n\t\treturn Response::forge(View::forge('admin/template'));\n\t}",
"public function Template()\n\t{\n\t\t#Atravez del metodo 'Include' icluimos Template \n\t\trequire_once \"views/template.php\";\n\t}",
"public function adminAction()\n {\n return $this->render(\n 'AppBundle:Default:admin.html.twig',\n array(\n )\n );\n }",
"public function persModif()\n {\n $this->templates->display('persModif');\n }",
"public function template(){\n\n\t\tinclude \"views/template.php\";\n\t}",
"public function listAdmin()\n {\n $item = (new HtmlMailTemplate)->readFirst();\n if ($item->id() != '') {\n header('Location: ' . url('html_mail_template/modify_view/' . $item->id(), true));\n } else {\n return parent::getContent();\n }\n }",
"public function insertAdmin()\n {\n $template = 'insertAdminForm.html.twig';\n $argsArray = [\n 'pageTitle' => 'Create Admin Form',\n 'username' => $this->usernameFromSession()\n ];\n $html = $this->twig->render($template, $argsArray);\n print $html;\n }",
"function showContratosTemplate() {\r\n $html = '\r\n\t<br />\r\n\t<span class=\"header\">Contratos:</span>\r\n\t<br />\r\n\t{$link_novo_contrato}\r\n\t<div id=\"novoContrato\" style=\"display: none;\">{$novo_contrato}</div>\r\n\t<br />\r\n\t<br />\r\n\t<br />\r\n\t<table width=\"100%\">\r\n\t\t<tr>\r\n\t\t\t<th>Nº CPO</th>\r\n\t\t\t<th>Número Contrato</th>\r\n\t\t\t<th>Obras</th>\r\n\t\t\t<th>Tipo Processo</th>\r\n\t\t\t<th>Processo</th>\r\n\t\t\t<th>Empresa</th>\r\n\t\t\t<th>Data Vigência</th>\r\n\t\t\t<th>Data Conclusão</th>\r\n\t\t</tr>\r\n\t\t{$tabela_contratos}\r\n\t</table>\r\n\t';\r\n\r\n return $html;\r\n}",
"public function tournois()\n {\n return $this->render('/admin/tournois/tournois.html.twig');\n }",
"static public function pagina(){\t\n\n\t\tinclude \"views/template.php\";\n\n\t}",
"public function gerenciar(){\n\t\t\n\t\tload_template();\n\t}",
"public function guias(){\n $this->smarty->display('guias.tpl');\n }",
"public function renderNew()\n {\n if(!($this->user->isLoggedIn()))\n {\n $this->redirect(\"Homepage:\");\n }\n else if(($this->user->isInRole('Obsluha')))\n {\n $this->redirect(\"Service:\");\n }\n $this->template->_user = $this->user;\n $this->template->_username = $this->user->getIdentity()->jmeno;\n \n }",
"public function adminAction()\n {\n return $this->render(':default:index.html.twig', array(\n 'body' => 'Admin Page!'\n ));\n }",
"public function loginAdmin(){\n return $this->render('security/loginAdmin.html.twig');\n }"
] | [
"0.7093833",
"0.6916093",
"0.68634313",
"0.6846896",
"0.68324786",
"0.6804608",
"0.67981386",
"0.67751503",
"0.6738858",
"0.67355424",
"0.6705374",
"0.6697648",
"0.66607225",
"0.6652273",
"0.66468525",
"0.6634603",
"0.66292626",
"0.6616641",
"0.6591032",
"0.6590114",
"0.6568652",
"0.65172833",
"0.6512765",
"0.6489362",
"0.6485991",
"0.6457099",
"0.6453562",
"0.64083415",
"0.64029485",
"0.64023286"
] | 0.70752025 | 1 |
easy access to the ImageOptions of CroppableImage, | public static function getGlobalImageSettings() {
$options = wire('modules')->get('ProcessCroppableImage')->getCroppableImageOptions();
if (!is_array($options)) {
throw new WireException(__('Unable to get CroppableImageOptions!'));
}
return $options;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function photo ($options = array()) {\n $options = array_merge(array('width' => 600, 'height' => 400,\n 'overflow' => 'hidden'), $options);\n\n if ($this->img['width'] > $this->img['height']) {\n if ($options['overflow'] == 'hidden')\n $options['canvas-height'] = $options['height'];\n\n unset($options['height']);\n }\n\n elseif ($this->img['width'] < $this->img['height']) {\n $options = array_merge($options, array('width' => $options['height'],\n 'height' => $options['width']));\n\n if ($options['overflow'] == 'hidden')\n $options['canvas-width'] = $options['width'];\n\n unset($options['width']);\n }\n\n $this->resize($options);\n }",
"public function output_image($options=array())\n {\n \n $options = Data($options);\n \n //Get the given path.\n $p = tx('Data')->get->path->get();\n \n //Are we getting a cached image?\n if(strpos($p, 'cache/') === 0)\n {\n \n //Create the filename.\n $filename = basename($p);\n \n //Create parameters.\n $resize = Data(array());\n $crop = Data(array());\n \n //Parse the name for resize parameters.\n $filename = preg_replace_callback('~_resize-(?P<width>\\d+)-(?P<height>\\d+)~', function($result)use(&$resize){\n $resize->{0} = $result['width'];\n $resize->{1} = $result['height'];\n return '';\n }, $filename);\n \n //Parse the name for crop parameters.\n $filename = preg_replace_callback('~_crop-(?P<x>\\d+)-(?P<y>\\d+)-(?P<width>\\d+)-(?P<height>\\d+)~', function($result)use(&$crop){\n $crop->{0} = $result['x'];\n $crop->{1} = $result['y'];\n $crop->{2} = $result['width'];\n $crop->{3} = $result['height'];\n return '';\n }, $filename);\n \n //Use the remaining file name to create a path.\n $path = PATH_COMPONENTS.DS.'media'.DS.'uploads'.DS.'images'.DS.$filename;\n \n //Test if the new path points to an existing file.\n if(!is_file($path)){\n set_status_header(404, sprintf('Image \"%s\" not found.', $filename));\n exit;\n }\n \n }\n \n //If this is not a cached image, the path is simple.\n else{\n \n //Create parameters.\n $resize = Data(false);\n $crop = Data(false);\n \n //Create the filename.\n $filename = basename($p);\n \n //Use the file name to create a path.\n $path = PATH_COMPONENTS.DS.'media'.DS.'uploads'.DS.'images'.DS.$filename;\n \n //Test if the new path points to an existing file.\n if(!is_file($path)){\n set_status_header(404, sprintf('Image \"%s\" not found.', $filename));\n exit;\n }\n \n }\n \n //Since we will output an image. Switch to read-only mode for the session to prevent bottlenecks.\n tx('Session')->close();\n \n $image = tx('File')->image()\n ->use_cache(!tx('Data')->get->no_cache->is_set())\n ->from_file($path)\n ->allow_growth(tx('Data')->get->allow_growth->is_set())\n ->allow_shrink(!tx('Data')->get->disallow_shrink->is_set())\n ->sharpening(!tx('Data')->get->disable_sharpen->is_set());\n \n if(!$resize->is_false())\n $image->resize($resize->{0}, $resize->{1});\n \n if(!$crop->is_false())\n $image->crop($crop->{0}, $crop->{1}, $crop->{2}, $crop->{3});\n \n //See if we should create a public symlink to the file.\n if($options->create_static_symlink->is_true() && $image->has_diverted() === false){\n \n $subfolders = explode(DS, $p);\n $subfolder_count = count($subfolders) -1;\n \n $target = str_repeat('..'.DS, $subfolder_count).'..'.DS.'..'.DS.'uploads'.DS.'images'.DS.$p;\n $link = PATH_COMPONENTS.DS.'media'.DS.'links'.DS.'images'.DS.'static-'.$p;\n \n //Check the link isn't already there.\n if(!is_link($link)){\n \n //Ensure the folder for the link and the symlink itself are present.\n @mkdir(dirname($link), 0777, true);\n if(!@symlink($target, $link)){\n tx('Logging')->log('Media', 'Static symlink', 'Creation failed for: '.$target.' -> '.$link);\n }\n \n }\n \n }\n \n set_exception_handler('exception_handler_image');\n if(tx('Data')->get->download->is_set())\n $image->download(array('as' => tx('Data')->get->as->otherwise(null)));\n else\n $image->output();\n \n }",
"public function getThumbnailerOptions()\n {\n return $this->config['thumbnailer_options'];\n }",
"public function crop($options = array()) {\n $options = array_merge(array('width' => $this->img['width'],\n 'height' => $this->img['height']), $options);\n\n $this->pixel($options['width'], $this->img['width']);\n $this->pixel($options['height'], $this->img['height']);\n\n $pos = $this->position($options, $this->img);\n\n $tmp = imagecreatetruecolor($options['width'], $options['height']);\n imagecopyresampled($tmp, $this->img['source'], 0, 0, $pos['x'], $pos['y'],\n $this->img['width'], $this->img['height'], $this->img['width'], $this->img['height']);\n imagedestroy($this->img['source']);\n\n $this->img['source'] = $tmp;\n $this->img['width'] = $options['width'];\n $this->img['height'] = $options['height'];\n }",
"protected function getCropOption($imageFieldOptions)\n {\n $crop = array_get($imageFieldOptions, 'crop', false);\n\n // check for crop override\n if (isset($this->cropCoordinates) && count($this->cropCoordinates) == 2) {\n $crop = $this->cropCoordinates;\n }\n\n return $crop;\n }",
"public function getImagesShouldCrop();",
"public function getImageConfig()\n {\n return $this->image_config;\n }",
"public function getOptions()\n\t{\n\t\t// Define the image file type filter.\n\t\t$filter = '\\.png$|\\.gif$|\\.jpg$|\\.bmp$|\\.ico$|\\.jpeg$|\\.psd$|\\.eps$';\n\n\t\t// Set the form field element attribute for file type filter.\n\t\t$this->element->addAttribute('filter', $filter);\n\n\t\t// Get the field options.\n\t\treturn parent::getOptions();\n\t}",
"abstract protected function options();",
"private function set_upload_options() { \r\n \r\n $config = array();\r\n $config['upload_path'] = 'assets/businessimage';\r\n $config['allowed_types'] = 'gif|jpg|png';\r\n $config['max_size'] = '5000';\r\n $config['overwrite'] = FALSE;\r\n \r\n return $config;\r\n }",
"function __construct($id, $options = array()){\n\t\tparent::__construct($id, $options);\n\t\t$this->images = isset($options[\"images\"]) ? $options[\"images\"] : array();\n \t}",
"protected function options()\n {\n return [\n 'width' => '6',\n 'height' => '15',\n 'x' => '0',\n 'y' => '2',\n ];\n }",
"protected function options()\n {\n return [\n 'width' => '4',\n 'height' => '4',\n ];\n }",
"protected function getResizeOptions ()\n {\n $dbHandler = getPersistClass('Asset');\n $resizers = $dbHandler->getResizers();\n $results = array();\n foreach ($resizers as $resizer) {\n $results[$resizer['id']] = $resizer['name'] . ' (' . $resizer['width'] . 'x' . $resizer['height'] .\n ')';\n }\n return $results;\n }",
"public function getMenuOptionsForCvrPhotoAction()\n\t{\n\t\t$prms = $this->getRequest()->getParams();\n\t\t$current_user_id = Auth_UserAdapter::getIdentity()->getId();\n\t\t$current_user_obj = Auth_UserAdapter::getIdentity();\n\t\tif(!$current_user_obj->getCoverPhoto() && $prms['cover_photo_name'] = \"default_cover_photo.jpg\")\n\t\t{\n\t\t\techo Zend_Json::encode( 2 );\n\t\t}\n\t\telse if ( $current_user_obj->getCoverPhoto() && $prms['cover_photo_name'] != \"default_cover_photo.jpg\")\n\t\t{\n\t\t\techo Zend_Json::encode( 1 );\n\t\t}\n\t\t\t\n\t\tdie;\n\t\t\n\t\t\n\t}",
"public function getImageCompose () {}",
"function _get_related_image_match_options()\n {\n return array(__('Categories', 'nggallery') => 'category', __('Tags', 'nggallery') => 'tags');\n }",
"protected function getOptionImages()\n {\n $images = [];\n foreach ($this->getAllowProducts() as $product) {\n $productImages = $this->helper->getGalleryImages($product) ?: [];\n foreach ($productImages as $image) {\n $images[$product->getId()][] =\n [\n 'thumb' => $image->getData('small_image_url'),\n 'img' => $image->getData('medium_image_url'),\n 'full' => $image->getData('large_image_url'),\n 'zoom' => $image->getData('zoom_image_url'),\n 'caption' => $image->getLabel(),\n 'position' => $image->getPosition(),\n 'isMain' => $image->getFile() == $product->getImage(),\n 'media_type' => $image->getMediaType(),\n 'videoUrl' => $image->getVideoUrl(),\n ];\n }\n }\n\n return $images;\n }",
"public function getImageProperties()\n {\n return array(\n 'image' => 'post_thumbnail'\n );\n }",
"public function cropped()\n {\n /* @var Image $image */\n $data = $this->object->getData();\n $image = $this->object->image();\n\n if (!$data) {\n return $image;\n }\n\n return $image->crop($data->width, $data->height, $data->x, $data->y);\n }",
"static function getimagesize($url, $option='all'){\r\n\t\t$options = getimagesize($url);\r\n\t\tswitch($option){\r\n\t\t\tcase 'width':\r\n\t\t\t\treturn $options[0];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'height':\r\n\t\t\t\treturn $options[1];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'type':\r\n\t\t\t\treturn $options[2];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'attr':\r\n\t\t\t\treturn $options[3];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'css':\r\n\t\t\t\treturn 'width:'.$options[0].'px;height:'.$options[1].'px;';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'all':\r\n\t\t\tdefault:\r\n\t\t\t\treturn $options;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\r\n\t}",
"public function getImage() { return $this->image;}",
"public function getEventCoverImage()\n {\n }",
"protected function _getImageSizeConfiguration()\n {\n return $this->_imageSizeConfiguration;\n }",
"protected function _getImageSizeConfiguration()\n {\n return $this->_imageSizeConfiguration;\n }",
"public function getCroppedImage(ImageCropDataModel $imageCrop);",
"public function getImageAttributes()\n {\n return $this->_imageAttributes;\n }",
"public function getPhoto($htmlOptions=[])\n {\n if($this->photo == null && ! file_exists('@web/uploads/'.$this->photo)){\n return Html::img('@web/images/buku.jpg',$htmlOptions);\n } else {\n return Html::img('@web/uploads/'. $this->photo,$htmlOptions);\n }\n }",
"public function getOptions() {\n $options = [\n 'name' => $this->getName(),\n 'cloud_name' => $this->getCloudName(),\n 'upload_preset' => Config::inst()->get('Cloudinary', 'upload_preset'),\n 'theme' => Config::inst()->get('Cloudinary', 'theme'),\n 'folder' => $this->folder,\n 'cropping' => $this->cropping,\n 'cropping_aspect_ratio' => $this->cropping_aspect_ratio,\n 'use_signed' => Config::inst()->get('Cloudinary', 'use_signed')\n ];\n\n if (self::$use_signed)\n $options['api_key'] = Config::inst()->get('Cloudinary', 'api_key');\n\n return Convert::array2json($options);\n }",
"public function getAllowedImages(){\n return self::$allowed_images;\n }"
] | [
"0.6111758",
"0.6098559",
"0.60780036",
"0.6069218",
"0.6032387",
"0.59481466",
"0.59196264",
"0.5647476",
"0.56387514",
"0.56261265",
"0.5590226",
"0.55679774",
"0.55631083",
"0.550321",
"0.54422307",
"0.5430921",
"0.5420738",
"0.54121715",
"0.5411639",
"0.5382973",
"0.5380897",
"0.53655195",
"0.535982",
"0.5355948",
"0.5355948",
"0.53519315",
"0.5336513",
"0.53350055",
"0.5328862",
"0.5328042"
] | 0.691994 | 0 |
MI: Force setting "active" as changed attribute on create to trigger Versioning on this attribute. | protected function set_active_changed()
{
$this->setChangedAttribute('active', 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setActiveAttribute($value) {\n $this->attributes['active'] = $value == 'Active' ? 1 : 0;\n }",
"public function setActivating()\n {\n $this->update(['status' => static::STATUS_ACTIVATING]);\n }",
"public function setActive()\n {\n $this->status = self::STATUS_ACTIVE;\n $this->started_at = \\Carbon\\Carbon::now();\n $this->save();\n }",
"public function setActive()\n {\n $this->isActive = true;\n $this->save();\n return true;\n }",
"public function setIsActive(){\n \t}",
"public function setActive();",
"public static function setActive($active)\r\n {\r\n /// do what you have to do\r\n }",
"public function forceCreate(array $attributes = []);",
"public function setActive($value)\r\n {\r\n $this->_isActive = $value;\r\n }",
"public function setActive(bool $active = true);",
"public function setActive($active = TRUE);",
"public function setActive($active);",
"public function setActive($active);",
"public function setActive($active);",
"public function setInactive()\n {\n $this->isActive = false;\n $this->save(); // make sure the record is saved\n }",
"public function setActive() {\n self::where('page_id', $this->page_id)\n ->where('id', '<>', $this->id)\n ->update([\n 'is_active' => false\n ]);\n\n $this->update([\n 'is_active' => true\n ]);\n }",
"public function setActive($active) {\r\n\t$this->active = $active;\r\n }",
"function setActive($value){\r\n $this->setColumnValue('active', $value);\r\n }",
"function setActive($value) {\n\t\treturn $this->setColumnValue('active', $value, BaseModel::COLUMN_TYPE_TINYINT);\n\t}",
"public function setActiveState($active);",
"public function markActive()\n {\n $new = (new static)->newQueryWithoutScope(new ActivationScope())->activate($this->id);\n return $this->setRawAttributes($new->attributesToArray());\n }",
"public static function setActive( $active )\n {\n \n self::$active = $active; \n \n }",
"public function testSetAndGetActive()\n {\n $value = true;\n\n self::assertEquals(false, $this->fixture->isActive());\n self::assertEquals($this->fixture, $this->fixture->setActive($value));\n self::assertEquals($value, $this->fixture->isActive());\n }",
"public function setActive($active)\n\t{\n\t\t$this->active = $active;\n\t}",
"public function getNewAttributes();",
"public function activate() {\n\t\t$this->status = self::STATUS_ACTIVE;\n\t\treturn $this->update();\n\t}",
"public function setIsActive($is_active)\n{\n $this->is_active = $is_active;\n\n return $this;\n}",
"public function setInitialStatus(){\n $this->order->status()->attach(1, ['user_id'=>$this->vendor->user->id, 'comment'=>'Social Network order']);\n\n //Set automatically approved by admin - since it it social\n //$this->order->status()->attach(2, ['user_id'=>1, 'comment'=>__('Automatically approved by admin')]);\n }",
"public function setActive($active)\n {\n $this->active = $active;\n }",
"public function markNew(){\n $this->status = self::STATUS_NEW;\n return $this->save(false,['status']);\n }"
] | [
"0.63222724",
"0.62601256",
"0.6096798",
"0.6077288",
"0.59762836",
"0.5771956",
"0.57685643",
"0.57416975",
"0.5736408",
"0.57288206",
"0.5712607",
"0.56565917",
"0.56565917",
"0.56565917",
"0.5655139",
"0.55941004",
"0.55897987",
"0.5588062",
"0.5548918",
"0.55403036",
"0.5484428",
"0.54803765",
"0.547864",
"0.5453457",
"0.5424513",
"0.5394909",
"0.53940755",
"0.5390411",
"0.53801614",
"0.53787094"
] | 0.7051068 | 0 |
This matches Pool.post_pretty_sequence in pool.js. | public function pretty_sequence()
{
if (preg_match('/^\d+/', $this->sequence))
return "#".$this->sequence;
else
return '"'.$this->sequence.'"';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pretty_sequence() {\n # Pool sequence must start with a number.\n return '#'.$this->sequence;\n }",
"function cyclone_slider_debug($out){\r\n\treturn '<pre>'.print_r($out, true).'</pre>';\r\n}",
"public function glitchDump(): iterable\n {\n $output = '';\n\n if ($this->_isTemporary) {\n $output .= 'TEMP ';\n }\n\n $output .= $this->_name;\n $output .= ' ' . $this->getTimingName();\n $output .= ' ' . $this->getEventName();\n\n if (!empty($this->_updateFields)) {\n $output .= ' OF ' . implode(', ', $this->_updateFields);\n }\n\n if ($this->_whenExpression !== null) {\n $output .= ' WHEN ' . $this->_whenExpression;\n }\n\n $output .= ' ' . implode('; ', $this->_statements);\n $output .= ' [' . $this->_sqlVariant . ']';\n\n yield 'definition' => $output;\n }",
"function p( $output ) {\r\n\t\t\t\t\r\n\t\t\tprint '<br /><br /><br /><pre>';\r\n\t\t\tprint_r( $output );\r\n\t\t\tprint '</pre>';\r\n\t\t}",
"public function getSequence()\n {\n return parent::getSequence() . '_seq'; // TODO: Change the autogenerated stub\n }",
"public function __toString() {\n\t\treturn '[Frame delay='.$this->delay.' disposal='.$this->dispos.']';\n\t}",
"public function glitchDump(): iterable\n {\n if ($this->_record) {\n yield 'value' => $this->_record;\n return;\n }\n\n\n $output = $this->_field->getTargetUnitId() . ' : ';\n\n if ($this->_value->countFields() == 1) {\n $value = $this->_value->getFirstKeyValue();\n\n if ($value === null) {\n $output .= 'null';\n } else {\n $output .= $value;\n }\n } else {\n $t = [];\n\n foreach ($this->_value->toArray() as $key => $value) {\n $valString = $key . '=';\n\n if ($value === null) {\n $valString .= 'null';\n } else {\n $valString .= $value;\n }\n\n $t[] = $valString;\n }\n\n $output .= implode(', ', $t);\n }\n\n yield 'definition' => $output;\n }",
"public function getDisplaySequence()\n {\n return $this->displaySequence;\n }",
"function fprint($param = NULL) {\n static $count;\n if(!isset($count))\n $count = 1;\n else\n $count++;\n echo '<br />';\n echo '<div style=\"background-color:#fff;\"><b><i><u>********* formated output '.$count.' *********</u></i></b>';\n echo '<pre>';\n var_dump($param);\n echo '</pre>';\n echo '<b><i>********* formated output *********</i></b></div>';\n echo '<br />';\n}",
"function print_r_pre( $argument ) {\n\t\techo '<pre style=\"color: steelblue; background: #eee; border: 1px dashed #bbb; padding: 10px\">' . PHP_EOL;\n\t\tprint_r( $argument );\n\t\techo PHP_EOL . '</pre>' . PHP_EOL;\n\t}",
"function um_groups_js_dump( $args = array() ){\n\techo \"<script>console.log(\".json_encode( $args ).\");</script>\";\n}",
"function theme_sequence_combo($variables) {\n $element = $variables['element'];\n $output = '';\n\n $output .= drupal_render($element['upstream']);\n $output .= \" \"; // This space forces our fields to have a little room in between.\n $output .= drupal_render($element['downstream']);\n\n return $output;\n}",
"public function prettyPrint() \n {\n }",
"public function glitchDump(): iterable\n {\n $output = $this->__toString();\n\n if (!$this->renderEmpty) {\n $output = '<?' . substr($output, 1);\n }\n\n yield 'className' => $this->name;\n yield 'definition' => $output;\n\n yield 'properties' => [\n '*renderEmpty' => $this->renderEmpty,\n '*attributes' => $this->attributes,\n ];\n\n yield 'section:properties' => false;\n }",
"public function glitchDump(): iterable\n {\n yield 'text' => $this->toString();\n }",
"public function glitchDump(): iterable\n {\n yield 'text' => $this->toString();\n }",
"public function glitchDump(): iterable\n {\n $def = $this->getFieldSchemaString();\n $def .= '(' . $this->_targetUnitId;\n\n if ($this->_targetField) {\n $def .= ' -> ' . $this->_targetField;\n }\n\n $def .= ')';\n\n yield 'definition' => $def;\n }",
"public function toString() {\n $buff = \"{\".$this->getClassName().\"}-->\\n\";\n foreach ($this->getParameters() as $name=>$value) {\n $buff .= \"[{$name}=\";\n if (is_array($value)) {\n $buff .= \"\\n\\t[Array:\\n\";\n foreach ($value as $k=>$v) {\n $buff .= \"\\t\\t[{$k}=\";\n if (is_array($v)) {\n $buff .= \"[Array]\\n\";\n continue;\n }\n if (strlen($v)>75) {\n $buff .= substr(str_replace(\"\",\"\\n\",$v),0,75) .\" .....]\\n\";\n } else {\n $buff .= \"$v]\\n\";\n }\n }\n $buff .= \"]]\\n\";\n } else {\n $buff .= \"{$value}]\";\n }\n }\n return $buff;\n }",
"public function toString() {\n\t\treturn sprintf(\"%-40s ; %s || ID %03d CID %03d %s\",$this->getASM(),$this->commentstr,$this->index,$this->codeIndex,$this->getMetaString());\n\t}",
"public function __toString()\n\t{\n\t\t$str = '';\n\t\tforeach ($this->chunks as $chunk)\n\t\t{\n\t\t\tif ($chunk instanceof Cotpl_var)\n\t\t\t{\n\t\t\t\t$str .= $chunk->__toString();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$str .= $chunk;\n\t\t\t}\n\t\t}\n\t\treturn $str . \"\\n\";\n\t}",
"function deferdump() {\r\n\t\t\t$args = func_get_args();\r\n\t\t\t$times = array_shift($args);\r\n\t\t\tif (!is_array($times)) {\r\n\t\t\t\t$times = array($times);\r\n\t\t\t}\r\n\t\t\tforeach ($times as $time) {\r\n\t\t\t\tif ($time == PDebug::$DEFER_COUNT) {\r\n\t\t\t\t\tPDebug::doOutput(PDebug::dump($args));\r\n\t\t\t\t\tPDebug::flush();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tPDebug::$DEFER_COUNT++;\r\n\t\t}",
"public function getSequence()\n {\n return $this->sequence;\n }",
"public function getSequence()\n {\n return $this->sequence;\n }",
"function preShow( $arr, $returnAsString=false ) {\n $ret = '<pre>' . print_r($arr, true) . '</pre>';\n if ($returnAsString)\n return $ret;\n else\n echo $ret; \n }",
"function h($par)\n{\n // pretty result in browser \n ?>\n <pre>\n <?php print_r($par) ?>\n </pre>\n <?php\n}",
"function _dump($input, $pre=true){\n\t\tif($pre) echo '<pre>';\n\t\tvar_dump($input);\n\t\tif($pre) echo '</pre>';\n\t}",
"public function glitchDump(): iterable\n {\n yield 'properties' => [\n '*prevText' => $this->_prevText,\n '*nextText' => $this->_nextText,\n '*renderDetails' => $this->_renderDetails,\n '*pageData' => $this->_pageData,\n '%tag' => $this->getTag()\n ];\n }",
"function pr($text, $wrap_pre = false)\n{\n if (!$wrap_pre)\n print_r($text);\n else\n {\n echo \"<pre>\";\n print_r($text);\n echo \"</pre>\";\n }\n}",
"public function laterStateDescription(int $sequence): string {\n if ($this->value->entity->field_sequence->value <= $sequence) {\n return '';\n }\n if ($this->value->entity->field_text_id->value === 'final_board_decision') {\n $decisions = [];\n foreach ($this->decisions as $state_decision) {\n $term = Term::load($state_decision->decision);\n $decisions[] = $term->name->value;\n }\n if (empty($decisions)) {\n return 'Editorial Board Decision (NO DECISION RECORDED)';\n }\n sort($decisions);\n return 'Editorial Board Decision (' . implode('; ', $decisions) . ')';\n }\n if ($this->value->entity->field_text_id->value === 'on_agenda') {\n $meetings = [];\n foreach ($this->meetings as $meeting) {\n $name = $meeting->entity->name->value;\n $date = substr($meeting->entity->dates->value, 0, 10);\n $meetings[] = \"$name - $date\";\n }\n if (empty($meetings)) {\n return 'On Agenda (NO MEETINGS RECORDED)';\n }\n return 'On Agenda (' . implode('; ', $meetings) . ')';\n }\n $name = $this->value->entity->name->value;\n return \"Board Manager Action ($name)\";\n }",
"function var_dump_pre($tab)\n{\n echo '<pre>';\n var_dump($tab);\n echo '</pre>';\n}"
] | [
"0.79730386",
"0.5150951",
"0.5057146",
"0.49911213",
"0.4954482",
"0.49475557",
"0.48861852",
"0.4853095",
"0.482599",
"0.4739494",
"0.4727067",
"0.4725052",
"0.472217",
"0.47155848",
"0.47081193",
"0.47081193",
"0.4707504",
"0.47040898",
"0.46891072",
"0.46836972",
"0.467878",
"0.4671074",
"0.4671074",
"0.4666615",
"0.46660212",
"0.4665443",
"0.46647248",
"0.4664414",
"0.46492827",
"0.46477848"
] | 0.6791955 | 1 |
Overriding Versioning's delete_history because it's a special case with pools posts. | protected function delete_history()
{
$ids = self::connection()->selectValues("SELECT DISTINCT history_id FROM history_changes WHERE table_name = 'pools_posts' AND remote_id = ?", $this->id);
Rails::log('IDS: ', $ids);
$sql = "DELETE FROM histories WHERE id IN (?)";
self::connection()->executeSql($sql, $ids);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function historyDelete($id)\n {\n return $this->getApi()\n ->methodDelete()\n ->execute(\"history/process-instance/{$id}\");\n }",
"protected function removeGarbageHistoryOperation () {\n $this->dbInstance->query('DELETE a FROM operations a LEFT JOIN (SELECT id FROM operations ORDER BY id DESC LIMIT '. self::MAX_HISTORY_OPERATIONS . ') b ON a.id = b.id WHERE b.id is null;');\n }",
"private function history_purge()\n {\n $log_data['runtime_jobname'] = __FUNCTION__;\n $log_data['start'] = $this->get_date();\n\n echo \"** HISTORY PURGE\\n\";\n $this->load->model('edition_model');\n $this->load->model('history_model');\n\n // remove hisroty records older than a year\n $log_data['runtime_count'] = $this->history_model->remove_old_history(date(\"Y-m-d\", strtotime(\"-1 year\")));\n\n // LOG RUNTIME DATA\n $log_data['end'] = $this->get_date();\n $this->log_runtime($log_data);\n\n echo \"History purge complete with \" . $log_data['runtime_count'] . \" records removed - \" . date(\"Y-m-d H:i:s\") . \"\\n\\r\";\n }",
"protected function removeHistory($version)\n\t{\n\t\t$this->db->table($this->table)\n\t\t\t\t->where('version', $version)\n\t\t\t\t->where('group', $this->group)\n\t\t\t\t->where('namespace', $this->namespace)\n\t\t\t\t->delete();\n\t\tif (is_cli())\n\t\t{\n\t\t\t$this->cliMessages[] = \"\\t\" . CLI::color(lang('Migrations.removed'), 'yellow') . \"($this->namespace) \" . $version . '_' . $this->name;\n\t\t}\n\t}",
"public function onDeleteAllRevisionsByModel()\n {\n if ($this->readOnly) {\n Flash::error(Lang::get('samuell.revisions::lang.revision.read_only_error'));\n return;\n }\n\n if ($id = $this->model->id) {\n Revision::where('revisionable_id', $id)->delete();\n\n Flash::success(Lang::get('samuell.revisions::lang.messages.all_successfully_deleted'));\n } else {\n Flash::warning(Lang::get('samuell.revisions::lang.messages.model_not_found'));\n }\n\n $this->prepareVars();\n\n return [\n '#RevisionHistory-formHistory-history' => $this->makePartial('revisionhistory-container')\n ];\n }",
"function hook_call_center_delete(CallCenter $call_center) {\n db_delete('mytable')\n ->condition('pid', entity_id('call_center', $call_center))\n ->execute();\n}",
"public function preRemove(LifecycleEventArgs $args) : void {\n $this->saveHistory($args, 'delete');\n }",
"public function erase_history()\n {\n if (false === $this->_history) {\n return;\n }\n $this->_history = [];\n }",
"public function deleted(Post $post)\n {\n //\n }",
"public function deleted(Post $post)\n {\n //\n }",
"public function delete()\n\t{\n\t\tDB::delete('posts')->where('id', '=', $this->get('id'))->execute($this->_db);\n\t}",
"public function deleted(Post $post)\n {\n Circle::query()->where('id',$post->circle_id)->decrement('post_count');\n }",
"function post_deleteFromDB() {\r\n $this->updateContactInformation();\r\n \r\n // logs\r\n $changes[0] = 0;\r\n $changes[1] = $this->getStringNameForHistory();\r\n $changes[2] = \"\";\r\n Log::history($this->fields[\"items_id\"], $this->fields[\"itemtype\"], $changes, __CLASS__, Log::HISTORY_DELETE_SUBITEM);\r\n }",
"public function delete() {}",
"public function delete(PropelPDO $con = null)\n\t{\n\t\tif ($this->isDeleted()) {\n\t\t\tthrow new PropelException(\"This object has already been deleted.\");\n\t\t}\n\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(SubmissionHistoryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);\n\t\t}\n\t\t\n\t\t$con->beginTransaction();\n\t\ttry {\n\t\t\t$ret = $this->preDelete($con);\n\t\t\t// symfony_behaviors behavior\n\t\t\tforeach (sfMixer::getCallables('BaseSubmissionHistory:delete:pre') as $callable)\n\t\t\t{\n\t\t\t if (call_user_func($callable, $this, $con))\n\t\t\t {\n\t\t\t $con->commit();\n\t\t\t\n\t\t\t return;\n\t\t\t }\n\t\t\t}\n\n\t\t\tif ($ret) {\n\t\t\t\tSubmissionHistoryPeer::doDelete($this, $con);\n\t\t\t\t$this->postDelete($con);\n\t\t\t\t// symfony_behaviors behavior\n\t\t\t\tforeach (sfMixer::getCallables('BaseSubmissionHistory:delete:post') as $callable)\n\t\t\t\t{\n\t\t\t\t call_user_func($callable, $this, $con);\n\t\t\t\t}\n\n\t\t\t\t$this->setDeleted(true);\n\t\t\t\t$con->commit();\n\t\t\t} else {\n\t\t\t\t$con->commit();\n\t\t\t}\n\t\t} catch (PropelException $e) {\n\t\t\t$con->rollBack();\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function truncateHistory(): void {\n $this->initUliCMS();\n\n Database::truncateTable('history');\n }",
"public function on_delete() {}",
"public function clearHistory()\n {\n\n $sql = \"DELETE FROM sb_TalkBox_mem\" . $this->room . \" WHERE id > 1;\";\n $result = $this->db->query($sql);\n\n $sql = \"DELETE FROM sb_TalkBox_\" . $this->room . \" WHERE id > 1;\";\n $result = $this->db->query($sql);\n }",
"protected abstract function delete();",
"public function destroy(RestHistory $RestHistory)\n {\n //\n }",
"public function onDeleteRevisionById()\n {\n if ($this->readOnly) {\n Flash::error(Lang::get('samuell.revisions::lang.revision.read_only_error'));\n return;\n }\n\n if ($revision = Revision::where('id', input('revision_id'))->first()) {\n Db::table('system_revisions')->where([\n ['revisionable_id', $revision->revisionable_id],\n ['created_at', $revision->created_at],\n ])->delete();\n Flash::success(Lang::get('samuell.revisions::lang.messages.successfully_deleted'));\n } else {\n Flash::warning(Lang::get('samuell.revisions::lang.messages.revision_not_found'));\n }\n\n $this->prepareVars();\n\n return [\n '#RevisionHistory-formHistory-history' => $this->makePartial('revisionhistory-container')\n ];\n }",
"public function afterDelete(): void\n {\n }",
"function meta_delete_hashtag(string $hashtag)\n{\n $query_delete = \"DELETE FROM `Hashtags` WHERE `Text`=? AND `RefrenceCount`=1\";\n $query_decrement = \"UPDATE `Hashtags` SET `RefrenceCount`=(`RefrenceCount`-1) WHERE `Text`=?\";\n $conn = meta_open_db();\n if ($stmt1 = $conn->prepare($query_delete))\n {\n $stmt1->bind_param(\"s\", $hashtag);\n $stmt1->execute();\n $stmt1->close();\n }\n if ($stmt2 = $conn->prepare($query_decrement))\n {\n $stmt2->bind_param(\"s\", $hashtag);\n $stmt2->execute();\n $stmt2->close();\n }\n $conn->close();\n}",
"public function login_history_delete($data)\n {\n\n $required = array(\n 'id' => 'Id not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n $model = $this->di['db']->getExistingModelById('ActivityClientHistory', $data['id']);\n\n if(!$model instanceof \\Model_ActivityClientHistory) {\n throw new \\Box_Exception('Event not found');\n }\n $this->di['db']->trash($model);\n return true;\n }",
"protected function afterDelete()\n {\n }",
"public function deleteAction()\n {\n $version = $this->params()->fromRoute('version');\n $this->commandService->migrationDelete($version);\n }",
"public function testRemovePayloadHistoryFeature()\n {\n $payloadHistory = factory(PayloadHistory::class)->create(['params' => 'test remove payload history']);\n factory(MessageHistory::class, 5)->create(['payload_history_id' => $payloadHistory->id]);\n\n $user = $payloadHistory->webhook->user;\n $this->actingAs($user);\n\n $response = $this->delete(route('history.destroy', $payloadHistory));\n $this->assertDatabaseMissing('payload_histories', [\n 'id' => $payloadHistory->id,\n 'params' => 'test remove payload history',\n 'deleted_at' => NULL,\n ]);\n $this->assertDatabaseMissing('message_histories', ['payload_history_id' => $payloadHistory->id, 'deleted_at' => NULL]);\n $response->assertRedirect(route('history.index'));\n $response->assertStatus(302);\n }",
"public function delete();",
"public function delete();",
"public function delete();"
] | [
"0.60677105",
"0.5962558",
"0.5956206",
"0.5891121",
"0.5657226",
"0.55604756",
"0.55268466",
"0.55251443",
"0.5522208",
"0.5522208",
"0.55159897",
"0.5509109",
"0.54931766",
"0.5476017",
"0.5465044",
"0.5399116",
"0.5395187",
"0.538526",
"0.5373373",
"0.5363654",
"0.5357798",
"0.5354691",
"0.53530234",
"0.53526676",
"0.53525805",
"0.53522027",
"0.5338548",
"0.5330326",
"0.5330326",
"0.5330326"
] | 0.78023314 | 0 |
Deletes a $num project(s). | private function deleteProjects($num)
{
$entries = Project::all();
$toDelete = min($num, count($entries));
for ($i = 0; $i < $toDelete; $i++) {
$entries[$i]->delete();
}
$this->line('Deleted ' . $toDelete . ' projects.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function DeleteProjects() \r\n\t{\r\n\t\t// Get timestamp of PROJECT_DELETE_DAY_LAG days ago\r\n\t\t$thirtyDaysAgo = date(\"Y-m-d H:i:s\", mktime(date(\"H\"),date(\"i\"),date(\"s\"),date(\"m\"),date(\"d\")-PROJECT_DELETE_DAY_LAG,date(\"Y\")));\r\n\t\t// Get all projects scheduled for deletion\r\n\t\t$sql = \"select project_id from redcap_projects where date_deleted is not null \r\n\t\t\t\tand date_deleted != '0000-00-00 00:00:00' and date_deleted <= '$thirtyDaysAgo'\";\r\n\t\t$q = db_query($sql);\r\n\t\t$numProjDeleted = db_num_rows($q);\r\n\t\twhile ($row = db_fetch_assoc($q)) \r\n\t\t{\r\n\t\t\t// Permanently delete the project from all db tables right now (as opposed to flagging it for deletion later)\r\n\t\t\tdeleteProjectNow($row['project_id']);\r\n\t\t}\r\n\t\tdb_free_result($q);\r\n\t\t// Set cron job message\r\n\t\tif ($numProjDeleted > 0) {\r\n\t\t\t$GLOBALS['redcapCronJobReturnMsg'] = \"$numProjDeleted projects were deleted\";\r\n\t\t}\r\n\t}",
"function delete_project() {\n $res = false;\n if ($this->request_id > 0) {\n $ok = true;\n\n // All in a single tranny..\n $qry = new PgQuery(\"BEGIN\");\n $qry->Exec(\"qa_project::delete_project\");\n\n // Remove all the subordinate request records for each project step..\n $request_table_suffixes = array(\n \"action\", \"allocated\", \"attachment\", \"history\", \"interested\",\n \"note\", \"quote\", \"status\", \"tag\", \"timesheet\", \"request\"\n );\n foreach ($this->qa_process->qa_steps as $qa_step_id => $qastep) {\n // Delete all subordinate records..\n foreach($request_table_suffixes as $suffix) {\n $qry = new PgQuery(\"DELETE FROM request_$suffix WHERE request_id=$qastep->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n if ($ok === false) {\n break;\n }\n }\n }\n\n if ($ok) {\n $qry = new PgQuery(\"DELETE FROM qa_project_approval WHERE project_id=$this->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n }\n if ($ok) {\n $qry = new PgQuery(\"DELETE FROM qa_project_step_approval WHERE project_id=$this->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n }\n if ($ok) {\n $qry = new PgQuery(\"DELETE FROM qa_project_step WHERE project_id=$this->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n }\n if ($ok) {\n $qry = new PgQuery(\"DELETE FROM request_project WHERE request_id=$this->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n }\n\n // Delete step request recs..\n foreach ($this->qa_process->qa_steps as $qa_step_id => $qastep) {\n if ($ok) {\n $qry = new PgQuery(\"DELETE FROM request WHERE request_id=$qastep->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n }\n }\n\n // Now delete the WRMS project master records..\n foreach($request_table_suffixes as $suffix) {\n if ($ok) {\n $qry = new PgQuery(\"DELETE FROM request_$suffix WHERE request_id=$this->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n }\n }\n // Then delete the main record..\n if ($ok) {\n $qry = new PgQuery(\"DELETE FROM request WHERE request_id=$this->request_id\");\n $ok = $qry->Exec(\"qa_project::delete_project\");\n }\n\n // Commit or rollback..\n $qry = new PgQuery(($ok ? \"COMMIT;\" : \"ROLLBACK;\"));\n $res = $qry->Exec(\"qa_project::delete_project\");\n }\n return $res;\n }",
"public function removeAllGroup($num_project){\n $this->getDB(); \n $query = \"DELETE FROM project_group WHERE num_project =? \";\n $this->execQuery($query, [$num_project]);\n }",
"public function destroy(Projects $projects)\n {\n //\n }",
"function project_delete_multiple(array $ids) {\n entity_delete_multiple('project', $ids);\n}",
"function deleteproject()\r\n\t{\r\n\t\t// Get/Create the model\r\n\t\t$model = & $this->getModel('Project', 'JPackageDirModel');\r\n\r\n\t\tif ($model->deleteproject()) {\r\n\t\t\t$msg = JText::_( 'Project Deleted' );\r\n\t\t} else {\r\n\t\t\t$msg = JText::_( 'Error Deleting Project(s) - ' . $model->getError() );\r\n\t\t}\r\n\r\n\t\t$option = JRequest::getVar('option', '', '', 'string');\r\n\t\t$project = JRequest::getVar('project', '', '', 'string');\r\n\t\t$category = JRequest::getVar('category', '', '', 'string');\r\n\t\t$owner = JRequest::getVar('owner', '', '', 'string');\r\n\t\t$sname = JRequest::getVar('sname', '', '', 'string');\r\n\r\n\t\t// Jump to proper page\r\n\t\t$this->setRedirect( \"index.php?option=$option&task=projects&project=$project&category=$category&owner=$owner&sname=$sname\" , $msg );\r\n\t}",
"#[Route(path: '/delete-multiple-projects/', name: 'translationalresearch_projects_multiple_delete', methods: ['GET'])]\n public function deleteMultipleProjectsAction(Request $request)\n {\n if( false === $this->isGranted('ROLE_PLATFORM_DEPUTY_ADMIN') ) {\n return $this->redirect( $this->generateUrl($this->getParameter('translationalresearch.sitename').'-nopermission') );\n }\n\n set_time_limit(600); //600 seconds => 10 min\n ini_set('memory_limit', '2048M');\n\n $em = $this->getDoctrine()->getManager();\n\n //process.py script: replaced namespace by ::class: ['AppTranslationalResearchBundle:Project'] by [Project::class]\n $repository = $em->getRepository(Project::class);\n $dql = $repository->createQueryBuilder(\"project\");\n $dql->select('project');\n\n $dql->leftJoin('project.principalInvestigators','principalInvestigators');\n\n $dql->andWhere(\"project.exportId IS NOT NULL\");\n //$dql->andWhere(\"project.oid IS NULL\");\n //$dql->andWhere(\"principalInvestigators.id IS NULL\");\n\n $query = $dql->getQuery();\n\n $projects = $query->getResult();\n echo \"projects count=\".count($projects).\"<br>\";\n\n foreach($projects as $project) {\n $this->deleteProject($project);\n }\n\n exit(\"EOF deleteMultipleProjectsAction\");\n return $this->redirectToRoute('translationalresearch_project_index');\n }",
"function del_project($id) {\n\t\t$query = \"delete from projectinfo \";\n\t\t$query .= \"where project_id = '$id' \";\n\t\t$result = mysql_query($query)\n\t\t\tor die('Deleting projectinfo query failed: ' . mysql_error());\n\t}",
"public function delete($idProject){\n\t\t$q = $this->pdo->prepare(\"DELETE FROM projet WHERE id = :id\");\n\t\t$q->bindValue(':id', $idProject, PDO::PARAM_INT);\n\t\t$q->execute();\n\t}",
"public function deleteByProject($project_id){\n return $this->where('project_id', $project_id)->delete();\n }",
"public function deleteprojects(){\n \n if (func_num_args() > 0):\n $projectid = func_get_arg(0);\n try {\n \n $sql = 'DELETE projects, projectlikes,projectcomments,projectcommentlikes\n FROM projects\n LEFT JOIN projectlikes ON projects.project_id = projectlikes.project_id\n LEFT JOIN projectcomments ON projects.project_id = projectcomments.project_id\n LEFT JOIN projectcommentlikes ON projects.project_id = projectcommentlikes.project_id\nWHERE projects.project_id = '.$projectid.'';\n $responseid = $this->getAdapter()->query($sql);\n } catch (Exception $e) {\n throw new Exception($e);\n }\n return $projectid;\n else:\n throw new Exception('Argument Not Passed');\n endif; \n\n \n}",
"function project_delete($id) {\n entity_delete('project', $id);\n}",
"public function del($user_id,$project_id);",
"function delete_project($file_id)\n {\n $file_user = new File_User(true);\n $file_user->delete_file_user_by_file($file_id);\n \n $phase_subtask = new Phase_Subtask(true);\n $phase_subtask->delete_phase_subtask_by_file($file_id);\n \n $file_phase = new File_Phase(true);\n $file_phase->delete_file_phases_by_file($file_id);\n \n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $file_id\n ));\n \n parent::delete('i', $parameter_array);\n }",
"public function Delete(){\n $revised_array = array();\n foreach($this->projects as $project=>$data){\n if($data['path']!=$this->path){\n $revised_array[] = array(\"name\"=>$data['name'],\"path\"=>$data['path']);\n }\n }\n // Save array back to JSON\n saveJSON('projects.php',$revised_array);\n // Response\n echo formatJSEND(\"success\",null);\n }",
"public function deleted(Project $project)\n {\n //\n }",
"public function delete($project_id = '') {\n\n //validations\n if (!is_numeric($project_id)) {\n Log::error(\"validation error - invalid params\", ['process' => '[ProjectManagerRepository]', config('app.debug_ref'), 'function' => __function__, 'file' => basename(__FILE__), 'line' => __line__, 'path' => __file__]);\n return false;\n }\n\n $query = $this->manager->newQuery();\n $query->where('projectsmanager_projectid', '=', $project_id);\n $query->delete();\n }",
"function deleteProject (PDO $db, int $id) : void {\n\t$query = $db->prepare(\"UPDATE `projects` SET `deleted` = 1 WHERE `id` = :id;\");\n\t$query->execute(['id'=>$id]);\n\n\theader(\"Location: dashboard.php\");\n}",
"public function delete($projectId){\n $user = Session::get('user'); \n\n $isOwner = Project::userIsOwner($user['id'], $projectId);\n\n // verify if user on session is owner of project\n if(empty($isOwner)) {\n\n return Redirect::to(URL::action('DashboardController@index')); \n\n }else{\n\n // get project iterations\n $iterations = Project::getProjectIterations($user['id'], $projectId);\n\n Project::deleteCategoriesActivity($projectId); \n\n if(!empty($iterations)){\n\n foreach($iterations as $iteration){\n\n // delete project activities\n $activities = Project::getIterationActivities($iteration['id']); \n \n if(!empty($activities)){\n\n foreach($activities as $activity){\n Activity::deleteActivityComment($activity['activity_id']);\n Activity::deleteProjectActivity($activity['activity_id'], $iteration['id']);\n Activity::deleteActivity($activity['activity_id']); \n \n }\n\n } \n\n }\n }\n\n // get project artefacts\n $projectArtefacts = (array) Project::getProjectArtefacts($projectId, 'ALL'); \n\n if(!empty($projectArtefacts)){\n\n foreach( $projectArtefacts as $index => $projectArtefact){\n\n switch($projectArtefact['friendly_url']) {\n\n case Config::get('constant.artefact.heuristic_evaluation'):\n\n $artefactList = HeuristicEvaluation::getEvaluationDataByProject($projectId); \n\n if(!empty($artefactList)){\n\n // delete artefact elements\n foreach($artefactList as $artefactValue){\n\n if(!empty($artefactValue['elements'])){\n\n foreach($artefactValue['elements'] as $element){\n\n HeuristicEvaluation::deleteElement($element['id']);\n\n } \n }\n }\n\n // delete artefact info\n foreach($artefactList as $artefact){\n\n HeuristicEvaluation::_delete($artefact['id']);\n\n } \n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n }else{\n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n } \n\n break;\n\n case Config::get('constant.artefact.storm_ideas'):\n\n $artefactList = StormIdeas::enumerate($projectId); \n \n if(!empty($artefactList)){\n\n // delete artefact \n foreach($artefactList as $artefactValue){\n\n if(!empty($artefactValue)){\n\n StormIdeas::deleteStormIdeas($artefactValue['id']);\n\n } \n \n }\n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n }else{\n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n } \n\n break; \n\n case Config::get('constant.artefact.probe'):\n\n $artefactList = Probe::getProbeElementsByProject($projectId); \n\n if(!empty($artefactList)){\n\n // delete artefact elements\n foreach($artefactList as $artefactValue){\n\n if(!empty($artefactValue['elements'])){\n\n foreach($artefactValue['elements'] as $element){\n\n Probe::deleteQuestion($element['id']);\n\n } \n }\n }\n\n // delete artefact info\n foreach($artefactList as $artefact){\n\n Probe::_delete($artefact['id']);\n\n } \n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n }else{\n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n } \n\n break;\n\n case Config::get('constant.artefact.style_guide'):\n\n $artefactList = StyleGuide::getStyleGuideByProject($projectId); \n \n if(!empty($artefactList)){\n\n // delete artefact elements\n foreach($artefactList as $artefactValue){\n\n if(!empty($artefactValue['colors'])){\n\n foreach($artefactValue['colors'] as $color){\n\n StyleGuide::deleteColor($color['id']);\n\n } \n }\n\n if(!empty($artefactValue['fonts'])){\n\n foreach($artefactValue['fonts'] as $font){\n\n StyleGuide::deleteFont($font['id']);\n\n } \n }\n } \n\n // delete artefact info\n foreach($artefactList as $artefact){\n\n StyleGuide::deleteStyleGuide($artefact['id']);\n\n } \n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n }else{\n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n } \n\n break;\n\n case Config::get('constant.artefact.existing_system'):\n\n $artefactList = ExistingSystem::getExistingSystemDataByProject($projectId); \n\n if(!empty($artefactList)){\n\n // delete artefact elements\n foreach($artefactList as $artefactValue){\n\n if(!empty($artefactValue['elements'])){\n\n foreach($artefactValue['elements'] as $element){\n\n ExistingSystem::deleteElement($element['id']);\n\n } \n }\n }\n\n // delete artefact info\n foreach($artefactList as $artefact){\n\n ExistingSystem::_delete($artefact['id']);\n\n } \n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n }else{\n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n } \n\n break;\n\n case Config::get('constant.artefact.checklist'):\n\n $artefactList = Checklist::getChecklistsByProject($projectId);\n\n if(!empty($artefactList)){\n\n // delete artefact elements\n foreach($artefactList as $artefactValue){\n\n if(!empty($artefactValue['elements'])){\n\n foreach($artefactValue['elements'] as $element){\n\n Checklist::deleteChecklitsElement($element['id']);\n\n }\n } \n }\n\n // delete artefact info\n foreach($artefactList as $artefact){\n\n Checklist::deleteChecklist($artefact['id']);\n\n } \n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n }else{\n\n //delete relation artefact - project\n Artefact::deleteProjectArtefact($projectArtefact['id'], $projectId);\n\n $deletedData = TRUE; \n\n } \n\n break;\n } \n\n\n // delete iterations info\n if(!empty($iterations)){\n foreach($iterations as $iteration){\n\n // delete user invitations\n Iteration::deleteUsers($iteration['id']); \n Iteration::deleteIterationInvitations($iteration['id']);\n Iteration::_delete($iteration['id']); \n\n }\n }\n\n\n // delete project info \n Project::_delete($projectId); \n \n \n }\n\n }\n\n }\n\n Session::flash('success_message', 'Se ha eliminado el proyecto correctamente'); \n\n return Redirect::to(URL::action('DashboardController@index'));\n }",
"public function actionDeleteProject($id, $folio) {\n\n\t\tif ($folio != null) {\n\t\t\t$command = Yii::app()->db->createCommand();\n\t\t\n $command->delete('projects_coworkers', 'id_project=:id_project', array(':id_project'=>$id));\n $command->delete('projects_docs', 'id_project=:id_project', array(':id_project'=>$id));\n $command->delete('projects_followups', 'id_project=:id_project', array(':id_project'=>$id));\n \n\t\t\t$model = Projects::model()->findByPk($id)->delete();\n\t\t}else{\n\t\t\t$model = Sponsorship::model()->findByPk($id)->delete();\n\t\t}\n\t\t\n\n\t\t\tif (!isset($_GET['ajax'])) {\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('adminProjects'));\n\t\t}\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t}",
"function delete()\r\n\t\t{ \r\n\t\t $projectID = $this->input->post('id');\r\n\t\t if(isset($projectID) && !empty($projectID))\r\n\t\t {\r\n\t\t \t$projectID=$this->data['projectID']=$this->ProjectModel->get(array('projectID'=>$projectID));\r\n\t\t \t$delete=$this->data['delete']=$this->ProjectModel->delete(array('projectID'=>$this->input->post('id')));\r\n\t\t $projectDelete=$projectID[0]->projectID;\r\n\t\t $this->projectGetValue($projectDelete);\r\n\t\t }\r\n\t\t}",
"public function delete(){\n \n /**\n * Project Files Delete\n */\n if(is_dir(OctoSettings::get('projects_path').'/'.$this->project->directory)){\n $commands = [\n 'cd '.OctoSettings::get('projects_path'),\n 'rm -rf '.$this->project->directory,\n ];\n\n SSH::run($commands);\n }else Flash::info(\"Directory does not exists\");\n \n /**\n * Database Delete\n */\n $query = DB::connection('engine');\n\n if(!$query->statement(\"DROP DATABASE IF EXISTS \".$this->project->database))\n Flash::info(\"The database could not be removed\");\n\n if($query->table('user')->where('user', $this->project->db_username)->get()){\n if(!$query->statement(\"DROP USER '\".$this->project->db_username.\"'@'\".$this->project->db_host.\"'\"))\n Flash::info(\"The User of database could not be removed\");\n }\n\n if($this->Project){\n $project = Project::find($this->Project->id);\n $project->delete();\n\n DB::disconnect('engine');\n return true;\n }else Flash::error(\"The Project could not be removed\");\n }",
"public function massDestroy(Request $request)\n {\n if (!Gate::allows('projects_manage')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Project::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }",
"public function deleteMyProjectAction()\n {\n \t$result = Extended\\project::deleteProject( $this->getRequest()->getParam(\"id\"), Auth_UserAdapter::getIdentity()->getId() );\n \tif($result)\n \t\techo Zend_Json::encode($result);\n \tdie;\n }",
"public function deletePasses()\n {\n $project = factory(Project::class)->create();\n\n $response = $this->withHeaders([\n 'X-Header' => 'Value',\n ])->json(\n 'POST',\n '/api/project/delete',\n ['id' => $project->id]\n );\n\n $deletedProject = Project::find($project->id);\n\n $this->assertEquals(null, $deletedProject);\n $response->assertStatus(200);\n }",
"public function delete_project($id) {\n $data = array(\n 'deleted' => 1,\n );\n\n\t\t//set project deleted flag to 1\n $this->db->where('id', $id);\n $query = $this->db->update('projects', $data);\n \n if ($query) {\n \t//set sketch deleted flag to 1 for every sketch of the project\n $this->db->where('projects_id', $id);\n $query = $this->db->update('sketches', $data);\n if ($query) {\n \treturn true;\n } else {\n \treturn false;\n }\n } else {\n return false;\n }\n }",
"public function destroy(Project $project)\n {\n //\n }",
"public function destroy(Project $project)\n {\n //\n }",
"public function destroy(Project $project)\n {\n //\n }",
"public function destroy(Project $project)\n {\n //\n }"
] | [
"0.6725982",
"0.65615076",
"0.65184474",
"0.6395352",
"0.63826233",
"0.6314243",
"0.6310169",
"0.62287337",
"0.6217181",
"0.6199538",
"0.614433",
"0.6135496",
"0.6048478",
"0.60357076",
"0.60115695",
"0.6007222",
"0.599562",
"0.5965984",
"0.59655464",
"0.5934609",
"0.591705",
"0.5914456",
"0.5861399",
"0.5824166",
"0.5822243",
"0.58207744",
"0.57944137",
"0.57944137",
"0.57944137",
"0.57944137"
] | 0.9039016 | 0 |
GETNOAAFILE function Developed by TNETWeather.com Returns an array of the contents of the specified filename Array contains days from 1 31 (or less if the month has less) and the values: Day Mean Temp High Temp Time of High Temp Low Temp Time of Low Temp Hot Degree Day Cold Degree Day Rain Avg Wind Speed High Wind Time High Wind Dom Wind Direction | function getnoaafile ($filename) {
global $SITE;
$rawdata = array();
$fd = @fopen($filename,'r');
$startdt = 0;
if ( $fd ) {
while ( !feof($fd) ) {
// Get one line of data
$gotdat = trim ( fgets($fd,8192) );
if ($startdt == 1 ) {
if ( strpos ($gotdat, "--------------" ) !== FALSE ){
$startdt = 2;
} else {
$foundline = preg_split("/[\n\r\t ]+/", $gotdat );
$rawdata[intval ($foundline[0]) -1 ] = $foundline;
}
}
if ($startdt == 0 ) {
if ( strpos ($gotdat, "--------------" ) !== FALSE ){
$startdt = 1;
}
}
}
// Close the file we are done getting data
fclose($fd);
}
return($rawdata);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFileArray();",
"function fileinfo($filename) {\n\t$file = array('filename' => '', 'extension' => '');\n\t// $pos: az utolsó . karakter pozíciója, vagy FALSE\n\t$pos = strrpos($filename, '.');\n\tif ($pos === false) {\n\t\t$file['filename'] = $filename;\n\t} else {\n\t\t// itt a $pos egy számot tartalmaz\n\t\t$file['filename'] = substr($filename, 0, $pos);\n\t\t$file['extension'] = substr($filename, $pos + 1);\n\t}\n\treturn $file;\t\n}",
"function findexts($filename)\r\n {\r\n $filename = strtolower($filename) ;\r\n $exts = explode(\"[/\\\\.]\", $filename) ;\r\n $n = count($exts)-1;\r\n $exts = $exts[$n];\r\n\t $exts = substr($exts, -3, 3);\t //added in\t\t\t\t \r\n\t return $exts;\r\n }",
"function readsunspotdata($aFile, &$aYears, &$aSunspots) {\r\n $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);\r\n \r\n // we use @ to avoid php droping error message.We will deal with errors\r\n \r\n if( $lines === false ) {\r\n throw new JpGraphException('Can not read sunspot data file.');\r\n \r\n // we deal with the error and drop out a warning message\r\n }\r\n \r\n \r\n foreach( $lines as $line => $datarow ) {\r\n //split on any part of the string that is at least 1 whitespace charac.\r\n \r\n $split = preg_split('/[\\s]+/',$datarow);\r\n \r\n // now we have a 2 dim array. split[0] is date.number,split[1] value.0\r\n // first we clean split[0] and assign the first 4 charac. to $ayears\r\n \r\n $aYears[] = substr(trim($split[0]),0,4);\r\n \r\n // now we assign the second dim of split to $asunsponts\r\n \r\n $aSunspots[] = trim($split[1]);\r\n \r\n /* this has been comented out becouse is used only to check out the $split array\r\n foreach ($split as $value) {\r\n echo \"$value <br>\";\r\n}\r\n*/\r\n }\r\n \r\n \r\n}",
"function findexts($filename) \n{ \n $filename = strtolower($filename) ; \n $exts = split(\"[/\\\\.]\", $filename) ; \n $n = count($exts)-1; \n $exts = $exts[$n]; \n return $exts; \n}",
"public function getfile($file) {\n\t\t\tif (file_exists($file)) { // Check if the file exists\n\t\t\t\t$fileArray = file($file);\n\t\t\t}\t\n\t\t\treturn $fileArray; \n\t\t}",
"public static function findexts ($filename) {\n $obj=new Base;\n $filename = strtolower($filename) ; \n $exts = explode(\".\", $filename) ; \n $n = count($exts)-1; \n $exts = $exts[$n]; \n return $exts; \n }",
"public function findexts($filename=\"\")\n\t{\n\t\t$filename = strtolower($filename) ;\n\t\t$exts = split(\"[/\\\\.]\", $filename) ;\n\t\t$n = count($exts)-1;\n\t\t$exts = $exts[$n];\n\t\treturn $exts;\n\t}",
"function findexts($filename) {\n $filename=strtolower($filename);\n $exts=split(\"[/\\\\.]\", $filename);\n $n=count($exts)-1;\n $exts=$exts[$n];\n return $exts;\n }",
"function findexts($filename) {\n $filename=strtolower($filename);\n $exts=split(\"[/\\\\.]\", $filename);\n $n=count($exts)-1;\n $exts=$exts[$n];\n return $exts;\n }",
"function noon_time($nday) {\r\n\t\t//convert longitude to hour value and calculate an approximate time\r\n\t\t$longh=rad2deg(-$this->GEO_longitude)/15;\r\n\t\t$t=$nday+((12-$longh)/24);\r\n\t\t//calculate the sun's mean anomaly\r\n\t\t$m=(0.9856*$t)-3.289;\r\n\t\t// calculate the sun's true longitude\r\n\t\t$slong=$m+(1.916*sin(deg2rad($m)))+(0.020*sin(deg2rad(2*$m)))+282.634;\r\n\t\t$slong=fmod($slong,360);\r\n\t\t//calculate the sun's right ascension\r\n\t\t//$ra=rad2deg(atan(0.91764*tan(deg2rad($slong))));\r\n\t\t$ra = rad2deg(atan2(0.91764*sin(deg2rad($slong)),cos(deg2rad($slong))));\r\n\t\t$ra=fmod($ra,360);\r\n\t\t//right ascension needs to be in the same quadrant as $slong (sun's true longitude)\r\n\t\t//$lquadrant=floor($slong/90)*90;\r\n\t\t//$raquadrant=floor($ra/90)*90;\r\n\t\t//$ra=$ra+($lquadrant-$raquadrant);\r\n\t\t//right ascension value needs to be converted into hours\r\n\t\t$ra=$ra/15;\r\n\t\t//calculate sun's declination\r\n\t\t$decl=rad2deg(asin(0.39782 * sin(deg2rad($slong))));\r\n\t\t//calculate local mean time of noon\r\n\t\t$locmt=$ra-(0.06571*$t)-6.622;\r\n\t\t$this->NT_t = fmod($locmt - $longh,24) + $this->GEO_timeZone;\r\n if ($this->NT_t<0.0) $this->NT_t += 24.0;\r\n if ($this->NT_t>24.0) $this->NT_t -= 24.0;\r\n $this->coaltn = deg2rad(abs(rad2deg($this->GEO_latitude) - $decl));\r\n\t}",
"function attendance_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {\n return null;\n}",
"function findexts ($filename) {\n $filename=strtolower($filename);\n $exts=explode(\"[/\\\\.]\", $filename);\n $n=count($exts)-1;\n $exts=$exts[$n];\n return $exts;\n }",
"function GetData($filename) { \n\t\t$file = fopen($filename, 'r');\n\t\t$MyData = [];\n\t\twhile (($data = fgetcsv($file, 1000, \",\")) !== FALSE) \n\t\t{\n\t\t $MyData[] = $data;\n\t\t}\n\t\tfclose($file);\n\t\treturn $MyData;\n\t}",
"function findexts ($filename) { $filename = strtolower($filename) ; $exts = split(\"[/\\\\.]\", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; }",
"function findexts ($filename) { $filename = strtolower($filename) ; $exts = split(\"[/\\\\.]\", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; }",
"function chargerDICO($file)\n{\n\t$fp = fopen($file, 'r');\n\t\n\twhile( ! feof($fp))\n\t{\n\t\t$tab_mot_vides[] = trim(fgets($fp, 4096));\n\t}\n\t\n\tfclose($fp);\n\t\n\treturn $tab_mot_vides;\n}",
"function findexts($filename) {\n\t$filename = strtolower($filename);\n\t$exts = split(\"[/\\\\.]\", $filename);\n\t$n = count($exts) - 1;\n\t$exts = $exts[$n];\n\treturn $exts;\n}",
"function getNAICShistory($naics)\n {\n\t \n// YQL URL\n $URL=\"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20atom%20where%20url%3D'https%3A%2F%2Fwww.fpds.gov%2Fezsearch%2Ffpdsportal%3Fs%3DFPDSNG.COM%26indexName%3Dawardfull%26templateName%3D1.4.4%26q%3DSIGNED_DATE%253A%5B2013%252F07%252F01%252C2013%252F09%252F30%5D%2B%2BPRINCIPAL_NAICS_CODE%253A%2522\" . $naics . \"%2522%26rss%3D1%26feed%3Datom0.3'&format=json\";\n\t \n $ch = curl_init($URL);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n\n $json = json_decode(curl_exec($ch));\n\n curl_close($ch);\n /*print \"$URL<br><pre style='font-size:%80'>\";\nprint_r($json);\nprint \"</pre>\";*/\n return $json;\n }",
"public function getNaics();",
"protected function getDeltasFilesArray()\n {\n $files = array();\n if (!is_dir($this->_dir)) {\n throw new Exception('Script directory does not exist!');\n }\n $baseDir = realpath($this->_dir);\n $dh = opendir($baseDir);\n $fileChangeNumberPrefix = '';\n while (($file = readdir($dh)) !== false) {\n if (preg_match('[\\d+]', $file, $fileChangeNumberPrefix)) {\n $files[intval($fileChangeNumberPrefix[0])] = $file;\n }\n }\n return $files;\n }",
"function unedtrivial_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {\n return null;\n}",
"function extract_invoice($file,$year='last') {\n\t\tif ($year=='last') {\n\t\t\t$folder = './invoice/'.date('Y');\n\t\t}else{\n\t\t\t$folder = './invoice/'.$year;\n\t\t}\n\t\t$xml = xml2array($folder.'/'.$file.'.xml');\n\t\treturn $xml;\n\t}",
"function lireFichier($filename)\n{\n\tif(file_exists($filename)){\n\t\t$ligne = array();\n\t\t$fp = fopen($filename,\"r\");\n\t\twhile (!feof($fp))\n\t\t{\n\t\t\t$ligne[] = fgets($fp, 8192);\n\t\t}\n\t\treturn $ligne;\n\t}\n\telse{\n\t\texit(\"Aucun fichier trouvé.\");\n\t}\n}",
"function get_file_dates($files,$options) {\n\t\n\t\t$files = $this->get_file_locations($files,$options);\n\t\t\t\t\n\t\tif(!is_array($files)) {\n\t\treturn;\n\t\t}\n\t\t\t\t\n\t\tforeach($files AS $key=>$value) {\n\t\t\tif(file_exists($value['src'])) {\n\t\t\t\t$thedate = filemtime($value['src']);\n\t\t\t\t$dates[] = $thedate;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(is_array($dates)) {\n\t\treturn implode(\".\",$dates);\n\t\t}\t\t\n\t\n\t\n\t}",
"function getFileIdForClosingFile($che=false) \n{\n\t// if $che is set it has to be a date then result is restricted to che < loan_ending_date < today so less results and more perfomance\n\t$today=date('Y-m-d');\n\t$sql=\"SELECT fin_file.file_id From fin_loan,fin_file WHERE loan_ending_date<='$today'\n\tAND fin_file.file_id=fin_loan.file_id\n\tAND file_status=1\";\n\tif($che!=false && $che!=\"NOTDONE\")\n\t$sql=$sql.\" AND loan_ending_date>'$che'\";\n\t$result=dbQuery($sql);\n\t$returnArray=array();\n\t$returnArray=getOpenLoansWithZeroBalance();\n\tif(dbNumRows($result)>0)\n\t{\n\t\t\n\t\t$resultArray=dbResultToArray($result);\n\t\tforeach($resultArray as $re)\n\t\t{\n\t\t\t$returnArray[]=$re[0];\n\t\t}\n\t\treturn $returnArray;\n\t\t}\n\telse\n\treturn $returnArray;\t\n}",
"protected function get_arquivo($nomeArquivo){\n\t\t\t$arquivo = fopen($nomeArquivo,\"r\");\n\t\t\t$conteudo = NULL;\n\t\t\twhile(!feof($arquivo)){\n\t\t\t\t$conteudo = $conteudo.fgets($arquivo);\n\t\t\t}\n\t\t\treturn $conteudo;\n\t\t}",
"public function ticket_read()\r\n{\r\n\t$this_item = & $this->bi_air_ticket; \r\n\r\n // load & read Existing object ---------------------------------------------------- \r\n \r\n $file = \"104730_00.AIR\" ; //ticket name\r\n\r\n $fullpath = \"D:\\\\process tkt\\\\airline\\\\Air_back\\\\tkt\\\\\" . $file ;//ticket path\r\n\t \r\n $file_content = file_get_contents( $fullpath );\r\n\r\n $main_array = explode(\"\\n\", $file_content);\r\n \r\n echo \"the content of main_array <br>\" ;\r\n //echo \"<pre>\" ;\r\n //print_r($main_array) ; \r\n\r\n return $main_array; \r\n}",
"function getFile($filename) \n{\n\tif (is_readable($filename))\n {\n\t\t$fileSize=fileSize($filename);\n\t\t$handle =fopen($filename, 'r');\n\t\t$wordlist = trim(fread($handle, $fileSize));\n\t\tfclose($handle);\n\t\t$words=explode(\"\\n\", $wordlist);\n\t\tforeach ($words as $key => $value) \n\t\t{\n\t\t\t$temparray =explode(\"\\t\", $value);\n\t\t\t$keyedarray[$temparray[0]]=$temparray[1];\n\t\t}\n }\n else\n {\n echo \"File not readable. Please check the file name and path and try again. \\n\";\n }\n return $keyedarray;\n}",
"function get_invoice($year='last'){\n\t\tif ($year=='last') {\n\t\t\t$folder = './invoice/'.date('Y');\n\t\t}else{\n\t\t\t$folder = './invoice/'.$year;\n\t\t}\n\t\t$files = scandir($folder, 1);\n\t\t$files = array_diff($files, array(\"index.php\",'..','.'));\n\t\t$files = array_values($files);\n\t\t$files = str_replace('.xml','',$files);\n\t\treturn $files;\n\t}"
] | [
"0.54105175",
"0.5287857",
"0.5276244",
"0.5186964",
"0.51707405",
"0.51547617",
"0.5154572",
"0.5130947",
"0.5079443",
"0.5079443",
"0.5027628",
"0.50169456",
"0.5010316",
"0.50036806",
"0.5001952",
"0.5001952",
"0.49533656",
"0.49454722",
"0.49187806",
"0.48765206",
"0.48677433",
"0.47713518",
"0.47541422",
"0.47345912",
"0.4706847",
"0.47053257",
"0.4686467",
"0.46820074",
"0.46762353",
"0.4674606"
] | 0.71665156 | 0 |
TODO: Implement getRequestBody() method. | public function getRequestBody() : string
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRequestBody() {\n return 'requestBody';\n }",
"function requestBody() {\r\n $app = \\Slim\\Slim::getInstance();\r\n $request = $app->request();\r\n return json_decode($request->getBody());\r\n }",
"public function getRequestBody()\n {\n return $this->history[0]['request']->getBody()->getContents();\n }",
"public static function get_request_body():string { return self::$request_body; }",
"public function getRequestBody(): string {\r\n\t\treturn file_get_contents ( stream_get_meta_data ( $this->request_body_file_handle ) ['uri'] );\r\n\t}",
"static public function get_req_body() {\r\n\t\tself::$response = file_get_contents(\"php://input\");\r\n\t\treturn self::instantiate();\r\n\t}",
"public function getBody(): RequestBody {\n return $this->body;\n }",
"public function getRequestBody()\n {\n if ($this->getJsonBody()) {\n return $this->getJsonBody();\n }\n\n if ($this->getPostBody()) {\n return $this->getPostBody();\n }\n\n return false;\n }",
"public function getBody()\n {\n if (null === $this->body) {\n $this->body = file_get_contents('php://input');\n }\n return $this->body;\n }",
"static public function getBody()\n {\n switch (Verbs::getVerb()) {\n case v_get:\n if(empty($_GET)){\n return '{}';\n }\n return json_encode($_GET);\n case v_post:\n return file_get_contents('php://input');\n case v_put:\n return file_get_contents('php://input');\n case v_delete:\n return file_get_contents('php://input');\n }\n }",
"public function body()\n\t{\n\t\t// Only get it once\n\t\tif (null === $this->body) {\n\t\t\t$this->body = @file_get_contents('php://input');\n\t\t}\n\t\treturn $this->body;\n\t}",
"private function getRequestBodyContents()\n {\n try {\n $stream = $this->debug->request->getBody();\n $pos = $stream->tell();\n $body = (string) $stream; // __toString() is like getContents(), but without throwing exceptions\n $stream->seek($pos);\n return $body;\n } catch (Exception $e) {\n return '';\n }\n }",
"public function getRawBody();",
"public function getRequest() {}",
"public function getRawRequest () {}",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"abstract public function getRequest();",
"public function getBody();",
"public function getBody();",
"public function getBody();",
"public function getRawBody(): string\n\t\t{\n\t\t\treturn file_get_contents(\"php://input\");\n\t\t}",
"public function getRequestParams(): array\n {\n return $this->body;\n }",
"public function getRawBody()\n {\n if (array_key_exists('raw_body', $this->_cache))\n {\n return $this->_cache['raw_body'];\n }\n\n $body = file_get_contents('php://input');\n\n return ($this->_cache['raw_body'] = trim($body));\n }",
"public function getRequestObject();",
"public function body()\n {\n // Only get it once\n if (null === $this->body) {\n $this->body = @file_get_contents('php://input');\n }\n\n return $this->body;\n }"
] | [
"0.8057458",
"0.7725701",
"0.76417506",
"0.7627472",
"0.7621613",
"0.7490387",
"0.7475136",
"0.7397174",
"0.73475915",
"0.73462105",
"0.73019415",
"0.72479236",
"0.724458",
"0.7153259",
"0.7147143",
"0.713955",
"0.713955",
"0.713955",
"0.713955",
"0.713955",
"0.713955",
"0.7133139",
"0.71282214",
"0.71282214",
"0.71282214",
"0.71166265",
"0.7106569",
"0.7091965",
"0.7086088",
"0.70676214"
] | 0.8121827 | 0 |
Recursively saves a complete ACO tree | public function completeTreeSave($tree, $parent_id = null)
{
if ($parent_id === null) {
$this->truncate();
}
foreach ($tree as $aro => $tre) {
$this->create();
$this->save(array(
'parent_id' => $parent_id,
'alias' => $aro
));
if (is_array($tre)) {
$this->completeTreeSave($tre, $this->id);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveTreeRecursive($arr,$parent_id,$object,$webClass,$hasil){\n// echo \"parent id : \".$parent_id.\"<br>\";\n// echo \"obj id : \".$obj;\n// pr($obj);\n /*if($parent_id == \"non-active-menu\" ||$parent_id == \"active-menu\" )\n return \"\";\n */\n $new = array();\n foreach($arr as $n=>$obj){\n //cek apakah array\n if(is_array($obj)){\n //if yes\n //get the first col as name and the res as children\n $id = $obj[0];\n $explode = explode(\"_\",$id);\n $object->getByID($explode[1]);\n $this->arrIds[] = $explode[1];\n $new[$object->cat_id]['name'] = $object->cat_name;\n //$this->saveToObj($id,$parent_id,$object,$webClass);\n $new[$object->cat_id]['subcategory'] = $this->saveTreeRecursive($obj[1],$id,$object,$webClass,$new);\n// return $new;\n }else{\n $id = $obj;\n $explode = explode(\"_\",$id);\n $object->getByID($explode[1]);\n $this->arrIds[] = $explode[1];\n //kalo bukan array di save\n// $this->saveToObj($id,$parent_id,$object,$webClass);\n $new[$object->cat_id]['name'] = $object->cat_name;\n// return $new;\n }\n }\n return $new;\n }",
"public function saved($node)\n {\n $node->moveToNewParent();\n $node->setDepth();\n }",
"public function saving($node)\n {\n $node->storeNewParent();\n }",
"public function save() {\n $data = array();\n $data['name'] = $this->getName();\n $data['type'] = 'hierarchy';\n $tree = new Warecorp_Tree('zanby_groups__hierarchy_tree');\n $h_id = $tree->add($data);\n $this->setId($h_id);\n $this->addHierarchyRelation();\n $gId = $this->addCustomGrouping();\n $cId1 = $this->addCustomCategory('Custom Level 1', $gId);\n $cId2 = $this->addCustomCategory('Custom Level 2', $cId1);\n $cId3 = $this->addCustomCategory('Custom Level 3', $cId2);\n }",
"public function save()\n {\n $this->beforeParentSave = [];\n $this->afterParentSave = [];\n\n $this->buildQueue($this->root);\n\n if (!$this->processQueue($this->beforeParentSave)) {\n return false;\n }\n\n if (!$this->root->save()) {\n return false;\n }\n\n if (!$this->processQueue($this->afterParentSave)) {\n return false;\n }\n\n return true;\n }",
"public function saveNode(Node $node);",
"public static function save(Ontologyclass &$rootNode)\n {\n foreach(self::$classes as $class){\n if(!$class->hasParent()){\n $class->saveWrapper($rootNode);\n }\n }\n }",
"public function doSave($con = null)\n {\n parent::doSave($con);\n // if a parent has been specified, add/move this node to be the child of that node\n if ($this->getValue('parent'))\n {\n $parent = Doctrine::getTable('BuildgreenCategory')->findOneById($this->getValue('parent'));\n if ($this->isNew())\n {\n $this->getObject()->getNode()->insertAsLastChildOf($parent);\n }\n else\n {\n $this->getObject()->getNode()->moveAsLastChildOf($parent);\n }\n }\n // if no parent was selected, add/move this node to be a new root in the tree\n else\n {\n $categoryTree = Doctrine::getTable('BuildgreenCategory')->getTree();\n if ($this->isNew())\n {\n $categoryTree->createRoot($this->getObject());\n }\n else\n {\n $this->getObject()->getNode()->makeRoot($this->getObject()->getId());\n }\n }\n }",
"public function save(AggregateRoot $aggregate)\n {\n\n }",
"public function saveTree(Model $model, $data, $options = array()) {\n \n $leafModel = isset($options['leaf']) ? $options['leaf'] : null;\n $errors = $this->_validateBranch($model, $data['root'], $leafModel);\n if (!$errors && isset($data['branches'])) {\n foreach ($data['branches'] as $branch) {\n $errors = $this->_validateBranch($model, $branch, $leafModel);\n if ($errors) break;\n }\n }\n if (!$errors && $leafModel) $errors = $this->_validateLeaves($model->$leafModel, $data['leaves']);\n if (!$errors) {\n $this->_saveBranch($model, $data['root'], $leafModel);\n if (isset($data['branches'])) {\n foreach ($data['branches'] as $branch) {\n $this->_saveBranch($model, $branch, $leafModel);\n }\n }\n if ($leafModel) $this->_saveLeaves($model->$leafModel, $data['leaves']);\n }\n return $errors;\n \n }",
"function rebuild() {\n\t\t$data = $this->_getTreeWithChildren();\n\t\t\n\t\t$level = 0; // need a variable to hold the running level tally\n\t\t// invoke the recursive function. Start it processing\n\t\t// on the fake \"root node\" generated in getTreeWithChildren().\n\t\t// because this node doesn't really exist in the database, we\n\t\t// give it an initial nleft value of 0 and an nlevel of 0.\n\t\t$this->_generateTreeData($data, 0, 0);\n\n\t\t// at this point the the root node will have nleft of 0, nlevel of 0\n\t\t// and nright of (tree size * 2 + 1)\n\n\t\tforeach ($data as $id => $row) {\n\n\t\t\t// skip the root node\n\t\t\tif ($id == 0)\n\t\t\t\tcontinue;\n\n\t\t\t$query = sprintf('update %s set nlevel = %d where %s = %d', $this->db->dbprefix( 'taxonomy_term_data' ), $row->nlevel, $this->fields['id'], $id);\n\t\t\t$this->db->query($query);\n\t\t}\n\t}",
"public function action_save()\r\n {\r\n\r\n\r\n /** @var Model_Category $root **/ // root node\r\n $root = ORM::factory('Pages', Arr::get($this->request->post(), 'parent'));\r\n \r\n\r\n \r\n // check root\r\n if (!$root->loaded())\r\n {\r\n throw new HTTP_Exception_502('Root node of categories tree not founded');\r\n }\r\n \r\n /** @var Model_Category $node **/ // create new node object\r\n $node = ORM::factory('Pages', Arr::get($this->request->post(), 'id_page'));\r\n \r\n // bind data\r\n $node->values($this->request->post(), array('name', 'description'));\r\n \r\n // insert node as last child of root\r\n try {\r\n if (! $node->loaded())\r\n {\r\n // insert\r\n $node->insert_as_last_child_of($root);\r\n }\r\n else\r\n {\r\n // save\r\n $node->save();\r\n \r\n // change parent if needed\r\n if (! $root->is_equal_to($node->get_parent()))\r\n {\r\n $node->move_as_last_child_of($root);\r\n }\r\n }\r\n } catch (Exception $e) {\r\n throw $e;\r\n // process error check\r\n }\r\n \r\n // setup success message\r\n Session::instance()->set('message', 'Operation was successfully completed');\r\n \r\n // redirect to modify page\r\n HTTP::redirect(Route::url('default', array('controller' => 'pages', 'action' => 'edit', 'id' => $node->id_page)));\r\n }",
"static private function _assembleTagTree() {\n\t\t$tagsData = self::_retrieveTagData();\n\n\t\t// reformat the array to name => data\n\t\tforeach ($tagsData as $index => $tagData) {\n\t\t\t$tagsData[$tagData['name']] = $tagData;\n\t\t\tunset($tagsData[$index]);\n\t\t}\n\t\tforeach ($tagsData as $name => $tagData) {\n\t\t\tself::$_upTree[$name] = self::_findRootPath($name, $tagsData);\n\t\t}\n\t}",
"public function completeTreeUpdate($tree, $parent_id = null)\n {\n if (!is_array($tree)) {\n return;\n }\n $keys = array_keys($tree);\n sort($keys);\n $children = $this->find('list', array(\n 'conditions' => array(\n 'PermissibleAco.parent_id' => $parent_id\n ),\n 'fields' => array(\n 'PermissibleAco.alias'\n )\n ));\n sort($children);\n $same = ($children === $keys);\n $children = $this->find('list', array(\n 'conditions' => array(\n 'PermissibleAco.parent_id' => $parent_id\n ),\n 'fields' => array(\n 'PermissibleAco.alias'\n )\n ));\n if ($same) {\n foreach ($children as $id => $alias) {\n $this->completeTreeUpdate($tree[$alias], $id);\n }\n } else {\n foreach ($children as $id => $child) {\n if (!in_array($child, $keys)) {\n $this->delete($id);\n unset($children[$id]);\n }\n }\n foreach ($keys as $key) {\n if (!in_array($key, $children)) {\n $this->create();\n $this->save(array(\n 'PermissibleAco' => array(\n 'parent_id' => $parent_id,\n 'alias' => $key\n )\n ));\n }\n }\n }\n }",
"public function save($data) {\n $path = $this->path;\n $oldData = $this->data;\n $this->recursiveSaveFiles($data, $path, $oldData);\n }",
"public function saveAssociation(NodeTypeAssociation $assoc);",
"public static function saveOrder($tree = [])\n {\n $tree = array_pluck($tree, 'id');\n\n if (empty(static::$branchOrder)) {\n static::setBranchOrder($tree);\n }\n\n foreach ($tree as $id) {\n $node = static::findOrFail($id);\n\n $node->order = static::$branchOrder[$id];\n $node->save();\n }\n }",
"public static function saveOrder($tree = [], $parentId = 0, $depth = 1)\n {\n if (empty(static::$branchOrder)) {\n static::setBranchOrder($tree);\n }\n\n foreach ($tree as $branch) {\n $node = static::find($branch['id']);\n\n $node->{$node->getParentColumn()} = $parentId;\n $node->{$node->getOrderColumn()} = static::$branchOrder[$branch['id']];\n $node->getDepthColumn() && $node->{$node->getDepthColumn()} = $depth;\n $node->save();\n\n if (isset($branch['children'])) {\n static::saveOrder($branch['children'], $branch['id'], $depth + 1);\n }\n }\n }",
"public function storeAll() {\r\n\t\tforeach ($this as $element) { /* @var $element tx_tcaobjects_object */\r\n\t\t\t$element->storeSelf();\r\n\t\t}\r\n\t}",
"public function putInTree($a_ref_id);",
"private function save()\n\t{\n\t\tfile_put_contents($this->_file, json_encode($this->_container));\n\t}",
"function createRoot(){\n\n global $mysqli;\n $node=new Node();\n $node->Set('Root',0);\n\n $node->SaveData($mysqli);\n GetAll();\n}",
"function save()\n {\n $ldap= $this->config->get_ldap_link();\n\n /* If domain part was selectable, contruct mail address */\n if(!(!$this->mailMethod->isModifyableMail() && $this->initially_was_account)){\n\n if($this->mailMethod->domainSelectionEnabled() || $this->mailMethod->mailEqualsCN()){\n $this->mail = $this->mail.\"@\".$this->mailDomainPart;\n }\n }\n\n /* Enforce lowercase mail address and trim whitespaces\n */\n $this->mail = trim(strtolower($this->mail));\n\n\n /* Create acls \n */\n $this->acl = array(\"anyone \".$this->folder_acls['__anyone__']);\n $member = $this->get_member();\n $new_folder_acls = array(\"anyone\" => $this->folder_acls['__anyone__']);\n foreach($member['mail'] as $uid => $mail){\n\n /* Do not save overridden acls */\n if(isset($this->folder_acls[$mail])){\n continue;\n }\n\n $this->acl[] = $mail.\" \".$this->folder_acls['__member__'];\n $new_folder_acls[$mail]=$this->folder_acls['__member__'];\n }\n foreach($this->folder_acls as $user => $acls){\n if(preg_match(\"/^__/\",$user)) continue;\n $this->acl[] = $user.\" \".$acls;\n $new_folder_acls[$user]=$acls;\n }\n $this->folder_acls = $new_folder_acls;\n $this->acl = array_unique($this->acl);\n\n /* Call parents save to prepare $this->attrs */\n plugin::save();\n\n /* Save arrays */\n $this->attrs['gosaMailAlternateAddress'] = $this->gosaMailAlternateAddress;\n $this->attrs['gosaMailForwardingAddress']= $this->gosaMailForwardingAddress;\n\n /* Map method attributes */\n $this->mailMethod->fixAttributesOnStore();\n\n /* Save data to LDAP */\n $ldap->cd($this->dn);\n $this->cleanup();\n $ldap->modify ($this->attrs); \n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }\n\n if($this->initially_was_account){\n new log(\"modify\",\"groups/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());\n }else{\n new log(\"create\",\"groups/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); \n }\n\n /* Do imap/sieve actions,\n */\n $this->mailMethod->connect();\n if(!$this->mailMethod->is_connected()){\n msg_dialog::display(_(\"Mail error\"), sprintf(_(\"Mail method cannot connect: %s\"),\n $this->mailMethod->get_error()), ERROR_DIALOG);\n }else{\n if(!$this->mailMethod->updateMailbox()){\n msg_dialog::display(_(\"Mail error\"), sprintf(_(\"Cannot update mailbox: %s\"),\n $this->mailMethod->get_error()), ERROR_DIALOG);\n }\n if(!$this->mailMethod->setQuota($this->gosaMailQuota)){\n msg_dialog::display(_(\"Mail error\"), sprintf(_(\"Cannot write quota settings: %s\"),\n $this->mailMethod->get_error()), ERROR_DIALOG);\n }\n /* Save Folder Types, if available \n */\n if($this->mailMethod->folderTypesEnabled()){\n $this->mailMethod->setFolderType($this->FolderType);\n }\n if(!$this->mailMethod->setFolderACLs($this->folder_acls)){\n msg_dialog::display(_(\"Mail error\"), sprintf(_(\"Cannot update shared folder permissions: %s\"),\n $this->mailMethod->get_error()), ERROR_DIALOG);\n }\n }\n $this->mailMethod->disconnect();\n\n /* Optionally execute a command after we're done */\n if ($this->initially_was_account == $this->is_account){\n if ($this->is_modified){\n $this->handle_post_events(\"modify\");\n }\n } else {\n $this->handle_post_events(\"add\");\n }\n }",
"function treeze(&$a, $parent_key = 'parent', $children_key = 'children') {\n\n\t/* Modelo de Array\n\t\t $ARRAY = array(\n\t\t 'a' => array( 'label' => \"A\" ),\n\t\t 'b' => array( 'label' => \"B\" ),\n\t\t 'c' => array( 'label' => \"C\" ),\n\t\t 'd' => array( 'label' => \"D\" ),\n\t\t 5 => array( 'label' => \"one\", 'parent' => 'a' ),\n\t\t 6 => array( 'label' => \"two\", 'parent' => 'a' ),\n\t\t 7 => array( 'label' => \"three\", 'parent' => 'a' ),\n\t\t 8 => array( 'label' => \"node 1\", 'parent' => 'a' ),\n\t\t 9 => array( 'label' => \"node 2\", 'parent' => '2' ),\n\t\t 10 => array( 'label' => \"node 3\", 'parent' => '2' ),\n\t\t 11 => array( 'label' => \"I\", 'parent' => '9' ),\n\t\t 12 => array( 'label' => \"II\", 'parent' => '9' ),\n\t\t 13 => array( 'label' => \"III\", 'parent' => '9' ),\n\t\t 14 => array( 'label' => \"IV\", 'parent' => '9' ),\n\t\t 15 => array( 'label' => \"V\", 'parent' => '9' ),\n\t\t );\n\t*/\n\n\t$orphans = true;\n\t$i;\n\twhile ($orphans) {\n\t\t$orphans = false;\n\t\tforeach ($a as $k => $v) {\n\t\t\t// is there $a[$k] sons?\n\t\t\t$sons = false;\n\t\t\tforeach ($a as $x => $y) {\n\t\t\t\tif (isset($y[$parent_key]) and $y[$parent_key] != false and $y[$parent_key] == $k) {\n\t\t\t\t\t$sons = true;\n\t\t\t\t\t$orphans = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// $a[$k] is a son, without children, so i can move it\n\t\t\tif (!$sons and isset($v[$parent_key]) and $v[$parent_key] != false) {\n\t\t\t\t$a[$v[$parent_key]][$children_key][$k] = $v;\n\t\t\t\tunset($a[$k]);\n\t\t\t}\n\t\t}\n\t}\n}",
"function save_object()\n {\n // Update the listing class, this is necessary to get post\n // actions from it.\n $this->listing->save_object();\n\n // Get the selected distribution and release from the listing widget.\n $cont = $this->listing->getSelectedContainer();\n if(isset($_POST['ROOT'])){\n $this->setCurrentContainer('/root');\n }elseif(isset($_POST['BACK'])){\n $path = $this->selectedContainer;\n if($this->dataModel->itemExistsByPath($path)){\n $data = $this->dataModel->getItemByPath($path);\n if($data['parentPath']){\n $this->setCurrentContainer($data['parentPath']);\n }\n }\n }else{\n $this->setCurrentContainer($cont);\n }\n }",
"public function save($bson=null){\n $this->nodes = array_slice($this->nodes, (MAX_PAGE_HISTORY * -1) );\n return parent::save($bson); \n }",
"public function writeTree(array $tree, $indentChar = ' ', $indentLevel = 4)\n {\n foreach ($tree as $node) {\n $this->writeNode($node, 0, $indentChar, $indentLevel);\n }\n }",
"public function saveAll(): void\n {\n foreach ($this->documents as $documents) {\n foreach ($documents as $document) {\n $this->save($document);\n }\n }\n }",
"public function saveArc() {\n if (isset($this->arc)) {\n file_save_data(serialize($this->arc), $this->temp_file, FILE_EXISTS_REPLACE);\n unset($this->arc);\n }\n }",
"function backfill_parents()\n {\n }"
] | [
"0.6636567",
"0.6599797",
"0.6248186",
"0.5999252",
"0.575806",
"0.5729042",
"0.5719978",
"0.5622414",
"0.5601618",
"0.5573862",
"0.5493995",
"0.5464518",
"0.5461195",
"0.5425581",
"0.5424801",
"0.53590584",
"0.5339321",
"0.53134596",
"0.5256676",
"0.52491796",
"0.5215504",
"0.5197487",
"0.5186601",
"0.51673925",
"0.51631063",
"0.51389295",
"0.51131475",
"0.5103207",
"0.5080031",
"0.5079054"
] | 0.68862283 | 0 |
Recursively updates the ACO tree | public function completeTreeUpdate($tree, $parent_id = null)
{
if (!is_array($tree)) {
return;
}
$keys = array_keys($tree);
sort($keys);
$children = $this->find('list', array(
'conditions' => array(
'PermissibleAco.parent_id' => $parent_id
),
'fields' => array(
'PermissibleAco.alias'
)
));
sort($children);
$same = ($children === $keys);
$children = $this->find('list', array(
'conditions' => array(
'PermissibleAco.parent_id' => $parent_id
),
'fields' => array(
'PermissibleAco.alias'
)
));
if ($same) {
foreach ($children as $id => $alias) {
$this->completeTreeUpdate($tree[$alias], $id);
}
} else {
foreach ($children as $id => $child) {
if (!in_array($child, $keys)) {
$this->delete($id);
unset($children[$id]);
}
}
foreach ($keys as $key) {
if (!in_array($key, $children)) {
$this->create();
$this->save(array(
'PermissibleAco' => array(
'parent_id' => $parent_id,
'alias' => $key
)
));
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rebuild() {\n\t\t$data = $this->_getTreeWithChildren();\n\t\t\n\t\t$level = 0; // need a variable to hold the running level tally\n\t\t// invoke the recursive function. Start it processing\n\t\t// on the fake \"root node\" generated in getTreeWithChildren().\n\t\t// because this node doesn't really exist in the database, we\n\t\t// give it an initial nleft value of 0 and an nlevel of 0.\n\t\t$this->_generateTreeData($data, 0, 0);\n\n\t\t// at this point the the root node will have nleft of 0, nlevel of 0\n\t\t// and nright of (tree size * 2 + 1)\n\n\t\tforeach ($data as $id => $row) {\n\n\t\t\t// skip the root node\n\t\t\tif ($id == 0)\n\t\t\t\tcontinue;\n\n\t\t\t$query = sprintf('update %s set nlevel = %d where %s = %d', $this->db->dbprefix( 'taxonomy_term_data' ), $row->nlevel, $this->fields['id'], $id);\n\t\t\t$this->db->query($query);\n\t\t}\n\t}",
"public static function _rebuildTree($data_array)\n {\n if (is_array($data_array)) {\n foreach ($data_array as $data_node) {\n $node = CategoryArticle::find(3);\n //loop recursively through the children\n if (isset($data_node['children']) && is_array($data_node['children'])) {\n foreach ($data_node['children'] as $data_node_child) {\n //append the children to their (old/new)parents\n $descendant = CategoryArticle::find($data_node_child['item_id']);\n $descendant->appendTo($node)->update();\n //ordering trick here, shift the descendants to the bottom to get the right order at the end\n $shift = count($descendant->getSiblings());\n $descendant->down($shift);\n self::_rebuildTree($data_node['children']);\n }\n }\n }\n }\n }",
"public function update () {\r\n\t\t$this->getParent ()->update();\r\n\t\t$this->_update();\r\n\t}",
"protected function update()\n {\n parent::update();\n\n // Copy all keys from all children\n $this->keys = new \\StdClass();\n foreach ($this->children as $child) {\n foreach ($child->keys as $key => $field) {\n $this->keys->$key = $field;\n }\n }\n\n // Copy default param only if every child has the same default param\n $defaultParam = $this->children[0]->defaultParam;\n $diff = false;\n foreach ($this->children as $child) {\n if ($child->defaultParam != $defaultParam) {\n $diff = true;\n }\n }\n\n if (!$diff) {\n $this->defaultParam = $defaultParam;\n }\n }",
"public function actionUpdate()\n\t{\n\t\t$structure = Yii::app()->request->getParam('structure');\n if($structure != null){\n $list = json_decode($structure,true);\n if(count($list) > 0){\n $i = 0;\n foreach($list as $value){\n $i++;\n $sql = \"UPDATE menu SET parent_id = 0, position =$i WHERE id =\".$value['id'];\n Yii::app()->db->createCommand($sql)->execute();\n if(isset($value['children'])){\n $children = $value['children'];\n if(count($children) > 0){\n $j = $i+1;\n foreach($children as $chid){\n $j++;\n $sql = \"UPDATE menu SET parent_id = \".$value['id'].\", position =$j WHERE id =\".$chid['id'];\n Yii::app()->db->createCommand($sql)->execute();\n }\n }\n }\n }\n }\n }\n\t}",
"static private function _assembleTagTree() {\n\t\t$tagsData = self::_retrieveTagData();\n\n\t\t// reformat the array to name => data\n\t\tforeach ($tagsData as $index => $tagData) {\n\t\t\t$tagsData[$tagData['name']] = $tagData;\n\t\t\tunset($tagsData[$index]);\n\t\t}\n\t\tforeach ($tagsData as $name => $tagData) {\n\t\t\tself::$_upTree[$name] = self::_findRootPath($name, $tagsData);\n\t\t}\n\t}",
"function treeze(&$a, $parent_key = 'parent', $children_key = 'children') {\n\n\t/* Modelo de Array\n\t\t $ARRAY = array(\n\t\t 'a' => array( 'label' => \"A\" ),\n\t\t 'b' => array( 'label' => \"B\" ),\n\t\t 'c' => array( 'label' => \"C\" ),\n\t\t 'd' => array( 'label' => \"D\" ),\n\t\t 5 => array( 'label' => \"one\", 'parent' => 'a' ),\n\t\t 6 => array( 'label' => \"two\", 'parent' => 'a' ),\n\t\t 7 => array( 'label' => \"three\", 'parent' => 'a' ),\n\t\t 8 => array( 'label' => \"node 1\", 'parent' => 'a' ),\n\t\t 9 => array( 'label' => \"node 2\", 'parent' => '2' ),\n\t\t 10 => array( 'label' => \"node 3\", 'parent' => '2' ),\n\t\t 11 => array( 'label' => \"I\", 'parent' => '9' ),\n\t\t 12 => array( 'label' => \"II\", 'parent' => '9' ),\n\t\t 13 => array( 'label' => \"III\", 'parent' => '9' ),\n\t\t 14 => array( 'label' => \"IV\", 'parent' => '9' ),\n\t\t 15 => array( 'label' => \"V\", 'parent' => '9' ),\n\t\t );\n\t*/\n\n\t$orphans = true;\n\t$i;\n\twhile ($orphans) {\n\t\t$orphans = false;\n\t\tforeach ($a as $k => $v) {\n\t\t\t// is there $a[$k] sons?\n\t\t\t$sons = false;\n\t\t\tforeach ($a as $x => $y) {\n\t\t\t\tif (isset($y[$parent_key]) and $y[$parent_key] != false and $y[$parent_key] == $k) {\n\t\t\t\t\t$sons = true;\n\t\t\t\t\t$orphans = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// $a[$k] is a son, without children, so i can move it\n\t\t\tif (!$sons and isset($v[$parent_key]) and $v[$parent_key] != false) {\n\t\t\t\t$a[$v[$parent_key]][$children_key][$k] = $v;\n\t\t\t\tunset($a[$k]);\n\t\t\t}\n\t\t}\n\t}\n}",
"private function _recursive_update($obj, $path, $update, $depth)\n {\n $node = $path[$depth];\n $next_node = $path[$depth+1];\n\n if(!$obj){\n throw new Exception(\"Field not found\");\n }\n if(!$path || gettype($path) != 'array'){\n throw new Exception(\"Invalid path\");\n }\n\n /* update at the root level */\n if(count($path) == 1){\n reset($update);\n $k = key($update);\n $v = current($update);\n\n if(isset($obj[$k])){\n return (object) array_replace_recursive((array) $obj, (array) $update);\n }\n else{\n return (object) array_merge_recursive((array) $obj, (array) $update);\n }\n }\n\n /**\n * special handling for updating arrays at depth 2\n * as arrays have to be replaced\n */\n if(count($path) == 2){\n if(gettype($obj[$path[1]]) == 'array'){\n $val = $obj[$path[1]];\n $new_val = array_merge_recursive($val, $update);\n $obj[$path[1]] = $new_val;\n return $obj;\n }\n }\n\n /**\n * similar to special handling above for arrays but at\n * a varied depth\n */\n if($depth == count($path) - 2){\n $temp = (array)$obj[$node];\n if(gettype($temp[$next_node]) == 'array'){\n reset($update);\n $k = key($update);\n $v = current($update);\n $val = $temp[$next_node];\n\n if(isset($val[$k])){\n $new_val = array_replace_recursive($val, $update);\n }\n else {\n $new_val = array_merge_recursive($val, $update);\n }\n\n if(gettype($obj[$node]) == 'object'){\n $obj[$node]->$next_node = $new_val;\n }\n else{\n $obj[$node][$next_node] = $new_val;\n }\n return;\n }\n }\n\n /* handling scalar values and JSON Object */\n if($depth == count($path) - 1){\n reset($update);\n $k = key($update);\n $v = current($update);\n\n if(gettype($obj[$node]) == 'object'){\n $obj[$node]->$k = $v;\n }\n else{\n $obj[$node][$k] = $v;\n }\n return;\n }\n\n if($depth == 0){\n /* ignore \"root\" */\n self::_recursive_update((array)$obj[$next_node], $path, $update, $depth + 2);\n }\n\n else{\n self::_recursive_update((array)$obj[$node], $path, $update, $depth + 1);\n }\n return $obj;\n }",
"public function update($object) {\n\t\t$uow = $this->entityManager->getUnitOfWork();\n\t\t$originalEntityData = $uow->getOriginalEntityData($object);\n\t\t$this->parentUpdate($object);\n\t\t$this->updateDocuments($object);\n\n\t\tif ($originalEntityData['path'] !== $object->getPath()) {\n\t\t\t$childs = $this->findByPathHead($originalEntityData['path']);\n\t\t\tforeach ($childs AS $category) {\n\t\t\t\t$replacedPath = $this->pathService->replacePath($category->getPath(), $originalEntityData['path'], $object->getPath());\n\t\t\t\t$category->setPath($replacedPath);\n\t\t\t\t$this->parentUpdate($category);\n\t\t\t\t$this->updateDocuments($category);\n\t\t\t}\n\t\t}\n\t}",
"public function updateCircuitsParents();",
"public function setDepthWithSubtree();",
"public function moveTo($new_parent_id) {\n\n if ($this->getNodeById()) {\n\n if ($this->asset_id == $new_parent_id) {\n return false;\n }\n\n $new_parent = new MY_Model($this->table_name);\n $new_parent->asset_id = $new_parent_id;\n $new_parent->getNodeById();\n\n $nodesize = $this->rgt - $this->lft + 1;\n\n\n //negate current node and children\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n SET lft = ((lft - \" . $this->lft . \") + 1) * (-1), \n rgt = ((rgt - \" . $this->lft . \") + 1) * (-1),\n hlevel = (hlevel -\" . $this->hlevel . \")+1\n WHERE \n lft >= \" . $this->lft . \" \n AND rgt <= \" . $this->rgt . \"\n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft - \" . $nodesize . \"\n WHERE\n lft > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt - \" . $nodesize . \"\n WHERE\n rgt > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update parent id\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n parent_id = \" . $new_parent_id . \"\n WHERE \n asset_id = \" . $this->db->escape($this->asset_id) . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update tree \n $updatedtree = new MY_Model($this->table_name);\n $updatedtree->asset_id = $new_parent_id;\n $updatedtree->getNodeById();\n\n //update tree for isertion\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft + \" . $nodesize . \" \n WHERE\n lft > \" . $updatedtree->lft . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt + \" . $nodesize . \" \n WHERE\n rgt > \" . $updatedtree->lft . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n //update pluged nodes\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = (lft *(-1) )+ \" . $updatedtree->lft . \",\n rgt = (rgt *(-1) ) + \" . $updatedtree->lft . \",\n hlevel = hlevel +\" . $updatedtree->hlevel . \"\n WHERE\n lft < 0 AND rgt < 0 \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n return true;\n } else {\n return false;\n }\n }",
"public function rebuildNestedSetNodes()\n\t{\n\t\t$errorFound = false;\n\t\t\n\t\t$params = [\n\t\t\t'adjacentTable' => 'categories',\n\t\t\t'nestedTable' => 'categories',\n\t\t];\n\t\t$transformer = new AdjacentToNested($params);\n\t\t\n\t\t$languages = Language::query()->get();\n\t\tif ($languages->count() > 0) {\n\t\t\tforeach ($languages as $lang) {\n\t\t\t\t$transformer->langCode = $lang->abbr;\n\t\t\t\ttry {\n\t\t\t\t\t$transformer->getAndSetAdjacentItemsIds();\n\t\t\t\t\t$transformer->convertChildrenRecursively(0);\n\t\t\t\t\t$transformer->setNodesDepth();\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\tAlert::error($e->getMessage())->flash();\n\t\t\t\t\t$errorFound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check if error occurred\n\t\tif (!$errorFound) {\n\t\t\t$message = trans('admin.action_performed_successfully');\n\t\t\tAlert::success($message)->flash();\n\t\t}\n\t\t\n\t\treturn redirect()->back();\n\t}",
"function allchildren($parrentid,$nodes){\n\n foreach ($nodes as $res){\n\n if($parrentid==$res->getParentId()) {\n echo '<div style=\"margin-left: 50px; position:relative\" >';\n $res->getallData();\n\n allchildren($res->getID(),$nodes);//recursive calling\n echo '</div>';\n unset($res);\n }\n }\n\n}",
"public function UpdateRootCategories()\n\t{\n\t\t$nestedset = new ISC_NESTEDSET_CATEGORIES();\n\n\t\t$data = array();\n\t\tforeach ($nestedset->getTree(array('categoryid', 'catparentid', 'catname'), ISC_NESTEDSET_START_ROOT, GetConfig('CategoryListDepth') - 1, null, null, false, array('MIN(`parent`.`catvisible`) = 1')) as $category) {\n\t\t\t$data[(int)$category['catparentid']][(int)$category['categoryid']] = $category;\n\t\t}\n\n\t\t$this->Save('ChildCategories', array());\n\t\treturn $this->Save('RootCategories', $data);\n\t}",
"function saveTreeRecursive($arr,$parent_id,$object,$webClass,$hasil){\n// echo \"parent id : \".$parent_id.\"<br>\";\n// echo \"obj id : \".$obj;\n// pr($obj);\n /*if($parent_id == \"non-active-menu\" ||$parent_id == \"active-menu\" )\n return \"\";\n */\n $new = array();\n foreach($arr as $n=>$obj){\n //cek apakah array\n if(is_array($obj)){\n //if yes\n //get the first col as name and the res as children\n $id = $obj[0];\n $explode = explode(\"_\",$id);\n $object->getByID($explode[1]);\n $this->arrIds[] = $explode[1];\n $new[$object->cat_id]['name'] = $object->cat_name;\n //$this->saveToObj($id,$parent_id,$object,$webClass);\n $new[$object->cat_id]['subcategory'] = $this->saveTreeRecursive($obj[1],$id,$object,$webClass,$new);\n// return $new;\n }else{\n $id = $obj;\n $explode = explode(\"_\",$id);\n $object->getByID($explode[1]);\n $this->arrIds[] = $explode[1];\n //kalo bukan array di save\n// $this->saveToObj($id,$parent_id,$object,$webClass);\n $new[$object->cat_id]['name'] = $object->cat_name;\n// return $new;\n }\n }\n return $new;\n }",
"public function testUpdateNode()\n {\n }",
"function markParentToUpdate() {\n\t\tglobal $repository;\n\t\t$mainObjId = $this->getMainObjectId();\n\t\tdebug(\"parentUpdate\", $mainObjId);\n\t\tif($mainObjId) {\n\t\t\t$mainObj = $repository->getObject($mainObjId);\n\t\t\tif(is_a($mainObj, 'sotf_nodeobject') && $mainObj->isLocal()) {\n\t\t\t\t$this->addToUpdate('updateMeta', $mainObjId);\n\t\t\t}\n\t\t}\t\t\n\t}",
"public function updateHierarchyOptions($data) {\n $where = $this->db->quoteInto('hierarchy_id = ?', $this->getId());\n $rows_affected = $this->db->update('zanby_groups__hierarchy_relation', $data, $where);\n }",
"function update($parent) {\r\n\r\n\t}",
"public function refresh()\n {\n $this->completeTreeUpdate($this->getCompleteTree());\n }",
"function backfill_parents()\n {\n }",
"public function completeTreeSave($tree, $parent_id = null)\n {\n if ($parent_id === null) {\n $this->truncate();\n }\n foreach ($tree as $aro => $tre) {\n $this->create();\n $this->save(array(\n 'parent_id' => $parent_id,\n 'alias' => $aro\n ));\n if (is_array($tre)) {\n $this->completeTreeSave($tre, $this->id);\n }\n }\n }",
"public function putInTree($a_ref_id);",
"function update_node($lft,$data){\n\t\tif(!$this->get_node($lft))return false;\n\t\t$data = $this->sanitize_data($data);\n\t\t// Make the update\n\t\t$this->db->where($this->left_col,$lft);\n\t\t$this->db->update($this->tree_table,$data);\n\t\treturn true;\n\t}",
"public function moveToRightOf($id) {\n if ($this->getNodeById()) {\n\n if ($this->asset_id == $id) {\n return false;\n }\n\n $left_node = new MY_Model($this->table_name);\n $left_node->asset_id = $id;\n $left_node->getNodeById();\n\n $nodesize = $this->rgt - $this->lft + 1;\n\n\n //negate current node and children\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n SET lft = ((lft - \" . $this->lft . \") + 1) * (-1), \n rgt = ((rgt - \" . $this->lft . \") + 1) * (-1),\n hlevel = (hlevel -\" . $this->hlevel . \")\n WHERE \n lft >= \" . $this->lft . \" \n AND rgt <= \" . $this->rgt . \"\n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft - \" . $nodesize . \"\n WHERE\n lft > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt - \" . $nodesize . \"\n WHERE\n rgt > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update parent id\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n parent_id = \" . $left_node->parent_id . \"\n WHERE \n asset_id = \" . $this->db->escape($this->asset_id) . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Updated tree \n $updatedleft = new MY_Model($this->table_name);\n $updatedleft->asset_id = $id;\n $updatedleft->getNodeById();\n\n //update tree for insertion\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft + \" . $nodesize . \" \n WHERE\n lft > \" . $updatedleft->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt + \" . $nodesize . \" \n WHERE\n rgt > \" . $updatedleft->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n $updatedleft->getNodeById();\n //update pluged nodes\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = (lft *(-1) )+ \" . $updatedleft->rgt . \",\n rgt = (rgt *(-1) ) + \" . $updatedleft->rgt . \",\n hlevel = hlevel +\" . $updatedleft->hlevel . \"\n WHERE\n lft < 0 AND rgt < 0 \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n return true;\n } else {\n\n return false;\n }\n }",
"public function updateHierarchyConstraints($data) {\n $where = $this->db->quoteInto('hierarchy_id = ?', $this->getId());\n $rows_affected = $this->db->update('zanby_groups__hierarchy_relation', $data, $where);\n }",
"function updateData($object)\n {\n if (!is_a($object, 'Horde_DataTreeObject')) {\n /* Nothing to do for non objects. */\n return true;\n }\n\n /* Get the object id. */\n $id = $this->getId($object->getName());\n if (is_a($id, 'PEAR_Error')) {\n return $id;\n }\n\n /* See if we can break the object out to datatree_attributes table. */\n if (method_exists($object, '_toAttributes')) {\n /* If we can, clear out the datatree_data field to make sure it\n * doesn't get picked up by getData(). Intentionally don't check\n * for errors here in case datatree_data goes away in the\n * future. */\n $query = 'UPDATE ' . $this->_params['table'] .\n ' SET datatree_data = ? WHERE datatree_id = ?';\n $values = array(NULL, (int)$id);\n\n Horde::logMessage('SQL Query by Horde_DataTree_Sql::updateData(): ' . $query . ', ' . var_export($values, true), 'DEBUG');\n $this->_write_db->query($query, $values);\n\n /* Start a transaction. */\n $this->_write_db->autoCommit(false);\n\n /* Delete old attributes. */\n $query = 'DELETE FROM ' . $this->_params['table_attributes'] .\n ' WHERE datatree_id = ?';\n $values = array((int)$id);\n\n Horde::logMessage('SQL Query by Horde_DataTree_Sql::updateData(): ' . $query . ', ' . var_export($values, true), 'DEBUG');\n $result = $this->_write_db->query($query, $values);\n if (is_a($result, 'PEAR_Error')) {\n $this->_write_db->rollback();\n $this->_write_db->autoCommit(true);\n return $result;\n }\n\n /* Get the new attribute set, and insert each into the DB. If\n * anything fails in here, rollback the transaction, return the\n * relevant error, and bail out. */\n $attributes = $object->_toAttributes();\n $query = 'INSERT INTO ' . $this->_params['table_attributes'] .\n ' (datatree_id, attribute_name, attribute_key, attribute_value)' .\n ' VALUES (?, ?, ?, ?)';\n $statement = $this->_write_db->prepare($query);\n foreach ($attributes as $attr) {\n $values = array((int)$id,\n $attr['name'],\n $attr['key'],\n Horde_String::convertCharset($attr['value'], 'UTF-8', $this->_params['charset']));\n\n Horde::logMessage('SQL Query by Horde_DataTree_Sql::updateData(): ' . $query . ', ' . var_export($values, true), 'DEBUG');\n\n $result = $this->_write_db->execute($statement, $values);\n if (is_a($result, 'PEAR_Error')) {\n $this->_write_db->rollback();\n $this->_write_db->autoCommit(true);\n return $result;\n }\n }\n\n /* Commit the transaction, and turn autocommit back on. */\n $result = $this->_write_db->commit();\n $this->_write_db->autoCommit(true);\n\n return is_a($result, 'PEAR_Error') ? $result : true;\n } else {\n /* Write to the datatree_data field. */\n $ser = Horde_Serialize::UTF7_BASIC;\n $data = Horde_Serialize::serialize($object->getData(), $ser, 'UTF-8');\n\n $query = 'UPDATE ' . $this->_params['table'] .\n ' SET datatree_data = ?, datatree_serialized = ?' .\n ' WHERE datatree_id = ?';\n $values = array($data,\n (int)$ser,\n (int)$id);\n\n Horde::logMessage('SQL Query by Horde_DataTree_Sql::updateData(): ' . $query . ', ' . var_export($values, true), 'DEBUG');\n $result = $this->_write_db->query($query, $values);\n\n return is_a($result, 'PEAR_Error') ? $result : true;\n }\n }",
"function updateOrdersWithOldNodeData($node) {\r\n\t\t$order = $node['Node']['order'];\r\n\t\t$nodes = $this->find('all',array(\r\n\t\t\t'conditions' => array(\r\n\t\t\t\t'Node.course_id' => $node['Node']['course_id'],\r\n\t\t\t\t'Node.parent_node_id' => $node['Node']['parent_node_id'],\r\n\t\t\t\t'Node.order >' => $order)\r\n\t\t));\r\n\t\t\r\n\t\t//$nodes = $this->findAll(array());\r\n\t\tforeach($nodes as $node) {\r\n\t\t\t$this->id = $node['Node']['id'];\r\n\t\t\t$this->saveField('order',$order++);\r\n\t\t}\r\n\t}",
"function rebuildTree($parentId, $parentLeft);"
] | [
"0.67205703",
"0.6313856",
"0.60795045",
"0.5977195",
"0.58781934",
"0.58777624",
"0.5766206",
"0.5718677",
"0.5683253",
"0.56437963",
"0.5631653",
"0.5601372",
"0.556601",
"0.55615294",
"0.5537364",
"0.55189806",
"0.5496364",
"0.5494799",
"0.5419688",
"0.5418519",
"0.54149693",
"0.5351992",
"0.5342452",
"0.532448",
"0.53005946",
"0.5279767",
"0.5277602",
"0.52749646",
"0.5274631",
"0.52743554"
] | 0.643099 | 1 |
Refreshes the ACO tree | public function refresh()
{
$this->completeTreeUpdate($this->getCompleteTree());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rebuild() {\n\t\t$data = $this->_getTreeWithChildren();\n\t\t\n\t\t$level = 0; // need a variable to hold the running level tally\n\t\t// invoke the recursive function. Start it processing\n\t\t// on the fake \"root node\" generated in getTreeWithChildren().\n\t\t// because this node doesn't really exist in the database, we\n\t\t// give it an initial nleft value of 0 and an nlevel of 0.\n\t\t$this->_generateTreeData($data, 0, 0);\n\n\t\t// at this point the the root node will have nleft of 0, nlevel of 0\n\t\t// and nright of (tree size * 2 + 1)\n\n\t\tforeach ($data as $id => $row) {\n\n\t\t\t// skip the root node\n\t\t\tif ($id == 0)\n\t\t\t\tcontinue;\n\n\t\t\t$query = sprintf('update %s set nlevel = %d where %s = %d', $this->db->dbprefix( 'taxonomy_term_data' ), $row->nlevel, $this->fields['id'], $id);\n\t\t\t$this->db->query($query);\n\t\t}\n\t}",
"public function update () {\r\n\t\t$this->getParent ()->update();\r\n\t\t$this->_update();\r\n\t}",
"public function afterUpdateTree() {\n\t\tCache::clear(false, CAKE_LDAP_CACHE_KEY_TREE_EMPLOYEES);\n\t}",
"public function refresh() {\n\t\t$gearman = $this->_connect();\n\n\t\t$this->_getStatus($gearman);\n\t\t$this->_getWorkers($gearman);\n\t\t$this->_getVersion($gearman);\n\n\t\tfclose($gearman);\n\t}",
"private function sync()\n {\n $dom = $this->packageXPath->document;\n $dom->loadXML($dom->saveXML());\n $this->packageXPath = new EpubDomXPath($dom);\n // reset structural members\n $this->manifest = null;\n $this->spine = null;\n $this->toc = null;\n }",
"function reload()\n {\n $this->load();\n }",
"function clear()\n\t{\n\t\t$this->setRoot($this->createRoot());\n\t}",
"public function rebuild()\n {\n if (! $this->rebuilt) {\n $this->build(false);\n $this->rebuilt = true;\n }\n }",
"public function refresh() {\n\t\t$this->_stats = null;\n\t\t$this->_info = null;\n\t}",
"final function redraw()\n {\n foreach ($this->parents as $parent)\n $parent->redraw();\n }",
"public function refresh() {\n }",
"public function refresh(){\n\t\t\n\t}",
"public function refresh()\n {\n $this->forget();\n parent::refresh();\n }",
"public function refresh() {\n\t\t$dataArrays = static::gatherData($this->getItemId());\n\t\t$this->load($dataArrays[0]);\n\t}",
"public function refresh(): void\n {\n }",
"public function refresh(): void\n {\n }",
"public function clearChildren()\n {\n $this->children = [];\n }",
"private function refresh()\n {\n $this->__construct($this->id);\n }",
"private function refresh()\n {\n $this->__construct($this->id);\n }",
"public function flush() : void\n {\n $this->hasChanges = true;\n $this->isFlushed = true;\n $this->elements = [];\n }",
"public function refresh()\n {\n if ($this->commandLineBuilder) {\n $this->commandLineBuilder->clearCommands();\n }\n\n if ($this->refreshRaw()) {\n $this->parseRaw();\n }\n }",
"public function flush()\n {\n $this->apc->flush();\n }",
"public function flush(){\n\t\tforeach($this->repos as $r){\n\t\t\t$r->flush();\n\t\t}\n\t}",
"public function flush(): void\n {\n $this->sharedObjects = [];\n }",
"public function cacheTreeChartPageRefresh()\n {\n // we manage the \"tree chart page\"\n $params_treechart = array();\n $params_treechart['action'] = \"renderByClick\";\n $params_treechart['id'] = \".org-chart-page\";\n $params_treechart['menu'] = \"page\";\n // we sort an array by key in reverse order\n krsort($params_treechart);\n // we create de Etag cache\n $params_treechart = json_encode($params_treechart);\n $params_treechart = str_replace(':', '#', $params_treechart);\n // we refresh all caches \n $all_lang = $this->getRepository('Langue')->findByEnabled(true);\n foreach($all_lang as $key => $lang) {\n $id_lang = $lang->getId();\n $Etag_treechart = \"organigram:Rubrique~org-chart-page:$id_lang:$params_treechart\";\n // we refresh the cache\n $this->cacheRefreshByname($Etag_treechart);\n }\n }",
"public function clearChildren()\n {\n $this->children = null;\n $this->children = array();\n }",
"public function flush(/* ... */)\n {\n $this->_storage = [[], [], []];\n if (false !== $this->_history){\n $this->_history = [];\n }\n $this->set_state(STATE_DECLARED);\n // gc_collect_cycles();\n }",
"public function actionUpdateTree()\n\t{\n\tif (Yii::app()->request->isAjaxRequest){\n\t\t$this->renderPartial('tree');\n\t\tYii::app()->end();\n\t}\n\t}",
"public function ApplyChanges()\n\t\t{\n\t\t\tparent::ApplyChanges();\n\n\t\t\t\n\t\t}",
"public function completeTreeUpdate($tree, $parent_id = null)\n {\n if (!is_array($tree)) {\n return;\n }\n $keys = array_keys($tree);\n sort($keys);\n $children = $this->find('list', array(\n 'conditions' => array(\n 'PermissibleAco.parent_id' => $parent_id\n ),\n 'fields' => array(\n 'PermissibleAco.alias'\n )\n ));\n sort($children);\n $same = ($children === $keys);\n $children = $this->find('list', array(\n 'conditions' => array(\n 'PermissibleAco.parent_id' => $parent_id\n ),\n 'fields' => array(\n 'PermissibleAco.alias'\n )\n ));\n if ($same) {\n foreach ($children as $id => $alias) {\n $this->completeTreeUpdate($tree[$alias], $id);\n }\n } else {\n foreach ($children as $id => $child) {\n if (!in_array($child, $keys)) {\n $this->delete($id);\n unset($children[$id]);\n }\n }\n foreach ($keys as $key) {\n if (!in_array($key, $children)) {\n $this->create();\n $this->save(array(\n 'PermissibleAco' => array(\n 'parent_id' => $parent_id,\n 'alias' => $key\n )\n ));\n }\n }\n }\n }"
] | [
"0.650363",
"0.5895893",
"0.5894515",
"0.58570564",
"0.5817845",
"0.5762335",
"0.5756337",
"0.5709604",
"0.5698659",
"0.5629963",
"0.5610545",
"0.55960065",
"0.55829906",
"0.55392915",
"0.5536493",
"0.5536493",
"0.54680103",
"0.54532427",
"0.54532427",
"0.5396797",
"0.5367635",
"0.53621393",
"0.5328246",
"0.53256404",
"0.53147566",
"0.5311592",
"0.53089654",
"0.52959996",
"0.52832365",
"0.52524406"
] | 0.7697903 | 0 |
Group base network enable | public function groupBaseNetworkEnable() {
return (bool) ( Engine_Api::_()->getApi('settings', 'core')->getSetting('sitegroup.networks.type', 0) && (Engine_Api::_()->getApi('settings', 'core')->getSetting('sitegroup.network', 0) || Engine_Api::_()->getApi('settings', 'core')->getSetting('sitegroup.default.show', 0)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function storeBaseNetworkEnable() {\n return (bool) ( Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.networks.type', 0) && (Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.network', 0) || Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.default.show', 0)));\n }",
"public function enable();",
"public function enable();",
"public function enable() {\n }",
"protected function loadEnablednodes()\n {\n $find = array(\n 'storagegroupID' => $this->get('id'),\n 'id' => $this->get('allnodes'),\n 'isEnabled' => 1\n );\n $nodeids = array();\n $testurls = array();\n foreach ((array)self::getClass('StorageNodeManager')\n ->find($find) as &$node\n ) {\n if ($node->get('maxClients') < 1) {\n continue;\n }\n $nodeids[] = $node->get('id');\n unset($node);\n }\n $this->set('enablednodes', $nodeids);\n }",
"public function enableUserAndGroupSupport(){\n\t\treturn false;\n\t}",
"public function enable() {\n\n CRM_Core_DAO::executeQuery(\"UPDATE civicrm_option_group SET is_active = 1 WHERE name = 'giftaid_batch_name'\");\n CRM_Core_DAO::executeQuery(\"UPDATE civicrm_option_group SET is_active = 1 WHERE name = 'giftaid_basic_rate_tax'\");\n CRM_Core_DAO::executeQuery(\"UPDATE civicrm_option_group SET is_active = 1 WHERE name = 'reason_ended'\");\n\n civicrm_api('CustomGroup', 'update', array(\n 'version' => 3,\n 'is_active' => 1,\n 'id' => CRM_Utils_Array::value('id',civicrm_api('CustomGroup', 'getsingle', array(\n 'version' => 3,\n 'name' => 'Gift_Aid')\n )),\n ));\n\n civicrm_api('CustomGroup', 'update', array(\n 'version' => 3,\n 'is_active' => 1,\n 'id' => CRM_Utils_Array::value('id',civicrm_api('CustomGroup', 'getsingle', array(\n 'version' => 3,\n 'name' => 'Gift_Aid_Declaration')\n )),\n ));\n\n civicrm_api('UFGroup', 'update', array(\n 'version' => 3,\n 'is_active' => 1,\n 'id' => CRM_Utils_Array::value('id',civicrm_api('UFGroup', 'getsingle', array(\n 'version' => 3,\n 'name' => 'Gift_Aid_Declaration')\n )),\n ));\n $gid = self::getReportTemplateGroupId();\n $className = self::REPORT_CLASS;\n CRM_Core_DAO::executeQuery(\"UPDATE civicrm_option_value SET is_active = 1 WHERE option_group_id = $gid AND name = '$className'\");\n }",
"public function enable()\n {\n $this->status = true;\n }",
"function enable() {\n\t\tparent::enable ();\n\t}",
"public function activate( $network_wide ){\n\n\t}",
"public function activate( $network_wide ){\n\n\t}",
"public function enable()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_ENABLE, $payload);\n }",
"abstract public static function enabled();",
"public function enable($accountKey, $groupKey)\n {\n $key = sprintf('%s.%s', $accountKey, $groupKey);\n $this->enabled[$key] = true;\n }",
"public function enabled();",
"function orgright_client_create_group() {\n orgright_client_include('node');\n\n // Create the group\n $group = _orgright_client_default_group_node();\n node_save($group);\n\n // Check if discussion nodes were enabled\n if (in_array('orgright_client_discussion', variable_get('orgright_client_selected_features', array()))) {\n // Create the discussion\n $node = _orgright_client_default_discussion_node();\n $node->og_groups = array($group->nid => $group->nid);\n node_save($node);\n }\n}",
"function enable_at_group_creation( $group_id ) {\n\t\t$settings = apply_filters( 'bp_docs_default_group_settings', array(\n\t\t\t'group-enable'\t=> 1,\n\t\t\t'can-create' \t=> 'member'\n\t\t) );\n\t\t\n\t\tgroups_update_groupmeta( $group_id, 'bp-docs', $settings );\n\t}",
"public function test_enable_network_registration_success() {\n\t\tdelete_network_option( 1, 'wp_sub_add_users_to_network' );\n\n\t\t$this->cli->enable_network_registration( array( 1 ), array() );\n\t\t$this->assertEquals( 1, get_network_option( 1, 'wp_sub_add_users_to_network' ) );\n\n\t\t$this->assertNotEmpty( $this->success );\n\t}",
"public function enable() {\n\t\tif (!WCF::getUser()->getPermission('mod.linkList.canEnableLink')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->link != null && $this->link->isDisabled) {\n\t\t\t// enable link\n\t\t\tLinkListLinkEditor::enableAll($this->linkID);\n\t\t\t// refresh category\n\t\t\tLinkListCategoryEditor::refreshAll($this->categoryID);\n\t\t\tLinkListCategoryEditor::resetCache();\n\t\t}\n\t}",
"public function supports_group_restriction() {\n return true;\n }",
"public function supports_group_restriction() {\n return true;\n }",
"function setGroupPublic($mysqli, $groupID){\n $mysqli->query(\"UPDATE Group_ SET Privacy=0 WHERE GroupID=\".$groupID.\";\");\n }",
"function group($group){\n\t\t\t$this->group = $group;\n\t\t}",
"public static function enable()\n {\n self::$enabled = true;\n }",
"public function enableMasking()\n {\n $input = Request::onlyLegacy('sub_id', 'data_masking');\n $validator = Validator::make($input, [\n 'sub_id' => 'required',\n 'data_masking' => 'required',\n ]);\n if( $validator->fails()){\n return ApiResponse::validation($validator);\n }\n $subContractor = $this->repo->getById($input['sub_id']);\n $subContractor->data_masking = (bool)$input['data_masking'];\n $subContractor->save();\n return ApiResponse::success([\n 'message' => trans('response.success.updated',['attribute' => 'Subcontractor']),\n ]);\n }",
"public function getEnable();",
"public function isGroupDerivedFromDn(): bool;",
"public static function enable_packlink_shipping_methods() {\n\t\tstatic::change_shipping_methods_status();\n\t}",
"public function changeGroup(Permittable $permittable, $group='') : Bool\n\t{\n\t\tif (!function_exists('chgrp')) {\n\t\t\treturn false;\n\t\t}\n\n\t\tchgrp(\n\t\t\t$permittable->getPermitted(),\n\t\t\t$group\n\t\t);\n\n\t\treturn true;\n\t}",
"public function addEnabled()\n {\n $element = $this->getCheckElement('enabled', 'Ativo');\n $this->addElement($element);\n }"
] | [
"0.6766215",
"0.6016938",
"0.6016938",
"0.58363926",
"0.573505",
"0.5639928",
"0.56059134",
"0.546692",
"0.5438238",
"0.53594303",
"0.53594303",
"0.5347186",
"0.5344016",
"0.5274051",
"0.5252771",
"0.5243555",
"0.5239045",
"0.5162977",
"0.5133899",
"0.511082",
"0.511082",
"0.51046586",
"0.507467",
"0.5073089",
"0.50201565",
"0.5019208",
"0.5016286",
"0.50148934",
"0.50097483",
"0.49832904"
] | 0.7908635 | 0 |
DELETE ACTIVITY FEED STREAM PRIVACY WHICH ARE NOT NEED | public function getGroupFeedActionIds() {
$streamTable = Engine_Api::_()->getDbtable('stream', 'activity');
$actionIds = $streamTable->select()
->from($streamTable->info('name'), "action_id")
->where('target_type = ?', 'sitegroup_group')
->query()
->fetchAll(Zend_Db::FETCH_COLUMN);
if (!empty($actionIds)) {
$streamTable->delete(array(
'action_id In(?)' => $actionIds,
'target_type <> ?' => 'sitegroup_group'
));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function purge_activity() {\n\t\t// Die if user does not have permission to change settings.\n\t\tif ( ! $this->_plugin->settings()->CurrentUserCan( 'edit' ) ) {\n\t\t\twp_send_json_error( esc_html__( 'Access Denied.', 'wp-security-audit-log' ) );\n\t\t}\n\n\t\t// Verify nonce.\n\t\t$nonce = filter_input( INPUT_POST, 'nonce', FILTER_SANITIZE_STRING );\n\t\tif ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'wsal-purge-activity' ) ) {\n\t\t\twp_send_json_error( esc_html__( 'Nonce Verification Failed.', 'wp-security-audit-log' ) );\n\t\t}\n\n $connector = WpSecurityAuditLog::getConnector();\n $result = $connector->purge_activity();\n\n if ( $result ) {\n // Log purge activity event.\n $this->_plugin->alerts->Trigger( 6034 );\n wp_send_json_success( esc_html__( 'Tables has been reset.', 'wp-security-audit-log' ) );\n } else {\n wp_send_json_error( esc_html__( 'Reset query failed.', 'wp-security-audit-log' ) );\n }\n\t}",
"public function canClearActivity();",
"public function clearActivity();",
"public function deleteShare()\n {\n # TODO [GH17] Add apisensorloggercontroller::deleteshare\n }",
"public function deleteFeedStream($action) {\n $settingsCoreApi = Engine_Api::_()->getApi('settings', 'core');\n if (empty($action) || empty($settingsCoreApi->sitestore_feed_type) || empty($settingsCoreApi->sitestore_feed_onlyliked))\n return;\n $streamTable = Engine_Api::_()->getDbtable('stream', 'activity');\n $streamTable->delete(array(\n 'action_id = ?' => $action->getIdentity(),\n 'target_type <> ?' => 'sitestore_store'\n ));\n }",
"public function revoke_access() {\n // Nothing to do!\n }",
"public function removeExpiredTokens()\n\t{\n\t\t// connect to apns server\n\t\t$apnsUrl = 'ssl://'.self::APNS_HOST.':'. self::APNS_PORT;\n\t\t$apnsCert = Yii::app()->basepath.'/certificates/iSpies.pem';\n\n\t\t// generate stream\n\t\t$streamContext = stream_context_create();\n\t\tstream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);\n\t\t\n\t\t// create the socket connection\n\t\t$apns = stream_socket_client($apnsUrl, $error, $errorMessage, 60, STREAM_CLIENT_CONNECT, $streamContext);\n\t\tif(!$apns) {\n\t\t\techo \"ERROR $error: $errorMessage\\n\";\n\t\t\treturn;\n\t\t}\n\n\t\t// collect the feedback tokens\n\t\t$feedbackTokens = array();\n\t\t//and read the data on the connection:\n\t\twhile(!feof($apns)) {\n\t\t\t$data = fread($apns, 38);\n\t\t\tif(strlen($data)) {\n\t\t\t\t$feedbackTokens[] = unpack(\"N1timestamp/n1length/H*devtoken\", $data);\n\t\t\t}\n\t\t}\n\t\tfclose($apns);\n\n\t\t// clear any unresponsive tokens from the database\n\t\tif(count($feedbackTokens)){\n\t\t\t$criteria = new CDbCriteria;\n\t\t\t$criteria->condition = \"\";\n\t\t\tforeach($feedbackTokens as $token){\n\t\t\t\tif(strlen($criteria->condition) > 0)\n\t\t\t\t\t$criteria->condition .= \" OR \";\n\t\t\t\t$tokenSegments = str_split($token['devtoken'],8);\n\t\t\t\t$criteria->condition .= \"deviceToken = '\".implode(\" \",$tokenSegments).\"'\";\n\t\t\t}\n\t\t\tPlayer::model()->updateAll(array(\"deviceToken\" => \"\"),$criteria);\n\t\t}\n\t}",
"abstract public function revoke();",
"public function destroy()\n {\n $rightId = 93;\n if (!$this->rightObj->checkRightsIrrespectiveChannel($rightId))\n return redirect('/dashboard');\n if (isset($_GET['option'])) {\n $id = $_GET['option'];\n \n }\n \n $delArr = explode(',', $id);\n\n foreach ($delArr as $d) {\n $topic=SbuscriptionFreebies::find($d);\n $topic->is_deleted=1;\n $topic->save();\n }\n return 'success';\n }",
"public static function deleteMagicLinkExpired()\n {\n static::where(function ($query) {\n $query\n ->where('available_at', '<', Carbon::now())\n ->orWhere(function ($query) {\n $query\n ->whereNotNull('max_visits')\n ->whereRaw('max_visits <= num_visits');\n });\n })\n ->delete();\n }",
"public function unvisit_all() {\n\t\tquery(\n\t\t\t\"DELETE FROM user_chest_visits WHERE visitor={$this->uid}\"\n\t\t);\n\t}",
"public static function fullActivityPurge (\n\t)\t\t\t\t\t// RETURNS <void>\n\t\n\t// AppFriends::fullActivityPurge();\n\t{\n\t\t// Declare a time of over 2 hours\n\t\t$timestamp = time() - 7200;\n\t\t\n\t\t// Delete users activity lists that haven't been active for a while\n\t\tDatabase::query(\"DELETE FROM friends_active WHERE uni_id IN (SELECT uni_id FROM users_activity WHERE last_activity <= ? LIMIT 2000)\", array($timestamp));\n\t}",
"function clear_private_infos(&$event,$allowed_participants = array())\n\t{\n\t\tif ($event == false) return;\n\t\tif (!is_array($event['participants'])) error_log(__METHOD__.'('.array2string($event).', '.array2string($allowed_participants).') NO PARTICIPANTS '.function_backtrace());\n\n\t\t$event = array(\n\t\t\t'id' => $event['id'],\n\t\t\t'start' => $event['start'],\n\t\t\t'end' => $event['end'],\n\t\t\t'tzid' => $event['tzid'],\n\t\t\t'title' => lang('private'),\n\t\t\t'modified'\t=> $event['modified'],\n\t\t\t'owner'\t\t=> $event['owner'],\n\t\t\t'recur_type' => MCAL_RECUR_NONE,\n\t\t\t'uid'\t=> $event['uid'],\n\t\t\t'etag'\t=> $event['etag'],\n\t\t\t'participants' => array_intersect_key($event['participants'],array_flip($allowed_participants)),\n\t\t\t'public'=> 0,\n\t\t\t'category' => $event['category'],\t// category is visible anyway, eg. by using planner by cat\n\t\t\t'non_blocking' => $event['non_blocking'],\n\t\t\t'caldav_name' => $event['caldav_name'],\n\t\t);\n\t}",
"public function unfavourite()\n {\n $this->favourites()->where(['user_id' => auth()->id()])->get()->each->delete();\n }",
"public function revoke();",
"public function revoke();",
"public function unlinkhasAccess(){\n $log = \"/REMOTE_ADDR: \".$_SERVER['REMOTE_ADDR'].\n \"/user_id: \".$_GET[\"user_id\"].$_POST[\"user_id\"].\n \"/referrer_type: \".$_GET[\"referrer_type\"].$_POST[\"referrer_type\"].PHP_EOL;\n file_put_contents('./unlinkCallBack_log_'.date(\"j.n.Y\").'.txt', $log, FILE_APPEND);\n }",
"private function deleteCommunaute() {\n if ($this->get_request_method() != \"DELETE\") {\n $this->response('', 406);\n }\n $suppression = $this->service->_deleteCommunaute($this->_request['communaute']);\n switch (true) {\n case $suppression > 0:\n $this->response('', 200);\n break;\n case $suppression == 0:\n $this->response('', 304);\n break;\n default:\n $this->response('', 500);\n break;\n }\n }",
"public function deleteFeedStream($action, $onlyCheckForNetwork = false) {\n if (empty($action))\n return;\n $settingsCoreApi = Engine_Api::_()->getApi('settings', 'core');\n if (!$onlyCheckForNetwork && !empty($settingsCoreApi->sitegroup_feed_type) && !empty($settingsCoreApi->sitegroup_feed_onlyliked)) {\n $streamTable = Engine_Api::_()->getDbtable('stream', 'activity');\n $streamTable->delete(array(\n 'action_id = ?' => $action->getIdentity(),\n 'target_type NOT IN(?)' => array('sitegroup_group', 'owner', 'parent')\n ));\n }\n\n $enableNetwork = $this->groupBaseNetworkEnable();\n $viewPricavyEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitegroup.networkprofile.privacy', 0);\n if ($enableNetwork && $viewPricavyEnable && $action->object_type = 'sitegroup_group') {\n $sitegroup = $action->getObject();\n if ($sitegroup->networks_privacy) {\n $groupNetworkIds = explode(\",\", $sitegroup->networks_privacy);\n if (count($groupNetworkIds)) {\n $streamTable = Engine_Api::_()->getDbtable('stream', 'activity');\n $streamTable->delete(array(\n 'action_id = ?' => $action->getIdentity(),\n 'target_type IN (?)' => array('everyone', 'registered', 'network', 'members')\n ));\n }\n $target_type = 'network';\n foreach ($groupNetworkIds as $target_id) {\n $streamTable->insert(array(\n 'action_id' => $action->action_id,\n 'type' => $action->type,\n 'target_type' => (string) $target_type,\n 'target_id' => (int) $target_id,\n 'subject_type' => $action->subject_type,\n 'subject_id' => $action->subject_id,\n 'object_type' => $action->object_type,\n 'object_id' => $action->object_id,\n ));\n }\n }\n }\n }",
"private function deleteUniqueLessons() {\n $result = eF_getTableData(\"lessons\", \"*\", \"originating_course=\".$this -> course['id']);\n foreach ($result as $value) {\n $value = new EfrontLesson($value);\n $value -> delete(false);\n }\n }",
"function removeSubscribed($catid, $userId) {\r\n\t\t$query = \"DELETE from interests WHERE userid='$userId' AND categoryid='$catid'\";\r\n\t\tmysql_query($query) or die();\r\n\t}",
"private function deleteUtilisateurCommunaute() {\n if ($this->get_request_method() != \"DELETE\") {\n $this->response('', 406);\n }\n $suppression = $this->service->_deleteUtilisateurCommunaute($this->_request['id_facebook'], $this->_request['communaute']);\n switch (true) {\n case $suppression > 0:\n $this->response('', 200);\n break;\n case $suppression == 0:\n $this->response('', 304);\n break;\n default:\n $this->response('', 500);\n break;\n }\n }",
"public function deleteUnusedDocumentRecords() {\n\t\t$nonDeletedRealtyRecordUids = $this->retrieveRealtyObjectUids();\n\t\t$documentsWithRealtyRecords = ($nonDeletedRealtyRecordUids == '')\n\t\t\t? array()\n\t\t\t: tx_oelib_db::selectColumnForMultiple(\n\t\t\t\t'uid', 'tx_realty_documents',\n\t\t\t\t'object IN (' . $nonDeletedRealtyRecordUids . ')' .\n\t\t\t\t\ttx_oelib_db::enableFields('tx_realty_documents', 1) .\n\t\t\t\t\t$this->additionalWhereClause\n\t\t\t);\n\t\t$this->addToStatistics(\n\t\t\t'Enabled document records with references to realty records',\n\t\t\tcount($documentsWithRealtyRecords)\n\t\t);\n\n\t\t$numberOfDeletedDocumentRecords = tx_oelib_db::update(\n\t\t\t'tx_realty_documents', (empty($documentsWithRealtyRecords)\n\t\t\t\t\t? '1=1'\n\t\t\t\t\t: 'uid NOT IN (' . implode(',', $documentsWithRealtyRecords) . ')'\n\t\t\t\t) . $this->additionalWhereClause,\n\t\t\tarray('deleted' => 1)\n\t\t);\n\t\t$this->addToStatistics(\n\t\t\t'Total deleted document records', $numberOfDeletedDocumentRecords\n\t\t);\n\t}",
"public function clear()\n {\n $user = auth()->user();\n if ($user->notifications()->delete()) {\n return StarJson::create(200);\n }\n return StarJson::create(403, '操作失败');\n }",
"function delete() {\n\t\t\t$this->API->call(\"subscriptions?id=\".$this->ID,false,\"DELETE\");\n\t\t}",
"function bbp_untrashed_topic($topic_id = 0)\n{\n}",
"function bbp_remove_user_engagement($user_id = 0, $topic_id = 0)\n{\n}",
"function deleteAction() {\n // Validate request methods\n $this->validateRequestMethod('DELETE');\n\n // Get params\n $is_owner = false;\n $comment_id = $this->getRequestParam('comment_id', null);\n $viewer = Engine_Api::_()->user()->getViewer();\n $activity_moderate = Engine_Api::_()->getDbtable('permissions', 'authorization')->getAllowed('user', $viewer->level_id, 'activity');\n\n // Check logged-in user ownership for feed.\n if (Engine_Api::_()->core()->hasSubject()) {\n $subject = Engine_Api::_()->core()->getSubject();\n if ($subject->getType() == 'siteevent_event' && ($subject->getParent()->getType() == 'sitepage_page' || $subject->getParent()->getType() == 'sitbusiness_business' || $subject->getParent()->getType() == 'sitegroup_group' || $subject->getParent()->getType() == 'sitestore_store')) {\n $subject = Engine_Api::_()->getItem($subject->getParent()->getType(), $subject->getParent()->getIdentity());\n }\n switch ($subject->getType()) {\n case 'user':\n $is_owner = $viewer->isSelf($subject);\n break;\n case 'sitepage_page':\n case 'sitebusiness_business':\n case 'sitegroup_group':\n case 'sitestore_store':\n $is_owner = $subject->isOwner($viewer);\n break;\n case 'sitepageevent_event':\n case 'sitebusinessevent_event':\n case 'sitegroupevent_event':\n case 'sitestoreevent_event':\n $is_owner = $viewer->isSelf($subject);\n if (empty($is_owner)) {\n $is_owner = $subject->getParent()->isOwner($viewer);\n }\n break;\n default :\n $is_owner = $viewer->isSelf($subject->getOwner());\n break;\n }\n }\n\n // Both the author and the person being written about get to delete the action_id\n if (!$comment_id && (\n $activity_moderate || $is_owner ||\n ('user' == $this->_action->subject_type && $viewer->getIdentity() == $this->_action->subject_id) || // owner of profile being commented on\n ('user' == $this->_action->object_type && $viewer->getIdentity() == $this->_action->object_id))) { // commenter\n // Delete action item and all comments/likes\n $db = Engine_Api::_()->getDbtable('actions', 'advancedactivity')->getAdapter();\n $db->beginTransaction();\n try {\n if ($this->_action->getTypeInfo()->commentable <= 1) {\n $comments = $this->_action->getComments(1);\n if ($comments) {\n foreach ($comments as $action_comments) {\n $action_comments->delete();\n }\n }\n }\n $this->_action->deleteItem();\n $db->commit();\n\n $this->successResponseNoContent('no_content', 'feed_index_homefeed');\n } catch (Exception $e) {\n $db->rollBack();\n $this->respondWithValidationError('internal_server_error', $e->getMessage());\n }\n } elseif ($comment_id) {\n $comment = $this->_action->comments()->getComment($comment_id);\n $db = Engine_Api::_()->getDbtable('comments', 'activity')->getAdapter();\n $db->beginTransaction();\n if ($activity_moderate || $is_owner ||\n ('user' == $comment->poster_type && $viewer->getIdentity() == $comment->poster_id) ||\n ('user' == $this->_action->object_type && $viewer->getIdentity() == $this->_action->object_id)) {\n try {\n $this->_action->comments()->removeComment($comment_id);\n $db->commit();\n\n $this->successResponseNoContent('no_content', 'feed_index_homefeed');\n } catch (Exception $e) {\n $db->rollBack();\n $this->respondWithValidationError('internal_server_error', $e->getMessage());\n }\n } else {\n $this->respondWithError('unauthorized');\n }\n }\n }",
"public function clearOlderAudits()\n {\n $auditsHistoryCount = $this->audits()->count();\n\n $auditsHistoryOlder = $auditsHistoryCount - $this->auditLimit;\n\n if (isset($this->auditLimit) && $auditsHistoryOlder > 0) {\n $this->audits()->orderBy('created_at', 'asc')\n ->limit($auditsHistoryOlder)->delete();\n }\n }",
"public function purgeData()\n {\n $maxIdVisit = $this->getDeleteIdVisitOffset();\n\n // break if no ID was found (nothing to delete for given period)\n if (empty($maxIdVisit)) {\n return;\n }\n\n $logTables = self::getDeleteTableLogTables();\n\n // delete data from log tables\n $where = \"WHERE idvisit <= ?\";\n foreach ($logTables as $logTable) {\n // deleting from log_action must be handled differently, so we do it later\n if ($logTable != Common::prefixTable('log_action')) {\n Db::deleteAllRows($logTable, $where, \"idvisit ASC\", $this->maxRowsToDeletePerQuery, array($maxIdVisit));\n }\n }\n\n // delete unused actions from the log_action table (but only if we can lock tables)\n if (Db::isLockPrivilegeGranted()) {\n $this->purgeUnusedLogActions();\n } else {\n $logMessage = get_class($this) . \": LOCK TABLES privilege not granted; skipping unused actions purge\";\n Log::warning($logMessage);\n }\n\n // optimize table overhead after deletion\n Db::optimizeTables($logTables);\n }"
] | [
"0.55886793",
"0.5560458",
"0.5521566",
"0.55215514",
"0.55109006",
"0.5492512",
"0.5425759",
"0.5417834",
"0.5411405",
"0.53770435",
"0.53579015",
"0.5344154",
"0.5327706",
"0.5326768",
"0.53264123",
"0.53264123",
"0.53092873",
"0.5306097",
"0.52858007",
"0.52386385",
"0.51914084",
"0.5181931",
"0.5169784",
"0.5168561",
"0.51608086",
"0.515377",
"0.5153691",
"0.51519763",
"0.5142696",
"0.5134935"
] | 0.561995 | 0 |
Relation to albums table where user is owner | public function ownAlbums() {
return $this->hasMany(Album::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function availableAlbums() {\n return $this->belongsToMany(Album::class, 'album_user');\n }",
"public function album() {\n\t\t # Define a one-to-many relationship. \n\t\t\treturn $this->hasMany('Album');\n\t\t}",
"public function album(){\n \treturn $this->belongsTo('App\\Album');\n }",
"public function album()\n {\n return $this->belongsTo('App\\Model\\Album');\n }",
"public function albums()\n\t{\n\t\treturn $this->hasMany(Album::class);\n\t}",
"public function album(){\n return $this->belongsTo(Album::class);\n }",
"public function album()\n {\n return $this->belongsTo(Album::class);\n }",
"public function albums() {\n return $this->belongsToMany(\"App\\Models\\Album\");\n }",
"public function owner()\n {\n \treturn $this->belongsTo(User::class, 'owner_uid', 'uid');\n }",
"public function owner() {\n \treturn $this->hasOne('\\App\\User', 'id', 'group_owner_id');\n }",
"public function owner()\n {\n return $this->belongsTo(User::class, 'owner_id');\n }",
"public function getAlbumsWithImages($user)\n {\n return $user->albums()->with('images')->get();\n }",
"public function owner()\n {\n return $this->belongsTo('App\\User','owner_id');\n }",
"public function owner() {\n return $this->belongsTo('App\\User', 'user_id');\n }",
"public function getAlbums($user)\n {\n return $user->albums()->get();\n }",
"public function getAlbum();",
"public function albums()\n {\n return $this->belongsToMany(Album::class);\n }",
"public function albumsWithOptionalUnsorted()\n\t{\n\t\treturn $this->hasMany(Album::class)\n\t\t\t\t\t->where(function($q) {\n\t\t\t\t\t\t$q->where('editable', '=', 1);\n\t\t\t\t\t})\n\t\t\t\t\t->orWhere(function($q) {\n\t\t\t\t\t\t$q->where('editable', '=', 0)->whereHas('photos');\n\t\t\t\t\t});\n\t}",
"public function owner()\n {\n return $this->belongsTo(config('auth.model'), 'owner_id');\n }",
"public function owner()\n {\n return $this->belongsToMany(\n User::class,\n 'store_owner',\n 'store_id',\n 'user_id'\n )->withTimeStamps();;\n }",
"public function owner()\n {\n return $this->belongsTo('Furniture\\User', 'created_by');\n }",
"public function owner()\n {\n return $this->belongsTo(Owner::class, 'owner_id', 'id');\n }",
"public function getAlbums();",
"public function owner()\n {\n return $this->belongsTo(User::class, 'user_id');\n }",
"public function owner(): BelongsTo\n {\n return $this->belongsTo(Owner::class, 'owner_id');\n }",
"public function owner() : BelongsTo\n {\n return $this->belongsTo(User::class, 'user_id');\n }",
"public function owner()\n {\n return $this->hasOne(User::class, 'id', 'owner_id');\n }",
"public function owner() {\n return $this->belongsTo(User::class);\n }",
"public function album(){\n return $this->hasMany('App\\Album','dept_id','id');\n }",
"public function owneruser()\n\t {\n\t\t return $this->belongsTo('RecipeApp\\User');\n\t }"
] | [
"0.6892383",
"0.66811377",
"0.6472789",
"0.6469812",
"0.6448306",
"0.6425453",
"0.64005184",
"0.62816775",
"0.6275691",
"0.6260784",
"0.62448317",
"0.6239325",
"0.6197726",
"0.61767256",
"0.61707425",
"0.61707425",
"0.6164254",
"0.6137219",
"0.611516",
"0.61143035",
"0.60827965",
"0.6023604",
"0.6018319",
"0.6013119",
"0.6010988",
"0.60058075",
"0.5988997",
"0.59598994",
"0.59508634",
"0.59218156"
] | 0.7149695 | 0 |
Relation to albums table through album_user table (many to many relation) | public function availableAlbums() {
return $this->belongsToMany(Album::class, 'album_user');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function albums() {\n return $this->belongsToMany(\"App\\Models\\Album\");\n }",
"public function ownAlbums() {\n return $this->hasMany(Album::class);\n }",
"public function albums()\n {\n return $this->belongsToMany(Album::class);\n }",
"public function albums()\n\t{\n\t\treturn $this->hasMany(Album::class);\n\t}",
"public function photos(){\n $this->hasMany(Photo::class, 'user_id', 'id');\n }",
"public function album() {\n\t\t # Define a one-to-many relationship. \n\t\t\treturn $this->hasMany('Album');\n\t\t}",
"public function getAlbumsWithImages($user)\n {\n return $user->albums()->with('images')->get();\n }",
"public function getAlbums();",
"public function albummusics()\n {\n return $this->belongsToMany('App\\Models\\Albummusic'); \t\n }",
"public function album(){\n return $this->hasMany('App\\Album','dept_id','id');\n }",
"public function getAlbums($user)\n {\n return $user->albums()->get();\n }",
"public function getAlbumList() {\n \n $albumList = [];\n foreach ($this->userAlbumList as $userAlbum) {\n $albumList[] = $userAlbum->album;\n }\n \n return $albumList;\n }",
"public function album(){\n \treturn $this->belongsTo('App\\Album');\n }",
"public function album(){\n return $this->belongsTo(Album::class);\n }",
"public function photoAlbumsAction()\n {\n \t$params=$this->getRequest()->getParams();\n \t\n\n \t//Fetching All albums of login user without filtering according to uid. \n \t\n \t// if user has passed uid in url.\n \tif( isset($params['uid']) )\n \t{\n \t\t$userObj = \\Extended\\ilook_user::getRowObject($params['uid']);\n \t\t//if user not found, redirect to error page.\n \t\tif(!$userObj)\n \t\t{\n \t\t\t$this->_helper->redirector('is-not-available', 'error', 'default', array('message'=>'Oops! this profile does not exists.'));\n \t\t}\n \t\t\n \t\t//Getting albums after filtering on basis of privacy.\n\t\t\t$filtered_albums = Extended\\socialise_album::getAlbums($params['uid'], Auth_UserAdapter::getIdentity()->getId());\n\n\t\t\tif(!($filtered_albums['album_info']) && Auth_UserAdapter::getIdentity()->getId() == $params['uid'] )\n\t\t\t{\n\t\t\t\t$this->view->loginUserAlbum=true;// variable to check that user is owner or not.\n\t\t\t}\n \t}\n \t// if user has not passed any uid in url.\n \telse if(!isset($params['uid']))\n \t{\n\n \t\t$this->view->loginUserAlbum=true;\n \t}\n else\n {\n \t$this->_helper->redirector('is-not-available', 'error', 'default' );\n }\n }",
"public function artists(){\n return $this->belongsToMany(User::class);\n }",
"public function album()\n {\n return $this->belongsTo('App\\Model\\Album');\n }",
"public function getPhotos()\n {\n return $this->hasMany(Photo::class, ['user_id' => 'id']);\n }",
"public function album()\n {\n return $this->belongsTo(Album::class);\n }",
"public function photos()\n {\n return $this->belongsToMany('App\\Photo');\n }",
"public function favorites(){\n \n \n return $this->belongsToMany(User::class,'favorites','ad_id','user_id');\n \n\n }",
"public function photoAlbumsProfileListingAction()\n\t{\n\t\t$photo_album = array ();\n\t\t$finalArr=array();\n\t\t\n\t\t$params = $this->getRequest()->getParams();\n\t\t\n\t\t$logged_in_user_id = Auth_UserAdapter::getIdentity()->getId();\n\t\t$userObj = Extended\\ilook_user::getRowObject( $params['uid'] );\n\t\t\n\t\t$user_album_count = \\Extended\\socialise_album::getUsersCountOfAlbum($params['uid']);\n\t\t\n\t\t\n\t\t$albums = array();\n\t\tif( $user_album_count )\n\t\t{\n\t\t\t//Code added by jsingh7=================\n\t\t\t$all_viewable_albums = \\Extended\\socialise_album::getAllAlbumIdsByPrivacy( $params['uid'], $logged_in_user_id );\n\t\t\t\n\t\t\t$offset = ( intval( $params['page'] ) - 1 ) * intval( $params['limit'] );\n\t\t\t\n\t\t\t$all_viewable_albums_fragment = array_slice($all_viewable_albums, $offset, $params['limit']);\n\t\t\t\n\t\t\t$total_fragments = ceil( count($all_viewable_albums)/ $params['limit'] );\n\t\t\tif($all_viewable_albums_fragment)\n\t\t\t{\n\t\t\t\t$albums = \\Extended\\socialise_album::getDetailOfAlbums( $all_viewable_albums_fragment );\n\t\t\t}\n\t\t\t$finalArr['is_there_more_albums'] = 1;\n\t\t\t\n\t\t\tif( $total_fragments == $params['page'] )\n\t\t\t{\n\t\t\t $finalArr['is_there_more_albums'] = 0;\n\t\t\t}\n\t\t\t//====================================\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//If array collection is available.\n\t\tif(\t$albums )\n\t\t{\n\t\t\tforeach( $albums as $key=>$album )\n\t\t\t{\n\t\t\t\t$album_cover = Extended\\socialise_photo::getCover( $album->getId() );//Geting cover photo of album.\n\t\t\t\t$photo_album ['id'] = $album->getId();//Id of album.\n\t\t\t\t$photo_album ['uid'] = $userObj->getId();//Id of owner of album.\n\t\t\t\t$photo_album ['photo_count'] = \\Extended\\socialise_photo::countAlbumImages($album->getId());//photo count of album.\n\t\t\t\t\n\t\t\t\t//if album_name is DEFAULT then store album name as album_default else append underscore and timestamp.\n\t\t\t\tif(strtolower( $album->getAlbum_name()) == strtolower(\\Extended\\socialise_album::DEFAULT_ALBUM_NAME)\n\t\t\t\t\t|| $album->getAlbum_name() == \\Extended\\socialise_album::PROFILE_PHOTOS_ALBUM_NAME\n\t\t\t\t\t|| $album->getAlbum_name() == \\Extended\\socialise_album::COVER_PHOTOS_ALBUM_NAME\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$albName= strtolower($album->getAlbum_name());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$albName = $album->getAlbum_name().\"_\".$album->getCreated_at_timestamp()->getTimestamp();\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//Storing album_name.\n\t\t\t\t$photo_album ['alb_name'] =\t$photo_album ['album_name'] = ucfirst(strtolower($album->getAlbum_display_name()));\n\t\t\t\t\n\t\t\t\tif( $album_cover )\n\t\t\t\t{\n\t\t\t\t\t//putting album name from $album_cover array into photo_album array.\n\t\t\t\t\t$realPath=REL_IMAGE_PATH.\"/albums/user_\".$params['uid'].\"/album_\".$albName.\"/gallery_thumbnails/thumbnail_\".$album_cover->getImage_name();\n\t\t\t\t\t\n\t\t\t\t\tif($album_cover->getImage_name()!=\"\" && file_exists($realPath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$photo_album ['socialise_albums_socialise_photo'] =IMAGE_PATH.\"/albums/user_\".$params['uid'].\"/album_\".$albName.\"/gallery_thumbnails/thumbnail_\".$album_cover->getImage_name();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$photo_album ['socialise_albums_socialise_photo'] = IMAGE_PATH.\"/no_image.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$photo_album ['socialise_albums_socialise_photo'] = IMAGE_PATH.\"/no_image.png\";\n\t\t\t\t}\n\t\t\t\t//Putting photo_album array into final array.\n\t\t\t\t$finalArr[\"album_info\"][] = $photo_album;\n\t\t\t}\n\t\t\t\n\t\t\t$finalArr[\"albums_owner_name\"] = $userObj->getFirstname().\" \".$userObj->getLastname();\n\t\t}\n\t\n\t\t//if user viewing his/her own profile and does not added any albums.\n\t\telse if( !$all_viewable_albums && $params['uid']== $logged_in_user_id )\n\t\t{\n\t\t\t$finalArr[\"login_user_no_album_msg\"] = \"You have not added any album\";\n\t\t}\n\t\t//if profile holder has not added any albums and some other user is viewing his/her profile.\n\t\telse if($user_album_count == 0 && $params['uid']!= $logged_in_user_id )\n\t\t{\n\t\t\t$finalArr[\"not_a_login_user_no_album_msg\"]= \"has not added albums.\";\n\t\t\t$finalArr['albums_owner_name'] = $userObj->getFirstname().\" \".$userObj->getLastname();\n\t\t}\n\t\t//if profile holder has not shared any album with current user.\n\t\telse if( !$all_viewable_albums && $params['uid'] != $logged_in_user_id && $user_album_count > 0 )\n\t\t{\n\t\t\t$finalArr[\"not_a_login_user_no_album_msg\"] = \"does not share any albums with you.\";\n\t\t\t$finalArr['albums_owner_name'] = $userObj->getFirstname().\" \".$userObj->getLastname();\n\t\t}\n\t\t\n\t\t//else just store album_owner_name in photo_album array.\n\t\telse \n\t\t{\n\t\t\t$finalArr[\"albums_owner_name\"] = $userObj->getFirstname().\" \".$userObj->getLastname();\n\t\t}\n\t\t\n\t\techo Zend_Json::encode($finalArr);\n\t\tdie;\n\t}",
"public function getPhotolibraries()\n {\n return $this->hasMany(Photolibrary::className(), ['create_user_id' => 'id']);\n }",
"public function getAlbumsByUser($user)\n {\n if(!$this->albums) {\n $this->albums = $this->entityManager->getRepository('KTUGalleryBundle:Album')\n ->findBy(['userId' => $user], ['id' => 'DESC']);\n }\n\n return $this->albums;\n }",
"public function getAlbum();",
"public function userBookPics()\n {\n return $this->hasMany('App\\Models\\UserBookPic', 'isbn', 'isbn');\n }",
"public function photos()\n {\n return $this->belongsToMany(Photo::class,$this->photo_table,\"sku_sku\",\"photo_id\")->withPivot($this->photoable)->withTimestamps();\n }",
"public function genres()\n {\n return $this->belongsToMany('App\\Genre', 'user_genre', 'user_id', 'genre_id');\n }",
"function se_album($user_id = 0) {\n\n\t $this->user_id = $user_id;\n\n\t}",
"public function get_albums()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t\n\t\t//getting log_user\n\t\t$log_user = $this->plugin->get('user')->id;\n\t\t\n\t\t//accepting user details.\t\n\t\t$uid = $app->input->get('uid',0,'INT');\n\t\t$type = $app->input->get('type',0,'STRING');\t\n\t\t$mapp = new EasySocialApiMappingHelper();\n\t\t//accepting pagination values.\n\t\t$limitstart = $app->input->get('limitstart',5,'INT');\n\t\t$limit = $app->input->get('limit',10,'INT');\t\t\n\t\t\n\t\t// taking values in array for pagination of albums.\t\t\n\t\t//$mydata['limitstart']=$limitstart;\n\t\t$mydata['excludeblocked'] = 1;\n\t\t$mydata['pagination'] = 1;\n\t\t//$mydata['limit'] = $limit;\n\t\t$mydata['privacy'] = true;\t\t\n\t\t$mydata['order'] = 'a.assigned_date';\t\t\n\t\t$mydata['direction'] = 'DESC';\t\t\n\t\t//creating object and calling relatvie method for data fetching.\n\t\t$obj = new EasySocialModelAlbums();\t\t\n\t\t\n\t\t//$obj->setState('limitstart',$limitstart);\n\t\t//$obj->setState('limit',$limit);\n\t\t\n\t\t//$obj->limitstart = $limitstart;\n\t\t//$obj->limit= $limit;\t\n\t\n\t\t// first param is user id,user type and third contains array for pagination.\n\t\t$albums = $obj->getAlbums($uid,$type,$mydata);\n\t\t//use to load table of album.\n\t\t$album = FD::table( 'Album' );\n\t\t\t\t\n\t\tforeach($albums as $album )\n\t\t{\n\t\t\tif($album->cover_id)\n\t\t\t{\n\t\t\t\t$album->load( $album->id );\n\t\t\t}\n\t\t$album->cover_featured = $album->getCover('featured');\n\t\t$album->cover_large = $album->getCover('large');\n\t\t$album->cover_square = $album->getCover('square');\n\t\t$album->cover_thumbnail = $album->getCover('thumbnail'); \t\t\n\t\t}\n\t\t\n\t\t//getting count of photos in every albums.\t\n\t\tforeach($albums as $alb)\n\t\t{\n\t\t $alb->count = $obj->getTotalPhotos($alb->id);\n\t\t}\t\t\n\t\t$all_albums = $mapp->mapItem($albums,'albums',$log_user);\n\t\t$output = array_slice($all_albums, $limitstart, $limit);\n\t\treturn $output;\n\t}"
] | [
"0.7085098",
"0.69117737",
"0.6901517",
"0.67470866",
"0.64718455",
"0.6398598",
"0.62744516",
"0.6223441",
"0.6130576",
"0.61185545",
"0.6098613",
"0.60527617",
"0.60259485",
"0.60222346",
"0.60018176",
"0.595428",
"0.5887685",
"0.5870965",
"0.5853037",
"0.5798869",
"0.57828456",
"0.57488465",
"0.56905615",
"0.5628575",
"0.55936795",
"0.5575674",
"0.55702573",
"0.5557159",
"0.5554613",
"0.5532613"
] | 0.7273804 | 0 |
Return associative array of own and available albums | public function allAlbums() {
// Get available albums list
$availableAlbums = $this->availableAlbums();
// Get own albums list
$ownAlbums = $this->ownAlbums();
// Initialize result array
$response = array();
// Add availableAlbums only if it not empty
if (sizeof($availableAlbums)>0) {
$response['availableAlbums'] = $availableAlbums;
}
// Add ownAlbums only if it not empty
if (sizeof($ownAlbums)>0) {
$response['ownAlbums'] = $ownAlbums;
}
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAlbums();",
"public function GetAlbums()\r\n\t{\r\n\t\terror_log(\"inicio GetAlbums \\n\",3,'/mnt/var/log/registro.log');\r\n\t\t\r\n\t\t$this->CheckToken();\r\n\r\n\t\t$albums = $this->api->getMySavedAlbums();\r\n\r\n\t\treturn $albums;\r\n\t}",
"public function getAlbumList() {\n \n $albumList = [];\n foreach ($this->userAlbumList as $userAlbum) {\n $albumList[] = $userAlbum->album;\n }\n \n return $albumList;\n }",
"public function getArrayObjAlbums()\n {\n return $this->arrayObjAlbums;\n }",
"function get_all_albums(){\n\t\t\t$albums = array();\n\t\t\t$sql = \"SELECT * FROM albums;\";\n\t\t\t$result = $this->connection->query($sql);\n\t\t\twhile ( $row = $result->fetch_row() ){\n\t\t\t\t$album = new Albums($row[0], $row[1], $row[2], $row[3], $row[4]);\n\t\t\t\t$albums[] = $album;\n\t\t\t}\n\t\t\treturn $albums;\n\t\t}",
"public function availableAlbums() {\n return $this->belongsToMany(Album::class, 'album_user');\n }",
"public function ownAlbums() {\n return $this->hasMany(Album::class);\n }",
"public function getAlbums() {\n\t\tif ($this->albums === null) {\n\t\t\t$this->loadElements();\n\t\t}\n\t\treturn $this->albums;\n\t}",
"public function get_albums(){\n $content = $this->google_curl->get(google_picasa::LIST_ALBUMS_URL);\n $xml = new SimpleXMLElement($content);\n\n $files = array();\n\n foreach($xml->entry as $album){\n $gphoto = $album->children('http://schemas.google.com/photos/2007');\n\n $mediainfo = $album->children('http://search.yahoo.com/mrss/');\n //hacky...\n $thumbnailinfo = $mediainfo->group->thumbnail[0]->attributes();\n\n $files[] = array( 'title' => (string) $gphoto->name,\n 'date' => userdate($gphoto->timestamp),\n 'size' => (int) $gphoto->bytesUsed,\n 'path' => (string) $gphoto->id,\n 'thumbnail' => (string) $thumbnailinfo['url'],\n 'thumbnail_width' => 160, // 160 is the native maximum dimension\n 'thumbnail_height' => 160,\n 'children' => array(),\n );\n\n }\n\n return $files;\n }",
"public function list_albums() {\n //Construct the MySQL select statement.\n $sql = \"SELECT * FROM \" . $this->db->getAlbumsTable();\n\n //execute the query\n $query = $this->dbConnection->query($sql);\n\n //handle the result\n if ($query && $query->num_rows > 0) {\n //create an array to store all returned albums\n $albums = array();\n\n //loop through all rows in the returned recordsets\n while ($query_row = $query->fetch_assoc()) {\n\n //create a Music object\n $album = new Album(\n $query_row['album_title'], $query_row['artist'], $query_row['release_date'], $query_row['image'], $query_row['genre'], $query_row['description']);\n\n //set the id for the album\n $album->setId($query_row[\"album_id\"]);\n //add the album into the array\n $albums[] = $album;\n }\n return $albums;\n }\n\n return false;\n }",
"public function getHiddenAlbums();",
"function getManagedAlbumList() {\n\tglobal $_zp_admin_album_list, $_zp_current_admin_obj;\n\t$_zp_admin_album_list = array();\n\tif (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {\n\t\t$sql = \"SELECT `folder` FROM \".prefix('albums').' WHERE `parentid` IS NULL';\n\t\t$albums = query_full_array($sql);\n\t\tforeach($albums as $album) {\n\t\t\t$_zp_admin_album_list[$album['folder']] = 32767;\n\t\t}\n\t} else {\n\t\t$sql = 'SELECT '.prefix('albums').'.`folder`,'.prefix('admin_to_object').'.`edit` FROM '.prefix('albums').', '.\n\t\t\t\t\t\tprefix('admin_to_object').' WHERE '.prefix('admin_to_object').'.adminid='.\n\t\t\t\t\t\t$_zp_current_admin_obj->getID().' AND '.prefix('albums').'.id='.prefix('admin_to_object').'.objectid AND `type`=\"album\"';\n\t\t$albums = query_full_array($sql);\n\t\tforeach($albums as $album) {\n\t\t\t$_zp_admin_album_list[$album['folder']] = $album['edit'];\n\t\t}\n\t}\n\treturn array_keys($_zp_admin_album_list);\n}",
"function GetAlbums( $ar = NULL) {\r\n addLog(\"mpd->GetAlbums()\");\r\n if ( is_null($resp = $this->SendCommand(MPD_CMD_TABLE, MPD_TBL_ALBUM, $ar ))) return NULL;\r\n $alArray = array();\r\n $alLine = strtok($resp,\"\\n\");\r\n $alName = \"\";\r\n $alCounter = -1;\r\n while ( $alLine ) {\r\n list ( $element, $value ) = explode(\": \",$alLine);\r\n if ( $element == \"Album\" ) {\r\n $alCounter++;\r\n $alName = $value;\r\n $alArray[$alCounter] = $alName;\r\n }\r\n $alLine = strtok(\"\\n\");\r\n }\r\n addLog(\"mpd->GetAlbums()\");\r\n return $alArray;\r\n }",
"protected function getClubPhotoAlbumsDatas(){\r\n // getting the member photos\r\n $memberPhotos = array();\r\n $photoAlbumsCount = 0;\r\n $clubPhotos = $this->_oDb->getMediaIds($this->clubDatas['id'], 'images');\r\n $images = array();\r\n if(sizeof($clubPhotos) > 0){\r\n foreach($clubPhotos as $clubPhoto){\r\n $a = array(\r\n 'ID' => $this->clubDatas['author_id'],\r\n 'Avatar' => $clubPhoto\r\n );\r\n $photo = BxDolService::call('photos', 'get_image', array($a, 'browse'), 'Search');\r\n if(!empty($photo['file'])){\r\n $images[] = $photo['file'];\r\n }\r\n $photoAlbumsCount++;\r\n }\r\n }\r\n\r\n if(sizeof($images) <= 0){\r\n $images = $this->getClubCoverOwnImages(BX_DIRECTORY_PATH_ROOT . 'modules/EmmetBytes/emmetbytes_club_cover/images/default_photo_icon.jpg');\r\n }\r\n $imageData = array(\r\n 'images' => $images,\r\n 'is_empty' => !$photoAlbumsCount,\r\n 'caption' => _t('_emmetbytes_club_cover_photo_albums_count_caption', $photoAlbumsCount),\r\n 'link' => '#',\r\n 'link_action' => 'onclick=\"return false;\"',\r\n 'addon_class' => '',\r\n );\r\n return array(\r\n 'content' => $this->getAddonDatasCommonContainer($imageData),\r\n 'count' => $photoAlbumsCount,\r\n );\r\n }",
"public function getAlbum();",
"function getArtistsAlbums()\n {\n $db = DatabaseProvider::getInstance();\n $sql = \"select folder, artist, album from music_combine group by folder, artist, album order by folder, artist, album\";\n $stmt = $db->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_NUM);\n $nodes = array();\n foreach($result as $row)\n {\n list($folder, $artist, $album) = $row;\n if(!isset($nodes[$folder]))\n {\n $nodes[$folder] = array();\n $nodes[$folder]['artists'] = array();\n $nodes[$folder]['albums'] = array();\n }\n $nodes[$folder]['artists'][] = $artist;\n $nodes[$folder]['albums'][] = $album;\n }\n $clean = array('folders' => array());\n foreach($nodes as $folder => $children)\n {\n $f = array(\n 'name' => $folder,\n 'artists' => array_values(array_unique($children['artists'])),\n 'albums' => array_values(array_unique($children['albums']))\n );\n $clean['folders'][] = $f;\n }\n return $clean;\n }",
"public function getAlbumPictures()\n\t{\n\t\t$pictures = array();\n\t\t$db_pictures = $this->pictures()->order_by('updated_at', 'desc')->get();\n\t\tforeach ($db_pictures as $value) \n\t\t{\n\t\t\t$pictures[] = $value->file_name;\n\t\t}\n\t\treturn $pictures;\n\t}",
"protected function getClubSoundAlbumsDatas(){\r\n $imagePath = $this->getClubCoverOwnImages(BX_DIRECTORY_PATH_ROOT . 'modules/EmmetBytes/emmetbytes_club_cover/images/default_sound_icon.jpg');\r\n $soundAlbumsCount = 0;\r\n $soundAlbums = $this->_oDb->getMediaIds($this->clubDatas['id'], 'sounds');\r\n if(sizeof($soundAlbums) > 0){\r\n foreach($soundAlbums as $soundAlbum){\r\n $a = BxDolService::call('sounds', 'get_music_array', array($soundAlbum), 'Search');\r\n if(!empty($a['file']) && $a['status'] == 'approved'){\r\n $images[] = $a['file'];\r\n $soundAlbumsCount++;\r\n }\r\n }\r\n }\r\n $imageData = array(\r\n 'images' => $imagePath,\r\n 'is_empty' => !$soundAlbumsCount,\r\n 'caption' => _t('_emmetbytes_club_cover_sound_albums_count_caption', $soundAlbumsCount),\r\n 'link' => '#',\r\n 'link_action' => 'onclick=\"return false;\"',\r\n 'addon_class' => '',\r\n );\r\n return array(\r\n 'count' => $soundAlbumsCount,\r\n 'content' => $this->getAddonDatasCommonContainer($imageData),\r\n );\r\n }",
"public function getAlbums($user)\n {\n return $user->albums()->get();\n }",
"function getNotViewableAlbums() {\n\tglobal $_zp_not_viewable_album_list;\n\tif (zp_loggedin(ADMIN_RIGHTS | MANAGE_ALL_ALBUM_RIGHTS)) return array(); //admins can see all\n\t$hint = '';\n\t$gallery = new Gallery();\n\tif (is_null($_zp_not_viewable_album_list)) {\n\t\t$sql = 'SELECT `folder`, `id`, `password`, `show` FROM '.prefix('albums').' WHERE `show`=0 OR `password`!=\"\"';\n\t\t$result = query_full_array($sql);\n\t\tif (is_array($result)) {\n\t\t\t$_zp_not_viewable_album_list = array();\n\t\t\tforeach ($result as $row) {\n\t\t\t\tif (checkAlbumPassword($row['folder'])) {\n\t\t\t\t\t$album = new Album($gallery, $row['folder']);\n\t\t\t\t\tif (!($row['show'] || $album->isMyItem(LIST_RIGHTS))) {\n\t\t\t\t\t\t$_zp_not_viewable_album_list[] = $row['id'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_zp_not_viewable_album_list[] = $row['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $_zp_not_viewable_album_list;\n}",
"public function getAlbums( $ar = null) {\n $this->debug(\"mpd->getAlbums()\");\n if ( is_null($resp = $this->sendCommand(self::CMD_TABLE, self::TBL_ALBUM, $ar ))) return null;\n $alArray = array();\n\n $alLine = strtok($resp,\"\\n\");\n $alName = \"\";\n $alCounter = -1;\n while ( $alLine ) {\n list ( $element, $value ) = explode(\": \",$alLine);\n if ( $element == \"Album\" ) {\n $alCounter++;\n $alName = $value;\n $alArray[$alCounter] = $alName;\n }\n\n $alLine = strtok(\"\\n\");\n }\n $this->debug(\"mpd->getAlbums()\");\n return $alArray;\n }",
"public function getAlbums()\n\t{\n $db = JFactory::getDbo();\n $query = $db->getQuery(true)\n ->select('COUNT(*)')\n ->from('#__hwdms_albums')\n ->where('status = ' . $db->quote(2));\n try\n {\n $db->setQuery($query);\n $count = $db->loadResult();\n }\n catch (RuntimeException $e)\n {\n $this->setError($e->getMessage());\n return false; \n }\n return $count;\n\t}",
"public function getAlbums(): GetAlbums\n {\n return new GetAlbums($this->_provider);\n }",
"protected function getClubVideoAlbumsDatas(){\r\n // getting the member photos\r\n $memberPhotos = array();\r\n $videoAlbumsCount = 0;\r\n $clubVideos = $this->_oDb->getMediaIds($this->clubDatas['id'], 'videos');\r\n $images = array();\r\n if(sizeof($clubVideos) > 0){\r\n foreach($clubVideos as $clubVideo){\r\n $a = BxDolService::call('videos', 'get_video_array', array($clubVideo), 'Search');\r\n if(!empty($a['file']) && $a['status'] == 'approved'){\r\n $images[] = $a['file'];\r\n $videoAlbumsCount++;\r\n }\r\n }\r\n }\r\n\r\n if(sizeof($images) <= 0){\r\n $images = $this->getClubCoverOwnImages(BX_DIRECTORY_PATH_ROOT . 'modules/EmmetBytes/emmetbytes_club_cover/images/default_video_icon.jpg');\r\n }\r\n\r\n $imageData = array(\r\n 'images' => $images,\r\n 'is_empty' => !$videoAlbumsCount,\r\n 'caption' => _t('_emmetbytes_club_cover_video_albums_count_caption', $videoAlbumsCount),\r\n 'link' => '#',\r\n 'link_action' => 'onclick=\"return false;\"',\r\n 'addon_class' => '',\r\n );\r\n return array(\r\n 'content' => $this->getAddonDatasCommonContainer($imageData),\r\n 'count' => $photoAlbumsCount,\r\n );\r\n }",
"function get_albums($cond = NULL,$limit = NULL,$start_limit = NULL)\n\t{\n\t\t$output = array();\n\t //$session_user_id = $this->session->userdata('user')->id;\n\t\t$this -> db -> select('id,name');\n\t\t$this -> db -> from('albums');\n\n\t\tif($cond != NULL)\n\t\t\t$where = \"(status='y' AND userId = '\".$this->sess_id.\"' AND \".$cond.\")\";\t\n\t\telse\n\t\t\t$where = \"(status='y' AND userId = '\".$this->sess_id.\"')\";\n\n\t\tif($limit != NULL)\n\t\t\t$this -> db -> limit($limit);\n\n\t\t$this->db->where($where);\t \n\t\t$this->db->order_by(\"id\");\n\t\t$query = $this -> db -> get();\t \n\t //print $this -> db ->last_query();\n\t\tif($query -> num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t\treturn $output;\n\t\t}\t \n\t}",
"public function albums()\n\t{\n\t\treturn $this->hasMany(Album::class);\n\t}",
"public function getOtherAlbumsForUserAction(){\n\t\t$finalArr=array();\n\t\t$params = $this->getRequest()->getParams();\n\t\t$resultArr=Extended\\socialise_album::getRemainingAlbumListing($params[\"albumID\"], Auth_UserAdapter::getIdentity()->getId());\n\t\tfor($i=0;$i<count($resultArr);$i++)\n\t\t{\n\t\t\t$finalArr[$i]=array(\"id\"=>$resultArr[$i]['id'],\"album_name\"=>$resultArr[$i]['album_display_name']);\n\t\t}\n\t\techo Zend_Json::encode($finalArr);\n\t\tdie;\n\t}",
"public function get_albums()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t\n\t\t//getting log_user\n\t\t$log_user = $this->plugin->get('user')->id;\n\t\t\n\t\t//accepting user details.\t\n\t\t$uid = $app->input->get('uid',0,'INT');\n\t\t$type = $app->input->get('type',0,'STRING');\t\n\t\t$mapp = new EasySocialApiMappingHelper();\n\t\t//accepting pagination values.\n\t\t$limitstart = $app->input->get('limitstart',5,'INT');\n\t\t$limit = $app->input->get('limit',10,'INT');\t\t\n\t\t\n\t\t// taking values in array for pagination of albums.\t\t\n\t\t//$mydata['limitstart']=$limitstart;\n\t\t$mydata['excludeblocked'] = 1;\n\t\t$mydata['pagination'] = 1;\n\t\t//$mydata['limit'] = $limit;\n\t\t$mydata['privacy'] = true;\t\t\n\t\t$mydata['order'] = 'a.assigned_date';\t\t\n\t\t$mydata['direction'] = 'DESC';\t\t\n\t\t//creating object and calling relatvie method for data fetching.\n\t\t$obj = new EasySocialModelAlbums();\t\t\n\t\t\n\t\t//$obj->setState('limitstart',$limitstart);\n\t\t//$obj->setState('limit',$limit);\n\t\t\n\t\t//$obj->limitstart = $limitstart;\n\t\t//$obj->limit= $limit;\t\n\t\n\t\t// first param is user id,user type and third contains array for pagination.\n\t\t$albums = $obj->getAlbums($uid,$type,$mydata);\n\t\t//use to load table of album.\n\t\t$album = FD::table( 'Album' );\n\t\t\t\t\n\t\tforeach($albums as $album )\n\t\t{\n\t\t\tif($album->cover_id)\n\t\t\t{\n\t\t\t\t$album->load( $album->id );\n\t\t\t}\n\t\t$album->cover_featured = $album->getCover('featured');\n\t\t$album->cover_large = $album->getCover('large');\n\t\t$album->cover_square = $album->getCover('square');\n\t\t$album->cover_thumbnail = $album->getCover('thumbnail'); \t\t\n\t\t}\n\t\t\n\t\t//getting count of photos in every albums.\t\n\t\tforeach($albums as $alb)\n\t\t{\n\t\t $alb->count = $obj->getTotalPhotos($alb->id);\n\t\t}\t\t\n\t\t$all_albums = $mapp->mapItem($albums,'albums',$log_user);\n\t\t$output = array_slice($all_albums, $limitstart, $limit);\n\t\treturn $output;\n\t}",
"public function testListAlbums()\n\t{\n\t\t$this->http->expects($this->once())->method('get')->will($this->returnCallback('picasaAlbumlistCallback'));\n\t\t$results = $this->object->listAlbums('userID');\n\n\t\t$this->assertCount(2, $results);\n\t\t$i = 1;\n\n\t\tforeach ($results as $result)\n\t\t{\n\t\t\t$this->assertEquals(get_class($result), 'JGoogleDataPicasaAlbum');\n\t\t\t$this->assertEquals($result->getTitle(), 'Album ' . $i);\n\t\t\t$i++;\n\t\t}\n\t}",
"function gdata_album($pwa_options, $test=0) {\r\n\r\n/*\t\t\tif (!empty($pwa_pro)) {\r\n\t\t\t\t//$pwa_options = pwa_pro::cache_xml($pwa_options);\r\n\t\t\t\t$album = pwa_pro::gdata_album_pro($pwa_options, $test);\r\n\t\t\t\treturn $album;\r\n\t\t\t}*/\r\n\r\n\t\t\t$GDATA_TOKEN = get_option(c_pwa_gdata_token);\r\n\t\t\t$temp_file=$pwa_options['FILE'];\r\n\t\t\tif (self::Public_Only() == \"FALSE\") $temp_file .= \"&access_token=\". $GDATA_TOKEN;\r\n\t\t\t$file = (array_key_exists('SAVEFILE',$pwa_options)) ? $pwa_options['SAVEFILE'] : $temp_file;\r\n\t\t\t$feed = simplexml_load_file($file);\r\n\t\t\t$namespaces = $feed->getNamespaces(true);\r\n\t\t\t$album = array();\r\n\t\t\t$i=0;\r\n\t\t\t$opensearch = $feed->children($namespaces['openSearch']);\r\n\t\t\t$total = $opensearch->totalResults;\r\n\r\n\t\t\tforeach ($feed->entry as $entry) {\r\n\t\t\t\t$access\t= trim($entry->rights);\r\n\t\t\t\t$public = strrpos(get_option(c_pwa_access), 'public');\r\n\t\t\t\t$protected = strrpos(get_option(c_pwa_access), 'protected');\r\n\t\t\t\t$private = strrpos(get_option(c_pwa_access), 'private');\r\n\r\n\t\t\t\tif ((($public !== false) && ($access == 'public')) ||\r\n\t\t\t\t\t(($protected !== false) && ($access == 'protected')) ||\r\n\t\t\t\t\t(($private !== false) && ($access == 'private'))) {\r\n\r\n\t\t\t\t\t$album[$i]['total'] = $total;\r\n\t\t\t\t\t$album[$i]['id'] = trim($entry->id);\r\n\t\t\t\t\t$album[$i]['published'] = trim($entry->published);\r\n\t\t\t\t\t$album[$i]['updated'] = trim($entry->updated);\r\n\t\t\t\t\t$album[$i]['title'] = trim($entry->title);\r\n\t\t\t\t\t$album[$i]['summary'] = trim($entry->summary);\r\n\t\t\t\t\t$album[$i]['rights'] = $access;\r\n\t\t\t\t\t$album[$i]['link'] = trim($entry->link->attributes()->href);\r\n\r\n\t\t\t\t\t# Gphoto\r\n\t\t\t\t\t$gphoto = $entry->children($namespaces['gphoto']);\r\n\t\t\t\t\t$album[$i]['gphoto:name'] = trim($gphoto->name);\r\n\t\t\t\t\t$album[$i]['gphoto:location'] = trim($gphoto->location);\r\n\t\t\t\t\t$album[$i]['gphoto:access'] = trim($gphoto->access);\r\n\t\t\t\t\t$album[$i]['gphoto:timestamp'] = trim($gphoto->timestamp);\r\n\t\t\t\t\t$album[$i]['gphoto:numphotos'] = trim($gphoto->numphotos);\r\n\r\n\t\t\t\t\t# Media:Group\r\n\t\t\t\t\t$media = $entry->children($namespaces['media'])\r\n\t\t\t\t\t\t->group\r\n\t\t\t\t\t\t->children($namespaces['media']);\r\n\t\t\t\t\t$album[$i]['media:description'] = trim($media->description);\r\n\t\t\t\t\t$album[$i]['media:thumbnail'] = trim($media->thumbnail->attributes()->url);\r\n\t\t\t\t\t$album[$i]['media:title'] = trim($media->title);\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($test==1) { echo \"File: $file<br>\"; self::test_xml($album); }\r\n\t\t\treturn $album;\r\n\t\t}"
] | [
"0.8025306",
"0.75693274",
"0.7285406",
"0.7280406",
"0.7248381",
"0.7184886",
"0.71230084",
"0.70974886",
"0.70513976",
"0.7031554",
"0.69853836",
"0.69807225",
"0.6973942",
"0.6911087",
"0.6858694",
"0.6823741",
"0.6774171",
"0.6681328",
"0.66428727",
"0.6601722",
"0.65652853",
"0.6546114",
"0.65360636",
"0.65278584",
"0.65260094",
"0.6516739",
"0.64947927",
"0.64918286",
"0.6447909",
"0.6446583"
] | 0.77283543 | 1 |
Check if user is editor of album | public function editor(Album $album) {
return in_array($this, array($album->availableUsers()
->wherePivot('permission' == 'write')));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n $user = Auth::user();\n $id = $this->get('id');\n $album = $user->albums()->find($id);\n return $album ? true : false;\n }",
"public function getIsEditor()\n {\n return $this->hasRole(Role::GROUP_EDITOR);\n }",
"public function isOwner()\n {\n return $this->user_type == static::OWNER;\n }",
"public function isOwner(){\n return auth()->id() == $this->user_id;\n }",
"public function isAlbumable()\n {\n return in_array(\n 'Sharenjoy\\Cmsharenjoy\\Filer\\AlbumTrait',\n $this->getReflection()->getTraitNames()\n );\n }",
"function local_mediaserver_user_can_edit(stdClass $stream) {\n global $USER;\n\n $context = context_system::instance();\n\n return ($stream->userid == $USER->id || has_capability('local/mediaserver:edit', $context));\n}",
"protected function isUserOwner() {\n $estateOwnerId = $this->findModel(Yii::$app->request->get('id'))->getBill()->one()->getEstate()->one()->user_id;\n return $estateOwnerId == Yii::$app->user->id;\n }",
"static public function isPotentialEditor($user = false)\n {\n if ($user === false)\n {\n $user = sfContext::getInstance()->getUser();\n }\n // Rule 1: admin can do anything\n // Work around a bug in some releases of sfDoctrineGuard: users sometimes\n // still have credentials even though they are not logged in\n if ($user->isAuthenticated() && $user->hasCredential('cms_admin'))\n {\n return true;\n }\n\n // The editor permission, which (like the editor group) makes you a candidate to edit\n // if actually granted that privilege somewhere in the tree (via membership in a group\n // that has the editor permission), is generally received from a group. In older installs the\n // editor group itself won't have it, so we still check by other means (see below).\n if ($user->isAuthenticated() && $user->hasCredential(sfConfig::get('app_a_group_editor_permission', 'editor')))\n {\n return true;\n }\n\n $sufficientCredentials = sfConfig::get(\"app_a_edit_sufficient_credentials\", false);\n $sufficientGroup = sfConfig::get(\"app_a_edit_sufficient_group\", false);\n $candidateGroup = sfConfig::get(\"app_a_edit_candidate_group\", false);\n // By default users must log in to do anything except view\n $loginRequired = sfConfig::get(\"app_a_edit_login_required\", true);\n\n if ($loginRequired)\n {\n if (!$user->isAuthenticated())\n {\n return false;\n }\n // Rule 3: if there are no sufficient credentials and there is no\n // required or sufficient group, then login alone is sufficient. Common\n // on sites with one admin\n if (($sufficientCredentials === false) && ($candidateGroup === false) && ($sufficientGroup === false))\n {\n // Logging in is the only requirement\n return true;\n }\n // Rule 4: if the user has sufficient credentials... that's sufficient!\n // Many sites will want to simply say 'editors can edit everything' etc\n if ($sufficientCredentials &&\n ($user->hasCredential($sufficientCredentials)))\n {\n\n return true;\n }\n if ($sufficientGroup &&\n ($user->hasGroup($sufficientGroup)))\n {\n return true;\n }\n\n // Rule 5: if there is a candidate group, make sure the user is a member\n if ($candidateGroup &&\n (!$user->hasGroup($candidateGroup)))\n {\n return false;\n }\n return true;\n }\n else\n {\n // No login required\n return true;\n }\n }",
"function user_can_edit() {\n\tif( current_user_can('administrator')) {\n\t\treturn true;\n\t}\n\n\t// si logged in\n\tif( is_user_logged_in() ) {\n\t\t// si auteur\n\t\tif( current_user_can('author')) {\n\t\t\t// si editor\n\t\t\tif(can_user_edit_project()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}",
"private function isOwner(): bool {\n $id = $this->getParameter('id');\n return isset($id) && $this->getUser()->getIdentity()->teacherId === $id;\n }",
"function bbp_is_single_user_edit()\n{\n}",
"function isOwner( $user, $folderID )\r\n {\r\n if ( !is_a( $user, \"eZUser\" ) )\r\n return false;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $res, \"SELECT UserID from eZFileManager_Folder WHERE ID='$folderID'\");\r\n $userID = $res[$db->fieldName( \"UserID\" )];\r\n if ( $userID == $user->id() )\r\n return true;\r\n\r\n return false;\r\n }",
"function isOwner($user_id, $article_id) {\n $result = false;\n $article= model_get_article($article_id);\n if($article[\"article_authorid\"] == $user_id){\n $result=true;\n }\n return $result;\n }",
"private function isAllowedEditor($editorUid) {\n\t\t// 1. No edit groups are set or\n\t\t// 2. if they are set, it is in one of the edit groups\n\t\t$editGroups = \\array_filter(\\explode('|', $this->appConfig->getAppValue('edit_groups')));\n\t\t$isAllowed = true;\n\t\tif (\\count($editGroups) > 0) {\n\t\t\t$editor = $this->userManager->get($editorUid);\n\t\t\tif (!$editor) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$isAllowed = false;\n\t\t\tforeach ($editGroups as $editGroup) {\n\t\t\t\t$editorGroup = $this->groupManager->get($editGroup);\n\t\t\t\tif ($editorGroup !== null && $editorGroup->inGroup($editor)) {\n\t\t\t\t\t$this->logger->debug(\"Editor {editor} is in edit group {group}\", [\n\t\t\t\t\t\t'app' => $this->appName,\n\t\t\t\t\t\t'editor' => $editorUid,\n\t\t\t\t\t\t'group' => $editGroup\n\t\t\t\t\t]);\n\t\t\t\t\t$isAllowed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $isAllowed;\n\t}",
"protected function isUserOwner() {\n $userId = $this->findModel(Yii::$app->request->get('id'))->getEstate()->one()->user_id;\n return $userId == Yii::$app->user->id;\n }",
"public function isOwned() {\n\t\t$logged = Common::getLoggedUser();\n\t\t// si es administrador (level <=2) es propietario\n\t\tif ($logged->getLevelId() <= 2) \n\t\t\treturn true;\n\t\telse {\n\t\t\t$queryClass = $this->getUserObjectType() . 'Query';\n\t\t\tif (class_exists($queryClass)) {\n\t\t\t\t$author = $queryClass::create()->findOneById($this->getUserObjectId());\n\t\t\t\t// lo dejo editar si es el creado\n\t\t\t\tif(!empty($author) && (get_class($logged) == get_class($author) && $logged->getId() == $author->getId()))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t}",
"public static function isEditor()\n {\n if (php_uname('n') === 'eurybe' /*&& PHP_SAPI == 'cli'*/) {\n // for now only allow editing on phoebe\n return true;\n }\n if (php_uname('n') === 'phoebe' /*&& PHP_SAPI == 'cli'*/) {\n // for now only allow editing on phoebe\n return true;\n }\n \n return false;\n }",
"public function authorize()\n {\n if ($this->getSubtitle()->isEditable()\n && $this->getVersion()\n && ! $this->getVersion()->isOwner()\n ) {\n return true;\n }\n return false;\n }",
"function isOwner($user, $profileOwner){\n if ($user==$profileOwner) {\n return true;\n }\n else{\n return false;\n }\n }",
"public function isAuthor()\n {\n return ($this->get('user_type') == 'author');\n }",
"function _can_manage_content_entity($entity, $managingUser = null)\n{\n if (!$managingUser && \\Auth::check()) $managingUser = \\Auth::user();\n\n // if user found and this user is the entity author, return TRUE\n return ($managingUser && (($managingUser->id == $entity->user->id) || $managingUser->is_admin));\n}",
"private function checkUser($id_editor) {\n\t\tif ($this->getUser()->roles[\"Admin\"] != \"1\" && $this->getUser()->id != $id_editor) {\n\t\t\t$this->flashMessages->flashMessageAuthentification(\"Tento článek nemůžete upravovat.\");\n\t\t\t$this->redirect(\"default\");\n\t\t}\n\t}",
"public function isOwner($content)\n {\n return true;\n }",
"public static function is_owner($id, $type){\n\t\tif(UserSession::is_authorized()){\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'project':\n\t\t\t\t\treturn static::is_project_owner($id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'article':\n\t\t\t\t\treturn static::is_article_owner($id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'event':\n\t\t\t\t\treturn static::is_event_owner($id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job':\n\t\t\t\t\treturn static::is_job_owner($id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'comment':\n\t\t\t\t\treturn static::is_comment_owner($id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\treturn UserSession::is_current($id);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"function wine_can_edit_discussion($entity, $wine_owner) {\n\n\t//logged in user\n\t$user = elgg_get_logged_in_user_guid();\n\n\tif (($entity->owner_guid == $user) || $wine_owner == $user || elgg_is_admin_logged_in()) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function canSee(Album $album) {\n return in_array($this, array($album->availableUsers()) );\n }",
"static public function isPotentialEditor($user = false)\n {\n if ($user === false)\n {\n $user = sfContext::getInstance()->getUser();\n }\n // Rule 1: admin can do anything\n // Work around a bug in some releases of sfDoctrineGuard: users sometimes\n // still have credentials even though they are not logged in\n if ($user->isAuthenticated() && $user->hasCredential('cms_admin'))\n {\n return true;\n }\n $sufficientCredentials = sfConfig::get(\"app_pkContextCMS_edit_sufficient_credentials\", false);\n $sufficientGroup = sfConfig::get(\"app_pkContextCMS_edit_sufficient_group\", false);\n $candidateGroup = sfConfig::get(\"app_pkContextCMS_edit_candidate_group\", false);\n // By default users must log in to do anything except view\n $loginRequired = sfConfig::get(\"app_pkContextCMS_edit_login_required\", true);\n \n if ($loginRequired)\n {\n if (!$user->isAuthenticated())\n {\n return false;\n }\n // Rule 3: if there are no sufficient credentials and there is no\n // required or sufficient group, then login alone is sufficient. Common \n // on sites with one admin\n if (($sufficientCredentials === false) && ($candidateGroup === false) && ($sufficientGroup === false))\n {\n // Logging in is the only requirement\n return true; \n }\n // Rule 4: if the user has sufficient credentials... that's sufficient!\n // Many sites will want to simply say 'editors can edit everything' etc\n if ($sufficientCredentials && \n ($user->hasCredential($sufficientCredentials)))\n {\n \n return true;\n }\n if ($sufficientGroup && \n ($user->hasGroup($sufficientGroup)))\n {\n return true;\n }\n\n // Rule 5: if there is a candidate group, make sure the user is a member\n if ($candidateGroup && \n (!$user->hasGroup($candidateGroup)))\n {\n return false;\n }\n return true;\n }\n else\n {\n // No login required\n return true;\n } \n \n // Rule 6: when minimum but not sufficient credentials are present,\n // check for an explicit grant of privileges to this user, on\n // this page or on any ancestor page.\n $result = $this->userHasExplicitPrivilege($privilege);\n if ($result)\n {\n return true;\n }\n }",
"function is_editable($sessionid,$onebook){\n $book_arr=explode('@',$onebook);\n $author=$book_arr[0];\n if(empty($author) || $sessionid!=$author){\n return false;\n }\n //all ok\n return true;\n }",
"public function getTypeEditor($book)\n\t{\n\t\treturn $book->bookable_type == 'App\\Models\\Editor';\n\t}",
"public function isAuthor(object $gateauOrRecette) {\n\n if($this->id == $gateauOrRecette->user_id) {\n return true;\n }\n else {\n return false;\n }\n\n}"
] | [
"0.6496422",
"0.6418966",
"0.6042241",
"0.5953329",
"0.5866177",
"0.58638364",
"0.58499193",
"0.58414876",
"0.5838322",
"0.58220035",
"0.5820353",
"0.5790043",
"0.57587147",
"0.5757532",
"0.57274383",
"0.57196647",
"0.571742",
"0.56891036",
"0.56872743",
"0.5632255",
"0.5625339",
"0.5618894",
"0.56017977",
"0.5587148",
"0.55845594",
"0.55728304",
"0.5555434",
"0.5545135",
"0.55399114",
"0.5533029"
] | 0.735385 | 0 |
Check if user have permission to see album | public function canSee(Album $album) {
return in_array($this, array($album->availableUsers()) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n $user = Auth::user();\n $id = $this->get('id');\n $album = $user->albums()->find($id);\n return $album ? true : false;\n }",
"function hasPermission($itemId) {\r\n global $gallery,$userId;\r\n if (!$userId) {\r\n $userId = $gallery->getActiveUserId();\r\n }\r\n if (!$userId) {\r\n list($ret, $userId) = GalleryCoreApi::getAnonymousUserId();\r\n }\r\n list($ret, $ok) = GalleryCoreApi::hasItemPermission($itemId, 'core.view', $userId);\r\n if ($ret || !$ok) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"public function authorize()\n {\n $song = Song::find($this->id);\n\n if (!$song) {\n abort(404);\n }\n\n return $song->user_id == $this->user()->id;\n }",
"public function show(Album $album)\n {\n\n # if($album->user_id == Auth::id()){\n return $album;\n #}\n #abort(401);\n }",
"function albumPrivacy()\r\n {\r\n global $mainframe, $mosConfig_live_site, $Itemid, $my;\r\n $db =& JFactory::getDBO();\r\n\r\n $my = & JFactory::getUser();\r\n\r\n //check valid user\r\n if (!$my->id) {\r\n $msg = _HWDPS_ALERT_LOGFORPRIVACY;\r\n $mainframe->enqueueMessage($msg);\r\n $mainframe->redirect( JURI::root( true ) . \"/index.php?option=com_hwdphotoshare\" );\r\n }\r\n\r\n $query = 'SELECT *'\r\n . ' FROM #__hwdpsalbums'\r\n . ' WHERE user_id = '.$my->id\r\n . ' AND approved = \"yes\"'\r\n . ' ORDER BY date_created DESC'\r\n ;\r\n\r\n $db->SetQuery($query);\r\n $rows = $db->loadObjectList();\r\n\r\n hwd_ps_html::albumPrivacy($rows);\r\n }",
"public function authorize()\n {\n //$album = \\App\\Models\\Album::find($this->id);\n /*\n if (Gate::denies('update', $album)){\n return false;\n }\n */\n return true;\n }",
"public function isAlbumable()\n {\n return in_array(\n 'Sharenjoy\\Cmsharenjoy\\Filer\\AlbumTrait',\n $this->getReflection()->getTraitNames()\n );\n }",
"public function can_see() {\n\t\tglobal $I2_USER;\n\n\t\tif ($I2_USER->is_group_member('admin_podcasts'))\n\t\t\treturn TRUE;\n\t\tif (!$this->visibility)\n\t\t\treturn FALSE;\n\n\t\t$ugroups = Group::get_user_groups($I2_USER);\n\t\tforeach ($ugroups as $g) {\n\t\t\tif (isset($this->gs[$g->gid]))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function photoAlbumsAction()\n {\n \t$params=$this->getRequest()->getParams();\n \t\n\n \t//Fetching All albums of login user without filtering according to uid. \n \t\n \t// if user has passed uid in url.\n \tif( isset($params['uid']) )\n \t{\n \t\t$userObj = \\Extended\\ilook_user::getRowObject($params['uid']);\n \t\t//if user not found, redirect to error page.\n \t\tif(!$userObj)\n \t\t{\n \t\t\t$this->_helper->redirector('is-not-available', 'error', 'default', array('message'=>'Oops! this profile does not exists.'));\n \t\t}\n \t\t\n \t\t//Getting albums after filtering on basis of privacy.\n\t\t\t$filtered_albums = Extended\\socialise_album::getAlbums($params['uid'], Auth_UserAdapter::getIdentity()->getId());\n\n\t\t\tif(!($filtered_albums['album_info']) && Auth_UserAdapter::getIdentity()->getId() == $params['uid'] )\n\t\t\t{\n\t\t\t\t$this->view->loginUserAlbum=true;// variable to check that user is owner or not.\n\t\t\t}\n \t}\n \t// if user has not passed any uid in url.\n \telse if(!isset($params['uid']))\n \t{\n\n \t\t$this->view->loginUserAlbum=true;\n \t}\n else\n {\n \t$this->_helper->redirector('is-not-available', 'error', 'default' );\n }\n }",
"public function authorize()\n {\n $chatId = $this->chat_id;\n return empty($chatId) || $this->user()->can('uploadPhoto', Chat::find($chatId));\n }",
"public function verify_is_album($albumId){\n\t\t\n\t\tif (!$this->user)\n\t\t\theader('location: '. PUBLIC_BASE_URL);\n\t\t\n\t\t$album_ids = $this->user->get_all_albums_ids();\n\t\tif(!isset($album_ids[$albumId])){\n\t\t\theader('location: '. PUBLIC_404_URL);\n\t\t}\t\t\n\t}",
"public function hasAccess();",
"public function has_permission() {\n\t\treturn current_user_can( 'rank_math_analytics' );\n\t}",
"public function authorize()\n {\n $user = app( 'auth' )->user();\n $el = Musicalbum::findOrFail( $this->route('id') );\n\n return $user->isId( $el->user_id );\n }",
"public function authorize(): bool\n {\n return Gate::allows('admin.song-collection.edit', $this->songCollection);\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n if ($user = $this->owner_id) {\n return true;\n } else {\n return false;\n }\n }",
"function _hasAccess()\r\n {\r\n // create user object\r\n $user =& User::singleton();\r\n\r\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\r\n $candID = $timePoint->getCandID();\r\n\r\n $candidate =& Candidate::singleton($candID);\r\n\r\n // check user permissions\r\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\r\n }",
"public function editor(Album $album) {\n return in_array($this, array($album->availableUsers()\n ->wherePivot('permission' == 'write')));\n }",
"public function canAccess();",
"public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Voyager::model('User'));\n }",
"public function authorize() {\n\t\treturn $this->user()->can('create', ArtistManager::class);\n\t}",
"public function getPublic(AlbumIDRequest $request)\n\t{\n\t\t$request->validate([\n\t\t\t'password' => 'string|nullable',\n\t\t]);\n\n\t\treturn $this->albumFunctions->unlockAlbum($request['albumID'], $request['password']) ? 'true' : 'false';\n\t}",
"function getNotViewableAlbums() {\n\tglobal $_zp_not_viewable_album_list;\n\tif (zp_loggedin(ADMIN_RIGHTS | MANAGE_ALL_ALBUM_RIGHTS)) return array(); //admins can see all\n\t$hint = '';\n\t$gallery = new Gallery();\n\tif (is_null($_zp_not_viewable_album_list)) {\n\t\t$sql = 'SELECT `folder`, `id`, `password`, `show` FROM '.prefix('albums').' WHERE `show`=0 OR `password`!=\"\"';\n\t\t$result = query_full_array($sql);\n\t\tif (is_array($result)) {\n\t\t\t$_zp_not_viewable_album_list = array();\n\t\t\tforeach ($result as $row) {\n\t\t\t\tif (checkAlbumPassword($row['folder'])) {\n\t\t\t\t\t$album = new Album($gallery, $row['folder']);\n\t\t\t\t\tif (!($row['show'] || $album->isMyItem(LIST_RIGHTS))) {\n\t\t\t\t\t\t$_zp_not_viewable_album_list[] = $row['id'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_zp_not_viewable_album_list[] = $row['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $_zp_not_viewable_album_list;\n}",
"public function authorize()\n {\n return $this->user()->hasPermission('update-event-results');\n }",
"protected function _isAllowed() {\n return Mage::getSingleton('admin/session')->isAllowed('cms/unideal_topads/magazine');\n }",
"public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'core', 'clubs', 'clubs_manage' );\n\t}",
"public function view(User $user)\n {\n return $user->hasAccess('view-conference-gallery');\n }",
"public function checkAccess()\n {\n\t\treturn !is_null($this->author_id) && $this->author_id == Yii::app()->user->id;\n }",
"function isAccessGranted() {\r\n\tif(isset($_SESSION['access_granted']) && ($_SESSION['access_granted'] === true)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}",
"public function user_has_access() {\n\t\treturn current_user_can( 'pvm_delegated_authorship' );\n\t}"
] | [
"0.7977139",
"0.69755584",
"0.67618984",
"0.6492169",
"0.64843345",
"0.6482675",
"0.64576703",
"0.6457566",
"0.6377763",
"0.63667345",
"0.6336836",
"0.6320293",
"0.63133574",
"0.6223024",
"0.6190397",
"0.61600655",
"0.61588746",
"0.61477965",
"0.6089771",
"0.60586715",
"0.6039324",
"0.6035211",
"0.60338825",
"0.6025594",
"0.6024771",
"0.6015882",
"0.60107994",
"0.60059",
"0.5978839",
"0.59272367"
] | 0.7324953 | 1 |
Check if index is first | public function isFirst()
{
return (0 === $this->index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isFirst();",
"public function isFirstStep()\n\t{\n\t\treturn self::getStepOffset($this->step) == 0;\n\t}",
"public function first() {\n $this->index = 0;\n }",
"function first() {\n\t\t\treturn $this->page_number == 1;\n\t\t}",
"function isFirst();",
"function isFirst();",
"public function MoveFirst()\n {\n if ($this->_currentRow == 0)\n return true;\n\n return $this->Move(0);\n }",
"public function isBefore($index): bool;",
"public function isFirstPage(): bool\n {\n return $this->getPage() === 1;\n }",
"function atFirstPage() {\n\t\treturn $this->page==1;\n\t}",
"public function is_first_step() {\n\t\t$steps = $this->get_step_keys();\n\n\t\treturn array_search( $this->get_current_step(), $steps ) === 0;\n\t}",
"public function isFirstPage()\n\t{\n\t\treturn ($this->getCurrentPage() <= 1);\n\t}",
"public function isFirst()\n {\n return false;\n }",
"function first($a)\n{\n if (count($a) == 0) return false;\n reset($a);\n return current($a);\n}",
"function getFirstIncompleteStep(){\n $i = false;\n \n // This also runs isComplete on everything at least once so that complete is initialised. Don't break the loop!\n foreach( $this->aSteps as $k => $step ){\n if( !$this->aSteps[$k]->isComplete() && !$i ) $i = $step->index;\n }\n return $i;\n }",
"public function isFirstPage(): bool\n {\n return $this->getCurrentPage() == 1;\n }",
"public function get_first_position()\n {\n if(! $count = $this->position_count())\n {\n return false;\n }\n \n return $this->positions[0];\n }",
"function array_is_first(&$array, $key)\n{\n\treset($array);\n\treturn $key === key($array);\n}",
"public function isOnFirstPage(): bool {\n return $this->page == 1;\n }",
"function is_First( $num ) {\r\n if( (int)$num === 1 )return true;\r\n return false;\r\n}",
"public function hasFirst($num = NULL) {\n\t\treturn reset($this->getPageRange($num)) > 1;\n\t}",
"public function getIsFirstPage()\r\n {\r\n if (!$this->getLimitPerPage()) {\r\n return true;\r\n }\r\n return $this->getCollection()->getCurPage() == 1;\r\n }",
"public function offsetExists($index) : bool\r\n {\r\n return $index >= 0 && $index < $this->Count;\r\n }",
"public function hasIndex($idx) {\r\n\t\treturn ($idx >= 0) && ($idx < $this->count ());\r\n\t}",
"public static function first($arr)\n {\n // Internal PHP function to return the first array item\n return (is_array($arr)) ? reset($arr) : false;\n }",
"public function is_first(): bool {\n\t\t/**\n\t\t * Filters the tab is_first state.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param bool $is_first Tab is_first state.\n\t\t * @param Tab $tab Tab object.\n\t\t *\n\t\t * @ignore\n\t\t */\n\t\treturn (bool) apply_filters( 'learndash_template_tab_is_first', $this->is_first, $this );\n\t}",
"private function isElementIndex($index) {\n\t\treturn (($index >= 0) && ($index <= $this->size));\n\t}",
"public function getFirstRowIndex()\r\n {\r\n return ($this->_page - 1) * $this->_recordsPerPage;\r\n }",
"public function first()\n\t{\n\t\tif ($this->root)\n\t\t{\n\t\t\treturn $this->root->first;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new \\OutOfBoundsException('First element unexisting');\n\t\t}\n\t}",
"function test_firstpos_leaf() {\n $this->qtype = new dfa_preg_matcher('a');\n $connection = array();\n $maxnum = 0;\n $this->qtype->roots[0]->pregnode->operands[0]->number($connection, $maxnum);\n $this->qtype->roots[0]->pregnode->operands[0]->nullable();\n $result = $this->qtype->roots[0]->pregnode->operands[0]->firstpos();\n $this->assertTrue(count($result) == 1 && $result[0] == 1);\n }"
] | [
"0.69266206",
"0.6896079",
"0.68375546",
"0.6781141",
"0.6734973",
"0.6734973",
"0.6676145",
"0.66651016",
"0.6596519",
"0.6523554",
"0.646624",
"0.64453274",
"0.639789",
"0.63619757",
"0.6359894",
"0.63349646",
"0.629201",
"0.62915343",
"0.6290362",
"0.6147169",
"0.60890675",
"0.59997284",
"0.5864607",
"0.5847987",
"0.58374804",
"0.58185774",
"0.57785213",
"0.57492864",
"0.57362854",
"0.5717848"
] | 0.8327548 | 0 |
Check if index is last | public function isLast()
{
return (1 + $this->index === $this->count);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isLast();",
"function isLast();",
"public function isLast()\n {\n return false;\n }",
"public function isAfter($index): bool;",
"public function isLast() {\r\n return count($this->_quizSet) === $_SESSION['current_num'] + 1;\r\n\r\n }",
"public function isLastStep()\n\t{\n\t\treturn self::getStepOffset($this->step) == (count(self::$steps) - 1);\n\t}",
"public function MoveLast()\n {\n $this->ResetError();\n $this->active_row = $this->RowCount() - 1;\n if (!$this->ErrorNumber()) {\n return !!$this->Seek($this->active_row);\n } else {\n return false;\n }\n }",
"function last() {\n\t\t\treturn $this->page_number == $this->paginator->pages_count;\n\t\t}",
"function array_is_last(&$array, $key)\n{\n\tend($array);\n\treturn $key === key($array);\n}",
"public function is_last_step() {\n\t\t$steps = $this->get_step_keys();\n\n\t\treturn array_search( $this->get_current_step(), $steps ) === sizeof( $steps ) - 1;\n\t}",
"function atLastPage() {\n\t\treturn ($this->page * $this->itemsPerPage) + 1 > $this->count;\n\t}",
"public function isLastPage(): bool\n {\n return $this->getPage() === $this->getLastPage();\n }",
"public function isOnLastPage(): bool {\n return $this->page == $this->getPageCount();\n }",
"public function isLastStep(): bool\n {\n return $this->isStep($this->lastStep());\n }",
"public static function last($arr)\n {\n // Internal PHP function to return the last array item\n return (is_array($arr)) ? end($arr) : false;\n }",
"public function hasLast($num = NULL) {\n\t\treturn end($this->getPageRange($num)) < $this->getTotal();\n\t}",
"public function isLastPage(): bool\n {\n return $this->getCurrentPage() >= $this->getLastPageNum();\n }",
"function is_last($collection, $currentKey)\n{\n // Convert the collection to array\n $array = $collection->toArray();\n // Go to the end of the array\n end($array);\n // Get the key from the last element\n $endKey = key($array);\n // Return true if the current key is the same as the end key on the array.\n return $endKey == $currentKey;\n}",
"public function isLastPage()\n\t{\n\t\treturn ($this->getCurrentPage() >= $this->getMaxPages());\n\t}",
"public function isTheLastState()\n {\n return (bool)($this->orderState > 9);\n }",
"public static function last($array)\n {\n if (isset($array) && (is_array($array)) && (count($array) > 0))\n {\n return $array[count($array) - 1];\n }\n else\n {\n return false;\n }\n }",
"public function is_last_page() {\n\t\t\tif ( $this->get_numbers_found() == 0) return true;\n\t\t\treturn ( $this->page == $this->get_page_numbers() ) ? true : false;\n\t\t}",
"public function getLast()\n {\n return end($this->array);\n }",
"public function lastIndex()\n {\n if (count($this->objects) == 0) {\n return 0;\n } else {\n $indices = array_keys($this->objects);\n sort($indices);\n return $indices[count($indices) - 1];\n }\n }",
"private function getLastIndex(){\n \t$query = (new Stage)->newQuery();\n \t$query = $query->orderBy('position','desc');\n \t$obj = $query->first();\n \tif (is_null($obj)){\n \t\treturn 0;\n\t }\n\t return ($obj->position * 1);\n }",
"public static function getLast();",
"function actsLikeLast();",
"function last($array)\n {\n return end($array);\n }",
"function last($array)\n {\n return end($array);\n }",
"public function isLastPage() {\n return $this->isLastPage;\n }"
] | [
"0.7725059",
"0.7725059",
"0.75945413",
"0.7541687",
"0.70974404",
"0.7093836",
"0.7073629",
"0.70316374",
"0.6925057",
"0.69147",
"0.6851797",
"0.67795295",
"0.67465836",
"0.6599666",
"0.65285426",
"0.6511163",
"0.6508852",
"0.6435635",
"0.6415363",
"0.6409415",
"0.63037294",
"0.63016343",
"0.62642026",
"0.62460154",
"0.62348104",
"0.62246734",
"0.6223118",
"0.619317",
"0.619317",
"0.618416"
] | 0.82753533 | 0 |
Check if index is odd | public function isOdd()
{
return ($this->index % 2 != 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isEven()\n\t{\n\t\treturn ($this->index % 2 == 0);\n\t}",
"protected function isOddTeamsCnt()\n {\n if ($this->teamsCount % 2 != 0) {\n $this->isOdd = true;\n $this->teamsCount++;\n }\n }",
"function is_odd( $val ) {\n\t\tif( !is_numeric( $val ) ) return false; \n\t\treturn ( $val % 2 ); \n\t}",
"public static function odd($arr)\n {\n // Pass the array to sell::mod() to get odd array items\n return (is_array($arr)) ? self::mod($arr, 2, '==') : false;\n }",
"private function isOdd($word){\n $number = strlen($word);\n //echo ' number = '.$number.' ';\n return $number % 2 != 0;\n }",
"function is_even( $val ) {\n\t\treturn !is_odd( $val ); \n\t}",
"public function evenOdd()\n {\n return $this->unsetFlag(Flag::clip())->setFlag(Flag::clipEvenOdd());\n }",
"public function odd($var) {\n return($var & 1);\n }",
"function odd($var) {\n\t return($var & 1);\n\t}",
"static function isOdd($number){\r\n return $number & 1;\r\n }",
"function is_odd($num){\n\treturn (is_numeric($num)&($num&1));\n}",
"function is_odd($num){\n\treturn (is_numeric($num)&($num&1));\n}",
"function is_odd($num){\n\treturn (is_numeric($num)&($num&1));\n}",
"function isEven($val) {\n\t\treturn ($val % 2 == 0);\n\t}",
"function isOdd($num) {\n\t\tif ($number & 1) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t} //End of if\n\t}",
"function Even($array) \n { \n // returns if the input integer is even \n if($array%2==null) \n return TRUE; \n else \n return FALSE; \n }",
"public static function is_num_odd( $int ) {\n\t \t\n\t\treturn( $int & 1 );\n\t\t \n\t }",
"public static function isOdd($num){\n\n\t\t\t\t$num\t=\tself::cast($num);\n\t\t\t\treturn !(boolean)($num%2);\n\n\t\t\t}",
"function even($var) {\n if (($var % 2) == 0) {\n return true;\n }\n}",
"function odd(int $number): bool\n{\n return !even($number);\n}",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function setOddEvenDifferent() {\t \r\n\t \t$this->oddEvenDifferent = 1;\t \r\n\t}",
"function is_even( $number )\n\t{\n\t\treturn $number % 2 == 0;\n\t}",
"function getOddNumber($srcValues)\n{\n $occurrences = array_count_values($srcValues);\n foreach ($occurrences as $value => $times) {\n if ($times%2 !== 0) {\n return $value;\n }\n }\n}",
"function is_even (int $value) {\r\n if($value % 2 == 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"public function even($var) {\n return(!($var & 1));\n }",
"function helper_alternate_colors( $p_index=null, $p_odd_color, $p_even_color ) {\n\t\tstatic $t_index = 1;\n\n\t\tif ( null !== $p_index ) {\n\t\t\t$t_index = $p_index;\n\t\t}\n\n\t\tif ( 1 == $t_index++ % 2 ) {\n\t\t\treturn $p_odd_color;\n\t\t} else {\n\t\t\treturn $p_even_color;\n\t\t}\n\t}",
"public static function even($arr)\n {\n // Pass the array to sell::mod() to get even array items\n return (is_array($arr)) ? self::mod($arr, 2, '!=') : false;\n }"
] | [
"0.7655897",
"0.6890263",
"0.6758042",
"0.6567036",
"0.6367958",
"0.6318099",
"0.62956595",
"0.6272463",
"0.626949",
"0.6157533",
"0.61290365",
"0.61290365",
"0.61290365",
"0.6124237",
"0.60910463",
"0.60433686",
"0.6036656",
"0.60159296",
"0.59707797",
"0.5949922",
"0.591988",
"0.591988",
"0.591988",
"0.5900251",
"0.5892864",
"0.58891606",
"0.5881502",
"0.5866722",
"0.5847539",
"0.5843303"
] | 0.8303095 | 0 |
Check if index is even | public function isEven()
{
return ($this->index % 2 == 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isOdd()\n\t{\n\t\treturn ($this->index % 2 != 0);\n\t}",
"function isEven($val) {\n\t\treturn ($val % 2 == 0);\n\t}",
"function is_even( $val ) {\n\t\treturn !is_odd( $val ); \n\t}",
"function is_even (int $value) {\r\n if($value % 2 == 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"function Even($array) \n { \n // returns if the input integer is even \n if($array%2==null) \n return TRUE; \n else \n return FALSE; \n }",
"function is_even( $number )\n\t{\n\t\treturn $number % 2 == 0;\n\t}",
"function even($var) {\n if (($var % 2) == 0) {\n return true;\n }\n}",
"function isEven(int $int): bool\n{\n return 0 === ($int % 2);\n}",
"public static function even($arr)\n {\n // Pass the array to sell::mod() to get even array items\n return (is_array($arr)) ? self::mod($arr, 2, '!=') : false;\n }",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function is_odd( $val ) {\n\t\tif( !is_numeric( $val ) ) return false; \n\t\treturn ( $val % 2 ); \n\t}",
"protected function isOddTeamsCnt()\n {\n if ($this->teamsCount % 2 != 0) {\n $this->isOdd = true;\n $this->teamsCount++;\n }\n }",
"function isEven(int $number): bool\n{\n return $number % 2 === 0;\n}",
"public static function isEven($num){\n\n\t\t\t\t$num\t=\tself::cast($num);\n\t\t\t\treturn (boolean)($num%2);\n\n\t\t\t}",
"public function even($var) {\n return(!($var & 1));\n }",
"function even(int $number): bool\n{\n return $number % 2 === 0;\n}",
"function even($var) {\n\t return(!($var & 1));\n\t}",
"public static function isEvenNumber($number) {\r\n return (((int)$number[strlen($number)-1]) & 1) == 0;\r\n }",
"public static function isEvenNumber($number) {\r\n return (((int)$number[strlen($number)-1]) & 1) == 0;\r\n }",
"function even($number)\n{\n\tif($number%2=='1') return FALSE;\n\telse return TRUE;\n}",
"public static function isEven(int $num): bool\n {\n return ($num % 2 === 0);\n }",
"public function evenOdd()\n {\n return $this->unsetFlag(Flag::clip())->setFlag(Flag::clipEvenOdd());\n }",
"public static function odd($arr)\n {\n // Pass the array to sell::mod() to get odd array items\n return (is_array($arr)) ? self::mod($arr, 2, '==') : false;\n }",
"function even($var)\r\n{\r\n return !($var & 1);\r\n}",
"function isEven($n){ // parameter\n // function body\n if($n % 2 == 0){\n return true;\n }\n return false;\n}",
"function odd(int $number): bool\n{\n return !even($number);\n}",
"public function odd($var) {\n return($var & 1);\n }",
"function odd($var) {\n\t return($var & 1);\n\t}"
] | [
"0.7458557",
"0.7219075",
"0.7124076",
"0.69969434",
"0.6954271",
"0.690745",
"0.68026084",
"0.67462635",
"0.6707888",
"0.66040015",
"0.66040015",
"0.66040015",
"0.65184957",
"0.6510219",
"0.64494056",
"0.64483285",
"0.6408714",
"0.63429713",
"0.63292044",
"0.63223517",
"0.63223517",
"0.63172317",
"0.6171538",
"0.6055081",
"0.5999468",
"0.5990988",
"0.5974407",
"0.59359723",
"0.5839986",
"0.5803539"
] | 0.86122656 | 0 |
Check if index is divisible by | public function isDivisible($num = 2)
{
if ($num <= 0 or !is_numeric($num)) {
return false;
}
return ($this->index % (integer)$num == 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_multiple($number, $multiple)\n{\n return ($number % $multiple) == 0;\n}",
"function isDividedByAll($number) {\n\t$range = range(11,20);\n\tforeach ($range as $value) {\n\t\tif ($number % $value > 0) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}",
"public function isOdd()\n\t{\n\t\treturn ($this->index % 2 != 0);\n\t}",
"function isPrime($val){\n if($val == 1)\n return 0;\n for ($index = 2; $index <= $_POST[\"limit\"]; $index++) {\n if($val % $index == 0 && $val !== $index){\n return 0;\n }\n }\n return 1; \n}",
"function nombre_premier($x){\n for ($i=2; $i < $x ; $i++) { \n if($x % $i==0){\n $test =1;\n }\n }if (isset($test)) {\n echo \"$x n'est pas un nomber premier\";\n } else {\n echo \"$x est un nomber premier\";\n } \n}",
"public function testDivMod()\n {\n self::assertEquals(123456 % 1, to_int(div_mod(from_int(123456, 8), from_int(1, 8))[1]));\n self::assertEquals(123456 % 1024, to_int(div_mod(from_int(123456, 8), from_int(1024, 8))[1]));\n self::assertEquals(123456 % 654321, to_int(div_mod(from_int(123456, 8), from_int(654321, 8))[1]));\n self::assertEquals(123456 % 123456, to_int(div_mod(from_int(123456, 8), from_int(123456, 8))[1]));\n // negative is accepted\n // self::assertEquals(...?, to_int(mod(from_int(123456, 8), from_int(-1000, 8)))));\n }",
"function suivantPremier($nb = 1)\n{\n\tdo {\n\t\t$div = $nb++;\n\t\twhile ($div >= ($nb / 2) && ($nb % $div) != 0)\n\t\t\t$div--;\n\t} while ($div >= ($nb / 2));\n\n\treturn $nb;\n}",
"function evenlyDivisibleByTen(int $num = 0): bool\n{\n return $num % 10 === 0;\n}",
"public function isEven()\n\t{\n\t\treturn ($this->index % 2 == 0);\n\t}",
"function num_divisors($num)\n{\n $count = 0;\n for($i = 1; $i <= $num; $i++)\n {\n if($num % $i == 0)\n {\n $count++;\n }\n }\n \n return $count;\n}",
"function isDrob($number)\n{\n if($number % 3 == 0)\n {\n echo $number;\n } else {\n echo \"OSTATOK EST\";\n }\n }",
"function solution(array $numbers): int {\n while(count(array_count_values($numbers)) !== 1){\n $a = min($numbers);\n foreach($numbers as &$number){\n $number = ($number % $a !== 0)? $number % $a: $a;\n }\n }\n return array_sum($numbers);\n}",
"public function hasCanSingleDivorce(){\n return $this->_has(8);\n }",
"function IsPrime($n){\n // list divisors\n for($x=2; $x<$n; $x++){\n if($n %$x ==0){\n $d = $n / $x;\n echo \"<h3>$n is divisible by $x</h3>\";\n echo \"<p>$n / $x = $d</p>\";\n // return 0;\n }\n }\n return 1;\n}",
"function is_odd( $val ) {\n\t\tif( !is_numeric( $val ) ) return false; \n\t\treturn ( $val % 2 ); \n\t}",
"function calc_evendiv($array) {\n $array_length = count($array);\n\n if ($array_length >= 2) {\n for ($i = 0; $i < $array_length; $i++) {\n for ($k = 0; $k < $array_length; $k++) {\n\n // don't divide x/x\n if ($i === $k) {\n continue;\n }\n\n if ($array[$i] % $array[$k] === 0) {\n if ($array[$k] !== 0) {\n return $array[$i] / $array[$k];\n }\n } elseif ($array[$k] % $array[$i] === 0) {\n if ($array[$i] !== 0) {\n return $array[$k] / $array[$i];\n }\n }\n }\n }\n }\n}",
"function modulus($a, $b){\n if (is_numeric($a) && is_numeric($b)) {\n\t\treturn $a % $b;\n\t} else {\n\t\tthrowError(\"modulus\");\n\n\t}\n}",
"function numeroPrimo($numero) { // $numero será o numero a ser testado\n $i = 1; // não pode ser 0, se não $numero/0 (divisão por zero)\n $divisores = array(); // os divisores serão guardados no array\n\n for ($i; $i <= $numero; $i++) {\n if ($numero % $i == 0) {\n array_push($divisores, $i);\n }\n }\n\n if (count($divisores) == 2) { // contando a quantidade de divisores para saber se é primo\n echo \"O número {$numero} é PRIMO !!!\" . nl2br(PHP_EOL);\n } else {\n echo \"O número {$numero} NÃO É PRIMO\" . nl2br(PHP_EOL); \n }\n}",
"function isPowerOfThree($num)\n{\n $current = 1;\n while ($current <= $num) {\n if ($current == $num) {\n return true;\n }\n $current *= 3;\n }\n return false;\n}",
"function primos($x){\n#echo \"\\nO numero > 2 e primo\";\n\n for($i = 0; $i <=$x; $i++){\n \t$nao_e = 0;\n \tif($i%2 == 0)\n \t continue;\n \t$cont = 0 ;\n\n \tfor($j = 0; $j <= $x; $j++){\n \t if($j == 0)\n \t continue;\n \t if($i%$j ==0)\n \t \t$cont ++;\n \t \n \t if($cont > 2)\n \t \tcontinue;\n \t \n\n \t}\n \tif($cont == 2)\n \t \t$e_primo = true;\n \t echo \"\\n$i\";\n }\n}",
"function divcheck($a, $b) {\n if(!$b == 0) {\n return true;\n } else {\n echo \"ERROR: You cannot divide by $b.\";\n return false;\n }\n}",
"static function isOdd($number){\r\n return $number & 1;\r\n }",
"function isEven(int $int): bool\n{\n return 0 === ($int % 2);\n}",
"function fizzBuzz()\n{\n // use modulo to check for divisibilty\n // not using braces for if blocks because they are one line each\n foreach(range(1,100) as $i) {\n if ($i % 3 === 0 && $i %5 === 0) echo \"FizzBuzz\\n\";\n elseif ($i % 3 === 0) echo \"Fizz\\n\";\n elseif ($i % 5 === 0) echo \"Buzz\\n\";\n else echo \"$i\\n\";\n }\n\n}",
"function even($var) {\n if (($var % 2) == 0) {\n return true;\n }\n}",
"function primeCheck($number){ \r\n if ($number == 1) \r\n return 0; \r\n for ($i = 2; $i <= $number/2; $i++){ \r\n if ($number % $i == 0) \r\n return 0; \r\n } \r\n return 1; \r\n}",
"function fancyFunction(){\r\n\tfor ($i = 1; $i <= 120; $i++)\r\n\t\t{\r\n\t\t// check if divisible by 4 and 7\r\n\t\tif ($i % 4 == 0 && $i % 7 == 0)\r\n\t\t\t{\r\n\t\t\techo \"ChiCken and SteAk <br />\";\r\n\t\t\t}\r\n\t\t else\r\n\t\t//check if divisible by 4\r\n\t\tif ($i % 4 == 0)\r\n\t\t\t{\r\n\t\t\techo \"ChiCken <br />\";\r\n\t\t\t}\r\n\t\t else\t\r\n\t\t//check if divisible by 7\r\n\t\tif ($i % 7 == 0)\r\n\t\t\t{\r\n\t\t\techo \"SteAk <br />\";\r\n\t\t\t}\r\n\t\t else\r\n\t\t//echo the number\r\n\t\t\t{\r\n\t\t\techo $i . \"<br />\";\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function checkNumber($number){\n\n if($number <= 2)\n return false;\n for($i = 2; $i <= sqrt($number); $i++){\n if($number%$i==0)\n return false;\n\n }\n return true;\n }",
"public function valid()\n {\n return $this->index * $this->count < $this->length;\n }",
"function multiploDe ($num1, $num2) {\n // int $resto\n $resto = ($num1 % $num2);\n\n // Si el resto es 0 significa que es multiplo, de lo contrario no lo es\n if ($resto == 0) {\n $resultado = true;\n } else {\n $resultado = false;\n }\n\n return $resultado;\n}"
] | [
"0.66909474",
"0.66383433",
"0.63983893",
"0.60089487",
"0.5913668",
"0.5875695",
"0.579845",
"0.5792332",
"0.5791429",
"0.5755473",
"0.5735006",
"0.5682418",
"0.56644493",
"0.5567315",
"0.5566915",
"0.5529556",
"0.55042833",
"0.55022556",
"0.5479837",
"0.5453862",
"0.53949636",
"0.53398633",
"0.5337963",
"0.53302705",
"0.52774566",
"0.5265343",
"0.5258442",
"0.5254579",
"0.5232111",
"0.5222252"
] | 0.6799776 | 0 |
Convert Taxonomy name to slug | public function toSlug()
{
$this->slug = str_replace(' ', '-', strtolower($this->name));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function slug() { return ppb_parameterize($this->name); }",
"function get_slug( $name = null ) {\n\n\t\t// If no name set use the post type name.\n\t\tif ( ! isset( $name ) ) {\n\n\t\t\t$name = $this->post_type_name;\n\t\t}\n\n\t\t// Name to lower case.\n\t\t$name = strtolower( $name );\n\n\t\t// Replace spaces with hyphen.\n\t\t$name = str_replace( \" \", \"-\", $name );\n\n\t\t// Replace underscore with hyphen.\n\t\t$name = str_replace( \"_\", \"-\", $name );\n\n\t\treturn $name;\n\t}",
"protected function format_taxonomy_slug ( $jobvite_taxonomy = '' ) {\n\t\t$slug = strtolower( str_replace ( array( ',', ' ' ), '-', $jobvite_taxonomy ) );\n\t\t$slug = preg_replace( '/-{2,}/', '-', $slug );\n\t\t/* Remove Trailing Dash if Present */\n\t\treturn rtrim( $slug, \"-\" );\n\t}",
"public function getSlug()\n {\n $text = preg_replace('~[^\\\\pL\\d]+~u', '-', $this->getTitle());\n $text = trim($text, '-');\n $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n $text = strtolower($text);\n $text = preg_replace('~[^-\\w]+~', '', $text);\n\n if (empty($text)) {\n return 'n-a';\n }\n\n return $text;\n }",
"public function slug()\n {\n return Str::slug($this->name());\n }",
"public function slug();",
"public function slug();",
"function slug() {\n\t\treturn $this->_post->post_name;\n\t}",
"public function getSlugAttribute()\n {\n $slug = $this->attributes['name'];\n\n if ($this->attributes['entity_type']) {\n $slug .= '-'.$this->attributes['entity_type'];\n }\n\n if ($this->attributes['entity_id']) {\n $slug .= '-'.$this->attributes['entity_id'];\n }\n\n return strtolower($slug);\n }",
"public function the_slug() {\n $post_data = get_post($post->ID, ARRAY_A);\n $slug = $post_data['post_name'];\n return $slug;\n }",
"protected function get_slug(): string {\n\t\t$year = gmdate( 'Y', strtotime( $this->plato_project->get_start_date() ) );\n\t\t$code = $this->plato_project->get_code();\n\t\t$country = $this->country->get_name();\n\t\t$work = $this->work_types[0]->get_name();\n\t\tif ( count( $this->work_types ) > 1 ) {\n\t\t\t$work .= ' en ' . $this->work_types[1]->get_name();\n\t\t}\n\t\treturn sanitize_title( sprintf( '%s-%s-%s-%s', $year, $code, $country, $work ) );\n\t}",
"function _slug($value){\n\t$value = preg_replace('![^'.preg_quote('_').'\\pL\\pN\\s]+!u', '', mb_strtolower($value));\n\n\t//remove underscore and whitespace with a dash\n\t$value = preg_replace('!['.preg_quote('-').'\\s]+!u', '-', $value);\n\n\t//remove whitespace\n\treturn trim($value, '-');\n}",
"function slug($text)\n{\n $text = preg_replace('~[^\\\\pL\\d]+~u', '-', $text);\n // trim\n $text = trim($text, '-');\n // transliterate\n $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n // lowercase\n $text = strtolower($text);\n // remove unwanted characters\n $text = preg_replace('~[^-\\w]+~', '', $text);\n if (empty($text))\n {\n return 'n-a';\n }\n return $text.'.html';\n}",
"function slug($text) {\n $text = str_replace (' ', '_', $text);\n $text = preg_replace('/[^a-z0-9_]/i', '', $text);\n $text = strtolower($text);\n return $text;\n}",
"function ptv_to_taxomomy_name( $string ) {\n\n\treturn str_replace( '_', '-', ltrim( $string, '_' ) );\n\n}",
"function slugPost($text)\n\t\t{\n\t\t $text = preg_replace('~[^\\\\pL\\d]+~u', '-', $text);\n\n\t\t // trim\n\t\t $text = trim($text, '-');\n\n\t\t // transliterate\n\t\t $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n\n\t\t // lowercase\n\t\t $text = strtolower($text);\n\n\t\t // remove unwanted characters\n\t\t $text = preg_replace('~[^-\\w]+~', '', $text);\n\n\t\t if (empty($text))\n\t\t {\n\t\t\treturn 'n-a';\n\t\t }\n\n\t\t return $text;\n\t\t}",
"function slug($value){\n $value = preg_replace('![^'.preg_quote('_').'\\pL\\pN\\s]+!u', '', mb_strtolower($value));\n //replace underscore and whitespace with a dash -\n $value = preg_replace('!['.preg_quote('-').'\\s]+!u', '-', $value);\n //remove whitespace\n return trim($value, '-');\n}",
"public function convertStringToSlugAction()\n {\n // -------------------------------\n // strip special chars\n // strip html, js, etc\n // convert accented chars\n // replace camel case to dashes ('-')\n // replace delimiters to dashes ('-')\n // lowercase all words\n // trim to 256\n // validate slug\n }",
"public function get_slug ()\n {\n return sanitize_title (pathinfo ($this->path, PATHINFO_FILENAME));\n }",
"public function slug($text) {\n $slug = str_replace(\" \", \"-\", strtolower($text));\n $slug = str_replace(\"_\", \"-\", $slug);\n $slug = removeAccents($slug);\n $slug = preg_filter('#[^a-z0-9|^\\-]*#', \"\", $slug);\n\n return $slug;\n }",
"public function getSlug();",
"public function getSlug();",
"function the_slug() {\n\tglobal $post;\n $post_data = get_post($post->ID, ARRAY_A);\n $slug = $post_data['post_name'];\n return $slug; \n}",
"public function get_slug() {\n\t\t/**\n\t\t * Filter the action slug.\n\t\t *\n\t\t * @since 7.0\n\t\t *\n\t\t * @param string $slug The action slug.\n\t\t * @param string $name The action name.\n\t\t */\n\t\treturn apply_filters( 'tml_get_action_slug', $this->slug, $this->get_name() );\n\t}",
"public function get_slug() {\n\t\t\treturn apply_filters( 'pue_get_slug', $this->slug );\n\t\t}",
"function url_slug ($url) {\n $url = replaceAccents($url);\n $url = cano($url);\n return $url;\n\n}",
"function tuu_get_the_slug() {\n return basename(get_permalink());\n}",
"function tainacan_get_the_term_name() {\n\t$term = tainacan_get_term();\n\t$name = '';\n\tif ( $term ) {\n\t\t$name = $term->name;\n\t}\n\treturn apply_filters('tainacan-get-term-name', $name, $term);\n}",
"function php_slug($string) \n { $slug = preg_replace('/[^a-z0-9-]+/', '-', trim(strtolower($string)));return $slug; }",
"public function getSlug() {\r\n\t\t$class_name = get_class($this);\r\n\t\t$arr = explode('_', $class_name, 2);\r\n\t\treturn self::SLUG_PREFIX . $arr[1];\r\n\t}"
] | [
"0.74337363",
"0.69742113",
"0.69367236",
"0.69103855",
"0.6884822",
"0.68303144",
"0.68303144",
"0.681041",
"0.66451967",
"0.6633245",
"0.65619856",
"0.6554054",
"0.65348244",
"0.65241396",
"0.6523274",
"0.6429893",
"0.6428056",
"0.63891834",
"0.6352477",
"0.6337693",
"0.6321706",
"0.6321706",
"0.6319526",
"0.6318815",
"0.630774",
"0.6299025",
"0.62967974",
"0.62961763",
"0.62608236",
"0.6255947"
] | 0.699745 | 1 |
Return an image object representing the image in the given format. This image will be generated using generateFormattedImage(). The generated image is cached, to flush the cache append ?flush=1 to your URL. | function getFormattedImage($format, $arg1 = null, $arg2 = null) {
if($this->ID && $this->Filename && Director::fileExists($this->Filename)) {
$cacheFile = $this->cacheFilename($format, $arg1, $arg2);
if(!file_exists("../".$cacheFile) || isset($_GET['flush'])) {
$this->generateFormattedImage($format, $arg1, $arg2);
}
return new Image_Cached($cacheFile);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFormattedImage($format) {\n\t\t$args = func_get_args();\n\t\t\n\t\tif ($this->ID && $this->Filename && Director::fileExists($this->Filename)) {\n\t\t\t$cacheFile = call_user_func_array(array($this, \"cacheFilename\"), $args);\n\t\t\t$filename = Director::baseFolder() . \"/\" . $cacheFile;\n\t\t\t$filename = $this->insertFilenameAppender($filename, '-10x');\n\t\t\tif (!file_exists($filename) || isset($_GET['flush'])) {\n\t\t\t\tcall_user_func_array(array($this, \"generateFormattedImage\"), $args);\n\t\t\t} else {\n\t\t\t\t$this->adaptiveimages['1.0'] = $this->insertFilenameAppender($cacheFile, '-10x');\n\t\t\t\t$this->adaptiveimages['1.5'] = $this->insertFilenameAppender($cacheFile, '-15x');\n\t\t\t\t$this->adaptiveimages['2.0'] = $this->insertFilenameAppender($cacheFile, '-20x');\n\t\t\t}\n\n\t\t\t$cached = RetinaImage_Cached::create($cacheFile);\n\t\t\t// Pass through the title so the templates can use it\n\t\t\t$cached->Title = $this->Title;\n\t\t\t// Pass through the parent, to store cached images in correct folder.\n\t\t\t$cached->ParentID = $this->ParentID;\n\t\t\t\n\t\t\treturn $cached;\n\t\t}\n\t}",
"function generateFormattedImage($format, $arg1 = null, $arg2 = null) {\n\t\t$cacheFile = $this->cacheFilename($format, $arg1, $arg2);\n\t\n\t\t$gd = new GD(\"../\" . $this->Filename);\n\t\t\n\t\t\n\t\tif($gd->hasGD()){\n\t\t\t$generateFunc = \"generate$format\";\t\t\n\t\t\tif($this->hasMethod($generateFunc)){\n\t\t\t\t$gd = $this->$generateFunc($gd, $arg1, $arg2);\n\t\t\t\tif($gd){\n\t\t\t\t\t$gd->writeTo(\"../\" . $cacheFile);\n\t\t\t\t}\n\t\n\t\t\t} else {\n\t\t\t\tUSER_ERROR(\"Image::generateFormattedImage - Image $format function not found.\",E_USER_WARNING);\n\t\t\t}\n\t\t}\n\t}",
"public function generateFormattedImage($format) {\n\t\t$args = func_get_args();\n\n\t\t// list of independent resoultions to generate\n\t\t$cacheFile = call_user_func_array(array($this, \"cacheFilename\"), $args);\n\n\t\t$DPIlist = array(\n\t\t\t'1.0' => $this->insertFilenameAppender($cacheFile, '-10x'),\n\t\t\t'1.5' => $this->insertFilenameAppender($cacheFile, '-15x'),\n\t\t\t'2.0' => $this->insertFilenameAppender($cacheFile, '-20x'),\n\t\t);\n\t\t$gdbackend = Image::get_backend();\n\t\t$defaultQuality = config::inst()->get('RetinaImage', 'defaultQuality');\n\t\t\n\t\t// degrade the quality of the image as the dimensions increase\n\t\t$qualityDegrade = config::inst()->get('RetinaImage', 'qualityDegrade');\n\t\t$qualityCap = config::inst()->get('RetinaImage', 'qualityCap');\n\t\t\n\t\t// iterate through each resoultion to generate\n\t\tforeach ($DPIlist as $multiplier => $filename) {\n\t\t\t$backend = Injector::inst()->createWithArgs($gdbackend, array(\n\t\t\t\tDirector::baseFolder() . \"/\" . $this->Filename\n\t\t\t));\n\n\t\t\tif ($backend->hasImageResource()) {\n\t\t\t\t$generateFunc = \"generate$format\";\n\t\t\t\tif ($this->hasMethod($generateFunc)) {\n\t\t\t\t\tarray_shift($args);\n\t\t\t\t\tarray_unshift($args, $backend);\n\n\t\t\t\t\t$modifiedargs = $args;\n\t\t\t\t\t// most formatted images have width \n\t\t\t\t\tif (isset($args[1]) && isset($args[2]) &&\n\t\t\t\t\t\t\tis_numeric($args[1]) && is_numeric($args[2])) {\n\t\t\t\t\t\t$modifiedargs[1] = (int) ($args[1] * $multiplier);\n\t\t\t\t\t\t$modifiedargs[2] = (int) ($args[2] * $multiplier);\n\t\t\t\t\t\t// for SetHeight, SetWidth\n\t\t\t\t\t} else if (isset($args[1]) && is_numeric($args[1])) {\n\t\t\t\t\t\t$modifiedargs[1] = (int) ($args[1] * $multiplier);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// degrade the quality as the higher images progress\n\t\t\t\t\t$quality = $defaultQuality - (($multiplier-1) * $qualityDegrade);\n\t\t\t\t\tif($quality < $qualityCap) {\n\t\t\t\t\t\t$quality = $qualityCap;\n\t\t\t\t\t}\n\t\t\t\t\t$backend->setQuality($quality);\n\t\t\t\t\t$backend = call_user_func_array(array($this, $generateFunc), $modifiedargs);\n\t\t\t\t\tif ($backend) {\n\t\t\t\t\t\t$backend->writeTo(Director::baseFolder() . \"/\" . $filename);\n\t\t\t\t\t}\n\t\t\t\t\t$this->adaptiveimages [$multiplier] = $filename;\n\t\t\t\t} else {\n\t\t\t\t\tuser_error(\"Image::generateFormattedImage - Image $format public function not found.\", E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setImageFormat ($format) {}",
"public function getImageFormat () {}",
"public function getImageFormat() {\n\t}",
"public function toImage($options, $format = 'png')\n {\n return $this->prepareImage($options, $format);\n }",
"public function getImage($width = null, $height=null, $format=\"png\")\n\t{\n\t\t$image = new \\Imagine\\Gd\\Imagine();\n\t\t$image = $image->load(stream_get_contents($this->content));\n\n\t\tif ($width !== null && $height !== null) {\n\t\t\t$imageBox = new \\Imagine\\Image\\Box($width, $height);\n\t\t\t$image = $image->thumbnail($imageBox, \\Imagine\\Image\\ManipulatorInterface::THUMBNAIL_INSET);\n\t\t}\n\n\t\t$content = $image->get('png');\n\n\t\treturn new \\Symfony\\Component\\HttpFoundation\\Response($content, 200, array('content-type'=>'image/png'));\n\t}",
"public function getResource()\n {\n if (!is_resource($this->img)) \n {\n switch ($this->info['mime'])\n {\n case 'image/png':\n $this->img = imagecreatefrompng($this->info['image']);\n break;\n case 'image/gif':\n $this->img = imagecreatefromgif($this->info['image']);\n break;\n case 'image/webp':\n $this->img = imagecreatefromwebp($this->info['image']);\n break;\n case 'image/wbmp':\n case 'image/vnd.wap.wbmp':\n $this->img = imagecreatefromwbmp($this->info['image']);\n break;\n case 'image/xbm':\n case 'image/x-xbitmap':\n $this->img = imagecreatefromxbm($this->info['image']);\n break;\n case 'image/xpm':\n case 'image/x-xpixmap':\n $this->img = imagecreatefromxpm($this->info['image']);\n break;\n default:\n $this->img = imagecreatefromjpeg($this->info['image']);\n break;\n }\n if ($this->info['type'] == IMAGETYPE_PNG || $this->info['type'] == IMAGETYPE_GIF)\n {\n imagealphablending($this->img, false);\n imagesavealpha($this->img, true);\n }\n }\n return $this->img;\n }",
"public function setImageFormat($format) {\n\t}",
"private function get_image() {\n\t\t$this->addon->log_debug( __METHOD__ . \"(): Running for file: {$this->filename}\" );\n\t\t$file_path = trailingslashit( GFSignature::get_signatures_folder() ) . $this->filename . '.png';\n\n\t\tif ( ! $this->is_valid_file( $file_path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Preventing errors from being displayed.\n\t\t$prev_level = error_reporting( 0 );\n\n\t\t$image = imagecreatefrompng( $file_path );\n\n\t\t// Restoring error reporting level.\n\t\terror_reporting( $prev_level );\n\n\t\tif ( ! $image || $this->is_transparent_image() ) {\n\t\t\treturn $image;\n\t\t}\n\n\t\treturn $this->get_flattened_image( $image );\n\t}",
"function output($format = null, $quality = null) {\n\n // Determine quality\n $quality = $quality ?: $this->quality;\n\n // Determine mimetype\n switch (strtolower($format)) {\n case 'gif':\n $mimetype = 'image/gif';\n break;\n case 'jpeg':\n case 'jpg':\n imageinterlace($this->image, true);\n $mimetype = 'image/jpeg';\n break;\n case 'png':\n $mimetype = 'image/png';\n break;\n default:\n $info = (empty($this->imagestring)) ? getimagesize($this->filename) : getimagesizefromstring($this->imagestring);\n $mimetype = $info['mime'];\n unset($info);\n break;\n }\n\n // Output the image\n header('Content-Type: '.$mimetype);\n switch ($mimetype) {\n case 'image/gif':\n imagegif($this->image);\n break;\n case 'image/jpeg':\n imageinterlace($this->image, true);\n imagejpeg($this->image, null, round($quality));\n break;\n case 'image/png':\n imagepng($this->image, null, round(9 * $quality / 100));\n break;\n default:\n throw new Exception('Unsupported image format: '.$this->filename);\n break;\n }\n }",
"protected function get_image() {\n\t\tif ( empty( $this->file ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$image_extension = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );\n\t\tif ( 'jpg' === $image_extension ) {\n\t\t\t$image_extension = 'jpeg';\n\t\t}\n\t\tif ( function_exists( 'imagecreatefrom' . $image_extension ) ) {\n\t\t\treturn call_user_func_array( 'imagecreatefrom' . $image_extension, array( $this->file ) );\n\t\t}\n\t}",
"public function getImage()\n {\n $this->execute();\n $img = new sfImage($this->save_path,'image/jpg');\n return $img;\n }",
"function output_base64($format = null, $quality = null) {\n\n // Determine quality\n $quality = $quality ?: $this->quality;\n\n // Determine mimetype\n switch (strtolower($format)) {\n case 'gif':\n $mimetype = 'image/gif';\n break;\n case 'jpeg':\n case 'jpg':\n imageinterlace($this->image, true);\n $mimetype = 'image/jpeg';\n break;\n case 'png':\n $mimetype = 'image/png';\n break;\n default:\n $info = getimagesize($this->filename);\n $mimetype = $info['mime'];\n unset($info);\n break;\n }\n\n // Output the image\n ob_start();\n switch ($mimetype) {\n case 'image/gif':\n imagegif($this->image);\n break;\n case 'image/jpeg':\n imagejpeg($this->image, null, round($quality));\n break;\n case 'image/png':\n imagepng($this->image, null, round(9 * $quality / 100));\n break;\n default:\n throw new Exception('Unsupported image format: '.$this->filename);\n break;\n }\n $image_data = ob_get_contents();\n ob_end_clean();\n\n // Returns formatted string for img src\n return 'data:'.$mimetype.';base64,'.base64_encode($image_data);\n\n }",
"public function image()\n {\n return new Image;\n }",
"public function getImage () {}",
"public function getImageResponse()\n {\n $request = RequestFactory::create(func_get_args(), $this->defaultManipulations);\n\n $path = $this->makeImage($request);\n\n return $this->responseFactory->getResponse($request, $this->cache, $path);\n }",
"public final function convert(string $format){\n\t\tswitch($format){\n\t\t\tdefault:\n\t\t\tcase 'JPEG':\n\t\t\t\t$this->image_mime = IMAGETYPE_JPEG;\n\t\t\tbreak;\n\t\t\tcase 'PNG':\n\t\t\t\t$this->image_mime = IMAGETYPE_PNG;\n\t\t\tbreak;\n\t\t\tcase 'GIF':\n\t\t\t\t$this->image_mime = IMAGETYPE_GIF;\n\t\t\tbreak;\n\t\t}\n\t\treturn $this;\n\t}",
"private function fetch_image() {\n $image_size = getimagesize($this->image_src);\n $image_width = $image_size[0];\n $image_height = $image_size[1];\n $mime_array = explode('/', $this->file_mime_type);\n $file_mime_as_ext = end($mime_array);\n $image_dest_func = 'imagecreate';\n if ($this->gd_version >= 2)\n $image_dest_func = 'imagecreatetruecolor';\n if (in_array($file_mime_as_ext, array('gif', 'jpeg', 'png'))) {\n $image_src_func = 'imagecreatefrom' . $this->file_extension;\n $image_create_func = 'image' . $this->file_extension;\n } else {\n $this->error('The image you supply must have a .gif, .jpg/.jpeg, or .png extension.');\n return false;\n }\n $this->increase_memory_limit();\n $image_src = @call_user_func($image_src_func, $this->image_src);\n $image_dest = @call_user_func($image_dest_func, $image_width, $image_height);\n if ($file_mime_as_ext === 'jpeg') {\n $background = imagecolorallocate($image_dest, 255, 255, 255);\n imagefill($image_dest, 0, 0, $background);\n } elseif (in_array($file_mime_as_ext, array('gif', 'png'))) {\n imagealphablending($image_src, false);\n imagesavealpha($image_src, true);\n imagealphablending($image_dest, false);\n imagesavealpha($image_dest, true);\n }\n imagecopy($image_dest, $image_src, 0, 0, 0, 0, $image_width, $image_height);\n switch ($file_mime_as_ext) {\n case 'jpeg':\n $created = imagejpeg($image_dest, $this->cached_filename, $this->quality->jpeg);\n break;\n case 'png':\n $created = imagepng($image_dest, $this->cached_filename, $this->quality->png);\n break;\n case 'gif':\n $created = imagegif($image_dest, $this->cached_filename);\n break;\n default:\n return false;\n break;\n }\n imagedestroy($image_src);\n imagedestroy($image_dest);\n $this->reset_memory_limit();\n return $created;\n }",
"public function image()\n {\n $image_params = $this->getParams();\n $image_params['brand_id'] = $this->id;\n $image_params['name'] = 'brandimage';\n\n $image = new \\Spotlight\\File\\Entity\\Image($image_params);\n return $image;\n }",
"public function getImage()\n {\n $image = $this->image();\n $this->image = $image->url();\n return $this->image;\n }",
"public function outputImage($key,$size=\"\"){\r\n\t\tif (empty($key)) {\r\n\t\t\treturn $this->errorImage();\r\n\t\t}\r\n\t\theader ( \"Cache-Control: no-cache, must-revalidate\" );\r\n\t\theader ( \"Content-type: image/gif\" );\r\n\t\t$code=$this->cache->get($key);\r\n\t\tif (empty($code)) {\r\n\t\t\treturn $this->errorImage();\r\n\t\t}\r\n\t\t//make image according to type\r\n\t\tif ($this->type=='im') {\r\n\t\t\treturn $this->imImage($key,$code,$size=\"\");\r\n\t\t}else{\r\n\t\t\treturn $this->gdImage($code,$size);\r\n\t\t}\r\n\t}",
"public function show() {\n\t\tswitch ($this->getType()) {\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\treturn imagegif($this->image, null);\n\t\t\t\tbreak;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\treturn imagejpeg($this->image, null, 100);\n\t\t\t\tbreak;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\treturn imagepng($this->image, null, 0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn imagejpeg($this->image, null, 100);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function get_image($save_name) {\n header('Content-type: image/' . $this->theme['imageformat']);\n header('Content-Disposition: filename=' . $save_name . '.' . $this->theme['imageformat']);\n\n switch ($this->theme['imageformat']) {\n case 'gif':\n $this->makeimagegif();\n break;\n\n case 'jpg':\n imagejpeg($this->im, '', $this->theme['quality_jpg']);\n break;\n\n case 'png':\n imagepng($this->im);\n break;\n }\n }",
"public function toGdImage()\n {\n return imagecreatefromstring($this->getMediaPath());\n }",
"public function createImage($name, $size = 500, $format='raw'){\n return libvirt_image_create($this->connection,$name, $size, $format);\n }",
"function Image() {\n\t\tif(!$this->imageObj) {\n\t\t\t$funcName = $this->urlParams['Field'];\n\t\t\t$linked = $this->linkedObj();\n\t\t\t$this->imageObj = $linked->obj($funcName);\n\t\t\tif(!$this->imageObj) {$this->imageObj = new Image(null);}\n\t\t}\n\t\t\n\t\treturn $this->imageObj;\n\t}",
"private function _getImageResource() {\r\n if($this->type === 'jpg') {\r\n return @imagecreatefromjpeg($this->fullPath);\r\n }\r\n else if($this->type === 'png') {\r\n return @imagecreatefrompng($this->fullPath);\r\n }\r\n else {\r\n return false;\r\n }\r\n }",
"function getMapImage(){\n\t\t$out\t= null;\n\t\t\n\t\t/**\n\t\t * Check of image type.\n\t\t * @var Integer hods the typ of image ([1] Graphics Interchange, [2] Joint Photographic Experts Group, [3] Portable Network Graphics)\n\t\t */\n\t\t$type\t= exif_imagetype( $this->config->getConfig( 'MAP_PATH' ) );\n\n\t\t/**\n\t\t * Loding the image with the applicable method.\n\t\t */\n\t\tswitch ($type) { \n\t\t\tcase 1 : \n\t\t\t\t$out = imageCreateFromGif( $this->config->getConfig( 'MAP_PATH' ) ); \n\t\t\tbreak; \n\t\t\tcase 2 : \n\t\t\t\t$out = imageCreateFromJpeg( $this->config->getConfig( 'MAP_PATH' ) ); \n\t\t\tbreak; \n\t\t\tcase 3 : \n\t\t\t\t$out = imageCreateFromPng( $this->config->getConfig( 'MAP_PATH' ) ); \n\t\t\tbreak; \n\t\t} \n\n\t\treturn $out;\n\t}"
] | [
"0.794188",
"0.7091227",
"0.699357",
"0.6983998",
"0.69364834",
"0.68200314",
"0.6571277",
"0.65679556",
"0.6525877",
"0.6414821",
"0.6375637",
"0.6273209",
"0.6244256",
"0.62254673",
"0.62157476",
"0.61524373",
"0.6118722",
"0.6118622",
"0.61085445",
"0.6097171",
"0.6091472",
"0.6081588",
"0.6058621",
"0.60474116",
"0.60472274",
"0.60395336",
"0.60365784",
"0.6002555",
"0.59721094",
"0.59610254"
] | 0.76433426 | 1 |
Return the filename for the cached image, given it's format name and arguments. | function cacheFilename($format, $arg1 = null, $arg2 = null) {
$folder = $this->ParentID ? $this->Parent()->Filename : ASSETS_DIR . "/";
$format = $format.$arg1.$arg2;
return $folder . "_resampled/$format-" . $this->Name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFormattedImage($format) {\n\t\t$args = func_get_args();\n\t\t\n\t\tif ($this->ID && $this->Filename && Director::fileExists($this->Filename)) {\n\t\t\t$cacheFile = call_user_func_array(array($this, \"cacheFilename\"), $args);\n\t\t\t$filename = Director::baseFolder() . \"/\" . $cacheFile;\n\t\t\t$filename = $this->insertFilenameAppender($filename, '-10x');\n\t\t\tif (!file_exists($filename) || isset($_GET['flush'])) {\n\t\t\t\tcall_user_func_array(array($this, \"generateFormattedImage\"), $args);\n\t\t\t} else {\n\t\t\t\t$this->adaptiveimages['1.0'] = $this->insertFilenameAppender($cacheFile, '-10x');\n\t\t\t\t$this->adaptiveimages['1.5'] = $this->insertFilenameAppender($cacheFile, '-15x');\n\t\t\t\t$this->adaptiveimages['2.0'] = $this->insertFilenameAppender($cacheFile, '-20x');\n\t\t\t}\n\n\t\t\t$cached = RetinaImage_Cached::create($cacheFile);\n\t\t\t// Pass through the title so the templates can use it\n\t\t\t$cached->Title = $this->Title;\n\t\t\t// Pass through the parent, to store cached images in correct folder.\n\t\t\t$cached->ParentID = $this->ParentID;\n\t\t\t\n\t\t\treturn $cached;\n\t\t}\n\t}",
"function getFormattedImage($format, $arg1 = null, $arg2 = null) {\n\t\tif($this->ID && $this->Filename && Director::fileExists($this->Filename)) {\n\t\t\t$cacheFile = $this->cacheFilename($format, $arg1, $arg2);\n\n\t\t\tif(!file_exists(\"../\".$cacheFile) || isset($_GET['flush'])) {\n\t\t\t\t$this->generateFormattedImage($format, $arg1, $arg2);\n\t\t\t}\n\t\t\t\n\t\t\treturn new Image_Cached($cacheFile);\n\t\t}\n\t}",
"private function _filename() {\r\n\t\treturn $this->path . $this->id . '_' . $this->dimentions . '.jpg';\r\n\t}",
"private function getFileName()\n {\n if (null === $this->cachePath || null === $this->key) {\n return null;\n }\n\n if (!is_dir($this->cachePath)) {\n mkdir($this->cachePath, 0777);\n }\n\n return $this->cachePath . DIRECTORY_SEPARATOR . $this->key . '.rerun';\n }",
"private function generateCacheFileName() \n\t{\t\t\t\t\n\t\t\t\n\t\t$imageName = JFile::makesafe( basename( $this->getFileName() ) );\n\t\t$imageName = JFile::removespace($imageName);\n\t\t$imageName = explode('.',$imageName);\t\n\t\t$imageName = str_replace( '_', '', $imageName[0] );\n\t\t\n\t\t$cacheFileName = $imageName;\t\t\n\t\t$cacheFileName .= $this->thumbw.'x'.$this->thumbh;\n\t\t$cacheFileName .= '_q'.intval( $this->getQuality() );\n\t\tif($this->square)\n\t\t\t$cacheFileName .= '_sq';\n\t\t$cacheFileName .= '.jpg';\n\t\t\n\t\t$this->broadDirectories = $this->generateCacheDir().DS;\n\n\t\t$this->cacheFileName = $this->cacheDirectory.$this->broadDirectories.$this->cachePrefix.$cacheFileName;\n\n\t\treturn true;\t\t\n\t}",
"public function getImageFilename() {\n $number_hash = md5($this->getLNumber());\n\t\t$image_filename = $number_hash . '.png';\n return $image_filename;\n }",
"public function getImageFilename () {}",
"function _cache_get_filename()\r\n\t{\r\n\t\t$fname = 'wowcd.cache.' . $this -> cache_hash . '.html';\r\n\t\treturn $this -> cache_dir . $fname;\r\n\t}",
"protected function getCacheFileName() {\n\t\treturn TranslateUtils::cacheFile( \"translate_groupcache-{$this->group->getId()}-{$this->code}.cdb\" );\n\t}",
"private function set_cached_filename() {\n $pathinfo = pathinfo($this->image_src);\n //$this->cached_filename = $this->cached_image_directory . '/' . md5($this->cached_directory_version . basename($this->image_src) . $this->image_src_version) . '.' . $this->file_extension;\n $this->cached_filename = $this->cached_image_directory . '/' . basename($this->image_src);\n }",
"function generateFormattedImage($format, $arg1 = null, $arg2 = null) {\n\t\t$cacheFile = $this->cacheFilename($format, $arg1, $arg2);\n\t\n\t\t$gd = new GD(\"../\" . $this->Filename);\n\t\t\n\t\t\n\t\tif($gd->hasGD()){\n\t\t\t$generateFunc = \"generate$format\";\t\t\n\t\t\tif($this->hasMethod($generateFunc)){\n\t\t\t\t$gd = $this->$generateFunc($gd, $arg1, $arg2);\n\t\t\t\tif($gd){\n\t\t\t\t\t$gd->writeTo(\"../\" . $cacheFile);\n\t\t\t\t}\n\t\n\t\t\t} else {\n\t\t\t\tUSER_ERROR(\"Image::generateFormattedImage - Image $format function not found.\",E_USER_WARNING);\n\t\t\t}\n\t\t}\n\t}",
"public static function getFileName()\n {\n $files = glob(__DIR__ .'/cache/*.txt');\n $file = $files[0];\n $fileName = explode(\"/cache/\", $file);\n $fileName = $fileName[1];\n\n return $fileName;\n }",
"public function getImageFilename() {\n\t}",
"function get_cache_filename($url) {\n $extension = ICAL_EVENTS_CACHE_DEFAULT_EXTENSION;\n\n $matches = array();\n if (preg_match('/\\.(\\w+)$/', $url, $matches)) {\n $extension = $matches[1];\n }\n\n return md5($url) . \".$extension\";\n }",
"protected function getFilename()\n {\n $filename = trim($this->resolvePattern('%filename%'));\n return sanitize_file_name($filename ?: uniqid('img_', false));\n }",
"public function getCacheName($params)\n {\n \t$ext = $this->ext;\t\n\t\t\t\n \tif($params['ext']){\n \t\t\n \t\t$ext = $params['ext'];\n \t}\n\t\t\t\t\t\n \treturn $this->id . '_' . md5(implode('', $params)) . '.' . $ext;\n\t}",
"private function getFilename(string $name): string\n {\n //Runtime cache\n return sprintf(\n '%s/%s.%s',\n $this->directory,\n strtolower(str_replace(['/', '\\\\'], '-', $name)),\n self::EXTENSION\n );\n }",
"public function cache_filename() {\r\n return $this->cache_dir . $this->sector . '.partcache';\r\n }",
"private function buildFilename($key)\n\t{\n\t\treturn $this->path.'/'.md5($key).'.cache';\n\t}",
"public function getOutputFileName(): string\n {\n return \\sprintf('%s.%s', $this->cleanName(), $this->format);\n }",
"public function getCacheFileName()\n {\n $tmp = array(\n 'in' => $this->include,\n 'ex' => $this->exclude,\n 'ign' => $this->ignore,\n );\n\n return $this->cacheDir . \"/autoloader.\" . md5(serialize($tmp)) . \".php\";\n }",
"protected function filename(): string\n {\n return 'Receptionists_' . date('YmdHis');\n }",
"function file_name ($url)\n\t{\n\t\t$filename = md5( $url );\n\t\treturn reduce_double_slashes(join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename)));\n\t}",
"protected static function filename($string)\n\t{\n\t\treturn sha1($string).'.cache';\n\t}",
"public function generateFormattedImage($format) {\n\t\t$args = func_get_args();\n\n\t\t// list of independent resoultions to generate\n\t\t$cacheFile = call_user_func_array(array($this, \"cacheFilename\"), $args);\n\n\t\t$DPIlist = array(\n\t\t\t'1.0' => $this->insertFilenameAppender($cacheFile, '-10x'),\n\t\t\t'1.5' => $this->insertFilenameAppender($cacheFile, '-15x'),\n\t\t\t'2.0' => $this->insertFilenameAppender($cacheFile, '-20x'),\n\t\t);\n\t\t$gdbackend = Image::get_backend();\n\t\t$defaultQuality = config::inst()->get('RetinaImage', 'defaultQuality');\n\t\t\n\t\t// degrade the quality of the image as the dimensions increase\n\t\t$qualityDegrade = config::inst()->get('RetinaImage', 'qualityDegrade');\n\t\t$qualityCap = config::inst()->get('RetinaImage', 'qualityCap');\n\t\t\n\t\t// iterate through each resoultion to generate\n\t\tforeach ($DPIlist as $multiplier => $filename) {\n\t\t\t$backend = Injector::inst()->createWithArgs($gdbackend, array(\n\t\t\t\tDirector::baseFolder() . \"/\" . $this->Filename\n\t\t\t));\n\n\t\t\tif ($backend->hasImageResource()) {\n\t\t\t\t$generateFunc = \"generate$format\";\n\t\t\t\tif ($this->hasMethod($generateFunc)) {\n\t\t\t\t\tarray_shift($args);\n\t\t\t\t\tarray_unshift($args, $backend);\n\n\t\t\t\t\t$modifiedargs = $args;\n\t\t\t\t\t// most formatted images have width \n\t\t\t\t\tif (isset($args[1]) && isset($args[2]) &&\n\t\t\t\t\t\t\tis_numeric($args[1]) && is_numeric($args[2])) {\n\t\t\t\t\t\t$modifiedargs[1] = (int) ($args[1] * $multiplier);\n\t\t\t\t\t\t$modifiedargs[2] = (int) ($args[2] * $multiplier);\n\t\t\t\t\t\t// for SetHeight, SetWidth\n\t\t\t\t\t} else if (isset($args[1]) && is_numeric($args[1])) {\n\t\t\t\t\t\t$modifiedargs[1] = (int) ($args[1] * $multiplier);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// degrade the quality as the higher images progress\n\t\t\t\t\t$quality = $defaultQuality - (($multiplier-1) * $qualityDegrade);\n\t\t\t\t\tif($quality < $qualityCap) {\n\t\t\t\t\t\t$quality = $qualityCap;\n\t\t\t\t\t}\n\t\t\t\t\t$backend->setQuality($quality);\n\t\t\t\t\t$backend = call_user_func_array(array($this, $generateFunc), $modifiedargs);\n\t\t\t\t\tif ($backend) {\n\t\t\t\t\t\t$backend->writeTo(Director::baseFolder() . \"/\" . $filename);\n\t\t\t\t\t}\n\t\t\t\t\t$this->adaptiveimages [$multiplier] = $filename;\n\t\t\t\t} else {\n\t\t\t\t\tuser_error(\"Image::generateFormattedImage - Image $format public function not found.\", E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function img_path($name, $format = 'jpg') {\n return 'Layouts/img/' . $name . \".\" . $format;\n}",
"protected function buildFileName()\n {\n $version = $this->argument('version');\n if ($version === 'latest') {\n // TODO : find a way to retrieve the latest version number released (github tags ?)\n return 'latest.zip';\n } else {\n $version = \"modx-{$version}\";\n }\n if ($this->option('advanced')) {\n $version .= '-advanced';\n } elseif ($this->option('sdk')) {\n $version .= '-sdk';\n }\n\n return $version .'.zip';\n }",
"protected function cacheFilename($url = null) {\n $url = $url ? $url : $this->url();\n return md5($url);\n }",
"public function get_cache_name() {\n return md5($this->url->getURL() . $this->config['cache_seed']);\n }",
"private function getNameWithPath(){\n $name = $this->imageFolder.date('YmdHis').\".jpg\";\n return $name;\n }"
] | [
"0.71129155",
"0.6988468",
"0.6644702",
"0.6555749",
"0.6525973",
"0.64231974",
"0.6402231",
"0.63841534",
"0.6369246",
"0.63373333",
"0.63269883",
"0.6296506",
"0.6261888",
"0.6170092",
"0.6147415",
"0.61315393",
"0.60971826",
"0.60744613",
"0.6062461",
"0.60337764",
"0.59920466",
"0.59863406",
"0.5971617",
"0.5938693",
"0.5929226",
"0.59167415",
"0.5895139",
"0.58878475",
"0.5886303",
"0.5883874"
] | 0.78612036 | 0 |
Generate an image on the specified format. It will save the image at the location specified by cacheFilename(). The image will be generated using the specific 'generate' method for the specified format. | function generateFormattedImage($format, $arg1 = null, $arg2 = null) {
$cacheFile = $this->cacheFilename($format, $arg1, $arg2);
$gd = new GD("../" . $this->Filename);
if($gd->hasGD()){
$generateFunc = "generate$format";
if($this->hasMethod($generateFunc)){
$gd = $this->$generateFunc($gd, $arg1, $arg2);
if($gd){
$gd->writeTo("../" . $cacheFile);
}
} else {
USER_ERROR("Image::generateFormattedImage - Image $format function not found.",E_USER_WARNING);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generateFormattedImage($format) {\n\t\t$args = func_get_args();\n\n\t\t// list of independent resoultions to generate\n\t\t$cacheFile = call_user_func_array(array($this, \"cacheFilename\"), $args);\n\n\t\t$DPIlist = array(\n\t\t\t'1.0' => $this->insertFilenameAppender($cacheFile, '-10x'),\n\t\t\t'1.5' => $this->insertFilenameAppender($cacheFile, '-15x'),\n\t\t\t'2.0' => $this->insertFilenameAppender($cacheFile, '-20x'),\n\t\t);\n\t\t$gdbackend = Image::get_backend();\n\t\t$defaultQuality = config::inst()->get('RetinaImage', 'defaultQuality');\n\t\t\n\t\t// degrade the quality of the image as the dimensions increase\n\t\t$qualityDegrade = config::inst()->get('RetinaImage', 'qualityDegrade');\n\t\t$qualityCap = config::inst()->get('RetinaImage', 'qualityCap');\n\t\t\n\t\t// iterate through each resoultion to generate\n\t\tforeach ($DPIlist as $multiplier => $filename) {\n\t\t\t$backend = Injector::inst()->createWithArgs($gdbackend, array(\n\t\t\t\tDirector::baseFolder() . \"/\" . $this->Filename\n\t\t\t));\n\n\t\t\tif ($backend->hasImageResource()) {\n\t\t\t\t$generateFunc = \"generate$format\";\n\t\t\t\tif ($this->hasMethod($generateFunc)) {\n\t\t\t\t\tarray_shift($args);\n\t\t\t\t\tarray_unshift($args, $backend);\n\n\t\t\t\t\t$modifiedargs = $args;\n\t\t\t\t\t// most formatted images have width \n\t\t\t\t\tif (isset($args[1]) && isset($args[2]) &&\n\t\t\t\t\t\t\tis_numeric($args[1]) && is_numeric($args[2])) {\n\t\t\t\t\t\t$modifiedargs[1] = (int) ($args[1] * $multiplier);\n\t\t\t\t\t\t$modifiedargs[2] = (int) ($args[2] * $multiplier);\n\t\t\t\t\t\t// for SetHeight, SetWidth\n\t\t\t\t\t} else if (isset($args[1]) && is_numeric($args[1])) {\n\t\t\t\t\t\t$modifiedargs[1] = (int) ($args[1] * $multiplier);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// degrade the quality as the higher images progress\n\t\t\t\t\t$quality = $defaultQuality - (($multiplier-1) * $qualityDegrade);\n\t\t\t\t\tif($quality < $qualityCap) {\n\t\t\t\t\t\t$quality = $qualityCap;\n\t\t\t\t\t}\n\t\t\t\t\t$backend->setQuality($quality);\n\t\t\t\t\t$backend = call_user_func_array(array($this, $generateFunc), $modifiedargs);\n\t\t\t\t\tif ($backend) {\n\t\t\t\t\t\t$backend->writeTo(Director::baseFolder() . \"/\" . $filename);\n\t\t\t\t\t}\n\t\t\t\t\t$this->adaptiveimages [$multiplier] = $filename;\n\t\t\t\t} else {\n\t\t\t\t\tuser_error(\"Image::generateFormattedImage - Image $format public function not found.\", E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function getFormattedImage($format) {\n\t\t$args = func_get_args();\n\t\t\n\t\tif ($this->ID && $this->Filename && Director::fileExists($this->Filename)) {\n\t\t\t$cacheFile = call_user_func_array(array($this, \"cacheFilename\"), $args);\n\t\t\t$filename = Director::baseFolder() . \"/\" . $cacheFile;\n\t\t\t$filename = $this->insertFilenameAppender($filename, '-10x');\n\t\t\tif (!file_exists($filename) || isset($_GET['flush'])) {\n\t\t\t\tcall_user_func_array(array($this, \"generateFormattedImage\"), $args);\n\t\t\t} else {\n\t\t\t\t$this->adaptiveimages['1.0'] = $this->insertFilenameAppender($cacheFile, '-10x');\n\t\t\t\t$this->adaptiveimages['1.5'] = $this->insertFilenameAppender($cacheFile, '-15x');\n\t\t\t\t$this->adaptiveimages['2.0'] = $this->insertFilenameAppender($cacheFile, '-20x');\n\t\t\t}\n\n\t\t\t$cached = RetinaImage_Cached::create($cacheFile);\n\t\t\t// Pass through the title so the templates can use it\n\t\t\t$cached->Title = $this->Title;\n\t\t\t// Pass through the parent, to store cached images in correct folder.\n\t\t\t$cached->ParentID = $this->ParentID;\n\t\t\t\n\t\t\treturn $cached;\n\t\t}\n\t}",
"function getFormattedImage($format, $arg1 = null, $arg2 = null) {\n\t\tif($this->ID && $this->Filename && Director::fileExists($this->Filename)) {\n\t\t\t$cacheFile = $this->cacheFilename($format, $arg1, $arg2);\n\n\t\t\tif(!file_exists(\"../\".$cacheFile) || isset($_GET['flush'])) {\n\t\t\t\t$this->generateFormattedImage($format, $arg1, $arg2);\n\t\t\t}\n\t\t\t\n\t\t\treturn new Image_Cached($cacheFile);\n\t\t}\n\t}",
"public function gen($url) {\n $file = self::CACHE_DIR . md5($url);\n\n if (!file_exists($file)) {\n $esc_file = escapeshellarg($file);\n $esc_url = escapeshellarg(base64_decode($url));\n system(\"qrencode --output=$esc_file --level=H --size=5 --margin=10 $esc_url\");\n }\n\n header(\"Content-type: image/png\");\n fpassthru(fopen($file,\"r\"));\n }",
"function cacheFilename($format, $arg1 = null, $arg2 = null) {\n\t\t$folder = $this->ParentID ? $this->Parent()->Filename : ASSETS_DIR . \"/\";\n\t\t\n\t\t$format = $format.$arg1.$arg2;\n\t\t\n\t\treturn $folder . \"_resampled/$format-\" . $this->Name;\n\t}",
"public function setImageFormat ($format) {}",
"private static function generate( &$model, $field, $size, $use_cache = true )\n\t{\n\n\t\t$original_file = $model->get_attribute($field);\n\n\t\t// no image?\n\t\tif ( !$original_file ) return null;\n\n\t\t// did we ask for the original?\n\t\tif ( $size=='original' ) {\n\t\t\treturn $original_file;\n\t\t}\n\n\t\t// we could pass an array instead of a size\n\t\t// in which case we are specifiying directory and format for that particular size\n\t\t// cast it all to an array and proceed accordingly\n\t\tif ( !is_array($size) ) {\n\t\t\t$size = array( 'size' => $size );\n\t\t}\n\n\t\t// get the directory, format, method, quality and dimensions\n\t\t$directory = array_get($size, 'storage_dir', static::config( $model, 'storage_dir', $field ) );\n\t\t$format = array_get($size, 'thumbnail_format', static::config( $model, 'thumbnail_format', $field ) );\n\t\t$method = array_get($size, 'resize_method', static::config( $model, 'resize_method', $field ) );\n\t\t$quality = array_get($size, 'thumbnail_quality', static::config( $model, 'thumbnail_quality', $field ) );\n\t\t$dimensions = array_get($size, 'size', null );\n\n\t\tif ( !$dimensions ) {\n\t\t\tthrow new \\Exception(\"Can not generate thumbnail for $field: no dimensions given.\", 1);\n\t\t}\n\n\t\tif ( $format == 'auto' ) {\n\t\t\t$format = File::extension( $original_file );\n\t\t}\n\t\t$new_file = rtrim( $original_file, File::extension( $original_file ) ) .\n\t\t\tStr::lower($dimensions) . '.' . $format;\n\n\t\t// if we already have a cached copy, return it\n\t\tif ( $use_cache && File::exists( $directory . DS . $new_file ) ) {\n\t\t\treturn $new_file;\n\t\t}\n\n\t\tif ( !File::exists( $directory . DS . $original_file ) ) {\n\t\t\tthrow new \\Exception(\"Can not generate $dimensions thumbnail for $field: no original.\");\n\t\t}\n\n\t\tlist( $dst_width, $dst_height ) = explode('x', Str::lower($dimensions) );\n\n\t\tBundle::register('resizer');\n\t\tBundle::start('resizer');\n\n\t\t$success = Resizer::open( $directory . DS . $original_file )\n\t\t\t->resize( $dst_width, $dst_height, $method )\n\t\t\t->save( $directory . DS . $new_file, $quality );\n\n\t\tif ( !$success ) {\n\t\t\tthrow new \\Exception(\"Could not generate thumbnail $new_file.\");\n\t\t}\n\n\t\treturn $new_file;\n\n\t}",
"public function get_image($save_name) {\n header('Content-type: image/' . $this->theme['imageformat']);\n header('Content-Disposition: filename=' . $save_name . '.' . $this->theme['imageformat']);\n\n switch ($this->theme['imageformat']) {\n case 'gif':\n $this->makeimagegif();\n break;\n\n case 'jpg':\n imagejpeg($this->im, '', $this->theme['quality_jpg']);\n break;\n\n case 'png':\n imagepng($this->im);\n break;\n }\n }",
"public function outputImage($key,$size=\"\"){\r\n\t\tif (empty($key)) {\r\n\t\t\treturn $this->errorImage();\r\n\t\t}\r\n\t\theader ( \"Cache-Control: no-cache, must-revalidate\" );\r\n\t\theader ( \"Content-type: image/gif\" );\r\n\t\t$code=$this->cache->get($key);\r\n\t\tif (empty($code)) {\r\n\t\t\treturn $this->errorImage();\r\n\t\t}\r\n\t\t//make image according to type\r\n\t\tif ($this->type=='im') {\r\n\t\t\treturn $this->imImage($key,$code,$size=\"\");\r\n\t\t}else{\r\n\t\t\treturn $this->gdImage($code,$size);\r\n\t\t}\r\n\t}",
"function output($format = null, $quality = null) {\n\n // Determine quality\n $quality = $quality ?: $this->quality;\n\n // Determine mimetype\n switch (strtolower($format)) {\n case 'gif':\n $mimetype = 'image/gif';\n break;\n case 'jpeg':\n case 'jpg':\n imageinterlace($this->image, true);\n $mimetype = 'image/jpeg';\n break;\n case 'png':\n $mimetype = 'image/png';\n break;\n default:\n $info = (empty($this->imagestring)) ? getimagesize($this->filename) : getimagesizefromstring($this->imagestring);\n $mimetype = $info['mime'];\n unset($info);\n break;\n }\n\n // Output the image\n header('Content-Type: '.$mimetype);\n switch ($mimetype) {\n case 'image/gif':\n imagegif($this->image);\n break;\n case 'image/jpeg':\n imageinterlace($this->image, true);\n imagejpeg($this->image, null, round($quality));\n break;\n case 'image/png':\n imagepng($this->image, null, round(9 * $quality / 100));\n break;\n default:\n throw new Exception('Unsupported image format: '.$this->filename);\n break;\n }\n }",
"public function outputImage()\n {\n $request = RequestFactory::create(func_get_args(), $this->defaultManipulations);\n\n $path = $this->makeImage($request);\n\n $response = $this->responseFactory->getResponse($request, $this->cache, $path);\n\n $response->send();\n }",
"public abstract function render($format = 'png', $die = true, $quality = 90);",
"private function fetch_image() {\n $image_size = getimagesize($this->image_src);\n $image_width = $image_size[0];\n $image_height = $image_size[1];\n $mime_array = explode('/', $this->file_mime_type);\n $file_mime_as_ext = end($mime_array);\n $image_dest_func = 'imagecreate';\n if ($this->gd_version >= 2)\n $image_dest_func = 'imagecreatetruecolor';\n if (in_array($file_mime_as_ext, array('gif', 'jpeg', 'png'))) {\n $image_src_func = 'imagecreatefrom' . $this->file_extension;\n $image_create_func = 'image' . $this->file_extension;\n } else {\n $this->error('The image you supply must have a .gif, .jpg/.jpeg, or .png extension.');\n return false;\n }\n $this->increase_memory_limit();\n $image_src = @call_user_func($image_src_func, $this->image_src);\n $image_dest = @call_user_func($image_dest_func, $image_width, $image_height);\n if ($file_mime_as_ext === 'jpeg') {\n $background = imagecolorallocate($image_dest, 255, 255, 255);\n imagefill($image_dest, 0, 0, $background);\n } elseif (in_array($file_mime_as_ext, array('gif', 'png'))) {\n imagealphablending($image_src, false);\n imagesavealpha($image_src, true);\n imagealphablending($image_dest, false);\n imagesavealpha($image_dest, true);\n }\n imagecopy($image_dest, $image_src, 0, 0, 0, 0, $image_width, $image_height);\n switch ($file_mime_as_ext) {\n case 'jpeg':\n $created = imagejpeg($image_dest, $this->cached_filename, $this->quality->jpeg);\n break;\n case 'png':\n $created = imagepng($image_dest, $this->cached_filename, $this->quality->png);\n break;\n case 'gif':\n $created = imagegif($image_dest, $this->cached_filename);\n break;\n default:\n return false;\n break;\n }\n imagedestroy($image_src);\n imagedestroy($image_dest);\n $this->reset_memory_limit();\n return $created;\n }",
"private function generateCacheFileName() \n\t{\t\t\t\t\n\t\t\t\n\t\t$imageName = JFile::makesafe( basename( $this->getFileName() ) );\n\t\t$imageName = JFile::removespace($imageName);\n\t\t$imageName = explode('.',$imageName);\t\n\t\t$imageName = str_replace( '_', '', $imageName[0] );\n\t\t\n\t\t$cacheFileName = $imageName;\t\t\n\t\t$cacheFileName .= $this->thumbw.'x'.$this->thumbh;\n\t\t$cacheFileName .= '_q'.intval( $this->getQuality() );\n\t\tif($this->square)\n\t\t\t$cacheFileName .= '_sq';\n\t\t$cacheFileName .= '.jpg';\n\t\t\n\t\t$this->broadDirectories = $this->generateCacheDir().DS;\n\n\t\t$this->cacheFileName = $this->cacheDirectory.$this->broadDirectories.$this->cachePrefix.$cacheFileName;\n\n\t\treturn true;\t\t\n\t}",
"public function generateCache( ){\n global $config;\n\n if( isset( $config['enable_cache'] ) && is_file( $config['dir_database'].'cache/'.$config['language'].'_files' ) ){\n $this->aDefaultImages = unserialize( file_get_contents( $config['dir_database'].'cache/'.$config['language'].'_files' ) );\n return true;\n }\n \n $this->aDefaultImages = null;\n $oSql = Sql::getInstance( );\n $oQuery = $oSql->getQuery( 'SELECT files.iFile, files.iPage, files.iSize, files.sFileName, files.sDescription FROM files, pages WHERE files.iDefault = 1 AND pages.iPage=files.iPage AND pages.sLang = \"'.$config['language'].'\"' );\n while( $aData = $oQuery->fetch( PDO::FETCH_ASSOC ) ){\n $this->aDefaultImages[$aData['iPage']] = $aData;\n } // end while\n\n if( isset( $config['enable_cache'] ) ){\n file_put_contents( $config['dir_database'].'cache/'.$config['language'].'_files', serialize( $this->aDefaultImages ) );\n }\n }",
"private function Output()\n {\n switch ($this->image_type) {\n\t \tcase 'png':\n\t\t $this->image = imagepng($this->image);\n\t\t break;\n\t\t case 'jpg':\n\t\t $this->image = imagejpeg($this->image);\n\t\t break;\n\t\t case 'jpeg':\n\t\t $this->image = imagejpeg($this->image);\n\t\t break;\n\t\t case 'gif':\n\t\t $this->image = imagegif($this->image);\n\t\t break;\n\t\t case 'bmp':\n\t\t $this->image = imagebmp($filename);\n\t\t break;\n\t\t case 'webp':\n\t\t $this->image = imagewebp($filename);\n\t\t break; \n\t\t}\n }",
"public function generate($account, $bufferSize = 1024)\n {\n // Core Variables\n \n $requestUrl = $this->getUrl($account);\n $directory = $this->getStorageDirectory();\n $filename = sha1($requestUrl) . \".png\";\n \n // File Variables\n \n $fileHandler = null;\n $bytesWritten = 0;\n $fileLocation = \".\" . DIRECTORY_SEPARATOR . $filename;\n \n // Other Variables\n \n $temp = null;\n \n // Step 1 - Determine File Location\n \n if ($directory != null)\n {\n $fileLocation = $directory . DIRECTORY_SEPARATOR . $filename;\n }\n \n // Step 2 - Generate QR Code & Return It's Location\n \n if (!is_file($fileLocation))\n {\n // Get QR Code\n \n try\n {\n $fileHandler = fopen($requestUrl, \"r\");\n \n while (!feof($fileHandler))\n {\n $temp .= fread($fileHandler, $bufferSize);\n }\n \n fclose($fileHandler);\n }\n catch (\\Exception $e) {}\n \n // Save QR Code\n \n try\n {\n $fileHandler = fopen($fileLocation, \"w\");\n \n $bytesWritten = fwrite($fileHandler, $temp);\n \n fclose($fileHandler);\n }\n catch (\\Exception $e) {}\n }\n \n return $filename;\n }",
"public function setImageFormat($format) {\n\t}",
"private function get_image() {\n\t\t$this->addon->log_debug( __METHOD__ . \"(): Running for file: {$this->filename}\" );\n\t\t$file_path = trailingslashit( GFSignature::get_signatures_folder() ) . $this->filename . '.png';\n\n\t\tif ( ! $this->is_valid_file( $file_path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Preventing errors from being displayed.\n\t\t$prev_level = error_reporting( 0 );\n\n\t\t$image = imagecreatefrompng( $file_path );\n\n\t\t// Restoring error reporting level.\n\t\terror_reporting( $prev_level );\n\n\t\tif ( ! $image || $this->is_transparent_image() ) {\n\t\t\treturn $image;\n\t\t}\n\n\t\treturn $this->get_flattened_image( $image );\n\t}",
"public function generate()\n {\n $doc = self::FORMAT_WORD;\n $pdf = self::FORMAT_PDF;\n $both = self::FORMAT_BOTH;\n if ($this->format !== $doc && $this->format !== $pdf && $this->format !== $both) {\n throw new InvalidConfigException(\"Format must be either '{$doc}' or '{$pdf}' or '{$both}'\");\n }\n $this->setTemplate();\n $template = $this->getTemplate();\n static::log(\"generate(): Begin report output generation\");\n if (!empty($this->xslStyleSheet)) {\n $path = Yii::getAlias($this->xslStyleSheet);\n if (file_exists($path)) {\n $xslDomDocument = new DOMDocument();\n $xslDomDocument->load($path);\n $template->applyXslStyleSheet($xslDomDocument);\n static::log(\"generate(): Applied xslStyleSheet '{$this->xslStyleSheet}'\");\n }\n }\n $this->process('values');\n $this->process('images');\n $this->process('blocks');\n $this->process('charts');\n $this->process('rows', 'cloneRowAndSetValues');\n $this->process('complexValues');\n $this->process('complexBlocks');\n $file = substr($this->outputFile, 0, strrpos($this->outputFile, \".\"));\n $output = Yii::getAlias(\"{$this->outputPath}/{$file}.{$doc}\");\n $template->saveAs($output);\n static::log(\"generate(): Generated output file '{$file}.{$doc}'\");\n if ($this->format !== $doc) {\n $this->generatePdf($output, Yii::getAlias(\"{$this->outputPath}/{$file}.{$pdf}\"));\n static::log(\"generate(): Generated output file '{$file}.{$pdf}'\");\n if ($this->format === $pdf) {\n unlink($output);\n static::log(\"generate(): Deleted file '{$file}.{$doc}'\");\n }\n }\n static::log(\"generate(): End report output generation\");\n }",
"public function generateImage()\n {\n global $settings;\n \n // Generate the code for the captcha on render\n // This prevents regeneration on retrieval\n $this->generateCode();\n \n // Create the image resource\n $image = imagecreate($this->width * $this->squeeze, $this->height);\n \n // Allocate image colors\n list($r, $g, $b) = self::parseColorsFromHex($this->bgColor);\n $bgColor = imagecolorallocate($image, $r, $g, $b);\n \n list($r, $g, $b) = self::parseColorsFromHex($this->textColor);\n $textColor = imagecolorallocate($image, $r, $g, $b);\n \n list($r, $g, $b) = self::parseColorsFromHex($this->shadowColor);\n $shadowColor = imagecolorallocate($image, $r, $g, $b);\n \n // Offsets for x and y in the image\n $xOffset = 1;\n $yOffset = 20;\n\n // Check if a font is set\n if(strlen($this->font)) {\n $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR . \"fonts\" . DIRECTORY_SEPARATOR;\n $font = $this->font . \".ttf\";\n if(file_exists($path . $font)) {\n // If the font file exists on the server write the environment variable\n putenv('GDFONTPATH=' . $path);\n } else {\n // Font not found\n throw new Exception(\"CaptchaInput Exception: Font '{$this->font}' not found.\");\n }\n } else {\n throw new Exception(\"CaptchaInput Exception: No font set.\");\n }\n \n // Walk through each character in the code, to print it \n $xOffset = $this->fontScaleX*0.25;\n $yOffset = round($this->height*0.7);\n $angle = rand(-15,15);\n for($i = 0; $i < strlen($this->code); $i++) {\n $yOffset += rand(-2, 2);\n $yOffset = ($yOffset > $this->height) ? $this->height : $yOffset;\n $yOffset = ($yOffset < $this->height/2) ? round($this->height/2) : $yOffset;\n $angle += rand(-5,5);\n $this->writeString($image, $xOffset, $yOffset, $angle, $this->code{$i},$textColor, $shadowColor);\n $xOffset += rand(round($this->fontScaleX*0.63),round($this->fontScaleX*0.65)) // Random space for all letters\n + ($i == 0 ? $this->fontScaleX*0.1 : 0) // First letter is caps, so add some space\n + ($this->code{$i} == \"m\" || $this->code{$i} == \"w\" ? $this->fontScaleX*0.18 : 0) // Add space for m's and w's\n - ($this->code{$i} == \"l\" || $this->code{$i} == \"i\" ? $this->fontScaleX*0.2 : 0); // Subtract space for l's and i's\n }\n \n // Render the image\n header(\"Content-type: image/png\"); \n \n $finalImage = imagecreatetruecolor($this->width, $this->height);\n imagecopyresampled($finalImage, $image, 0, 0, 0, 0, $this->width, $this->height, $this->width * $this->squeeze, $this->height);\n imagepng($finalImage);\n \n // Destroy the image to free resources\n imagedestroy($image);\n imagedestroy($finalImage);\n }",
"public function output_image($options=array())\n {\n \n $options = Data($options);\n \n //Get the given path.\n $p = tx('Data')->get->path->get();\n \n //Are we getting a cached image?\n if(strpos($p, 'cache/') === 0)\n {\n \n //Create the filename.\n $filename = basename($p);\n \n //Create parameters.\n $resize = Data(array());\n $crop = Data(array());\n \n //Parse the name for resize parameters.\n $filename = preg_replace_callback('~_resize-(?P<width>\\d+)-(?P<height>\\d+)~', function($result)use(&$resize){\n $resize->{0} = $result['width'];\n $resize->{1} = $result['height'];\n return '';\n }, $filename);\n \n //Parse the name for crop parameters.\n $filename = preg_replace_callback('~_crop-(?P<x>\\d+)-(?P<y>\\d+)-(?P<width>\\d+)-(?P<height>\\d+)~', function($result)use(&$crop){\n $crop->{0} = $result['x'];\n $crop->{1} = $result['y'];\n $crop->{2} = $result['width'];\n $crop->{3} = $result['height'];\n return '';\n }, $filename);\n \n //Use the remaining file name to create a path.\n $path = PATH_COMPONENTS.DS.'media'.DS.'uploads'.DS.'images'.DS.$filename;\n \n //Test if the new path points to an existing file.\n if(!is_file($path)){\n set_status_header(404, sprintf('Image \"%s\" not found.', $filename));\n exit;\n }\n \n }\n \n //If this is not a cached image, the path is simple.\n else{\n \n //Create parameters.\n $resize = Data(false);\n $crop = Data(false);\n \n //Create the filename.\n $filename = basename($p);\n \n //Use the file name to create a path.\n $path = PATH_COMPONENTS.DS.'media'.DS.'uploads'.DS.'images'.DS.$filename;\n \n //Test if the new path points to an existing file.\n if(!is_file($path)){\n set_status_header(404, sprintf('Image \"%s\" not found.', $filename));\n exit;\n }\n \n }\n \n //Since we will output an image. Switch to read-only mode for the session to prevent bottlenecks.\n tx('Session')->close();\n \n $image = tx('File')->image()\n ->use_cache(!tx('Data')->get->no_cache->is_set())\n ->from_file($path)\n ->allow_growth(tx('Data')->get->allow_growth->is_set())\n ->allow_shrink(!tx('Data')->get->disallow_shrink->is_set())\n ->sharpening(!tx('Data')->get->disable_sharpen->is_set());\n \n if(!$resize->is_false())\n $image->resize($resize->{0}, $resize->{1});\n \n if(!$crop->is_false())\n $image->crop($crop->{0}, $crop->{1}, $crop->{2}, $crop->{3});\n \n //See if we should create a public symlink to the file.\n if($options->create_static_symlink->is_true() && $image->has_diverted() === false){\n \n $subfolders = explode(DS, $p);\n $subfolder_count = count($subfolders) -1;\n \n $target = str_repeat('..'.DS, $subfolder_count).'..'.DS.'..'.DS.'uploads'.DS.'images'.DS.$p;\n $link = PATH_COMPONENTS.DS.'media'.DS.'links'.DS.'images'.DS.'static-'.$p;\n \n //Check the link isn't already there.\n if(!is_link($link)){\n \n //Ensure the folder for the link and the symlink itself are present.\n @mkdir(dirname($link), 0777, true);\n if(!@symlink($target, $link)){\n tx('Logging')->log('Media', 'Static symlink', 'Creation failed for: '.$target.' -> '.$link);\n }\n \n }\n \n }\n \n set_exception_handler('exception_handler_image');\n if(tx('Data')->get->download->is_set())\n $image->download(array('as' => tx('Data')->get->as->otherwise(null)));\n else\n $image->output();\n \n }",
"function bootstrapstyle_imagecache($presetname, $path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE, $absolute = TRUE) {\n // Check is_null() so people can intentionally pass an empty array of\n // to override the defaults completely.\n if (is_null($attributes)) {\n $attributes = array('class' => 'imagecache imagecache-'. $presetname);\n if (substr($presetname, -7) == '_circle') { //if suffix is _circle\n $attributes['class'] .= ' img-circle';\n }\n if (substr($presetname, -8) == '_rounded') { //if suffix is _rounded\n $attributes['class'] .= ' img-rounded';\n }\n }\n \n $ours = array(\n 'src' => imagecache_create_url($presetname, $path, FALSE, $absolute),\n 'alt' => $alt,\n 'title' => $title,\n );\n if ($getsize && ($image = image_get_info(imagecache_create_path($presetname, $path)))) {\n $ours += array('width' => $image['width'], 'height' => $image['height']);\n }\n\n return '<img' . drupal_attributes($ours + $attributes) . '/>';\n}",
"public function GenerateImage()\n\t{\n if( !$this->_forGeneration )\n throw new Exception(\"This PlanetData cannot be used for generation!\");\n \n\t\t$selectedImage = $this->_class.\"/\";\n\t\t$this->_selectedgroundtype = $this->_groundtype[ mt_rand( 0, count( $this->_groundtype ) -1 ) ];\n\t\t$selectedImage .= $this->_selectedgroundtype.\"/\";\n\t\t$selectedImage .= $this->_images[ mt_rand( 0, count( $this->_images ) -1 ) ].\".jpg\";\n\t\t$this->_generatedimage = $selectedImage;\n\t\treturn $selectedImage;\n\t}",
"function output_base64($format = null, $quality = null) {\n\n // Determine quality\n $quality = $quality ?: $this->quality;\n\n // Determine mimetype\n switch (strtolower($format)) {\n case 'gif':\n $mimetype = 'image/gif';\n break;\n case 'jpeg':\n case 'jpg':\n imageinterlace($this->image, true);\n $mimetype = 'image/jpeg';\n break;\n case 'png':\n $mimetype = 'image/png';\n break;\n default:\n $info = getimagesize($this->filename);\n $mimetype = $info['mime'];\n unset($info);\n break;\n }\n\n // Output the image\n ob_start();\n switch ($mimetype) {\n case 'image/gif':\n imagegif($this->image);\n break;\n case 'image/jpeg':\n imagejpeg($this->image, null, round($quality));\n break;\n case 'image/png':\n imagepng($this->image, null, round(9 * $quality / 100));\n break;\n default:\n throw new Exception('Unsupported image format: '.$this->filename);\n break;\n }\n $image_data = ob_get_contents();\n ob_end_clean();\n\n // Returns formatted string for img src\n return 'data:'.$mimetype.';base64,'.base64_encode($image_data);\n\n }",
"private function generatePhoto() {\n\t}",
"public function generate(){\r\n\t\tQRcode::png($this->plain_text(), $this->get_filepath(), QR_ECLEVEL_L, 12);\r\n\t\treturn $this->filename . '.png';\r\n\t}",
"public function generateImage()\n {\n $code = $this->getCode();\n $fontSize = $this->cfg['height'] * $this->cfg['fontScale'];\n $image = \\imagecreate($this->cfg['width'], $this->cfg['height']);\n // set the colors\n \\imagecolorallocate($image, 0, 0, 0); // background color\n $colorText = \\imagecolorallocate($image, 200, 200, 200);\n $colorNoise = \\imagecolorallocate($image, 150, 150, 150);\n $area = $this->cfg['width']*$this->cfg['height'];\n // generate random dots in background\n for ($i=0; $i < $area / $this->cfg['dotDivisor']; $i++) {\n \\imagefilledellipse(\n $image,\n \\mt_rand(0, $this->cfg['width']), // center x\n \\mt_rand(0, $this->cfg['height']), // center y\n 1, // width\n 1, // height\n $colorNoise\n );\n }\n // generate random lines in background\n for ($i=0; $i < $area / $this->cfg['lineDivisor']; $i++) {\n \\imageline(\n $image,\n \\mt_rand(0, $this->cfg['width']), // start x\n \\mt_rand(0, $this->cfg['height']), // start y\n \\mt_rand(0, $this->cfg['width']), // end x\n \\mt_rand(0, $this->cfg['height']), // end y\n $colorNoise\n );\n }\n // create textbox and add text\n $textbox = \\imagettfbbox($fontSize, 0, $this->cfg['font'], $code);\n $baseX = ($this->cfg['width'] - $textbox[4])/2;\n $baseY = ($this->cfg['height'] - $textbox[5])/2;\n \\imagettftext($image, $fontSize, 0, $baseX, $baseY, $colorText, $this->cfg['font'], $code);\n // output captcha image to browser\n \\ob_start();\n \\imagejpeg($image);\n $data = \\ob_get_clean();\n $hash = $this->form->asset(array(\n 'data' => $data,\n 'headers' => array(\n 'Last-Modified' => \\date('r'),\n 'Cache-Control' => 'no-cache, must-revalidate', // HTTP/1.1\n 'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', // Date in the past\n 'Content-Type' => 'image/jpeg',\n 'Pragma' => 'no-cache',\n )\n ));\n \\imagedestroy($image);\n return $hash;\n }",
"public function imageCache($pathtofile, $filter, $width=0, $height=0, $background='transparent')\r\n {\r\n\r\n $showFallback = false;\r\n if($width ==0 || $height==0 ){\r\n echo \"( Error: width or height not set )\";\r\n return false;\r\n }\r\n\r\n //echo getcwd().$this->container->getParameter('gregwar_image.fallback_image').\"----\";\r\n $fallback = $this->container->getParameter('gregwar_image.fallback_image');\r\n\r\n if(!is_file(getcwd().$pathtofile)){\r\n $pathtofile = getcwd().$fallback;\r\n }else{\r\n $pathtofile = getcwd().$pathtofile;\r\n }\r\n\r\n $pathtofile = str_replace('\\\\', '/',$pathtofile );\r\n\r\n $file = explode('/', $pathtofile);\r\n $filename = end($file);\r\n $folder = $file[(count($file)-2)];\r\n $folder.= \"/\".$width.\"x\".$height;\r\n $cacheDir = getcwd().'/userfiles/image_cache/control/'.$folder;\r\n\r\n //echo \"[\".$pathtofile.\"]\";\r\n\r\n switch (strtolower($filter)) {\r\n case 'scaleresize':\r\n $generateFile = Image::open($pathtofile)->scaleResize($width,$height)->fixOrientation()\r\n ->fillBackground($background)->setCacheDir($cacheDir.'-sr')\r\n ->setPrettyName($filename,false)->guess(80);\r\n break;\r\n case 'cropresize':\r\n $generateFile = Image::open($pathtofile)->cropResize($width,$height)->fixOrientation()\r\n ->fillBackground($background)->setCacheDir($cacheDir.'-cr')\r\n ->setPrettyName($filename,false)->guess(80);\r\n break;\r\n case 'zoomcrop':\r\n $generateFile = Image::open($pathtofile)->zoomCrop($width,$height)->fixOrientation()\r\n ->fillBackground($background)->setCacheDir($cacheDir.'-zc')\r\n ->setPrettyName($filename,false)->guess(80);\r\n break;\r\n default:\r\n $generateFile = Image::open($pathtofile)->scaleResize($width,$height)->fixOrientation()\r\n ->fillBackground($background)->setCacheDir($cacheDir.'-sr')\r\n ->setPrettyName($filename,false)->guess(80);\r\n }\r\n //echo \"/userfiles/image_cache/\".$folder.\"/\".$filename;\r\n //echo $generateFile;\r\n\r\n echo str_replace(getcwd(),\"\",$generateFile);\r\n\r\n }",
"public function toImage($options, $format = 'png')\n {\n return $this->prepareImage($options, $format);\n }"
] | [
"0.7180324",
"0.7042357",
"0.66269916",
"0.6508394",
"0.5876433",
"0.5836741",
"0.5729753",
"0.5728372",
"0.5715609",
"0.56833625",
"0.56039625",
"0.5598265",
"0.55951065",
"0.5575965",
"0.5472468",
"0.5467195",
"0.54308105",
"0.54204285",
"0.5416888",
"0.5405937",
"0.5400024",
"0.53989625",
"0.5389811",
"0.5389556",
"0.5373248",
"0.5351478",
"0.53336436",
"0.53212553",
"0.5309171",
"0.5303521"
] | 0.74285716 | 0 |
Ensures the css is loaded for the iframe. | function iframe() {
if(!Permission::check('CMS_ACCESS_CMSMain')) Security::permissionFailure($this);
Requirements::css(CMS_DIR . "/css/Image_iframe.css");
return array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function load_styles() {\n\t\t// Respects SSL, style.css is relative to the current file\n\t\twp_enqueue_style( 'responsive-video-embeds', plugins_url('css/responsive-video-embeds.css', __FILE__), array(), '1.0' );\n\t}",
"public function load_css()\n\t{\n\t\tglobal $pagenow, $typenow;\n\n\t\t// Bail if we aren't on the edit.php page or the post.php page.\n\t\tif ( ( $pagenow != 'edit.php' && $pagenow != 'post.php' ) || $typenow != 'nf_sub' )\n\t\t\treturn false;\n\n\t\tninja_forms_admin_css();\n\t}",
"function get_css() {\n\nwp_register_style( 'iframe.embed', plugins_url('/css/video_size.css', __FILE__) );\nwp_enqueue_style( 'iframe.embed' );\n}",
"public function isValidCss ()\n {\n if (sfConfig::get('app_response_validator_css_validation', TRUE))\n {\n $this->tester->info('CSS stylesheet validation is not yet implemented');\n }\n else\n {\n $this->tester->info('CSS validation had been disabled.');\n }\n\n return $this->getObjectToReturn();\n }",
"public function onAfterInit()\n {\n if (!($this->owner instanceof Security) && !CookieConsent::check()) {\n if (Config::inst()->get(CookieConsent::class, 'include_css')) {\n Requirements::css('innoweb/silverstripe-cookie-consent:client/dist/css/cookieconsent.css');\n }\n }\n }",
"function loadCSS(){\n echo \"<!-- CSS elements are loaded here -->\\n\";\n if(is_array($this->css)){\n foreach ($this->css as $key => $value) {\n if(!is_array($this->css[$key])){\n echo \"<link rel=\\\"stylesheet\\\" href=\\\"{$this->css[$key]}\\\"/>\\n\";\n }\n }\n }\n else{\n echo \"<link rel=\\\"stylesheet\\\" href=\\\"{$this->css}\\\"/>\";\n \n } \n }",
"protected function initCss()\n {\n // Init css only once\n if ($this->paths->exists('dir.assets') && !self::$init_stages[$this->name]['css']) {\n\n // Check for existance of apps css file\n $filename = $this->paths->get('dir.assets') . DIRECTORY_SEPARATOR . $this->name . '.css';\n\n if (!file_exists($filename)) {\n Throw new AppException(sprintf('AbstractApp \"%s.css\" file does not exist. Either create the js file or remove the css flag in your app settings.', $this->name));\n }\n\n $this->css->link($this->paths->get('url.assets') . DIRECTORY_SEPARATOR . $this->name . '.css');\n\n // Set flag for initiated css\n self::$init_stages[$this->name]['css'] = true;\n }\n }",
"function edd_social_discounts_load_css() {\nif ( ! edd_social_discounts_is_enabled() )\n\treturn;\n?>\n\t<style>.edd-sd-service { display: inline-block; margin: 0 1em 1em 0; vertical-align: top; } .edd-sd-service iframe { max-width: none; }</style>\n\t<?php\n}",
"public function template_redirect__determineIfLoadingCustomCSS()\n\t\t{\n\n\t\t\t// We always load the UBC-Style comments sheet\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts__load_ssc_default_theme_css' ) );\n\n\t\t\t$hideCommentsOption = get_studiorum_option( 'side_comments_options', 'studiorum_side_comments_hide_standard_comments' );\n\n\t\t\tif( $hideCommentsOption && $hideCommentsOption == 'true' ){\n\t\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts__loadSideCommentsCSS' ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We'll also add a filter, so other pluigins can determine if we're hiding the standard comments or not\n\t\t\t$hideCommentsFilter = apply_filters( 'studiorum_side_comments_hide_standard_comments', false );\n\n\t\t\tif( !$hideCommentsFilter ){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts__loadSideCommentsCSS' ) );\n\n\t\t}",
"public function is_iframe(){\n\t\tif( isset($_GET['fapro_inline']) ){\n\t\t\t$_GET['noheader'] = true;\n\t\t\tif( !defined( 'IFRAME_REQUEST' ) ){\n\t\t\t\tdefine( 'IFRAME_REQUEST', true );\n\t\t\t}\n\t\t\tif( !defined( 'FAPRO_IFRAME' ) ){\n\t\t\t\tdefine( 'FAPRO_IFRAME', true );\n\t\t\t}\n\t\t\t\n\t\t\tfa_load_admin_style('iframe');\t\n\t\t}\t\t\n\t}",
"public function load_styles() {\n\n\t\t/** Checks if plugin should work on this page. */\n\t\tif( ! AssignmentsTab::get_instance()->display() ) { return; }\n\n\t\t/** Get custom CSS settings. */\n\t\t$CustomCssSettings = get_option( 'mdp_scroller_custom_css_settings' ) ? get_option( 'mdp_scroller_custom_css_settings' ) : [ 'customcss' => '' ];\n\t\twp_add_inline_style( 'mdp-scroller', $CustomCssSettings['customcss'] );\n\n\t}",
"function cp_load_css_async()\n {\n\n $scripts = '<script>function cpLoadCSS(e,t,n){\"use strict\";var i=window.document.createElement(\"link\"),o=t||window.document.getElementsByTagName(\"script\")[0];return i.rel=\"stylesheet\",i.href=e,i.media=\"only x\",o.parentNode.insertBefore(i,o),setTimeout(function(){i.media=n||\"all\"}),i}</script>';\n\n echo $scripts;\n }",
"function elgg_get_loaded_css() {\n\treturn elgg_get_loaded_external_files('css', 'head');\n}",
"protected function _setIframeRendering(): void\n {\n $renderIframe = trim((string)getenv('ALLOW_IFRAME_RENDERING'));\n\n if ('' !== $renderIframe) {\n $this->setResponse($this->response->withHeader('X-Frame-Options', $renderIframe));\n }\n }",
"function optionsframework_load_styles() {\n\twp_enqueue_style( 'optionsframework', OPTIONS_FRAMEWORK_DIRECTORY.'css/optionsframework.css' );\n\tif ( !wp_style_is( 'wp-color-picker','registered' ) ) {\n\t\twp_register_style( 'wp-color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'css/color-picker.min.css' );\n\t}\n\twp_enqueue_style( 'wp-color-picker' );\n}",
"function ca_load_css_js(){\n\t\t$plugin_url = plugin_dir_url(__FILE__);\n\n\t\twp_register_style('ca_style', $plugin_url . 'assets/styles.css');\n\t\twp_enqueue_style('ca_style');\n\t\t//appends phantom querystring to script so that browser is forced to not cache it\n\t\twp_enqueue_script('fuckadblock', $plugin_url . 'assets/fuckadblock.js' . '?' . time());\n\t}",
"function ht_bongda_01_iframe_script() {\n\tif ( ! is_singular( 'chapter' ) ) {\n\t\treturn;\n\t}\n\twp_enqueue_style( 'ht-bongda-01-iframe', get_template_directory_uri() . '/css/iframe.css' );\n\twp_enqueue_script( 'ht-bongda-01-iframe', get_template_directory_uri() . '/js/iframe.js', array(), false, true );\n}",
"function fcwp_load_parent_stylesheets() {\n\t\twp_enqueue_style( 'parent-style', FCWP_URI . '/style.css', array(), '1.0.0' );\n\t}",
"private function _loadCSS() {\n if (!empty($this->_cssCalls)) {\n $body = JResponse::getBody();\n foreach ($this->_cssCalls as $position => $cssCalls) {\n if (!empty($cssCalls)) {\n // if position is defined we append code (inject) to the desired position\n if(in_array($position, $this->_htmlPositionsAvailable)) {\n // generate the injected code\n $cssIncludes = implode(\"\\n\\t\", $cssCalls);\n $pattern = $this->_htmlPositions[$position]['pattern'];\n $replacement = str_replace('##CONT##', $cssIncludes, $this->_htmlPositions[$position]['replacement']);\n $body = preg_replace($pattern, $replacement, $body);\n //die('<h1>CSS:</h1>' . $body .'<h1>Fin</h1>');\n // non-defined positions will be threated as css url to load with $doc->addStylesheet\n } else {\n $doc = JFactory::getDocument();\n foreach ($cssCalls as $cssUrl) {\n $doc->addStyleSheet($cssUrl);\n }\n }\n }\n }\n JResponse::setBody($body);\n return $body;\n }\n }",
"public function init()\n {\n Requirements::customCSS($this->generateCustomCSS());\n }",
"function elgg_load_css($name) {\n\telgg_load_external_file('css', $name);\n}",
"public function fetchAllCSS()\n {\n parent::fetchAllCSS();\n Services::formLayout()->fetchAllCSS();\n }",
"public function load_stylesheet( ) {\n\n\t\tif( $this->options['css'] == false || isset( $_GET['_mc4wp_css_preview'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$opts = $this->options;\n\n\t\tif( $opts['css'] === 'custom' ) {\n\n\t\t\t// load the custom stylesheet\n\t\t\t$custom_stylesheet = get_option( 'mc4wp_custom_css_file', false );\n\n\t\t\t// prevent query on every pageload if option does not exist\n\t\t\tif( false === $custom_stylesheet ) {\n\t\t\t\tupdate_option( 'mc4wp_custom_css_file', '' );\n\t\t\t}\n\n\t\t\t// load stylesheet\n\t\t\tif( is_string( $custom_stylesheet ) && $custom_stylesheet !== '' ) {\n\t\t\t\twp_enqueue_style( 'mc4wp-custom-form-css', $custom_stylesheet, array(), MC4WP_VERSION, 'all' );\n\t\t\t}\n\n\t\t} elseif( $opts['css'] !== 1 && $opts['css'] !== 'default' ) {\n\n\t\t\tif( $opts['css'] === 'custom-color' ) {\n\t\t\t\t// load the custom color theme\n\t\t\t\t$custom_color = urlencode( $opts['custom_theme_color'] );\n\t\t\t\twp_enqueue_style( 'mailchimp-for-wp-form-theme-' . $opts['css'], MC4WP_PLUGIN_URL . \"assets/css/form-theme-custom.php?custom-color=\" . $custom_color, array(), MC4WP_VERSION, 'all' );\n\n\t\t\t} else {\n\t\t\t\t// load one of the default form themes\n\t\t\t\t$form_theme = $opts['css'];\n\t\t\t\tif( in_array( $form_theme, array( 'blue', 'green', 'dark', 'light', 'red' ) ) ) {\n\t\t\t\t\twp_enqueue_style( 'mailchimp-for-wp-form-theme-' . $opts['css'], MC4WP_PLUGIN_URL . \"assets/css/form-theme-{$opts['css']}.css\", array(), MC4WP_VERSION, 'all' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// load just the basic form reset\n\t\t\twp_enqueue_style( 'mailchimp-for-wp-form', MC4WP_PLUGIN_URL . \"assets/css/form.css\", array(), MC4WP_VERSION, 'all' );\n\t\t}\n\n\t\treturn true;\n\t}",
"function fcwp_load_stylesheets() {\n\t\twp_enqueue_style( 'olc-style', FCWP_STYLESHEETURI, array(), '1.0.1' );\n\t\t// Load the Internet Explorer 7 specific stylesheet.\n\t\twp_enqueue_style( 'olc-ie8-style', FCWP_CHILD_STYLESHEETURI . '/css/ie8.style.css', array( 'olc-style' ), '1.0.0' );\n\t\twp_style_add_data( 'olc-ie8-style', 'conditional', 'IE 8' );\n\t\t// Load the Internet Explorer 7 specific stylesheet.\n\t\twp_enqueue_style( 'olc-ie9-style', FCWP_CHILD_STYLESHEETURI . '/css/ie9.style.css', array( 'olc-style' ), '1.0.0' );\n\t\twp_style_add_data( 'olc-ie9-style', 'conditional', 'IE 9' );\n\t\t$dir = get_stylesheet_directory();\n\t\tif( filesize( $dir . '/css/quickfix.css' ) != 0 ) {\n\t wp_enqueue_style( 'ohw-qf', FCWP_CHILD_STYLESHEETURI . '/css/quickfix.css', array(), '1.0.0', 'all' );\n\t }\n\t}",
"function load_css() {\r\n\t\t$css_files = scandir('app/assets/stylesheets');\r\n\r\n\t\tif (defined(\"CSS_PRELOADS\"))\r\n\t\t{\r\n\t\t\t$load_priorities = unserialize(CSS_PRELOADS);\r\n\t\t\r\n\t\t\tforeach ($load_priorities as $css_file)\r\n\t\t\t{\r\n\t\t\t\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . ROOT . 'app/assets/stylesheets/' . $css_file . \"\\\">\\n\";\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($css_files as $css) {\r\n\t\t\t\tif (($css != '.') && ($css != '..') && (!in_array($css, $load_priorities)))\r\n\t\t\t\t{\r\n\t\t\t\t\t$filename_split = explode(\".\", $css);\r\n\r\n\t\t\t\t\tif (isset($filename_split[1]) && $filename_split[1] == 'css') {\r\n\t\t\t\t\t\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . ROOT . 'app/assets/stylesheets/' . $css . \"\\\">\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach ($css_files as $css) {\r\n\t\t\t\tif (($css != '.') && ($css != '..'))\r\n\t\t\t\t{\r\n\t\t\t\t\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . ROOT . 'app/assets/stylesheets/' . $css . \"\\\">\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected function loadStylesheets()\n {\n $files = [\n 'EXT:frontend_editing/Resources/Public/Css/frontend_editing.css',\n 'EXT:backend/Resources/Public/Css/backend.css'\n ];\n foreach ($files as $file) {\n $this->pageRenderer->addCssFile($file);\n }\n }",
"public function load_custom_stylesheet() {\n\t\t\tif ( function_exists( 'wpex_active_skin' ) ) {\n\t\t\t\t$skin = wpex_active_skin();\n\t\t\t\tif ( 'base' == $skin ) {\n\t\t\t\t\twp_enqueue_style( 'wpex-tribe-events', WPEX_CSS_DIR_URI .'wpex-tribe-events.css' );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function onEndShowStyles($input){\n\t\t$input->cssLink('https://cdn.conversejs.org/css/converse.min.css');\n return true;\n }",
"function rocket_insert_load_css() {\n\t_deprecated_function( __FUNCTION__, '2.11', 'Rocket_Critical_CSS->insert_load_css()' );\n}",
"private function defer_CSS()\n {\n // Rewrite our object context\n $object = $this;\n\n // Dequeue our CSS and save our styles. Please note - this function removes conditional styles for older browsers\n add_action(\"wp_enqueue_scripts\", function () use ($object) {\n // Bail out if we are uzing the customizer preview\n if (is_customize_preview()) {\n return;\n }\n\n global $wp_styles;\n\n // Save the queued styles\n foreach ($wp_styles->queue as $style) {\n $object->styles[] = $wp_styles->registered[$style];\n $dependencies = $wp_styles->registered[$style]->deps;\n\n if (!$dependencies) {\n continue;\n }\n\n // Add dependencies, but only if they are not included yet\n foreach ($dependencies as $dependency) {\n $object->styles[] = $wp_styles->registered[$dependency];\n }\n }\n\n // Remove duplicate values because of the dependencies\n $object->styles = array_unique($object->styles, SORT_REGULAR);\n\n // Dequeue styles and their dependencies except for conditionals\n foreach ($object->styles as $style) {\n wp_dequeue_style($style->handle);\n }\n\n }, 9999);\n\n // Load our CSS using loadCSS\n add_action(\"wp_head\", function () use ($object) {\n // Bail out if we are uzing the customizer preview\n if (is_customize_preview()) {\n return;\n }\n\n $output = '<script>function loadCSS(a,b,c,d){\"use strict\";var e=window.document.createElement(\"link\"),f=b||window.document.getElementsByTagName(\"script\")[0],g=window.document.styleSheets;return e.rel=\"stylesheet\",e.href=a,e.media=\"only x\",d&&(e.onload=d),f.parentNode.insertBefore(e,f),e.onloadcssdefined=function(b){for(var c,d=0;d<g.length;d++)g[d].href&&g[d].href.indexOf(a)>-1&&(c=!0);c?b():setTimeout(function(){e.onloadcssdefined(b)})},e.onloadcssdefined(function(){e.media=c||\"all\"}),e}';\n foreach ($object->styles as $style) {\n if (isset($style->extra[\"conditional\"])) {\n continue;\n }\n\n // Load local assets\n if (strpos($style->src, \"http\") === false) {\n $style->src = site_url() . $style->src;\n }\n\n $output .= 'loadCSS(\"' . $style->src . '\", \"\", \"' . $style->args . '\");';\n }\n $output .= \"</script>\";\n echo $output;\n }, 9999);\n }"
] | [
"0.6159709",
"0.60406643",
"0.60055554",
"0.5793138",
"0.57661664",
"0.57177675",
"0.5630951",
"0.550464",
"0.5492722",
"0.5459332",
"0.5418868",
"0.54057646",
"0.5394054",
"0.5361717",
"0.5313129",
"0.52660125",
"0.52415454",
"0.5218327",
"0.5217831",
"0.5170128",
"0.51429445",
"0.50681263",
"0.5066493",
"0.5064306",
"0.5036589",
"0.5014493",
"0.50076103",
"0.50027424",
"0.49970794",
"0.49865177"
] | 0.6569054 | 0 |
A form to delete this image. | function DeleteImageForm() {
if($this->Image()->ID) {
$isImage = $this->IsImage();
$type = $isImage ? _t('Controller.IMAGE') : _t('Controller.FILE');
$title = sprintf(
_t('ImageUploader.DELETE', 'Delete %s', PR_MEDIUM, 'Delete file/image'),
$type
);
$form = new Form(
$this,
'DeleteImageForm',
new FieldSet(
new HiddenField("Class", null, $this->urlParams['Class']),
new HiddenField("ID", null, $this->urlParams['ID']),
new HiddenField("Field", null, $this->urlParams['Field'])
),
new FieldSet(
$deleteAction = new ConfirmedFormAction(
"delete",
$title,
sprintf(_t('ImageUploader.REALLYDELETE', "Do you really want to remove this %s?"), $type)
)
)
);
$deleteAction->addExtraClass('delete');
return $form;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete(){\n if(!isset($_POST['submit'])){\n $this->redirect('/image/index');\n }\n $image_m = new Images($_POST);\n if(!$image_m->delete()){\n Flash::addMessage(\"Something went wrong, please try again\", Flash::INFO);\n View::render('Image/index.html');\n return;\n }\n //remove file from directory\n Flash::addMessage(\"Successfully deleted\");\n $this->index();\n }",
"private function createDeleteForm(Image $image)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('image_delete', array('id' => $image->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('turnossede_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->factory->createBuilder()\n ->setMethod('DELETE')\n ->getForm();\n }",
"public function delete( Entity $form ) {\n\t}",
"public function deleteImage()\n {\n $this->setValue($this->options['emptyReturn']);\n unlink($this->options['wwwDir'] . $this->hidden);\n $this->hidden = null;\n }",
"public function Display_delete_form(){\r\n\r\n echo '<form action=\"' . $_SERVER[\"PHP_SELF\"] . '\" method=\"post\">\r\n <b><font size=\"+1\">Are you sure you want to delete this record?</b></font>';\r\n\r\n echo \"<input type='hidden' name= 'fc' value='\" . $this->GetValue($this->fckeyname) . \"' />\";\r\n echo \"<br><input type='submit' name = 'deleterecord_forsure' value='YES, DELETE RECORD'><br><br>\";\r\n echo \"<input type='hidden' name='\" . $this->keyId_name . \"' value='\" . $this->keyId . \"'></form>\";\r\n\r\n }",
"public function deleteimageAction()\r\n {\r\n $path = Mage::getBaseDir();\r\n $attributeId = $this->getRequest()->getPost('aId');\r\n $optionId = $this->getRequest()->getPost('oId');\r\n $imageDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n $imageDirectory = $imageDirectory . DS . $optionId . DS . 'img';\r\n unlink($imageDirectory);\r\n $optionDriectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS . $optionId;\r\n rmdir($optionDriectory);\r\n $attributeDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n rmdir($attributeDirectory);\r\n }",
"private function createDeleteForm(Picture $picture)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('_delete', array('id' => $picture->getId(), 'comment' => $picture->getComment())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function getDeleteForm()\n\t{\n\t\t$result = \"\n\t\t\t<form style='float:left;' id='{$this->FormName}_delete' action='' method='$this->FormType'>\n\t\t\t<div>\n\t\t\t\t<input type='hidden' name='{$this->paramIDName}' value='{$this->record->getID()}' />\n\t\t\t\t<input type='hidden' name='__action' value='delete' />\n\t\t\t\t<input type='submit' value='Entfernen' />\n\t\t\t</div>\n\t\t\t</form>\n\t\t\t\";\n\n\t\treturn $result;\n\t}",
"function delete() {\n // model. Instead, just drop the association with the form which\n // will give the appearance of deletion. Not deleting means that\n // the field will continue to exist on form entries it may already\n // have answers on, but since it isn't associated with the form, it\n // won't be available for new form submittals.\n $this->set('form_id', 0);\n $this->save();\n }",
"function thumbwhere_contentupload_delete_form($form, &$form_state, $thumbwhere_contentupload) {\n $form_state['thumbwhere_contentupload'] = $thumbwhere_contentupload;\n\n $form['#submit'][] = 'thumbwhere_contentupload_delete_form_submit';\n\n $form = confirm_form($form,\n t('Are you sure you want to delete thumbwhere_contentupload %name?', array('%name' => $thumbwhere_contentupload->pk_contentupload)),\n 'admin/thumbwhere/thumbwhere_contentuploads/thumbwhere_contentupload',\n '<p>' . t('This action cannot be undone.') . '</p>',\n t('Delete'),\n t('Cancel'),\n 'confirm'\n );\n\n return $form;\n}",
"function thumbwhere_contentupload_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentuploads/thumbwhere_contentupload/' . $form_state['thumbwhere_contentupload']->pk_contentupload . '/delete';\n}",
"public function delete()\n {\n //can only delete if user is logged in and image id is set.\n if (Security::isAuthenticated() && isset($_GET['id'])) {\n $postId = $_GET['id'];\n $postRepository = new PostRepository();\n //call to readById\n $post = $postRepository->readById($postId);\n //only creator and admin can delete image\n if (($post->creator == Security::getUser()->email) || Security::isAdmin()) {\n //call to get_picture_path\n $path = $postRepository->get_picture_path($postId);\n if ($postRepository->deleteById($postId)) {\n unlink($path);\n }\n }\n }\n // redirects back to last page\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n }",
"public function delete($input = null, $alt = null);",
"public function deleteSelectorImage()\r\n\t{\r\n\t\t// Get request\r\n\t\t$metaSelectorId = Request::getInt('selector');\r\n\t\t\r\n\t\t// Delete from model\r\n\t\t$metaModel = BluApplication::getModel('meta');\r\n\t\t$deleted = $metaModel->updateMetaSelector($metaSelectorId, array(\r\n\t\t\t'images' => array($type => '')\r\n\t\t));\r\n\t\t\r\n\t\t// Back to listing\r\n\t\tif ($deleted) {\r\n\t\t\tMessages::addMessage('Meta selector image deleted', 'info');\r\n\t\t}\r\n\t\t$this->view();\r\n\t}",
"function submitDeleteImage() {\n\t$imageid = getContinuationVar(\"imageid\");\n\t$deleted = getContinuationVar(\"deleted\");\n\tif($deleted) {\n\t\t$query = \"UPDATE image \"\n\t\t\t\t . \"SET deleted = 0 \"\n\t\t\t\t . \"WHERE id = $imageid\";\n\t\t$qh = doQuery($query, 210);\n\t}\n\telse {\n\t\t$query = \"UPDATE image \"\n\t\t\t\t . \"SET deleted = 1 \"\n\t\t\t\t . \"WHERE id = $imageid\";\n\t\t$qh = doQuery($query, 211);\n\t\t$query = \"UPDATE computer \"\n\t\t\t\t . \"SET nextimageid = 0 \"\n\t\t\t\t . \"WHERE nextimageid = $imageid\";\n\t\tdoQuery($query, 212);\n\t}\n\tviewImages();\n}",
"protected function _delete()\n\t{\n\t\t$image = $this->_images->fetchImage( intval( $this->request['imageid'] ) );\n\t\t$album = $this->_albums->fetchAlbumsById( $image['img_album_id'] );\n\t\t\n\t\tif ( empty( $image['id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\tif ( ! $this->_albums->canModerate( $album ) AND ( $image['member_id'] != $this->memberData['member_id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\t/* Had enough now, just get rid of it */\n\t\t$this->_moderate->deleteImages( array( $image['id'] => $image ) );\n\t\t\n\t\t/* Back */\n\t\tif ( $this->request['modcp'] )\n\t\t{\n\t\t\t$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=modcp&fromapp=gallery&tab=' . $this->request['modcp'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=gallery&album=' . $album['album_id'], $album['album_name_seo'], false, 'viewalbum' );\n\t\t}\n\t}",
"public function DeleteImage()\n\t{\t\n\t\t// === GET ID === //\n\t\t$id = $this->segment_item;\n\t\t\n\t\t$this->companies_model->RemovePostImage($id);\n\t\t\n\t\tredirect($this->_getBaseURI().\"/edit/$this->segment_orderby/\".$this->segment_orderseq.\"/\".$this->segment_offset.\"/\".$id);\n\t}",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('slider_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array(\n 'label' => 'SUPPRIMER ',\n 'attr' => array('class' => 'btn btn-danger'),\n ))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_gallery_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"protected function createComponentDeleteForm() {\r\n $form = new Form;\r\n $form->addSubmit('cancel', 'Zrušit');\r\n $form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n $form->onSubmit[] = callback($this, 'deleteFormSubmitted');\r\n $form->addProtection('Odešlete prosím formulář znovu (bezpečnostní token vypršel).');\r\n return $form;\r\n }",
"public function deleteImage(){\n\t\t$img=ProductImage::find(Input::get('id'));\n\t\tunlink('img/p/'.$img['image']);\t\t\n\t\t$img->delete();\n\t\t\n\t\treturn '';\n\t}",
"public function photoDeleteAction() {\n /**\n * Get customer login details.\n */\n if (! Mage::getSingleton ( 'customer/session' )->isLoggedIn ()) {\n /**\n * Redirect to customer login.\n */\n $this->_redirectUrl ( Mage::helper ( 'customer' )->getLoginUrl () );\n return false;\n }\n /**\n * Get ImageId.\n * Get Entity Id.\n * Get album cover.\n */\n $imageId = $this->getRequest ()->getParam ( \"image_id\" );\n $entityId = $this->getRequest ()->getParam ( \"entity_id\" );\n $albumCover = $this->getRequest ()->getParam ( \"albumCover\" );\n /**\n * Check condition if $imageId exist or not\n */\n if ($imageId) {\n /**\n * Remove image.\n */\n Mage::getModel ( 'airhotels/calendar' )->removeImage ( $imageId, $entityId, $albumCover );\n } else {\n /**\n * Set error message.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'Please try again!' ) );\n }\n /**\n * Set redirect url.\n */\n $this->_redirect ( '*/property/form/step/photos' );\n }",
"public function deleteAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new DeleteForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Delete an item\",\n ]);\n }",
"public function deleteForm($id)\n {\n $this->view->render(\"auteurs/delete\", [\n 'auteur' => Auteur::findOrFail($id)\n ]);\n }",
"public function deleteValueImage()\r\n\t{\r\n\t\t// Get request\r\n\t\t$metaValueId = Request::getInt('value');\r\n\t\t$type = Request::getCmd('type', 'main');\r\n\t\t\r\n\t\t// Delete from model\r\n\t\t$metaModel = BluApplication::getModel('meta');\r\n\t\t$deleted = $metaModel->updateMetaValue($metaValueId, array(\r\n\t\t\t'images' => array($type => '')\r\n\t\t));\r\n\t\t\r\n\t\t// Back to listing\r\n\t\tif ($deleted) {\r\n\t\t\tMessages::addMessage('Meta value image deleted', 'info');\r\n\t\t}\r\n\t\t$this->view();\r\n\t}",
"private function deleteImage()\n\t\t{\n\t\t\t$directory = FN::getSessionValue(\"img-dir\");\n\t\t\t$name = FN::sanitise($_REQUEST['name']);\n\t\t\tunlink(\"$directory/$name\");\n\t\t}",
"public function privacy_meta_html_delete()\n {\n ?>\n <form method=\"post\" action=\"\">\n <div id=\"universal-message-container\">\n <div class=\"options\">\n <p>\n <label><?php _e('Enter User’s Mobile Number', 'wp-sms'); ?></label>\n <br/>\n <input type=\"tel\" name=\"mobile-number-delete\" value=\"\"/>\n <br/>\n <span class=\"description\"><?php _e('Note: You cannot undo these actions.', 'wp-sms'); ?></span>\n </p>\n </div><!-- #universal-message-container -->\n <?php submit_button( __('Delete'), 'primary', 'submit', false ); ?>\n </div>\n <input type=\"hidden\" name=\"wp_sms_nonce_privacy\" value=\"<?php echo $this->wp_nounce; ?>\">\n </form>\n <div class=\"clear\"></div>\n <style>\n\n </style>\n <?php\n }",
"function manidora_omit_collections_delete_form($form, &$form_state, $pid) {\n $query = db_query('SELECT m.title from {manidora_omit_collections} m where m.pid = :pid', [':pid' => $pid]);\n $result = $query->fetchAssoc();\n if ($result) {\n $title = $result['title'];\n }\n drupal_set_title(t('Remove collection \"@coll\"?', ['@coll' => $title]));\n $form['manidora_delete_omit_collections'] = [\n 'pid' => [\n '#type' => 'hidden',\n '#value' => $pid,\n ],\n 'title_holder' => [\n '#type' => 'hidden',\n '#value' => $title,\n ],\n 'delete_btn' => [\n '#type' => 'submit',\n '#value' => 'Delete',\n ],\n 'cancel_btn' => [\n '#type' => 'submit',\n '#value' => 'Cancel',\n ],\n ];\n return $form;\n}"
] | [
"0.721063",
"0.7165914",
"0.6875535",
"0.6759746",
"0.6756628",
"0.6729497",
"0.6714806",
"0.6639762",
"0.660528",
"0.65885735",
"0.6533809",
"0.65235597",
"0.6509731",
"0.6496828",
"0.64719754",
"0.6461739",
"0.6453528",
"0.64451504",
"0.6443732",
"0.64115834",
"0.6411322",
"0.64108497",
"0.6410614",
"0.63968307",
"0.63724804",
"0.6352566",
"0.63332236",
"0.6327931",
"0.63199407",
"0.63072705"
] | 0.84180564 | 0 |
Flush all of the generated images. | function flush() {
if(!Permission::check('ADMIN')) Security::permissionFailure($this);
$images = DataObject::get("Image","");
$numItems = 0;
$num = 0;
foreach($images as $image) {
$numDeleted = $image->deleteFormattedImages();
if($numDeleted) {
$numItems++;
}
$num += $numDeleted;
}
echo $num . ' formatted images from ' . $numItems . ' items flushed';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function flushAll() {\n\n\t\t$path = sprintf('%s/images', public_path());\n\n\t\t$files = new Filesystem();\n\t\t$files->cleanDirectory($path);\n\n\t}",
"public function flushAll()\n {\n // TODO: Implement flushAll() method.\n }",
"public function flushAll()\n {\n // TODO: Implement flushAll() method.\n }",
"public function flushAll();",
"public static function flushAllOutputBuffers()\n\t{\n\t\t$c = ob_get_level();\n\t\tfor ($i = 0; $i < $c; $i++) {\n\t\t\tob_end_flush();\n\t\t}\n\t}",
"public function flush()\n {\n $this->pipeline = [];\n $this->scriptCalls = [];\n }",
"public function flush(): void\n {\n flush();\n }",
"public function flushAll() {\n\t\t$this->redis->flushAll();\n\t\texit;\n\t}",
"public function flush(){\n\t\tforeach($this->repos as $r){\n\t\t\t$r->flush();\n\t\t}\n\t}",
"protected static function flushBuffers()\n {\n if (ob_get_level()) {\n @ob_flush();\n }\n\n flush();\n }",
"public function flush() {}",
"public function flush()\n {\n foreach ($this->cacheObjects as $object) {\n $object->remove();\n }\n }",
"public function disposeAll() {\n\t\t$this->dispose();\n\t\t$this->transparent = NULL;\n\t\t$this->frames = NULL;\n\t\t$this->count = NULL;\n\t\t$this->anloop = NULL;\n\t}",
"public function flush() : void\n {\n $this->hasChanges = true;\n $this->isFlushed = true;\n $this->elements = [];\n }",
"public function flushCaches()\n {\n $this->createAllCaches();\n foreach ($this->caches as $cache) {\n $cache->flush();\n }\n }",
"public function flush($style_names, $options = ['all' => false])\n {\n foreach (ImageStyle::loadMultiple(StringUtils::csvToArray($style_names)) as $style_name => $style) {\n $style->flush();\n $this->logger()->success(dt('Image style !style_name flushed', ['!style_name' => $style_name]));\n }\n }",
"public function flush()\n {\n if (!$this->buffer) {\n return;\n }\n\n \\fwrite($this->fileHandle, \\implode(\"\\n\", $this->buffer) . \"\\n\");\n $this->buffer = [];\n $this->bufferCounter = 0;\n }",
"public function flush()\n {\n $this->manager->flush();\n }",
"protected function flush(): void\n {\n $this->hand = array_slice(reset($this->suitHistogram), 0, 5);\n $this->handRank = static::FLUSH_RANK;\n }",
"public function flush(): void\n {\n $this->sharedObjects = [];\n }",
"public function flushAction()\n {\n if (Mage::helper('recomiendo_recipes/image')->flushImagesCache()) {\n $this->_getSession()->addSuccess('Cache successfully flushed');\n } else {\n $this->_getSession()->addError('There was error during flushing cache');\n }\n $this->_forward('index');\n }",
"private function deleteAllImgFiles()\n {\n $images = $this->getImages();\n\n foreach ($images as $image) {\n $this->deleteImage($image->id);\n }\n\n $dirPath = implode(DIRECTORY_SEPARATOR, [\n $this->directory,\n $this->getGalleryId(),\n ]);\n\n @rmdir($dirPath);\n }",
"protected function flush()\n {\n $this->flushDirectory($this->getCacheDir());\n $this->writeVersion();\n }",
"public function flush(){}",
"protected static function flush()\n\t{\n\t\t$items = new fIterator(path('storage').'views');\n\n\t\tforeach ($items as $item)\n\t\t{\n\t\t\tif ($item->isFile() and $item->getBasename() !== '.gitignore')\n\t\t\t{\n\t\t\t\t@unlink($item->getRealPath());\n\t\t\t}\n\t\t}\n\t}",
"public function flushAll(): void\n {\n $this->ioService->writeln('Flushing data...');\n\n $compare = static function (WriterInterface $a, WriterInterface $b) {\n if ($a->getPriority() === $b->getPriority()) {\n return 0;\n }\n\n return ($a->getPriority() > $b->getPriority()) ? -1 : 1;\n };\n\n $writers = $this->writers;\n \\usort($writers, $compare);\n\n foreach ($writers as $writer) {\n $writer->flush();\n }\n\n if ($this->displayImportMessage) {\n $this->ioService->writeln('Done. Please import SQLs using something like this:');\n $this->ioService->writeln('mysql --local-infile -uroot -proot DATABASE < FILE.sql');\n }\n }",
"public function clearAllOutput() {\n\t\twhile (ob_get_level() > $this->startingObLevel) {\n\t\t\tob_end_clean();\n\t\t}\n\t\t$this->startOutputBuffer();\n\t}",
"protected function flush()\n {\n $this->rows = array();\n $this->headers = array();\n }",
"public function flush()\n {\n \n }",
"public function flush()\n {\n $this->collectGarbage();\n $this->probes = $this->filterProbes($this->probes, true);\n }"
] | [
"0.78676885",
"0.6973214",
"0.6973214",
"0.69003344",
"0.6396059",
"0.63572454",
"0.6292074",
"0.62017095",
"0.61827904",
"0.6095191",
"0.60436565",
"0.6041543",
"0.6032249",
"0.600983",
"0.6007405",
"0.5985682",
"0.5984036",
"0.5973813",
"0.59731656",
"0.59721714",
"0.59639686",
"0.5957759",
"0.5945729",
"0.59422326",
"0.5941947",
"0.5936962",
"0.59362227",
"0.59359723",
"0.5932409",
"0.5919069"
] | 0.7412337 | 1 |
Determine whether the admin can restore the admin. | public function restore(Admin $admin)
{
if ($admin->getRole('Admin', 'restore')) {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function restore(Admin $admin)\n {\n if ($admin->getRole('Item', 'restore')) {\n return true;\n }\n }",
"protected function hasAccessToRestore(array & $params)\n {\n $row = $this->_getGroup(null, false, true);\n return (g()->auth->id() == $row['leader_id']);\n }",
"public function restore(User $user, Sandwich $sandwich)\n {\n return in_array($user->role, array('admin'));\n }",
"public function isStoreAdmin() {\n return $this->authorise('store.admin', 'com_zoo.application.'.$this->application->id.'.store');\n }",
"#[Pure] public function restore(User $user): bool\n {\n return $user->isAdmin();\n }",
"protected function getIsAdmin()\n {\n if (!$this->vol) return FALSE;\n if (!isset($this->vol['reg_num'])) return FALSE; // Cerad_Debug::dump($this->vol); die();\n $aysoid = $this->vol['reg_num'];\n switch($aysoid)\n {\n case '99437977':\n return TRUE;\n break;\n }\n return FALSE;\n }",
"public function restore(SquadMSUser $user, Server $server)\n {\n return $user->can(Config::get('sqms-servers.permissions.module').' admin servers manage');\n }",
"public function isAdmin()\n {\n return $this->role_id == Role::whereSlug('admin')->first()->id;\n }",
"public function isAdmin()\n {\t\t\n\t//$selection being the array of the row returned from the database.\n\tif($selection['is_admin'] == 1) {\n\t\treturn true;\n\t}\n\t\t\n\treturn false;\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('salesmanagerment/revenue');\n }",
"public function isAdmin(){\n return ($this->role->id >= 4);\n }",
"public function user_needs_to_restore_account() {\n global $frm, $user;\n if (!isset($user) &&\n isset($frm) &&\n isset($frm->username) &&\n is_restored_user($frm->username)) {\n return array(true, $frm->username);\n } else {\n return array(false, '');\n }\n\n }",
"protected function is_saving_a_super_admin(){\n $super_admin_group = Admin_Group::create()->find_by_code(Admin_Group::super_admin);\n if(is_array($this->rights)){\n foreach($this->rights as $right_id){\n if($right_id == $super_admin_group->id){\n return true;\n }\n }\n }\n return false;\n }",
"public function isAdmin() {\n if ($this->role_id == Roles::where('role', 'admin')->first()->role_id) {\n return true;\n }\n return false;\n }",
"public function verifyAdmin() {\n\t\t\t\treturn check_admin_referer( $this->getAction(), $this->getName() );\n\t\t}",
"public function isAdmin()\n {\n return $this->role_id === 1;\n }",
"public function isAdmin(): bool\n {\n return $this->role_id === 1;\n }",
"public function adminCheck()\n {\n if (!$this->check()) {\n return false;\n }\n return $this->container->user_manager->currentUser()->getAdmin();\n }",
"function isadmin() {\n\tif (getrole() == 3)\n\t\treturn TRUE;\n\telse\n\t\treturn FALSE;\n}",
"public static function is_admin()\n\t{\n\t\treturn (bool) self::current()->has(ORM::factory('role', 'admin'));\n\t}",
"public function checkAdmin() {\r\n\t\tif($_SESSION['access'] != 'admin') {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"function is_admin() {\n\t\treturn current_user_can('level_8');\n\t}",
"function isAdmin(){\r\n return intval($this->is_admin)==1;\r\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Litmus7_Merc::redis_configuration');\n }",
"public function restore(User $user, Role $role)\n {\n return $user->hasPermission('restore-system-role');\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('izberg/merchants');\n }",
"public function isStoreAdmin(): bool\n {\n return $this->role === 'store-admin';\n }",
"public function can_migrate() {\n\t\tif ( false == ( $old_optins = get_transient( '_om_old_optins' ) ) ) {\n\t\t\t$args = array(\n\t\t\t\t'post_type' => 'optin',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t);\n\t\t\t$old_optins = get_posts( $args );\n\t\t\tset_transient( '_om_old_optins', $old_optins, DAY_IN_SECONDS );\n\t\t}\n\n\t\tif ( empty( $old_optins ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public function hasAdminAccess()\n {\n return $this->_access == \"Admin\";\n }",
"public function isadmin()\n {\n return is_object($this->hasrole('Site', 'Admin'));\n }"
] | [
"0.72555727",
"0.6440196",
"0.6104166",
"0.60715014",
"0.60524774",
"0.60262465",
"0.60173416",
"0.59680116",
"0.596604",
"0.5944784",
"0.5895908",
"0.5891423",
"0.58815926",
"0.5872193",
"0.58623415",
"0.58592176",
"0.58363897",
"0.58301294",
"0.5829099",
"0.5820871",
"0.5809692",
"0.58017534",
"0.58016574",
"0.5795209",
"0.5791812",
"0.57902956",
"0.577794",
"0.5772162",
"0.57660884",
"0.5754578"
] | 0.744266 | 0 |
Imports the file attributes and tags. At some point we can add further methods to make this a little more useful (a json method perhaps?) | public function import(array $file) {
foreach ($file['@attributes'] as $key => $val) {
$this->attributes[$key] = $val;
}
if (array_key_exists('tags', $file)) {
foreach ($file['tags'] as $i => $tag) {
$tags[$i] = $tag;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function addFileFields(): void\n {\n //the relative path to the file project main dir, e.g. output/images/\n $this->addField(\n\n 'path',\n [\n 'type' => 'string'\n ]\n );\n\n //extra field to further classify file if needed, e.g. \"ATTACHMENT\", \"TEMPORARY\"\n $this->addField(\n 'type',\n [\n 'type' => 'string'\n ]\n );\n\n //pdf, jpg etc\n $this->addField(\n 'filetype',\n [\n 'type' => 'string'\n ]\n );\n\n //indicates if the file was generated by Script (true) or uploaded by user (false)\n $this->addField(\n 'auto_generated',\n [\n 'type' => 'boolean',\n 'default' => false\n ]\n );\n\n //crypt_id, used when file is made available for download\n $this->addField(\n 'crypt_id',\n [\n 'type' => 'string',\n 'system' => true\n ]\n );\n\n $this->addField(\n 'sort',\n [\n 'type' => 'string'\n ]\n );\n }",
"function __construct ($filename) {\n # The second parameter \"true\" on json_decode does this.\n $metadata_from_json = json_decode(file_get_contents($filename . '.json'), true);\n\n # dump the remaining files into the protected variable $file_list\n $this->setMetadata($metadata_from_json);\n\n }",
"function rekord_import_files() {\n\treturn array(\n\t array(\n\t\t'import_file_name' => 'Demo Import 1',\n\t\t'categories' => array( 'Category 1', 'Category 2' ),\n\t\t'local_import_file' => trailingslashit( get_template_directory() ) . 'inc/demo-data/content.xml',\n\t\t'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'inc/demo-data/widgets.wie',\n\t\t'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'inc/demo-data/customizer.dat',\n\t\t'import_preview_image_url' => get_template_directory_uri() . '/inc/demo-data/screenshot.jpg',\n\t\t'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'rekord' ),\n\t ),\n\t);\n }",
"public function importFile($file);",
"function jot_prepare_file_vars($file = null) {\n\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'access_id' => ACCESS_DEFAULT,\n\t\t'tags' => '',\n\t\t'container_guid' => elgg_get_page_owner_guid(),\n\t\t'guid' => null,\n\t\t'entity' => $file,\n\t);\n\n\tif ($file) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($file->$field)) {\n\t\t\t\t$values[$field] = $file->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('file')) {\n\t\t$sticky_values = elgg_get_sticky_values('file');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\t}\n\n\telgg_clear_sticky_form('file');\n\n\treturn $values;\n}",
"protected function fill_file_data()\n\t{\n\t\t$this->file_data['filesize'] = $this->file->get('filesize');\n\t\t$this->file_data['mimetype'] = $this->file->get('mimetype');\n\t\t$this->file_data['extension'] = $this->file->get('extension');\n\t\t$this->file_data['physical_filename'] = $this->file->get('realname');\n\t\t$this->file_data['real_filename'] = $this->file->get('uploadname');\n\t\t$this->file_data['filetime'] = time();\n\t}",
"function import($file)\n {\n }",
"abstract protected function getFileProps($file);",
"function get_meta_tags ($filename, $use_include_path = false) {}",
"public function __construct()\n {\n $this->supportedFileExtensions = json_decode(\n file_get_contents(base_path(\"node_modules/file-icon-vectors/dist/icons/vivid/catalog.json\"))\n );\n }",
"function parseFile() {\n $this->title = $this->val(\"title\");\n $this->showTitle = $this->val(\"showtitle\");\n $this->rating = $this->val(\"rating\");\n $this->votes = $this->val(\"votes\");\n $this->epBookmark = $this->val(\"epbookmark\");\n $this->year = $this->val(\"year\");\n $this->top250 = $this->val(\"top250\");\n $this->season = $this->val(\"season\");\n $this->episode = $this->val(\"episode\");\n $this->uniqueId = $this->val(\"uniqueid\");\n $this->displaySeason = $this->val(\"displayseason\");\n $this->displayEpisode = $this->val(\"displayepisode\");\n $this->outline = $this->val(\"outline\");\n $this->plot = $this->val(\"plot\");\n $this->tagline = $this->val(\"tagline\");\n $this->runtime = $this->val(\"runtime\");\n $this->mpaa = $this->val(\"mpaa\");\n $this->playCount = $this->val(\"playcount\");\n $this->lastPlayed = $this->val(\"lastplayed\");\n $this->episodeGuide = $this->val(\"url\", $this->val(\"episodeGuide\"));\n $this->id = $this->val(\"id\");\n $this->genres = [];\n $genreNodeList = $this->doc->getElementsByTagName(\"genre\");\n foreach ($genreNodeList as $genre) {\n $this->genres[] = $genre->nodeValue;\n }\n $this->set = $this->val(\"set\");\n $this->premiered = $this->val(\"premiered\");\n $this->status = $this->val(\"status\");\n $this->code = $this->val(\"code\");\n $this->aired = $this->val(\"aired\");\n $this->studio = $this->val(\"studio\");\n $this->trailer = $this->val(\"trailer\");\n $this->actors = [];\n $actorNodeList = $this->doc->getElementsByTagName(\"actor\");\n foreach ($actorNodeList as $actorNode) {\n $actor = (object) [];\n $nameItem = $actorNode->getElementsByTagName(\"name\")->item(0);\n $actor->name = $nameItem != null ? $nameItem->nodeValue : \"\";\n $roleItem = $actorNode->getElementsByTagName(\"role\")->item(0);\n $actor->role = $roleItem != null ? $roleItem->nodeValue : \"\";\n $thumbItem = $actorNode->getElementsByTagName(\"thumb\")->item(0);\n $actor->thumb = $thumbItem != null ? $thumbItem->nodeValue : \"\";\n //if we have either an actor name or role, add this actor\n if ($actor->name != \"\" || $actor->role != \"\" || $actor->thumb != \"\") {\n $this->actors[] = $actor;\n }\n }\n\n $this->resume = (object) [];\n $this->resume->position = $this->val(\"position\", $this->doc->getElementsByTagName(\"resume\")->item(0));\n $this->resume->total = $this->val(\"total\", $this->doc->getElementsByTagName(\"resume\")->item(0));\n $this->dateAdded = $this->val(\"dateadded\");\n\n //if made it to here, all is good. return true\n return true;\n }",
"public function import();",
"public function import();",
"private function parseFromFile()\n\t{\n\t\tif (is_null($this->file_path)) throw new StorageException('Invalid file path');\n\t\t$data = unserialize(file_get_contents($this->file_path));\n\n\t\tif ($data === FALSE) throw new StorageException('File contents not unserializeable');\n\n\t\t$this->tokens = $data[ 'tokens' ];\n\t\t$this->states = $data[ 'states' ];\n\t}",
"function tagReader($file){\n $id3v23 = array(\"TIT2\",\"TALB\",\"TPE1\",\"TRCK\",\"TDRC\",\"TLEN\",\"USLT\");\n $id3v22 = array(\"TT2\",\"TAL\",\"TP1\",\"TRK\",\"TYE\",\"TLE\",\"ULT\");\n $fsize = filesize($file);\n $fd = fopen($file,\"r\");\n $tag = fread($fd,$fsize);\n $tmp = \"\";\n fclose($fd);\n if (substr($tag,0,3) == \"ID3\") {\n $result['FileName'] = $file;\n $result['TAG'] = substr($tag,0,3);\n $result['Version'] = hexdec(bin2hex(substr($tag,3,1))).\".\".hexdec(bin2hex(substr($tag,4,1)));\n }\n if($result['Version'] == \"4.0\" || $result['Version'] == \"3.0\"){\n for ($i=0;$i<count($id3v23);$i++){\n if (strpos($tag,$id3v23[$i].chr(0))!= FALSE){\n $pos = strpos($tag, $id3v23[$i].chr(0));\n $len = hexdec(bin2hex(substr($tag,($pos+5),3)));\n $data = substr($tag, $pos, 10+$len);\n for ($a=0;$a<strlen($data);$a++){\n $char = substr($data,$a,1);\n if($char >= \" \" && $char <= \"~\") $tmp.=$char;\n }\n if(substr($tmp,0,4) == \"TIT2\") $result['Title'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TALB\") $result['Album'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TPE1\") $result['Artist'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TRCK\") $result['Track'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TDRC\") $result['Year'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TLEN\") $result['Length'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"USLT\") $result['Lyric'] = substr($tmp,7);\n $tmp = \"\";\n }\n }\n }\n if($result['Version'] == \"2.0\"){\n for ($i=0;$i<count($id3v22);$i++){\n if (strpos($tag,$id3v22[$i].chr(0))!= FALSE){\n $pos = strpos($tag, $id3v22[$i].chr(0));\n $len = hexdec(bin2hex(substr($tag,($pos+3),3)));\n $data = substr($tag, $pos, 6+$len);\n for ($a=0;$a<strlen($data);$a++){\n $char = substr($data,$a,1);\n if($char >= \" \" && $char <= \"~\") $tmp.=$char;\n }\n if(substr($tmp,0,3) == \"TT2\") $result['Title'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TAL\") $result['Album'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TP1\") $result['Artist'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TRK\") $result['Track'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TYE\") $result['Year'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TLE\") $result['Length'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"ULT\") $result['Lyric'] = substr($tmp,6);\n $tmp = \"\";\n }\n }\n }\n return $result;\n}",
"public function __construct(File $file = null) {\n $this->attributes = array();\n $this->tags = array();\n\n if ($file) {\n if ($file->isDirectory) {\n $this->attribute('localpath', $file->getPath());\n } else {\n $this->attribute('localpath', $file->getParent()->getPath());\n $this->attribute('filename', $file->getName());\n }\n }\n }",
"private static function initialize()\n {\n $fileName = ExtensionManagementUtility::extPath('extractor') . 'Resources/Private/mime.types';\n $fh = fopen($fileName, 'r');\n if (is_resource($fh)) {\n while (($buffer = fgets($fh, 1024)) !== false) {\n if ($buffer{0} === '#') {\n continue;\n }\n list($mimeType, $extensions) = GeneralUtility::trimExplode(TAB, $buffer, true);\n $extensions = GeneralUtility::trimExplode(' ', $extensions, true);\n static::$mimeTypesMapping[$mimeType] = $extensions;\n foreach ($extensions as $extension) {\n static::$extensionsMapping[$extension] = $mimeType;\n }\n }\n fclose($fh);\n }\n }",
"abstract public function import();",
"private function fetch_metadata_from_file()\n\t{\n\t\tif (!file_exists($this->metadata_file))\n\t\t{\n\t\t\tthrow new \\phpbb\\extension\\exception('FILE_NOT_FOUND', array($this->metadata_file));\n\t\t}\n\n\t\tif (!($file_contents = file_get_contents($this->metadata_file)))\n\t\t{\n\t\t\tthrow new \\phpbb\\extension\\exception('FILE_CONTENT_ERR', array($this->metadata_file));\n\t\t}\n\n\t\tif (($metadata = json_decode($file_contents, true)) === null)\n\t\t{\n\t\t\tthrow new \\phpbb\\extension\\exception('FILE_JSON_DECODE_ERR', array($this->metadata_file));\n\t\t}\n\n\t\tarray_walk_recursive($metadata, array($this, 'sanitize_json'));\n\t\t$this->metadata = $metadata;\n\t}",
"private function parseSourceFile()\n {\n $this->setCollection(SourceFile::parse($this->source_file));\n }",
"abstract protected function loadMetadataFromFile($className, $file);",
"protected function load() {}",
"protected function getRawMetadata() {\n // Use static pattern to avoid rebuilding multiple times per request.\n if (is_null($this->metadata)) {\n\n $it = new RecursiveDirectoryIterator($this->path);\n $filter = ['json', 'twig'];\n $this->metadata = [];\n $components = [];\n\n /** @var \\SplFileInfo $file */\n foreach (new RecursiveIteratorIterator($it) as $file) {\n // Skip directories and non-files.\n if (!$file->isFile()) {\n continue;\n }\n $file_path = $file->getPath();\n\n // Skip tests folders.\n if (strpos($file_path, '/tests') !== FALSE) {\n continue;\n }\n\n // Get the file extension for the file.\n $file_ext = $file->getExtension();\n if (!in_array(strtolower($file_ext), $filter, TRUE)) {\n continue;\n }\n\n // We use file_basename as a unique key, it is required that the\n // JSON and twig file share this basename.\n $file_basename = $file->getBasename('.' . $file_ext);\n\n // Build an array of all the filenames of interest, keyed by name.\n $components[$file_basename][$file_ext] = \"$file_path/$file_basename.$file_ext\";\n }\n\n foreach ($components as $module_name => $data) {\n // If the component has a json file, create the pattern from it.\n if (!empty($data['json']) && $file_contents = file_get_contents($data['json'])) {\n $pattern = $this->createPattern(json_decode($file_contents));\n\n $subtype = \"pk_$module_name\";\n $pattern->subtype = $subtype;\n // URL is redundant for the twig based components, so we use it to\n // store namespace.\n $pattern->url = $this->getId();\n }\n else {\n // Create the pattern from defaults.\n $pattern = $this->createPattern(\n (object) [\n '$schema' => 'http =>//json-schema.org/draft-04/schema#',\n 'category' => 'atom',\n 'title' => $module_name,\n 'type' => 'object',\n 'format' => 'grid',\n 'properties' => (object) [],\n 'required' => [],\n ]\n );\n }\n\n if (!empty($data['twig'])) {\n $twig_file = $data['twig'];\n if (file_exists($twig_file)) {\n $pattern->filename = $twig_file;\n $pattern->template = file_get_contents($twig_file);\n }\n }\n\n $this->metadata[$module_name] = $pattern;\n }\n\n foreach ($this->metadata as $pattern_type => $pattern) {\n // Replace any $ref links with relative paths.\n if (!isset($pattern->schema->properties)) {\n continue;\n }\n $pattern->schema->properties = _patternkit_schema_ref(\n $pattern->schema->properties,\n $this->metadata\n );\n $this->metadata[$pattern_type] = $pattern;\n }\n }\n\n return $this->metadata;\n }",
"abstract protected function load_file($file);",
"public function import()\n {\n }",
"public function withData()\n {\n $metadata = $this->filesystem->getMetadata($this->path);\n $metadata['mimetype'] = isset($metadata['mimetype']) ? $metadata['mimetype'] : $this->filesystem->getMimetype($this->path);\n $data = [\n 'filename' => $this->name,\n 'url' => $this->getUrl(),\n 'visibility' => $this->visibility,\n ];\n\n return array_merge($metadata, $data);\n }",
"function sinan_set_import_files() {\n return array(\n array(\n 'import_file_name' => __('Demo content', 'sinan'),\n 'local_import_file' => trailingslashit( get_template_directory() ) . 'inc/demo-content/demo-content.xml', \n 'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'inc/demo-content/demo-widgets.wie',\n ),\n );\n}",
"public function getMeta(): SplFileInfo;",
"abstract public function load($file);",
"function parse($file)\n {\n }"
] | [
"0.6110747",
"0.58490044",
"0.5778039",
"0.5706703",
"0.5706349",
"0.5664896",
"0.56640077",
"0.5629056",
"0.55897033",
"0.555836",
"0.55508155",
"0.55503225",
"0.55503225",
"0.55470693",
"0.5493913",
"0.54909784",
"0.54812676",
"0.54728156",
"0.54718435",
"0.54536754",
"0.5452685",
"0.5435902",
"0.5418733",
"0.5404591",
"0.54034406",
"0.53978527",
"0.53676414",
"0.5359467",
"0.5354863",
"0.5352116"
] | 0.63068354 | 0 |
Send command to command queue. | public function sendCommand(CommandInterface $command); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SendCommandQueue() {\r\n addLog(\"mpd->SendCommandQueue()\");\r\n if ( ! $this->connected ) {\r\n addErr(\"mpd->SendCommandQueue() / Error: Not connected\");\r\n return NULL;\r\n } else {\r\n $this->command_queue .= MPD_CMD_END_BULK . \"\\n\";\r\n if ( is_null($respStr = $this->SendCommand($this->command_queue)) ) {\r\n return NULL;\r\n } else {\r\n $this->command_queue = NULL;\r\n addLog(\"mpd->SendCommandQueue() / response: '\".$respStr.\"'\\n\");\r\n }\r\n }\r\n return $respStr;\r\n }",
"public function send($command) {\n fputs($this->connection, $command . \"\\n\\r\");\n\n $this->output(date(\"[d/m @ H:i:s]\") . \"-> \" . $command);\n }",
"public function sendCommandQueue() {\n\n $this->debug(\"mpd->sendCommandQueue()\");\n\n if ( ! $this->connected ) {\n throw new Exception(\"mpd->sendCommandQueue() / Error: Not connected\");\n }\n $this->command_queue .= self::CMD_END_BULK . \"\\n\";\n if ( is_null($respStr = $this->sendCommand($this->command_queue)) ) {\n return null;\n } else {\n $this->command_queue = null;\n $this->debug(\"mpd->sendCommandQueue() / response: '\" . $respStr . \"'\");\n }\n return $respStr;\n }",
"function QueueCommand($cmdStr,$arg1 = \"\",$arg2 = \"\") {\r\n addLog(\"mpd->QueueCommand() / cmd: \".$cmdStr.\", args: \".$arg1.\" \".$arg2);\r\n if ( ! $this->connected ) {\r\n addErr(\"mpd->QueueCommand() / Error: Not connected\");\r\n return NULL;\r\n } else {\r\n if ( strlen($this->command_queue) == 0 ) {\r\n $this->command_queue = MPD_CMD_START_BULK . \"\\n\";\r\n }\r\n if (strlen($arg1) > 0) $cmdStr .= \" \\\"$arg1\\\"\";\r\n if (strlen($arg2) > 0) $cmdStr .= \" \\\"$arg2\\\"\";\r\n\r\n $this->command_queue .= $cmdStr .\"\\n\";\r\n addLog(\"mpd->QueueCommand() / return\");\r\n }\r\n return TRUE;\r\n }",
"private function _sendCommand($cmd)\n { $packet = new MQF_Client_Packet();\n }",
"public function sendFirstFromQueue();",
"public function sendAllFromQueue();",
"function sendCommand($Command)\n {\n //$Command=\"stop\";\n $this->_Write(SERVERDATA_EXECCOMMAND, $Command, '');\n }",
"abstract public function addCommandToQueue(array $parameters);",
"public function queueCommand($cmdStr, $arg1 = \"\", $arg2 = \"\") {\n\n $this->debug(\"mpd->queueCommand() / cmd: \".$cmdStr.\", args: \".$arg1.\" \".$arg2);\n\n if ( ! $this->connected ) {\n throw new Exception(\"mpd->queueCommand() / Error: Not connected\");\n } else {\n if ( strlen($this->command_queue) == 0 ) {\n $this->command_queue = self::CMD_START_BULK . \"\\n\";\n }\n if (strlen($arg1) > 0) $cmdStr .= \" \\\"$arg1\\\"\";\n if (strlen($arg2) > 0) $cmdStr .= \" \\\"$arg2\\\"\";\n\n $this->command_queue .= $cmdStr .\"\\n\";\n\n $this->debug(\"mpd->QueueCommand() / return\");\n }\n return true;\n }",
"public function execute(){\n\n\t\t$total_messages = 0;\n\n\t\t$total_sent = 0;\n\n\t\tforeach ($this->_queue as $message) {\n\t\t\t++$total_messages;\n\t\t\tif($message->send())\n\t\t\t\t++$total_sent;\n\t\t}\n\n\t\techo \"$total_sent out of $total_messages messages sent\\n\";\n\t}",
"protected function registerQueuedCommand(): void\n {\n $this->app->singleton('orchestra.commands.tenanti.queue', static function () {\n return new QueuedCommand();\n });\n }",
"public function sendCommand($cmd, $timeout = 15)\n {\n if (substr($this->output, -1) !== \"\\n\") {\n $this->addLog(\"\\n\");\n }\n $this->addLog($this->getPrompt().$cmd.\"\\n\");\n $this->addLog($this->shell->sendSmartCommand($cmd, true, $timeout, true));\n }",
"public function dispatch($command);",
"public function push(CommandInterface $command)\n {\n // todo: implement queue push()\n }",
"public function dispatchNow($command);",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"protected function sendCommand($command) {\n $this->connection->startConnection($this->host);\n\n $result = $this->connection->sendAndReceive($command);\n\n $this->connection->closeConnection();\n\n return $result;\n }",
"public function send(): void ;",
"public function sendCommand($command, $data) {\n $this->connect();\n if ($this->isConnected) {\n fwrite($this->clientSocket, $command.PHP_EOL);\n if (!empty($data))\n foreach ($data as $dataItem)\n fwrite($this->clientSocket, $dataItem.PHP_EOL);\n fwrite($this->clientSocket, \"END COMMAND\".PHP_EOL);\n $return = stream_get_contents($this->clientSocket);\n $this->closeConnection();\n return $return;\n } else\n return \"INVALID CONNECTION\";\n }",
"public function sendMessage()\n {\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BAD begin\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BAD end\n }",
"public function send() {\n }",
"final public function sendCommand($cmd) {\n if($this->debug) echo \"Função: \".__FUNCTION__.\"\\n\";\n\n if(is_resource($this->process)) {\n if($this->debug) echo \" escrevendo \".'fwrite($this->pipes[0], '.$cmd.')\\n\");'.\"<br />\\n\";\n fwrite($this->pipes[0], $cmd.\"\\n\");\n #fwrite($this->pipes[0], \"ascii()\\n\");\n\n //$this->waitUnlock();\n\n #$this->esperaCampo();\n #$this->waitReturn();\n\n }\n else {\n $this->error=\"Erro de resource\\n\";\n echo $this->error;\n return false;\n }\n\n return true;\n }",
"private function sendCommand($command) {\r\n\t\tif (!$this->connected) {\r\n\t\t\techo 'Not connected!';\r\n\t\t\treturn NULL;\r\n\t\t}\r\n\r\n\t\tfputs($this->sock, \"$command\\n\");\r\n\t\t$resp = \"\";\r\n\r\n\t\t// only set to false if no error occured\r\n\t\t$this->error = TRUE;\r\n\r\n\t\twhile (!feof($this->sock)) {\r\n\t\t\t$response = fgets($this->sock, 1024);\r\n\r\n\t\t\tif (strncmp('OK', $response, 2) == 0) {\r\n\t\t\t\t$this->error = FALSE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (strncmp('ACK', $response, 3) == 0) {\r\n\t\t\t\t$this->error = TRUE;\r\n\t\t\t\treturn NULL;\r\n\t\t\t}\r\n\r\n\t\t\t$resp .= $response;\r\n\t\t}\r\n\r\n\t\treturn $resp;\r\n\t}"
] | [
"0.68984646",
"0.6843767",
"0.6713124",
"0.66351897",
"0.64383566",
"0.64250535",
"0.63511807",
"0.633345",
"0.62591535",
"0.62223506",
"0.61135715",
"0.61128527",
"0.60977584",
"0.60307324",
"0.6004139",
"0.59683347",
"0.59518665",
"0.59518665",
"0.59518665",
"0.59518665",
"0.59518665",
"0.59518665",
"0.59518665",
"0.5915334",
"0.59060544",
"0.58774066",
"0.58420855",
"0.58238614",
"0.5818654",
"0.5808873"
] | 0.6886505 | 1 |
Return a list of translated error messages. | public function getMessages(): array
{
$errors = $this->getErrors();
$keys = array_keys($errors);
return array_reduce($keys, function ($messages, $key) use ($errors) {
$translated = $this->translator->getMessages($key, $errors[$key]);
return array_merge($messages, $translated);
}, []);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getErrorMessages();",
"public function errorMessages()\n {\n return array_map(\n function ($result) {\n return $result->message();\n },\n $this->errors()\n );\n }",
"public function getErrorMessages(): Collection;",
"public function getErrorMessages() {\n $messages = [];\n foreach ($this->errors as $field => $errors) {\n $messages = array_merge($messages, $errors);\n }\n return $messages;\n }",
"function _getErrorMessageI18n() {\n return $this->_error_messages;\n }",
"public function getErrorMessages(): array\n {\n $messages = [];\n foreach ($this->errors as $errors) {\n foreach ($errors as $error) {\n $messages[] = $error->message;\n }\n }\n return $messages;\n }",
"public function get_all_error_messages() {\n\n\t\t\treturn call_user_func_array( 'array_merge', $this->get_error_messages() );\n\n\t\t}",
"public function errorMessages()\n {\n return [\n self::REQUIRED => 'This field is required.',\n self::EMAIL => 'This field must be a valid email address.',\n self::MIN => 'Mininmun length of this field must be {min} characters.',\n self::MAX => 'Maximum length of this field must be {max} characters.',\n self::MATCH => 'This field must be the same as {match}',\n self::UNIQUE => 'Record with this {field} already existes',\n self::DOESNTEXIST => 'Record does not exist',\n self::PASSWORDVERIFY=> 'Wrong password',\n ];\n }",
"public function getTranslationMessages()\r\n {\r\n if(isset($this->m_options['fallback'])){\r\n $messageIds = $this->m_translation->getMessageIds($this->m_options['fallback']);\r\n $len = count($messageIds);\r\n for ($i = 0; $i < $len; $i++) {\r\n $messages[$messageIds[$i]] = $this->m_translation->_($messageIds[$i]);\r\n }\r\n return $messages;\r\n } else {\r\n return $this->m_translation->getMessages();\r\n }\r\n }",
"public function messages()\n {\n return [\n 'first_name.required' => trans('errors.external_service_provider_edit.first_name'),\n 'last_name.required' => trans('errors.external_service_provider_edit.last_name'),\n 'email.required' => trans('errors.external_service_provider_edit.email'),\n 'mobile.required' => trans('errors.external_service_provider_edit.mobile'),\n 'address.required' => trans('errors.external_service_provider_edit.address'),\n 'lat.required' => trans('errors.external_service_provider_edit.address'),\n 'lng.required' => trans('errors.external_service_provider_edit.address'),\n ];\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"public function getMessages()\n {\n if (! $this->_valid) {\n return [$this->_translator->_('This is not the correct two factor code!')];\n }\n }",
"public function messages()\n {\n return [\n 'attachment.*.required' => trans('site::mailing.error.attachment.required'),\n 'attachment.*.mimes' => trans('site::mailing.error.attachment.mimes'),\n 'attachment.*.max' => trans('site::mailing.error.attachment.max'),\n 'recipient' => trans('site::mailing.recipient'),\n ];\n }",
"public function getErrorMessages(){\r\n\t\treturn implode('|', $this->_errorMessages);\r\n\t}",
"public function messages()\n {\n return [\n 'name.required' => trans('timetracker::customers/admin_lang.name_required'),\n 'timezone.required' => trans('timetracker::customers/admin_lang.timezone_required'),\n 'currency.required' => trans('timetracker::customers/admin_lang.currency_required'),\n 'country.required' => trans('timetracker::customers/admin_lang.country_required'),\n 'email.email' => trans('timetracker::customers/admin_lang.email_incorrect'),\n 'fixed_rate.numeric' => trans('timetracker::customers/admin_lang.fixed_rate_incorrect'),\n 'hourly_rate.numeric' => trans('timetracker::customers/admin_lang.hourly_rate_incorrect'),\n\n ];\n }",
"protected function getMessages() {\n return [\n 'name.required' => trans('lwv.module.careers::errors.form_invalid_name'),\n 'email.required' => trans('lwv.module.careers::errors.form_invalid_email'),\n 'email.email' => trans('lwv.module.careers::errors.form_invalid_email'),\n 'phone.required' => trans('lwv.module.careers::errors.form_invalid_phone'),\n ];\n }",
"private function messages() {\n return [\n 'name.required' => trans('categories.controller.name_required'),\n 'name.min' => trans('categories.controller.name_short'),\n 'name.unique' => trans('categories.controller.name_used'),\n 'lang.required' => trans('categories.controller.language_required'),\n 'lang.in' => trans('categories.controller.language_invalid'),\n 'image.required' => trans('categories.controller.image_required'),\n 'image.mimes' => trans('categories.controller.image_invalid'),\n ];\n }",
"function getMessageMap() {\n $errors = file(\"errors/{$this->language}.txt\");\n foreach($errors as $error) {\n list($key,$value) = explode(\",\", $error, 2);\n $errorArray[$key] = $value;\n }\n return $errorArray[$this->errorcode];\n }",
"public function messages()\n {\n return [\n 'local.path.required_if' => translate('validation.required', ['attribute' => 'path']),\n 'local.url.required_if' => translate('validation.required', ['attribute' => 'URL']),\n\n 's3.key.required_if' => translate('validation.required', ['attribute' => 'access key ID']),\n 's3.secret.required_if' => translate('validation.required', ['attribute' => 'secret access key']),\n 's3.bucket.required_if' => translate('validation.required', ['attribute' => 'bucket']),\n 's3.region.required_if' => translate('validation.required', ['attribute' => 'region']),\n ];\n }",
"public static function getTranslationMessages()\n {\n return [\n new Message('menu.page', 'victoire'),\n new Message('menu.preview', 'victoire'),\n new Message('menu.page.settings', 'victoire'),\n new Message('menu.page.template', 'victoire'),\n new Message('menu.page.new', 'victoire'),\n new Message('menu.template', 'victoire'),\n new Message('menu.template.settings', 'victoire'),\n new Message('menu.template.new', 'victoire'),\n new Message('menu.sitemap', 'victoire'),\n new Message('menu.media', 'victoire'),\n new Message('menu.parent', 'victoire'),\n new Message('menu.business_template', 'victoire'),\n new Message('modal.button.create.title', 'victoire'),\n new Message('modal.button.update.title', 'victoire'),\n new Message('menu.leftnavbar.stats.label', 'victoire'),\n new Message('menu.leftnavbar.target.label', 'victoire'),\n new Message('menu.leftnavbar.lang.label', 'victoire'),\n new Message('menu.leftnavbar.network.label', 'victoire'),\n new Message('menu.leftnavbar.todo.label', 'victoire'),\n new Message('menu.leftnavbar.img.label', 'victoire'),\n new Message('menu.leftnavbar.user.label', 'victoire'),\n new Message('menu.leftnavbar.404.label', 'victoire'),\n new Message('menu.leftnavbar.sitemap.label', 'victoire'),\n new Message('menu.leftnavbar.sandbox.label', 'victoire'),\n ];\n }",
"public function getErrorMessages(): array\n {\n return $this->errorMessages;\n }",
"public function error_messages() {\n return $this->messages;\n }",
"public static function validationMessage()\n {\n return [\n 'required' => __('lang.required'),\n 'required_with' => __('lang.required'),\n 'numeric' => __('lang.numeric'),\n 'unique' => __('lang.unique'),\n 'integer' => __('lang.integer'),\n 'date' => __('lang.date'),\n 'courier_id.required_if' => 'The courier id field is required when package type is incoming',\n 'package_status.unique' => 'This action is already performed',\n 'signing_person_name.required_if' => 'Please provide signature person name',\n 'signature_image_url.required_if' => 'Please provide signature image',\n 'courier_id_number.required_if' => 'Courier Id Number is required, when adding courier',\n 'floor_rep_id.exists' => trans('Messages.noFloorReps'),\n 'email.exists' => \"Sorry, but we couldn't locate a user with the email address entered. Please Try Again\",\n ];\n }",
"public function messages()\n {\n return [\n 'first_name.required' => trans('errors.support_worker.first_name'),\n 'last_name.required' => trans('errors.support_worker.last_name'),\n 'email.required' => trans('errors.support_worker.email'),\n 'mobile.required' => trans('errors.support_worker.email'),\n 'address.required' => trans('errors.support_worker.address'),\n 'lat.required' => trans('errors.invalid_address'),\n 'registration_groups.required' => trans('errors.support_worker.registration_groups')\n ];\n }",
"private function messages() {\n return [\n 'name.required' => 'Category Name Is Required',\n 'name.min' => 'Category Name Is Too Short',\n 'name.unique' => 'Category Name Is Already Taken',\n 'lang.required' => 'Languge Is Required',\n 'lang.in' => 'Invalid Information',\n 'image.required' => 'Image Is Required',\n 'image.mimes' => 'Image Type Is Invalid',\n ];\n }",
"public function messages()\n {\n return [\n 'name.required' => trans('validation.signUp.name.required'),\n 'name.regex' => trans('validation.signUp.name.regex'),\n 'address.*' => trans('validation.signUp.address.error'),\n 'department.*' => trans('validation.signUp.department.error'),\n 'position.*' => trans('validation.signUp.position.error'),\n 'phone.*' => trans('validation.signUp.phone.error'),\n 'phone_ext.*' => trans('validation.signUp.phone_ext.error'),\n 'fax.*' => trans('validation.signUp.fax.error'),\n 'fax_ext.*' => trans('validation.signUp.fax_ext.error'),\n ];\n }",
"public function messages()\n {\n return [\n 'name.required' => trans('validationForm.client_name.required'),\n 'email.required' => trans('validationForm.email.required'),\n 'email.email' => trans('validationForm.email.email'),\n 'password.confirmed' => trans('validationForm.password.confirmed'),\n 'country.required' => trans('validationForm.country_select.required'),\n 'language.required' => trans('validationForm.language_select.required'),\n 'time_zone.required' => trans('validationForm.timezone_select.required'),\n 'default_price_sms.required' => trans('validationForm.default_price.required'),\n 'default_price_sms.min' => trans('validationForm.default_price.min'),\n ];\n }",
"function replaceValidationErrorMessagesI18n() {\n $this->setErrorMessageI18n();\n\n foreach ($this->validate as $fieldname => $ruleSet) {\n foreach ($ruleSet as $rule => $rule_info) {\n\n $rule_option = array();\n if (!empty($this->validate[$fieldname][$rule]['rule'])) {\n $rule_option = $this->validate[$fieldname][$rule]['rule'];\n }\n\n $error_message_list = $this->_getErrorMessageI18n();\n $error_message = ( array_key_exists($rule, $error_message_list) ? $error_message_list[$rule] : null );\n\n if (!empty($error_message)) {\n $this->validate[$fieldname][$rule]['message'] = vsprintf($error_message, $rule_option);\n } elseif (!empty($this->validate[$fieldname][$rule]['message'])) {\n $this->validate[$fieldname][$rule]['message'] = __($this->validate[$fieldname][$rule]['message'], true);\n }\n\n\n if ($this->_withFieldName && !empty($this->validate[$fieldname][$rule]['message'])) {\n $this->validate[$fieldname][$rule]['message'] = __($fieldname, true) . ' : ' . $this->validate[$fieldname][$rule]['message'];\n }\n }\n }\n }",
"function _getDefaultErrorMessagesI18n() {\n //Write Default Error Message\n $default_error_messages = array(\n 'notempty' => __('This field can not leave empty.', true),\n 'require' => __('This field can not leave empty.', true),\n 'email' => __('Invalid Email address.', true),\n 'alphanumeric' => __('Please input numerical and alphabetical characters.', true),\n 'between' => __('Between %2$d and %3$d characters.', true),\n 'numeric' => __('Please input numerical characters.', true),\n 'isUnique' => __('This value is not a unique.', true),\n 'boolean' => __('This field can set boolean value.', true),\n 'alphaNumericHyphen' => __('Please input numerical and alphabetical characters and hyphen.', true),\n 'numericHyphen' => __('Please input numerical characters and hyphen.', true),\n 'equalLength' => __('Please input %2$d characters.', true),\n 'nendoRange' => __('Please input proper year.', true),\n 'date' => __('Please input date.', true),\n 'warekiRange' => __('Please input proper japanese year.', true),\n 'userNameRule' => __('Please input numerical and alphabetical characters and hyphen, underscore, dot.', true),\n 'passwordRule' => __('Please input proper password', true),\n );\n\n return $default_error_messages;\n }",
"public function messages(): array\n {\n return [\n 'name.required' => 'Поле «Название» обязательно для заполнения',\n 'title.required' => 'Поле «Title» обязательно для заполнения',\n 'alias.required' => 'Поле «Alias» обязательно для заполнения',\n 'alias.unique' => 'Значение поля «Alias» уже присутствует в базе данных',\n ];\n }"
] | [
"0.7777003",
"0.76046056",
"0.7476075",
"0.73348826",
"0.73323876",
"0.7296122",
"0.7274908",
"0.72630405",
"0.7260925",
"0.7255244",
"0.71728045",
"0.7152557",
"0.7132962",
"0.7114408",
"0.71048605",
"0.7096882",
"0.7096143",
"0.7054043",
"0.7052269",
"0.7040084",
"0.70295846",
"0.70215887",
"0.70032626",
"0.6961552",
"0.6943331",
"0.69272196",
"0.692398",
"0.6921069",
"0.6912825",
"0.6911023"
] | 0.7964597 | 0 |
Handle the order "created" event. | public function created(Order $order)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function handle(OrderCreated $event)\n {\n }",
"public function created(Order $model)\n {\n $model->sendOrderStatusChangeNotification($model, true);\n $this->sendOrderUpdateMail($model);\n $model->notifyDeliveryBoys();\n }",
"public function createOrder(){\r\n\r\n }",
"public function handleOrderCreated(OrderCreated $event)\n { \n return $event->order->makePdf();\n }",
"public function onCreated($order, $shop)\n {\n\n $schedule_when = \"glovo_when_receive\";\n $schedule_day = \"glovo_schedule_day\";\n $schedule_time = \"glovo_schedule_time\";\n\n $schedule_when_val = null;\n $schedule_time_val = null;\n $glovo_attemp = 'N';\n\n try\n {\n $this->debug(\"onCreated - Creating local order\", 3);\n\n $notes = collect($order->note_attributes)->keyBy('name');\n\n $this->debug(\"Number of metas in order [notes] => \".$notes->count(), 4);\n $this->debug(\"Result Metas => \".$notes->toJson(), 4);\n\n\n //metas\n $apimetas = $shop->api()->rest('GET', \"/admin/api/\".\\Config('shopify-app.api_version').\"/orders/{$order->id}/metafields.json\");\n $shopifyordermetas = collect( $apimetas->body->metafields )->keyBy('key');\n\n\n\n $this->debug(\"Shop Domain -> \".$shop->shopify_domain, 4);\n $emstore = EMVexstore::findByDomain($shop->shopify_domain);\n $emsettings = EMVexsetting::findByStoreId($emstore->getId());\n\n $this->debug(\"Evaluating Store Status ........\", 4);\n $this->debug(\"Plan of Store ................\" . (is_null($emstore->getCarrierId()) ? ' is a Basic Plan' : ' is Advanced Plan'), 4);\n $this->debug(\"Store is validated ............\" . ($emsettings->getValidated() ? ' is validated and can delivery by glovo' : 'not validated'), 4);\n $this->debug(\"Avalilable products ............\" . ($emsettings->getEnableAllProducts() ? ' is available for all' : 'is enable for custom products'), 4);\n $this->debug(\"Determinate when create the order\", 4);\n $this->debug(\" Setting for create Orderd is set to .....\".$emsettings->getCreateStatus(), 4);\n $this->debug(\" Setting for Schedule Orders is set to ...\". ( $emsettings->getAllowScheduled() ? ' allow schedules' : ' no schedulled' ), 4);\n $this->debug(\" Order financial status is................\".$order->financial_status, 4);\n $this->debug(\" Shipping method is: \", 4);\n\n if ( isset($order->shipping_lines) and count($order->shipping_lines)>0)\n {\n $this->debug( \"[\". $order->shipping_lines[0]->title .\"]\", 4);\n }else\n {\n $this->debug( '----> Cant determinate shipping method' , 5);\n $this->debug( '----> Some bad ocurred - check order json', 5);\n }\n\n\n $this->debug(\"Evaluating Allow Scheduled\", 4);\n\n if ( is_null($emstore->getCarrierId()) )\n {\n $this->debug(\"Store have a Basic Plan\", 4);\n if ($emsettings->getValidated() ) //and $emsettings->getAllowScheduled() == false\n { $this->debug(\"Allow Scheduled is Off\", 4);\n $this->debug(\"Attemp send manualy\", 4);\n $glovo_attemp = 'S';\n }\n\n\n }else\n\n {\n $this->debug(\"Store have a Advanced Plan\", 4);\n $this->debug(\"Use the chosen shipping option\", 4);\n if ( isset($order->shipping_lines) and is_array($order->shipping_lines) and $order->shipping_lines[0]->title === env('SHOPIFY_SHIPPING_TITLE'))\n {\n $glovo_attemp = 'S';\n\n }\n\n\n }\n\n\n\n\n $this->debug(\"Evaluating Metas\", 4);\n if ($notes->has($schedule_when))\n {\n $this->debug(\"Allow Scheduled is On\", 5);\n $schedule_when_val = $notes->has($schedule_when) ? $notes->get($schedule_when)->value : \"scheduled\";\n $metadata = array(\n 'metafield' => array(\n \"namespace\" => \"glovo_shipping\",\n \"key\" => $schedule_when,\n \"value\" => $schedule_when_val,\n \"value_type\"=> \"string\",\n )\n );\n\n $this->debug(\"value of attribute $schedule_when is \".$schedule_when_val, 5);\n\n if ( !$shopifyordermetas->has($schedule_when) )\n $apirest = $shop->api()->rest('POST',\"/admin/api/\".\\Config('shopify-app.api_version').\"/orders/{$order->id}/metafields.json\", $metadata);\n\n }\n\n\n if ($notes->has($schedule_day)){\n $metadata = array(\n 'metafield' => array(\n \"namespace\" => \"glovo_shipping\",\n \"key\" => $schedule_day,\n \"value\" => $notes->get($schedule_day)->value,\n \"value_type\"=> \"string\",\n )\n );\n $this->debug(\"value of attribute $schedule_day is \".$notes->get($schedule_day)->value, 5);\n\n if ( !$shopifyordermetas->has($schedule_day) )\n $apirest = $shop->api()->rest('POST',\"/admin/api/\".\\Config('shopify-app.api_version').\"/orders/{$order->id}/metafields.json\", $metadata);\n\n }\n\n\n\n if ($notes->has($schedule_time)){\n $schedule_time_val = $notes->get($schedule_time)->value;\n $metadata = array(\n 'metafield' => array(\n \"namespace\" => \"glovo_shipping\",\n \"key\" => $schedule_time,\n \"value\" => $schedule_time_val,\n \"value_type\"=> \"string\",\n )\n );\n\n $this->debug(\"value of attribute $schedule_time is \".$schedule_time_val, 5);\n\n if ( !$shopifyordermetas->has($schedule_time) )\n $apirest = $shop->api()->rest('POST',\"/admin/api/\".\\Config('shopify-app.api_version').\"/orders/{$order->id}/metafields.json\", $metadata);\n\n }\n\n\n\n\n #convert dates\n $created_at = Carbon::parse($order->created_at);\n\n #registramos la orden local\n $this->debug(\"Preparing to save local order\", 4);\n\n $localorder = EMVexorders::where('id', $order->id)->first();\n\n if ( is_null($localorder))\n {\n $this->debug(\"Creating order\", 4);\n\n $localorder = new EMVexorders();\n $localorder->shop = $shop->id;\n $localorder->store_id = $emstore->getId();\n $localorder->id = $order->id;\n $localorder->name = $order->name;\n $localorder->number = $order->number;\n $localorder->order_number = $order->order_number;\n $localorder->currency = $order->currency;\n $localorder->shipping_method = implode(\", \", $this->getShippingMethods($order));\n $localorder->financial_status = $order->financial_status;\n $localorder->fulfillment_status = $order->fulfillment_status;\n $localorder->created_at = $created_at->format('Y-m-d H:i:s');\n $localorder->customer = json_encode(isset($order->customer) ? $order->customer : \"\");\n $localorder->shipping_address = json_encode( isset($order->shipping_address) ? $order->shipping_address : \"\" );\n $localorder->order_status_url = $order->order_status_url;\n $localorder->glovo_attemp = $glovo_attemp;\n $localorder->deliverywhen = $schedule_when_val;\n $localorder->scheduletime = $schedule_time_val;\n $localorder->source = json_encode($order);\n $localorder->save();\n\n $this->debug(\"Creating order .... OK\", 4);\n $this->debug(\"Result attemp to glovo : $glovo_attemp\", 4);\n }\n\n $this->debug(\"Returning .... true\", 4);\n\n return true;\n\n\n }catch (Exception $e)\n {\n $this->debug(\"Error in -> ShopifyOrdersController.onCreated\", 4);\n $this->debug(\"Error message -> \".$e->getMessage(), 4);\n\n Log::critical(\"Error in -> ShopifyOrdersController.onCreated \". $e->getMessage() .\"- Line:\".$e->getLine() );\n }\n\n\n return false;\n\n }",
"public function created(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"public function onPostCreateOrder(OrderEvent $orderEvent)\n {\n try {\n $order = $orderEvent->getOrder();\n\n // suspend auto-commit\n $this->em->getConnection()->beginTransaction();\n\n $this->em->persist($order);\n $this->em->flush();\n\n // Try and commit the transaction\n $this->em->getConnection()->commit();\n\n $orderEvent->setOrder($order);\n } catch (ConnectionException $e) {\n // Rollback the failed transaction attempt\n $this->em->getConnection()->rollback();\n $orderEvent->setErrorType(OrderEvent::TYPE_DATABASE_ERROR);\n $orderEvent->setErrorMsg($e->getMessage());\n $orderEvent->stopPropagation();\n }\n }",
"public function afterPlaceOrder($order)\n {\n $this->bookingRepository->create(['order' => $order]);\n }",
"public function afterPlaceOrder($order)\n {\n $this->order->create(['order' => $order]);\n }",
"public function execute(Observer $observer)\n {\n /* @var $order Order */\n $order = $observer->getEvent()->getData('order');\n\n /** @var Quote $quote */\n $quote = $observer->getEvent()->getData('quote');\n\n try {\n $items = $quote->getItems();\n $productsSku = [];\n foreach ($items as $item) {\n $productsSku[] = $item->getSku();\n }\n\n /** @var OrderCreatedEventInterface $createOrderEvent */\n $createOrderEvent = $this->createdEventFactory->create();\n $createOrderEvent->setOrderId($order->getId());\n $createOrderEvent->setProductsSku($productsSku);\n $createOrderEvent->setStoreId($order->getStoreId());\n\n $this->publisher->publish(self::MQ_TOPIC_NAME_IMPORT, $createOrderEvent);\n } catch (Throwable $e) {\n $this->logger->error('OrderCreatedObserver::execute error: ' . $e->getMessage());\n }\n }",
"protected function _processOrder()\n {\n try {\n switch ($this->response->getTransactionStatus()) {\n case Response::STATUS_SUCCESS:\n $this->_registerSuccess(true);\n break;\n case Response::STATUS_WAITING:\n $this->_registerPaymentReview();\n break;\n case Response::STATUS_FAILURE:\n $this->_registerFailure();\n break;\n }\n } catch (\\Exception $ex) {\n $comment = $this->_createIpnComment(__('Note: %s', $ex->getMessage()));\n $this->_order->addStatusHistoryComment($comment);\n $this->orderRepository->save($this->_order);\n throw $ex;\n }\n }",
"public function created(WechatPayOrder $wechatPayOrder)\n {\n //\n }",
"public function onPostAdd(OrderItemEvent $event)\n {\n $this->dispatcher->dispatch(OrderEvents::CONTENT_CHANGE, $event);\n }",
"public function created(XmlShiporder $xmlShiporder)\n {\n ProcessorXMLShiporder::dispatch($xmlShiporder);\n }",
"public function checkCreateOrder(){\n\t\tif(!$this->id){\n\t\t\t$this->createOrder();\n\t\t}\n\t}",
"public function __invoke(CreateOrder $createsOrder)\n {\n // update warehouse database to keep stock up to date in physical stores\n sleep(4);\n var_dump($createsOrder);\n }",
"public function order_has_been_created( $order_id ) {\n\t\t// load the order\n\t\t$order = wc_get_order( $order_id );\n\t\t\n\t\t// cycle through the order items, and update all the ticket items to confirmed\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\t\t\t$item = QSOT_WC3()->order_item( $item );\n\t\t\t// only do this for order items that are tickets\n\t\t\tif ( ! apply_filters( 'qsot-item-is-ticket', false, $item ) ) {\n\t\t\t\tvar_dump( 'NOT A TICKET', $item );\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t// get the event, area_type and zoner for this item\n\t\t\t$event = get_post( $item['event_id'] );\n\t\t\t$event_area = apply_filters( 'qsot-event-area-for-event', false, $event );\n\t\t\t$area_type = is_object( $event_area ) ? $event_area->area_type : null;\n\n\t\t\t// if any of the data is missing, the skip this item\n\t\t\tif ( ! is_object( $event ) || ! is_object( $event_area ) || ! is_object( $area_type ) ) {\n\t\t\t\tif ( ! is_object( $event ) )\n\t\t\t\t\tvar_dump( 'NOT AN EVENT', $event );\n\t\t\t\tif ( ! is_object( $event_area ) )\n\t\t\t\t\tvar_dump( 'NOT EVENT AREA', $event_area );\n\t\t\t\tif ( ! is_object( $area_type ) )\n\t\t\t\t\tvar_dump( 'NOT AREA TYPE', $area_type );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// have the event_area determine how to update the order item info in the ticket table\n\t\t\t\t$result = $area_type->confirm_tickets( $item, $item_id, $order, $event, $event_area );\n\t\t\t\tvar_dump( 'RESULT', $result );\n\n\t\t\t\t// notify externals of the change\n\t\t\t\tdo_action( 'qsot-confirmed-ticket', $order, $item, $item_id, $result );\n\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function create()\n {\n $model = new Order();\n \n $this->data('model', $model);\n \n $this->data('page_title', trans('labels.order_creating'));\n \n $this->breadcrumbs(trans('labels.order_creating'));\n \n $this->_fillAdditionalTemplateData($model);\n \n return $this->render('views.'.$this->module.'.create');\n }",
"public static function createOrder()\n {\n\n $user = Auth::user();\n \n $admins = User::where('role', 'super_admin')\n ->orWhere('role', 'admin')\n ->get();\n\n $order = $user->orders()\n ->create([\n 'total' => Cart::total(),\n 'delivered' => 0,\n 'hash' => str_random(60)\n ]);\n\n $cartItems = Cart::content();\n\n\n foreach ($cartItems as $cartItem) {\n\n if ($cartItem->options->type == 'w') {\n\n $order->widgetItems()->attach($cartItem->id,[\n 'qty' => $cartItem->qty,\n 'total' => $cartItem->qty * $cartItem->price\n ]);\n\n }else{\n\n $order->orderItems()->attach($cartItem->id,[\n 'qty' => $cartItem->qty,\n 'total' => $cartItem->qty * $cartItem->price\n ]);\n\n }\n\n \n }\n\n Mail::to($user)\n ->send( new OrderShipped($order) );\n\n Notification::send($admins, new NewOrder($order));\n\n //$user->notify(new NewPost($post));\n \n\n /*Mail::to($request->user())\n ->cc($moreUsers)\n ->bcc($evenMoreUsers)\n ->send(new OrderShipped($order))\n ->queue(new OrderShipped($order));*/\n\n }",
"public function onNewOrder\n (Notification $notification, Notification $originalNewOrderNotification)\n {\n }",
"public function onPreAdd(OrderItemEvent $event)\n {\n if ($this->isOrderLocked($event)) {\n return;\n }\n\n $this->prepareEvent($event);\n }",
"public function __construct(OrderSaved $event)\n {\n //\n }",
"public function isOrderCreated($orderId);",
"public function actionAddOrder() {\r\n $model = new Preorder();\r\n $orderModel = new Order();\r\n if($model->load(Yii::$app->request->post()) && $model->save()){\r\n $orderModel->on(Order::FORM_CONFIRMED, [$orderModel, 'formConfirm']);\r\n $orderModel->trigger(Order::FORM_CONFIRMED);\r\n }\r\n }",
"protected function recordOrderCreation(Array $request, Mage_Sales_Model_Order $order)\n {\n Mage::getModel('nypwidget/order')\n ->setStoreId($order->getStoreId())\n ->setPricewaiterId($request['pricewaiter_id'])\n ->setOrderId($order->getId())\n ->save();\n }",
"public function create()\n\t{\n\t return view('Admin::order.create', [\n\t 'eventNames' => Event::distinct()->pluck('name'),\n 'users' => $this->clientService->query([], ['created_at' => 'desc']),\n 'ticketsData' => $this->getTicketData()\n ]);\n\t}",
"public function creating(Order $order)\n {\n $order->total = ($order->width * $order->height * $order->amount * $order->price_unit) / 10000;\n if ($order->client->email != null) {\n Mail::to($order->client)->send(new OrderPlaced($order));\n }\n }",
"static function new_order_just_processed($order_id, $order_data){\n\t\tif(isset($_SESSION['delivery']['delivery_time'])){\n\t\t\tupdate_post_meta($order_id, self::delivery_date, $_SESSION['delivery']['delivery_time']);\n\t\t}\n\t\t\n\t\tif(isset($_SESSION['delivery']['delivery_time_h'])){\n\t\t\tupdate_post_meta($order_id, self::delivery_hour, $_SESSION['delivery']['delivery_time_h']);\n\t\t}\n\t\t\n\t\tif(isset($_SESSION['delivery']['delivery_code'])){\n\t\t\tupdate_post_meta($order_id, self::delivery_code, $_SESSION['delivery']['delivery_code']);\n\t\t}\n\t\t\n\t\t//saving date to the extra table\n\t\t\n\t\t$order = new WC_Order($order_id);\n\t\t//var_dump($order->get_order_total());\n\t\t$items = $order->get_items();\n\t\t\n\t\t$order_brands = array();\n\t\t\n\t\tif($items){\n\t\t\tforeach($items as $item){\n\t\t\t\t\n\t\t\t\t$brands = wp_get_object_terms($item['product_id'], self::food_provider_taxonomy, array('fields'=>'ids'));\n\t\t\t\tif($brands){\n\t\t\t\t\tforeach($brands as $b){\n\t\t\t\t\t\t$order_brands[$b]['qty'] += (int) $item['qty'];\n\t\t\t\t\t\t$order_brands[$b]['price'] += $item['line_subtotal'];\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tupdate_post_meta($order_id, self::brand_info, $order_brands);\n\t}",
"function neworder() {\n //get the new order number\n\t\t$order_num = $this->orders->highest() + 1;\n\n\t\t//create a new order object\n\t\t$record = $this->orders->create();\n\t\t\n\t\t//set the properties of the order\n\t\t$record->num = $order_num;\n\t\t$record->date = date(\"l jS \\of F Y h:i:s A\");\n\t\t$record->status = 'Y';\n\t\t\n\t\t$this->orders->add($record);\n\t\t\t\n redirect('/order/display_menu/' . $order_num);\n }",
"public function broadcastOn()\n {\n return new Channel('order.created');\n }"
] | [
"0.8519741",
"0.72894186",
"0.6871711",
"0.68112063",
"0.6763463",
"0.66658616",
"0.65636003",
"0.6533231",
"0.6434521",
"0.6373541",
"0.6332618",
"0.62039167",
"0.61772454",
"0.61726385",
"0.6118271",
"0.6100328",
"0.6081408",
"0.60368013",
"0.5995238",
"0.5978676",
"0.5977647",
"0.5973277",
"0.5923615",
"0.5920799",
"0.59180117",
"0.58842105",
"0.58659816",
"0.5860846",
"0.58528906",
"0.58453554"
] | 0.77930534 | 1 |
Handle the order "updated" event. | public function updated(Order $order)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function admin_update_order(){\n\t\t\t$saved = $this->Attachment->saveAll($this->request->data);\n\t\t\tif($saved){\n\t\t\t\t$response = ['status'=>1, 'message'=>'Order Updated'];\n\t\t\t}else{\n\t\t\t\t$response = ['status'=>0, 'message'=>'Order failed to update'];\n\t\t\t}\n\t\t\t$this->_exit_status($response);\n\t\t}",
"public function orderUpdate(Varien_Event_Observer $observer)\n {\n try{\n error_reporting(0);\n ini_set('display_errors',0);\n\n $storeDisabled = Mage::getStoreConfig('advanced/modules_disable_output/Comrse_ComrseSync', $observer->getOrder()->getStoreId());\n if (!$storeDisabled)\n {\n if ($mageOrder = $observer->getOrder())\n {\n $orderPaymentMethod = $mageOrder->getPayment()->getMethodInstance()->getTitle();\n // if this order came from Comr.se\n if (($orderPaymentMethod == \"Comrse\" || $orderPaymentMethod == \"comrsepay\" || $orderPaymentMethod == \"comrsesync\") && $mageOrder->getState() == Mage_Sales_Model_Order::STATE_NEW)\n {\n $orgData = Mage::getModel('comrsesync/comrseconnect')->load(Comrse_ComrseSync_Model_Config::COMRSE_RECORD_ROW_ID);\n $mageOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);\n $mageOrder->save();\n }\n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Comrse Order Update: {$e->getMessage()}\");\n }\n }",
"public function updated(Order $model)\n {\n $model->sendOrderStatusChangeNotification($model);\n $this->sendOrderUpdateMail($model);\n $model->updateEarning();\n $model->refundUser();\n $model->notifyDeliveryBoys();\n $model->clearFirestore();\n }",
"function update_order_info($order){\n }",
"public function updated(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"function orderChanged();",
"public function onPostSync(OrderItemEvent $event)\n {\n $this->dispatcher->dispatch(OrderEvents::CONTENT_CHANGE, $event);\n }",
"private function updateOrderData()\n {\n $get = $this->connector->get($this->orderURL);\n if (strpos($get['header'], \"200 OK\") !== false) {\n $this->status = $get['body']['status'];\n $this->expires = $get['body']['expires'];\n $this->identifiers = $get['body']['identifiers'];\n $this->authorizationURLs = $get['body']['authorizations'];\n $this->finalizeURL = $get['body']['finalize'];\n if (array_key_exists('certificate', $get['body'])) $this->certificateURL = $get['body']['certificate'];\n $this->updateAuthorizations();\n }\n }",
"public function onUpdateOrderDetails(UploadEvent $uploadEvent)\n {\n $order = $uploadEvent->getOrder();\n $this->orderHandler->updateOrderPrice($order);\n $this->em->flush();\n }",
"public function on_status_update($order_id, $old_status = '', $new_status = '')\n {\n // Check if it's enabled\n if (!$this->opt['woochimp_update_order_status'] || empty($order_id)) {\n return;\n }\n\n $this->log_add(__('Order status update process launched for order id: ', 'woochimp') . $order_id);\n\n // Try to get order object\n $order = self::wc_get_order($order_id);\n\n // Stop if there's no order and no status\n if (!$order && empty($new_status)) {\n $this->log_add(__('No order and no status found, stopping.', 'woochimp'));\n return;\n }\n\n // Check status\n $new_status = empty($new_status) ? $order->get_status() : $new_status;\n\n // Get MC store id\n try {\n $store_id = $this->ecomm_get_store();\n\n if ($store_id === false) {\n return;\n }\n }\n catch (Exception $e) {\n return;\n }\n\n // Get MC order id\n $mc_order_id = self::ecomm_get_id('order', $order_id);\n\n // Prepare order args to send\n $args = array(\n 'financial_status' => $new_status,\n 'processed_at_foreign' => $order->order_date,\n 'updated_at_foreign' => $order->modified_date,\n );\n\n // Check if MailChimp is loaded\n if ($this->load_mailchimp()) {\n\n // Check if order exists in MailChimp\n if ($this->order_exists($store_id, $mc_order_id) === false) {\n $this->log_add(sprintf(__('Order %s does not exist in Store %s, stopping.', 'woochimp'), $mc_order_id, $store_id));\n return;\n }\n\n // Send request to update order\n try {\n $result = $this->mailchimp->update_order($store_id, $mc_order_id, $args);\n $this->log_add(__('Order updated successfully.', 'woochimp'));\n $this->log_process_regular_data($args, $result);\n }\n catch (Exception $e) {\n $this->log_process_exception($e);\n return;\n }\n }\n }",
"protected function updateOrders()\n {\n $connection = $this->resource->getConnection('core_write');\n $bind = [self::SENT_TO_ERP_ORDER_TABLE_FLAG => 1];\n $where = ['entity_id IN(?)' => $this->orderIds];\n $connection->update($connection->getTableName('sales_order'), $bind, $where);\n }",
"public function onUpdateUserMonthlyOrder(OrderEvent $orderEvent)\n {\n try {\n $order = $orderEvent->getOrder();\n // suspend auto-commit\n $this->em->getConnection()->beginTransaction();\n\n // generate the invoice\n $this->builder->setOrder($order)\n ->setOrderInProduction()\n ->generateOrderNumber()\n ;\n\n // Try to flush and commit the transaction\n $this->em->flush();\n $this->em->getConnection()->commit();\n\n $orderEvent->setOrder($this->builder->getOrder());\n } catch (ConnectionException $e) {\n $this->em->getConnection()->rollback();\n $orderEvent->setErrorType(OrderEvent::TYPE_DATABASE_ERROR);\n $orderEvent->setErrorMsg($e->getMessage());\n $orderEvent->stopPropagation();\n }\n }",
"public function onStatusChangeEvent(Event $event)\n {\n $this->logger->info(\"Order status updated\");\n }",
"function update(&$order)\n\t\t{\n\n\t\t\t//simulate a successful billing update\n\t\t\treturn true;\n\t\t}",
"function update_order_states() {\r\n if (true === empty($_POST)) {\r\n $this->log('[Error] No post data sent to callback handler!');\r\n error_log('[Error] Plugin received empty POST data for an callback_url message.');\r\n wp_die('No post data');\r\n } else {\r\n $this->log('[Info] The post data sent from server is present...');\r\n }\r\n\r\n $payload = (object) $_POST;\r\n\r\n if (true === empty($payload)) {\r\n $this->log('[Error] Invalid JSON payload: ' . $post_body);\r\n error_log('[Error] Invalid JSON payload: ' . $post_body);\r\n wp_die('Invalid JSON');\r\n } else {\r\n $this->log('[Info] The post data was decoded into JSON...');\r\n }\r\n\r\n if (false === array_key_exists('id', $payload)) {\r\n $this->log('[Error] No ID present in payload: ' . var_export($payload, true));\r\n error_log('[Error] Plugin did not receive an Order ID present in payload: ' . var_export($payload, true));\r\n wp_die('No Order ID');\r\n } else {\r\n $this->log('[Info] Order ID present in payload...');\r\n }\r\n\r\n if (false === array_key_exists('external_id', $payload)) {\r\n $this->log('[Error] No Order ID present in payload: ' . var_export($payload, true));\r\n error_log('[Error] Plugin did not receive an Order ID present in payload: ' . var_export($payload, true));\r\n wp_die('No Order ID');\r\n } else {\r\n $this->log('[Info] Order ID present in JSON payload...');\r\n }\r\n\r\n if (false === array_key_exists('signature', $payload) && $payload->signature === (string) $this->getHash('sha384', $payload->id . $payload->status, $this->get_option('api_secret')) ) {\r\n error_log('[Error] Request is not signed:' . var_export($payload, true));\r\n exit;\r\n } else {\r\n error_log('[Info] Signature valid present in payload...');\r\n }\r\n\r\n $order_id = $payload->external_id; $this->log('[Info] Order ID:' . $order_id);\r\n $order = wc_get_order($order_id);\r\n $order_states = $this->get_option('order_states');\r\n\r\n if (false === $order) {\r\n $this->log('[Error] The Plugin was called but could not retrieve the order details for order_id: \"' . $order_id . '\". If you use an alternative order numbering system, please see class-wc-gateway-cryptomarket.php to apply a search filter.');\r\n throw new \\Exception('The Plugin was called but could not retrieve the order details for order_id ' . $order_id . '. Cannot continue!');\r\n } else {\r\n $this->log('[Info] Order details retrieved successfully...');\r\n }\r\n\r\n $current_status = $order->get_status();\r\n if (false === isset($current_status) && true === empty($current_status)) {\r\n $this->log('[Error] The Plugin was calledbut could not obtain the current status from the order.');\r\n throw new \\Exception('The Plugin was called but could not obtain the current status from the order. Cannot continue!');\r\n } else {\r\n $this->log('[Info] The current order status for this order is ' . $current_status);\r\n }\r\n\r\n switch ($payload->status) {\r\n case \"-4\":\r\n $this->log('[Info] Pago múltiple. Orden ID:'.$order_id);\r\n $order->update_status($order_states['invalid']);\r\n\r\n wp_die('Pago Multiple');\r\n break;\r\n case \"-3\":\r\n $this->log('[Info] Monto pagado no concuerda. Orden ID:'.$order_id);\r\n $order->update_status($order_states['invalid']);\r\n\r\n wp_die('Monto pagado no concuerda');\r\n break;\r\n case \"-2\":\r\n $this->log('[Info] Falló conversión. Orden ID:'.$order_id);\r\n $order->update_status($order_states['invalid']);\r\n\r\n wp_die('Falló conversión');\r\n break;\r\n case \"-1\":\r\n $this->log('[Info] Expiró orden de pago. Orden ID:'.$order_id);\r\n $order->update_status($order_states['invalid']);\r\n\r\n wp_die('Expiró orden de pago');\r\n break;\r\n case \"0\":\r\n $this->log('[Info] Esperando pago. Orden ID:'.$order_id);\r\n $order->update_status($order_states['waiting_pay']);\r\n\r\n break;\r\n case \"1\":\r\n $this->log('[Info] Esperando bloque. Orden ID:'.$order_id);\r\n $order->update_status($order_states['waiting_block']);\r\n\r\n break;\r\n case \"2\":\r\n $this->log('[Info] Esperando procesamiento. Orden ID:'.$order_id);\r\n $order->update_status($order_states['waiting_processing']);\r\n\r\n break;\r\n case \"3\":\r\n $this->log('[Info] Pago exitoso. Orden ID:'.$order_id);\r\n $transaction_id = isset($payload->id) ? $payload->id : '';\r\n $order->payment_complete($transaction_id);\r\n $order->update_status($order_states['complete']);\r\n break;\r\n\r\n default:\r\n $this->log('[Error] No status payment defined:'.$payload->status.'. Order ID:'.$order_id);\r\n break;\r\n }\r\n exit;\r\n }",
"public function handleNotifyRequest()\n {\n try {\n $result = $this->getOrderRestModel()->consumeNotification();\n\n $response = $result->getResponse();\n $orderRetrieved = $response->order;\n if (isset($orderRetrieved) && is_object($orderRetrieved) && $orderRetrieved->orderId) {\n $transactionId = $orderRetrieved->orderId;\n $status = $orderRetrieved->status;\n $this->updateOrder($transactionId, $status);\n\n header(\"HTTP/1.1 200 OK\");\n }\n } catch (Exception $e) {\n header('X-PHP-Response-Code: 500', true, 500);\n Mage::log($e->getMessage(), null, 'super_payu.log', true);\n die($e->getMessage());\n }\n\n exit;\n }",
"public function actionUpdate()\n { \n if (Yii::$app->request->isAjax) {\n $data = $this->collectData();\n $error = $this->saveData($data, true);\n if (!$error) {\n echo json_encode([\n 'status' => 'success', \n 'msg' => 'Order data has been saved.', \n 'url'=> \\yii\\helpers\\Url::toRoute(['/site/view', 'item_id'=>$data['order_id']])\n ]);\n } else {\n echo json_encode($error);\n } \n }\n Yii::$app->end();\n }",
"public function updating(Order $order)\n {\n $order->total = ($order->width * $order->height * $order->amount * $order->price_unit) / 10000;\n if ($order->client->email != null) {\n // Mail::to($order->client)->send(new OrderPlaced($order));\n }\n\n }",
"public function update_element_order()\n\t{\n\t\t// get the data\n\t\t$element_order = $this->input->get('element_order');\n\n\t\t// load the element model\n\t\t$this->load->model('admin/element_model');\n\n\t\t$this->element_model->update_element_order($element_order, $this->input->get('page_id'));\n\n\t\t$data['success'] = true;\n\n\t\t// return as ajax\n\t\t$this->_json_response($data);\n\t}",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, order $order)\n {\n //\n }",
"public function update(Request $request, order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }",
"public function update(Request $request, Order $order)\n {\n //\n }"
] | [
"0.6983204",
"0.69797313",
"0.69522196",
"0.6942325",
"0.69364494",
"0.67206144",
"0.6662543",
"0.66528744",
"0.6642809",
"0.6423565",
"0.6361371",
"0.63339347",
"0.63098407",
"0.62505746",
"0.6242355",
"0.62277454",
"0.6199371",
"0.6178998",
"0.61674225",
"0.6145009",
"0.6144103",
"0.6144103",
"0.6125256",
"0.6125256",
"0.6125256",
"0.6125256",
"0.6125256",
"0.6125256",
"0.6125256",
"0.6125256"
] | 0.7801366 | 0 |
Handle the order "deleted" event. | public function deleted(Order $order)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleted(Order $order)\n {\n //\n }",
"public function onPostDelete(OrderEvent $event)\n {\n $order = $event->getOrder();\n if ($order->getType() === OrderTypes::TYPE_CART) {\n $this->provider->clearCart();\n }\n }",
"public static function deleted($event, $args = array()){\n\n\t\t$id = $event['order_id'];\n\t\tif(!$id){\n\t\t\treturn;\n\t\t}\n\n\t\t$app = App::getInstance('zoo');\n\n\t\t// Cleaning up related orderhistories:\n\t\t$app->zoocart->table->orderhistories->removeByOrder($id);\n\n\t\t// Cleaning up orderitems:\n\t\t$app->zoocart->table->orderitems->removeByOrder($id);\n\t}",
"public function deleted(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"public function handle(EntryDeleted $event)\n {\n if ($event->entry->collection()->handle() !== 'products') {\n return;\n }\n\n $this->deleteVariants($event);\n }",
"public function afterDelete($event)\n {\n $this->emit(\"delete\");\n }",
"public function forceDeleted(Order $order)\n {\n //\n }",
"public function forceDeleted(Order $order)\n {\n //\n }",
"public function onDelete($event);",
"public function deleted(WechatPayOrder $wechatPayOrder)\n {\n //\n }",
"public function on_delete() {}",
"protected function onDelete(): Delete\r\n {\r\n }",
"public function orderPositionDeleteAction() {\n $post = $this->post;\n if (!Arr::get($post, 'id')) {\n $this->error();\n }\n if (!Arr::get($post, 'catalog_id')) {\n $this->error();\n }\n $res = DB::delete('orders_items')\n ->where('order_id', '=', Arr::get($post, 'id'))\n ->where('catalog_id', '=', Arr::get($post, 'catalog_id'))\n ->where('size_id', '=', Arr::get($post, 'size_id'))\n ->execute();\n if ($res) {\n Common::factory('orders')->update(['changed' => 1], Arr::get($post, 'id'));\n }\n $this->success([\n 'msg' => __('Позиция удалена!'),\n ]);\n }",
"public static function deleted($callback)\n {\n static::registerModelEvent('deleted', $callback);\n }",
"protected function onPostDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnPost'.$this->string()->ucwords($event).'Delete';\n\t\t\t$this->fire($event,[$this->id]);\n\t\t}\n\t}",
"public function onDelete()\n {\n }",
"public function delete_order()\n {\n if ($this->checkLogin('A') == '') {\n redirect('admin_ror');\n } else {\n $order_id = $this->uri->segment(4, 0);\n $condition = array('id' => $order_id);\n $old_order_details = $this->order_model->get_all_details(PRODUCT, array('id' => $order_id));\n $this->update_old_list_values($order_id, array(), $old_order_details);\n $this->update_user_order_count($old_order_details);\n $this->order_model->commonDelete(PRODUCT, $condition);\n $this->setErrorMessage('success', 'Order deleted successfully');\n redirect('admin/order/display_order_list');\n }\n }",
"protected function afterDelete()\n {\n }",
"public function deleted(Event $event)\n {\n $event->update(['status' => 0]);\n }",
"public static function deleted($callback): void\n {\n static::registerModelEvent('deleted', $callback);\n }",
"public function forceDeleted(Event $event)\n {\n //\n }",
"public function deleteOrder($order_id)\n {\n $input = Request::all();\n\n //path params validation\n\n\n //not path params validation\n\n return response('How about implementing deleteOrder as a DELETE method ?');\n }",
"public function forceDeleted(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"protected function onAfterDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnAfter'.$this->string()->ucwords($event).'Delete';\n\t\t\t$this->fire($event,[$this->id]);\n\t\t}\n\t}",
"public static function coreEventHandlerEventDelete($eh, $post_id) {\n\t\t\t#do something before event deletion\n\t\t}",
"protected function _afterDelete()\r\n\t{}",
"function ordDeleteOrder( $orderID )\n{\n $q = db_query( \"select statusID from \".ORDERS_TABLE.\" where orderID=\".(int)$orderID );\n $row = db_fetch_row( $q );\n if ( $row[\"statusID\"] != ostGetCanceledStatusId() ) return;\n db_query( \"delete from \".ORDERED_CARTS_TABLE.\" where orderID=\".(int)$orderID);\n db_query( \"delete from \".ORDERS_TABLE.\" where orderID=\".(int)$orderID);\n db_query( \"delete from \".ORDER_STATUS_CHANGE_LOG_TABLE.\" where orderID=\".(int)$orderID);\n}",
"public function destroy(order $order)\n {\n //\n }",
"public function destroy(order $order)\n {\n //\n }",
"public function destroy(order $order)\n {\n //\n }"
] | [
"0.7829415",
"0.73453736",
"0.73410296",
"0.7194059",
"0.68130773",
"0.67633957",
"0.67414534",
"0.67414534",
"0.67102253",
"0.6627821",
"0.6514958",
"0.6511759",
"0.64991677",
"0.6467773",
"0.6443541",
"0.6419969",
"0.64184797",
"0.64166886",
"0.63762105",
"0.6364871",
"0.63405955",
"0.63340414",
"0.63154966",
"0.62808317",
"0.62740195",
"0.62734354",
"0.62710834",
"0.6256383",
"0.6256383",
"0.6256383"
] | 0.76947147 | 1 |
Handle the order "restored" event. | public function restored(Order $order)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function restored(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"public function restored(Event $event)\n {\n //\n }",
"public function onPostStateChange(OrderEvent $event)\n {\n $order = $event->getOrder();\n $cart = $this->provider->getCart();\n if ($order->getId() === $cart->getId() && $order->getType() !== OrderTypes::TYPE_CART) {\n $this->provider->clearCart();\n }\n }",
"public function restored(WechatPayOrder $wechatPayOrder)\n {\n //\n }",
"public function restore(ThreadWasRestored $event)\n {\n if ($event->thread->firstPost ) {\n $event->thread->firstPost->restore();\n event(new PostWasRestored($event->thread->firstPost));\n }\n }",
"public function restore(Order $order): RedirectResponse\n {\n $order->restore();\n\n return Redirect::back()\n ->with('message', __('The order has been restored.'));\n }",
"public function restored(Cart $cart)\n {\n //\n }",
"public function restored(Employee $employee)\n {\n event(new EmployeeUpdated($employee, \"restore\"));\n }",
"public function orderCompleteHandler(Event $event)\n {\n /** @var Market_OrderModel $order */\n $order = $event->params['order'];\n\n foreach ($order->lineItems as $lineItem) {\n /** @var Market_VariantRecord $record */\n $record = Market_VariantRecord::model()->findByAttributes(['id' => $lineItem->purchasableId]);\n if (!$record->unlimitedStock) {\n $record->stock = $record->stock - $lineItem->qty;\n $record->save(false);\n }\n }\n }",
"public function restored(Recordable $model): void\n {\n Accountant::record($model, 'restored');\n\n // Once the event terminates, the state is reverted\n static::$restoring = false;\n }",
"public function handleOrderSaveAfter(Varien_Event_Observer $observer)\n {\n /* @var $order Mage_Sales_Model_Order */\n $order = $observer->getEvent()->getOrder();\n\n $session = Mage::getSingleton('customer/session');\n\n if (!$session->getData('abandonment_flag')) {\n return;\n }\n\n /* @var $orderFlag Emailvision_Abandonment_Model_Orderflag */\n $orderFlag = Mage::getModel('abandonment/orderflag')->loadByOrderId($order->getId());\n\n if (!$orderFlag->getId()) {\n $orderFlag->setEntityId($order->getId());\n $orderFlag->setFlag($session->getData('abandonment_flag'));\n $orderFlag->setFlagDate($session->getData('abandonment_date'));\n $orderFlag->save();\n }\n\n $session->unsetData('abandonment_flag');\n $session->unsetData('abandonment_date');\n }",
"public function restored(Stock_producto $stockProducto)\n {\n //\n }",
"public function restored(Invoice $invoice)\n {\n //\n }",
"public function restored(TradeActivityDetail $tradeActivityDetail)\n {\n //\n }",
"public function afterOrderCancel($order)\n {\n $this->order->cancel(['order' => $order]);\n }",
"public function restored(Reaction $reaction)\n {\n //\n }",
"public function handleQuoteSaveAfter(Varien_Event_Observer $observer)\n {\n /* @var $order Mage_Sales_Model_Quote */\n $quote = $observer->getEvent()->getQuote();\n if ($quote instanceof Mage_Sales_Model_Quote) {\n $session = Mage::getSingleton('customer/session');\n // if customer is logged in and he has some products inside cart\n if ($session->isLoggedIn() && $quote->getItemsCount() && $quote->getId()) {\n if (!$session->getData('abandonment_reset_flag')) {\n try {\n Mage::helper('abandonment')->resetReminderForQuote($quote);\n } catch (Exception $e) {\n Mage::logException($e);\n }\n $session->setData('abandonment_reset_flag', 1);\n }\n }\n }\n }",
"public function restoring(ordenes $ordenes)\n {\n //code...\n }",
"public function restore(User $user, WorkOrder $workOrder)\n {\n //\n }",
"public function restored(ordenes $ordenes)\n {\n //code...\n }",
"public function restored(Transaction $transaction)\n {\n //\n }",
"public function restored(Transaction $transaction)\n {\n //\n }",
"public function restored(Transaction $transaction)\n {\n //\n }",
"public function restore($oldcart);",
"public function restored(Review $entity)\n {\n ReviewRestoredEvent::dispatch($entity);\n }",
"public function restoring(Recordable $model): void\n {\n // This event triggers others that should be ignored, so we track\n // the original to avoid creating unnecessary Ledger records\n static::$restoring = true;\n }",
"public function restored(Events $events)\n {\n //\n }",
"protected function restoreState() : void\n {\n /** Load State from save file */\n try {\n $savedState = $this->saveStateHandler->loadState();\n } catch (RuntimeException $ex) {\n $this->logger->critical($ex->getMessage());\n exit(1);\n }\n $restoring = $savedState !== false;\n\n if ($restoring) {\n try {\n $this->setState($savedState['scheduler']);\n $this->engine->setState($savedState['engine']);\n } catch (Exception $ex) {\n $this->logger->emergency(\"A fatal exception was thrown while loading previous saved state.\", ['exception' => $ex]);\n exit(-1);\n }\n $this->logger->debug(\"Successfully loaded from saved state\");\n }\n unset($savedState);\n\n /** Force a run of the PHP GC and release caches. This helps clear out memory consumed by restoring state from a large json file */\n $this->memoryReclaim();\n\n /** Inject some synthetic events in to the engine to flag that the engine is starting for the first time or restoring\n * Rules can handle these events for initialisation purposes (handy for setting up rules that detect when an event is missing)\n */\n $this->loop->futureTick(function() use ($restoring) {\n $event = $restoring ? new Event(['event' => static::CONTROL_MSG_RESTORED_STATE]) : new Event(['event' => static::CONTROL_MSG_NEW_STATE]);\n\n /**\n * Pass the event to the engine to be handled\n */\n $this->engine->handle($event);\n\n /**\n * If we are running in real time then schedule a timer for the next timeout\n */\n if ($this->engine->isRealtime()) {\n $this->scheduleNextTimeout();\n }\n });\n }",
"public function restored(Product $product)\n {\n //\n }",
"public function restored($model)\n {\n //this is a record restore\n $newData = [];\n $oldData = [];\n\n $event = \"restored\";\n $activity = \"Restored a record.\";\n\n if(array_key_exists(\"deleted_by\", $model->getAttributes()))\n {\n $columns = [\"deleted_by\" => null];\n $query = $model->newQueryWithoutScopes()->where($model->getKeyName(), $model->getKey());\n\n $query->update($columns);\n }\n\n $this->recordActivity($model, $event, $oldData, $newData, $activity);\n }"
] | [
"0.6921158",
"0.65984803",
"0.6392263",
"0.6373081",
"0.62986153",
"0.61847085",
"0.6083651",
"0.60704756",
"0.5986659",
"0.5943166",
"0.5873679",
"0.5740157",
"0.5736646",
"0.57216275",
"0.5705784",
"0.570062",
"0.5696001",
"0.56558853",
"0.5654807",
"0.5623608",
"0.56146955",
"0.56146955",
"0.56146955",
"0.561271",
"0.5599717",
"0.559807",
"0.55869126",
"0.55700743",
"0.556825",
"0.5563092"
] | 0.7441134 | 1 |
Handle the order "force deleted" event. | public function forceDeleted(Order $order)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleted(Order $order)\n {\n //\n }",
"public function deleted(Order $order)\n {\n\n }",
"public function forceDeleted(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"public function forceDeleted(WechatPayOrder $wechatPayOrder)\n {\n //\n }",
"public function onPostDelete(OrderEvent $event)\n {\n $order = $event->getOrder();\n if ($order->getType() === OrderTypes::TYPE_CART) {\n $this->provider->clearCart();\n }\n }",
"public function forceDeleted(Event $event)\n {\n //\n }",
"protected function _beforeDelete()\r\n\t{}",
"protected function afterDelete()\n {\n }",
"public static function deleted($event, $args = array()){\n\n\t\t$id = $event['order_id'];\n\t\tif(!$id){\n\t\t\treturn;\n\t\t}\n\n\t\t$app = App::getInstance('zoo');\n\n\t\t// Cleaning up related orderhistories:\n\t\t$app->zoocart->table->orderhistories->removeByOrder($id);\n\n\t\t// Cleaning up orderitems:\n\t\t$app->zoocart->table->orderitems->removeByOrder($id);\n\t}",
"protected function _afterDelete()\r\n\t{}",
"public function deleted(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"protected function onDelete(): Delete\r\n {\r\n }",
"protected function beforeDelete()\n {\n }",
"public function on_delete() {}",
"public function afterDelete()\n {\n }",
"function ordDeleteOrder( $orderID )\n{\n $q = db_query( \"select statusID from \".ORDERS_TABLE.\" where orderID=\".(int)$orderID );\n $row = db_fetch_row( $q );\n if ( $row[\"statusID\"] != ostGetCanceledStatusId() ) return;\n db_query( \"delete from \".ORDERED_CARTS_TABLE.\" where orderID=\".(int)$orderID);\n db_query( \"delete from \".ORDERS_TABLE.\" where orderID=\".(int)$orderID);\n db_query( \"delete from \".ORDER_STATUS_CHANGE_LOG_TABLE.\" where orderID=\".(int)$orderID);\n}",
"public function forceDeleted(Reaction $reaction)\n {\n //\n }",
"protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t}",
"protected function _postDelete()\n\t{\n\t}",
"public function afterDelete($event)\n {\n $this->emit(\"delete\");\n }",
"public function delete_order()\n {\n if ($this->checkLogin('A') == '') {\n redirect('admin_ror');\n } else {\n $order_id = $this->uri->segment(4, 0);\n $condition = array('id' => $order_id);\n $old_order_details = $this->order_model->get_all_details(PRODUCT, array('id' => $order_id));\n $this->update_old_list_values($order_id, array(), $old_order_details);\n $this->update_user_order_count($old_order_details);\n $this->order_model->commonDelete(PRODUCT, $condition);\n $this->setErrorMessage('success', 'Order deleted successfully');\n redirect('admin/order/display_order_list');\n }\n }",
"public function afterDelete() { return true; }",
"public function deleted(WechatPayOrder $wechatPayOrder)\n {\n //\n }",
"public function before_delete() {\n\t}",
"public function onDelete()\n {\n }",
"protected function onPostDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnPost'.$this->string()->ucwords($event).'Delete';\n\t\t\t$this->fire($event,[$this->id]);\n\t\t}\n\t}",
"public function orderPositionDeleteAction() {\n $post = $this->post;\n if (!Arr::get($post, 'id')) {\n $this->error();\n }\n if (!Arr::get($post, 'catalog_id')) {\n $this->error();\n }\n $res = DB::delete('orders_items')\n ->where('order_id', '=', Arr::get($post, 'id'))\n ->where('catalog_id', '=', Arr::get($post, 'catalog_id'))\n ->where('size_id', '=', Arr::get($post, 'size_id'))\n ->execute();\n if ($res) {\n Common::factory('orders')->update(['changed' => 1], Arr::get($post, 'id'));\n }\n $this->success([\n 'msg' => __('Позиция удалена!'),\n ]);\n }",
"public function forceDeleted(Deal $deal)\n {\n //\n }",
"public function beforeDelete(): void\n {\n }",
"public function forceDeleted(Invoice $invoice)\n {\n //\n }"
] | [
"0.75437367",
"0.75219274",
"0.728617",
"0.71539724",
"0.7022855",
"0.6964102",
"0.6872238",
"0.67600065",
"0.67516464",
"0.67152834",
"0.6706227",
"0.6586495",
"0.6568754",
"0.6531555",
"0.65250796",
"0.6460061",
"0.64102376",
"0.6402611",
"0.6386175",
"0.637151",
"0.63448906",
"0.63421494",
"0.6333956",
"0.63143486",
"0.6307744",
"0.62987834",
"0.62879795",
"0.62827224",
"0.6280109",
"0.6269202"
] | 0.7843557 | 1 |
Specify the call score. This is of type integer. Use a range of 15 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. | public function setCallScore(int $callScore): self
{
$this->options['callScore'] = $callScore;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setScore(int $score): void\n {\n $this->_score = $score;\n }",
"public function setScore($nr, $score)\n {\n }",
"public function setScore (int $score)\r\n {\r\n $this->color = $score;\r\n }",
"function score ($phone_number, $ucid, array $other = []) {\n return $this->get(sprintf(self::PHONEID_SCORE_RESOURCE, $phone_number), array_merge($other, [\n \"ucid\" => $ucid\n ]));\n }",
"public function score($choice): int\n {\n\n $currentRolls = $this->players[$this->currentPlayer]->getLastRoll();\n $rollsHistogram = $this->arrayToHist($currentRolls);\n $score = 0;\n\n switch ($choice) {\n case \"onlyOnes\":\n $score = $this->onlyN($rollsHistogram, 1);\n break;\n case \"onlyTwos\":\n $score = $this->onlyN($rollsHistogram, 2);\n break;\n case \"onlyThrees\":\n $score = $this->onlyN($rollsHistogram, 3);\n break;\n case \"onlyFours\":\n $score = $this->onlyN($rollsHistogram, 4);\n break;\n case \"onlyFives\":\n $score = $this->onlyN($rollsHistogram, 5);\n break;\n case \"onlySixes\":\n $score = $this->onlyN($rollsHistogram, 6);\n break;\n case \"yatzy\":\n $score = $this->yatzy($rollsHistogram);\n break;\n case \"Chance\":\n $score = $this->chance($rollsHistogram);\n break;\n case \"onePair\":\n $score = $this->onePair($rollsHistogram);\n break;\n case \"twoPair\":\n $score = $this->twoPair($rollsHistogram);\n break;\n case \"threes\":\n $score = $this->threes($rollsHistogram);\n break;\n case \"fourths\":\n $score = $this->fourths($rollsHistogram);\n break;\n case \"smallLadder\":\n $score = $this->smallLadder($rollsHistogram);\n break;\n case \"bigLadder\":\n $score = $this->bigLadder($rollsHistogram);\n break;\n case \"fullHouse\":\n $score = $this->fullHouse($rollsHistogram);\n break;\n default:\n $choice = explode(\" \", $choice);\n $this->players[$this->currentPlayer]->setScore($score, $choice[1]);\n $this->newRound();\n return 1;\n }\n\n // add $score to gamestats\n if ($score == 0) {\n // set message: cant do that\n $this->data[\"message\"] = \"That choice does not give any score.\";\n return 0;\n }\n\n if ($this->players[$this->currentPlayer]->setScore($score, $choice)) {\n $this->newRound();\n return 1;\n }\n\n $this->data[\"message\"] = \"That choice does not give any score.\";\n return 1;\n }",
"public function setScore($score)\n {\n $this->score = $score;\n }",
"public function score(): int\n {\n $score = 0;\n $previousRoll = 0;\n $addSpareBonus = false;\n\n foreach ($this->frames as $index => $frameScore) {\n $score += $addSpareBonus ? $frameScore * 2 : $frameScore;\n $addSpareBonus = false;\n if (($index + 1) % 2 === 0) {\n $addSpareBonus = $frameScore + $previousRoll === 10;\n }\n $previousRoll = $frameScore;\n }\n\n return $score;\n }",
"function score($num){\r\n $leve = intval($num/10);\r\n switch($leve){\r\n case 10;\r\n case 9;\r\n return \"A\";\r\n break;\r\n case 8 ;\r\n return\"B\";\r\n break;\r\n case 7;\r\n return\"C\";\r\n break;\r\n case 6;\r\n return\"D\";\r\n break;\r\n case 5;\r\n return\"E\";\r\n break;\r\n case 4;\r\n return\"F\";\r\n break;\r\n default :\r\n return \"Failed\";\r\n break;\r\n }\r\n}",
"public function addScore(int $score)\n {\n $this->score += $score;\n }",
"function getTopScore (){\nreturn 4;\n}",
"public function getScore();",
"function score()\n {\n access::ensure(\"scoring\");\n $achid = vsql::retr(\"SELECT id FROM achievements WHERE deleted = 0 AND \" . vsql::id_condition($_REQUEST[\"id\"], \"ground\"));\n insider_achievements::score(array_keys($achid));\n }",
"public function setIDRScore($idrScore){\n\t\t$this->idrScore = $idrScore;\n\t}",
"public function setScore($score) {\n $this->score = $score;\n $this->toSave['score'] = $score;\n }",
"public function getScoreAttribute($value): int\n {\n if (is_int($value) && $value >= 0) {\n return $value;\n }\n\n return 0;\n }",
"function updateScore() {\n\t\t\n\t}",
"function AttribuerScore($distance,$bio,$saison){\n $note_origine=0;\n $note_bio=0;\n $note_saison=0;\n $score=0;\n\n\n if($distance >= \"0\"){\n if ($distance <\"0\") {\n echo 'error';\n }\n elseif ($distance < \"51\") {\n $note_origine =20;\n }\n elseif ($distance < \"351\"){\n $note_origine =18;\n }\n elseif($distance < \"751\"){\n $note_origine =16;\n }\n elseif($distance < \"1501\"){\n $note_origine =14;\n }\n elseif($distance < \"2501\"){\n $note_origine =12;\n }\n elseif($distance < \"3501\"){\n $note_origine =10;\n }\n elseif($distance < \"5001\"){\n $note_origine =8;\n }\n elseif($distance < \"7001\"){\n $note_origine =6;\n }\n elseif($distance < \"10001\"){\n $note_origine =4;\n }\n elseif($distance < \"12001\"){\n $note_origine =2;\n }\n elseif($distance < \"15001\"){\n $note_origine = 0;\n }\n };\n\n if($bio == \"0\"){\n $note_bio=0;\n }\n elseif ($bio==\"1\") {\n $note_bio=10;\n };\n\n if($saison == \"Pas_de_saison\"){\n $note_saison=0;\n }\n elseif ($saison==\"De_saison\") {\n $note_saison=10;\n };\n\n if ($score > 10){\n $score = 10;\n \n }\n\n $score = (($note_origine + $note_bio + $note_saison)/4);\n return $score;\n}",
"function matchSetScore($admlogin, $playerlogin, $score){\n\tglobal $_debug,$_match_scores,$_match_conf,$_match_map;\n\t\n\tif($_match_map < 1 || !isset($_match_scores[$playerlogin]) || $score < 0 || $score < $_match_scores[$playerlogin]['ScoreBonus'])\n\t\treturn;\n\n\t// set score\n\tconsole(\"matchSetScore: set score to {$playerlogin} ({$score})\");\n\t$_match_scores[$playerlogin]['Score'] = $score;\n\t$scores = array(array('PlayerId'=>$_match_scores[$playerlogin]['PlayerId'],\n\t\t\t\t\t\t\t\t\t\t\t\t'Score'=>$_match_scores[$playerlogin]['Score']));\n\taddCall($admlogin,'ForceScores',$scores,true);\n\tdebugPrint(\"matchSetScore::scores\",$scores);\n\t\n\t// sort scores list\n\tmatchSortMatchScores();\n\t\n\t$nick = $_match_scores[$playerlogin]['NickDraw2'];\n\t$msg = localeText(null,'server_message').localeText(null,'interact').\" \\$o\\$88fScore for {$nick} : {$score}\";\n\t// send message in offical chat\n\taddCall(null,'ChatSendServerMessage', $msg);\n\n\t//debugPrint(\"matchSetScore - _match_scores\",$_match_scores);\n}",
"public function setMaxScore($value)\n {\n $this->setProperty(\"MaxScore\", $value, true);\n }",
"public function getScore() {\n return $this->score;\n }",
"public function getScore ()\r\n {\r\n return $this->score;\r\n }",
"public function incrementScore() : game;",
"public function score(){\n\t\treturn $this->score;\n\t}",
"public function SetLeaderboardScore($sLeaderboardId, $sScore, $sScoreMethod, $rDetails = null, $sSteamid = null) {\n if ($sSteamid == null) {\n $sSteamid = $this->steamid;\n }\n $aOptions = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query(array('key' => $this->key, 'appid' => (int) $this->game, 'leaderboardid' => $sLeaderboardId, 'steamid' => $sSteamid, 'score' => $sScore, 'scoremethod' => $sScoreMethod, 'details' => $rDetails))\n )\n );\n $cContext = stream_context_create($aOptions);\n $fgcSetLeaderboardScore = file_get_contents(\"https://partner.steam-api.com/ISteamLeaderboards/SetLeaderboardScore/v1/\", false, $cContext);\n $oSetLeaderboardScore = json_decode($fgcSetLeaderboardScore);\n\n\n return $oSetLeaderboardScore->result;\n }",
"public function score()\n {\n// return 0;\n $score = 0;\n $roll = 0;\n\n foreach (range(1, self::FRAMES_PER_GAME) as $frame) {\n // check for a strike\n if ($this->isStrike($roll)) {\n// $score += $this->rolls[$roll] + $this->strikeBonus($roll);\n $score += $this->pinCount($roll) + $this->strikeBonus($roll);\n // strike bonus\n// $score += $this->rolls[$roll];\n// // strike bonus\n// $score += $this->strikeBonus($roll);\n\n $roll++;\n\n continue;\n }\n\n $score += $this->defaultFrameScore($roll);\n\n // check for a spare\n if ($this->isSpare($roll)) {\n // you got a spare\n// $score += $this->defaultFrameScore($roll);\n// $score += $this->spareBonus($roll);\n $score += $this->spareBonus($roll);\n }\n\n $roll += 2;\n }\n\n return $score;\n// return array_sum($this->rolls);\n }",
"public function calculateScore()\n {\n // \n $this->score = 0;\n $multiplier = 0;\n \n // if the current price is above a minimum price\n if(isset($this->current_price) && ($this->current_price >= $this->min_current_price)) {\n $price_divider = round(($this->current_price / $this->min_current_price));\n $this->score = $this->score + $price_divider; \n }\n \n // if the bid count is above a minimum bid count\n if(isset($this->bid_count) && ($this->bid_count >= $this->min_bid_count)) {\n $bid_count_divider = round(($this->bid_count / $this->min_bid_count));\n $this->score = $this->score + $bid_count_divider;\n }\n \n // if the feedback score is above a minimum feedback score\n if(isset($this->feedback_score) && ($this->feedback_score >= $this->min_feedback_score)) {\n $feedback_score_divider = round(($this->feedback_score / $this->min_feedback_score));\n $this->score = $this->score + $feedback_score_divider;\n }\n \n return $this->score;\n }",
"public function getIDRScore(){\n\t\treturn $this->idrScore;\n\t}",
"public function setScore( float $score ) {\n $this->score = $score;\n return $this;\n }",
"public function getScore() { return $this->_score; }",
"public function getScore()\n {\n $ipLkup = $this->get('ipLkup', ['ip' => $this->ip]);\n\n $score = $ipLkup['response'][$this->ip];\n\n if ($score) {\n return (string) $score;\n } else {\n return 'unknown';\n }\n }"
] | [
"0.6015222",
"0.6011947",
"0.5990738",
"0.5971785",
"0.5816038",
"0.5739453",
"0.57321227",
"0.5699894",
"0.5684937",
"0.56511146",
"0.55925417",
"0.5551165",
"0.54674214",
"0.54491377",
"0.54407805",
"0.5391021",
"0.53617877",
"0.5359779",
"0.5315827",
"0.5306096",
"0.5293354",
"0.52865624",
"0.52633154",
"0.52516675",
"0.52426267",
"0.5227509",
"0.51868546",
"0.517466",
"0.51622826",
"0.5156143"
] | 0.7543752 | 0 |
Creates a new Route model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new Route();
$d_boys = Staff::find()
->innerJoinWith('users', 'Staff.user_id = Users.id')
->andWhere(['user.status' => User::STATUS_ACTIVE])
->andWhere(['user.role' => Role::getRole('DELIVERY BOY')])
->all();
$status = DefaultSetting::find()->where(['type'=>'price'])->all();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['index']);
} else {
return $this->render('create', [
'model' => $model,
'status' => $status,
'd_boys' =>$d_boys
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new Reservacion();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \\Yii::$app->session->addFlash('success', 'Успех! Приступите к заполнению данных по квартирам.');\n //var_dump($model->id);die;\n\n return $this->redirect(['filling', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new Resource();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new Restaurant();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->IDRestaurant]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n $model = new vm();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->vm_host_name]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new BaseStation();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Order();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Order();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Request();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Dashboard;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new ActivityDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(Yii::$app->request->getReferrer());\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Area();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Objects();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n return view('routes.create');\n }",
"public function actionCreate()\n {\n $model = new Task();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', ['model' => $model,]);\n }\n }",
"public function actionCreate()\n {\n $model = new Order();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Comment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Area();\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('/addres/area/create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Action();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n return view('routes.create');\n }",
"public function create()\n {\n return view('routes.create');\n }",
"public function actionCreate()\r\n {\r\n $model = new CrmVisitPlan();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->svp_planID]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new Golfer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Udashboard();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->recid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n $form = $this->form;\n $route = $this->route;\n return view($this->rCreate,compact('form','route'));\n }",
"public function actionCreate() {\n $model = new Forms();\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post())) {\n $model->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n $vehicleTypes= VehicleType::all();\n $routes= Route::all();\n return view('admin.trip.tripCreate',compact('routes','vehicleTypes'));\n }",
"public function actionCreate()\n {\n//\n// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n// try {\n// $model->save();\n// Yii::$app->session->setFlash('alert', [\n// 'body' => Yii::$app->params['create-success'],\n// 'class' => 'bg-success',\n// ]);\n// } catch (\\yii\\db\\Exception $exception) {\n Yii::$app->session->setFlash('alert', [\n 'body' => Yii::$app->params['create-danger'],\n 'class' => 'bg-danger',\n ]);\n// }\n return $this->redirect(['index']);\n// }\n\n// return $this->render('create', [\n// 'model' => $model,\n// ]);\n }",
"public function actionCreate()\n {\n $model = new ScheduleItem();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n return view('api_routes.create');\n }"
] | [
"0.64042103",
"0.63893974",
"0.6379141",
"0.63696784",
"0.63319695",
"0.6324556",
"0.63062197",
"0.63062197",
"0.62865657",
"0.62618756",
"0.62599254",
"0.6250353",
"0.6201765",
"0.619412",
"0.618934",
"0.6187619",
"0.61825967",
"0.6173299",
"0.6153537",
"0.6150676",
"0.6150676",
"0.6142391",
"0.612913",
"0.6115331",
"0.6106676",
"0.6091501",
"0.6087207",
"0.60868734",
"0.6081299",
"0.6072994"
] | 0.6696515 | 0 |
Finds the Route model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = Route::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function find($key): ?Model;",
"protected function findModel($item_id)\n\t{\n\t\tif (($model = SapItem::findOne($item_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id) {\n\t\tif (($model = ServiceMapping::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"protected function findModel($id)\n {\n if (($model = CmsRoute::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function getRouteById($id)\n {\n if (is_integer($id) === false) {\n throw new Exception('Invalid parameter type.');\n }\n\n foreach ($this->_routes as $route) {\n if ($route->getRouteId() === $id) {\n return $route;\n }\n }\n\n return false;\n }",
"protected function findModel($id)\n {\n if (($model = ScheduleItem::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"public function getRoute()\n {\n foreach ($this->routes as $route) {\n\n // Is the route array valid\n if (false == ($cleansed = $this->isValidRoute($route))) {\n continue;\n }\n\n $route = $cleansed;\n\n // Does request method match\n if (!$this->methodMatches($route)) {\n continue;\n }\n\n if (false === $this->isAllowedByIp($route)) {\n continue;\n }\n\n if (false === $this->isAllowedByRole($route)) {\n // @codeCoverageIgnoreStart\n continue;\n // @codeCoverageIgnoreEnd\n }\n\n if (false != ($match = $this->isDirectMatch($route))) {\n return $match;\n }\n\n if (false != ($match = $this->isParameterisedMatch($route))) {\n return $match;\n }\n }\n\n $e = new RouteNotFoundException('Route for path not found.');\n $e->setAdditionalData('Path: ', $this->path);\n throw $e;\n }",
"protected function findModel($id) {\n if (($model = Was16a::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function findRoute() {\n $result = null;\n\n if(!empty($this->map)) {\n\n foreach ($this->map as $name => $routeData) {\n $path = $routeData['path'];\n $pattern = $this->transformToRegexp($path);\n if(preg_match($pattern, $this->request->getUri(), $matches)) {\n $method = $this->request->getMethod();\n\n if(($method != 'OPTIONS') && (!empty($routeData['method']) &&\n $method != strtoupper($routeData['method']))) {\n\n continue;\n }\n\n $result = $routeData;\n $result['params'] = $this->parseParams($path);\n $result = new Route($result);\n\n break;\n }\n }\n }\n\n return $result;\n }",
"public function find(int $id): ?Model;",
"public function getRoute($id);",
"protected function findModel($id) {\n\t\tif (($model = Beaches::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}",
"public function loadModel($id) {\n $model = Host::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function setModelInstanceFromCurrentRoute()\n {\n try {\n $route = Route::getRoutes()->match(request());\n } catch (HttpException $e) {\n return;\n }\n\n if (! $route) {\n return;\n }\n\n $search = str_replace('.', '_', Config::getKey(static::class));\n\n foreach ($route->parameters as $parameter => $id) {\n if ($parameter != $search) {\n continue;\n }\n\n try {\n $this->modelInstance = $this->controllerInstance()\n ->getQuery()\n ->find($id);\n } catch (ErrorException $e) {\n //\n }\n\n break;\n }\n }",
"protected function findModel($id)\n {\n \tif (($model = Constancia::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new NotFoundHttpException('The requested page does not exist.');\n \t}\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = AuthItem::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}",
"public function loadModel($ID) {\r\n $model = Timesheet::model()->findByPk($ID);\r\n if ($model === null)\r\n throw new CHttpException(404, Yii::t('site', 'The requested page does not exist.'));\r\n return $model;\r\n }",
"protected function findModel($id)\n {\n if (($model = ResourceManagement::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"public function lookup($path)\n\t{\n\t\tforeach ($this->_entries as $entry)\n\t\t{\n\t\t\tif ($match = $entry->getMatch($path))\n\t\t\t{\n\t\t\t\treturn $match;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Ergo_Routing_LookupException(\"No route matches path '$path'\");\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Location::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"protected function findModel($id) {\n if (($model = Farmers::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = RefDynamicTableName::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id) {\n $model = Spt::model()->findByPk($id);\n if ($model === null) {\n throw new CHttpException(404, Yii::t('trans', 'The requested page does not exist.'));\n }\n return $model;\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Premio::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n\t{\n\t\tif (($model = Office::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\r\n {\r\n if (($model = Resource::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }",
"public function loadModel($id)\n {\n $model = Akm::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = TicketComment::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n // if (($model = Employee::findOne($id)) !== null) {\n if (($model = Employee::find()->where(['slug' => $id])->one()) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n $modelClass = $this->di('Team');\n if (($model = $modelClass::findOne(is_numeric($id) ? ['id' => $id] : ['slug' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('team_backend', 'Team not found'));\n }\n }"
] | [
"0.6745384",
"0.6438835",
"0.63966894",
"0.6337929",
"0.62521803",
"0.6171427",
"0.61383086",
"0.613627",
"0.61005265",
"0.60951144",
"0.6086369",
"0.6080833",
"0.6048977",
"0.6047514",
"0.6039992",
"0.60325193",
"0.603127",
"0.6030714",
"0.6016648",
"0.60155183",
"0.6007761",
"0.6004348",
"0.5991364",
"0.598525",
"0.59846663",
"0.59793967",
"0.59790725",
"0.59751266",
"0.59718394",
"0.59634763"
] | 0.6519103 | 1 |
This method will scan the given transaction journal and check if it matches the triggers found in the Processor If so, it will also attempt to run the given actions on the journal. It returns a bool indicating if the transaction journal matches all of the triggers (regardless of whether the Processor could act on it). | public function handleTransactionJournal(TransactionJournal $journal): bool
{
$this->journal = $journal;
// get all triggers:
$triggered = $this->triggered();
if ($triggered) {
if ($this->actions->count() > 0) {
$this->actions();
}
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function triggered()\n {\n $foundTriggers = 0;\n $hitTriggers = 0;\n /** @var RuleTrigger $trigger */\n foreach ($this->triggers as $trigger) {\n $foundTriggers++;\n\n /** @var AbstractTrigger $trigger */\n if ($trigger->triggered($this->journal)) {\n $hitTriggers++;\n }\n if ($trigger->stopProcessing) {\n break;\n }\n\n }\n\n return ($hitTriggers == $foundTriggers && $foundTriggers > 0);\n\n }",
"private function containsSchemaUpdateAction($actions)\n {\n foreach ($actions as $action) {\n if (self::ACTION_NAME === $action['name']) {\n return true;\n }\n }\n\n return false;\n }",
"public function checkPermission($actions, $matchAll = false)\n\t{\n\t\tif (Auth::user()->roles->contains(\\BaseModel::ROLE_DEVELOPER)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!is_array($actions)) {\n\t\t\t$actions = array($actions);\n\t\t}\n\n\t\t$matchedActions = 0;\n\n\t\tif ($this->actions && $this->actions->count() > 0) {\n\t\t\t$userActions = $this->actions->keyName->toArray();\n\n\t\t\tforeach ($actions as $action) {\n\t\t\t\tif (in_array($action, $userActions)) {\n\t\t\t\t\tif (!$matchAll) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t$matchedActions++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($matchedActions) {\n\t\t\t\tif (count($actions) == $matchedActions) return true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function hasBulkActions()\n {\n foreach ($this->_actions as $actionName => $action) {\n if( $action['bulk_action'] ) return true;\n }\n return false;\n }",
"function execute()\n\t\t{\n\t\t\t$result = false;\n\n\t\t\tforeach($this->data as $action)\n\t\t\t{\n\t\t\t\tif(isset($action[\"attributes\"]) && isset($action[\"attributes\"][\"type\"])) {\n\t\t\t\t\t$store = $this->getActionStore($action);\n\t\t\t\t\t$parententryid = $this->getActionParentEntryID($action);\n\t\t\t\t\t$entryid = $this->getActionEntryID($action);\n\n\t\t\t\t\tswitch($action[\"attributes\"][\"type\"])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"search\":\n\t\t\t\t\t\t\t// get properties and column info\n\t\t\t\t\t\t\t$this->getColumnsAndPropertiesForMessageType($store, $entryid, $action);\n\t\t\t\t\t\t\t$result = $this->search($store, $entryid, $action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"updatesearch\":\n\t\t\t\t\t\t\t$result = $this->updatesearch($store, $entryid, $action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"stopsearch\":\n\t\t\t\t\t\t\t$result = $this->stopSearch($store, $entryid, $action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"delete\":\n\t\t\t\t\t\t\t$result = $this->delete($store, $parententryid, $entryid, $action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"delete_searchfolder\":\n\t\t\t\t\t\t\t$result = $this->deleteSearchFolder($store, $entryid, $action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"save\":\n\t\t\t\t\t\t\t$result = $this->save($store, $parententryid, $action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}",
"public function actionsExist();",
"public function matchesAction($action)\n {\n $action = (array) $action;\n return in_array($this->action,$action);\n }",
"public function can($actions): bool\n {\n if (is_array($actions)) {\n $reject = collect($actions)->map(function ($action, $key) {\n return $this->can($action);\n })->reject()->count();\n\n return ($reject == 0) ? true : false;\n }\n\n return Str::is($actions, $this->action) || Str::is($this->action, $actions);\n }",
"public function matchesAction($action)\n {\n return in_array($this->action, (array) $action);\n }",
"public function hasTransactions();",
"private function transactions_running() {\n\t\tforeach ($this->processes as $process) {\n\t\t\tif ($process->is_running()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function hasActions()\n {\n return ! empty($this->actions['table']);\n }",
"protected function IsTriggered()\n {\n return Request::MethodData($this->Method(), $this->triggerName) !== null;\n }",
"public function execute() {\n\t\t$this->error = false;\n\n\t\tforeach ( $this->commands as $key => $transaction ) {\n\t\t\t$done = false;\n\t\t\t$log_line = '';\n\n\t\t\tif ( count( $transaction ) < 1 ) {\n\t\t\t\t$done = false;\n\t\t\t} elseif ( ! is_callable( $transaction[0] ) ) {\n\t\t\t\t$done = false;\n\t\t\t} else {\n\t\t\t\t$func = array_shift( $transaction );\n\n\t\t\t\tif ( is_array( $func ) ) {\n\t\t\t\t\tif ( is_object( $func[0] ) ) {\n\t\t\t\t\t\t$log_line = get_class( $func[0] ) . '->';\n\t\t\t\t\t} elseif ( is_scalar( $func[0] ) ) {\n\t\t\t\t\t\t$log_line = $func[0] . '::';\n\t\t\t\t\t}\n\t\t\t\t\tif ( is_scalar( $func[1] ) ) {\n\t\t\t\t\t\t$log_line .= $func[1];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$log_line = $func;\n\t\t\t\t}\n\t\t\t\t$log_line .= '(' . json_encode( $transaction ) . ')';\n\n\t\t\t\ttry {\n\t\t\t\t\tcall_user_func_array( $func, $transaction );\n\t\t\t\t\t$done = true;\n\t\t\t\t} catch( Exception $ex ) {\n\t\t\t\t\t$this->set_error( $ex, $func );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $done ) {\n\t\t\t\t$this->log_action( $log_line );\n\t\t\t\tunset( $this->commands[$key] );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function can_be_run($action, $ref = '')\n\t{\n\t\t$times_run = DB::select()->from('kthrottler_logs')\n\t\t ->where('scope', '=', $action)\n\t\t ->and_where('reference', '=', $this->normalise_ref($ref))\n\t\t ->and_where('created_at', '>=', $this->datetime_since($this->actions[$action]['duration']))\n\t\t ->execute()\n\t\t ->count();\n\t\t\n\t\treturn $times_run < $this->actions[$action]['limit'] ? true : false;\n\t}",
"private function canProcess()\n {\n $lastExeBulkPush = $this->cronLogHelper->getBulkPush();\n $todayDate = new \\DateTime($this->dateTime->date(StdDateTime::DATE_PHP_FORMAT));\n $lastExecutedDate = new \\DateTime(\n $this->dateTime->date(\n StdDateTime::DATE_PHP_FORMAT,\n $lastExeBulkPush\n )\n );\n $diffDate = $todayDate->diff($lastExecutedDate);\n\n $todayDateTime = new \\DateTime($this->dateTime->date());\n $lastExecutedDateTime = new \\DateTime($lastExeBulkPush);\n $diffDateTime = $todayDateTime->diff($lastExecutedDateTime);\n\n if ($diffDate->d > 0 && $todayDateTime->format('H') == $this->configBatchHelper->getBatchFirstPushTime()) {\n return true;\n }\n\n if ($diffDate->d == 0 && $this->configBatchHelper->getBatchBulkPushFreq() == $diffDateTime->h) {\n return true;\n }\n\n return false;\n }",
"public function DispatchSaveLog(array $logs): bool;",
"public function hasTrigger($exclude = array())\n\t{\n\t\t$posted = array_keys($this->getPosted());\n\t\tforeach ($posted as $key)\n\t\t{\n\t\t\tif(!in_array($key, $exclude) && strpos($key, 'etrigger_') === 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function matchActions($actions, $authRequired = true)\n {\n if (in_array($this->getAction(), $actions)) {\n if ($authRequired and !$this->isAuthorized()) {\n throw new \\Exception(\"Unauthorized access\");\n }\n\n return true;\n }\n\n return false;\n }",
"function check_for_re_post() {\n\tglobal $db, $messageStack;\n\t$messageStack->debug(\"\\n Checking for re-post records ... \");\n\t$gl_type = NULL;\n\tswitch ($this->journal_id) {\n\t case 6: // Purchase/Receive Journal\n\t case 7: // Purchase Credit Memo Journal\n\t case 21: // Inventory Direct Purchase Journal\n\t case 12: // Sales/Invoice Journal\n\t case 13: // Sales Credit Memo Journal\n\t case 19: // POS Journal\n\t\t// Check for payments or receipts made to this record that will need to be re-posted.\n\t\t$sql = \"select ref_id from \" . TABLE_JOURNAL_ITEM . \" \n\t\t where so_po_item_ref_id = \" . $this->id . \" and gl_type in ('chk', 'pmt')\";\n\t\t$result = $db->Execute($sql);\n\t\twhile(!$result->EOF) {\n\t\t $messageStack->debug(\"\\n check_for_re_post is queing id = \" . $result->fields['ref_id']);\n\t\t $this->repost_ids[$result->fields['ref_id']] = $result->fields['ref_id'];\n\t\t $result->MoveNext();\n\t\t}\n\t\t$messageStack->debug(\" end Checking for Re-post.\");\n\t\tbreak;\n\t case 2: // General Journal\n\t case 3: // Purchase Quote Journal\n\t case 4: // Purchase Order Journal\n\t case 9: // Sales Quote Journal\n\t case 10: // Sales Order Journal\n\t case 14: // Inventory Assembly Journal\n\t case 16: // Inventory Adjustment Journal\n\t case 18: // Cash Receipts Journal\n\t case 20: // Cash Distribution Journal\n\t default: $messageStack->debug(\" end check for Re-post with no action.\");\n\t}\n return true;\n }",
"protected function doDatabaseTransactions()\n\t{\n\t\t$route = $this->route === 'discover_install' ? 'install' : $this->route;\n\n\t\t// Let's run the install queries for the component\n\t\tif (isset($this->getManifest()->{$route}->sql))\n\t\t{\n\t\t\t$result = $this->parent->parseSQLFiles($this->getManifest()->{$route}->sql);\n\n\t\t\tif ($result === false)\n\t\t\t{\n\t\t\t\t// Only rollback if installing\n\t\t\t\tif ($route === 'install')\n\t\t\t\t{\n\t\t\t\t\tthrow new \\RuntimeException(\n\t\t\t\t\t\t\\JText::sprintf(\n\t\t\t\t\t\t\t'JLIB_INSTALLER_ABORT_SQL_ERROR',\n\t\t\t\t\t\t\t\\JText::_('JLIB_INSTALLER_' . strtoupper($this->route)),\n\t\t\t\t\t\t\t$this->parent->getDbo()->stderr(true)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// If installing with success and there is an uninstall script, add an installer rollback step to rollback if needed\n\t\t\tif ($route === 'install' && isset($this->getManifest()->uninstall->sql))\n\t\t\t{\n\t\t\t\t$this->parent->pushStep(array('type' => 'query', 'script' => $this->getManifest()->uninstall->sql));\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public static function hasMatchingRecord(array $conditions, ?\\Closure $configurator = null): bool;",
"public function has_actions() {\n\t\treturn $this->has_filters();\n }",
"public function run($action, $ref = '')\n\t{\n\t\tif ($this->can_be_run($action, $ref))\n\t\t{\n\t\t\tDB::insert('kthrottler_logs', array('scope', 'reference', 'created_at'))\n\t\t\t ->values(array($action, $this->normalise_ref($ref), $this->datetime_since('now')))\n\t\t\t ->execute();\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function execute()\n {\n $successfullyExecuted = true;\n\n // do some init work...\n $this->initializeAction();\n\n // if a valid storagePid is given, only delete in this repository\n if (MathUtility::canBeInterpretedAsInteger($this->storagePid)) {\n // set storagePid to point extbase to the right repositories\n $configurationArray = [\n 'persistence' => [\n 'storagePid' => $this->storagePid,\n ],\n ];\n $this->configurationManager->setConfiguration($configurationArray);\n\n // start the work...\n // Get old emails to be deleted.\n $oldEmails = $this->emailRepository->findOlderThan($this->cleanupDays);\n foreach ($oldEmails AS $object) {\n // remove one by one\n $this->emailRepository->remove($object);\n }\n // persist the repository\n $this->persistenceManager->persistAll();\n } else {\n // delete old mails global\n $this->emailRepository->deleteOlderThan($this->cleanupDays);\n }\n\n return $successfullyExecuted;\n }",
"public function hasAlterations()\n {\n foreach($this->getModifications() as $modification) if ($this->getAffectedByReversion($modification)) return true;\n\n return false;\n }",
"public function canPublish() {\n\t\tif ($active = $this->getWorkflowInstance()) {\n\t\t\treturn $active->canPublishTarget($this->owner);\n\t\t}\n\n\t\t// otherwise, see if there's any workflows applied. If there are, then we shouldn't be able\n\t\t// to directly publish\n\t\tif ($effective = singleton('WorkflowService')->getDefinitionFor($this->owner)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"function run_triggers() {\n// 2. run those triggers that are activated.\n// 3. update locked pins (locked by triggers)\n\n$trigger2_go = false;\n$trigger4_go = false;\n$trigger5_go = false;\n$trigger6_go = false;\n$static_db = open_static_data_db(true);\n$results = $static_db->query('SELECT id FROM `triggers` where state = 1;');\nwhile ($row = $results->fetchArray()) {\n\t\t$trigger_id = $row['id'];\n\t\tif ($trigger_id == 2) $trigger2_go = true;\n\t\tif ($trigger_id == 4) $trigger4_go = true;\n\t\tif ($trigger_id == 5) $trigger5_go = true;\n \t\tif ($trigger_id == 6) $trigger6_go = true;\n\t\t\t//print (\"process trigger $trigger_id\");\n}\n$static_db->close();\n\nif ($trigger2_go) process_trigger_zavesana();\nif ($trigger4_go) ledusskapja_dzesesana();\nif ($trigger5_go) apkure();\nif ($trigger6_go) trigger_apkure_riits_vakars ();\n}",
"protected function doSecondaryActionDetection(string $action, object $object): bool\n {\n //====================================================================//\n // TRIGGER ACTION FOR : Address / Contact\n //====================================================================//\n return $this->doAddressSecondaryCommit($action, $object);\n }",
"public function hasChanges() {\r\n\t\tforeach ($this->ranges as $region => $rng) { //commit changes\r\n\t\t\t$changes = $rng->playChanges();\r\n\t\t\tif(!empty($changes)) return true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}"
] | [
"0.6128721",
"0.5444378",
"0.506196",
"0.50426805",
"0.48764214",
"0.4830039",
"0.47356677",
"0.46315876",
"0.46299616",
"0.4627607",
"0.46255547",
"0.4605533",
"0.45995426",
"0.45961085",
"0.45303923",
"0.4529863",
"0.45294395",
"0.44695345",
"0.44638476",
"0.4448864",
"0.4442554",
"0.4428503",
"0.4415079",
"0.4414253",
"0.4394123",
"0.43923485",
"0.4352442",
"0.43374798",
"0.43228677",
"0.43153208"
] | 0.69745445 | 0 |
Method to check whether the current transaction would be triggered by the given list of triggers | private function triggered()
{
$foundTriggers = 0;
$hitTriggers = 0;
/** @var RuleTrigger $trigger */
foreach ($this->triggers as $trigger) {
$foundTriggers++;
/** @var AbstractTrigger $trigger */
if ($trigger->triggered($this->journal)) {
$hitTriggers++;
}
if ($trigger->stopProcessing) {
break;
}
}
return ($hitTriggers == $foundTriggers && $foundTriggers > 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasTrigger()\n {\n return $this->trigger instanceof tx_t3socials_models_TriggerConfig;\n }",
"protected function IsTriggered()\n {\n return Request::MethodData($this->Method(), $this->triggerName) !== null;\n }",
"public function hasTrigger($exclude = array())\n\t{\n\t\t$posted = array_keys($this->getPosted());\n\t\tforeach ($posted as $key)\n\t\t{\n\t\t\tif(!in_array($key, $exclude) && strpos($key, 'etrigger_') === 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function check_evergreen_triggers() {\n\t\t/**\n\t\t * This only applies to evergreen campaigns - only fetch evergreen campaigns\n\t\t */\n\t\t$evergreen_campaigns = tve_ult_get_campaigns( array(\n\t\t\t'only_running' => true,\n\t\t\t'get_designs' => false,\n\t\t\t'get_events' => false,\n\t\t\t'campaign_type' => TVE_Ult_Const::CAMPAIGN_TYPE_EVERGREEN,\n\t\t\t'get_settings' => true,\n\t\t) );\n\t\tforeach ( $evergreen_campaigns as $campaign ) {\n\t\t\t//this will trigger any campaigns for which the current request acts as a trigger\n\t\t\t$campaign->tu_schedule_instance->applies();\n\t\t}\n\t}",
"public function getTriggers();",
"public function hasTransactions();",
"public function hasChanges() {\r\n\t\tforeach ($this->ranges as $region => $rng) { //commit changes\r\n\t\t\t$changes = $rng->playChanges();\r\n\t\t\tif(!empty($changes)) return true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"private function exactTargetTriggerControllers(ControllerCollection $controllers)\n {\n $controllers->get(\n '/triggers',\n 'Skyflow\\Controller\\TriggerController::triggersAction'\n )->bind('triggers');\n\n $controllers->match(\n '/createTrigger',\n 'Skyflow\\Controller\\TriggerController::createTriggerAction'\n )->bind('createTrigger');\n\n $controllers->match(\n '/send',\n 'Skyflow\\Controller\\TriggerController::sendTriggeredSendAction'\n )->bind('send');\n\n $controllers->match(\n '/trigger/{customerKey}',\n 'Skyflow\\Controller\\TriggerController::infoTriggeredSendAction'\n );\n }",
"public function hasAllowedTransitions()\n {\n return count($this->allowedTransitions) > 0;\n }",
"public function hasTransactions(): bool;",
"public function getContextualTriggers()\n {\n return $this->contextual_triggers;\n }",
"function run_triggers() {\n// 2. run those triggers that are activated.\n// 3. update locked pins (locked by triggers)\n\n$trigger2_go = false;\n$trigger4_go = false;\n$trigger5_go = false;\n$trigger6_go = false;\n$static_db = open_static_data_db(true);\n$results = $static_db->query('SELECT id FROM `triggers` where state = 1;');\nwhile ($row = $results->fetchArray()) {\n\t\t$trigger_id = $row['id'];\n\t\tif ($trigger_id == 2) $trigger2_go = true;\n\t\tif ($trigger_id == 4) $trigger4_go = true;\n\t\tif ($trigger_id == 5) $trigger5_go = true;\n \t\tif ($trigger_id == 6) $trigger6_go = true;\n\t\t\t//print (\"process trigger $trigger_id\");\n}\n$static_db->close();\n\nif ($trigger2_go) process_trigger_zavesana();\nif ($trigger4_go) ledusskapja_dzesesana();\nif ($trigger5_go) apkure();\nif ($trigger6_go) trigger_apkure_riits_vakars ();\n}",
"private function containsSchemaUpdateAction($actions)\n {\n foreach ($actions as $action) {\n if (self::ACTION_NAME === $action['name']) {\n return true;\n }\n }\n\n return false;\n }",
"public function hasBulkActions()\n {\n foreach ($this->_actions as $actionName => $action) {\n if( $action['bulk_action'] ) return true;\n }\n return false;\n }",
"public function getTriggers()\n {\n return $this->triggerNodes;\n }",
"function hasChanges(){\n\t\t\treturn $this->hasSectionChanges() || $this->hasCourseChanges();\n\t\t}",
"public function hasAlterations()\n {\n foreach($this->getModifications() as $modification) if ($this->getAffectedByReversion($modification)) return true;\n\n return false;\n }",
"protected function canExecute() {\r\n return !empty($this->operations);\r\n }",
"function checkUpdate()\n\t{\n\t\t$oModuleModel = &getModel('module');\n\t\t// 2007. 10. 17 posts deleted, even when the comments will be deleted trigger property\n\t\tif(!$oModuleModel->getTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after')) return true;\n\t\t// 2007. 10. 17 modules are deleted when you delete all registered triggers that add Trackbacks\n\t\tif(!$oModuleModel->getTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after')) return true;\n\t\t// 2007. 10. Yeokingeul sent from the popup menu features 18 additional posts\n\t\tif(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) return true;\n\t\t// 2007. 10. The ability to receive 19 additional modular yeokingeul\n\t\tif(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) return true;\n\n\t\t// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied \n\t\tif(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'trackback', 'controller', 'triggerCopyModule', 'after')) return true;\n\n\t\treturn false;\n\t}",
"public function checkTransaction()\n { \n $model = $this->hasMany(LogWarehouse::className(),['suppliers_performers_id'=>'_id'])->count();\n if($model>0){\n return true;\n } else {\n return false;\n }\n }",
"public function isApplied(): bool;",
"private function in_list($list) {\n\t\treturn $list[$this->_name] === true || (is_array($list[$this->_name]) && in_array($this->_action, $list[$this->_name]));\n\t}",
"protected function hasTransaction()\n {\n return isset($this->data->Payment->TxnList->Txn);\n }",
"public static function getTriggerIds()\n {\n return array_keys(self::$triggers);\n }",
"public function deleteTriggers()\n {\n $trigger_object_list = $this->get_linked_beans('triggers', 'WorkFlowTriggerShell');\n\n foreach ($trigger_object_list as $trigger_object) {\n //mark delete trigger components and sub expression components\n mark_delete_components($trigger_object->get_linked_beans('future_triggers', 'Expression'));\n mark_delete_components($trigger_object->get_linked_beans('past_triggers', 'Expression'));\n $trigger_object->mark_deleted($trigger_object->id);\n }\n }",
"protected function _isChanged()\n {\n return $this\n ->_getCronService()\n ->checkEntitiesChanged($this->getName(), self::getListenEntities());\n }",
"public function hasActions()\n {\n return ! empty($this->actions['table']);\n }",
"private function order_status_matches_email_trigger( $order, $email ) {\n if ( is_numeric( $order ) ) {\n $order = WC_FUE_Compatibility::wc_get_order( $order );\n }\n\n if ( is_numeric( $email ) ) {\n $email = new FUE_Email( $email );\n }\n\n return WC_FUE_Compatibility::get_order_status( $order ) == $email->trigger;\n }",
"public function triggerEvent(): bool\n {\n //triggering events\n $eventCollector = App::$di->get(CategoryEventCollector::class);\n $eventCollector->collectCategory($this);\n foreach ($this->getChildrenRecords() as $childRecord) {\n $eventCollector->collectCategory($childRecord);\n }\n foreach ($this->getSiblingsRecords() as $siblingRecord) {\n $eventCollector->collectCategory($siblingRecord);\n }\n $parentRecord = $this->getParentRecord();\n if (null === $parentRecord) {\n return true;\n }\n $eventCollector->collectCategory($parentRecord);\n return true;\n }",
"public function isSetRentalTransactionEventList()\n {\n return !empty($this->_fields['RentalTransactionEventList']['FieldValue']);\n }"
] | [
"0.6791762",
"0.6593702",
"0.6510906",
"0.59828645",
"0.5957001",
"0.5921792",
"0.57314247",
"0.5477801",
"0.54336554",
"0.5383966",
"0.53661627",
"0.53360546",
"0.5325977",
"0.52894205",
"0.52654487",
"0.52091265",
"0.520826",
"0.5190548",
"0.51904964",
"0.5187613",
"0.5146286",
"0.51380366",
"0.5108488",
"0.5078039",
"0.50779015",
"0.50777364",
"0.50690085",
"0.5067392",
"0.5064027",
"0.50440687"
] | 0.7287509 | 0 |
Creates query finding all tt_content elements of plugin/newloginbox type which has any of the message/header fields set. | function query($fields) {
return $GLOBALS['TYPO3_DB']->SELECTquery(
$fields,
'tt_content',
'CType="list" AND list_type="newloginbox_pi1" AND
(
tx_newloginbox_show_forgot_password OR
tx_newloginbox_header_welcome OR
tx_newloginbox_msg_welcome OR
tx_newloginbox_header_success OR
tx_newloginbox_msg_success OR
tx_newloginbox_header_error OR
tx_newloginbox_msg_error OR
tx_newloginbox_header_status OR
tx_newloginbox_msg_status OR
tx_newloginbox_header_logout OR
tx_newloginbox_msg_logout
)' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function generateLoginAlerts() {\n $orphanedContent = content::getOrphanedContent();\n if (count($orphanedContent) > 0) {\n foreach ($orphanedContent as $oc) {\n $alert = new orphanedcontentalert();\n $alert->sendAlert($oc);\n }\n }\n }",
"function limit_login_reg_filter_login_message($content) {\r\n\tif (is_limit_login_reg_page() && !is_limit_login_reg_ok())\r\n\t\treturn '';\r\n\r\n\treturn $content;\r\n}",
"function getListQuery()\n\t{\n\t\tstatic $query;\n\t\t\n\t\tif(!isset($query)) {\n\t\t\t\n\t\t\t// Get the WHERE, HAVING and ORDER BY clauses for the query\n\t\t\t$where\t\t= trim($this->_buildContentWhere());\n\t\t\t$orderby\t= trim($this->_buildContentOrderBy());\n\t\t\t$having\t\t= trim($this->_buildContentHaving());\n\t\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select(\n\t\t\t\t$this->getState( 'list.select',\n\t\t\t\t\t't.*, u.name AS editor, COUNT(rel.type_id) AS nrassigned, level.title AS access_level, rel.ordering as typeordering, t.field_type as type, plg.name as field_friendlyname'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$query->from('#__flexicontent_fields AS t');\n\t\t\t$query->join('LEFT', '#__extensions AS plg ON (plg.element = t.field_type AND plg.`type`=\\'plugin\\' AND plg.folder=\\'flexicontent_fields\\')');\n\t\t\t$query->join('LEFT', '#__flexicontent_fields_type_relations AS rel ON rel.field_id = t.id');\n\t\t\t$query->join('LEFT', '#__viewlevels AS level ON level.id=t.access');\n\t\t\t$query->join('LEFT', '#__users AS u ON u.id = t.checked_out');\n\t\t\tif ($where) $query->where($where);\n\t\t\t$query->group('t.id');\n\t\t\tif ($having) $query->having($having);\n\t\t\tif ($orderby) $query->order($orderby);\n\t\t\t\n\t\t}//end if(!isset($query))\n\t\t\n\t\treturn $query;\n\t}",
"function hook_user_message_build_draft_query($account, $query) {\r\n // Only fetch common user messages.\r\n $query->where('user_message.type = :type', array(':type' => 'common'));\r\n}",
"private function getContentElements()\n {\n $select_fields = '*';\n $from_table = 'tt_content';\n $where_clause = '\n\t\tCType=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('list', $from_table) . '\n\t\tAND list_type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('jfmulticontent_pi1', $from_table) . '\n\t\tAND deleted=0';\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields, $from_table, $where_clause);\n if ($res) {\n $resultRows = array();\n while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {\n $ff_parsed = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::xml2array($row['pi_flexform']);\n // Check for old sheet values\n if (is_array($ff_parsed['data'])) {\n foreach ($ff_parsed['data'] as $key => $val) {\n if (array_key_exists($key, $this->sheet_mapping)) {\n $resultRows[$row['uid']] = array(\n 'ff' => $row['pi_flexform'],\n 'ff_parsed' => $ff_parsed,\n 'title' => $row['title'],\n 'pid' => $row['pid'],\n );\n }\n }\n }\n }\n }\n return $resultRows;\n }",
"function ajax_fetch_dialog_content(){\n\t\n\tif( ! wp_verify_nonce( $_POST['Nonce'],'sibson_nonce')) die ('Sorry there was a problem, please try again later!');\n\t// Gather the data being sent via url query string.\n\t\n\t$type = $_POST['theType'];\n\t\t$id = $_POST['theId'];\n\t\t$pageType = $_POST['thePageType'];\n\t\t$classType = $_POST['theClassType'];\n\t\t$post_id = $_POST['post_id'];\t\n\t\n\tswitch ($type){\n\t\t\n\tcase \"stuff\";\n\t\t \n\t\techo '<div data-role=\"content\" id=\"dialog_content\" >';\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\n\t\t$mail = \"<img src='\".SIBSON_IMAGES.\"/mail.png' class='badgeImage'>\";\n\t\t$Calendar = \"<img src='\".SIBSON_IMAGES.\"/Calendar.png' class='badgeImage'>\";\n\t\t$enrolment = \"<img src='\".SIBSON_IMAGES.\"/enrolment.png' class='badgeImage'>\";\n\t\t$group = \"<img src='\".SIBSON_IMAGES.\"/groups_head.png' class='badgeImage'>\";\n\t\techo '<ul>';\n\t\t\techo '<li>';\n\t\t\tsibson_link_badge( $mail, 'https://mail.google.com', 'Mail'); \n\t\t\techo '</li>';\n\t\t\techo '<li>';\n\t\t\tsibson_link_badge( $Calendar, 'https://www.google.com/calendar/', 'Calendar'); \n\t\t\techo '</li>';\n\t\t\techo '<li>';\n\t\t\tsibson_badge(34, $group, 'New Group' , array(), true, false, '','data-title=\"Create a new group\" data-dialogtype=\"groupform\"', 'loaddialog'); \n\t\t\techo '</li>';\n\t\t\t$current_user = wp_get_current_user();\n\t$userId = $current_user->ID;\n\t$userdata = get_userdata( $userId );\n\t$user_level =$userdata->user_level;\n\t\t\tif ($user_level==10){\n\t\t\techo '<li>';\n\t\t\tsibson_badge(34, $enrolment, 'New Enrolment' , array(), true, false, '','data-title=\"New Enrolment Form\" data-dialogtype=\"enrolment\"', 'loaddialog'); \n\t\t\techo '</li>';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\techo '</ul>';\n\techo '</div>';\n\t\tbreak;\n\t\t\n\t\tcase \"people\";\n\t\n\t\t\t\t\t\t\n\t\t\techo '<div data-role=\"fieldcontain\">';\n\t\t\n\t\t\n\t\t\techo '<input type=\"search\" id=\"searchBox\" name=\"search\" value=\"\" />';\n\t\t\techo '</div>';\n\t\t\n\t\t\tif ($classType==\"Group\"){\n\t\t\t\t$group = new Group($id);\n\t\t\t\t}\n\t\t\t\telse if ($classType==\"Person\") {\n\t\t\t\t $person= new Person($id);\t\n\t\t\t\t\n\t\t\t\t$groupid = $person->currentClass();\t\n\t\t\t\t\n\t\t\t\t$group = new Group($groupid);\t\n\t\t\t\t\n\t\t\t\t}\n\t\t$idArray = $group->get_id_array();\n\t\techo \"<ul id='badgeList'>\";\n\t\tforeach ($idArray as $pId){\n\t\t\n\t\t$pers = new Person($pId);\n\t\t$pers->showBadge();\t\n\t\t\n\t\t}\n\t\techo '</ul>';\n\t\t\n\t\tbreak;\n\t\tcase \"groups\";\n\t\t\n\t\t\techo '<div data-role=\"fieldcontain\">';\n\t\t\techo '<div data-role=\"controlgroup\" data-type=\"horizontal\" data-theme=\"b\" class=\"page_buttons\">';\n\t\t\n\t\t\t\t\techo '<a href=\"#\" data-theme=\"b\" class=\"loaddialog\" data-dialogtype=\"mygroups\" data-role=\"button\">My Groups</a>';\n\t\t\t\t\techo '<a href=\"#\" data-theme=\"a\" class=\"loaddialog\" data-role=\"button\" data-dialogtype=\"groups\">Classes</a>';\n\t\t\n\t\techo '</div>';\n\t\t\techo '</div>';\n\t\t\t\t$list = new GroupList();\n\t\t\t\t\n\t\techo $list->badgeList(); \n\t\tbreak;\n\t\t\n\t\tcase \"mygroups\";\n\t\t\techo '<div data-role=\"fieldcontain\">';\n\t\t\techo '<div data-role=\"controlgroup\" data-type=\"horizontal\" data-theme=\"b\" class=\"page_buttons\">';\n\t\t\n\t\t\t\t\techo '<a href=\"#\" data-theme=\"a\" class=\"loaddialog\" data-dialogtype=\"mygroups\" data-role=\"button\">My Groups</a>';\n\t\t\t\t\techo '<a href=\"#\" data-theme=\"b\" class=\"loaddialog\" data-role=\"button\" data-dialogtype=\"groups\">Classes</a>';\n\t\t\n\t\techo '</div>';\n\t\t\techo '</div>';\n\t\t\t$current_user = wp_get_current_user();\n$userId = $current_user->ID;\n\t\t\t\t$list = new GroupList($userId , 'groups');\n\t\t\t\techo $list->badgeList(); \n\t\t\t\t\n\t\tbreak;\n\t\t\tcase \"delete\";\n\t\t\n\t\t\techo \"<p>Are you sure you want to delete this?</p>\";\n\t\t\t\t\t\techo \"<input type='hidden' id='delete_post_id' value='$post_id' />\";\n\t\t\t\t\t\techo \"<a href='#' data-role='button' class='button' data-inline='true' id='confirm_delete' data-theme='b'>Yes, delete it!</a>\";\n\t\tbreak;\n\t\t\tcase \"deleteGroup\";\n\t\t\n\t\t\techo \"<p>Are you sure you want to delete this Group?</p>\";\n\t\t\t\t\t\techo \"<input type='hidden' id='delete_group_id' value='$post_id' />\";\n\t\t\t\t\t\techo \"<a href='#' data-role='button' class='button' data-inline='true' id='confirm_delete_group' data-theme='b'>Yes, delete it!</a>\";\n\t\tbreak;\n\t\t\tcase \"write\";\n\t\t\t\n\t\t\n\t\t\tif ($pageType == \"groups\"){ \n\t\t\t\t\t\t\t\t $form_type = 'new_group';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t $form_type = 'new_post';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$id.\"&pageType=\".$pageType.\"&formType=\".$form_type.\"' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"post_author\" name=\"post_author\" value=\"'.$post->post_author.'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($pageType == \"groups\"){\n\t\t\t\t\t\t\t\t\tsibson_create_group_form($id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_post_type_select( $pageType);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_subject_select($pageType, $classType);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_text_area(\t$_POST['desc'], $id, $pageType);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_refer($pageType);\t// add a referal page if the page type calls for it.\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_upload();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($pageType==\"goals\"){\n\t\t\t\t\t\t\t\tsibson_form_staff_publish();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tsibson_form_publish();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo \"</form>\"; \n\t\tbreak;\n\t\t\tcase \"edit\";\n\t\t\t\n\t\t\t$post = get_post($post_id);\n\t\t\t$cat = get_the_category( $post_id );\n\t\t\t\n\t\n\t\t\t\n\t\t\tif ($pageType == \"groups\"){ \n\t\t\t\t\t\t\t\t $form_type = 'new_group';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t $form_type = 'new_post';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$id.\"&pageType=\".$pageType.\"&formType=\".$form_type.\"' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"post_author\" name=\"post_author\" value=\"'.$post->post_author.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"post_title\" name=\"post_title\" value=\"'.$post->post_title.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"indicator_type\" name=\"indicator_type\" value=\"'.$_POST['indtype'].'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($pageType == \"groups\"){\n\t\t\t\t\t\t\t\t\tsibson_create_group_form($id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_post_type_select( $pageType, $post->post_type);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_subject_select($pageType, $cat[0]->category_nicename);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_text_area($post->post_content, $id, $pageType);\n\t\t\t\t\t\t\t\tsibson_form_upload();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_publish($post->post_date);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo \"</form>\"; \n\t\tbreak;\n\t\tcase \"document\";\n\t\t$checkType = explode(\"type=\", $_SERVER['HTTP_REFERER']);\n\t\t\t$check = $checkType[1];\n\t\t\n\t\t\t\t\t\t\t\t $form_type = 'new_document';\n\t\t\t\t\t\t\t\t $desc = $_POST['desc'];\n\t\t\t\t\t\t\t\t $cat = $_POST['title'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( substr($check, 0, 5)==\"Group\"){\n\t\t\t\t\t\t\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$desc.\"&type=Group&teachingId=\".$id.\"&pageType=teaching&formType=\".$form_type.\"' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\techo '<input type=\"hidden\" id=\"is_group\" name=\"is_group\" value=\"true\" />';\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$desc.\"&teachingId=\".$id.\"&pageType=teaching&formType=\".$form_type.\"' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"person_id\" name=\"person_id\" value=\"'.$desc.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"indicator_id\" name=\"indicator_id\" value=\"'.$id.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"category\" name=\"category\" value=\"'.$pageType.'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_upload('', true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo \"</form>\"; \n\t\tbreak;\n\t\t\n\t\t\n\t\t\tcase \"teachingIdea\";\n\t\t\t$checkType = explode(\"type=\", $_SERVER['HTTP_REFERER']);\n\t\t\t$check = $checkType[1];\n\t\t\t\n\t\t\t$post = get_post($post_id);\n\t\t\t$terms = wp_get_post_terms( $post_id, 'indicator',array(\"fields\" => \"names\") );\n\t\t\t$teachingId =sibson_fetch_indicator_by_target ( $terms[4]);\n\t\t\t $desc = $_POST['desc'];\n\t\t\t\n\t\t\t\t\t\t\t\t $form_type = 'new_post';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( substr($check, 0, 5)==\"Group\"){\n\t\t\t\t\t\t\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$desc.\"&type=Group&teachingId=\".$id.\"&pageType=teaching&formType=\".$form_type.\"' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\techo '<input type=\"hidden\" id=\"is_group\" name=\"is_group\" value=\"true\" />';\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$desc.\"&teachingId=\".$id.\"&pageType=teaching&formType=\".$form_type.\"' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"person_id\" name=\"person_id\" value=\"'.$desc.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"post_author\" name=\"post_author\" value=\"'.$post->post_author.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"post_title\" name=\"post_title\" value=\"'.$post->post_title.'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"indictar_id\" name=\"indicator_id\" value=\"'.$id.'\" />';\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\t\t\t\tsibson_form_post_type_select( $pageType, $selection);\n\t\t\t\t\t\t\t\tsibson_text_area($post->post_content, $id, $pageType);\n\t\t\t\t\t\t\t\tsibson_form_upload();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_staff_publish($post->post_date);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo \"</form>\"; \n\t\tbreak;\n\t\t\tcase \"reuse\";\n\t\t$post = get_post($post_id);\n\t\t\techo \"<p>Please select the children you would like to re-cycle this post for:</p>\";\n\t\t\techo \"<form data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$id.\"&pageType=\".$pageType.\"&formType=reusePost' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"post_author\" name=\"post_author\" value=\"'.$post->post_author.'\" />';\n\t\t\t\t\t\t\t\t\techo \"<div class='form_page' data-name='Select People'>\";\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\techo '<div data-role=\"fieldcontain\">';\n\t\t\techo '<fieldset data-role=\"controlgroup\" data-type=\"horizontal\">';\n\t\t\t\n\t\t\tfor ($i=65; $i<=90; $i++) {\n\t\t\t\t $x = chr($i);\n\t\t\t\techo \"<a href='#' class='loadPeopleByAlphabet' data-theme='b' data-role='button' data-inline='true' data-letter='\".$x.\"' >\";\n\t\t\t\techo $x;\n\t\t\t\techo \"</a>\";\n\t\t\t\t}\n\t\t\techo '</fieldset>';\t\n\t\t\techo '</div>';\n\t\t\techo \"<div id='hiddenCheckboxes'>\";\n\t\t\t\t\n\t\t\t\techo \"</div>\";\t\n\t\t\t\n\t\t\techo '<ul id=\"selectableList\">';\n\t\t\t\n\t\t\t\t$person= new Person($id);\t\t\n\t\t\t\t$groupid = $person->currentClass();\t\n\t\t\t\t$group = new Group($groupid);\t\n\t\t\t\t$idArray = $group->get_id_array();\n\t\t\t\tforeach ($idArray as $pers){\n\t\t\t\techo \"<li>\";\n\t\t\t\t$p = new Person($pers);\n\t\t\t\t$p->selectableBadge();\n\t\t\t\techo \"</li>\";\n\t\t\t\t}\n\t\t\t\techo \"</ul>\";\n\t\t\t\n\t\t\t\techo \"</div>\";\n\t\t\t\t\n\t\t\t\techo \"<div class='form_page' data-name='Finish'>\";\n\t\t\t\t\n\t\t\t\techo '<p>The words <span class=\"ui-btn-up-e\">highlighted</span> will be replaced to match the children that you have chosen.</p>';\n\t\t\t\t\n\t\t\t\t$find = array( $person->returnFirstName(), ' he ', ' she ', ' his ', ' her ', 'He ', 'She ', 'His ', 'Her ' );\t\n\t\t\t\t$replace = array( '<span class=\"ui-btn-up-e\">'.$person->returnFirstName().'</span>', '<span class=\"ui-btn-up-e\"> he </span>', '<span class=\"ui-btn-up-e\"> she </span>', '<span class=\"ui-btn-up-e\"> his </span>', '<span class=\"ui-btn-up-e\"> her </span>', '<span class=\"ui-btn-up-e\">He </span>', '<span class=\"ui-btn-up-e\">She </span>', '<span class=\"ui-btn-up-e\">His </span>', '<span class=\"ui-btn-up-e\">Her </span>' );\n\t\t\t\t\n\t\t\t\techo str_replace($find, $replace, $post->post_content);\n\t\t\t\t\n\t\t\t\techo \"<br />\";\n\t\t\t\techo '<a href=\"#\" id=\"confirm_save\" data-formid=\"post_form\" data-role=\"button\" data-theme=\"b\" data-inline=\"true\" >Ok, copy this!</a>'; \n\t\t\t\t\t\n\t\t\t\techo '</div>';\n\t\tbreak;\n\t\t\n\t\tcase \"groupform\";\n\t\t\n\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$id.\"&formType=new_group' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"post_author\" name=\"post_author\" value=\"'.$id.'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tsibson_create_group_form($id);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo \"</form>\"; \n\t\t\t\t\n\t\tbreak;\n\t\t\tcase \"editGroup\";\n\t\t\n\t\t\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?formType=edit_group' id='post_form' method='post'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"existing_post_id\" name=\"existing_post_id\" value=\"'.$post_id.'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tsibson_create_group_form($id, $post_id);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo \"</form>\"; \n\t\t\t\t\n\t\tbreak;\n\t\tcase \"emailGroup\";\n\t\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$id.\"&type=Group&pageType=\".$pageType.\"&formType=send_email' id='post_form' method='post' enctype='multipart/form-data'>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"group_id\" name=\"group_id\" value=\"'.$id.'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_nonce('send_email');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_text_area_mail($id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo \"</form>\"; \n\t\tbreak;\t\t\t\t\t\t\n\t\t\n\t\tcase \"staffgoals\";\n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$goals = $wpdb->get_results($wpdb->prepare(\"SELECT wp_assessment_data.ID, \n\twp_assessment_data.person_id, \n\tDATE_FORMAT(wp_assessment_data.date, '%M %D %Y') AS the_date, \n\twp_assessment_data.user_id, \n\twp_assessment_terms.assessment_target,\n\twp_assessment_terms.assessment_subject,\n\twp_assessment_terms.assessment_link, \n\twp_assessment_terms.assessment_type, \n\twp_assessment_terms.assessment_description, \n\twp_assessment_terms.assessment_value\nFROM wp_assessment_data INNER JOIN wp_assessment_terms ON wp_assessment_data.assessment_value = wp_assessment_terms.ID\nWHERE wp_assessment_data.person_id = %d AND wp_assessment_terms.assessment_subject = %s AND wp_assessment_data.area = %s \", $id, $classType, $pageType));\n\n\t\t\t\t\n\t\t\t\techo '<ul>';\n\t\t\t\tforeach ($goals as $goal){\n\t\t\t\t\t\n\t\t\t\t\techo '<li>';\n\t\t\t\t\techo $goal->assessment_description;\n\t\t\t\techo '</li>';\n\t\t\t\t\n\t}\n\t\t\t\techo '</ul>';\n\t\tbreak;\n\t\t\n\t\t\tcase \"enrolment\";\n\t\t\trequire('enrolment.php');\n\t\t\t\tsibson_enrolment_form('', 'enrol_form');\n\t\tbreak;\n\t\tcase \"enrol_edit\";\n\t\t\trequire('enrolment.php');\n\t\t\t\tsibson_enrolment_form($id, 'enrol_form');\n\t\tbreak;\n\t\t\tcase \"post\";\n\t\t\t\n\t\t\t$post = get_post($post_id);\n\t\t\t\n\t\t\techo '<p>';\n\t\t\techo $post->post_content;\n\t\t\techo '</p>';\n\t\t\techo \"<a href='#' class='loaddialog button' data-role='button' data-pagetype='post' data-indicatortype='\".$_POST['indtype'].\"' data-theme='b' data-dialogtype='edit' data-inline='true' data-postid='\".$post_id.\"'>Edit this...</a>\";\n\t\t\t\n\t\tbreak;\n\t\tcase \"showgoals\";\n\t\t\n\t\t$person = new Person($id);\n\t\techo $person->showGoals($pageType);\n\t\t\n\t\tbreak;\n\t\t case \"duplicate_group\";\n\t\t\n\t\t $group = new Group ($id);\n\t\t\t\n\t\t\t$yearGroup = $group->returnYearGroup();\n\t\t\t\n\t\t\t\tswitch($yearGroup){\n\t\t\t\t\tcase 0;\n\t\t\t\t\t$team = \"New Entrants\";\n\t\t\t\t\t$team_order =1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1;\n\t\t\t\t\t$team = \"New Entrants\";\n\t\t\t\t\t$team_order =1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2;\n\t\t\t\t\t$team = \"Year 2\";\n\t\t\t\t\t$team_order =2;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3;\n\t\t\t\t\t$team = \"Middle\";\n\t\t\t\t\t$team_order =3;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 4;\n\t\t\t\t\t$team = \"Middle\";\n\t\t\t\t\t$team_order =3;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5;\n\t\t\t\t\t$team = \"Senior\";\n\t\t\t\t\t$team_order =4;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 6;\n\t\t\t\t\t$team = \"Senior\";\n\t\t\t\t\t$team_order =4;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\n\t\t\t\t\t$peopleList = $group->get_id_array();\n\t\t\t\t\t$current_user = wp_get_current_user();\n\t\t\t\t\t$userId = $current_user->ID;\n\t\t\t\t\t$groupDetail = array(\n\t\t\t\t\t'user_id'=> $userId,\n\t\t\t\t\t'room'=> $group->returnRoom(),\n\t\t\t\t\t'year'=> date('Y'),\n\t\t\t\t\t'type'=> '',\n\t\t\t\t\t'group_name'=> $group->returnName(),\n\t\t\t\t\t 'team'=> $team,\n\t\t\t\t\t 'team_order'=> $team_order, \n\t\t\t\t\t 'yearGroup'=> $yearGroup\n\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$newGroup = sibson_create_a_group($groupDetail);\n\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\tforeach ($peopleList as $person){\n\t\t\t\t\t\n\t\t\t\t\t$id = $person;\n\t\t\t\t\t\n\t\t\t\t//\t$insert = $wpdb->insert( 'wp_group_relationships', array( 'wp_group_id' => $newGroup, 'wp_person_id'=>$id, 'vacated' =>0 ));\t\n\t\t\t\t\t\n\t\t\t\t\t\t$result = $wpdb->query( $wpdb->prepare( \n\t\"\n\t\tINSERT INTO wp_group_relationships\n\t\t( wp_group_id, wp_person_id, vacated )\n\t\tVALUES ( %d, %d, %d )\n\t\", \n array(\n\t\t$newGroup, \n\t\t$id, \n\t\t0\n\t\t) \n\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif ($newGroup){\n\t\t\t\t\techo \"The group has been duplicated.\";\n\t\t\t\t\techo \"<a href='\".get_bloginfo('url').\"?accessId=\".$newGroup.\"&type=Group' data-theme='b' data-inline='true' rel='external' data-role='button'>Go to the new group</a>\"; \n\t\t\t\t\t}\n\t\t break;\n\t\t\n\t\t\tcase \"assessment\";\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t$assessments =$wpdb->get_results(\"SELECT * from wp_assessment_terms where assessment_subject = '$pageType'\");\n\techo \"<form data-initialForm='' data-ajax='false' action='\".get_bloginfo('url').\"/?accessId=\".$id.\"&formType=new_assessment' id='post_form' method='post'>\";\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"subject\" name=\"subject\" value=\"'.$pageType.'\" />';\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"person_id\" name=\"person_id\" value=\"'.$id.'\" />';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsibson_form_nonce('post_form');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tforeach ($assessments as $assessment){\n\t\t\t\t\n\t\t\t\t\n\t\t\t$measure = $assessment->assessment_measure;\n\t\t\tif ($measure == \"scale-3\"){\t\t // scale\n\t\t\techo \"<label><strong>\".ucfirst($assessment->assessment_description).\"</strong></label>\";\n\t\t\t\techo \"<p>\".ucfirst($assessment->assessment_target).\"</p>\";\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t\t\tsibson_radio_list( \tarray (\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'name'=>'radio-'.$assessment->ID,\n\t\t\t\t\t\t\t\t\t\t\t'id'=>'1',\n\t\t\t\t\t\t\t\t\t\t\t'value'=>'1',\n\t\t\t\t\t\t\t\t\t\t\t'existing'=> '',\n\t\t\t\t\t\t\t\t\t\t\t'title'=>'1'\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'name'=>'radio-'.$assessment->ID,\n\t\t\t\t\t\t\t\t\t\t\t'id'=>'2',\n\t\t\t\t\t\t\t\t\t\t\t'value'=>'2',\n\t\t\t\t\t\t\t\t\t\t\t'existing'=> '',\n\t\t\t\t\t\t\t\t\t\t\t'title'=>'2'),\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'name'=>'radio-'.$assessment->ID,\n\t\t\t\t\t\t\t\t\t\t\t'id'=>'3',\n\t\t\t\t\t\t\t\t\t\t\t'value'=>'3',\n\t\t\t\t\t\t\t\t\t\t\t'existing'=> '',\n\t\t\t\t\t\t\t\t\t\t\t'title'=>'3')),\n\t\t\t\t\t\t\t\t\t\t\t 'horizontal');\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\n\t\n\t\t\t} // end scale\n\t\t\telse if ($measure == \"net\") {\n\t\t\t\techo \"<p><strong>\".ucfirst($assessment->assessment_description).\"</strong></p>\";\n\t\t\t\t\n\t\t\t$assess = new Assessment( $id, $pageType, 'individual');\n\t\t\t\techo '<p id=\"update_'.$id.'\">Drag the slider to the correct score.</p>';\n\t\t\t\t $assess->score($assessment->assessment_short, $assessment->ID);\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\tbreak;\t// break out of the loop\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ($measure == \"Level\"){\t\t\n\t\t\n\t\t\t\t$assess = new Assessment( $id, $pageType, 'individual');\n\t\t\t\techo '<p id=\"update_'.$id.'\">Drag the slider to set the level.</p>';\n\t\t\t\t $assess->slider();\n\t\t}\n\t\t\t\n\techo \"<input type='submit' data-theme='b' data-inline='true' value='Save'/>\";\t\n\techo '</form>';\n\t\tbreak;\n\t\n\t\t\n\t}\n\t // IMPORTANT: don't forget to \"exit\"\n\tdie();\nexit;\n\t\n}",
"function _getContentTypes()\n\t{\n\t\t$typeIds = $this->params->get('search_types',\t'');\n\t\t$typesarray = array();\n\t\tpreg_match_all('/\\b\\d+\\b/', $typeIds, $typesarray);\n\t\t\n\t\t$wheres=array();\n\t\tforeach ($typesarray[0] as $key=>$typeID)\n\t\t{\n\t\t\t$wheres[]='t.id = '.$typeID;\n\t\t}\n\t\t$whereTypes = $wheres ? '(' . implode(') OR (', $wheres) . ')' : '';\n\t\t\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->clear();\n\t\t$query->select('t.id, t.name ');\n\t\t$query->from('#__flexicontent_types AS t ');\n\t\t$query->where('t.published = 1'.($whereTypes ? ' AND ('.$whereTypes.')' : ''));\n\t\t$query->order('t.id ASC');\n\n\t\t$db->setQuery($query);\n\t\t$list = $db->loadObjectList();\n\n\t\t$ContentType = array();\n\t\tif (isset($list)){\n\t\t\tforeach($list as $item){\n\t\t\t\t$ContentType['FlexisearchType'.$item->id]=$item->name.'<br>'; // add a line break too\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Goto last element of array and add to it one more line breaks, this layout hack is not appropriate e.g. the areas maybe inside a list ...\n\t\t//end($ContentType);\n\t\t//$ContentType[key($ContentType)]=current($ContentType).'<br>';\n\t\t\n\t\treturn $ContentType;\n\t\n\t}",
"public function create()\n\t{\n\t\t$this->content_obj = new ilPCLoginPageElements($this->dom);\n\t\t$this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);\n\t\t$this->content_obj->setLoginPageElementType($_POST[\"type\"]);\n\t\t$this->content_obj->setAlignment($_POST['horizontal_align']);\n\n\t\t$this->updated = $this->pg_obj->update();\n\t\tif ($this->updated === true)\n\t\t{\n\t\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->insert();\n\t\t}\n\t}",
"function hook_user_message_build_received_query($account, $query) {\r\n // Only fetch common user messages.\r\n $query->where('user_message.type = :type', array(':type' => 'common'));\r\n}",
"public function render_meta_box() {\r\n global $post; ?>\r\n <input type=\"hidden\" name=\"popup_remote_content_defaults_set\" value=\"true\" />\r\n <div id=\"popmake_remote_content_fields\" class=\"popmake_meta_table_wrap\">\r\n <table class=\"form-table\">\r\n <tbody>\r\n <tr>\r\n <th scope=\"row\"><?php _e( 'Enable Remote Content', popmake_rc()->textdomain );?></th>\r\n <td>\r\n <input type=\"checkbox\" value=\"true\" name=\"popup_remote_content_enabled\" id=\"popup_remote_content_enabled\" <?php checked( popmake_get_popup_remote_content( $post->ID, 'enabled' ), 'true' ); ?>/>\r\n <label for=\"popup_remote_content_enabled\" class=\"description\"><?php _e( 'This enables Remote Content for this popup.', popmake_rc()->textdomain );?></label>\r\n </td>\r\n </tr>\r\n <tr class=\"remote-content-enabled\">\r\n <th scope=\"row\">\r\n <label for=\"popup_remote_content_type\"><?php _e( 'Type', popmake_rc()->textdomain );?></label>\r\n </th>\r\n <td>\r\n <select name=\"popup_remote_content_type\" id=\"popup_remote_content_type\">\r\n <?php foreach( apply_filters( 'popmake_remote_content_type_options', array() ) as $option => $value ) : ?>\r\n <option\r\n value=\"<?php echo $value;?>\"\r\n <?php selected( $value, popmake_get_popup_remote_content( $post->ID, 'type' ) ); ?>\r\n ><?php echo $option;?></option>\r\n <?php endforeach ?>\r\n </select>\r\n <p class=\"description\"><?php _e( 'Choose the type of remote content use.', popmake_rc()->textdomain ); ?></p>\r\n </td>\r\n </tr>\r\n\r\n\r\n <tr class=\"remote-content-enabled only-ajax\">\r\n <th scope=\"row\">\r\n <label for=\"popup_remote_content_function_name\"><?php _e( 'Function Name', popmake_rc()->textdomain );?></label>\r\n </th>\r\n <td>\r\n <input type=\"text\" class=\"regular-text\" name=\"popup_remote_content_function_name\" id=\"popup_remote_content_function_name\" placeholder=\"<?php _e( 'A function that will be called and render results.', popmake_rc()->textdomain ); ?>\" value=\"<?php esc_attr_e( popmake_get_popup_remote_content( $post->ID, 'function_name', '' ) ); ?>\"/>\r\n <p class=\"description\"><?php _e( 'A function that will be called and render results.', popmake_rc()->textdomain )?></p>\r\n </td>\r\n </tr>\r\n\r\n <tr class=\"remote-content-enabled only-loadselector\">\r\n <th scope=\"row\">\r\n <label for=\"popup_remote_content_css_selector\"><?php _e( 'CSS Selector', popmake_rc()->textdomain );?></label>\r\n </th>\r\n <td>\r\n <input type=\"text\" class=\"regular-text\" name=\"popup_remote_content_css_selector\" id=\"popup_remote_content_css_selector\" placeholder=\"<?php _e( '#main .content', popmake_rc()->textdomain ); ?>\" value=\"<?php esc_attr_e( popmake_get_popup_remote_content( $post->ID, 'css_selector', '' ) ); ?>\"/>\r\n <p class=\"description\"><?php _e( 'Enter the CSS id or selector that we will will load from links.', popmake_rc()->textdomain )?></p>\r\n </td>\r\n </tr>\r\n\r\n <tr class=\"remote-content-enabled\">\r\n <th scope=\"row\">\r\n <label for=\"popup_remote_content_loading_icon\"><?php _e( 'Loading Icon', popmake_rc()->textdomain );?></label>\r\n </th>\r\n <td>\r\n <select name=\"popup_remote_content_loading_icon\" id=\"popup_remote_content_loading_icon\">\r\n <?php foreach( apply_filters( 'popmake_remote_content_loading_icon_options', array() ) as $option => $value ) : ?>\r\n <option\r\n value=\"<?php echo $value;?>\"\r\n <?php selected( $value, popmake_get_popup_remote_content( $post->ID, 'loading_icon' ) ); ?>\r\n ><?php echo $option;?></option>\r\n <?php endforeach ?>\r\n </select>\r\n <p class=\"description\"><?php _e( 'Choose a loding icon style.', popmake_rc()->textdomain ); ?></p>\r\n </td>\r\n </tr>\r\n\r\n\r\n <?php do_action( 'popmake_remote_content_meta_box_fields', $post->ID );?>\r\n </tbody>\r\n </table>\r\n </div><?php\r\n }",
"function learndash_add_login_field_top( $content = '' ) {\n\t$content .= '<input id=\"learndash-login-form\" type=\"hidden\" name=\"learndash-login-form\" value=\"' . wp_create_nonce( 'learndash-login-form' ) . '\" />';\n\n\t$course_id = learndash_get_course_id( get_the_ID() );\n\tif ( ( ! empty( $course_id ) ) && ( in_array( learndash_get_setting( $course_id, 'course_price_type' ), array( 'free' ), true ) ) && ( apply_filters( 'learndash_login_form_include_course', true, $course_id ) ) ) {\n\t\t$content .= '<input name=\"learndash-login-form-course\" value=\"' . $course_id . '\" type=\"hidden\" />';\n\t\t$content .= wp_nonce_field( 'learndash-login-form-course-' . $course_id . '-nonce', 'learndash-login-form-course-nonce', false, false );\n\t}\n\n\treturn $content;\n}",
"function main() {\r\n\t\t\t$query = $this->query('*');\r\n\r\n\t\t\t$res = $GLOBALS['TYPO3_DB']->sql_query($query );\r\n\r\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_error() ) {\r\n\t\t\t\tt3lib_div::debug(array('SQL error:',\r\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->sql_error() ) );\r\n\t\t\t}\r\n\r\n\t\t\t$count = $GLOBALS['TYPO3_DB']->sql_num_rows($res );\r\n\r\n\t\t\tif (!t3lib_div::GPvar('do_update')) {\r\n\t\t\t\t$onClick = \"document.location='\".t3lib_div::linkThisScript(array('do_update' => 1)).\"'; return false;\";\r\n\r\n\t\t\t\treturn 'There are '.$count.' rows in \"tt_content\" to update. Do you want to perform the action now?\r\n\r\n\t\t\t\t\t<form action=\"\"><input type=\"submit\" value=\"DO IT\" onclick=\"'.htmlspecialchars($onClick).'\"></form>\r\n\t\t\t\t\t';\r\n\t\t\t} else {\r\n\t\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res) ) {\r\n\t\t\t\t\t$xml = trim('\r\n<T3FlexForms>\r\n\t<meta>\r\n\t\t<dataStructureUid></dataStructureUid>\r\n\t\t<currentSheetId>s_logout</currentSheetId>\r\n\t</meta>\r\n\t<data>\r\n\t\t<sDEF>\r\n\t\t\t<lDEF>\r\n\t\t\t\t<show_forgot_password>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_show_forgot_password'].'</vDEF>\r\n\t\t\t\t</show_forgot_password>\r\n\t\t\t</lDEF>\r\n\t\t</sDEF>\r\n\t\t<s_welcome>\r\n\t\t\t<lDEF>\r\n\t\t\t\t<header>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_header_welcome'].'</vDEF>\r\n\t\t\t\t</header>\r\n\t\t\t\t<message>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_msg_welcome'].'</vDEF>\r\n\t\t\t\t</message>\r\n\t\t\t</lDEF>\r\n\t\t</s_welcome>\r\n\t\t<s_success>\r\n\t\t\t<lDEF>\r\n\t\t\t\t<header>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_header_success'].'</vDEF>\r\n\t\t\t\t</header>\r\n\t\t\t\t<message>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_msg_success'].'</vDEF>\r\n\t\t\t\t</message>\r\n\t\t\t</lDEF>\r\n\t\t</s_success>\r\n\t\t<s_error>\r\n\t\t\t<lDEF>\r\n\t\t\t\t<header>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_header_error'].'</vDEF>\r\n\t\t\t\t</header>\r\n\t\t\t\t<message>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_msg_error'].'</vDEF>\r\n\t\t\t\t</message>\r\n\t\t\t</lDEF>\r\n\t\t</s_error>\r\n\t\t<s_status>\r\n\t\t\t<lDEF>\r\n\t\t\t\t<header>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_header_status'].'</vDEF>\r\n\t\t\t\t</header>\r\n\t\t\t\t<message>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_msg_status'].'</vDEF>\r\n\t\t\t\t</message>\r\n\t\t\t</lDEF>\r\n\t\t</s_status>\r\n\t\t<s_logout>\r\n\t\t\t<lDEF>\r\n\t\t\t\t<header>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_header_logout'].'</vDEF>\r\n\t\t\t\t</header>\r\n\t\t\t\t<message>\r\n\t\t\t\t\t<vDEF>'.$row['tx_newloginbox_msg_logout'].'</vDEF>\r\n\t\t\t\t</message>\r\n\t\t\t</lDEF>\r\n\t\t</s_logout>\r\n\t</data>\r\n</T3FlexForms>\r\n\t\t\t\t\t\t');\r\n\r\n\t\t\t\t\t$updateRecord = array();\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_show_forgot_password'] = 0;\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_header_welcome'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_msg_welcome'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_header_success'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_msg_success'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_header_error'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_msg_error'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_header_status'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_msg_status'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_header_logout'] = '';\r\n\t\t\t\t\t$updateRecord['tx_newloginbox_msg_logout'] = '';\r\n\t\t\t\t\t$updateRecord['pi_flexform'] = $xml;\r\n\r\n\t\t\t\t\t$updateQ = t3lib_BEfunc::DBcompileUpdate('tt_content', 'uid='.intval($row['uid']), $updateRecord);\r\n\r\n\t\t\t\t\t$res = $GLOBALS['TYPO3_DB']->sql_query($updateQ );\r\n\r\n\t\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_error()) {\r\n\t\t\t\t\t\tt3lib_div::debug(array('SQL error:', $updateQ ) );\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn sprintf('ROW %s updated.', $count );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public function lstContent(){\r\n\t\t$Sql = \"SELECT\r\n\t\t\t\t\tcms_id,\r\n\t\t\t\t\tcms_title,\r\n\t\t\t\t\tcms_detail,\r\n\t\t\t\t\tparent_id,\r\n\t\t\t\t\tcms_category_id,\r\n\t\t\t\t\tcms_type_id,\r\n\t\t\t\t\tother_type,\r\n\t\t\t\t\tcms_file,\r\n\t\t\t\t\tcms_date,\r\n\t\t\t\t\tis_active,\r\n\t\t\t\t\turl_key,\r\n\t\t\t\t\tans_yes,\r\n\t\t\t\t\tans_no\r\n\t\t\t\tFROM\r\n\t\t\t\t\trs_tbl_content\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t1=1\";\r\n\t\tif($this->isPropertySet(\"cms_id\", \"V\"))\r\n\t\t\t$Sql .= \" AND cms_id=\" . $this->getProperty(\"cms_id\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"parent_id\", \"V\"))\r\n\t\t\t$Sql .= \" AND parent_id=\" . $this->getProperty(\"parent_id\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"cms_category_id\", \"V\"))\r\n\t\t\t$Sql .= \" AND cms_category_id='\" . $this->getProperty(\"cms_category_id\") . \"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"cms_type_id\", \"V\"))\r\n\t\t\t$Sql .= \" AND cms_type_id='\" . $this->getProperty(\"cms_type_id\") . \"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"other_type\", \"V\"))\r\n\t\t\t$Sql .= \" AND other_type='\" . $this->getProperty(\"other_type\") . \"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"cms_file\", \"V\"))\r\n\t\t\t$Sql .= \" AND cms_file=\" . $this->getProperty(\"cms_file\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"cms_date\", \"V\"))\r\n\t\t\t$Sql .= \" AND cms_date=\" . $this->getProperty(\"cms_date\");\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"is_active\", \"V\"))\r\n\t\t\t$Sql .= \" AND is_active=\" . $this->getProperty(\"is_active\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"url_key\", \"V\"))\r\n\t\t\t$Sql .= \" AND url_key='\" . $this->getProperty(\"url_key\").\"'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\"))\r\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\r\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\r\n\t\t\r\n\t\treturn $this->dbQuery($Sql);\r\n\t}",
"function notifier_get_page_content_list () {\n\t$params = array();\n\n\t$params['title'] = elgg_echo('notifier:all');\n\t$params['filter'] = '';\n\n\t// Link to notification settings\n\telgg_register_menu_item('title', array(\n\t\t'name' => 'notification-settings',\n\t\t'href' => 'notifications/personal',\n\t\t'text' => elgg_echo('settings'),\n\t\t'class' => 'elgg-button elgg-button-action',\n\t));\n\n\t// Link to remove all notifications\n\telgg_register_menu_item('title', array(\n\t\t'name' => 'notification-delete',\n\t\t'href' => 'action/notifier/clear',\n\t\t'text' => elgg_echo('notifier:clear_all'),\n\t\t'class' => 'elgg-button elgg-button-delete elgg-requires-confirmation',\n\t\t'is_action' => true,\n\t\t'rel' => elgg_echo('notifier:deleteconfirm'),\n\t));\n\n\t// Link to dismiss all unread notifications\n\telgg_register_menu_item('title', array(\n\t\t'name' => 'notification-dismiss',\n\t\t'href' => 'action/notifier/dismiss',\n\t\t'text' => elgg_echo('notifier:dismiss_all'),\n\t\t'class' => 'elgg-button elgg-button-submit',\n\t\t'is_action' => true,\n\t));\n\n\t$notifications = elgg_list_entities_from_metadata(array(\n\t\t'type' => 'object',\n\t\t'subtype' => 'notification',\n\t\t'limit' => 20,\n\t\t'owner_guid' => elgg_get_logged_in_user_guid(),\n\t\t'full_view' => false,\n\t\t'order_by_metadata' => array(\n\t\t\t'name' => 'status',\n\t\t\t'direction' => DESC\n\t\t),\n\t));\n\n\tif ($notifications) {\n\t\t$params['content'] = $notifications;\n\t} else { \n\t\t$params['content'] = elgg_echo('notifier:none');\n\t}\n\n\treturn $params;\n}",
"public function SelectNewMessagesForAdmin(){\n\n\t\t\t\t$status = 'new';\n\n\t\t\t$query = \"SELECT * FROM message WHERE status = ? ORDER BY id DESC\";\n $sql = $this->conn->prepare($query);\n $sql->execute([$status]);\n $res = $sql->fetchAll(PDO::FETCH_ASSOC);\n return $res;\n\n\t}",
"public function createContentTypes() {\n if (!is_array($this->content_types) || empty($this->content_types))\n return;\n\n // Create all defined content types.\n foreach ($this->content_types as $type) {\n $type = node_type_set_defaults($type);\n node_type_save($type);\n if (!isset($type->body) || $type->body != FALSE) {\n node_add_body_field($type);\n }\n }\n\n }",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM main_contact_messages';\n\t\t$SqlQuery2 = new SqlQuery($sql);\n\t\treturn $this->getList($SqlQuery2);\n\t}",
"function _showInbox(){\r\n\tglobal $dbi,$usertoken;\r\n\t# lookup on the recipient group ==> msgmap does not work , we have more than 1 group to check ..\r\n\t# here we check on the recipient email ...\r\n\t# att: the $usertoken['email'] must contain something else we see ALL messages\r\n\tif (strlen($usertoken['email'])<8){$usertoken['email']='[email protected]';}\r\n\t\r\n\t$RS=DB_listMessage($dbi,'',$usertoken['email'],2);\r\n\t$HEAD='';\r\n\t$ROWS='';\r\n\tif (!sizeof($RS)>0){\r\n\t\t$ROWS='<tr><td>Keine Nachrichten oder Aufgaben ...</td></tr>';\r\n\t}else {\r\n\t\tif ($usertoken['usertype_id']<5){\r\n\t\t\t$ROWS=RecordsetToDataTable($RS,array(1,2,3,5,6,7,8));\r\n\t\t} else {\r\n\t\t\t$ROWS=RecordsetToDataTable($RS,array(1,2,3,5,6,7,8),array('delmessage'),array(array(0)),array('Del'));\r\n\t\t}\r\n\t\t$aTH=array('Status','Absender','Datum','Gruppe','Empfänger','Link','Nachricht','Aktion');\r\n\t\t$HEAD=ArrayToTableHead($aTH);\r\n\t}\r\n\t// OUTPUT //\r\n\techo '<script type=\"text/javascript\">$(\"#pagetitle\").html(\"Inbox\");</script>';\r\n\techo OpenTable('maillist',1);\r\n\techo $HEAD.$ROWS;\r\n\techo CloseTable(1);\r\n}",
"function getSearchBox($formFields=1)\t{\r\n\r\n\t\t\t// Setting form-elements, if applicable:\r\n\t\t$formElements=array('','');\r\n\t\tif ($formFields)\t{\r\n\t\t\t$formElements=array('<form action=\"'.htmlspecialchars($this->listURL()).'\" method=\"post\">','</form>');\r\n\t\t}\r\n\r\n\t\t\t// Make level selector:\r\n\t\t$opt=array();\r\n\t\t$parts = explode('|',$GLOBALS['LANG']->sL('LLL:EXT:categories/locallang.xml:labels.enterSearchLevels'));\r\n\t\twhile(list($kv,$label)=each($parts))\t{\r\n\t\t\t$opt[] = '<option value=\"'.$kv.'\"'.($kv==intval($this->searchLevels)?' selected=\"selected\"':'').'>'.htmlspecialchars($label).'</option>';\r\n\t\t}\r\n\t\t$lMenu = '<select name=\"search_levels\">'.implode('',$opt).'</select>';\r\n\r\n\t\t\t// Table with the search box:\r\n\t\t$content.= '\r\n\t\t\t'.$formElements[0].'\r\n\r\n\t\t\t\t<!--\r\n\t\t\t\t\tSearch box:\r\n\t\t\t\t-->\r\n\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"bgColor4\" id=\"typo3-dblist-search\">\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.enterSearchString',1).'<input type=\"text\" name=\"search_field\" value=\"'.htmlspecialchars($this->searchString).'\"'.$GLOBALS['TBE_TEMPLATE']->formWidth(10).' /></td>\r\n\t\t\t\t\t\t<td>'.$lMenu.'</td>\r\n\t\t\t\t\t\t<td><input type=\"submit\" name=\"search\" value=\"'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.search',1).'\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"3\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showRecords',1).':<input type=\"text\" name=\"showLimit\" value=\"'.htmlspecialchars($this->showLimit?$this->showLimit:'').'\"'.$GLOBALS['SOBE']->doc->formWidth(4).' /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t'.$formElements[1];\r\n\t\t//$content.=t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_searchbox', $GLOBALS['BACK_PATH'],'|<br/>');\r\n\t\treturn $content;\r\n\t}",
"function get_content() {\r\n\t\t\tglobal $CFG, $to,$msg_content,$PAGE,$COURSE,$DB, $OUTPUT;\r\n\t\t\tif ($this->content !== NULL) {\r\n\t\t\t return $this->content;\r\n\t\t\t}\r\n\r\n\t\t\t if (empty($this->instance)) { // Overrides: use no course at all\r\n $courseshown = false;\r\n \r\n\r\n } else {\r\n\t\t\t$context = get_context_instance(CONTEXT_COURSE,$COURSE->id);\r\n\t\t\t$this->content->footer = '';\r\n\t\t\t$this->content = new stdClass;\r\n\t\t\t$this->content->area='block_message';\r\n\t\t\t\r\n\t\t\t$this->content->text .= \"\\n\".'<form class=\"messageform\" id=\"message\" method=\"post\" action=\"'.$CFG->wwwroot.'/blocks/books/search.php\">';\r\n\t\t\t$this->content->text .= '<div align=\"center\"><font color=\"white\" ><b>Search for the books.</b></font></div><div><font color=\"white\"><br/><b>Title: </b></font>'.'<input type=\"textbox\" name=\"books\" size=\"15\" id=\"books\" /></div>';\r\n\t\t\t$this->content->text .= '</br><div align=\"center\"><b><input type=\"submit\" align=\"center\" value=\"Search\" id=\"search\"></b></div>';\r\n\t\t $this->content->text .='</br><div align=\"center\"><b><a href=\"'.$CFG->wwwroot.'/blocks/books/AdvanceSearch.php\">Advance Search</a></b></div>';\r\n\t\t\t$this->content->text .= '</br><div align=\"center\"><b><a href=\"'.$CFG->wwwroot.'/blocks/books/postBook.php\">Post Books</a></b></div>';\r\n\t\t\t$this->content->text .= '</br><div align=\"center\"><b><a href=\"'.$CFG->wwwroot.'/blocks/books/availableBooks.php\">Available Books</a></b></div>';\r\n\t\t\t$this->content->text .= '</br><div align=\"center\"><b><a href=\"'.$CFG->wwwroot.'/blocks/books/mybooks.php\">My Books</a></b></div>';\r\n\t\t\t$this->content->text .='</form>';\r\n\t\t\t\r\n\t\t\t if ($courseshown == SITEID) {\r\n // Being displayed at site level. This will cause the filter to fall back to auto-detecting\r\n // the list of courses it will be grabbing events from.\r\n $filtercourse = NULL;\r\n \r\n } else {\r\n // Forcibly filter events to include only those from the particular course we are in.\r\n $filtercourse = array($courseshown => $this->page->course);\r\n ;\r\n }\r\n\t\t\t}\r\n\t\t\t\t//assign capabilities to users in the course context\r\n\t\t\t\t\t// only the allowed users can access the block \r\n\t\tif (!isloggedin()) {\r\n\t\t\t$this->content->text = 'Not loggedin Yet !';\r\n\t\t}\r\n\t\telse\r\n\t\t{ \t\t\r\n\t\t// retrieve user's data \r\n\t\t\r\n\t\treturn $this->content;\r\n\t\t\t}\r\n\t\t\r\n\t\t}",
"private function Build_Login_Body() {\n\t\tglobal $_LG, $_COOKIE;\n\t\t\n\t\t// lets output our smarty data from the template.\n\t\t$output = $_LG['Smarty']->fetch($this->gui_template_url .\"/login_body.tpl\");\n\t\t\n\t\treturn $output;\n\t}",
"function plugin_dopluginsearch_forum($query, $datestart, $dateend, $topic, $type, $author,$keyType,$page, $perpage)\n{\n global $LANG_GF00, $LANG_GF01, $_TABLES, $_CONF, $CONF_FORUM;\n\n if (empty($type)) {\n $type = 'all';\n }\n // Bail if we aren't supppose to do our search\n if ($type <> 'all' AND $type <> 'forum') {\n $plugin_results = new Plugin();\n $plugin_results->plugin_name = $LANG_GF00['plugin_name'];\n $plugin_results->searchlabel = $LANG_GF00['searchlabel'];\n return $plugin_results;\n }\n \n // Build search SQL\n\n $sqltmp = \" WHERE 1=1 \";\n\n if ( $keyType == 'phrase' ) {\n $q = addslashes($query);\n $sqltmp .= \"AND (comment LIKE '%$query%' OR subject LIKE '%$q%')\";\n } else if ( $keyType == 'any' ) {\n $sqltmp .= 'AND ';\n $tmp = '';\n $mywords = explode( ' ', $query );\n foreach( $mywords AS $mysearchitem ) {\n $mysearchitem = addslashes( $mysearchitem );\n $tmp .= \"( comment LIKE '%$mysearchitem%' OR subject LIKE '%$mysearchitem%' ) OR \";\n }\n $tmp = substr($tmp, 0, strlen($tmp) - 3); // pulls off the last OR\n $sqltmp .= \"($tmp)\";\n } else if ( $keyType == 'all' ) {\n $sqltmp .= 'AND ';\n $tmp = '';\n $mywords = explode( ' ', $query );\n foreach( $mywords AS $mysearchitem ) {\n $mysearchitem = addslashes( $mysearchitem );\n $tmp .= \"( comment LIKE '%$mysearchitem%' ) AND \";\n }\n $tmp = substr($tmp, 0, strlen($tmp) - 4);\n $sqltmp .= \"($tmp)\";\n \n $sqltmp .= 'OR ';\n $tmp = '';\n $mywords = explode( ' ', $query );\n foreach( $mywords AS $mysearchitem ) {\n $mysearchitem = addslashes( $mysearchitem );\n $tmp .= \"( subject LIKE '%$mysearchitem%' ) AND \";\n }\n $tmp = substr($tmp, 0, strlen($tmp) - 4);\n $sqltmp .= \"($tmp)\";\n \n } else {\n $q = addslashes($query);\n $sqltmp = \"WHERE (comment LIKE '%$q%' OR subject LIKE '%$q%')\";\n }\n\n if ( $author != 0 ) {\n $sqltmp .= \" AND uid='\" . $author . \"'\";\n }\n \n // handle date ranges\n\n if (!empty($datestart) && !empty($dateend)) {\n $delim = substr($datestart, 4, 1);\n $sd = explode($delim,$datestart);\n $ed = explode($delim,$dateend);\n $startdate = mktime(0,0,0,$sd[1],$sd[2],$sd[0]);\n $enddate = mktime(0,0,0,$ed[1],$ed[2],$ed[0]) + ( 3600 * 24 ) - 1;\n $sqltmp .= \" AND date BETWEEN '$startdate' AND '$enddate'\";\n }\n \n $sql = \"SELECT id,name,forum,date,subject,comment,views,uid FROM {$_TABLES['gf_topic']} \"\n . $sqltmp . \" ORDER BY date DESC\";\n\n // limit what we are searching for...\n if ( $perpage < 1 ) {\n $perpage = 10;\n }\n $limitStart = ($page-1) * $perpage;\n $limitEnd = $limitStart + $perpage;\n $sql .= \" LIMIT \" . $limitStart . \",\" . $limitEnd;\n\n // Perform search\n $result = DB_query($sql);\n\n // OK, now return coma delmited string of table header labels\n // Need to use language variables\n require_once($_CONF['path_system'] . 'classes/plugin.class.php');\n $plugin_results = new Plugin();\n $plugin_results->plugin_name = 'forum';\n if (!empty($author)) {\n $username = DB_getItem($_TABLES['users'],\"username\",\"uid = {$author}\");\n $plugin_results->searchlabel = sprintf($LANG_GF00['searchresults'],$LANG_GF01['FOR'] . ' ' . $username);\n } else {\n $plugin_results->searchlabel = sprintf($LANG_GF00['searchresults'],\"\");\n }\n $plugin_results->addSearchHeading($LANG_GF01['FORUM']);\n $plugin_results->addSearchHeading($LANG_GF01['SUBJECT']);\n $plugin_results->addSearchHeading($LANG_GF01['DATE']);\n $plugin_results->addSearchHeading($LANG_GF01['VIEWS'] );\n $totalsearched = DB_numRows($result);\n $searchcount=0;\n // NOTE if any of your data items need to be links then add them here!\n // make sure data elements are in an array and in the same order as your\n // headings above!\n for ($i = 1; $i <= $totalsearched; $i++) {\n $A = DB_fetchArray($result);\n $grp_id = DB_getItem($_TABLES['gf_forums'],'grp_id',\"forum_id='{$A['forum']}'\");\n $groupname = DB_getItem($_TABLES['groups'],'grp_name',\"grp_id='$grp_id'\");\n if (SEC_inGroup($groupname) OR $grp_id == 2) {\n if ($CONF_FORUM['use_censor']) {\n $A['subject'] = COM_checkWords($A['subject']);\n }\n $searchcount++;\n $forumname = DB_getItem($_TABLES['gf_forums'],\"forum_name\",\"forum_id='{$A['forum']}'\");\n $subject = forum_mb_wordwrap($A['subject'],$CONF_FORUM['linkinfo_width'],\"<br\" . XHTML . \">\"); // added function\n $thetime = COM_getUserDateTimeFormat ($A['date']);\n $date = $thetime[0];\n $url = $_CONF['site_url']. \"/forum/viewtopic.php?showtopic={$A['id']}\";\n $row = array($forumname, \"<a href=\\\"$url\\\">\" . COM_truncate($subject,$CONF_FORUM['show_subject_length'],'...') . \"</a>\",$date,$A['views']);\n $plugin_results->addSearchResult($row);\n }\n }\n $plugin_results->num_searchresults = $searchcount;\n $plugin_results->num_itemssearched = DB_count($_TABLES['gf_topic']);\n\n return $plugin_results;\n}",
"function initialize(){\n \t\n \t$sql1 = \"SELECT id, id_fuseaction, token, id_author, description, moment FROM \" . $this->fContentTokensTable . \" WHERE 1=2\";\n \t$sql2 = \"SELECT id, id_token, id_language, id_author, title, content, moment FROM \" . $this->fContentTable . \" WHERE 1=2\";\n \t$sql3 = \"SELECT id, id_content, author, commenttext, moment FROM \" . $this->fContentCommentsTable . \" WHERE 1=2\";\n \t\n \treturn $this->fDB->query($sql1) && $this->fDB->query($sql2) && $this->fDB->query($sql3);\n }",
"function gTelefonverzeichnis_TelSearchblock_init()\r\n{\r\n pnSecAddSchema('gTelefonverzeichnis:TelSearch:', 'Block title::');\r\n}",
"function moments_qodef_search_body_class($classes) {\n\n\t\tif ( is_active_widget( false, false, 'qode_search_opener' ) ) {\n\n\t\t\t$classes[] = 'qodef-search-covers-header';\n\n\n\t\t}\n\t\treturn $classes;\n\n\t}",
"public function getAllBodyParts(){\n \tglobal $wpdb; // this is how you get access to the database\n $tableName = $wpdb->prefix . \"cura_body_parts\";\n \n \n $body_parts = $wpdb->get_results(\"SELECT id, name FROM $tableName where name NOT LIKE '%No Body Part Assigned%' ORDER BY name\");\n return $body_parts;\n }",
"public function testAllFieldsInContentTypesExists() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $fields = array_keys($this->contentTypes['test'][$type]['fields']);\n foreach ($fields as $field) {\n try {\n $this->assertArrayHasKey(\n $field,\n $this->contentTypes['system'][$type]['fields'],\n \"Failed asserting that {type}:{field} exists.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n }\n // Verify if all fields in content types passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"protected function getAllContentElementTypes() {\n\t\t\t// The base list is taken from the TCA of tt_content\n\t\t$allContentElements = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];\n\t\t\t// Remove the dummy first element\n\t\tarray_shift($allContentElements);\n\t\t\t// Filter out the \"list_type\" type as plug-ins are displayed separately\n\t\tforeach ($allContentElements as $index => $item) {\n\t\t\tif ($item[1] == 'list') {\n\t\t\t\tunset($allContentElements[$index]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $allContentElements;\n\t}",
"function GetCustomFields()\n\t{\n\t\t$fields = array();\n\t\t$html_body = $this->body['h'];\n\t\tif ($html_body) {\n\t\t\tpreg_match_all('/%field:(.*?)%/is', $html_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t\tpreg_match_all('/%%(.*?)%%/is', $html_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t}\n\n\t\t$text_body = $this->body['t'];\n\t\tif ($text_body) {\n\t\t\tpreg_match_all('/%field:(.*?)%/is', $text_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t\tpreg_match_all('/%%(.*?)%%/is', $text_body, $matches);\n\t\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\t\t$fields += $matches[1];\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/%field:(.*?)%/i', $this->Subject, $matches);\n\n\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\tforeach ($matches[1] as $p => $f_s) {\n\t\t\t\t$fields[] = $f_s;\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/%%(.*?)%%/i', $this->Subject, $matches);\n\n\t\tif (!empty($matches) && isset($matches[1])) {\n\t\t\tforeach ($matches[1] as $p => $f_s) {\n\t\t\t\t$fields[] = $f_s;\n\t\t\t}\n\t\t}\n\n\t\t// in case the field went over multiple lines, strip them out.\n\t\tforeach ($fields as $p => $field) {\n\t\t\t$fields[$p] = str_replace(array(\"\\r\", \"\\n\"), \"\", $field);\n\t\t}\n\n\t\t$fields = array_unique($fields);\n\n\t\t$built_in_fields = array('emailaddress', 'unsubscribelink', 'confirmlink', 'openimage', 'mailinglistarchive', 'webversion', 'companyname', 'companyphone', 'companyaddress', 'link_subscriber_info');\n\t\tforeach ($built_in_fields as $p => $built_in_field) {\n\t\t\t$key = array_search($built_in_field, $fields);\n\t\t\tif ($key !== false) {\n\t\t\t\tunset($fields[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// Sometimes UTF-8 characters inside a custom field name were replaced with\n\t\t// an htmlentities (translated by TinyMCE), so we will need to make sure we include both\n\t\t// decoded and unencoded field name that needed to be searched.\n\t\t$temp = $fields;\n\t\tforeach ($temp as $each) {\n\t\t\t$fields[] = html_entity_decode($each, ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t}\n\n\t\treturn $fields;\n\t}",
"function flexiform_add_pane_content_type_content_types() {\n $types = &drupal_static(__FUNCTION__, array());\n if (!empty($types)) {\n return $types;\n }\n\n // This will hold all the individual field content types.\n $forms = entity_load('flexiform');\n\n foreach ($forms as $form) {\n if (!($display = $form->getDisplay('FlexiformDisplayAddPane')) || !$display->isEnabled()) {\n continue;\n }\n\n $types[$form->form] = array(\n 'category' => t('Flexiforms'),\n 'title' => t('Flexiform: @form_label (@form)', array(\n '@form_label' => $form->label,\n '@form' => $form->form,\n )),\n 'description' => t('Flexiform form edit pane.'),\n 'edit form' => 'flexiform_add_pane_content_type_options',\n );\n }\n\n return $types;\n}"
] | [
"0.5136113",
"0.5129571",
"0.50733644",
"0.50081563",
"0.4992922",
"0.4971766",
"0.49715835",
"0.48863617",
"0.48742646",
"0.48728558",
"0.4867805",
"0.48310596",
"0.47875097",
"0.47395337",
"0.46859056",
"0.46756673",
"0.46112663",
"0.4609562",
"0.45997572",
"0.4595471",
"0.457941",
"0.45552275",
"0.45539522",
"0.45449317",
"0.45275205",
"0.45012942",
"0.44764605",
"0.44444036",
"0.44417801",
"0.4439477"
] | 0.68932784 | 0 |
Operation apiMerchantV3TransactionTransactionIdCapturePostWithHttpInfo Report a capture for a transaction according to its unique functional identifier | public function apiMerchantV3TransactionTransactionIdCapturePostWithHttpInfo($transactionId, $captureRequest = null)
{
$request = $this->apiMerchantV3TransactionTransactionIdCapturePostRequest($transactionId, $captureRequest);
try {
// $options = $this->createHttpClientOption();
try {
$response = $this->client->sendRequest($request);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\ConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\AuthenticationError',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 409:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiMerchantV3TransactionTransactionIdCapturePostRequest($transactionId, $captureRequest = null)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdCapturePost'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}/capture';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($captureRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($captureRequest));\n } else {\n $httpBody = $captureRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiMerchantV3TransactionTransactionIdCapturePost($transactionId, $captureRequest = null)\n {\n $this->apiMerchantV3TransactionTransactionIdCapturePostWithHttpInfo($transactionId, $captureRequest);\n }",
"function CaptureTransaction( $data, $transactionId ) {\n\n $xml = $this->getRequestXML( 'CaptureTransaction', $data );\n\n\n $response = $this->client->doPayIQRequest( $xml, 'CaptureTransaction' );\n\n $data = $this->getXMLFields( $response, [\n 'Succeeded', 'ErrorCode', 'AuthorizedAmount', 'SettledAmount'\n ]);\n\n return $data;\n\n }",
"public function create_credit_card_capture() {\n\n\t\t$this->set_resource( 'transaction' );\n\t\t$this->set_callback( 'submitForSettlement' );\n\n\t\t$FACData = [\n\t\t 'amount' => $this->get_order()->capture->amount,\n\t\t 'transactionId' => $this->getFACOrderNumber(),\n\t\t];\n\n\t\t$this->FACRequest = $this->FACAPI->capture($FACData);\n\t}",
"public function apiMerchantV3TransactionTransactionIdRefundPostWithHttpInfo($transactionId, $refundRequest = null)\n {\n $request = $this->apiMerchantV3TransactionTransactionIdRefundPostRequest($transactionId, $refundRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\ConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function capture($transId) {\n\n\t\t$this->transType = \"CAPTURE\";\n\t\t$this->masterId = $transId;\n\t}",
"public function blueCapture($transId) {\n\n $this->transType = \"CAPTURE\";\n $this->masterId = $transId;\n }",
"public function createTransactionCodeUsingPostWithHttpInfo($transaction_request)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\TransactionCode';\n $request = $this->createTransactionCodeUsingPostRequest($transaction_request);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\com\\hydrogen\\nucleus\\Model\\TransactionCode',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function capturePreviouslyAuthorizedCreditCard($transactionId, int $amount = null, bool $testMode = null)\n {\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $this->options($merchantAuthentication);\n\n // Now capture the previously authorized amount\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType('priorAuthCaptureTransaction');\n if ($amount !== null) {\n $transactionRequestType->setAmount($amount);\n }\n $transactionRequestType->setRefTransId($transactionId);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setTransactionRequest($transactionRequestType);\n // Create the controller and get the response\n $response = $this->handleExecution($testMode, $request);\n\n return $this->handleResponse($response);\n }",
"public function capture_token($ccdetails) {\n\n $options=array();\n $options['x_login'] = $this->configuration['API Login']['value'];\n $options['x_tran_key'] = $this->configuration['Transaction Key']['value'];\n\n\n /* CUSTOMER INFORMATION */\n $options['x_first_name'] = $this->client['firstname'];\n $options['x_last_name'] = $this->client['lastname'];\n $options['x_address'] = $this->client['address1'];\n $options['x_city'] = $this->client['city'];\n $options['x_state'] = $this->client['state'];\n $options['x_zip'] = $this->client['postcode'];\n $options['x_country'] = $this->client['country'];\n $options['x_phone'] = $this->client['phonenumber'];\n $options['x_email'] = $this->client['email'];\n $options['x_cust_id'] = $this->client['client_id'];\n\n\n /* ORDER INFORMATION */\n $options['x_invoice_num'] = $this->invoice_id;\n $options['x_description'] = $this->subject;\n $options['x_amount'] = $this->amount;\n\n\n /* CREDIT CARD INFORMATION */\n // we have token available, use it against payment gateway\n if ($ccdetails['token']) {\n $options['x_card_token'] = $ccdetails['token'];\n } else {\n $options['x_card_num'] = $ccdetails['cardnum'];\n $options['x_exp_date'] = $ccdetails['expdate']; //MMYY\n if($ccdetails['cvv']) {\n //this is manual payment, client passed cvv code\n $options['x_card_code'] = $ccdetails['cvv'];\n }\n }\n\n\n //\n //SEND details to your credit card processor to validate and attempt to charge\n //\n $response = $this->processData($options);\n\n switch ($response['code']) {\n case 1:\n //charge succeeded, add transaction and log it\n $this->logActivity(array(\n 'output' => $response,\n 'result' => PaymentModule::PAYMENT_SUCCESS\n ));\n $this->addTransaction(array(\n 'client_id' => $this->client['client_id'],\n 'invoice_id' => $this->invoice_id,\n 'description' => \"Payment for invoice \".$this->invoice_id,\n 'number' => $response['Transaction ID'],\n 'in' => $this->amount,\n 'fee' => '0'\n ));\n\n //Store token only if client allowed to - $ccetails['store']==true\n if($response['Token'] && $ccdetails['store']) {\n return $response['Token']; //return token to be stored\n } else {\n return true; //capture success\n }\n break;\n\n case 2:\n $this->logActivity(array(\n 'output' => $response,\n 'result' => PaymentModule::PAYMENT_FAILURE\n ));\n return false;\n\n break;\n }\n }",
"public function capture(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CaptureRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CaptureRequest', $parameters);\n }",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function capture($amount = null, $currency = null, array $data = [])\n\t{\n\t\t$params = [\n\t\t\t'transaction' => [\n\t\t\t\t'currency_code' => $currency ?: 'USD'\n\t\t\t]\n\t\t];\n\n\t\tif ($amount > 0)\n\t\t\t$params['transaction']['amount'] = $amount * 100;\n\n\t\t$params['transaction'] += $data;\n\n\t\treturn $this->client->request('https://core.spreedly.com/v1/transactions/'.$this->transactionToken.'/capture.xml', 'post', $params);\n\t}",
"public function spotiiCapture($reference)\n {\n try {\n $this->spotiiHelper->logSpotiiActions(\"****Capture at Spotii Start****\");\n $url = $this->spotiiApiIdentity->getSpotiiBaseUrl() . '/api/v1.0/orders' . '/' . $reference . '/capture' . '/';\n $authToken = $this->spotiiApiConfig->getAuthToken();\n $response = $this->spotiiApiProcessor->call(\n $url,\n $authToken,\n null,\n \\Magento\\Framework\\HTTP\\ZendClient::POST\n );\n $this->spotiiHelper->logSpotiiActions(\"****Capture at Spotii End****\");\n } catch (\\Exception $e) {\n $this->spotiiHelper->logSpotiiActions($e->getMessage());\n throw new LocalizedException(__($e->getMessage()));\n }\n return $response;\n }",
"public function createTransactionCodeUsingPostAsyncWithHttpInfo($transaction_request)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\TransactionCode';\n $request = $this->createTransactionCodeUsingPostRequest($transaction_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function authorizeAndCapture($transaction, $applicationProfileId, $merchantProfileId, $workflowId)\n {\n $this->openSession();\n return $this->transactionProcessingService->authorizeAndCapture($this->sessionToken, $transaction, $applicationProfileId, $merchantProfileId, $workflowId);\n }",
"public function placeRequest(TransferInterface $transferObject)\n {\n $request = $transferObject->getBody();\n $this->_conektaLogger->info('HTTP Client TransactionCapture :: placeRequest', $request);\n\n $txnId = $request['txn_id'];\n\n $this->conektaSalesOrderFactory\n ->create()\n ->setData([\n ConektaSalesOrderInterface::CONEKTA_ORDER_ID => $request['order_id'],\n ConektaSalesOrderInterface::INCREMENT_ORDER_ID => $request['metadata']['order_id']\n ])\n ->save();\n\n $paymentMethod = $request['payment_method_details']['payment_method']['type'];\n $response = [];\n \n //If is offline payment, added extra info needed\n if ($paymentMethod == ConfigProvider::PAYMENT_METHOD_CASH ||\n $paymentMethod == ConfigProvider::PAYMENT_METHOD_BANK_TRANSFER\n ) {\n $response['offline_info'] = [];\n try {\n $conektaOrder = $this->conektaApiClient->getOrderByID($request['order_id']);\n $charge = $conektaOrder->getCharges()->getData()[0];\n\n $txnId = $charge->getID();\n $paymentMethodResponse = $charge->getPaymentMethod();\n $response['offline_info'] = [\n \"type\" => $paymentMethodResponse->getType(),\n \"data\" => [\n \"expires_at\" => $paymentMethodResponse->getExpiresAt()\n ]\n ];\n\n if ($paymentMethod == ConfigProvider::PAYMENT_METHOD_CASH) {\n $response['offline_info']['data']['barcode_url'] = $paymentMethodResponse->getBarcodeUrl();\n $response['offline_info']['data']['reference'] = $paymentMethodResponse->getReference();\n } else {\n $response['offline_info']['data']['clabe'] = $paymentMethodResponse->getClabe();\n $response['offline_info']['data']['bank_name'] = $paymentMethodResponse->getBank();\n }\n } catch (Exception $e) {\n $this->_conektaLogger->error(\n 'EmbedForm :: HTTP Client TransactionCapture :: cannot get offline info. ',\n ['exception' => $e]\n );\n }\n }\n\n $response = $this->generateResponseForCode(\n $response,\n 1,\n $txnId,\n $request['order_id']\n );\n $response['error_code'] = '';\n $response['payment_method_details'] = $request['payment_method_details'];\n\n $this->_conektaLogger->info(\n 'HTTP Client TransactionCapture Iframe Payment :: placeRequest',\n [\n 'request' => $request,\n 'response' => $response\n ]\n );\n\n return $response;\n }",
"public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function capture(array $parameters = array())\n {\n return $this->createRequest('\\Omnipay\\SaferPay\\Message\\CaptureRequest', $parameters);\n }",
"public function capture(array $parameters = [])\n {\n return $this->createRequest('\\Omnipay\\Saferpay\\Message\\CaptureRequest', $parameters);\n }",
"public function capture($id){\n // $response->result->id gives the orderId of the order created above\n $request = new OrdersCaptureRequest($id);\n $request->prefer('return=representation');\n try {\n // Call API with your client and get a response for your call\n $response = $this->client->execute($request);\n\n // If call returns body in response, you can get the deserialized version from the result attribute of the response\n return $response->result;\n }catch (HttpException $ex) {\n echo $ex->statusCode;\n print_r($ex->getMessage());\n return false;\n }\n }",
"public function apiMerchantV3TransactionTransactionIdRefundPostRequest($transactionId, $refundRequest = null)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdRefundPost'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}/refund';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($refundRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($refundRequest));\n } else {\n $httpBody = $refundRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setAsCaptured($transaction_id)\n {\n global $wpdb;\n\n return $wpdb->update(\n $wpdb->prefix . 'wpsc_payex_transactions',\n array(\n 'is_captured' => '1',\n ),\n array('transaction_id' => $transaction_id),\n array(\n '%d',\n ),\n array('%d')\n );\n }",
"private function capture_txn_data( $transaction_id, $items, $status = 'Complete' ) {\n\t\t$total = 0;\n\t\tforeach ( $items as $price ) {\n\t\t\t$total += $price;\n\t\t}\n\t\t$txn_data= array();\n\t\t$txn_data['UserName'] = $this->api_username;\n\t\t$txn_data['Password'] = $this->api_password;\n\t\t$txn_data['TransType'] = 'Capture';\n\t\t$txn_data['PNRef'] = $transaction_id;\n\t\t$txn_data['Amount'] = $transaction_id;\n\n\t\treturn $txn_data;\n\t}",
"public function getTransactionId()\n {\n return $this->getParameter('transactionId');\n }",
"function _doCapt($oID, $captureType = 'Complete', $amt = 0, $currency = 'USD', $note = '') {\n global $db, $doPayPal, $messageStack;\n $doPayPal = $this->paypal_init();\n\n // alt value for $captureType = 'NotComplete';\n\n //@TODO: Read current order status and determine best status to set this to\n $new_order_status = MODULE_PAYMENT_PAYPALWPP_ORDER_STATUS_ID;\n\n\n $orig_order_amount = 0;\n $doPayPal = $this->paypal_init();\n $proceedToCapture = false;\n $captureNote = strip_tags(zen_db_input($_POST['captnote']));\n if (isset($_POST['captfullconfirm']) && $_POST['captfullconfirm'] == 'on') {\n $proceedToCapture = true;\n } else {\n $messageStack->add_session(MODULE_PAYMENT_PAYPALWPP_TEXT_CAPTURE_FULL_CONFIRM_ERROR, 'error');\n }\n if (isset($_POST['captfinal']) && $_POST['captfinal'] == 'on') {\n $captureType = 'Complete';\n } else {\n $captureType = 'NotComplete';\n }\n if (isset($_POST['btndocapture']) && $_POST['btndocapture'] == MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_BUTTON_TEXT_FULL) {\n $captureAmt = (float)$_POST['captamt'];\n if ($captureAmt == 0) {\n $messageStack->add_session(MODULE_PAYMENT_PAYPALWPP_TEXT_INVALID_CAPTURE_AMOUNT, 'error');\n $proceedToCapture = false;\n }\n }\n // look up history on this order from PayPal table\n $sql = \"select * from \" . TABLE_PAYPAL . \" where order_id = :orderID AND parent_txn_id = '' \";\n $sql = $db->bindVars($sql, ':orderID', $oID, 'integer');\n $zc_ppHist = $db->Execute($sql);\n if ($zc_ppHist->RecordCount() == 0) return false;\n $txnID = $zc_ppHist->fields['txn_id'];\n /**\n * Submit capture request to PayPal\n */\n if ($proceedToCapture) {\n $response = $doPayPal->DoCapture($txnID, $captureAmt, $currency, $captureType, '', $captureNote);\n $error = $this->_errorHandler($response, 'DoCapture');\n if (!$error) {\n if (isset($response['PNREF'])) {\n if (!isset($response['AMT'])) $response['AMT'] = $captureAmt;\n if (!isset($response['ORDERTIME'])) $response['ORDERTIME'] = date(\"M-d-Y h:i:s\");\n }\n // Success, so save the results\n $sql_data_array = array('orders_id' => (int)$oID,\n 'orders_status_id' => (int)$new_order_status,\n 'date_added' => 'now()',\n 'comments' => 'FUNDS COLLECTED. Trans ID: ' . urldecode($response['TRANSACTIONID']) . $response['PNREF']. \"\\n\" . ' Amount: ' . urldecode($response['AMT']) . ' ' . $currency . \"\\n\" . 'Time: ' . urldecode($response['ORDERTIME']) . \"\\n\" . (isset($response['RECEIPTID']) ? 'Receipt ID: ' . urldecode($response['RECEIPTID']) : 'Auth Code: ' . $response['AUTHCODE']) . (isset($response['PPREF']) ? \"\\nPPRef: \" . $response['PPREF'] : '') . \"\\n\" . $captureNote,\n 'customer_notified' => 0\n );\n zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n $db->Execute(\"update \" . TABLE_ORDERS . \"\n set orders_status = '\" . (int)$new_order_status . \"'\n where orders_id = '\" . (int)$oID . \"'\");\n $messageStack->add_session(sprintf(MODULE_PAYMENT_PAYPALWPP_TEXT_CAPT_INITIATED, urldecode($response['AMT']), urldecode($response['RECEIPTID'] . $response['AUTHCODE']). $response['PNREF']), 'success');\n return true;\n }\n }\n }",
"public function stockTransferPOSTRequestPostWithHttpInfo($accept, $jiwa_stateful = null, $transfer_no = null, $status = null, $transfer_date = null, $reference = null, $logical_warehouse_id = null, $logical_warehouse_description = null, $physical_warehouse_id = null, $physical_warehouse_description = null, $last_saved_by_staff_id = null, $last_saved_by_staff_user_name = null, $last_saved_by_staff_title = null, $last_saved_by_staff_first_name = null, $last_saved_by_staff_surname = null, $last_saved_date_time = null, $created_by_staff_id = null, $created_by_staff_user_name = null, $created_by_staff_title = null, $created_by_staff_first_name = null, $created_by_staff_surname = null, $created_date_time = null, $lines = null, $notes = null, $documents = null, $custom_field_values = null, $stock_transfer_reason_rec_id = null, $stock_transfer_reason_name = null, $stock_transfer_reason_is_default = null, $stock_transfer_reason_write_off_ledger_account_override = null, $stock_transfer_reason_write_off_ledger_account_rec_id = null, $stock_transfer_reason_write_off_ledger_account_no = null, $stock_transfer_reason_write_off_ledger_account_description = null, $stock_transfer_reason_write_on_ledger_account_override = null, $stock_transfer_reason_write_on_ledger_account_rec_id = null, $stock_transfer_reason_write_on_ledger_account_no = null, $stock_transfer_reason_write_on_ledger_account_description = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\StockTransfer';\n $request = $this->stockTransferPOSTRequestPostRequest($accept, $jiwa_stateful, $transfer_no, $status, $transfer_date, $reference, $logical_warehouse_id, $logical_warehouse_description, $physical_warehouse_id, $physical_warehouse_description, $last_saved_by_staff_id, $last_saved_by_staff_user_name, $last_saved_by_staff_title, $last_saved_by_staff_first_name, $last_saved_by_staff_surname, $last_saved_date_time, $created_by_staff_id, $created_by_staff_user_name, $created_by_staff_title, $created_by_staff_first_name, $created_by_staff_surname, $created_date_time, $lines, $notes, $documents, $custom_field_values, $stock_transfer_reason_rec_id, $stock_transfer_reason_name, $stock_transfer_reason_is_default, $stock_transfer_reason_write_off_ledger_account_override, $stock_transfer_reason_write_off_ledger_account_rec_id, $stock_transfer_reason_write_off_ledger_account_no, $stock_transfer_reason_write_off_ledger_account_description, $stock_transfer_reason_write_on_ledger_account_override, $stock_transfer_reason_write_on_ledger_account_rec_id, $stock_transfer_reason_write_on_ledger_account_no, $stock_transfer_reason_write_on_ledger_account_description, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\StockTransfer',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\StockTransfer',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\StockTransfer',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\StockTransfer',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"private function captureOrder($transaction, $order)\n {\n $this->log->logInfos('# Capture Order '.$order->reference);\n\n $this->dbUtils->deleteOrderPaymentDuplicate($order);\n\n // If Capture is originated in the TPP BO the Operation field is null\n // Otherwise transaction has already been saved\n if (null == $transaction->getOperation() && $transaction->getAttemptId() < 2) {\n try {\n $maintenanceData = new HipayMaintenanceData($this->module);\n // retrieve number of capture or refund request\n $transactionAttempt = $maintenanceData->getNbOperationAttempt('BO_TPP', $order->id);\n\n // save capture items and quantity in prestashop\n $captureData = [\n 'hp_ps_order_id' => $order->id,\n 'hp_ps_product_id' => 0,\n 'operation' => 'BO_TPP',\n 'type' => 'BO',\n 'attempt_number' => $transactionAttempt + 1,\n 'quantity' => 1,\n 'amount' => 0,\n ];\n\n $this->dbMaintenance->setCaptureOrRefundOrder($captureData);\n } catch (Exception $e) {\n $this->log->logException($e);\n throw $e;\n }\n }\n\n // if transaction doesn't exist we create an order payment (if multiple capture, 1 line by amount captured)\n if (0 == $this->dbUtils->countOrderPayment($order->reference, $this->setTransactionRefForPrestashop($transaction, $order))) {\n $this->createOrderPayment($transaction, $order);\n }\n\n return true;\n }",
"abstract protected function authorizeOrPurchase(Transaction $transaction, BasePaymentForm $form, bool $capture = true): RequestResponseInterface;",
"public function getTransactionId()\n {\n return $this->data['ik_payment_id'];\n }"
] | [
"0.70313823",
"0.6710228",
"0.6037769",
"0.5180945",
"0.48434922",
"0.48380393",
"0.45807406",
"0.4501829",
"0.44909754",
"0.44531763",
"0.4424305",
"0.43688557",
"0.43670103",
"0.43313017",
"0.43294445",
"0.43262386",
"0.43058875",
"0.42931926",
"0.42642453",
"0.4256625",
"0.41946214",
"0.4177249",
"0.41654068",
"0.41416574",
"0.40891516",
"0.40694773",
"0.40508157",
"0.4049949",
"0.40448114",
"0.40404356"
] | 0.7702953 | 0 |
Create request for operation 'apiMerchantV3TransactionTransactionIdCapturePost' | public function apiMerchantV3TransactionTransactionIdCapturePostRequest($transactionId, $captureRequest = null)
{
// verify the required parameter 'transactionId' is set
if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdCapturePost'
);
}
$resourcePath = '/api/merchant/v3/transaction/{transactionId}/capture';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($transactionId !== null) {
$resourcePath = str_replace(
'{' . 'transactionId' . '}',
ObjectSerializer::toPathValue($transactionId),
$resourcePath
);
}
/*
*/
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/problem+json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/problem+json'],
['application/json']
);
}
// for model (json/xml)
if (isset($captureRequest)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($captureRequest));
} else {
$httpBody = $captureRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \http_build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
if (!empty($this->config->getAccessToken())) {
$headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = http_build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiMerchantV3TransactionTransactionIdCapturePostWithHttpInfo($transactionId, $captureRequest = null)\n {\n $request = $this->apiMerchantV3TransactionTransactionIdCapturePostRequest($transactionId, $captureRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\ConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function CaptureTransaction( $data, $transactionId ) {\n\n $xml = $this->getRequestXML( 'CaptureTransaction', $data );\n\n\n $response = $this->client->doPayIQRequest( $xml, 'CaptureTransaction' );\n\n $data = $this->getXMLFields( $response, [\n 'Succeeded', 'ErrorCode', 'AuthorizedAmount', 'SettledAmount'\n ]);\n\n return $data;\n\n }",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create_credit_card_capture() {\n\n\t\t$this->set_resource( 'transaction' );\n\t\t$this->set_callback( 'submitForSettlement' );\n\n\t\t$FACData = [\n\t\t 'amount' => $this->get_order()->capture->amount,\n\t\t 'transactionId' => $this->getFACOrderNumber(),\n\t\t];\n\n\t\t$this->FACRequest = $this->FACAPI->capture($FACData);\n\t}",
"public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiMerchantV3TransactionTransactionIdCapturePost($transactionId, $captureRequest = null)\n {\n $this->apiMerchantV3TransactionTransactionIdCapturePostWithHttpInfo($transactionId, $captureRequest);\n }",
"public function getPaymentCreateRequest() {\n $data = null;\n if ($this->amount && $this->currency) {\n // capture pre-authorized payment\n if ($this->parentTransactionId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"authorization\" => $this->parentTransactionId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using Simplify customer identifier\n else if ($this->cardId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"customer\" => $this->cardId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using card token\n else if ($this->cardToken) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"token\" => $this->cardToken,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using raw card data\n else if ($this->cardNumber) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"card\" => array(\n \"expYear\" => $this->expirationYear,\n \"expMonth\" => $this->expirationMonth, \n \"cvc\" => $this->cvc,\n \"number\" => $this->cardNumber\n ),\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n if ($this->billing) {\n $data[\"card\"][\"name\"] = $this->billing->getName();\n $data[\"card\"][\"addressCity\"] = $this->billing->getCity();\n $data[\"card\"][\"addressLine1\"] = $this->billing->getStreetLine(1);\n $data[\"card\"][\"addressLine2\"] = $this->billing->getStreetLine(2);\n $data[\"card\"][\"addressZip\"] = $this->billing->getPostcode();\n $data[\"card\"][\"addressState\"] = $this->billing->getRegion();\n $data[\"card\"][\"addressCountry\"] = $this->billing->getCountryId();\n }\n } \n }\n return $data;\n }",
"public function apiMerchantV3TransactionTransactionIdRefundPostRequest($transactionId, $refundRequest = null)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdRefundPost'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}/refund';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($refundRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($refundRequest));\n } else {\n $httpBody = $refundRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createTransactionRequest()\n\t{\n\t\t$issuer \t\t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->issuer))\n\t\t{\n\t\t\t$issuer \t\t\t\t\t\t=\t' issuer=\"'.$this->xmlEscape($this->issuer).'\"';\n\t\t}\n \n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<redirecttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) \t. '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t\t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t\t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<referrer>' . $this->xmlEscape($this->customer['referrer']) \t\t\t. '</referrer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<user_agent>' . $this->xmlEscape($this->customer['user_agent']) \t\t\t. '</user_agent>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state']) \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t <transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t\t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) \t\t. '</daysactive>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<gateway'.$issuer.'>'.$this->xmlEscape($this->transaction['gateway']) \t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t </transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t <signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</redirecttransaction>';\n \n\t\treturn $request;\n\t}",
"public function placeRequest(TransferInterface $transferObject)\n {\n $request = $transferObject->getBody();\n $this->_conektaLogger->info('HTTP Client TransactionCapture :: placeRequest', $request);\n\n $txnId = $request['txn_id'];\n\n $this->conektaSalesOrderFactory\n ->create()\n ->setData([\n ConektaSalesOrderInterface::CONEKTA_ORDER_ID => $request['order_id'],\n ConektaSalesOrderInterface::INCREMENT_ORDER_ID => $request['metadata']['order_id']\n ])\n ->save();\n\n $paymentMethod = $request['payment_method_details']['payment_method']['type'];\n $response = [];\n \n //If is offline payment, added extra info needed\n if ($paymentMethod == ConfigProvider::PAYMENT_METHOD_CASH ||\n $paymentMethod == ConfigProvider::PAYMENT_METHOD_BANK_TRANSFER\n ) {\n $response['offline_info'] = [];\n try {\n $conektaOrder = $this->conektaApiClient->getOrderByID($request['order_id']);\n $charge = $conektaOrder->getCharges()->getData()[0];\n\n $txnId = $charge->getID();\n $paymentMethodResponse = $charge->getPaymentMethod();\n $response['offline_info'] = [\n \"type\" => $paymentMethodResponse->getType(),\n \"data\" => [\n \"expires_at\" => $paymentMethodResponse->getExpiresAt()\n ]\n ];\n\n if ($paymentMethod == ConfigProvider::PAYMENT_METHOD_CASH) {\n $response['offline_info']['data']['barcode_url'] = $paymentMethodResponse->getBarcodeUrl();\n $response['offline_info']['data']['reference'] = $paymentMethodResponse->getReference();\n } else {\n $response['offline_info']['data']['clabe'] = $paymentMethodResponse->getClabe();\n $response['offline_info']['data']['bank_name'] = $paymentMethodResponse->getBank();\n }\n } catch (Exception $e) {\n $this->_conektaLogger->error(\n 'EmbedForm :: HTTP Client TransactionCapture :: cannot get offline info. ',\n ['exception' => $e]\n );\n }\n }\n\n $response = $this->generateResponseForCode(\n $response,\n 1,\n $txnId,\n $request['order_id']\n );\n $response['error_code'] = '';\n $response['payment_method_details'] = $request['payment_method_details'];\n\n $this->_conektaLogger->info(\n 'HTTP Client TransactionCapture Iframe Payment :: placeRequest',\n [\n 'request' => $request,\n 'response' => $response\n ]\n );\n\n return $response;\n }",
"public function capture(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CaptureRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CaptureRequest', $parameters);\n }",
"abstract protected function authorizeOrPurchase(Transaction $transaction, BasePaymentForm $form, bool $capture = true): RequestResponseInterface;",
"public function disTransfer($amount, $number, $currency){\n // the access taken returned from the disToken() function is sent suing the Basic token\n $base64 = base64_encode($this->_disApiUser .\":\". $this->_disApiKey);\n $externalID = \"YourExternalID\";\n $data = '{\n \"amount\": \"'.$amount.'\",\n \"currency\": \"'.$currency.'\",\n \"externalId\": \"'.$externalID.'\",\n \"payee\": {\n \"partyIdType\": \"MSISDN\",\n \"partyId\": \"'.$number.'\"\n },\n \"payerMessage\": \"From:\",\n \"payeeNote\": \"Transaction ID '.$externalID.'\"\n }';\n //print_r($data);\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, \"https://sandbox.momodeveloper.mtn.com/disbursement/v1_0/transfer\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Ocp-Apim-Subscription-Key: '.$this->_disPrimKey,\n 'X-Target-Environment: sandbox',\n 'Authorization: Bearer '.$this->disToken(),\n 'X-Reference-Id: '.$this->_disXRefId\n ));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_HEADER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n var_dump($result);\n }",
"public function capture($amount = null, $currency = null, array $data = [])\n\t{\n\t\t$params = [\n\t\t\t'transaction' => [\n\t\t\t\t'currency_code' => $currency ?: 'USD'\n\t\t\t]\n\t\t];\n\n\t\tif ($amount > 0)\n\t\t\t$params['transaction']['amount'] = $amount * 100;\n\n\t\t$params['transaction'] += $data;\n\n\t\treturn $this->client->request('https://core.spreedly.com/v1/transactions/'.$this->transactionToken.'/capture.xml', 'post', $params);\n\t}",
"public function capture(array $parameters = [])\n {\n return $this->createRequest('\\Omnipay\\Saferpay\\Message\\CaptureRequest', $parameters);\n }",
"public function capture(array $parameters = array())\n {\n return $this->createRequest('\\Omnipay\\SaferPay\\Message\\CaptureRequest', $parameters);\n }",
"public function make(AuthorizeTransactionContracts $authorizeTransaction)\n {\n $request = new StdClass;\n\n //Request\n $request->RequestId = $authorizeTransaction->getRequestId();\n $request->Version = $authorizeTransaction->getVersion();\n //OrderData\n $request->OrderData = new StdClass;\n $request->OrderData->MerchantId = $authorizeTransaction->getOrderData()->getMerchantId();\n $request->OrderData->OrderId = $authorizeTransaction->getOrderData()->getOrderId();\n $request->OrderData->BraspagOrderId = new SoapVar($authorizeTransaction->getOrderData()->getBraspagOrderId(), SOAP_ENC_OBJECT, 'true');\n //CustomerData\n $request->CustomerData = new StdClass;\n $request->CustomerData->CustomerIdentity = $authorizeTransaction->getCustomerData()->getCustomerIdentity();\n $request->CustomerData->CustomerName = $authorizeTransaction->getCustomerData()->getCustomerName();\n $request->CustomerData->CustomerEmail = $authorizeTransaction->getCustomerData()->getCustomerEmail();\n $request->CustomerData->CustomerAddressData = new SoapVar($authorizeTransaction->getCustomerData()->getCustomerAddressData(), SOAP_ENC_OBJECT, 'true');\n $request->CustomerData->DeliveryAddressData = new SoapVar($authorizeTransaction->getCustomerData()->getCustomerDeliveryAddressData(), SOAP_ENC_OBJECT, 'true');\n $authorizeTransaction->getCustomerData()->getCustomerDeliveryAddressData();\n //PaymentDataCollection\n $Payment = new StdClass;\n $Payment->PaymentMethod = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getPaymentMethod(), XSD_INT, null, null, 'PaymentMethod', BrasPagSoapClient::NAMESPACE);\n $Payment->Amount = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAmount(), XSD_INT, null, null, 'Amount', BrasPagSoapClient::NAMESPACE);\n $Payment->Currency = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getCurrency(), XSD_STRING, null, null, 'Currency', BrasPagSoapClient::NAMESPACE );\n $Payment->Country = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getCountry(), XSD_STRING, null, null, 'Country', BrasPagSoapClient::NAMESPACE );\n\n $PaymentType = $authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getObjPaymentType();\n if ($PaymentType instanceof CreditCardDataRequestContracts){\n $Payment->NumberOfPayments = new SoapVar($PaymentType->getNumberOfPayments(), XSD_STRING, null, null, 'Number', BrasPagSoapClient::NAMESPACE );\n $Payment->PaymentPlan = new SoapVar($PaymentType->getPaymentPlan(), XSD_STRING, null, null, 'PaymentPlan', BrasPagSoapClient::NAMESPACE );\n $Payment->TransactionType = new SoapVar($PaymentType->getTransactionType(), XSD_STRING, null, null, 'TransactionType', BrasPagSoapClient::NAMESPACE );\n $Payment->CardHolder = new SoapVar($PaymentType->getCardHolder(), XSD_STRING, null, null, 'CardHolder', BrasPagSoapClient::NAMESPACE );\n $Payment->CardNumber = new SoapVar($PaymentType->getCardNumber(), XSD_STRING, null, null, 'CardNumber', BrasPagSoapClient::NAMESPACE );\n $Payment->CardSecurityCode = new SoapVar($PaymentType->getCardSecurityCode(), XSD_STRING, null, null, 'CardSecurityCode', BrasPagSoapClient::NAMESPACE );\n $Payment->CardExpirationDate = new SoapVar($PaymentType->getCardExpirationDate(), XSD_STRING, null, null, 'CardSecurityCode', BrasPagSoapClient::NAMESPACE );\n }\n\n $Payment->AdditionalDataCollection = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAdditionalDataCollection(), SOAP_ENC_OBJECT, 'true', NULL, NULL, BrasPagSoapClient::NAMESPACE);\n $Payment->AffiliationData = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAffiliationData(), SOAP_ENC_OBJECT, 'true', NULL, NULL, BrasPagSoapClient::NAMESPACE);\n $request->PaymentDataCollection = new StdClass;\n $request->PaymentDataCollection->PaymentDataRequest = new SoapVar($Payment, SOAP_ENC_OBJECT, $PaymentType->getPaymentType());\n\n return $request;\n }",
"protected function createTransactionCodeUsingPostRequest($transaction_request)\n {\n // verify the required parameter 'transaction_request' is set\n if ($transaction_request === null || (is_array($transaction_request) && count($transaction_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_request when calling createTransactionCodeUsingPost'\n );\n }\n\n $resourcePath = '/nucleus/v1/transaction_code';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($transaction_request)) {\n $_tempBody = $transaction_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setTransactionId($transaction_id)\r\n{\r\n$this->post_data['transactionId'] = $transaction_id;\r\n}",
"public function submit($merchant_id, $format = 'json')\n {\n set_time_limit(0);\n \n $format = strtolower($format);\n\n // Format to view mapping\n $formats = [\n 'xml' => 'Xml',\n 'json' => 'Json',\n ];\n\n // Error on unknown type\n if (!isset($formats[$format])) {\n throw new NotFoundException(__('Unknown format.'));\n }\n $this->viewBuilder()->className($formats[ $format ]);\n\n // Get user information\n $user = $this->Auth->user();\n \n\n $startDate = $this->request->data('start');\n $endDate = $this->request->data('end');\n $startDateNtx = $this->request->data('start_ntx');\n $endDateNtx = $this->request->data('end_ntx');\n $ntx = $this->request->data('ntx');\n \n if ($startDate == 'null') {\n $startDate = null;\n }\n if ($endDate == 'null') {\n $endDate = null;\n }\n $req_txid = isset($this->request->data['txid']) ? $this->request->data('txid') : null;\n if (is_string($req_txid)) {\n $req_txid =empty($req_txid)? []: explode(',', trim($req_txid));\n }\n\n // Step 1 - Create single token. if any exist token found, stop here.\n $tokenLockPath = ROOT.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'SettlementBatch.lock';\n \n // Lock the state for preventing other process\n $tokenFp = tryFileLock($tokenLockPath);\n if (!$tokenFp) {\n $this->dataResponse(['status'=>'error','type'=>'CannotCreateToken']);\n return;\n }\n $this->log('Settlement token locked.', 'debug');\n \n\n\n $particulars = $this->request->data('particulars');\n $reportDate = $this->request->data('report_date');\n\n $params = compact('particulars', 'ntx');\n $params['start_date'] = $startDate;\n $params['end_date'] = $endDate;\n $params['start_date_ntx'] = $startDateNtx;\n $params['end_date_ntx'] = $endDateNtx;\n $params['report_date'] = $reportDate;\n $params['txid'] = $req_txid;\n\n $masterMerchant = $this->merchantService->getMasterMerchant($merchant_id, true);\n \n $batchData = $this->service->batchBuilder->create($masterMerchant, $params);\n $batchData->id = Text::uuid(); // Assign the batch id for the creation\n \n \n try {\n // Requesting client side to submit the total amount for comparing server-side result\n $requestedTotalSettlementAmount = assume($particulars, 'totalSettlementAmount', null);\n if (!isset($requestedTotalSettlementAmount['converted_amount'])) {\n throw new ProcessException('InvalidTotalSettlementAmount', 'submitBatch', 'Total settlement amount need to be submitted.');\n }\n\n $requestedTotalSettlementAmount['converted_amount'] = round(floatval($requestedTotalSettlementAmount['converted_amount']), 2);\n \n // Warning if total settlement amount is equal / lower than zero in server-side result\n $totalSettlementAmount = $batchData->getParticularData('totalSettlementAmount', $batchData->merchantCurrency);\n $totalSettlementAmount['converted_amount'] = round(floatval($totalSettlementAmount['converted_amount']), 2);\n\n if (round($totalSettlementAmount['converted_amount'], 2) != round($requestedTotalSettlementAmount['converted_amount'], 2)) {\n $response = [\n 'server'=>$totalSettlementAmount['converted_amount'],\n 'requested'=>$requestedTotalSettlementAmount['converted_amount'],\n 'particulars'=>$batchData->particulars,\n ];\n throw new ProcessException('UnmatchedTotalSettlementAmount', 'submitBatch', 'Submitted total settlement amount does not match server-side result.', $response);\n }\n \n\n $submittingChecksum = $batchData->getChecksum();\n \n $this->service->batchProcessor->submit($batchData, $user);\n \n $this->Flash->success('Settlement batch created.');\n $response = [\n 'status'=>'done',\n 'msg'=>'Batch created.',\n 'id'=>$batchData->id,\n 'url'=>Router::url(['action'=>'view', $batchData->id]),\n ];\n\n // Remove cached data after submit a batch.\n $this->removeBatchCache($submittingChecksum);\n\n $this->log($response, 'debug');\n\n // Update merchant unsettled records after batch created.\n $this->service->updateMerchantUnsettled();\n\n // Clear cache if checksum provided.\n $checksum = $this->request->data('checksum');\n if (!empty($checksum)) {\n $cacheKey = 'settlement_batch_cached_'.$checksum;\n Cache::delete($cacheKey);\n }\n } catch (ProcessException $exp) {\n $response = [\n 'status'=>'error',\n 'type'=>$exp->type,\n 'msg'=>$exp->message,\n ];\n if ($exp->data != null) {\n $response['data'] = $exp->data;\n }\n $this->log($response, 'error');\n } catch (\\Exception $exp) {\n $response = [\n 'status'=>'error',\n 'type'=>'Exception',\n 'exception'=>get_class($exp),\n 'msg'=>$exp->getMessage(),\n ];\n $this->log($response, 'error');\n }\n\n // Unlock path\n tryFileUnlock($tokenFp);\n @unlink($tokenLockPath);\n $this->log('Settlement token unlocked.', 'debug');\n\n return $this->dataResponse($response);\n }",
"public function accept_transaction(Request $request){\n // TODO : Check user not confirmed transaction\n $transaction = Transaction::findOrFail($request->transaction_id);\n\n if ($transaction->order_id == null){\n $uuid = Uuid::uuid4()->toString();\n $transaction->order_id = $uuid;\n $transaction->transaction_status = \"pending payment\"; \n $transaction->save();\n }\n\n $params = array(\n 'transaction_details' => array(\n 'order_id' => $transaction->order_id,\n 'gross_amount' => $transaction->price,\n )\n );\n \n try {\n $snapToken = \\Midtrans\\Snap::getSnapToken($params);\n } catch (Exception $e) { \n // Kalo ada tambahan Error bisa tulis disini\n\n // 400 : OrderId sudah pernah dipakai sebelumnya\n if ($e->getCode() == '400'){ \n return response()->json([\n 'message' => 'Transaksi telah dilakukan atau OrderId telah dipakai sebelumnya '\n ], 400);\n }\n\n $message = $e->getMessage();\n Log::debug('Error when accept transaction : '.$message);\n return response()->json([\n 'message' => \"Unknown Error, please contact developer, error : $message\"\n ], $e->getCode());\n }\n\n // return dump($snapToken);\n return response()->json(compact('snapToken', 'transaction'));\n \n }",
"protected function rechargeTransactionsByTransactionIdGetRequest($transaction_id)\n {\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_id when calling rechargeTransactionsByTransactionIdGet'\n );\n }\n\n $resourcePath = '/recharge/transactions/{transaction_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transaction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_id' . '}',\n ObjectSerializer::toPathValue($transaction_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function receiveTransaction()\n {\n $callbackJSONData = file_get_contents('php://input');\n $callbackData = json_decode($callbackJSONData);\n\n return json_encode([\n 'resultCode' => $callbackData->Result->ResultCode,\n 'resultDesc' => $callbackData->Result->ResultDesc,\n 'originatorConversationID' => $callbackData->Result->OriginatorConversationID,\n 'conversationID' => $callbackData->Result->ConversationID,\n 'transactionID' => $callbackData->Result->TransactionID,\n 'ReceiptNo' => $callbackData->Result->ResultParameters->ResultParameter[0]->Value,\n 'ConversationID' => $callbackData->Result->ResultParameters->ResultParameter[1]->Value,\n 'FinalisedTime' => $callbackData->Result->ResultParameters->ResultParameter[2]->Value,\n 'Amount' => $callbackData->Result->ResultParameters->ResultParameter[3]->Value,\n 'TransactionStatus' => $callbackData->Result->ResultParameters->ResultParameter[4]->Value,\n 'ReasonType' => $callbackData->Result->ResultParameters->ResultParameter[5]->Value,\n 'TransactionReason' => $callbackData->Result->ResultParameters->ResultParameter[6]->Value,\n 'DebitPartyCharges' => $callbackData->Result->ResultParameters->ResultParameter[7]->Value,\n 'DebitAccountType' => $callbackData->Result->ResultParameters->ResultParameter[8]->Value,\n 'InitiatedTime' => $callbackData->Result->ResultParameters->ResultParameter[9]->Value,\n 'OriginatorConversationID' => $callbackData->Result->ResultParameters->ResultParameter[10]->Value,\n 'CreditPartyName' => $callbackData->Result->ResultParameters->ResultParameter[11]->Value,\n 'DebitPartyName' => $callbackData->Result->ResultParameters->ResultParameter[12]->Value,\n ]);\n }",
"public function create(array $request)\n {\n $apiReques = [];\n $url = $this->getUrl();\n $apiRequest[\"Token\"] = $request[\"Token\"];\n $apiRequest[\"Amount\"] = $request[\"Amount\"];\n\n $this->log->writeLog($apiReques);\n \n $headers = array(\"Content-Type\" => \"application/json\", \"Accept\" => \"application/json\", \"Authorization\" => $request[\"datacap_mid\"]);\n return $this->transferBuilder\n ->setMethod('POST')\n ->setHeaders($headers)\n ->setUri($url)\n ->setBody($apiRequest)\n ->build();\n }",
"function createCheckoutRequest()\n\t{\n\t\t$this->cart_xml \t\t\t\t\t= \t$this->cart->GetXML();\n\t\t$this->fields_xml \t\t\t\t\t= \t$this->fields->GetXML();\n\n\t\t$ganalytics \t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->ganalytics['account']))\n\t\t{\n\t\t\t$ganalytics \t\t\t\t\t.= \t'<google-analytics>';\n\t\t\t$ganalytics \t\t\t\t\t.= \t' <account>' . $this->xmlEscape($this->ganalytics['account']) . '</account>';\n\t\t\t$ganalytics \t\t\t\t\t.= \t'</google-analytics>';\n\t\t}\n\t\t\n\t\tif($this->use_shipping_notification)\n\t\t{\n\t\t\t$use_shipping_xml \t\t\t\t= \"<checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<use-shipping-notification>true</use-shipping-notification>\n\t\t\t\t\t\t\t\t\t\t\t </checkout-settings>\"; \t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$use_shipping_xml \t\t\t\t= \t\"\";\n\t\t}\n\t\t\t\t\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<checkouttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) . '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<referer>' . \t\t $this->xmlEscape($this->customer['referer'])\t\t\t. '</referer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state'])\t \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $this->cart_xml . '\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $this->fields_xml . '\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $ganalytics . '\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $use_shipping_xml . ' \n\t\t\t\t\t\t\t\t\t\t\t\t\t<checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <no-shipping-method>true</no-shipping-method>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t<gateway>'. $this->xmlEscape($this->transaction['gateway']) \t\t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</checkouttransaction>';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn $request;\n\t}",
"public function setTransactionId($transaction_id);",
"function startTransaction()\n\t{\n\t\t$this->checkSettings();\n\t\t$this->setIp();\n\t\t$this->createSignature();\n\t\t$this->SetRef();\n \n\t\t$this->request_xml \t\t\t\t= \t$this->createTransactionRequest();\n\n\t\t$this->api_url \t\t\t\t= \t$this->getApiUrl();\n\t\t$this->reply_xml \t\t\t\t= \t$this->xmlPost($this->api_url, $this->request_xml);\n \n\t\tif (!$this->reply_xml)\n\t\t\treturn false;\n \n\t\t$rootNode \t\t\t\t\t\t= \t$this->parseXmlResponse($this->reply_xml);\n\t\tif (!$rootNode)\n\t\t\treturn false;\n \n\t\t$this->payment_url \t\t\t\t= \t$this->xmlUnescape($rootNode['transaction']['payment_url']['VALUE']);\n\t\treturn $this->payment_url;\n\t}",
"protected function actionPost() { \n \n $data = $this->data;\n if(\n !$data \n || !isset($data[\"TransactionId\"]) \n || !isset($data[\"UserId\"]) \n || !isset($data[\"CurrencyAmount\"])\n || !isset($data[\"Verifier\"])\n ) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Invalid Parameters\"\n ];\n return $response;\n }\n\n $transactionId = $data[\"TransactionId\"];\n $userId = $data[\"UserId\"];\n $currencyAmount = $data[\"CurrencyAmount\"];\n $verifier = $data[\"Verifier\"];\n\n $transaction = new Transaction($transactionId,$userId,$currencyAmount);\n $isValidTransaction = $transaction->isValid($verifier);\n if(!$isValidTransaction) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Invalid Verifier\"\n ];\n return $response; \n }\n\n $transactionRepository = new TransactionRepository();\n $existedTransaction = $transactionRepository->find($transactionId);\n\n if($existedTransaction) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Duplicate transaction with TransactionId:$transactionId\"\n ];\n return $response; \n }\n\n $transactionRepository->save($transaction);\n\n $response = [\n \"Success\" => true\n ];\n \n\n return $response; \n }",
"protected function quotesV2PostRequest($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_id' is set\n if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'due_date' is set\n if ($due_date === null || (is_array($due_date) && count($due_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $due_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'quote_date' is set\n if ($quote_date === null || (is_array($quote_date) && count($quote_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $quote_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'created_utc' is set\n if ($created_utc === null || (is_array($created_utc) && count($created_utc) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_utc when calling quotesV2Post'\n );\n }\n // verify the required parameter 'approved_date' is set\n if ($approved_date === null || (is_array($approved_date) && count($approved_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $approved_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null || (is_array($currency_code) && count($currency_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'status' is set\n if ($status === null || (is_array($status) && count($status) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $status when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_rate' is set\n if ($currency_rate === null || (is_array($currency_rate) && count($currency_rate) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_rate when calling quotesV2Post'\n );\n }\n // verify the required parameter 'company_reference' is set\n if ($company_reference === null || (is_array($company_reference) && count($company_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $company_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'eu_third_party' is set\n if ($eu_third_party === null || (is_array($eu_third_party) && count($eu_third_party) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $eu_third_party when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_reference' is set\n if ($customer_reference === null || (is_array($customer_reference) && count($customer_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_customer_name' is set\n if ($invoice_customer_name === null || (is_array($invoice_customer_name) && count($invoice_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address1' is set\n if ($invoice_address1 === null || (is_array($invoice_address1) && count($invoice_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address2' is set\n if ($invoice_address2 === null || (is_array($invoice_address2) && count($invoice_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_postal_code' is set\n if ($invoice_postal_code === null || (is_array($invoice_postal_code) && count($invoice_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_city' is set\n if ($invoice_city === null || (is_array($invoice_city) && count($invoice_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_country_code' is set\n if ($invoice_country_code === null || (is_array($invoice_country_code) && count($invoice_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_customer_name' is set\n if ($delivery_customer_name === null || (is_array($delivery_customer_name) && count($delivery_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address1' is set\n if ($delivery_address1 === null || (is_array($delivery_address1) && count($delivery_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address2' is set\n if ($delivery_address2 === null || (is_array($delivery_address2) && count($delivery_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_postal_code' is set\n if ($delivery_postal_code === null || (is_array($delivery_postal_code) && count($delivery_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_city' is set\n if ($delivery_city === null || (is_array($delivery_city) && count($delivery_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_country_code' is set\n if ($delivery_country_code === null || (is_array($delivery_country_code) && count($delivery_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_name' is set\n if ($delivery_method_name === null || (is_array($delivery_method_name) && count($delivery_method_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_code' is set\n if ($delivery_method_code === null || (is_array($delivery_method_code) && count($delivery_method_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_code' is set\n if ($delivery_term_code === null || (is_array($delivery_term_code) && count($delivery_term_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_name' is set\n if ($delivery_term_name === null || (is_array($delivery_term_name) && count($delivery_term_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_is_private_person' is set\n if ($customer_is_private_person === null || (is_array($customer_is_private_person) && count($customer_is_private_person) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_is_private_person when calling quotesV2Post'\n );\n }\n // verify the required parameter 'includes_vat' is set\n if ($includes_vat === null || (is_array($includes_vat) && count($includes_vat) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $includes_vat when calling quotesV2Post'\n );\n }\n // verify the required parameter 'is_domestic' is set\n if ($is_domestic === null || (is_array($is_domestic) && count($is_domestic) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $is_domestic when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_type' is set\n if ($rot_reduced_invoicing_type === null || (is_array($rot_reduced_invoicing_type) && count($rot_reduced_invoicing_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_property_type' is set\n if ($rot_property_type === null || (is_array($rot_property_type) && count($rot_property_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_property_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_property_name' is set\n if ($rot_reduced_invoicing_property_name === null || (is_array($rot_reduced_invoicing_property_name) && count($rot_reduced_invoicing_property_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_property_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_org_number' is set\n if ($rot_reduced_invoicing_org_number === null || (is_array($rot_reduced_invoicing_org_number) && count($rot_reduced_invoicing_org_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_org_number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_amount' is set\n if ($rot_reduced_invoicing_amount === null || (is_array($rot_reduced_invoicing_amount) && count($rot_reduced_invoicing_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_automatic_distribution' is set\n if ($rot_reduced_invoicing_automatic_distribution === null || (is_array($rot_reduced_invoicing_automatic_distribution) && count($rot_reduced_invoicing_automatic_distribution) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_automatic_distribution when calling quotesV2Post'\n );\n }\n // verify the required parameter 'persons' is set\n if ($persons === null || (is_array($persons) && count($persons) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $persons when calling quotesV2Post'\n );\n }\n // verify the required parameter 'terms_of_payment' is set\n if ($terms_of_payment === null || (is_array($terms_of_payment) && count($terms_of_payment) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $terms_of_payment when calling quotesV2Post'\n );\n }\n // verify the required parameter 'sales_document_attachments' is set\n if ($sales_document_attachments === null || (is_array($sales_document_attachments) && count($sales_document_attachments) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sales_document_attachments when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rows' is set\n if ($rows === null || (is_array($rows) && count($rows) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rows when calling quotesV2Post'\n );\n }\n // verify the required parameter 'total_amount' is set\n if ($total_amount === null || (is_array($total_amount) && count($total_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'vat_amount' is set\n if ($vat_amount === null || (is_array($vat_amount) && count($vat_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vat_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'roundings_amount' is set\n if ($roundings_amount === null || (is_array($roundings_amount) && count($roundings_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $roundings_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'uses_green_technology' is set\n if ($uses_green_technology === null || (is_array($uses_green_technology) && count($uses_green_technology) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $uses_green_technology when calling quotesV2Post'\n );\n }\n\n $resourcePath = '/v2/quotes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($id !== null) {\n $formParams['Id'] = ObjectSerializer::toFormValue($id);\n }\n // form params\n if ($number !== null) {\n $formParams['Number'] = ObjectSerializer::toFormValue($number);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['CustomerId'] = ObjectSerializer::toFormValue($customer_id);\n }\n // form params\n if ($due_date !== null) {\n $formParams['DueDate'] = ObjectSerializer::toFormValue($due_date);\n }\n // form params\n if ($quote_date !== null) {\n $formParams['QuoteDate'] = ObjectSerializer::toFormValue($quote_date);\n }\n // form params\n if ($created_utc !== null) {\n $formParams['CreatedUtc'] = ObjectSerializer::toFormValue($created_utc);\n }\n // form params\n if ($approved_date !== null) {\n $formParams['ApprovedDate'] = ObjectSerializer::toFormValue($approved_date);\n }\n // form params\n if ($currency_code !== null) {\n $formParams['CurrencyCode'] = ObjectSerializer::toFormValue($currency_code);\n }\n // form params\n if ($status !== null) {\n $formParams['Status'] = ObjectSerializer::toFormValue($status);\n }\n // form params\n if ($currency_rate !== null) {\n $formParams['CurrencyRate'] = ObjectSerializer::toFormValue($currency_rate);\n }\n // form params\n if ($company_reference !== null) {\n $formParams['CompanyReference'] = ObjectSerializer::toFormValue($company_reference);\n }\n // form params\n if ($eu_third_party !== null) {\n $formParams['EuThirdParty'] = ObjectSerializer::toFormValue($eu_third_party);\n }\n // form params\n if ($customer_reference !== null) {\n $formParams['CustomerReference'] = ObjectSerializer::toFormValue($customer_reference);\n }\n // form params\n if ($invoice_customer_name !== null) {\n $formParams['InvoiceCustomerName'] = ObjectSerializer::toFormValue($invoice_customer_name);\n }\n // form params\n if ($invoice_address1 !== null) {\n $formParams['InvoiceAddress1'] = ObjectSerializer::toFormValue($invoice_address1);\n }\n // form params\n if ($invoice_address2 !== null) {\n $formParams['InvoiceAddress2'] = ObjectSerializer::toFormValue($invoice_address2);\n }\n // form params\n if ($invoice_postal_code !== null) {\n $formParams['InvoicePostalCode'] = ObjectSerializer::toFormValue($invoice_postal_code);\n }\n // form params\n if ($invoice_city !== null) {\n $formParams['InvoiceCity'] = ObjectSerializer::toFormValue($invoice_city);\n }\n // form params\n if ($invoice_country_code !== null) {\n $formParams['InvoiceCountryCode'] = ObjectSerializer::toFormValue($invoice_country_code);\n }\n // form params\n if ($delivery_customer_name !== null) {\n $formParams['DeliveryCustomerName'] = ObjectSerializer::toFormValue($delivery_customer_name);\n }\n // form params\n if ($delivery_address1 !== null) {\n $formParams['DeliveryAddress1'] = ObjectSerializer::toFormValue($delivery_address1);\n }\n // form params\n if ($delivery_address2 !== null) {\n $formParams['DeliveryAddress2'] = ObjectSerializer::toFormValue($delivery_address2);\n }\n // form params\n if ($delivery_postal_code !== null) {\n $formParams['DeliveryPostalCode'] = ObjectSerializer::toFormValue($delivery_postal_code);\n }\n // form params\n if ($delivery_city !== null) {\n $formParams['DeliveryCity'] = ObjectSerializer::toFormValue($delivery_city);\n }\n // form params\n if ($delivery_country_code !== null) {\n $formParams['DeliveryCountryCode'] = ObjectSerializer::toFormValue($delivery_country_code);\n }\n // form params\n if ($delivery_method_name !== null) {\n $formParams['DeliveryMethodName'] = ObjectSerializer::toFormValue($delivery_method_name);\n }\n // form params\n if ($delivery_method_code !== null) {\n $formParams['DeliveryMethodCode'] = ObjectSerializer::toFormValue($delivery_method_code);\n }\n // form params\n if ($delivery_term_code !== null) {\n $formParams['DeliveryTermCode'] = ObjectSerializer::toFormValue($delivery_term_code);\n }\n // form params\n if ($delivery_term_name !== null) {\n $formParams['DeliveryTermName'] = ObjectSerializer::toFormValue($delivery_term_name);\n }\n // form params\n if ($customer_is_private_person !== null) {\n $formParams['CustomerIsPrivatePerson'] = ObjectSerializer::toFormValue($customer_is_private_person);\n }\n // form params\n if ($includes_vat !== null) {\n $formParams['IncludesVat'] = ObjectSerializer::toFormValue($includes_vat);\n }\n // form params\n if ($is_domestic !== null) {\n $formParams['IsDomestic'] = ObjectSerializer::toFormValue($is_domestic);\n }\n // form params\n if ($rot_reduced_invoicing_type !== null) {\n $formParams['RotReducedInvoicingType'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_type);\n }\n // form params\n if ($rot_property_type !== null) {\n $formParams['RotPropertyType'] = ObjectSerializer::toFormValue($rot_property_type);\n }\n // form params\n if ($rot_reduced_invoicing_property_name !== null) {\n $formParams['RotReducedInvoicingPropertyName'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_property_name);\n }\n // form params\n if ($rot_reduced_invoicing_org_number !== null) {\n $formParams['RotReducedInvoicingOrgNumber'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_org_number);\n }\n // form params\n if ($rot_reduced_invoicing_amount !== null) {\n $formParams['RotReducedInvoicingAmount'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_amount);\n }\n // form params\n if ($rot_reduced_invoicing_automatic_distribution !== null) {\n $formParams['RotReducedInvoicingAutomaticDistribution'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_automatic_distribution);\n }\n // form params\n if ($persons !== null) {\n $formParams['Persons'] = ObjectSerializer::toFormValue($persons);\n }\n // form params\n if ($terms_of_payment !== null) {\n $formParams['TermsOfPayment'] = ObjectSerializer::toFormValue($terms_of_payment);\n }\n // form params\n if ($sales_document_attachments !== null) {\n $formParams['SalesDocumentAttachments'] = ObjectSerializer::toFormValue($sales_document_attachments);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // form params\n if ($total_amount !== null) {\n $formParams['TotalAmount'] = ObjectSerializer::toFormValue($total_amount);\n }\n // form params\n if ($vat_amount !== null) {\n $formParams['VatAmount'] = ObjectSerializer::toFormValue($vat_amount);\n }\n // form params\n if ($roundings_amount !== null) {\n $formParams['RoundingsAmount'] = ObjectSerializer::toFormValue($roundings_amount);\n }\n // form params\n if ($uses_green_technology !== null) {\n $formParams['UsesGreenTechnology'] = ObjectSerializer::toFormValue($uses_green_technology);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}/authorization';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($authorizationRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($authorizationRequest));\n } else {\n $httpBody = $authorizationRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | [
"0.6596898",
"0.6192548",
"0.6039347",
"0.5875315",
"0.58223736",
"0.5662693",
"0.55550927",
"0.5408215",
"0.534844",
"0.5224614",
"0.5206938",
"0.5199564",
"0.5193439",
"0.51833254",
"0.5135489",
"0.51048976",
"0.5093434",
"0.5066597",
"0.5035216",
"0.5029691",
"0.5026733",
"0.4984999",
"0.49668983",
"0.49582762",
"0.4947021",
"0.49446785",
"0.49424303",
"0.4935151",
"0.49334583",
"0.49271986"
] | 0.773746 | 0 |
Create request for operation 'apiMerchantV3TransactionTransactionIdGet' | public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)
{
// verify the required parameter 'transactionId' is set
if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'
);
}
$resourcePath = '/api/merchant/v3/transaction/{transactionId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($transactionId !== null) {
$resourcePath = str_replace(
'{' . 'transactionId' . '}',
ObjectSerializer::toPathValue($transactionId),
$resourcePath
);
}
/*
*/
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/hal+json', 'application/problem+json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/hal+json', 'application/problem+json'],
[]
);
}
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \http_build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
if (!empty($this->config->getAccessToken())) {
$headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = http_build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTransactionId();",
"public function getByTransactionId($transaction_id);",
"abstract function getTransactionId();",
"public function apiMerchantV3TransactionGetRequest($firstname = null, $lastname = null, $orderId = null, $pageSize = 100, $page = null, $status = null, $minOrderValue = null, $maxOrderValue = null, $tId = null)\n {\n if ($tId !== null && count($tId) > 1000) {\n throw new \\InvalidArgumentException('invalid value for \"$tId\" when calling TransactionApi.apiMerchantV3TransactionGet, number of items must be less than or equal to 1000.');\n }\n\n\n $resourcePath = '/api/merchant/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($firstname !== null) {\n if('form' === 'form' && is_array($firstname)) {\n foreach($firstname as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['firstname'] = $firstname;\n }\n }\n // query params\n if ($lastname !== null) {\n if('form' === 'form' && is_array($lastname)) {\n foreach($lastname as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['lastname'] = $lastname;\n }\n }\n // query params\n if ($orderId !== null) {\n if('form' === 'form' && is_array($orderId)) {\n foreach($orderId as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['orderId'] = $orderId;\n }\n }\n // query params\n if ($pageSize !== null) {\n if('form' === 'form' && is_array($pageSize)) {\n foreach($pageSize as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['pageSize'] = $pageSize;\n }\n }\n // query params\n if ($page !== null) {\n if('form' === 'form' && is_array($page)) {\n foreach($page as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['page'] = $page;\n }\n }\n // query params\n if ($status !== null) {\n if('form' === 'form' && is_array($status)) {\n foreach($status as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['status'] = $status;\n }\n }\n // query params\n if ($minOrderValue !== null) {\n if('form' === 'form' && is_array($minOrderValue)) {\n foreach($minOrderValue as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['minOrderValue'] = $minOrderValue;\n }\n }\n // query params\n if ($maxOrderValue !== null) {\n if('form' === 'form' && is_array($maxOrderValue)) {\n foreach($maxOrderValue as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['maxOrderValue'] = $maxOrderValue;\n }\n }\n // query params\n if ($tId !== null) {\n if('form' === 'form' && is_array($tId)) {\n foreach($tId as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tId'] = $tId;\n }\n }\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdGetRequest($technicalTransactionId)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function rechargeTransactionsByTransactionIdGetRequest($transaction_id)\n {\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_id when calling rechargeTransactionsByTransactionIdGet'\n );\n }\n\n $resourcePath = '/recharge/transactions/{transaction_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transaction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_id' . '}',\n ObjectSerializer::toPathValue($transaction_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getTx($txid)\n {\n }",
"public function getTransactionId()\n {\n return $this->getParameter('transactionId');\n }",
"public function requestTransaction(string $transactionId) : TransactionResponse {\n return $this->transactions()->transaction($transactionId);\n }",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function actionGetTransaction($id)\n\t{\n\t\tif ($id === '-- Select a transaction --') {\n\t\t\treturn;\n\t\t}\n\t\t$transaction_model = Yii::$app->modelFinder->findTransactionModel($id); // @TODO: change to dynamic transaction id\n\t\t$customer_model = Yii::$app->modelFinder->findCustomerModel($transaction_model->customer_code);\n\n\t\t// retrieve all transaction details\n\t\t$transaction_details_model = Yii::$app->modelFinder->getTransactionDetailList(null, null, null,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ['transaction_id' => $transaction_model->id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'status' \t\t=> [Yii::$app->params['STATUS_PROCESS'], Yii::$app->params['STATUS_CLOSED'], Yii::$app->params['STATUS_REJECTED']]], false, null);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t$transaction_model_properties = [\n\t\t\t\t\t\t\t\t\t\t 'app\\models\\TrxTransactions' => [\n\t\t\t\t\t\t\t\t\t\t 'id',\n\t\t\t\t\t\t\t\t\t\t 'customer_code',\n\t\t\t\t\t\t\t\t\t\t 'sap_no',\n\t\t\t\t\t\t\t\t\t\t 'created_date',\n\t\t\t\t\t\t\t\t\t\t 'plant_location',\n\t\t\t\t\t\t\t\t\t\t 'storage_location',\n\t\t\t\t\t\t\t\t\t\t 'truck_van',\n\t\t\t\t\t\t\t\t\t\t 'remarks',\n\t\t\t\t\t\t\t\t\t\t ],\n\t\t\t\t\t\t\t\t\t\t];\n\n\t\t$customer_model_properties = \t[\n\t\t\t\t\t\t\t\t\t\t 'app\\models\\MstCustomer' => [\n\t\t\t\t\t\t\t\t\t\t 'customer_name' => 'name',\n\t\t\t\t\t\t\t\t\t\t ],\n\t\t\t\t\t\t\t\t\t\t];\n\t\t\n\t\t// get pallet count\n\t\t$pallet_count = Yii::$app->modelFinder->getTransactionDetailList(null, 'id', null, ['transaction_id' => $transaction_model->id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t'status' \t\t => [Yii::$app->params['STATUS_PROCESS'], Yii::$app->params['STATUS_CLOSED'], Yii::$app->params['STATUS_REJECTED']]], false, 'pallet_no');\n\t\t\n\t\t// get total weight from trx_transaction_details\n\t\t$total_weight = array_sum(ArrayHelper::map($transaction_details_model, 'id', 'total_weight'));\n\n\t\t$transaction_header = ArrayHelper::toArray($transaction_model, $transaction_model_properties);\n\t\t$customer_name = ArrayHelper::toArray($customer_model, $customer_model_properties);\n\t\t\n\t\t$transaction_header = ArrayHelper::merge($transaction_header, $customer_name);\n\t\t\n\t\t$transaction_header['pallet_count'] = $pallet_count;\n\t\t$transaction_header['total_weight'] = $total_weight;\n\t\t\n\t\t$transaction_header['created_date_formatted'] = date('m/d/Y', strtotime($transaction_header['created_date']));\n\t\t\n\t\techo json_encode($transaction_header);\n\t}",
"public function setTransactionId($transaction_id);",
"public function setTransactionId() : string;",
"public function getTransactionId(): string;",
"public function setTransactionId($value)\n {\n return $this->setParameter('transactionId', $value);\n }",
"public function setTransactionId($transactionId);",
"function createTransactionRequest()\n\t{\n\t\t$issuer \t\t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->issuer))\n\t\t{\n\t\t\t$issuer \t\t\t\t\t\t=\t' issuer=\"'.$this->xmlEscape($this->issuer).'\"';\n\t\t}\n \n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<redirecttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) \t. '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t\t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t\t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<referrer>' . $this->xmlEscape($this->customer['referrer']) \t\t\t. '</referrer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<user_agent>' . $this->xmlEscape($this->customer['user_agent']) \t\t\t. '</user_agent>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state']) \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t <transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t\t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) \t\t. '</daysactive>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<gateway'.$issuer.'>'.$this->xmlEscape($this->transaction['gateway']) \t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t </transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t <signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</redirecttransaction>';\n \n\t\treturn $request;\n\t}",
"public function generateTransactionId($parameters = []);",
"function createUpdateTransactionRequest()\n\t{\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<updatetransaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) . '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) . '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) . '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<invoiceid>' . $this->xmlEscape($this->transaction['invoice_id']) . '</invoiceid>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<shipdate>' . $this->xmlEscape($this->transaction['shipdate']) \t. '</shipdate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t</updatetransaction>';\n \n\t\treturn $request;\n\t}",
"public function getTransactionId()\n {\n return $this->data['MerchantTradeNo'];\n }",
"public function setTransactionId($transaction_id)\n {\n $this->transaction_id = $transaction_id;\n return $this;\n }",
"public function transaction($transactionId)\n {\n // Verify required parameters\n if (!$transactionId) {\n return $this->setError('Please enter a transaction ID.');\n }\n\n $params = array(\n 'client_id' => $this->apiKey,\n 'client_secret' => $this->apiSecret\n );\n\n // Build request, and send it to Dwolla\n $response = $this->get(\"transactions/{$transactionId}\", $params);\n\n // Parse Dwolla's response\n $transaction = $this->parse($response);\n\n return $transaction;\n }",
"public function getTransactionId() { return $this->TransactionId; }",
"public function getTransactionId()\n {\n return $this->transaction_id;\n }",
"function getTransactionId() {\n\t\treturn $this->transactionId;\n\t}",
"protected function createTransaction(): Transaction\n {\n return new Transaction([\n 'billerCode' => '5566778',\n 'paymentAccountBSB' => '084455',\n 'paymentAccountNumber' => '112233445',\n 'customerReferenceNumber' => '9457689335',\n 'amount' => '2599',\n 'lodgementReference1' => 'lodgeRef1',\n 'lodgementReference2' => 'lodgeRef2',\n 'lodgementReference3' => 'lodgeRef2',\n ]);\n }",
"public function getTransactionId()\n {\n return $this->transactionId;\n }",
"function getTransactions($blockGetTransactionsRequest) {\n $blockGetTransactionsResponse = new BlockGetTransactionsResponse();\n $blockGetTransactionsResult = new BlockGetTransactionsResult();\n try {\n if(!($blockGetTransactionsRequest instanceof BlockGetTransactionsRequest)){\n throw new SDKException(\"INVALID_REQUEST_ERROR\", null);\n }\n if (Tools::isEmpty($blockGetTransactionsRequest)) {\n throw new SDKException(\"REQUEST_NULL_ERROR\", null);\n }\n $blockNumber = $blockGetTransactionsRequest->getBlockNumber();\n if (Tools::isEmpty($blockNumber) || !is_int($blockNumber) || $blockNumber < 1) {\n throw new SDKException(\"INVALID_BLOCKNUMBER_ERROR\", null);\n }\n if(Tools::isEmpty(General::getInstance()->getUrl())) {\n throw new SDKException(\"URL_EMPTY_ERROR\", null);\n }\n $baseUrl = General::getInstance()->blockGetTransactionsUrl($blockNumber);\n $result = Http::get($baseUrl);\n if (Tools::isEmpty($result)) {\n throw new SDKException(\"CONNECTNETWORK_ERROR\", null);\n }\n $blockGetInfoResponse = Tools::jsonToClass($result, $blockGetTransactionsResponse);\n $errorCode = $blockGetInfoResponse->error_code;\n if (4 == $errorCode) {\n $errorDesc = $blockGetInfoResponse->error_desc;\n throw new SDKException($errorCode, is_null($errorDesc)? \"Block(\" . $blockNumber . \") does not exist\" : $errorDesc);\n }\n } catch(SDKException $e) {\n $blockGetTransactionsResponse->buildResponse($e->getErrorCode(), $e->getErrorDesc(), $blockGetTransactionsResult);\n }\n catch (\\Exception $e) {\n $blockGetTransactionsResponse->buildResponse(20000, $e->getMessage(), $blockGetTransactionsResult);\n }\n return $blockGetTransactionsResponse;\n }",
"public function setTransactionId($value) \n {\n $this->_fields['TransactionId']['FieldValue'] = $value;\n return $this;\n }",
"public function setTransactionId($value) \n {\n $this->_fields['TransactionId']['FieldValue'] = $value;\n return $this;\n }"
] | [
"0.66709423",
"0.64615417",
"0.641374",
"0.6408535",
"0.6374888",
"0.6224218",
"0.62073624",
"0.61412543",
"0.6114779",
"0.6096841",
"0.6087182",
"0.6075812",
"0.60614276",
"0.60451317",
"0.6040457",
"0.6005522",
"0.5979307",
"0.5961478",
"0.59086657",
"0.58714193",
"0.58704805",
"0.5829176",
"0.5826239",
"0.58174425",
"0.57800084",
"0.57558936",
"0.57418555",
"0.56869745",
"0.56720096",
"0.56720096"
] | 0.7759039 | 0 |
Operation apiMerchantV3TransactionTransactionIdRefundPostWithHttpInfo Report a refund for a transaction according to its unique functional identifier | public function apiMerchantV3TransactionTransactionIdRefundPostWithHttpInfo($transactionId, $refundRequest = null)
{
$request = $this->apiMerchantV3TransactionTransactionIdRefundPostRequest($transactionId, $refundRequest);
try {
// $options = $this->createHttpClientOption();
try {
$response = $this->client->sendRequest($request);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\ConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\AuthenticationError',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiMerchantV3TransactionTransactionIdRefundPostRequest($transactionId, $refundRequest = null)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdRefundPost'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}/refund';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($refundRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($refundRequest));\n } else {\n $httpBody = $refundRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiMerchantV3TransactionTransactionIdRefundPost($transactionId, $refundRequest = null)\n {\n $this->apiMerchantV3TransactionTransactionIdRefundPostWithHttpInfo($transactionId, $refundRequest);\n }",
"public function createRefundWithHttpInfo($location_id, $body)\n {\n // verify the required parameter 'location_id' is set\n if ($location_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $location_id when calling\n createRefund');\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createRefund'\n );\n }\n\n // parse inputs\n $resourcePath = \"/v1/{location_id}/refunds\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = ApiClient::selectHeaderAccept(['application/json']);\n if ($_header_accept !== null) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(['application/json']);\n\n // path params\n if ($location_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"location_id\" . \"}\",\n $this->apiClient->getSerializer()\n ->toPathValue($location_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (!empty($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->apiClient->getConfig()->getAccessToken() !== \"\") {\n $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()\n ->getAccessToken();\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n \\SquareConnect\\Model\\V1Refund::class\n );\n if (!$response) {\n return [null, $statusCode, $httpHeader];\n }\n\n return [\n \\SquareConnect\\ObjectSerializer::deserialize(\n $response,\n \\SquareConnect\\Model\\V1Refund::class,\n $httpHeader\n ),\n $statusCode,\n $httpHeader\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = \\SquareConnect\\ObjectSerializer::deserialize(\n $e->getResponseBody(),\n \\SquareConnect\\Model\\V1Refund::class,\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function create_refund() {\n\t $this->set_resource( 'transaction' );\n\t $this->set_callback( 'refund' );\n\n\t $FACData = [\n\t 'amount' => $this->get_order()->refund->amount,\n\t 'transactionId' => $this->getFACOrderNumber(),\n\t ];\n\n\t $this->FACRequest = $this->FACAPI->refund($FACData);\n\t}",
"public function refund($id, RefundRequest $request)\n {\n try {\n $transaction = GetCandy::payments()->refund(\n $id,\n $request->amount ?: null,\n $request->notes ?: null\n );\n } catch (AlreadyRefundedException $e) {\n return $this->errorWrongArgs('Refund already issued');\n } catch (ModelNotFoundException $e) {\n return $this->errorNotFound();\n } catch (TransactionAmountException $e) {\n return $this->errorWrongArgs('Amount exceeds remaining balance');\n }\n\n if (! $transaction->success) {\n return $this->errorWrongArgs($transaction->status);\n }\n\n return new TransactionResource($transaction);\n }",
"public function setRefundTransactionReference($value) \n {\n $this->_fields['RefundTransactionReference']['FieldValue'] = $value;\n return $this;\n }",
"private function processRefund($transaction_id, $amount=null) {\n\t\t$this->loadApi();\n\t\t$result = false;\n\t\tif (isset($amount) && $amount !== null) {\n\t\t\t$options['amount'] = $this->formatAmount($amount, $this->currency);\n\t\t}\n\t\t$logUrl = \"refunds\";\n\t\t$request = array(\n\t\t\t'charge' => $transaction_id,\n\t\t);\n\t\ttry {\n\t\t\t$result = \\Stripe\\Refund::create($request);\n\t\t\t$this->logRequest($logUrl, $request, $result->__toArray(true));\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$errors = $this->handleErrors($e);\n\t\t\t$this->logRequest($logUrl, $request, $this->getErrorLog($e, $errors), true);\n\t\t}\n\t\tif (isset($result['is_error']) && $result['is_error'] === true) {\n\t\t\treturn array(\n\t\t\t\t'status' => \"error\",\n\t\t\t\t'message' => $this->ifSet($result['message'], Language::_(\"Stripe_plus_gateway.!error.refund.generic\", true)),\n\t\t\t\t'transaction_id' => null,\n\t\t\t\t'reference_id' => null\n\t\t\t);\n\t\t}\n\t\treturn array(\n\t\t\t'status' => $amount === null ? \"void\" : \"refunded\",\n\t\t\t'message' => null,\n\t\t\t'transaction_id' => $result->id,\n\t\t\t'reference_id' => null\n\t\t);\n\t}",
"public function withRefundTransactionReference($value)\n {\n $this->setRefundTransactionReference($value);\n return $this;\n }",
"public function refundTransaction($txn_id){\n\t \t$result = \\Braintree_Transaction::refund($txn_id);\n\n\t \t if ($result->success) {\n $status='success';\n $transaction= array( \n 'txn_id'=>$result->transaction->id,\n 'txn_details'=>json_encode($result->transaction),\n 'txn_date'=>$result->transaction->createdAt->format('Y-m-d H:i:s'),\n 'txn_amount'=>$result->transaction->amount,\n 'token'=>$result->transaction->creditCardDetails->token\n ); \n } \n else{\n $message = '';\n foreach($result->errors->deepAll() AS $error) { \n $message .=$error->code . \": \" . $error->message . \"\\n\"; \n }\n $status='error';\n $transaction=array(\"message\"=>$message);\n }\n return array(\"status\"=>$status,\"response\"=>$transaction);\n\t }",
"public function refund($request = [])\n {\n $params = [\n 'merchid' => $this->merchant_id,\n ];\n\n $request = array_merge($params, $request);\n\n $res = $this->send('PUT', 'refund', $request);\n\n $res = $this->parseResponse($res);\n\n return new RefundResponse($res);\n }",
"public function refund($params = [], $options = null)\n {\n return self::scopedPostCall(\n $this->instanceUrl().'/refund', $params, $options\n );\n }",
"public static function create_refund_request( $data ) {\n $map_params = [\n 'line_item_qtys' => 'item_qtys',\n 'line_item_totals' => 'item_totals',\n 'line_item_tax_totals' => 'item_tax_totals',\n 'restock_refunded_items' => 'restock_items',\n 'api_refund' => 'method',\n ];\n\n foreach ( $map_params as $request_param => $refund_param ) {\n if ( isset( $data[ $request_param ] ) ) {\n $data[ $refund_param ] = $data[ $request_param ];\n }\n }\n\n $request = new Request( $data );\n\n $request->set_required(\n [\n 'order_id',\n 'refund_amount',\n ]\n );\n\n $request->validate();\n\n if ( $request->has_error() ) {\n throw new DokanException( $request->get_error() );\n }\n\n $request->sanitize();\n\n if ( $request->has_error() ) {\n throw new DokanException( $request->get_error() );\n }\n\n $refund = dokan_pro()->refund->create( $request->get_model()->get_data() );\n\n if ( is_wp_error( $refund ) ) {\n throw new DokanException( $refund );\n }\n\n return $refund;\n }",
"public function refundTransaction(string $transactionId, int $amount): Refund {\n\t\t$refundTransactionRequest = (new TransactionRefundRequest($transactionId, $this->baseUrl . TransactionRefundRequest::URI, $amount));\n\n\t\t$response = $this->authenticatedHttpClient->post($refundTransactionRequest);\n\n\t\t$refundTransactionResponse = new TransactionRefundResponse($response);\n\n\t\treturn $refundTransactionResponse->getRefund();\n\t}",
"public function refund($transactionId, $amount)\n {\n return $this->refund->create([\n 'charge' => $transactionId,\n 'amount' => $amount,\n ]);\n }",
"function paypal_RefundTransaction($vendor, $TRANSACTIONID, $INVNUM, $NOTE = null)\r\n{\r\n\t// Set request-specific fields.\r\n\t$nvp = array(\r\n\t\t'TRANSACTIONID' => urlencode($TRANSACTIONID),\r\n\t\t'INVNUM' => urlencode($INVNUM),\r\n\t);\t\r\n\t( strlen($NOTE) ? $nvp['NOTE'] = urlencode(htmlspecialchars($NOTE)) : null );\r\n\t\r\n\t// Add request-specific fields to the request string.\r\n\t$nvpStr = '';\r\n\tforeach($nvp as $key => $value)\r\n\t{\r\n\t\t$nvpStr .= \"&\" . $key . \"=\" . $value;\r\n\t}\r\n\t\r\n\t// Execute the API operation; see the PPHttpPost function above.\r\n\treturn PPHttpPost($vendor, 'RefundTransaction', $nvpStr);\r\n}",
"function ticket_refund_details_request($request_data) {\r\n $response['status'] = SUCCESS_STATUS;\r\n $response['data'] = array();\r\n $this->credentials('TicketRefundDetails');\r\n $request_params = array();\r\n $request_params['AppReference'] = $request_data['AppReference'];\r\n $request_params['SequenceNumber'] = $request_data['SequenceNumber'];\r\n $request_params['BookingId'] = $request_data['BookingId'];\r\n $request_params['PNR'] = $request_data['PNR'];\r\n $request_params['TicketId'] = $request_data['TicketId'];\r\n $request_params['ChangeRequestId'] = $request_data['ChangeRequestId'];\r\n\r\n $response['data']['request'] = json_encode($request_params);\r\n $response['data']['service_url'] = $this->service_url;\r\n return $response;\r\n }",
"public function refund($refund, $apiContext = null, $restCall = null)\n {\n ArgumentValidator::validate($this->getId(), \"Id\");\n ArgumentValidator::validate($refund, 'refund');\n $payLoad = $refund->toJSON();\n $json = self::executeCall(\n \"/v1/payments/capture/{$this->getId()}/refund\",\n \"POST\",\n $payLoad,\n null,\n $apiContext,\n $restCall\n );\n $ret = new Refund();\n $ret->fromJson($json);\n return $ret;\n }",
"public function refund($parameters = []) {\n if(!isset($parameters['order_id']) || !is_numeric($parameters['order_id']) || empty($parameters['order_id'])) {\n throw new Exception('You must provide a valid order ID to refund (you provided \"'.$parameters['order_id'].'\").');\n }\n\n if(!isset($parameters['reference']) || empty($parameters['reference'])) {\n throw new Exception('You must provide a valid item reference to refund (you provided \"'.$parameters['reference'].'\").');\n }\n\n if(isset($parameters['reason']) && strlen($parameters['reason']) > 200) {\n throw new Exception('Your reason for this refund must be shorter than 200 characters (yours was \"'.strlen($parameters['reason']).'\").');\n }\n\n return $this->request('POST', '/refund', null, $parameters);\n }",
"public function issue_refund()\n {\n // TODO: requires refactoring (control and views mixed)\n $settings = get_option('adpress_settings');\n if (isset($settings['paypal']) && isset($this->param['paypal']['PAYMENTINFO_0_TRANSACTIONID']) && isset($settings['paypal_refund']) && $this->status != 'running') {\n $transactionID = $this->param['paypal']['PAYMENTINFO_0_TRANSACTIONID'];\n $gateway = array(\n 'username' => $settings['paypal_username'],\n 'password' => $settings['paypal_password'],\n 'signature' => $settings['paypal_signature'],\n 'version' => '84.0',\n 'payment_action' => 'Sale',\n 'payment_amount' => '',\n 'currency' => '',\n 'return_url' => '',\n 'cancel_url' => ''\n );\n $paypal = new wp_adpress_paypal($gateway, isset($settings['paypal_testmode']));\n if ($paypal->issueRefund($transactionID)) {\n wp_adpress::display_notice(__('Refund issued', 'wp-adpress'), '<p>' . __('A refund was issued', 'wp-adpress') . '</p>', 'adpress-icon-flag');\n return true;\n } else {\n wp_adpress::display_notice(__('Error issuing refund', 'wp-adpress'), '<p>' . __('There was an error while trying to issue the refund. Please Contact the Administrator to issue the refund manually.' . 'wp-adpress') . '</p>', 'adpress-icon-flag');\n return false;\n }\n }\n }",
"public function apiMerchantV3TransactionTransactionIdCapturePostWithHttpInfo($transactionId, $captureRequest = null)\n {\n $request = $this->apiMerchantV3TransactionTransactionIdCapturePostRequest($transactionId, $captureRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\ConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public static function createRefund($id)\n {\n return self::getFacadeRoot()->createRefund($id);\n }",
"public function refundAjax($param = null)\n {\n $objResponse = new xajaxResponse();\n // Checking whether parametres are nullor not\n if ($param != null) {\n $lesson_id = $param['lesson_id'];\n $transaction_id = $param['transaction_id'];\n $tutor_availability_id = $param['tutor_availability_id'];\n $lesson_code = $param['lesson_code'];\n $lesson_date = $param['lesson_date'];\n $refunded_amount = $param['transaction_amount'];\n $student_id = $param['student_id'];\n $settings = $this->user_model->getSiteSettings();\n //\t\t$refunded_amount = $refunded_amount*100; // Cents\n require_once(\"vendor/autoload.php\");\n # Setup the Start object with your private API key\n \\Stripe\\Stripe::setApiKey($settings['stripe_secret']);\n # Process the charge\n try {\n $refund = \\Stripe\\Refund::create(array(\n \"charge\" => $transaction_id,\n //\t\t\t \"amount\" => $refunded_amount,\n \"reason\" => \"requested_by_customer\"\n ));\n\n $status = REFUNDED;\n $qResponse = $this->payment_model->addRefunds($transaction_id, $lesson_id, $refunded_amount, $status, $tutor_availability_id, $lesson_code, $lesson_date);\n if ($qResponse) {\n // email\n $student_data = $this->user_model->getUserById($student_id);\n $student_email = $student_data['email'];\n $subject = \"Refund Alert\";\n $email_msg = \"Hello \" . ucfirst($student_data['first_name']) . \"!<br><br>Open Mind Tutors has refunded your amount \" . CURRENCY_SYMBOL . $refunded_amount / 100 . \" for the lesson \" . $lesson_code . \". Please click on the following link to view your lesson details:\n\t\t\t\t\t\t\t\t\t<a href='\" . ROUTE_LOGIN . \"'>Open Mind Tutors</a><br><br>\n\t\t\t\t\t\t\t\t\tSincerely,<br />\n\t\t\t\t\t\t\t\t\t<img alt='logo' style='width: 120px;' src='\" . FRONTEND_ASSET_IMAGES_DIR . \"omt-logo.png'/>\";\n $sender = NO_REPLY;\n sendEmail($sender, $student_email, $email_msg, $subject);\n // email\n $msg = CURRENCY_SYMBOL . $refunded_amount / 100 . \" GBP refunded successfully\";\n $url = BACKEND_LESSON_DETAILS_URL . \"/\" . $lesson_id;\n $objResponse->script(\"successAlerts('\" . $msg . \"','\" . $url . \"')\");\n }\n } catch (Exception $e) {\n $error_message = \"Something went wrong!\";\n /* depending on $error_code we can show different messages */\n $url = \"\";\n $objResponse->script(\"successAlerts('\" . $error_message . \"','\" . $url . \"')\");\n }\n }\n return $objResponse;\n }",
"public function getRefundTransactionReference() \n {\n return $this->_fields['RefundTransactionReference']['FieldValue'];\n }",
"public function get_refund()\n {\n $total = $this->format($this->amount);\n\n $amount = new Amount();\n $amount\n ->setCurrency($this->order->get_currency())\n ->setTotal($total);\n\n $refund = new RefundRequest();\n $refund->setAmount($amount);\n\n return $refund;\n }",
"public function requestShipmentRefund()\n {\n $body = file_get_contents(__DIR__\n . '/Mocks/ncshipment-refund-request-info.xml');\n $mock = new MockHandler([\n new Response(200, [], $body),\n ]);\n $handler = HandlerStack::create($mock);\n $refund = $this->shipmentService->requestShipmentRefund('', '', ['handler' => $handler]);\n\n // Check response.\n $this->assertTrue(is_array($refund['non-contract-shipment-refund-request-info']));\n\n $this->assertEquals('2018-08-28', $refund['non-contract-shipment-refund-request-info']['service-ticket-date']);\n $this->assertEquals('GT12345678RT', $refund['non-contract-shipment-refund-request-info']['service-ticket-id']);\n\n }",
"public function refund(\\Magento\\Payment\\Model\\InfoInterface $payment, $amount)\n {\n parent::refund($payment, $amount);\n\n $params = array(\n \"amount\" => $amount,\n \"originalMerchantTxId\" => $payment->getRefundTransactionId()\n );\n $result = $this->_helper->executeGatewayTransaction(\"REFUND\", $params);\n if(strtolower($result->Status) == 'approved') {\n $payment->setTransactionId($result->TrxKey)\n ->setTransactionAdditionalInfo(\\Magento\\Sales\\Model\\Order\\Payment\\Transaction::RAW_DETAILS, json_decode(json_encode($result), true));\n// $order = $payment->getOrder();\n// $order->setState(\"processing\")\n// ->setStatus(\"processing\")\n// ->addStatusHistoryComment('Payment refunded amount ' . $amount);\n// $transaction = $payment->addTransaction(Transaction::TYPE_REFUND, null, true);\n// $transaction->setIsClosed(0);\n// $transaction->save();\n// $order->save();\n } else {\n throw new \\Magento\\Framework\\Validator\\Exception(isset($result->Message) ? __($result->Message) : __( 'Refund error!' ));\n }\n\n return $this;\n }",
"public function getRefundCreateRequest($reason = null) {\n $data = null; \n if ($this->amount && $this->currency && $this->transactionId) { \n $data = array(\n \"amount\" => $this->amount,\n \"description\" => is_null($reason) ? __(\"Refund for \") . $this->reference : $reason,\n \"payment\" => $this->parentTransactionId,\n \"reference\" => $this->reference\n );\n }\n return $data;\n }",
"protected function payInsWebPayWebPayPostRefundRequest($pay_in_id, $body = null)\n {\n // verify the required parameter 'pay_in_id' is set\n if ($pay_in_id === null || (is_array($pay_in_id) && count($pay_in_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pay_in_id when calling payInsWebPayWebPayPostRefund'\n );\n }\n\n $resourcePath = '/v2.1/PayInsWebPay/payments/{PayInId}/refunds';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($pay_in_id !== null) {\n $resourcePath = str_replace(\n '{' . 'PayInId' . '}',\n ObjectSerializer::toPathValue($pay_in_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json', 'text/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function refund($param){\n\n\t\t$type = array('type'=> 'refund');\n\t\t$transaction = CardFlex::transaction($param, $type);\n\t\treturn $transaction;\n\n\t}",
"public function refund(Request $request);"
] | [
"0.6539074",
"0.5718133",
"0.56160295",
"0.5573396",
"0.52533835",
"0.52310914",
"0.51515615",
"0.5140062",
"0.50491667",
"0.50099546",
"0.49705324",
"0.4937021",
"0.4878065",
"0.48198965",
"0.48148605",
"0.47559363",
"0.47424006",
"0.47325194",
"0.46796912",
"0.46753505",
"0.46555835",
"0.4653779",
"0.46273872",
"0.460667",
"0.46056035",
"0.45691606",
"0.45647448",
"0.45527047",
"0.45260808",
"0.45247793"
] | 0.7213236 | 0 |
Create request for operation 'apiMerchantV3TransactionTransactionIdRefundPost' | public function apiMerchantV3TransactionTransactionIdRefundPostRequest($transactionId, $refundRequest = null)
{
// verify the required parameter 'transactionId' is set
if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdRefundPost'
);
}
$resourcePath = '/api/merchant/v3/transaction/{transactionId}/refund';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($transactionId !== null) {
$resourcePath = str_replace(
'{' . 'transactionId' . '}',
ObjectSerializer::toPathValue($transactionId),
$resourcePath
);
}
/*
*/
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/problem+json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/problem+json'],
['application/json']
);
}
// for model (json/xml)
if (isset($refundRequest)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($refundRequest));
} else {
$httpBody = $refundRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \http_build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
if (!empty($this->config->getAccessToken())) {
$headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = http_build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_refund() {\n\t $this->set_resource( 'transaction' );\n\t $this->set_callback( 'refund' );\n\n\t $FACData = [\n\t 'amount' => $this->get_order()->refund->amount,\n\t 'transactionId' => $this->getFACOrderNumber(),\n\t ];\n\n\t $this->FACRequest = $this->FACAPI->refund($FACData);\n\t}",
"public function refund(Request $request);",
"abstract protected function buildRefundRequest(Request $request);",
"public static function create_refund_request( $data ) {\n $map_params = [\n 'line_item_qtys' => 'item_qtys',\n 'line_item_totals' => 'item_totals',\n 'line_item_tax_totals' => 'item_tax_totals',\n 'restock_refunded_items' => 'restock_items',\n 'api_refund' => 'method',\n ];\n\n foreach ( $map_params as $request_param => $refund_param ) {\n if ( isset( $data[ $request_param ] ) ) {\n $data[ $refund_param ] = $data[ $request_param ];\n }\n }\n\n $request = new Request( $data );\n\n $request->set_required(\n [\n 'order_id',\n 'refund_amount',\n ]\n );\n\n $request->validate();\n\n if ( $request->has_error() ) {\n throw new DokanException( $request->get_error() );\n }\n\n $request->sanitize();\n\n if ( $request->has_error() ) {\n throw new DokanException( $request->get_error() );\n }\n\n $refund = dokan_pro()->refund->create( $request->get_model()->get_data() );\n\n if ( is_wp_error( $refund ) ) {\n throw new DokanException( $refund );\n }\n\n return $refund;\n }",
"abstract protected function _buildRefundRequest(Request $request);",
"function paypal_RefundTransaction($vendor, $TRANSACTIONID, $INVNUM, $NOTE = null)\r\n{\r\n\t// Set request-specific fields.\r\n\t$nvp = array(\r\n\t\t'TRANSACTIONID' => urlencode($TRANSACTIONID),\r\n\t\t'INVNUM' => urlencode($INVNUM),\r\n\t);\t\r\n\t( strlen($NOTE) ? $nvp['NOTE'] = urlencode(htmlspecialchars($NOTE)) : null );\r\n\t\r\n\t// Add request-specific fields to the request string.\r\n\t$nvpStr = '';\r\n\tforeach($nvp as $key => $value)\r\n\t{\r\n\t\t$nvpStr .= \"&\" . $key . \"=\" . $value;\r\n\t}\r\n\t\r\n\t// Execute the API operation; see the PPHttpPost function above.\r\n\treturn PPHttpPost($vendor, 'RefundTransaction', $nvpStr);\r\n}",
"function refund(array $requestParams)\n {\n }",
"public function refundTransaction($txn_id){\n\t \t$result = \\Braintree_Transaction::refund($txn_id);\n\n\t \t if ($result->success) {\n $status='success';\n $transaction= array( \n 'txn_id'=>$result->transaction->id,\n 'txn_details'=>json_encode($result->transaction),\n 'txn_date'=>$result->transaction->createdAt->format('Y-m-d H:i:s'),\n 'txn_amount'=>$result->transaction->amount,\n 'token'=>$result->transaction->creditCardDetails->token\n ); \n } \n else{\n $message = '';\n foreach($result->errors->deepAll() AS $error) { \n $message .=$error->code . \": \" . $error->message . \"\\n\"; \n }\n $status='error';\n $transaction=array(\"message\"=>$message);\n }\n return array(\"status\"=>$status,\"response\"=>$transaction);\n\t }",
"public function refund($request = [])\n {\n $params = [\n 'merchid' => $this->merchant_id,\n ];\n\n $request = array_merge($params, $request);\n\n $res = $this->send('PUT', 'refund', $request);\n\n $res = $this->parseResponse($res);\n\n return new RefundResponse($res);\n }",
"public function refund(array $parameters = array())\n {\n return $this->createRequest(\\Omnipay\\Pingpp\\Message\\RefundRequest::class, $parameters);\n }",
"public function refundRequestAction() {\n \n }",
"public function apiMerchantV3TransactionTransactionIdRefundPostWithHttpInfo($transactionId, $refundRequest = null)\n {\n $request = $this->apiMerchantV3TransactionTransactionIdRefundPostRequest($transactionId, $refundRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\ConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function payInsWebPayWebPayPostRefundRequest($pay_in_id, $body = null)\n {\n // verify the required parameter 'pay_in_id' is set\n if ($pay_in_id === null || (is_array($pay_in_id) && count($pay_in_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pay_in_id when calling payInsWebPayWebPayPostRefund'\n );\n }\n\n $resourcePath = '/v2.1/PayInsWebPay/payments/{PayInId}/refunds';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($pay_in_id !== null) {\n $resourcePath = str_replace(\n '{' . 'PayInId' . '}',\n ObjectSerializer::toPathValue($pay_in_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json', 'text/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function requestShipmentRefund()\n {\n $body = file_get_contents(__DIR__\n . '/Mocks/ncshipment-refund-request-info.xml');\n $mock = new MockHandler([\n new Response(200, [], $body),\n ]);\n $handler = HandlerStack::create($mock);\n $refund = $this->shipmentService->requestShipmentRefund('', '', ['handler' => $handler]);\n\n // Check response.\n $this->assertTrue(is_array($refund['non-contract-shipment-refund-request-info']));\n\n $this->assertEquals('2018-08-28', $refund['non-contract-shipment-refund-request-info']['service-ticket-date']);\n $this->assertEquals('GT12345678RT', $refund['non-contract-shipment-refund-request-info']['service-ticket-id']);\n\n }",
"public function getRefundCreateRequest($reason = null) {\n $data = null; \n if ($this->amount && $this->currency && $this->transactionId) { \n $data = array(\n \"amount\" => $this->amount,\n \"description\" => is_null($reason) ? __(\"Refund for \") . $this->reference : $reason,\n \"payment\" => $this->parentTransactionId,\n \"reference\" => $this->reference\n );\n }\n return $data;\n }",
"public function refund($id, RefundRequest $request)\n {\n try {\n $transaction = GetCandy::payments()->refund(\n $id,\n $request->amount ?: null,\n $request->notes ?: null\n );\n } catch (AlreadyRefundedException $e) {\n return $this->errorWrongArgs('Refund already issued');\n } catch (ModelNotFoundException $e) {\n return $this->errorNotFound();\n } catch (TransactionAmountException $e) {\n return $this->errorWrongArgs('Amount exceeds remaining balance');\n }\n\n if (! $transaction->success) {\n return $this->errorWrongArgs($transaction->status);\n }\n\n return new TransactionResource($transaction);\n }",
"protected function _postRequest(array $request)\n {\n \t$client = new Varien_Http_Client();\n \t$client->setUri($this->getRefundUrl());\n \t\n \tMage::log(\"RequestURL : \".$this->getRefundUrl(), null, 'eximbay'.Mage::getModel('core/date')->date('Y-m-d').'.log');\n \t\n \t$client->setConfig(array(\n \t\t\t'maxredirects'=>0,\n \t\t\t'timeout'=>30,\n \t\t\t//'ssltransport' => 'tcp',\n \t));\n\n \t$client->setParameterPost($request);\n \t$client->setMethod(Zend_Http_Client::POST);\n \t\n \t$result = array();\n \ttry {\n \t\t$response = $client->request();\n \t} catch (Exception $e) {\n \t\t$result['rescode'] = $e->getCode();\n \t\t$result['resmsg'] = $e->getMessage();\n\n \t\tMage::throwException(Mage::helper('eximbay')->__('Gateway error: %s', ($e->getMessage())));\n \t}\n \n \t$responseBody = trim($response->getBody());\n \tMage::log(\"Raw Response Data : \".$responseBody, null, 'eximbay'.Mage::getModel('core/date')->date('Y-m-d').'.log');\n\n \tMage::log(\"------------- Mapped Response -------------\", null, 'eximbay'.Mage::getModel('core/date')->date('Y-m-d').'.log');\n \tparse_str($responseBody, $data);\n \tforeach ($data as $key => $value) {\n \t\t$result[$key] = $value;\n \t\tMage::log($key.\" : \".$result[$key], null, 'eximbay'.Mage::getModel('core/date')->date('Y-m-d').'.log');\n \t}\n \t\n \tif (empty($result['rescode'])) {\n \t\tMage::throwException(Mage::helper('eximbay')->__('Error in payment gateway.'));\n \t}\n \n \treturn $result;\n }",
"public function refund($params = [], $options = null)\n {\n return self::scopedPostCall(\n $this->instanceUrl().'/refund', $params, $options\n );\n }",
"private function processRefund($transaction_id, $amount=null) {\n\t\t$this->loadApi();\n\t\t$result = false;\n\t\tif (isset($amount) && $amount !== null) {\n\t\t\t$options['amount'] = $this->formatAmount($amount, $this->currency);\n\t\t}\n\t\t$logUrl = \"refunds\";\n\t\t$request = array(\n\t\t\t'charge' => $transaction_id,\n\t\t);\n\t\ttry {\n\t\t\t$result = \\Stripe\\Refund::create($request);\n\t\t\t$this->logRequest($logUrl, $request, $result->__toArray(true));\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$errors = $this->handleErrors($e);\n\t\t\t$this->logRequest($logUrl, $request, $this->getErrorLog($e, $errors), true);\n\t\t}\n\t\tif (isset($result['is_error']) && $result['is_error'] === true) {\n\t\t\treturn array(\n\t\t\t\t'status' => \"error\",\n\t\t\t\t'message' => $this->ifSet($result['message'], Language::_(\"Stripe_plus_gateway.!error.refund.generic\", true)),\n\t\t\t\t'transaction_id' => null,\n\t\t\t\t'reference_id' => null\n\t\t\t);\n\t\t}\n\t\treturn array(\n\t\t\t'status' => $amount === null ? \"void\" : \"refunded\",\n\t\t\t'message' => null,\n\t\t\t'transaction_id' => $result->id,\n\t\t\t'reference_id' => null\n\t\t);\n\t}",
"public function makeRefund(Request $request)\n {\n \ttry {\n \t\t$Input = Input::all();\n\t \tStripe::setApiKey(Config('services.stripe.key'));\n\t \t/* Full refund */\n\t\t\t$refund = \\Stripe\\Refund::create([\n\t\t\t 'charge' => '{charge-id}',/* the one which we stored in the charge method */\n\t\t\t]);\n\t\t\t/* Partial refund */\n\t\t\t$refund = \\Stripe\\Refund::create([\n\t\t\t 'charge' => '{charge-id}',/* the one which we stored in the charge method */\n \t\t\t'amount' => '{amount-to-refund}',\n\t\t\t]);\n\t \tif($refund){\n\t \t\t/* Your code after successfull refund goes here. */\n\t \t} else {\n\t \t\t/* Your Code for unsuccessfull refund goes here */\n\t \t}\n\t return $token;\n \t} catch (\\Exception $e) {\n \t\t/* You can handle you exceptions here. For now, lets just print the error to see what cause the problem */\n \t\tprint_r($e->getMessage().'-:-'.$e->getLine()); die;\n \t}\n }",
"function ticket_refund_details_request($request_data) {\r\n $response['status'] = SUCCESS_STATUS;\r\n $response['data'] = array();\r\n $this->credentials('TicketRefundDetails');\r\n $request_params = array();\r\n $request_params['AppReference'] = $request_data['AppReference'];\r\n $request_params['SequenceNumber'] = $request_data['SequenceNumber'];\r\n $request_params['BookingId'] = $request_data['BookingId'];\r\n $request_params['PNR'] = $request_data['PNR'];\r\n $request_params['TicketId'] = $request_data['TicketId'];\r\n $request_params['ChangeRequestId'] = $request_data['ChangeRequestId'];\r\n\r\n $response['data']['request'] = json_encode($request_params);\r\n $response['data']['service_url'] = $this->service_url;\r\n return $response;\r\n }",
"public function doRefund() {\n if(isset($this->request->post['transaction_id']) && isset($this->request->post['refund_full'])) {\n\n $this->load->model('payment/pp_express');\n $this->load->language('payment/pp_express_refund');\n \n if($this->request->post['refund_full'] == 0 && $this->request->post['amount'] == 0) {\n $this->session->data['error'] = $this->language->get('error_partial_amt');\n } else {\n $order_id = $this->model_payment_pp_express->getOrderId($this->request->post['transaction_id']);\n $paypal_order = $this->model_payment_pp_express->getOrder($order_id);\n \n if ($paypal_order) {\n $call_data = array();\n $call_data['METHOD'] = 'RefundTransaction';\n $call_data['TRANSACTIONID'] = $this->request->post['transaction_id'];\n $call_data['NOTE'] = urlencode($this->request->post['refund_message']);\n $call_data['MSGSUBID'] = uniqid(mt_rand(), true);\n\n $current_transaction = $this->model_payment_pp_express->getLocalTransaction($this->request->post['transaction_id']);\n \n if ($this->request->post['refund_full'] == 1) {\n $call_data['REFUNDTYPE'] = 'Full';\n } else {\n $call_data['REFUNDTYPE'] = 'Partial';\n $call_data['AMT'] = number_format($this->request->post['amount'], 2);\n $call_data['CURRENCYCODE'] = $this->request->post['currency_code'];\n }\n\n $result = $this->model_payment_pp_express->call($call_data);\n\n $transaction = array(\n 'paypal_order_id' => $paypal_order['paypal_order_id'],\n 'transaction_id' => '',\n 'parent_transaction_id' => $this->request->post['transaction_id'],\n 'note' => $this->request->post['refund_message'],\n 'msgsubid' => $call_data['MSGSUBID'],\n 'receipt_id' => '',\n 'payment_type' => '',\n 'payment_status' => 'Refunded',\n 'transaction_entity' => 'payment',\n 'pending_reason' => '',\n 'amount' => '-' . (isset($call_data['AMT']) ? $call_data['AMT'] : $current_transaction['amount']),\n 'debug_data' => json_encode($result),\n );\n \n if ($result == false) {\n $transaction['payment_status'] = 'Failed';\n $this->model_payment_pp_express->addTransaction($transaction, $call_data);\n $this->redirect($this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $paypal_order['order_id'], 'SSL'));\n } else if ($result['ACK'] != 'Failure' && $result['ACK'] != 'FailureWithWarning') {\n\n $transaction['transaction_id'] = $result['REFUNDTRANSACTIONID'];\n $transaction['payment_type'] = $result['REFUNDSTATUS'];\n $transaction['pending_reason'] = $result['PENDINGREASON'];\n $transaction['amount'] = '-' . $result['GROSSREFUNDAMT'];\n\n $this->model_payment_pp_express->addTransaction($transaction);\n\n //update transaction to refunded status\n if ($result['TOTALREFUNDEDAMOUNT'] == $this->request->post['amount_original']) {\n $this->db->query(\"UPDATE `\" . DB_PREFIX . \"paypal_order_transaction` SET `payment_status` = 'Refunded' WHERE `transaction_id` = '\" . $this->db->escape($this->request->post['transaction_id']) . \"' LIMIT 1\");\n } else {\n $this->db->query(\"UPDATE `\" . DB_PREFIX . \"paypal_order_transaction` SET `payment_status` = 'Partially-Refunded' WHERE `transaction_id` = '\" . $this->db->escape($this->request->post['transaction_id']) . \"' LIMIT 1\");\n }\n\n //redirect back to the order\n $this->redirect($this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $paypal_order['order_id'], 'SSL'));\n } else {\n $this->model_payment_pp_express->log(json_encode($result));\n $this->session->data['error'] = (isset($result['L_SHORTMESSAGE0']) ? $result['L_SHORTMESSAGE0'] : 'There was an error') . (isset($result['L_LONGMESSAGE0']) ? '<br />' . $result['L_LONGMESSAGE0'] : '');\n $this->redirect($this->url->link('payment/pp_express/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n } else {\n $this->session->data['error'] = $this->language->get('error_data_missing');\n $this->redirect($this->url->link('payment/pp_express/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n }\n } else {\n $this->session->data['error'] = $this->language->get('error_data');\n $this->redirect($this->url->link('payment/pp_express/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n }",
"public function refund($parameters = []) {\n if(!isset($parameters['order_id']) || !is_numeric($parameters['order_id']) || empty($parameters['order_id'])) {\n throw new Exception('You must provide a valid order ID to refund (you provided \"'.$parameters['order_id'].'\").');\n }\n\n if(!isset($parameters['reference']) || empty($parameters['reference'])) {\n throw new Exception('You must provide a valid item reference to refund (you provided \"'.$parameters['reference'].'\").');\n }\n\n if(isset($parameters['reason']) && strlen($parameters['reason']) > 200) {\n throw new Exception('Your reason for this refund must be shorter than 200 characters (yours was \"'.strlen($parameters['reason']).'\").');\n }\n\n return $this->request('POST', '/refund', null, $parameters);\n }",
"public function get_refund()\n {\n $total = $this->format($this->amount);\n\n $amount = new Amount();\n $amount\n ->setCurrency($this->order->get_currency())\n ->setTotal($total);\n\n $refund = new RefundRequest();\n $refund->setAmount($amount);\n\n return $refund;\n }",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function refundQuery(array $requestParams)\n {\n }",
"public function refund(array $parameters = array())\n {\n return $this->createRequest('\\Omnipay\\PaymentWall\\Message\\RefundRequest', $parameters);\n }",
"public function createRefund($parameters = [])\n {\n if (!array_key_exists('charge_id', $parameters)\n && !array_key_exists('amount', $parameters)\n && !array_key_exists('currency', $parameters)\n && !array_key_exists('reason', $parameters)\n ) {\n throw new BadMethodCallException('Parameter required missing : charge_id or amount or currency or reason');\n }\n\n return $this->post('/refunds/', $parameters);\n }",
"public function refundAjax($param = null)\n {\n $objResponse = new xajaxResponse();\n // Checking whether parametres are nullor not\n if ($param != null) {\n $lesson_id = $param['lesson_id'];\n $transaction_id = $param['transaction_id'];\n $tutor_availability_id = $param['tutor_availability_id'];\n $lesson_code = $param['lesson_code'];\n $lesson_date = $param['lesson_date'];\n $refunded_amount = $param['transaction_amount'];\n $student_id = $param['student_id'];\n $settings = $this->user_model->getSiteSettings();\n //\t\t$refunded_amount = $refunded_amount*100; // Cents\n require_once(\"vendor/autoload.php\");\n # Setup the Start object with your private API key\n \\Stripe\\Stripe::setApiKey($settings['stripe_secret']);\n # Process the charge\n try {\n $refund = \\Stripe\\Refund::create(array(\n \"charge\" => $transaction_id,\n //\t\t\t \"amount\" => $refunded_amount,\n \"reason\" => \"requested_by_customer\"\n ));\n\n $status = REFUNDED;\n $qResponse = $this->payment_model->addRefunds($transaction_id, $lesson_id, $refunded_amount, $status, $tutor_availability_id, $lesson_code, $lesson_date);\n if ($qResponse) {\n // email\n $student_data = $this->user_model->getUserById($student_id);\n $student_email = $student_data['email'];\n $subject = \"Refund Alert\";\n $email_msg = \"Hello \" . ucfirst($student_data['first_name']) . \"!<br><br>Open Mind Tutors has refunded your amount \" . CURRENCY_SYMBOL . $refunded_amount / 100 . \" for the lesson \" . $lesson_code . \". Please click on the following link to view your lesson details:\n\t\t\t\t\t\t\t\t\t<a href='\" . ROUTE_LOGIN . \"'>Open Mind Tutors</a><br><br>\n\t\t\t\t\t\t\t\t\tSincerely,<br />\n\t\t\t\t\t\t\t\t\t<img alt='logo' style='width: 120px;' src='\" . FRONTEND_ASSET_IMAGES_DIR . \"omt-logo.png'/>\";\n $sender = NO_REPLY;\n sendEmail($sender, $student_email, $email_msg, $subject);\n // email\n $msg = CURRENCY_SYMBOL . $refunded_amount / 100 . \" GBP refunded successfully\";\n $url = BACKEND_LESSON_DETAILS_URL . \"/\" . $lesson_id;\n $objResponse->script(\"successAlerts('\" . $msg . \"','\" . $url . \"')\");\n }\n } catch (Exception $e) {\n $error_message = \"Something went wrong!\";\n /* depending on $error_code we can show different messages */\n $url = \"\";\n $objResponse->script(\"successAlerts('\" . $error_message . \"','\" . $url . \"')\");\n }\n }\n return $objResponse;\n }",
"public function setRefundTransactionReference($value) \n {\n $this->_fields['RefundTransactionReference']['FieldValue'] = $value;\n return $this;\n }"
] | [
"0.6538365",
"0.6325919",
"0.6268113",
"0.6199619",
"0.617546",
"0.6159472",
"0.61289644",
"0.6094305",
"0.6058534",
"0.60545176",
"0.60445285",
"0.6042344",
"0.60372615",
"0.60299546",
"0.60235804",
"0.5869387",
"0.5792988",
"0.5787152",
"0.57718724",
"0.57562375",
"0.57263094",
"0.57055974",
"0.570191",
"0.5685106",
"0.5635255",
"0.5626275",
"0.56035036",
"0.5603073",
"0.55536854",
"0.55527025"
] | 0.76498425 | 0 |
Create request for operation 'apiPaymentV3TransactionPost' | public function apiPaymentV3TransactionPostRequest($transaction = null)
{
$resourcePath = '/api/payment/v3/transaction';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
/*
*/
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/hal+json', 'application/problem+json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/hal+json', 'application/problem+json'],
['application/json']
);
}
// for model (json/xml)
if (isset($transaction)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($transaction));
} else {
$httpBody = $transaction;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \http_build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
if (!empty($this->config->getAccessToken())) {
$headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = http_build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createTransactionCodeUsingPostRequest($transaction_request)\n {\n // verify the required parameter 'transaction_request' is set\n if ($transaction_request === null || (is_array($transaction_request) && count($transaction_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_request when calling createTransactionCodeUsingPost'\n );\n }\n\n $resourcePath = '/nucleus/v1/transaction_code';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($transaction_request)) {\n $_tempBody = $transaction_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function makeRequest()\n {\n return new Request('POST', 'payments', [], json_encode($this->payment));\n }",
"protected function actionPost() { \n \n $data = $this->data;\n if(\n !$data \n || !isset($data[\"TransactionId\"]) \n || !isset($data[\"UserId\"]) \n || !isset($data[\"CurrencyAmount\"])\n || !isset($data[\"Verifier\"])\n ) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Invalid Parameters\"\n ];\n return $response;\n }\n\n $transactionId = $data[\"TransactionId\"];\n $userId = $data[\"UserId\"];\n $currencyAmount = $data[\"CurrencyAmount\"];\n $verifier = $data[\"Verifier\"];\n\n $transaction = new Transaction($transactionId,$userId,$currencyAmount);\n $isValidTransaction = $transaction->isValid($verifier);\n if(!$isValidTransaction) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Invalid Verifier\"\n ];\n return $response; \n }\n\n $transactionRepository = new TransactionRepository();\n $existedTransaction = $transactionRepository->find($transactionId);\n\n if($existedTransaction) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Duplicate transaction with TransactionId:$transactionId\"\n ];\n return $response; \n }\n\n $transactionRepository->save($transaction);\n\n $response = [\n \"Success\" => true\n ];\n \n\n return $response; \n }",
"public function postAction()\n\t{\n\t\t$config = Esquire_Config_Factory::getApplicationConfig();\n\t\t$logger = Esquire_Log_Factory::getLogger($config, 'payment');\n\t\t$logger->log('Beginning new payment request', Zend_Log::INFO);\n\n\t\t$invoiceObjects = null;\n\t\t$paymentId = null;\n\t\t$values = json_decode(stripslashes($this->_getParam('values')), true);\n $values['payment_amount'] = number_format(\n\t\t\tpreg_replace('/[^\\d\\.]/', '', $values['payment_amount']), \n\t\t\t2, \n\t\t\t'.', \n\t\t\t''\n\t\t);\n $source = $this->_getParam('source');\n \n\t\ttry {\n\t\t\t\n\t\t\t$payment = Esquire_Payment_Factory::getInstance($config);\n\n /**\n * If coming from cashapp interface the structure of the parameters are\n * different. We add in a couple of keys that are named differently on ECN.\n */\n if (isset($values['PaymentDistribution'])) {\n $invoiceArray = $values['PaymentDistribution'];\n } elseif (isset($values['invoices'])) {\n $invoiceArray = $values['invoices'];\n }\n $logger->log('Invoice Array: ' . print_r($invoiceArray, true), Zend_Log::INFO);\n \n\t\t\tif (count($invoiceArray) > 0) {\n\t\t\t\t$invoiceObjects = $this->_getInvoiceObjects($invoiceArray);\n\t\t\t\tif ($invoiceObjects instanceof Doctrine_Collection) {\n\t\t\t\t\t$logger->log('Got invoice objects ' . $invoiceObjects->count(), Zend_Log::INFO);\n\t\t\t\t} else {\n\t\t\t\t\t$logger->log('Got NO invoices', Zend_Log::INFO);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count($invoiceArray) > 0) {\n\t\t\t\t$invoices = $payment->setAmountAppliedToInvoice($invoiceArray, $invoiceObjects);\n\t\t\t}\n\t\t\t$success = $payment->createPayment($values, $invoices);\n\t\t\t$logger->log('Payment creation success: ' . $success, Zend_Log::INFO);\n\n\t\t\tif ($success === false) {\n\t\t\t\t$logger->log(\n\t\t\t\t\t'Payment creation error: ' . $payment->getErrorMessage(), \n\t\t\t\t\tZend_Log::ERR\n\t\t\t\t);\n\t\t\t\t$this->getResponse()\n\t\t\t\t\t ->setHttpResponseCode(500);\n\t\t\t\t$this->view->data = array(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'error_code' => 10,\n\t\t\t\t\t'error_message' => $payment->getErrorMessage()\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$paymentId = $payment->getPaymentId();\n\t\t} catch (Exception $e) {\n\t\t\t$this->getResponse()\n\t\t\t\t ->setHttpResponseCode(500);\n\t\t\t$this->view->data = array(\n\t\t\t\t'success' => false,\n\t\t\t\t'error_code' => 11,\n\t\t\t\t'error_message' => 'A system error occurred.'\n\t\t\t);\n\t\t\t$logger->log($e->getMessage(), Zend_Log::ERR);\n\t\t\t$logger->log($e->getTraceAsString(), Zend_Log::ERR);\n\t\t\treturn;\n\t\t}\n\n\t\t$commitMessage = '';\n\n /**\n * Call ModPayController. Format $params first in a way that ModPay expects.\n * ModPay will commit payments to Solaria.\n */\n $params = array (\n\t\t\t'card_name' => $values['card_name'],\n\t\t\t'email' => $values['cc_email'], // Customer's billing email address\n\t\t\t'address' => $values['cc_address'],\n\t\t\t'city' => $values['cc_city'],\n\t\t\t'state' => $values['cc_state'],\n\t\t\t'zipcode' => $values['cc_zipcode'],\n\t\t\t'shiptophone' => $values['cc_shiptophone'],\n\t\t\t'card_number' => $values['card_number'],\n\t\t\t'expiration_date' => $values['expiration_date'],\n\t\t\t'payment_amount' => $values['payment_amount'],\n\t\t\t'cvv2' => $values['cvv2'],\n\t\t\t'npc_payment_id' => $paymentId,\n 'source' => $source,\n\t\t\t'payor_name' => $values['card_name'],\n 'transaction_date' => $values['transaction_date']\n\t\t);\n\n if ($invoiceObjects instanceof Doctrine_Collection && $invoiceObjects->count() > 0) {\n $serverBaseUrl = $config->server->url;\n $url = $serverBaseUrl . '/cashapp.php?control=modpay';\n\n\t\t\t/**\n\t\t\t * The old cash app system expects a \"PaymentType\" string:\n\t\t\t * CREDIT-AMERICAN EXPRESS\n\t\t\t * CREDIT-MC\n\t\t\t * CREDIT-VISA\n\t\t\t * CREDIT-DISCOVER\n\t\t\t */\n\t\t\tswitch(substr($values['card_number'], 0, 1)) {\n\t\t\t\tcase 6:\n\t\t\t\t\t$params['PaymentType'] = 'CREDIT-DISCOVER';\n $paymentType = 'CREDIT-DISCOVER';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$params['PaymentType'] = 'CREDIT-MC';\n $paymentType = 'CREDIT-MC';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$params['PaymentType'] = 'CREDIT-VISA';\n $paymentType = 'CREDIT-VISA';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$params['PaymentType'] = 'CREDIT-AMERICAN EXPRESS';\n $paymentType = 'CREDIT-AMERICAN EXPRESS';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n $client = Esquire_Http_Builder::getInstance($config, $url);\n \n $postVars = array(\n 'control' => 'modpay',\n 'action' => 'processcreditcard',\n 'values' => json_encode($params),\n 'invoices' => json_encode($invoiceArray),\n\t\t\t\t\t'PaymentType' => $paymentType,\n 'entered_login' => $config->system->sys_account_name,\n 'entered_password' => $config->system->sys_key,\n 'login' => $config->system->sys_account_name,\n 'password' => $config->system->sys_key,\n 'paymentId' => $paymentId\n );\n \n $client->setParameterPost(\n $postVars\n );\n\n\t\t\t$json = null;\n\n\t\t\t/**\n\t\t\t * Errors from Modpay shouldn't bubble up\n\t\t\t */\n\t\t\ttry {\n\t\t\t\t$logger->log('Modpay params -- ' . print_r($postVars, true), Zend_Log::INFO);\n\t\t\t\t$logger->log('Modpay URL -- ' . $url, Zend_Log::INFO);\n\t\t\t\t$response = $client->request('POST');\n\t\t\t\t$body = $response->getBody();\n\t\t\t\t$logger->log('Modpay Response -- ' . $body, Zend_Log::INFO);\n\t\t\t\t$json = json_decode($body, true);\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$logger->log(\n\t\t\t\t\t'Caught exception when processing payment - ' . $e->getMessage(), \n\t\t\t\t\tZend_Log::ERR\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$transactionNumber = $paymentId;\n\t\t\twhile(strlen($transactionNumber) < 10) {\n\t\t\t\t$transactionNumber = '0' . $transactionNumber;\n\t\t\t}\n\n\t\t\tif (!empty($json) && $json['success'] == 1) {\n\t\t\t\t$commitMessage = 'Payment successfully applied to invoices. '\n\t\t\t\t\t\t\t . 'Your transaction number is ' . $transactionNumber;\n\t\t\t} else {\n\t\t\t\t$commitMessage = '<b>Warning: </b>We were unable to successfully '\n\t\t\t\t\t\t\t . 'apply this payment to your invoices. Our support '\n\t\t\t\t\t\t\t . 'staff have been notified of the issue and will '\n\t\t\t\t\t\t\t . 'contact you to resolve it.'\n\t\t\t\t\t\t\t . '<br /><br />'\n\t\t\t\t\t\t\t . 'Your transaction number is ' . $transactionNumber;\n\t\t\t}\n } \n\n\t\t$this->getResponse()\n\t\t\t ->setHttpResponseCode(200);\n\n $this->view->data = array(\n\t\t\t'success' => true,\n\t\t\t'message' => $commitMessage,\n\t\t\t'payment_id' => $paymentId\n\t\t);\n\t}",
"public function getPaymentCreateRequest() {\n $data = null;\n if ($this->amount && $this->currency) {\n // capture pre-authorized payment\n if ($this->parentTransactionId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"authorization\" => $this->parentTransactionId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using Simplify customer identifier\n else if ($this->cardId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"customer\" => $this->cardId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using card token\n else if ($this->cardToken) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"token\" => $this->cardToken,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using raw card data\n else if ($this->cardNumber) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"card\" => array(\n \"expYear\" => $this->expirationYear,\n \"expMonth\" => $this->expirationMonth, \n \"cvc\" => $this->cvc,\n \"number\" => $this->cardNumber\n ),\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n if ($this->billing) {\n $data[\"card\"][\"name\"] = $this->billing->getName();\n $data[\"card\"][\"addressCity\"] = $this->billing->getCity();\n $data[\"card\"][\"addressLine1\"] = $this->billing->getStreetLine(1);\n $data[\"card\"][\"addressLine2\"] = $this->billing->getStreetLine(2);\n $data[\"card\"][\"addressZip\"] = $this->billing->getPostcode();\n $data[\"card\"][\"addressState\"] = $this->billing->getRegion();\n $data[\"card\"][\"addressCountry\"] = $this->billing->getCountryId();\n }\n } \n }\n return $data;\n }",
"public function createPayment(){\n \t$this->pushTransaction();\n\n \t$this->info['intent'] = $this->intent;\n\n \t$fields_string = http_build_query($this->info);\n\t\tcurl_setopt($this->ch, CURLOPT_URL, \"https://api.sandbox.paypal.com/v1/payments/payment\");\n\t\tcurl_setopt($this->ch,CURLOPT_POSTFIELDS, json_encode($this->info));\n\t\tcurl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_HTTPHEADER, $this->headers);\n\n\t\t$result = curl_exec($this->ch);\n\n\t\tif (curl_errno($this->ch)) {\n\t\t echo 'Error:' . curl_error($this->ch);\n\t\t}\n\n\t\tcurl_close ($this->ch);\n\n\t\treturn $result;\n }",
"public function createHttpRequest(array $request)\n {\n return $this->transferBuilder\n ->setBody($request)\n ->setMethod('POST')\n ->setHeaders(array('content-type:application/json'))\n ->setUri('https://secure.citypay.com/paylink3/create')\n ->build();\n }",
"public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create(array $request)\n {\n $apiReques = [];\n $url = $this->getUrl();\n $apiRequest[\"Token\"] = $request[\"Token\"];\n $apiRequest[\"Amount\"] = $request[\"Amount\"];\n\n $this->log->writeLog($apiReques);\n \n $headers = array(\"Content-Type\" => \"application/json\", \"Accept\" => \"application/json\", \"Authorization\" => $request[\"datacap_mid\"]);\n return $this->transferBuilder\n ->setMethod('POST')\n ->setHeaders($headers)\n ->setUri($url)\n ->setBody($apiRequest)\n ->build();\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}/authorization';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($authorizationRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($authorizationRequest));\n } else {\n $httpBody = $authorizationRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function create_payment( $access_token, $c_total, $c_articulo, $c_descripcion, $c_cantidad ) {\r\n\r\n global $host;\r\n\r\n $postdata= get_json_payment( $c_total, $c_articulo, $c_descripcion, $c_cantidad );\r\n\r\n $url = $host.'/v1/payments/payment';\r\n $curl = curl_init($url); \r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($curl, CURLOPT_HEADER, false);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\r\n 'Authorization: Bearer '.$access_token,\r\n 'Accept: application/json',\r\n 'Content-Type: application/json'\r\n ));\r\n\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); \r\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\r\n $response = curl_exec( $curl );\r\n if (empty($response)) {\r\n // some kind of an error happened\r\n die(curl_error($curl));\r\n curl_close($curl); // close cURL handler\r\n } else {\r\n $info = curl_getinfo($curl);\r\n curl_close($curl); // close cURL handler\r\n if($info['http_code'] != 200 && $info['http_code'] != 201 ) {\r\n echo \"Received error: \" . $info['http_code']. \"\\n\";\r\n echo \"Raw response:\".$response.\"\\n\";\r\n die();\r\n }\r\n }\r\n\r\n\r\n // Convert the result from JSON format to a PHP array \r\n $jsonResponse = json_decode($response, TRUE);\r\n return $jsonResponse;\r\n}",
"public function build_payment_request(Transaction $transaction)\n {\n $request = array();\n $request['amount'] = $transaction->amount;\n $request['currency'] = config_item('store_currency_code');\n $request['transactionId'] = $transaction->id;\n $request['description'] = lang('store.order').' #'.$transaction->order->id;\n $request['transactionReference'] = $transaction->reference;\n $request['returnUrl'] = $this->build_return_url($transaction);\n $request['notifyUrl'] = $request['returnUrl'];\n $request['cancelUrl'] = $transaction->order->cancel_url;\n $request['clientIp'] = $this->ee->input->ip_address();\n\n // custom gateways may wish to access the order directly\n $request['order'] = $transaction->order;\n $request['orderId'] = $transaction->order->id;\n\n // these only apply to PayPal\n $request['noShipping'] = 1;\n $request['allowNote'] = 0;\n\n return $request;\n }",
"public function postRequestMoneyPayApi()\n {\n $uid = request('user_id');\n $emailOrPhone = request('emailOrPhone');\n $amount = request('amount');\n $currency_id = request('currencyId');\n $note = request('note');\n $uuid = unique_code();\n $processedBy = $this->helper->getPrefProcessedBy();\n $emailFilterValidate = $this->helper->validateEmailInput(trim($emailOrPhone));\n $phoneRegex = $this->helper->validatePhoneInput(trim($emailOrPhone));\n $senderInfo = User::where(['id' => $uid])->first(['email']);\n $userInfo = $this->helper->getEmailPhoneValidatedUserInfo($emailFilterValidate, $phoneRegex, trim($emailOrPhone));\n $receiverName = isset($userInfo) ? $userInfo->first_name . ' ' . $userInfo->last_name : '';\n $arr = [\n 'unauthorisedStatus' => $this->unauthorisedStatus,\n 'emailFilterValidate' => $emailFilterValidate,\n 'phoneRegex' => $phoneRegex,\n 'processedBy' => $processedBy,\n 'user_id' => $uid,\n 'userInfo' => $userInfo,\n 'currency_id' => $currency_id,\n 'uuid' => $uuid,\n 'amount' => $amount,\n 'receiver' => $emailOrPhone,\n 'note' => $note,\n 'receiverName' => $receiverName,\n 'senderEmail' => $senderInfo->email,\n ];\n //Get response\n $response = $this->requestPayment->processRequestCreateConfirmation($arr, 'mobile');\n if ($response['status'] != 200)\n {\n if (empty($response['transactionOrReqPaymentId']))\n {\n return response()->json([\n 'status' => false,\n ]);\n }\n return response()->json([\n 'status' => true,\n 'requestMoneyMailErrorMessage' => $response['ex']['message'],\n 'tr_ref_id' => $response['transactionOrReqPaymentId'],\n ]);\n }\n return response()->json([\n 'status' => true,\n 'tr_ref_id' => $response['transactionOrReqPaymentId'],\n ]);\n }",
"function createOrder($amount, $currency) {\n\n\t//Building headers\n\t$headers = AUTH_HEADER;\n\t$headers[] = 'content-type: application/json';\n\n\t//Building data\n\t$data = Array(\n \"depositCoin\" => $currency\n ,\"destinationCoin\" => PAYOUT_CURRENCY\n ,\"depositCoinAmount\" => $amount\n ,\"destinationCoinAmount\" => \"\"\n ,\"destinationAddress\" => \"\" // PAYOUT_ADDRESS[PAYOUT_CURRENCY]\n //,\"refundAddress\" => \"\" // alternate JSON object to recollect in caso of a trade error\n\t\t//,\"callback\" => CS_CALLBACK //to receive any change in the status of the order\n\t\t);\n //$data['refundAddress'] = Array(\n // \"address\" => \"\" // alternative collecting address\n // ,'tag' => null);\n\n $data['destinationAddress'] = Array(\n \"address\" => PAYOUT_ADDRESS[PAYOUT_CURRENCY]\n ,'tag' => null);\n\n\terror_log(\"Creating order with data = \" . json_encode($data));\n\n\t//POSTing\n\t$res = httpPost(URL_ORDERCREATE,json_encode($data), $headers);\n\terror_log($res);\n\treturn json_decode($res,true);\n}",
"protected function quotesV2PostRequest($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_id' is set\n if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'due_date' is set\n if ($due_date === null || (is_array($due_date) && count($due_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $due_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'quote_date' is set\n if ($quote_date === null || (is_array($quote_date) && count($quote_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $quote_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'created_utc' is set\n if ($created_utc === null || (is_array($created_utc) && count($created_utc) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_utc when calling quotesV2Post'\n );\n }\n // verify the required parameter 'approved_date' is set\n if ($approved_date === null || (is_array($approved_date) && count($approved_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $approved_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null || (is_array($currency_code) && count($currency_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'status' is set\n if ($status === null || (is_array($status) && count($status) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $status when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_rate' is set\n if ($currency_rate === null || (is_array($currency_rate) && count($currency_rate) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_rate when calling quotesV2Post'\n );\n }\n // verify the required parameter 'company_reference' is set\n if ($company_reference === null || (is_array($company_reference) && count($company_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $company_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'eu_third_party' is set\n if ($eu_third_party === null || (is_array($eu_third_party) && count($eu_third_party) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $eu_third_party when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_reference' is set\n if ($customer_reference === null || (is_array($customer_reference) && count($customer_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_customer_name' is set\n if ($invoice_customer_name === null || (is_array($invoice_customer_name) && count($invoice_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address1' is set\n if ($invoice_address1 === null || (is_array($invoice_address1) && count($invoice_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address2' is set\n if ($invoice_address2 === null || (is_array($invoice_address2) && count($invoice_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_postal_code' is set\n if ($invoice_postal_code === null || (is_array($invoice_postal_code) && count($invoice_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_city' is set\n if ($invoice_city === null || (is_array($invoice_city) && count($invoice_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_country_code' is set\n if ($invoice_country_code === null || (is_array($invoice_country_code) && count($invoice_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_customer_name' is set\n if ($delivery_customer_name === null || (is_array($delivery_customer_name) && count($delivery_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address1' is set\n if ($delivery_address1 === null || (is_array($delivery_address1) && count($delivery_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address2' is set\n if ($delivery_address2 === null || (is_array($delivery_address2) && count($delivery_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_postal_code' is set\n if ($delivery_postal_code === null || (is_array($delivery_postal_code) && count($delivery_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_city' is set\n if ($delivery_city === null || (is_array($delivery_city) && count($delivery_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_country_code' is set\n if ($delivery_country_code === null || (is_array($delivery_country_code) && count($delivery_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_name' is set\n if ($delivery_method_name === null || (is_array($delivery_method_name) && count($delivery_method_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_code' is set\n if ($delivery_method_code === null || (is_array($delivery_method_code) && count($delivery_method_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_code' is set\n if ($delivery_term_code === null || (is_array($delivery_term_code) && count($delivery_term_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_name' is set\n if ($delivery_term_name === null || (is_array($delivery_term_name) && count($delivery_term_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_is_private_person' is set\n if ($customer_is_private_person === null || (is_array($customer_is_private_person) && count($customer_is_private_person) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_is_private_person when calling quotesV2Post'\n );\n }\n // verify the required parameter 'includes_vat' is set\n if ($includes_vat === null || (is_array($includes_vat) && count($includes_vat) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $includes_vat when calling quotesV2Post'\n );\n }\n // verify the required parameter 'is_domestic' is set\n if ($is_domestic === null || (is_array($is_domestic) && count($is_domestic) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $is_domestic when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_type' is set\n if ($rot_reduced_invoicing_type === null || (is_array($rot_reduced_invoicing_type) && count($rot_reduced_invoicing_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_property_type' is set\n if ($rot_property_type === null || (is_array($rot_property_type) && count($rot_property_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_property_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_property_name' is set\n if ($rot_reduced_invoicing_property_name === null || (is_array($rot_reduced_invoicing_property_name) && count($rot_reduced_invoicing_property_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_property_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_org_number' is set\n if ($rot_reduced_invoicing_org_number === null || (is_array($rot_reduced_invoicing_org_number) && count($rot_reduced_invoicing_org_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_org_number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_amount' is set\n if ($rot_reduced_invoicing_amount === null || (is_array($rot_reduced_invoicing_amount) && count($rot_reduced_invoicing_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_automatic_distribution' is set\n if ($rot_reduced_invoicing_automatic_distribution === null || (is_array($rot_reduced_invoicing_automatic_distribution) && count($rot_reduced_invoicing_automatic_distribution) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_automatic_distribution when calling quotesV2Post'\n );\n }\n // verify the required parameter 'persons' is set\n if ($persons === null || (is_array($persons) && count($persons) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $persons when calling quotesV2Post'\n );\n }\n // verify the required parameter 'terms_of_payment' is set\n if ($terms_of_payment === null || (is_array($terms_of_payment) && count($terms_of_payment) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $terms_of_payment when calling quotesV2Post'\n );\n }\n // verify the required parameter 'sales_document_attachments' is set\n if ($sales_document_attachments === null || (is_array($sales_document_attachments) && count($sales_document_attachments) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sales_document_attachments when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rows' is set\n if ($rows === null || (is_array($rows) && count($rows) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rows when calling quotesV2Post'\n );\n }\n // verify the required parameter 'total_amount' is set\n if ($total_amount === null || (is_array($total_amount) && count($total_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'vat_amount' is set\n if ($vat_amount === null || (is_array($vat_amount) && count($vat_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vat_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'roundings_amount' is set\n if ($roundings_amount === null || (is_array($roundings_amount) && count($roundings_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $roundings_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'uses_green_technology' is set\n if ($uses_green_technology === null || (is_array($uses_green_technology) && count($uses_green_technology) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $uses_green_technology when calling quotesV2Post'\n );\n }\n\n $resourcePath = '/v2/quotes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($id !== null) {\n $formParams['Id'] = ObjectSerializer::toFormValue($id);\n }\n // form params\n if ($number !== null) {\n $formParams['Number'] = ObjectSerializer::toFormValue($number);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['CustomerId'] = ObjectSerializer::toFormValue($customer_id);\n }\n // form params\n if ($due_date !== null) {\n $formParams['DueDate'] = ObjectSerializer::toFormValue($due_date);\n }\n // form params\n if ($quote_date !== null) {\n $formParams['QuoteDate'] = ObjectSerializer::toFormValue($quote_date);\n }\n // form params\n if ($created_utc !== null) {\n $formParams['CreatedUtc'] = ObjectSerializer::toFormValue($created_utc);\n }\n // form params\n if ($approved_date !== null) {\n $formParams['ApprovedDate'] = ObjectSerializer::toFormValue($approved_date);\n }\n // form params\n if ($currency_code !== null) {\n $formParams['CurrencyCode'] = ObjectSerializer::toFormValue($currency_code);\n }\n // form params\n if ($status !== null) {\n $formParams['Status'] = ObjectSerializer::toFormValue($status);\n }\n // form params\n if ($currency_rate !== null) {\n $formParams['CurrencyRate'] = ObjectSerializer::toFormValue($currency_rate);\n }\n // form params\n if ($company_reference !== null) {\n $formParams['CompanyReference'] = ObjectSerializer::toFormValue($company_reference);\n }\n // form params\n if ($eu_third_party !== null) {\n $formParams['EuThirdParty'] = ObjectSerializer::toFormValue($eu_third_party);\n }\n // form params\n if ($customer_reference !== null) {\n $formParams['CustomerReference'] = ObjectSerializer::toFormValue($customer_reference);\n }\n // form params\n if ($invoice_customer_name !== null) {\n $formParams['InvoiceCustomerName'] = ObjectSerializer::toFormValue($invoice_customer_name);\n }\n // form params\n if ($invoice_address1 !== null) {\n $formParams['InvoiceAddress1'] = ObjectSerializer::toFormValue($invoice_address1);\n }\n // form params\n if ($invoice_address2 !== null) {\n $formParams['InvoiceAddress2'] = ObjectSerializer::toFormValue($invoice_address2);\n }\n // form params\n if ($invoice_postal_code !== null) {\n $formParams['InvoicePostalCode'] = ObjectSerializer::toFormValue($invoice_postal_code);\n }\n // form params\n if ($invoice_city !== null) {\n $formParams['InvoiceCity'] = ObjectSerializer::toFormValue($invoice_city);\n }\n // form params\n if ($invoice_country_code !== null) {\n $formParams['InvoiceCountryCode'] = ObjectSerializer::toFormValue($invoice_country_code);\n }\n // form params\n if ($delivery_customer_name !== null) {\n $formParams['DeliveryCustomerName'] = ObjectSerializer::toFormValue($delivery_customer_name);\n }\n // form params\n if ($delivery_address1 !== null) {\n $formParams['DeliveryAddress1'] = ObjectSerializer::toFormValue($delivery_address1);\n }\n // form params\n if ($delivery_address2 !== null) {\n $formParams['DeliveryAddress2'] = ObjectSerializer::toFormValue($delivery_address2);\n }\n // form params\n if ($delivery_postal_code !== null) {\n $formParams['DeliveryPostalCode'] = ObjectSerializer::toFormValue($delivery_postal_code);\n }\n // form params\n if ($delivery_city !== null) {\n $formParams['DeliveryCity'] = ObjectSerializer::toFormValue($delivery_city);\n }\n // form params\n if ($delivery_country_code !== null) {\n $formParams['DeliveryCountryCode'] = ObjectSerializer::toFormValue($delivery_country_code);\n }\n // form params\n if ($delivery_method_name !== null) {\n $formParams['DeliveryMethodName'] = ObjectSerializer::toFormValue($delivery_method_name);\n }\n // form params\n if ($delivery_method_code !== null) {\n $formParams['DeliveryMethodCode'] = ObjectSerializer::toFormValue($delivery_method_code);\n }\n // form params\n if ($delivery_term_code !== null) {\n $formParams['DeliveryTermCode'] = ObjectSerializer::toFormValue($delivery_term_code);\n }\n // form params\n if ($delivery_term_name !== null) {\n $formParams['DeliveryTermName'] = ObjectSerializer::toFormValue($delivery_term_name);\n }\n // form params\n if ($customer_is_private_person !== null) {\n $formParams['CustomerIsPrivatePerson'] = ObjectSerializer::toFormValue($customer_is_private_person);\n }\n // form params\n if ($includes_vat !== null) {\n $formParams['IncludesVat'] = ObjectSerializer::toFormValue($includes_vat);\n }\n // form params\n if ($is_domestic !== null) {\n $formParams['IsDomestic'] = ObjectSerializer::toFormValue($is_domestic);\n }\n // form params\n if ($rot_reduced_invoicing_type !== null) {\n $formParams['RotReducedInvoicingType'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_type);\n }\n // form params\n if ($rot_property_type !== null) {\n $formParams['RotPropertyType'] = ObjectSerializer::toFormValue($rot_property_type);\n }\n // form params\n if ($rot_reduced_invoicing_property_name !== null) {\n $formParams['RotReducedInvoicingPropertyName'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_property_name);\n }\n // form params\n if ($rot_reduced_invoicing_org_number !== null) {\n $formParams['RotReducedInvoicingOrgNumber'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_org_number);\n }\n // form params\n if ($rot_reduced_invoicing_amount !== null) {\n $formParams['RotReducedInvoicingAmount'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_amount);\n }\n // form params\n if ($rot_reduced_invoicing_automatic_distribution !== null) {\n $formParams['RotReducedInvoicingAutomaticDistribution'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_automatic_distribution);\n }\n // form params\n if ($persons !== null) {\n $formParams['Persons'] = ObjectSerializer::toFormValue($persons);\n }\n // form params\n if ($terms_of_payment !== null) {\n $formParams['TermsOfPayment'] = ObjectSerializer::toFormValue($terms_of_payment);\n }\n // form params\n if ($sales_document_attachments !== null) {\n $formParams['SalesDocumentAttachments'] = ObjectSerializer::toFormValue($sales_document_attachments);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // form params\n if ($total_amount !== null) {\n $formParams['TotalAmount'] = ObjectSerializer::toFormValue($total_amount);\n }\n // form params\n if ($vat_amount !== null) {\n $formParams['VatAmount'] = ObjectSerializer::toFormValue($vat_amount);\n }\n // form params\n if ($roundings_amount !== null) {\n $formParams['RoundingsAmount'] = ObjectSerializer::toFormValue($roundings_amount);\n }\n // form params\n if ($uses_green_technology !== null) {\n $formParams['UsesGreenTechnology'] = ObjectSerializer::toFormValue($uses_green_technology);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createUpdateTransactionRequest()\n\t{\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<updatetransaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) . '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) . '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) . '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<invoiceid>' . $this->xmlEscape($this->transaction['invoice_id']) . '</invoiceid>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<shipdate>' . $this->xmlEscape($this->transaction['shipdate']) \t. '</shipdate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t</updatetransaction>';\n \n\t\treturn $request;\n\t}",
"public function createRequestTransaction(Store_Model_Order $order, array $params = array())\r\n {\r\n if ($order->gateway_id != $this->_gatewayInfo->gateway_id) {\r\n throw new Experts_Payment_Plugin_Exception('Gateways do not match');\r\n }\r\n\r\n // Check that item_type match\r\n if ($order->item_type != 'store_request') {\r\n throw new Experts_Payment_Plugin_Exception(\"Wrong item_type has been provided. Method requires 'store_request'\");\r\n }\r\n\r\n // Check if the order has item\r\n if (null == ($request = $order->getItem())) {\r\n throw new Experts_Payment_Plugin_Exception(\"Provided store_request doesn't exist\");\r\n }\r\n\r\n // Check if the request has page\r\n if (null == ($page = $request->getOwner())) {\r\n throw new Experts_Payment_Plugin_Exception(\"Provided store doesn't exist\");\r\n }\r\n // Check if the page owner\r\n if (null == ($user = $page->getOwner())) {\r\n throw new Experts_Payment_Plugin_Exception(\"Store owner doesn't exist or has been deleted\");\r\n }\r\n\r\n // Prepare request item\r\n $view = Zend_Registry::get('Zend_View');\r\n $paymentRequest = array(\r\n 'li_0_type' => 'product',\r\n 'li_0_name' => $view->translate('STORE_Money Request'),\r\n 'li_0_quantity' => 1,\r\n 'li_0_price' => $order->total_amt,\r\n 'li_0_tangible' => 'N',\r\n 'li_0_product_id' => $order->item_id,\r\n );\r\n\r\n $params['fixed'] = true;\r\n $params['skip_landing'] = true;\r\n\r\n $params = array_merge($params, $paymentRequest);\r\n\r\n // Create transaction\r\n $transaction = $this->createTransaction($params);\r\n\r\n return $transaction;\r\n }",
"public function createTransaction(array $params) {\n $transaction = new Engine_Payment_Transaction($params);\n $transaction->process($this->getGateway());\n return $transaction;\n }",
"public function testBuildPOSTransaction()\n {\n $config = array();\n $amount = '10.00';\n\n $transaction = TransactionBuilder::buildPOSTransaction($config, $amount);\n $this->assertInstanceOf('\\SinglePay\\PaymentService\\Element\\Express\\Type\\Transaction', $transaction);\n $this->assertEquals($transaction->MarketCode, 'Retail');\n $this->assertEquals($transaction->TransactionAmount, '10.00');\n }",
"protected function createCartRequest()\n {\n\n $resourcePath = '/v3/carts/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function asPostRequest()\n {\n $url = $this->asUrl();\n\n return parent::request('POST', $url, $this->post_data, $this->fqb_access_token, $this->fqb_etag);\n }",
"public function postOrders($params = [])\n {\n if(empty($params)){\n throw new AbbyBadRequestBodyModel(400, Yii::t('base','Request parameters can not be empty'));\n }\n// {\n// \"type\": \"string\",\n// \"email\": \"string\",\n// \"contact_culture\": \"string\",\n// \"contact_utc_offset\": \"string\",\n// \"label\": \"string\", //max 89\n// \"approval_required\": true,\n// \"cost_type\": \"Default\", //\"Default\", \"SomeDiscounts\", \"AllDiscounts\"\n// \"unit_type\": \"Chars\",\n// \"currency\": \"string\",\n// \"from\": \"string\",\n// \"to\": [\n// \"string\"\n// ],\n// \"files\":\n// [bannedip\n// {\n// \"id\": \"string\",\n// \"token\": \"string\"\n// }\n// ]\n// }\n\n return $this->send('order','post');\n }",
"public function createTransaction(Request $request) {\n // Validation\n $validator = Validator::make($request->all(), [\n 'amount' => 'required|numeric',\n 'name' => 'required',\n 'due' => 'required|date',\n 'categories' => 'nullable|array',\n ]);\n if($validator->fails()) {\n return response()->json(['status' => 'error', 'error' => $validator->errors()], 422);\n }\n\n $transaction = new Transaction;\n $transaction->amount = $request->amount;\n $transaction->name = $request->name;\n $transaction->description = $request->description;\n $transaction->due = $request->due;\n $transaction->getUser()->associate(Auth::user());\n $transaction->save();\n $transaction->categories()->attach($request->categories);\n\n return response()->json(['status' => 'OK', 'transaction' => $transaction], 201);\n }",
"public function create_request($data)\n {\n $data = array_merge($this->_parameters, $data);\n $res = $this->_client->call('bpPayRequest', $data, $this->namespace);\n if ($this->_client->fault) {\n $this->_result = $res;\n } else {\n $res = explode(',', $res['return']);\n if(2 == count($res)) {\n $this->_result = [\n 'ResCode' => $res[0],\n 'RefId' => $res[1] ?? '',\n ];\n } else {\n $this->_result = -1000;\n }\n }\n\n return $this;\n }",
"public function make(AuthorizeTransactionContracts $authorizeTransaction)\n {\n $request = new StdClass;\n\n //Request\n $request->RequestId = $authorizeTransaction->getRequestId();\n $request->Version = $authorizeTransaction->getVersion();\n //OrderData\n $request->OrderData = new StdClass;\n $request->OrderData->MerchantId = $authorizeTransaction->getOrderData()->getMerchantId();\n $request->OrderData->OrderId = $authorizeTransaction->getOrderData()->getOrderId();\n $request->OrderData->BraspagOrderId = new SoapVar($authorizeTransaction->getOrderData()->getBraspagOrderId(), SOAP_ENC_OBJECT, 'true');\n //CustomerData\n $request->CustomerData = new StdClass;\n $request->CustomerData->CustomerIdentity = $authorizeTransaction->getCustomerData()->getCustomerIdentity();\n $request->CustomerData->CustomerName = $authorizeTransaction->getCustomerData()->getCustomerName();\n $request->CustomerData->CustomerEmail = $authorizeTransaction->getCustomerData()->getCustomerEmail();\n $request->CustomerData->CustomerAddressData = new SoapVar($authorizeTransaction->getCustomerData()->getCustomerAddressData(), SOAP_ENC_OBJECT, 'true');\n $request->CustomerData->DeliveryAddressData = new SoapVar($authorizeTransaction->getCustomerData()->getCustomerDeliveryAddressData(), SOAP_ENC_OBJECT, 'true');\n $authorizeTransaction->getCustomerData()->getCustomerDeliveryAddressData();\n //PaymentDataCollection\n $Payment = new StdClass;\n $Payment->PaymentMethod = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getPaymentMethod(), XSD_INT, null, null, 'PaymentMethod', BrasPagSoapClient::NAMESPACE);\n $Payment->Amount = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAmount(), XSD_INT, null, null, 'Amount', BrasPagSoapClient::NAMESPACE);\n $Payment->Currency = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getCurrency(), XSD_STRING, null, null, 'Currency', BrasPagSoapClient::NAMESPACE );\n $Payment->Country = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getCountry(), XSD_STRING, null, null, 'Country', BrasPagSoapClient::NAMESPACE );\n\n $PaymentType = $authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getObjPaymentType();\n if ($PaymentType instanceof CreditCardDataRequestContracts){\n $Payment->NumberOfPayments = new SoapVar($PaymentType->getNumberOfPayments(), XSD_STRING, null, null, 'Number', BrasPagSoapClient::NAMESPACE );\n $Payment->PaymentPlan = new SoapVar($PaymentType->getPaymentPlan(), XSD_STRING, null, null, 'PaymentPlan', BrasPagSoapClient::NAMESPACE );\n $Payment->TransactionType = new SoapVar($PaymentType->getTransactionType(), XSD_STRING, null, null, 'TransactionType', BrasPagSoapClient::NAMESPACE );\n $Payment->CardHolder = new SoapVar($PaymentType->getCardHolder(), XSD_STRING, null, null, 'CardHolder', BrasPagSoapClient::NAMESPACE );\n $Payment->CardNumber = new SoapVar($PaymentType->getCardNumber(), XSD_STRING, null, null, 'CardNumber', BrasPagSoapClient::NAMESPACE );\n $Payment->CardSecurityCode = new SoapVar($PaymentType->getCardSecurityCode(), XSD_STRING, null, null, 'CardSecurityCode', BrasPagSoapClient::NAMESPACE );\n $Payment->CardExpirationDate = new SoapVar($PaymentType->getCardExpirationDate(), XSD_STRING, null, null, 'CardSecurityCode', BrasPagSoapClient::NAMESPACE );\n }\n\n $Payment->AdditionalDataCollection = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAdditionalDataCollection(), SOAP_ENC_OBJECT, 'true', NULL, NULL, BrasPagSoapClient::NAMESPACE);\n $Payment->AffiliationData = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAffiliationData(), SOAP_ENC_OBJECT, 'true', NULL, NULL, BrasPagSoapClient::NAMESPACE);\n $request->PaymentDataCollection = new StdClass;\n $request->PaymentDataCollection->PaymentDataRequest = new SoapVar($Payment, SOAP_ENC_OBJECT, $PaymentType->getPaymentType());\n\n return $request;\n }",
"function createTransactionRequest()\n\t{\n\t\t$issuer \t\t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->issuer))\n\t\t{\n\t\t\t$issuer \t\t\t\t\t\t=\t' issuer=\"'.$this->xmlEscape($this->issuer).'\"';\n\t\t}\n \n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<redirecttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) \t. '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t\t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t\t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<referrer>' . $this->xmlEscape($this->customer['referrer']) \t\t\t. '</referrer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<user_agent>' . $this->xmlEscape($this->customer['user_agent']) \t\t\t. '</user_agent>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state']) \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t <transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t\t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) \t\t. '</daysactive>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<gateway'.$issuer.'>'.$this->xmlEscape($this->transaction['gateway']) \t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t </transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t <signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</redirecttransaction>';\n \n\t\treturn $request;\n\t}",
"public static function create($data = array()){\n $trx = new Transaction();\n $trx->customer_name = $data['customerName'];\n $trx->vehicle_id = $data['vehiclesid'];\n $trx->status = statusWorkOrder::OPEN;\n $trx->payment_state = paymentState::INITIATE;\n $trx->date = date(static::$sqlformat);\n $batch = Batch::getSingleResult(array(\n 'status' => array(batchStatus::UNSETTLED)\n ));\n if ($batch===null) {\n $batch = Batch::create(array());\n }\n $trx->batch_id = $batch->id;\n $trx->save();\n\n\n //define amount variable\n $amountItem=(double)0;\n //add items if available\n if(isset($data['items']) && is_array($data['items'])) {\n foreach($data['items'] as $items) {\n $item_price = ItemPrice::getSingleResult(array('item_id' => $items['item_id']));\n $items['item_price_id']=$item_price->id;\n $trx->transaction_item()->insert($items);\n $itemPrice = (double)Item::find((int)$items['item_id'])->price;\n $amountItem=$amountItem+($itemPrice*$items['quantity']);\n $stock=($item_price->item->stock - $items['quantity']);\n $updatestock = Item::updateStock($item_price->item->id, $stock);\n }\n }\n\n //add service\n $amountService=(double)0;\n $discAmount=(double)0;\n if(isset($data['services']) && is_array($data['services'])) {\n foreach($data['services'] as $service) {\n $trx->transaction_service()->insert($service);\n $servicePrice = (double)Service::find((int)$service['service_formula_id'])->service_formula()->price;\n $amountService=$amountService+$servicePrice;\n }\n $membership = Member::getSingleResult(array(\n 'status' => array(statusType::ACTIVE),\n 'vehicle_id' => $data['vehiclesid'],\n 'is_member' => true\n ));\n if ($membership) {\n $trx->membership_id=$membership->id;\n if (isset($membership->discount)){\n $discAmount = $amountService * ($membership->discount->value / 100);\n }\n }\n }\n\n //add mechanic\n if(isset($data['users']) && is_array($data['users'])) {\n foreach($data['users'] as $user) {\n $trx->user_workorder()->insert($user);\n }\n }\n\n\n //GENERATE WORK ORDER & INVOICE NO\n $woNo = 'C'.$data['customerId'].'V'.$data['vehiclesid'].($trx->id);\n $date = date(static::$yyyymmdd_format, time());\n $invNo = $date.($trx->id);\n $trx->invoice_no= $invNo;\n $trx->workorder_no = $woNo;\n $trx->amount = ($amountItem+$amountService);\n $trx->discount_amount = $discAmount;\n $trx->paid_amount = ($amountItem + $amountService - $discAmount);\n $trx->save();\n return $trx->id;\n }",
"public function store (Request $request) {\n\t\tif (True || \\Entrust::can('make_transaction')) {\n\t\t\t$this->validate($request, [\n\t\t\t\t'user_id' => 'required|numeric',\n\t\t\t\t'store_id' => 'required|numeric',\n\t\t\t\t'product_id' => 'required|numeric',\n\t\t\t\t'amount' => 'required|numeric|min:1',\n\t\t\t]);\n\n\t\t\t$resp = Transaction::create($request->all());\n\t\t\t$status = 200;\n\t\t} else {\n\t\t\t$status = 403;\n\t\t\t$resp = 'unauthorized create request';\n\t\t}\n\n\t\treturn response()->json([\n\t\t\t'status' => $status,\n\t\t\t'response' => $resp,\n\t\t], $status);\n\t}",
"public function createRequest($terminalId, $orderId);",
"protected function _buildRequest(Varien_Object $payment)\n {\n \t$order = $payment->getOrder();\n \n \t$order_id = $order->getRealOrderId();\n \t$secretKey = Mage::getStoreConfig('payment/'.$this->getPaymentMethodCode().'/secret_key');\n \t$mid = Mage::getStoreConfig('payment/'.$this->getPaymentMethodCode().'/mid');\n \t$ref = $order_id;\n \t$cur = $order->getBaseCurrencyCode();\n \t$amt = round($this->getOrder()->getGrandTotal(), 2);\n \tif($cur == 'KRW' || $cur == 'JPY' || $cur == 'VND')\n \t{\n \t\t$amt = round($this->getOrder()->getGrandTotal(), 0, PHP_ROUND_HALF_UP);\n \t}\n \t\n \t$linkBuf = $secretKey. \"?mid=\" . $mid .\"&ref=\" . $ref .\"&cur=\" .$cur .\"&amt=\" .$amt;\n \t\n \t//$fgkey = md5($linkBuf);\n \t$fgkey = hash(\"sha256\", $linkBuf);\n \t\n \t$txntype = 'REFUND';\n \t\n \t$params = array(\n \t\t\t'ver' \t\t\t\t=> '210',\n \t\t\t'mid' \t\t\t\t=> $mid,\n \t\t\t'txntype' \t\t\t=> $txntype,\n \t\t\t'refundtype' \t\t=> $payment->getRefundType(),\n \t\t\t'charset'\t \t\t=> 'UTF-8',\n \t\t\t'ref' \t\t=> $ref,\n \t\t\t'fgkey' \t\t=> $fgkey,\n \t\t\t'lang' \t=> $this->getLocale(),\n \t\t\t'amt' \t=> $amt,\n \t\t\t'cur' \t\t=> $cur,\n \t\t\t'refundamt'\t\t\t\t=> $payment->getRefundAmt(),\n \t\t\t'transid'\t\t\t\t=> $payment->getEximbayTransId(),\n \t\t\t'reason'\t\t\t\t=> 'Merchant Request' \t\t\t\n \t);\n \t \t\n \tMage::log($params, null, 'eximbay'.Mage::getModel('core/date')->date('Y-m-d').'.log');\n \t\n \treturn $params;\n }"
] | [
"0.6330626",
"0.6298546",
"0.62414056",
"0.6215906",
"0.6204463",
"0.6099097",
"0.6041591",
"0.60295045",
"0.59996456",
"0.5973313",
"0.5953365",
"0.59377044",
"0.5932054",
"0.5927427",
"0.59214246",
"0.58659315",
"0.583615",
"0.5826572",
"0.58226067",
"0.57990706",
"0.5659718",
"0.564994",
"0.564507",
"0.5641749",
"0.56272984",
"0.55564356",
"0.55511594",
"0.553228",
"0.5528236",
"0.5519721"
] | 0.78151375 | 0 |
Operation apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostWithHttpInfo Authorizes a transaction after finishing the process in a webshop | public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostWithHttpInfo($technicalTransactionId, $authorizationRequest = null)
{
$request = $this->apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest);
try {
// $options = $this->createHttpClientOption();
try {
$response = $this->client->sendRequest($request);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\AuthenticationError',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 409:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Teambank\RatenkaufByEasyCreditApiV3\Model\PaymentConstraintViolation',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}/authorization';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($authorizationRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($authorizationRequest));\n } else {\n $httpBody = $authorizationRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost($technicalTransactionId, $authorizationRequest = null)\n {\n $this->apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostWithHttpInfo($technicalTransactionId, $authorizationRequest);\n }",
"public function createTransaction(Customweb_Payment_Authorization_ITransactionContext $transactionContext, Customweb_Payment_ExternalCheckout_IContext $context) {\n\t\t\n\t\tthrow new Exception(\"Not yet implemented.\");\n\t}",
"public function apiPaymentV3TransactionTechnicalTransactionIdGetRequest($technicalTransactionId)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function new_ticket_transaction(){\n if(wp_verify_nonce($_POST['_wpnonce'], 'aact_continue_to_payment')){\n $api_key = DPAPIKEY;\n $orderid = $this->order->get_order_id();\n $order = $this->order->get_order($orderid);\n $_SESSION['cancelkey'] = wp_generate_uuid4();\n $order['complete_url'] = get_permalink(get_page_by_path('ticket-order-complete'));\n $order['cancel_url'] = get_permalink(get_page_by_path('ticket-test'));\n $order['return_url'] = get_permalink(get_page_by_path('confirm-ticket-order'));\n $order['cancel_key'] = $_SESSION['cancelkey'];\n $transaction = $this->transaction->send_transcation_info($order, $api_key);\n\n\n if(!is_wp_error($transaction)){\n $url = add_query_arg( 'ticket_token', $transaction->ticket_token, $transaction->redirect_url);\n wp_redirect( $url );\n exit;\n }\n\n $_SESSION['alert'] = $transaction->get_error_message().' Order Ref: '.$order['details']->orderID;\n $this->transaction->register_transaction();\n }\n }",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createTransactionCodeUsingPostWithHttpInfo($transaction_request)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\TransactionCode';\n $request = $this->createTransactionCodeUsingPostRequest($transaction_request);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\com\\hydrogen\\nucleus\\Model\\TransactionCode',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createCustomerTransaction($payment)\n { \n /**\n * Set the order in its own object\n */\n $order = $payment->getOrder();\n \n /**\n * Create the transaction\n */\n $soap_env = array(\n self::TRANS_CREATE_TRANS => array(\n 'merchantAuthentication' => $this->_getAuthentication(),\n 'transaction' => array(\n $payment->getAnetTransType() => array(\n 'amount' => $payment->getAmount(),\n 'tax' => array(\n 'amount' => $order->getBaseTaxAmount()\n ),\n 'shipping' => array(\n 'amount' => $order->getBaseShippingAmount()\n ),\n 'customerProfileId' => $payment->getAuthorizenetcimCustomerId(),\n 'customerPaymentProfileId' => $payment->getAuthorizenetcimPaymentId(),\n 'order' => array(\n 'invoiceNumber' => $order->getIncrementId()\n ),\n //'cardCode' => $payment->getCcCid() \n ) \n ),\n 'extraOptions' => 'x_delim_char='. Gorilla_AuthorizenetCim_Model_Gateway::RESPONSE_DELIM_CHAR\n )\n ); \n\n // If this is a prior auth capture, void, or refund add the transaction id\n if ($payment->getAnetTransType() == self::TRANS_PRIOR_AUTH_CAP \n || $payment->getAnetTransType() == self::TRANS_VOID\n || $payment->getAnetTransType() == self::TRANS_REFUND) \n {\n $soap_env[self::TRANS_CREATE_TRANS]['transaction'][$payment->getAnetTransType()]['transId'] = $payment->getTransId();\n }\n\n $response = $this->doCall(self::TRANS_CREATE_TRANS, $soap_env); \n \n if (!$response)\n return false;\n \n $hasErrors = $this->_checkErrors($response);\n if ($response)\n {\n if (!$hasErrors)\n {\n return $response->CreateCustomerProfileTransactionResult->directResponse;\n } else { \n return $response->CreateCustomerProfileTransactionResult->directResponse;\n } \n } else {\n return false;\n }\n }",
"public function getTransactionForTransientTokenWithHttpInfo($transientToken)\n {\n // verify the required parameter 'transientToken' is set\n if ($transientToken === null) {\n self::$logger->error(\"InvalidArgumentException : Missing the required parameter $transientToken when calling getTransactionForTransientToken\");\n throw new \\InvalidArgumentException('Missing the required parameter $transientToken when calling getTransactionForTransientToken');\n }\n // parse inputs\n $resourcePath = \"/up/v1/payment-details/{transientToken}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']);\n\n // path params\n if ($transientToken !== null) {\n $resourcePath = str_replace(\n \"{\" . \"transientToken\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($transientToken),\n $resourcePath\n );\n }\n if ('GET' == 'POST') {\n $_tempBody = '{}';\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // Logging\n self::$logger->debug(\"Resource : GET $resourcePath\");\n if (isset($httpBody)) {\n if ($this->apiClient->merchantConfig->getLogConfiguration()->isMaskingEnabled()) {\n $printHttpBody = \\CyberSource\\Utilities\\Helpers\\DataMasker::maskData($httpBody);\n } else {\n $printHttpBody = $httpBody;\n }\n \n self::$logger->debug(\"Body Parameter :\\n\" . $printHttpBody); \n }\n\n self::$logger->debug(\"Return Type : null\");\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/up/v1/payment-details/{transientToken}'\n );\n \n self::$logger->debug(\"Response Headers :\\n\" . \\CyberSource\\Utilities\\Helpers\\ListHelper::toString($httpHeader));\n\n return [$response, $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n self::$logger->error(\"ApiException : $e\");\n throw $e;\n }\n }",
"public function createTransactionCodeUsingPostAsyncWithHttpInfo($transaction_request)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\TransactionCode';\n $request = $this->createTransactionCodeUsingPostRequest($transaction_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdPatchRequest($technicalTransactionId, $transactionUpdate = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdPatch'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transactionUpdate)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transactionUpdate));\n } else {\n $httpBody = $transactionUpdate;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiMerchantV3TransactionTransactionIdCapturePostWithHttpInfo($transactionId, $captureRequest = null)\n {\n $request = $this->apiMerchantV3TransactionTransactionIdCapturePostRequest($transactionId, $captureRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\ConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"private function _sendAramex($orderNumber, $transactionStatus, $latestData) {\r\n //$transaction either complete,pending.\r\n //phone number of customer that paid.\r\n //through json\r\n $aramexData = Mage::helper('Boonagel_Cba')->aramexGateway();\r\n \r\n $amount = (string)$latestData->getTransAmount();\r\n $orderNum = (string)$orderNumber;\r\n $aramexSecret = $aramexData['secret'];\r\n /****/\r\n $hashString = $aramexSecret.$amount.$orderNum.$transactionStatus;\r\n $hashedStuff = strtoupper(hash(\"sha256\", $hashString));\r\n $hashBase64 = base64_encode($hashedStuff);\r\n /****/\r\n \r\n $data = array(\"hashval\"=>$hashBase64,\"status\"=>$transactionStatus,\"order\" => $orderNum, \"amount\" => $amount);\r\n $data_string = json_encode($data);\r\n \r\n $ch = curl_init();\r\n\r\n \r\n curl_setopt($ch, CURLOPT_URL, $aramexData['url']);\r\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER,array(\r\n 'Content-Type: application/json',\r\n 'Content-Length: ' . strlen($data_string)));\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\r\n \r\n \r\n $result = curl_exec($ch);\r\n\r\n curl_close($ch);\r\n }",
"public function curl_transaction( $data ) {\n\t\t$email = $this->getData_Unstaged_Escaped( 'email' );\n\t\t$this->logger->info( \"Making API call for donor $email\" );\n\n\t\t$filterResult = $this->runSessionVelocityFilter();\n\t\tif ( $filterResult === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/** @var HostedCheckoutProvider $provider */\n\t\t$provider = $this->getPaymentProvider();\n\t\tswitch ( $this->getCurrentTransaction() ) {\n\t\t\tcase 'createHostedCheckout':\n\t\t\t\t$result = $provider->createHostedPayment( $data );\n\t\t\t\tbreak;\n\t\t\tcase 'getHostedPaymentStatus':\n\t\t\t\t$result = $provider->getHostedPaymentStatus(\n\t\t\t\t\t$data['hostedCheckoutId']\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'approvePayment':\n\t\t\t\t$id = $data['id'];\n\t\t\t\tunset( $data['id'] );\n\t\t\t\t$result = $provider->approvePayment( $id, $data );\n\t\t\t\tbreak;\n\t\t\tcase 'cancelPayment':\n\t\t\t\t$id = $data['id'];\n\t\t\t\tunset( $data['id'] );\n\t\t\t\t$result = $provider->cancelPayment( $id );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$this->transaction_response->setRawResponse( json_encode( $result ) );\n\t\treturn true;\n\t}",
"private function createAuthorization(Request $request, Transaction $transaction)\n {\n $payment_id = $request->paymentId;\n\n $payer_id = $request->PayerID;\n $token = $request->token;\n\n $payee = $transaction->payee;\n\n $redirect_url = $this->redirect_url . '/' . $payee->username;\n\n /** clear the session payment ID **/\n if (!$payer_id || !$token) {\n return $this->sendFailResponse(\n $redirect_url,\n $transaction,\n self::DONATION_TYPE\n );\n }\n\n $payment = Payment::get($payment_id, $this->_api_context);\n $execution = new PaymentExecution();\n $execution->setPayerId($payer_id);\n\n /**Execute the payment **/\n try {\n $result = $payment->execute($execution, $this->_api_context);\n\n $authorization_id = $result->transactions[0]\n ->related_resources[0]\n ->authorization->id;\n\n $authorization = Authorization::get($authorization_id, $this->_api_context);\n\n $payer = Auth::user();\n\n $transaction_data = $transaction->transaction_data;\n\n $transaction_data = array_merge($transaction_data, [\n 'token' => $token,\n 'payerId' => $payer_id,\n 'authorizationId' => $authorization->id,\n ]);\n\n $transaction->transaction_data = $transaction_data;\n $transaction->save();\n } catch (\\Exception $e) {\n $this->sendFailResponse(\n $redirect_url,\n $transaction,\n self::DONATION_TYPE\n );\n }\n\n if ($result->getState() == 'approved') {\n // Make auto accept\n $auto_operation = AutoOperation::where('initiator_id', $payer->id)\n ->where('subject_id', $payee->id)\n ->first();\n if ($auto_operation) {\n if ($auto_operation->status === AutoOperation::STATUS_ALWAYS_DECLINE) {\n $transaction->status = Transaction::STATUS_DECLINED;\n } else {\n return $this->captureAuthorization($transaction);\n }\n } else {\n $transaction->status = Transaction::STATUS_PENDING;\n }\n $transaction->save();\n\n $transaction->payee->notify(new NewDonationNotification($transaction));\n\n $expireJob = dispatch(new ExpirePayment($transaction))\n ->delay(now()->addDays(3));\n\n return redirect($redirect_url . '#payment_status_ok');\n }\n\n return $this->sendFailResponse(\n $redirect_url,\n $transaction,\n self::DONATION_TYPE\n );\n }",
"public function createAdditionalCostAsyncWithHttpInfo($body)\n {\n $returnType = '\\TalonOne\\Client\\Model\\AccountAdditionalCost';\n $request = $this->createAdditionalCostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function createTransaction($api_key, $param, $bankAccountUid)\n {\n $method = 'bankAccounts/' . $bankAccountUid . '/transactions';\n\n return $this->post($api_key, $param, $method);\n }",
"public function generateTransactionId($parameters = []);",
"public function addTransaction($order_id, $transaction_id, $transaction_status, $transaction_data, $date = null)\n {\n global $wpdb;\n\n if (is_null($date)) {\n $date = time();\n }\n\n return $wpdb->insert(\n $wpdb->prefix . 'wpsc_payex_transactions',\n array(\n 'order_id' => $order_id,\n 'transaction_id' => $transaction_id,\n 'transaction_status' => $transaction_status,\n 'transaction_data' => serialize($transaction_data),\n 'date' => date('Y-m-d H:i:s', $date),\n ),\n array(\n '%d',\n '%d',\n '%d',\n '%s',\n '%s',\n )\n );\n }",
"public function setTransactionDetails($details)\n {\n try {\n if(empty($details))\n {\n return ApiResponseHandler::validationError(\"Transaction details are required\");\n }\n\n $validator = new Validator;\n $validation = $validator->make($details, [\n 'order_id' => 'required',\n 'transaction_dt' => 'required',\n 'sub_total_amt' => 'required',\n 'discount_amt' => 'required',\n 'total_amt' => 'required',\n 'redirect_url' => 'required',\n ]);\n // then validate\n $validation->validate();\n //Now check validation:\n if ($validation->fails())\n {\n return ApiResponseHandler::validationError($validation->errors());\n }\n\n $this->orderPayload['order'] = [\n \"order_id\" => $details['order_id'],\n \"currency\" => 'PKR',\n \"sub_total_amount\" => $details['sub_total_amt'],\n \"discount_amount\" => $details['discount_amt'],\n \"total_amount\" => $details['total_amt']\n ];\n $this->orderPayload['plugin_version'] = Constant::PACKAGE_VERISON;\n $this->orderPayload['env_id'] = config('bSecurePayments.integration_type') == \"sandbox\" ? 2 : 1;\n $this->orderPayload['txn_reference'] = $details['transaction_dt'];\n $this->orderPayload['redirect_url'] = $details['redirect_url'];\n $this->orderPayload['merchant_id'] = config('bSecurePayments.merchant_id');\n $this->orderPayload['store_id'] = config('bSecurePayments.store_slug');\n $this->orderPayload['hash'] = Helper::calculateSecureHash($this->orderPayload);\n\n return $this->orderPayload;\n //code...\n } catch (\\Throwable $th) {\n throw $th;\n }\n }",
"function buyAirtime($network, $phone, $amount, $transaction_id){\n $request = \"\";\n $param = [];\n $param[\"username\"] = $GLOBALS['username_mobileNig'];\n $param[\"api_key\"] = $GLOBALS['Mobile_api'];\n $param[\"network\"] = $network;\n $param[\"amount\"] = $amount;\n $param[\"phoneNumber\"] = $phone;\n $param[\"trans_id\"] = $transaction_id;\n\n\n\n //return $network.$phone.$amount.$transaction_id;\n //unique id, you can use time()\n foreach($param as $key=>$val) //traverse through each member of the param array\n {\n $request .= $key . \"=\" . urlencode($val); //we have to urlencode the values\n $request .= '&'; //append the ampersand (&) sign after each paramter/value pair\n }\n $len = strlen($request) - 1;\n $request = substr($request, 0, $len); //remove the final ampersand sign from the request\n\n $url = \"https://mobilenig.com/API/airtime?\". $request . \"&return_url=https://mywebsite.com/order_status.asp\"; //The URL given in the documentation without parameters\n //return $url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"$url$request\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return as a variable\n $response = json_decode(curl_exec($ch));\n curl_close($ch);\n return $response;\n}",
"protected function createTransactionCodeUsingPostRequest($transaction_request)\n {\n // verify the required parameter 'transaction_request' is set\n if ($transaction_request === null || (is_array($transaction_request) && count($transaction_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_request when calling createTransactionCodeUsingPost'\n );\n }\n\n $resourcePath = '/nucleus/v1/transaction_code';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($transaction_request)) {\n $_tempBody = $transaction_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createTransactionRequest()\n\t{\n\t\t$issuer \t\t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->issuer))\n\t\t{\n\t\t\t$issuer \t\t\t\t\t\t=\t' issuer=\"'.$this->xmlEscape($this->issuer).'\"';\n\t\t}\n \n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<redirecttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) \t. '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t\t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t\t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<referrer>' . $this->xmlEscape($this->customer['referrer']) \t\t\t. '</referrer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<user_agent>' . $this->xmlEscape($this->customer['user_agent']) \t\t\t. '</user_agent>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state']) \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t <transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t\t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) \t\t. '</daysactive>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<gateway'.$issuer.'>'.$this->xmlEscape($this->transaction['gateway']) \t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t </transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t <signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</redirecttransaction>';\n \n\t\treturn $request;\n\t}",
"public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createAdditionalCostWithHttpInfo($body)\n {\n $request = $this->createAdditionalCostRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 201:\n if ('\\TalonOne\\Client\\Model\\AccountAdditionalCost' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\TalonOne\\Client\\Model\\AccountAdditionalCost', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\TalonOne\\Client\\Model\\AccountAdditionalCost';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\TalonOne\\Client\\Model\\AccountAdditionalCost',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createTransaction($account_type, $transaction_type, $amount, $date, $user_id, $transaction_status = 1, $transaction_code = \"\")\n {\n try {\n $account_model = new AccountModel();\n\n $create_transaction = $account_model->create([\n 'user_id' => $user_id,\n 'amount' => $amount,\n 'account_type' => $account_type,\n 'transaction_type' => $transaction_type,\n 'transaction_date' => $date,\n 'transaction_status' => $transaction_status,\n 'transaction_code' => $transaction_code,\n ]);\n\n if ($transaction_status == 1) {\n $this->updateUserTotalBalance($user_id, $amount);\n }\n\n return $create_transaction->id;\n } catch (Exception $e) {\n return false;\n }\n }",
"public function createPayment(){\n \t$this->pushTransaction();\n\n \t$this->info['intent'] = $this->intent;\n\n \t$fields_string = http_build_query($this->info);\n\t\tcurl_setopt($this->ch, CURLOPT_URL, \"https://api.sandbox.paypal.com/v1/payments/payment\");\n\t\tcurl_setopt($this->ch,CURLOPT_POSTFIELDS, json_encode($this->info));\n\t\tcurl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_HTTPHEADER, $this->headers);\n\n\t\t$result = curl_exec($this->ch);\n\n\t\tif (curl_errno($this->ch)) {\n\t\t echo 'Error:' . curl_error($this->ch);\n\t\t}\n\n\t\tcurl_close ($this->ch);\n\n\t\treturn $result;\n }",
"public function createTransaction($RealTimestamp,$UnitValue,$Description,$Currency,$TaxValue,$TaxPercentage,$AssocAccount){\n $transaction = new Transaction($RealTimestamp,$UnitValue,$Description,$Currency,$TaxValue,$TaxPercentage,$AssocAccount);\n array_push($this->TransactionLog,$transaction);\n }",
"public static function processTransaction($transactionType, $requiredTransactionState, $overrideParameters = null){\n\t\ttry{\n\t\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\t\tPayU::$merchantId = PayUTestUtil::MERCHANT_ID;\n\t\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\t\t \n\t\t\t$parameters = PayUTestUtil::buildSuccessParametersCreditCard($overrideParameters);\n\t\t\t\n\t\t\tif(TransactionType::AUTHORIZATION == $transactionType){\n\t\t\t\t$response = PayUPayments::doAuthorization($parameters);\n\t\t\t}else if(TransactionType::AUTHORIZATION_AND_CAPTURE == $transactionType){\n\t\t\t\t$response = PayUPayments::doAuthorizationAndCapture($parameters);\n\t\t\t}else{\n\t\t\t\tthrow new RuntimeException(sprintf(\"transaction type %s not supported\",$transactionType));\n\t\t\t}\n\t\t\t\n\t\t\tif($response->code != PayUResponseCode::SUCCESS){\n\t\t\t\tthrow new Exception(sprintf('Request code not was %s was [%s] ', PayUResponseCode::SUCCESS, $response->code));\n\t\t\t}\n\t\t\t\n\t\t\tif($requiredTransactionState != '*' && $response->transactionResponse->state != $requiredTransactionState){\n\t\t\t\tthrow new Exception(sprintf('Transaction state not was [%s] ',$requiredTransactionState));\n\t\t\t}\n\t\t\t\n\t\t\treturn $response;\n\t\t\t\n\t\t}catch (Exception $e){\n\t\t\t$message = $e->getMessage();\n\t\t\tthrow new Exception('Error processing authorization orignal message [' . $message . ']',null,$e);\n\t\t}\n\t}",
"public function addTransactionData($orderid, $transactionid, $paymentid, $transactiondata, $parametersdata);"
] | [
"0.6185958",
"0.57179296",
"0.5394209",
"0.531592",
"0.5068516",
"0.501788",
"0.48916993",
"0.47307378",
"0.469796",
"0.46094772",
"0.45951384",
"0.4488452",
"0.44776726",
"0.44584224",
"0.4425008",
"0.43700984",
"0.43555555",
"0.43544257",
"0.43475562",
"0.43383786",
"0.43351933",
"0.43310434",
"0.4322707",
"0.4295595",
"0.4286981",
"0.42719355",
"0.42466688",
"0.42376885",
"0.42229015",
"0.42166474"
] | 0.6811331 | 0 |
Create request for operation 'apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost' | public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest = null)
{
// verify the required parameter 'technicalTransactionId' is set
if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost'
);
}
$resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}/authorization';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($technicalTransactionId !== null) {
$resourcePath = str_replace(
'{' . 'technicalTransactionId' . '}',
ObjectSerializer::toPathValue($technicalTransactionId),
$resourcePath
);
}
/*
*/
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/problem+json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/problem+json'],
['application/json']
);
}
// for model (json/xml)
if (isset($authorizationRequest)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($authorizationRequest));
} else {
$httpBody = $authorizationRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \http_build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
if (!empty($this->config->getAccessToken())) {
$headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = http_build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiPaymentV3TransactionTechnicalTransactionIdGetRequest($technicalTransactionId)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostWithHttpInfo($technicalTransactionId, $authorizationRequest = null)\n {\n $request = $this->apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdPatchRequest($technicalTransactionId, $transactionUpdate = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdPatch'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transactionUpdate)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transactionUpdate));\n } else {\n $httpBody = $transactionUpdate;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function new_ticket_transaction(){\n if(wp_verify_nonce($_POST['_wpnonce'], 'aact_continue_to_payment')){\n $api_key = DPAPIKEY;\n $orderid = $this->order->get_order_id();\n $order = $this->order->get_order($orderid);\n $_SESSION['cancelkey'] = wp_generate_uuid4();\n $order['complete_url'] = get_permalink(get_page_by_path('ticket-order-complete'));\n $order['cancel_url'] = get_permalink(get_page_by_path('ticket-test'));\n $order['return_url'] = get_permalink(get_page_by_path('confirm-ticket-order'));\n $order['cancel_key'] = $_SESSION['cancelkey'];\n $transaction = $this->transaction->send_transcation_info($order, $api_key);\n\n\n if(!is_wp_error($transaction)){\n $url = add_query_arg( 'ticket_token', $transaction->ticket_token, $transaction->redirect_url);\n wp_redirect( $url );\n exit;\n }\n\n $_SESSION['alert'] = $transaction->get_error_message().' Order Ref: '.$order['details']->orderID;\n $this->transaction->register_transaction();\n }\n }",
"protected function createTransactionCodeUsingPostRequest($transaction_request)\n {\n // verify the required parameter 'transaction_request' is set\n if ($transaction_request === null || (is_array($transaction_request) && count($transaction_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_request when calling createTransactionCodeUsingPost'\n );\n }\n\n $resourcePath = '/nucleus/v1/transaction_code';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($transaction_request)) {\n $_tempBody = $transaction_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createTransactionRequest()\n\t{\n\t\t$issuer \t\t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->issuer))\n\t\t{\n\t\t\t$issuer \t\t\t\t\t\t=\t' issuer=\"'.$this->xmlEscape($this->issuer).'\"';\n\t\t}\n \n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<redirecttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) \t. '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t\t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t\t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<referrer>' . $this->xmlEscape($this->customer['referrer']) \t\t\t. '</referrer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<user_agent>' . $this->xmlEscape($this->customer['user_agent']) \t\t\t. '</user_agent>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state']) \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t <transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t\t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) \t\t. '</daysactive>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<gateway'.$issuer.'>'.$this->xmlEscape($this->transaction['gateway']) \t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t </transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t <signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</redirecttransaction>';\n \n\t\treturn $request;\n\t}",
"function createUpdateTransactionRequest()\n\t{\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<updatetransaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) . '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) . '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) . '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<invoiceid>' . $this->xmlEscape($this->transaction['invoice_id']) . '</invoiceid>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<shipdate>' . $this->xmlEscape($this->transaction['shipdate']) \t. '</shipdate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t</updatetransaction>';\n \n\t\treturn $request;\n\t}",
"private function createAuthorization(Request $request, Transaction $transaction)\n {\n $payment_id = $request->paymentId;\n\n $payer_id = $request->PayerID;\n $token = $request->token;\n\n $payee = $transaction->payee;\n\n $redirect_url = $this->redirect_url . '/' . $payee->username;\n\n /** clear the session payment ID **/\n if (!$payer_id || !$token) {\n return $this->sendFailResponse(\n $redirect_url,\n $transaction,\n self::DONATION_TYPE\n );\n }\n\n $payment = Payment::get($payment_id, $this->_api_context);\n $execution = new PaymentExecution();\n $execution->setPayerId($payer_id);\n\n /**Execute the payment **/\n try {\n $result = $payment->execute($execution, $this->_api_context);\n\n $authorization_id = $result->transactions[0]\n ->related_resources[0]\n ->authorization->id;\n\n $authorization = Authorization::get($authorization_id, $this->_api_context);\n\n $payer = Auth::user();\n\n $transaction_data = $transaction->transaction_data;\n\n $transaction_data = array_merge($transaction_data, [\n 'token' => $token,\n 'payerId' => $payer_id,\n 'authorizationId' => $authorization->id,\n ]);\n\n $transaction->transaction_data = $transaction_data;\n $transaction->save();\n } catch (\\Exception $e) {\n $this->sendFailResponse(\n $redirect_url,\n $transaction,\n self::DONATION_TYPE\n );\n }\n\n if ($result->getState() == 'approved') {\n // Make auto accept\n $auto_operation = AutoOperation::where('initiator_id', $payer->id)\n ->where('subject_id', $payee->id)\n ->first();\n if ($auto_operation) {\n if ($auto_operation->status === AutoOperation::STATUS_ALWAYS_DECLINE) {\n $transaction->status = Transaction::STATUS_DECLINED;\n } else {\n return $this->captureAuthorization($transaction);\n }\n } else {\n $transaction->status = Transaction::STATUS_PENDING;\n }\n $transaction->save();\n\n $transaction->payee->notify(new NewDonationNotification($transaction));\n\n $expireJob = dispatch(new ExpirePayment($transaction))\n ->delay(now()->addDays(3));\n\n return redirect($redirect_url . '#payment_status_ok');\n }\n\n return $this->sendFailResponse(\n $redirect_url,\n $transaction,\n self::DONATION_TYPE\n );\n }",
"public function transactionRequest($type, $amount, $customerCode, $additional_transaction_no, $date = false)\n {\n $request = new \\Illuminate\\Http\\Request();\n\n $request->replace([\n 'type' => $type,\n 'date' => $date,\n 'category' => 'customer',\n 'tmode' => 'cash',\n 'other_transaction_no' => $additional_transaction_no,\n 'amount' => $amount,\n 'description' => '',\n 'receiver_id' => $customerCode\n ]);\n\n if(Transaction::insertion($request)){\n return true;\n }\n\n return false;\n }",
"public function getPaymentCreateRequest() {\n $data = null;\n if ($this->amount && $this->currency) {\n // capture pre-authorized payment\n if ($this->parentTransactionId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"authorization\" => $this->parentTransactionId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using Simplify customer identifier\n else if ($this->cardId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"customer\" => $this->cardId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using card token\n else if ($this->cardToken) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"token\" => $this->cardToken,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using raw card data\n else if ($this->cardNumber) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"card\" => array(\n \"expYear\" => $this->expirationYear,\n \"expMonth\" => $this->expirationMonth, \n \"cvc\" => $this->cvc,\n \"number\" => $this->cardNumber\n ),\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n if ($this->billing) {\n $data[\"card\"][\"name\"] = $this->billing->getName();\n $data[\"card\"][\"addressCity\"] = $this->billing->getCity();\n $data[\"card\"][\"addressLine1\"] = $this->billing->getStreetLine(1);\n $data[\"card\"][\"addressLine2\"] = $this->billing->getStreetLine(2);\n $data[\"card\"][\"addressZip\"] = $this->billing->getPostcode();\n $data[\"card\"][\"addressState\"] = $this->billing->getRegion();\n $data[\"card\"][\"addressCountry\"] = $this->billing->getCountryId();\n }\n } \n }\n return $data;\n }",
"public function generateTransactionId($parameters = []);",
"public function build_payment_request(Transaction $transaction)\n {\n $request = array();\n $request['amount'] = $transaction->amount;\n $request['currency'] = config_item('store_currency_code');\n $request['transactionId'] = $transaction->id;\n $request['description'] = lang('store.order').' #'.$transaction->order->id;\n $request['transactionReference'] = $transaction->reference;\n $request['returnUrl'] = $this->build_return_url($transaction);\n $request['notifyUrl'] = $request['returnUrl'];\n $request['cancelUrl'] = $transaction->order->cancel_url;\n $request['clientIp'] = $this->ee->input->ip_address();\n\n // custom gateways may wish to access the order directly\n $request['order'] = $transaction->order;\n $request['orderId'] = $transaction->order->id;\n\n // these only apply to PayPal\n $request['noShipping'] = 1;\n $request['allowNote'] = 0;\n\n return $request;\n }",
"public function createAuthorizationRequest($authorization_create_dto = null)\n {\n\n $resourcePath = '/authorization/create';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($authorization_create_dto)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($authorization_create_dto));\n } else {\n $httpBody = $authorization_create_dto;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function apiXmlData() {\n\n $cardType = isset($this->jsonData['Payment']['DebitCard']) ? 'DebitCard' : 'CreditCard';\n $product = '1';\n\n if ($cardType == 'CreditCard') {\n if ($this->jsonData['Payment']['Installments'] > 1) $product = '2';\n } else {\n $product = 'A';\n }\n\n $authorize = '3';\n $generateToken = isset($this->jsonData['Payment']['RecurrentPayment']) ? '<gerar-token>true</gerar-token>' : '';\n\n $cardValidDate = explode('/', $this->jsonData['Payment'][$cardType]['ExpirationDate']);\n $cardValidDate = $cardValidDate[1] . $cardValidDate[0];\n\n $currencies = array(\n 'BRL' => 986\n );\n\n $paymentCurrency = $this->jsonData['Payment']['Currency'];\n $currency = isset($currencies[$paymentCurrency]) ? $currencies[$paymentCurrency] : 986;\n\n $this->transactionId = md5(date(\"YmdHisu\"));\n\n /**\n * Unfortunately, this is the simplest way to generate the request body\n */\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n <requisicao-transacao id=\"' . $this->transactionId . '\" versao=\"1.2.1\">\n <dados-ec>\n <numero>' . ($this->sandbox ? $this->sandboxId : $this->merchantId) . '</numero>\n <chave>' . ($this->sandbox ? $this->sandboxKey : $this->merchantKey) . '</chave>\n </dados-ec>\n <dados-portador>\n <numero>' . $this->jsonData['Payment'][$cardType]['CardNumber'] . '</numero>\n <validade>' . $cardValidDate . '</validade>\n <indicador>1</indicador>\n <codigo-seguranca>' . $this->jsonData['Payment'][$cardType]['SecurityCode'] . '</codigo-seguranca>\n <nome-portador>' . $this->jsonData['Payment'][$cardType]['Holder'] . '</nome-portador>\n </dados-portador>\n <dados-pedido>\n <numero>' . $this->jsonData['MerchantOrderId'] . '</numero>\n <valor>' . $this->jsonData['Payment']['Amount'] . '</valor>\n <moeda>' . $currency . '</moeda>\n <data-hora>' . date('Y-m-d') . 'T' . date('h:i:s') . '</data-hora>\n </dados-pedido>\n <forma-pagamento>\n <bandeira>' . strtolower($this->jsonData['Payment'][$cardType]['Brand']) . '</bandeira>\n <produto>' . $product . '</produto>\n <parcelas>' . $this->jsonData['Payment']['Installments'] . '</parcelas>\n </forma-pagamento>\n <url-retorno>null</url-retorno>\n <autorizar>' . $authorize . '</autorizar>\n <capturar>false</capturar>\n '. $generateToken .'\n </requisicao-transacao>';\n\n return $xml;\n }",
"public function createCustomerTransaction($payment)\n { \n /**\n * Set the order in its own object\n */\n $order = $payment->getOrder();\n \n /**\n * Create the transaction\n */\n $soap_env = array(\n self::TRANS_CREATE_TRANS => array(\n 'merchantAuthentication' => $this->_getAuthentication(),\n 'transaction' => array(\n $payment->getAnetTransType() => array(\n 'amount' => $payment->getAmount(),\n 'tax' => array(\n 'amount' => $order->getBaseTaxAmount()\n ),\n 'shipping' => array(\n 'amount' => $order->getBaseShippingAmount()\n ),\n 'customerProfileId' => $payment->getAuthorizenetcimCustomerId(),\n 'customerPaymentProfileId' => $payment->getAuthorizenetcimPaymentId(),\n 'order' => array(\n 'invoiceNumber' => $order->getIncrementId()\n ),\n //'cardCode' => $payment->getCcCid() \n ) \n ),\n 'extraOptions' => 'x_delim_char='. Gorilla_AuthorizenetCim_Model_Gateway::RESPONSE_DELIM_CHAR\n )\n ); \n\n // If this is a prior auth capture, void, or refund add the transaction id\n if ($payment->getAnetTransType() == self::TRANS_PRIOR_AUTH_CAP \n || $payment->getAnetTransType() == self::TRANS_VOID\n || $payment->getAnetTransType() == self::TRANS_REFUND) \n {\n $soap_env[self::TRANS_CREATE_TRANS]['transaction'][$payment->getAnetTransType()]['transId'] = $payment->getTransId();\n }\n\n $response = $this->doCall(self::TRANS_CREATE_TRANS, $soap_env); \n \n if (!$response)\n return false;\n \n $hasErrors = $this->_checkErrors($response);\n if ($response)\n {\n if (!$hasErrors)\n {\n return $response->CreateCustomerProfileTransactionResult->directResponse;\n } else { \n return $response->CreateCustomerProfileTransactionResult->directResponse;\n } \n } else {\n return false;\n }\n }",
"public function make(AuthorizeTransactionContracts $authorizeTransaction)\n {\n $request = new StdClass;\n\n //Request\n $request->RequestId = $authorizeTransaction->getRequestId();\n $request->Version = $authorizeTransaction->getVersion();\n //OrderData\n $request->OrderData = new StdClass;\n $request->OrderData->MerchantId = $authorizeTransaction->getOrderData()->getMerchantId();\n $request->OrderData->OrderId = $authorizeTransaction->getOrderData()->getOrderId();\n $request->OrderData->BraspagOrderId = new SoapVar($authorizeTransaction->getOrderData()->getBraspagOrderId(), SOAP_ENC_OBJECT, 'true');\n //CustomerData\n $request->CustomerData = new StdClass;\n $request->CustomerData->CustomerIdentity = $authorizeTransaction->getCustomerData()->getCustomerIdentity();\n $request->CustomerData->CustomerName = $authorizeTransaction->getCustomerData()->getCustomerName();\n $request->CustomerData->CustomerEmail = $authorizeTransaction->getCustomerData()->getCustomerEmail();\n $request->CustomerData->CustomerAddressData = new SoapVar($authorizeTransaction->getCustomerData()->getCustomerAddressData(), SOAP_ENC_OBJECT, 'true');\n $request->CustomerData->DeliveryAddressData = new SoapVar($authorizeTransaction->getCustomerData()->getCustomerDeliveryAddressData(), SOAP_ENC_OBJECT, 'true');\n $authorizeTransaction->getCustomerData()->getCustomerDeliveryAddressData();\n //PaymentDataCollection\n $Payment = new StdClass;\n $Payment->PaymentMethod = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getPaymentMethod(), XSD_INT, null, null, 'PaymentMethod', BrasPagSoapClient::NAMESPACE);\n $Payment->Amount = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAmount(), XSD_INT, null, null, 'Amount', BrasPagSoapClient::NAMESPACE);\n $Payment->Currency = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getCurrency(), XSD_STRING, null, null, 'Currency', BrasPagSoapClient::NAMESPACE );\n $Payment->Country = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getCountry(), XSD_STRING, null, null, 'Country', BrasPagSoapClient::NAMESPACE );\n\n $PaymentType = $authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getObjPaymentType();\n if ($PaymentType instanceof CreditCardDataRequestContracts){\n $Payment->NumberOfPayments = new SoapVar($PaymentType->getNumberOfPayments(), XSD_STRING, null, null, 'Number', BrasPagSoapClient::NAMESPACE );\n $Payment->PaymentPlan = new SoapVar($PaymentType->getPaymentPlan(), XSD_STRING, null, null, 'PaymentPlan', BrasPagSoapClient::NAMESPACE );\n $Payment->TransactionType = new SoapVar($PaymentType->getTransactionType(), XSD_STRING, null, null, 'TransactionType', BrasPagSoapClient::NAMESPACE );\n $Payment->CardHolder = new SoapVar($PaymentType->getCardHolder(), XSD_STRING, null, null, 'CardHolder', BrasPagSoapClient::NAMESPACE );\n $Payment->CardNumber = new SoapVar($PaymentType->getCardNumber(), XSD_STRING, null, null, 'CardNumber', BrasPagSoapClient::NAMESPACE );\n $Payment->CardSecurityCode = new SoapVar($PaymentType->getCardSecurityCode(), XSD_STRING, null, null, 'CardSecurityCode', BrasPagSoapClient::NAMESPACE );\n $Payment->CardExpirationDate = new SoapVar($PaymentType->getCardExpirationDate(), XSD_STRING, null, null, 'CardSecurityCode', BrasPagSoapClient::NAMESPACE );\n }\n\n $Payment->AdditionalDataCollection = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAdditionalDataCollection(), SOAP_ENC_OBJECT, 'true', NULL, NULL, BrasPagSoapClient::NAMESPACE);\n $Payment->AffiliationData = new SoapVar($authorizeTransaction->getPaymentDataCollection()->getPaymentDataRequest()->getAffiliationData(), SOAP_ENC_OBJECT, 'true', NULL, NULL, BrasPagSoapClient::NAMESPACE);\n $request->PaymentDataCollection = new StdClass;\n $request->PaymentDataCollection->PaymentDataRequest = new SoapVar($Payment, SOAP_ENC_OBJECT, $PaymentType->getPaymentType());\n\n return $request;\n }",
"protected function actionPost() { \n \n $data = $this->data;\n if(\n !$data \n || !isset($data[\"TransactionId\"]) \n || !isset($data[\"UserId\"]) \n || !isset($data[\"CurrencyAmount\"])\n || !isset($data[\"Verifier\"])\n ) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Invalid Parameters\"\n ];\n return $response;\n }\n\n $transactionId = $data[\"TransactionId\"];\n $userId = $data[\"UserId\"];\n $currencyAmount = $data[\"CurrencyAmount\"];\n $verifier = $data[\"Verifier\"];\n\n $transaction = new Transaction($transactionId,$userId,$currencyAmount);\n $isValidTransaction = $transaction->isValid($verifier);\n if(!$isValidTransaction) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Invalid Verifier\"\n ];\n return $response; \n }\n\n $transactionRepository = new TransactionRepository();\n $existedTransaction = $transactionRepository->find($transactionId);\n\n if($existedTransaction) {\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Duplicate transaction with TransactionId:$transactionId\"\n ];\n return $response; \n }\n\n $transactionRepository->save($transaction);\n\n $response = [\n \"Success\" => true\n ];\n \n\n return $response; \n }",
"public function createTransaction(Request $request) {\n // Validation\n $validator = Validator::make($request->all(), [\n 'amount' => 'required|numeric',\n 'name' => 'required',\n 'due' => 'required|date',\n 'categories' => 'nullable|array',\n ]);\n if($validator->fails()) {\n return response()->json(['status' => 'error', 'error' => $validator->errors()], 422);\n }\n\n $transaction = new Transaction;\n $transaction->amount = $request->amount;\n $transaction->name = $request->name;\n $transaction->description = $request->description;\n $transaction->due = $request->due;\n $transaction->getUser()->associate(Auth::user());\n $transaction->save();\n $transaction->categories()->attach($request->categories);\n\n return response()->json(['status' => 'OK', 'transaction' => $transaction], 201);\n }",
"public function createTransaction(Customweb_Payment_Authorization_ITransactionContext $transactionContext, Customweb_Payment_ExternalCheckout_IContext $context) {\n\t\t\n\t\tthrow new Exception(\"Not yet implemented.\");\n\t}",
"public function create()\n {\n $transaction = new Transaction;\n\n $transaction->owner_id = (request()->has('user')) ?\n User::whereSlug(request('user'))->first()->id : 0;\n $transaction->vendor_id = (request()->has('vendor')) ?\n Vendor::whereSlug(request('vendor'))->first()->id : 0;\n\n $preselectedCard = request()->has('card') ?\n Card::findOrFail(request('card'))->id : 0;\n\n $transaction->type = ($preselectedCard) ? 'use' : 0;\n $vendors = Vendor::orderBy('name')->get();\n $owners = User::orderBy('name')->get();\n $cards = $this->getActiveCardList();\n\n return view('transactions.create', compact('transaction', 'vendors', 'owners', 'cards', 'preselectedCard'));\n }",
"public function actionCreate()\n {\n $request = Yii::app()->request;\n\n if (!$request->isPostRequest) {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api', 'Only POST requests allowed for this endpoint.')\n ), 400);\n }\n \n $attributes = (array)$request->getPost('email', array());\n\n $email = new TransactionalEmail();\n $email->attributes = $attributes;\n $email->body = !empty($email->body) ? @base64_decode($email->body) : null;\n $email->plain_text = !empty($email->plain_text) ? @base64_decode($email->plain_text) : null;\n $email->customer_id = (int)Yii::app()->user->getId();\n\n if (!$email->save()) {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => $email->shortErrors->getAll(),\n ), 422);\n }\n\n return $this->renderJson(array(\n 'status' => 'success',\n 'email_uid' => $email->email_uid,\n ), 201);\n }",
"protected function quotesV2PostRequest($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_id' is set\n if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'due_date' is set\n if ($due_date === null || (is_array($due_date) && count($due_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $due_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'quote_date' is set\n if ($quote_date === null || (is_array($quote_date) && count($quote_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $quote_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'created_utc' is set\n if ($created_utc === null || (is_array($created_utc) && count($created_utc) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_utc when calling quotesV2Post'\n );\n }\n // verify the required parameter 'approved_date' is set\n if ($approved_date === null || (is_array($approved_date) && count($approved_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $approved_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null || (is_array($currency_code) && count($currency_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'status' is set\n if ($status === null || (is_array($status) && count($status) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $status when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_rate' is set\n if ($currency_rate === null || (is_array($currency_rate) && count($currency_rate) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_rate when calling quotesV2Post'\n );\n }\n // verify the required parameter 'company_reference' is set\n if ($company_reference === null || (is_array($company_reference) && count($company_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $company_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'eu_third_party' is set\n if ($eu_third_party === null || (is_array($eu_third_party) && count($eu_third_party) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $eu_third_party when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_reference' is set\n if ($customer_reference === null || (is_array($customer_reference) && count($customer_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_customer_name' is set\n if ($invoice_customer_name === null || (is_array($invoice_customer_name) && count($invoice_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address1' is set\n if ($invoice_address1 === null || (is_array($invoice_address1) && count($invoice_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address2' is set\n if ($invoice_address2 === null || (is_array($invoice_address2) && count($invoice_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_postal_code' is set\n if ($invoice_postal_code === null || (is_array($invoice_postal_code) && count($invoice_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_city' is set\n if ($invoice_city === null || (is_array($invoice_city) && count($invoice_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_country_code' is set\n if ($invoice_country_code === null || (is_array($invoice_country_code) && count($invoice_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_customer_name' is set\n if ($delivery_customer_name === null || (is_array($delivery_customer_name) && count($delivery_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address1' is set\n if ($delivery_address1 === null || (is_array($delivery_address1) && count($delivery_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address2' is set\n if ($delivery_address2 === null || (is_array($delivery_address2) && count($delivery_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_postal_code' is set\n if ($delivery_postal_code === null || (is_array($delivery_postal_code) && count($delivery_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_city' is set\n if ($delivery_city === null || (is_array($delivery_city) && count($delivery_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_country_code' is set\n if ($delivery_country_code === null || (is_array($delivery_country_code) && count($delivery_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_name' is set\n if ($delivery_method_name === null || (is_array($delivery_method_name) && count($delivery_method_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_code' is set\n if ($delivery_method_code === null || (is_array($delivery_method_code) && count($delivery_method_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_code' is set\n if ($delivery_term_code === null || (is_array($delivery_term_code) && count($delivery_term_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_name' is set\n if ($delivery_term_name === null || (is_array($delivery_term_name) && count($delivery_term_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_is_private_person' is set\n if ($customer_is_private_person === null || (is_array($customer_is_private_person) && count($customer_is_private_person) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_is_private_person when calling quotesV2Post'\n );\n }\n // verify the required parameter 'includes_vat' is set\n if ($includes_vat === null || (is_array($includes_vat) && count($includes_vat) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $includes_vat when calling quotesV2Post'\n );\n }\n // verify the required parameter 'is_domestic' is set\n if ($is_domestic === null || (is_array($is_domestic) && count($is_domestic) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $is_domestic when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_type' is set\n if ($rot_reduced_invoicing_type === null || (is_array($rot_reduced_invoicing_type) && count($rot_reduced_invoicing_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_property_type' is set\n if ($rot_property_type === null || (is_array($rot_property_type) && count($rot_property_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_property_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_property_name' is set\n if ($rot_reduced_invoicing_property_name === null || (is_array($rot_reduced_invoicing_property_name) && count($rot_reduced_invoicing_property_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_property_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_org_number' is set\n if ($rot_reduced_invoicing_org_number === null || (is_array($rot_reduced_invoicing_org_number) && count($rot_reduced_invoicing_org_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_org_number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_amount' is set\n if ($rot_reduced_invoicing_amount === null || (is_array($rot_reduced_invoicing_amount) && count($rot_reduced_invoicing_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_automatic_distribution' is set\n if ($rot_reduced_invoicing_automatic_distribution === null || (is_array($rot_reduced_invoicing_automatic_distribution) && count($rot_reduced_invoicing_automatic_distribution) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_automatic_distribution when calling quotesV2Post'\n );\n }\n // verify the required parameter 'persons' is set\n if ($persons === null || (is_array($persons) && count($persons) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $persons when calling quotesV2Post'\n );\n }\n // verify the required parameter 'terms_of_payment' is set\n if ($terms_of_payment === null || (is_array($terms_of_payment) && count($terms_of_payment) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $terms_of_payment when calling quotesV2Post'\n );\n }\n // verify the required parameter 'sales_document_attachments' is set\n if ($sales_document_attachments === null || (is_array($sales_document_attachments) && count($sales_document_attachments) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sales_document_attachments when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rows' is set\n if ($rows === null || (is_array($rows) && count($rows) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rows when calling quotesV2Post'\n );\n }\n // verify the required parameter 'total_amount' is set\n if ($total_amount === null || (is_array($total_amount) && count($total_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'vat_amount' is set\n if ($vat_amount === null || (is_array($vat_amount) && count($vat_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vat_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'roundings_amount' is set\n if ($roundings_amount === null || (is_array($roundings_amount) && count($roundings_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $roundings_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'uses_green_technology' is set\n if ($uses_green_technology === null || (is_array($uses_green_technology) && count($uses_green_technology) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $uses_green_technology when calling quotesV2Post'\n );\n }\n\n $resourcePath = '/v2/quotes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($id !== null) {\n $formParams['Id'] = ObjectSerializer::toFormValue($id);\n }\n // form params\n if ($number !== null) {\n $formParams['Number'] = ObjectSerializer::toFormValue($number);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['CustomerId'] = ObjectSerializer::toFormValue($customer_id);\n }\n // form params\n if ($due_date !== null) {\n $formParams['DueDate'] = ObjectSerializer::toFormValue($due_date);\n }\n // form params\n if ($quote_date !== null) {\n $formParams['QuoteDate'] = ObjectSerializer::toFormValue($quote_date);\n }\n // form params\n if ($created_utc !== null) {\n $formParams['CreatedUtc'] = ObjectSerializer::toFormValue($created_utc);\n }\n // form params\n if ($approved_date !== null) {\n $formParams['ApprovedDate'] = ObjectSerializer::toFormValue($approved_date);\n }\n // form params\n if ($currency_code !== null) {\n $formParams['CurrencyCode'] = ObjectSerializer::toFormValue($currency_code);\n }\n // form params\n if ($status !== null) {\n $formParams['Status'] = ObjectSerializer::toFormValue($status);\n }\n // form params\n if ($currency_rate !== null) {\n $formParams['CurrencyRate'] = ObjectSerializer::toFormValue($currency_rate);\n }\n // form params\n if ($company_reference !== null) {\n $formParams['CompanyReference'] = ObjectSerializer::toFormValue($company_reference);\n }\n // form params\n if ($eu_third_party !== null) {\n $formParams['EuThirdParty'] = ObjectSerializer::toFormValue($eu_third_party);\n }\n // form params\n if ($customer_reference !== null) {\n $formParams['CustomerReference'] = ObjectSerializer::toFormValue($customer_reference);\n }\n // form params\n if ($invoice_customer_name !== null) {\n $formParams['InvoiceCustomerName'] = ObjectSerializer::toFormValue($invoice_customer_name);\n }\n // form params\n if ($invoice_address1 !== null) {\n $formParams['InvoiceAddress1'] = ObjectSerializer::toFormValue($invoice_address1);\n }\n // form params\n if ($invoice_address2 !== null) {\n $formParams['InvoiceAddress2'] = ObjectSerializer::toFormValue($invoice_address2);\n }\n // form params\n if ($invoice_postal_code !== null) {\n $formParams['InvoicePostalCode'] = ObjectSerializer::toFormValue($invoice_postal_code);\n }\n // form params\n if ($invoice_city !== null) {\n $formParams['InvoiceCity'] = ObjectSerializer::toFormValue($invoice_city);\n }\n // form params\n if ($invoice_country_code !== null) {\n $formParams['InvoiceCountryCode'] = ObjectSerializer::toFormValue($invoice_country_code);\n }\n // form params\n if ($delivery_customer_name !== null) {\n $formParams['DeliveryCustomerName'] = ObjectSerializer::toFormValue($delivery_customer_name);\n }\n // form params\n if ($delivery_address1 !== null) {\n $formParams['DeliveryAddress1'] = ObjectSerializer::toFormValue($delivery_address1);\n }\n // form params\n if ($delivery_address2 !== null) {\n $formParams['DeliveryAddress2'] = ObjectSerializer::toFormValue($delivery_address2);\n }\n // form params\n if ($delivery_postal_code !== null) {\n $formParams['DeliveryPostalCode'] = ObjectSerializer::toFormValue($delivery_postal_code);\n }\n // form params\n if ($delivery_city !== null) {\n $formParams['DeliveryCity'] = ObjectSerializer::toFormValue($delivery_city);\n }\n // form params\n if ($delivery_country_code !== null) {\n $formParams['DeliveryCountryCode'] = ObjectSerializer::toFormValue($delivery_country_code);\n }\n // form params\n if ($delivery_method_name !== null) {\n $formParams['DeliveryMethodName'] = ObjectSerializer::toFormValue($delivery_method_name);\n }\n // form params\n if ($delivery_method_code !== null) {\n $formParams['DeliveryMethodCode'] = ObjectSerializer::toFormValue($delivery_method_code);\n }\n // form params\n if ($delivery_term_code !== null) {\n $formParams['DeliveryTermCode'] = ObjectSerializer::toFormValue($delivery_term_code);\n }\n // form params\n if ($delivery_term_name !== null) {\n $formParams['DeliveryTermName'] = ObjectSerializer::toFormValue($delivery_term_name);\n }\n // form params\n if ($customer_is_private_person !== null) {\n $formParams['CustomerIsPrivatePerson'] = ObjectSerializer::toFormValue($customer_is_private_person);\n }\n // form params\n if ($includes_vat !== null) {\n $formParams['IncludesVat'] = ObjectSerializer::toFormValue($includes_vat);\n }\n // form params\n if ($is_domestic !== null) {\n $formParams['IsDomestic'] = ObjectSerializer::toFormValue($is_domestic);\n }\n // form params\n if ($rot_reduced_invoicing_type !== null) {\n $formParams['RotReducedInvoicingType'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_type);\n }\n // form params\n if ($rot_property_type !== null) {\n $formParams['RotPropertyType'] = ObjectSerializer::toFormValue($rot_property_type);\n }\n // form params\n if ($rot_reduced_invoicing_property_name !== null) {\n $formParams['RotReducedInvoicingPropertyName'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_property_name);\n }\n // form params\n if ($rot_reduced_invoicing_org_number !== null) {\n $formParams['RotReducedInvoicingOrgNumber'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_org_number);\n }\n // form params\n if ($rot_reduced_invoicing_amount !== null) {\n $formParams['RotReducedInvoicingAmount'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_amount);\n }\n // form params\n if ($rot_reduced_invoicing_automatic_distribution !== null) {\n $formParams['RotReducedInvoicingAutomaticDistribution'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_automatic_distribution);\n }\n // form params\n if ($persons !== null) {\n $formParams['Persons'] = ObjectSerializer::toFormValue($persons);\n }\n // form params\n if ($terms_of_payment !== null) {\n $formParams['TermsOfPayment'] = ObjectSerializer::toFormValue($terms_of_payment);\n }\n // form params\n if ($sales_document_attachments !== null) {\n $formParams['SalesDocumentAttachments'] = ObjectSerializer::toFormValue($sales_document_attachments);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // form params\n if ($total_amount !== null) {\n $formParams['TotalAmount'] = ObjectSerializer::toFormValue($total_amount);\n }\n // form params\n if ($vat_amount !== null) {\n $formParams['VatAmount'] = ObjectSerializer::toFormValue($vat_amount);\n }\n // form params\n if ($roundings_amount !== null) {\n $formParams['RoundingsAmount'] = ObjectSerializer::toFormValue($roundings_amount);\n }\n // form params\n if ($uses_green_technology !== null) {\n $formParams['UsesGreenTechnology'] = ObjectSerializer::toFormValue($uses_green_technology);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createTransaction($api_key, $param, $bankAccountUid)\n {\n $method = 'bankAccounts/' . $bankAccountUid . '/transactions';\n\n return $this->post($api_key, $param, $method);\n }",
"public function createPayment(){\n \t$this->pushTransaction();\n\n \t$this->info['intent'] = $this->intent;\n\n \t$fields_string = http_build_query($this->info);\n\t\tcurl_setopt($this->ch, CURLOPT_URL, \"https://api.sandbox.paypal.com/v1/payments/payment\");\n\t\tcurl_setopt($this->ch,CURLOPT_POSTFIELDS, json_encode($this->info));\n\t\tcurl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_HTTPHEADER, $this->headers);\n\n\t\t$result = curl_exec($this->ch);\n\n\t\tif (curl_errno($this->ch)) {\n\t\t echo 'Error:' . curl_error($this->ch);\n\t\t}\n\n\t\tcurl_close ($this->ch);\n\n\t\treturn $result;\n }",
"function startTransaction()\n\t{\n\t\t$this->checkSettings();\n\t\t$this->setIp();\n\t\t$this->createSignature();\n\t\t$this->SetRef();\n \n\t\t$this->request_xml \t\t\t\t= \t$this->createTransactionRequest();\n\n\t\t$this->api_url \t\t\t\t= \t$this->getApiUrl();\n\t\t$this->reply_xml \t\t\t\t= \t$this->xmlPost($this->api_url, $this->request_xml);\n \n\t\tif (!$this->reply_xml)\n\t\t\treturn false;\n \n\t\t$rootNode \t\t\t\t\t\t= \t$this->parseXmlResponse($this->reply_xml);\n\t\tif (!$rootNode)\n\t\t\treturn false;\n \n\t\t$this->payment_url \t\t\t\t= \t$this->xmlUnescape($rootNode['transaction']['payment_url']['VALUE']);\n\t\treturn $this->payment_url;\n\t}",
"public function submit($merchant_id, $format = 'json')\n {\n set_time_limit(0);\n \n $format = strtolower($format);\n\n // Format to view mapping\n $formats = [\n 'xml' => 'Xml',\n 'json' => 'Json',\n ];\n\n // Error on unknown type\n if (!isset($formats[$format])) {\n throw new NotFoundException(__('Unknown format.'));\n }\n $this->viewBuilder()->className($formats[ $format ]);\n\n // Get user information\n $user = $this->Auth->user();\n \n\n $startDate = $this->request->data('start');\n $endDate = $this->request->data('end');\n $startDateNtx = $this->request->data('start_ntx');\n $endDateNtx = $this->request->data('end_ntx');\n $ntx = $this->request->data('ntx');\n \n if ($startDate == 'null') {\n $startDate = null;\n }\n if ($endDate == 'null') {\n $endDate = null;\n }\n $req_txid = isset($this->request->data['txid']) ? $this->request->data('txid') : null;\n if (is_string($req_txid)) {\n $req_txid =empty($req_txid)? []: explode(',', trim($req_txid));\n }\n\n // Step 1 - Create single token. if any exist token found, stop here.\n $tokenLockPath = ROOT.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'SettlementBatch.lock';\n \n // Lock the state for preventing other process\n $tokenFp = tryFileLock($tokenLockPath);\n if (!$tokenFp) {\n $this->dataResponse(['status'=>'error','type'=>'CannotCreateToken']);\n return;\n }\n $this->log('Settlement token locked.', 'debug');\n \n\n\n $particulars = $this->request->data('particulars');\n $reportDate = $this->request->data('report_date');\n\n $params = compact('particulars', 'ntx');\n $params['start_date'] = $startDate;\n $params['end_date'] = $endDate;\n $params['start_date_ntx'] = $startDateNtx;\n $params['end_date_ntx'] = $endDateNtx;\n $params['report_date'] = $reportDate;\n $params['txid'] = $req_txid;\n\n $masterMerchant = $this->merchantService->getMasterMerchant($merchant_id, true);\n \n $batchData = $this->service->batchBuilder->create($masterMerchant, $params);\n $batchData->id = Text::uuid(); // Assign the batch id for the creation\n \n \n try {\n // Requesting client side to submit the total amount for comparing server-side result\n $requestedTotalSettlementAmount = assume($particulars, 'totalSettlementAmount', null);\n if (!isset($requestedTotalSettlementAmount['converted_amount'])) {\n throw new ProcessException('InvalidTotalSettlementAmount', 'submitBatch', 'Total settlement amount need to be submitted.');\n }\n\n $requestedTotalSettlementAmount['converted_amount'] = round(floatval($requestedTotalSettlementAmount['converted_amount']), 2);\n \n // Warning if total settlement amount is equal / lower than zero in server-side result\n $totalSettlementAmount = $batchData->getParticularData('totalSettlementAmount', $batchData->merchantCurrency);\n $totalSettlementAmount['converted_amount'] = round(floatval($totalSettlementAmount['converted_amount']), 2);\n\n if (round($totalSettlementAmount['converted_amount'], 2) != round($requestedTotalSettlementAmount['converted_amount'], 2)) {\n $response = [\n 'server'=>$totalSettlementAmount['converted_amount'],\n 'requested'=>$requestedTotalSettlementAmount['converted_amount'],\n 'particulars'=>$batchData->particulars,\n ];\n throw new ProcessException('UnmatchedTotalSettlementAmount', 'submitBatch', 'Submitted total settlement amount does not match server-side result.', $response);\n }\n \n\n $submittingChecksum = $batchData->getChecksum();\n \n $this->service->batchProcessor->submit($batchData, $user);\n \n $this->Flash->success('Settlement batch created.');\n $response = [\n 'status'=>'done',\n 'msg'=>'Batch created.',\n 'id'=>$batchData->id,\n 'url'=>Router::url(['action'=>'view', $batchData->id]),\n ];\n\n // Remove cached data after submit a batch.\n $this->removeBatchCache($submittingChecksum);\n\n $this->log($response, 'debug');\n\n // Update merchant unsettled records after batch created.\n $this->service->updateMerchantUnsettled();\n\n // Clear cache if checksum provided.\n $checksum = $this->request->data('checksum');\n if (!empty($checksum)) {\n $cacheKey = 'settlement_batch_cached_'.$checksum;\n Cache::delete($cacheKey);\n }\n } catch (ProcessException $exp) {\n $response = [\n 'status'=>'error',\n 'type'=>$exp->type,\n 'msg'=>$exp->message,\n ];\n if ($exp->data != null) {\n $response['data'] = $exp->data;\n }\n $this->log($response, 'error');\n } catch (\\Exception $exp) {\n $response = [\n 'status'=>'error',\n 'type'=>'Exception',\n 'exception'=>get_class($exp),\n 'msg'=>$exp->getMessage(),\n ];\n $this->log($response, 'error');\n }\n\n // Unlock path\n tryFileUnlock($tokenFp);\n @unlink($tokenLockPath);\n $this->log('Settlement token unlocked.', 'debug');\n\n return $this->dataResponse($response);\n }",
"protected function rechargeTransactionsByTransactionIdGetRequest($transaction_id)\n {\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_id when calling rechargeTransactionsByTransactionIdGet'\n );\n }\n\n $resourcePath = '/recharge/transactions/{transaction_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transaction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_id' . '}',\n ObjectSerializer::toPathValue($transaction_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function curl_transaction( $data ) {\n\t\t$email = $this->getData_Unstaged_Escaped( 'email' );\n\t\t$this->logger->info( \"Making API call for donor $email\" );\n\n\t\t$filterResult = $this->runSessionVelocityFilter();\n\t\tif ( $filterResult === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/** @var HostedCheckoutProvider $provider */\n\t\t$provider = $this->getPaymentProvider();\n\t\tswitch ( $this->getCurrentTransaction() ) {\n\t\t\tcase 'createHostedCheckout':\n\t\t\t\t$result = $provider->createHostedPayment( $data );\n\t\t\t\tbreak;\n\t\t\tcase 'getHostedPaymentStatus':\n\t\t\t\t$result = $provider->getHostedPaymentStatus(\n\t\t\t\t\t$data['hostedCheckoutId']\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'approvePayment':\n\t\t\t\t$id = $data['id'];\n\t\t\t\tunset( $data['id'] );\n\t\t\t\t$result = $provider->approvePayment( $id, $data );\n\t\t\t\tbreak;\n\t\t\tcase 'cancelPayment':\n\t\t\t\t$id = $data['id'];\n\t\t\t\tunset( $data['id'] );\n\t\t\t\t$result = $provider->cancelPayment( $id );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$this->transaction_response->setRawResponse( json_encode( $result ) );\n\t\treturn true;\n\t}"
] | [
"0.7037719",
"0.6454771",
"0.60927075",
"0.594961",
"0.58796567",
"0.5528327",
"0.5427876",
"0.5405716",
"0.53869057",
"0.52717125",
"0.5268578",
"0.5206691",
"0.5154948",
"0.5140264",
"0.51033217",
"0.50582093",
"0.5049402",
"0.50113744",
"0.50044006",
"0.5004356",
"0.49797636",
"0.49338496",
"0.49322227",
"0.4904081",
"0.4897119",
"0.48845437",
"0.48662704",
"0.4864275",
"0.4841072",
"0.4840201"
] | 0.71452767 | 0 |
Create request for operation 'apiPaymentV3TransactionTechnicalTransactionIdGet' | public function apiPaymentV3TransactionTechnicalTransactionIdGetRequest($technicalTransactionId)
{
// verify the required parameter 'technicalTransactionId' is set
if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdGet'
);
}
$resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($technicalTransactionId !== null) {
$resourcePath = str_replace(
'{' . 'technicalTransactionId' . '}',
ObjectSerializer::toPathValue($technicalTransactionId),
$resourcePath
);
}
/*
*/
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/hal+json', 'application/problem+json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/hal+json', 'application/problem+json'],
[]
);
}
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \http_build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
if (!empty($this->config->getAccessToken())) {
$headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = http_build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdPatchRequest($technicalTransactionId, $transactionUpdate = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdPatch'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transactionUpdate)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transactionUpdate));\n } else {\n $httpBody = $transactionUpdate;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}/authorization';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($authorizationRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($authorizationRequest));\n } else {\n $httpBody = $authorizationRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract function getTransactionId();",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getTransactionId();",
"protected function rechargeTransactionsByTransactionIdGetRequest($transaction_id)\n {\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_id when calling rechargeTransactionsByTransactionIdGet'\n );\n }\n\n $resourcePath = '/recharge/transactions/{transaction_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transaction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_id' . '}',\n ObjectSerializer::toPathValue($transaction_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiMerchantV3TransactionGetRequest($firstname = null, $lastname = null, $orderId = null, $pageSize = 100, $page = null, $status = null, $minOrderValue = null, $maxOrderValue = null, $tId = null)\n {\n if ($tId !== null && count($tId) > 1000) {\n throw new \\InvalidArgumentException('invalid value for \"$tId\" when calling TransactionApi.apiMerchantV3TransactionGet, number of items must be less than or equal to 1000.');\n }\n\n\n $resourcePath = '/api/merchant/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($firstname !== null) {\n if('form' === 'form' && is_array($firstname)) {\n foreach($firstname as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['firstname'] = $firstname;\n }\n }\n // query params\n if ($lastname !== null) {\n if('form' === 'form' && is_array($lastname)) {\n foreach($lastname as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['lastname'] = $lastname;\n }\n }\n // query params\n if ($orderId !== null) {\n if('form' === 'form' && is_array($orderId)) {\n foreach($orderId as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['orderId'] = $orderId;\n }\n }\n // query params\n if ($pageSize !== null) {\n if('form' === 'form' && is_array($pageSize)) {\n foreach($pageSize as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['pageSize'] = $pageSize;\n }\n }\n // query params\n if ($page !== null) {\n if('form' === 'form' && is_array($page)) {\n foreach($page as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['page'] = $page;\n }\n }\n // query params\n if ($status !== null) {\n if('form' === 'form' && is_array($status)) {\n foreach($status as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['status'] = $status;\n }\n }\n // query params\n if ($minOrderValue !== null) {\n if('form' === 'form' && is_array($minOrderValue)) {\n foreach($minOrderValue as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['minOrderValue'] = $minOrderValue;\n }\n }\n // query params\n if ($maxOrderValue !== null) {\n if('form' === 'form' && is_array($maxOrderValue)) {\n foreach($maxOrderValue as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['maxOrderValue'] = $maxOrderValue;\n }\n }\n // query params\n if ($tId !== null) {\n if('form' === 'form' && is_array($tId)) {\n foreach($tId as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tId'] = $tId;\n }\n }\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function actionGetTransaction($id)\n\t{\n\t\tif ($id === '-- Select a transaction --') {\n\t\t\treturn;\n\t\t}\n\t\t$transaction_model = Yii::$app->modelFinder->findTransactionModel($id); // @TODO: change to dynamic transaction id\n\t\t$customer_model = Yii::$app->modelFinder->findCustomerModel($transaction_model->customer_code);\n\n\t\t// retrieve all transaction details\n\t\t$transaction_details_model = Yii::$app->modelFinder->getTransactionDetailList(null, null, null,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ['transaction_id' => $transaction_model->id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'status' \t\t=> [Yii::$app->params['STATUS_PROCESS'], Yii::$app->params['STATUS_CLOSED'], Yii::$app->params['STATUS_REJECTED']]], false, null);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t$transaction_model_properties = [\n\t\t\t\t\t\t\t\t\t\t 'app\\models\\TrxTransactions' => [\n\t\t\t\t\t\t\t\t\t\t 'id',\n\t\t\t\t\t\t\t\t\t\t 'customer_code',\n\t\t\t\t\t\t\t\t\t\t 'sap_no',\n\t\t\t\t\t\t\t\t\t\t 'created_date',\n\t\t\t\t\t\t\t\t\t\t 'plant_location',\n\t\t\t\t\t\t\t\t\t\t 'storage_location',\n\t\t\t\t\t\t\t\t\t\t 'truck_van',\n\t\t\t\t\t\t\t\t\t\t 'remarks',\n\t\t\t\t\t\t\t\t\t\t ],\n\t\t\t\t\t\t\t\t\t\t];\n\n\t\t$customer_model_properties = \t[\n\t\t\t\t\t\t\t\t\t\t 'app\\models\\MstCustomer' => [\n\t\t\t\t\t\t\t\t\t\t 'customer_name' => 'name',\n\t\t\t\t\t\t\t\t\t\t ],\n\t\t\t\t\t\t\t\t\t\t];\n\t\t\n\t\t// get pallet count\n\t\t$pallet_count = Yii::$app->modelFinder->getTransactionDetailList(null, 'id', null, ['transaction_id' => $transaction_model->id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t'status' \t\t => [Yii::$app->params['STATUS_PROCESS'], Yii::$app->params['STATUS_CLOSED'], Yii::$app->params['STATUS_REJECTED']]], false, 'pallet_no');\n\t\t\n\t\t// get total weight from trx_transaction_details\n\t\t$total_weight = array_sum(ArrayHelper::map($transaction_details_model, 'id', 'total_weight'));\n\n\t\t$transaction_header = ArrayHelper::toArray($transaction_model, $transaction_model_properties);\n\t\t$customer_name = ArrayHelper::toArray($customer_model, $customer_model_properties);\n\t\t\n\t\t$transaction_header = ArrayHelper::merge($transaction_header, $customer_name);\n\t\t\n\t\t$transaction_header['pallet_count'] = $pallet_count;\n\t\t$transaction_header['total_weight'] = $total_weight;\n\t\t\n\t\t$transaction_header['created_date_formatted'] = date('m/d/Y', strtotime($transaction_header['created_date']));\n\t\t\n\t\techo json_encode($transaction_header);\n\t}",
"function createUpdateTransactionRequest()\n\t{\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<updatetransaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) . '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) . '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) . '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<invoiceid>' . $this->xmlEscape($this->transaction['invoice_id']) . '</invoiceid>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<shipdate>' . $this->xmlEscape($this->transaction['shipdate']) \t. '</shipdate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t</updatetransaction>';\n \n\t\treturn $request;\n\t}",
"public function generateTransactionId($parameters = []);",
"function query($transaction_id){\n $request = \"\";\n $param = [];\n $param[\"username\"] = $GLOBALS['username_mobileNig'];\n $param[\"api_key\"] = $GLOBALS['Mobile_api'];\n $param[\"trans_id\"] = $transaction_id;\n\n //return $network.$phone.$amount.$transaction_id;\n //unique id, you can use time()\n foreach($param as $key=>$val) //traverse through each member of the param array\n {\n $request .= $key . \"=\" . urlencode($val); //we have to urlencode the values\n $request .= '&'; //append the ampersand (&) sign after each paramter/value pair\n }\n $len = strlen($request) - 1;\n $request = substr($request, 0, $len); //remove the final ampersand sign from the request\n\n $url = \"https://mobilenig.com/API/airtime_premium_query?\". $request . \"&return_url=https://mywebsite.com/order_status.asp\"; //The URL given in the documentation without parameters\n //return $url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"$url$request\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return as a variable\n $response = json_decode(curl_exec($ch));\n curl_close($ch);\n return $response;\n}",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostWithHttpInfo($technicalTransactionId, $authorizationRequest = null)\n {\n $request = $this->apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getByTransactionId($transaction_id);",
"public function getTransactionId(): string;",
"protected function getTransactionCodeUsingGetRequest($transaction_code_id)\n {\n // verify the required parameter 'transaction_code_id' is set\n if ($transaction_code_id === null || (is_array($transaction_code_id) && count($transaction_code_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_code_id when calling getTransactionCodeUsingGet'\n );\n }\n\n $resourcePath = '/nucleus/v1/transaction_code/{transaction_code_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transaction_code_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_code_id' . '}',\n ObjectSerializer::toPathValue($transaction_code_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createTransactionRequest()\n\t{\n\t\t$issuer \t\t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->issuer))\n\t\t{\n\t\t\t$issuer \t\t\t\t\t\t=\t' issuer=\"'.$this->xmlEscape($this->issuer).'\"';\n\t\t}\n \n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<redirecttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) \t. '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t\t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t\t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<referrer>' . $this->xmlEscape($this->customer['referrer']) \t\t\t. '</referrer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<user_agent>' . $this->xmlEscape($this->customer['user_agent']) \t\t\t. '</user_agent>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state']) \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t <transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t\t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) \t\t. '</daysactive>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<gateway'.$issuer.'>'.$this->xmlEscape($this->transaction['gateway']) \t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t </transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t <signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</redirecttransaction>';\n \n\t\treturn $request;\n\t}",
"public function beanstream_get_transaction_details($params)\n\t{\n\t\t$this->_api_method = array('trnType' => 'Q');\n\t\t$this->_build_request($params);\t\t\n\t\treturn $this->_handle_query();\t\t\n\t}",
"function get_xendit_api($last_transaction) {\r\n\t\t\r\n\t\t$data = array(\r\n\t\t\t'ApiKey' \t=> 'ca3affbf9c1cb3c1b7e251de31654f3037911b4a',\r\n\t\t\t'LastDate' => $last_transaction\r\n\t\t\t);\r\n\t\t$url = \"http://sewa-beli.net/dppmu_api/Xendit_api/getXendit\";\r\n\t\t$ch = curl_init($url); \r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \r\n\t\t$output = curl_exec($ch); \r\n\t\tcurl_close($ch);\r\n\t\t$transaction = json_decode($output, TRUE); \r\n\t\treturn $transaction;\r\n\t}",
"public function setTransactionId() : string;",
"public function build_payment_request(Transaction $transaction)\n {\n $request = array();\n $request['amount'] = $transaction->amount;\n $request['currency'] = config_item('store_currency_code');\n $request['transactionId'] = $transaction->id;\n $request['description'] = lang('store.order').' #'.$transaction->order->id;\n $request['transactionReference'] = $transaction->reference;\n $request['returnUrl'] = $this->build_return_url($transaction);\n $request['notifyUrl'] = $request['returnUrl'];\n $request['cancelUrl'] = $transaction->order->cancel_url;\n $request['clientIp'] = $this->ee->input->ip_address();\n\n // custom gateways may wish to access the order directly\n $request['order'] = $transaction->order;\n $request['orderId'] = $transaction->order->id;\n\n // these only apply to PayPal\n $request['noShipping'] = 1;\n $request['allowNote'] = 0;\n\n return $request;\n }",
"function quickpay_request($apikey = '', $endpoint = '', $params = array(), $method = 'GET')\n{\n $baseUrl = 'https://api.quickpay.net/';\n $url = $baseUrl . $endpoint;\n\n $headers = array(\n 'Accept-Version: v10',\n 'Accept: application/json',\n 'Authorization: Basic ' . base64_encode(':' . $apikey),\n );\n\n $options = array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => true,\n CURLOPT_HTTPAUTH => CURLAUTH_BASIC,\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_CUSTOMREQUEST => $method,\n CURLOPT_URL => $url,\n CURLOPT_POSTFIELDS => $params,\n );\n\n $ch = curl_init();\n\n curl_setopt_array($ch, $options);\n\n $response = curl_exec($ch);\n\n //Check for errors\n if (curl_errno($ch) !== 0) {\n throw new Exception(curl_error($ch), curl_errno($ch));\n }\n\n curl_close ($ch);\n\n return json_decode($response);\n}",
"public function getTx($txid)\n {\n }",
"public function testGetOrderDetailByTransactionIdValid(){\n \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n\n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t \n \t$parameters = array(\n \t\t\tPayUParameters::TRANSACTION_ID => $authorizationResponse->transactionResponse->transactionId,\n \t);\n \t \n \t$response = PayUReports::getTransactionResponse($parameters);\n }",
"function it_exchange_paypal_pro_addon_get_transaction_id( $paypal_pro_id ) {\n $args = array(\n 'meta_key' => '_it_exchange_transaction_method_id',\n 'meta_value' => $paypal_pro_id,\n 'numberposts' => 1, //we should only have one, so limit to 1\n );\n return it_exchange_get_transactions( $args );\n}",
"function bcashGetTransaction($hash): BchTx\n{\n return ApiRequest::get(Constants::TATUM_API_URL . \"/v3/bcash/transaction/{$hash}\", [], ['x-api-key' => getenv('TATUM_API_KEY')])->data;\n}",
"public function get_tx_ids()\n {\n\n $transaction_id = UserMembership::all()->pluck('transaction_id')->toArray();\n\n foreach ($transaction_id as $tx_id){\n // El número máximo de IDs de transacciones a devolver de 1 a 100. (por defecto: 25)\n $txid = implode('|',$transaction_id);\n }\n\n // Create a new API wrapper instance\n $cps_api = new CoinpaymentsAPI($this->private_key, $this->public_key, $this->format);\n\n // Desde qué transacción # comenzar (para la iteración/paginación.) (por defecto: 0, comienza con sus transacciones más recientes.)\n $full = 1;\n\n // Make call to API to create the transaction\n try {\n $transaction_response = $cps_api->SearchAllTransaction($txid, $full);\n } catch (Exception $e) {\n echo 'Error: ' . $e->getMessage();\n exit();\n }\n\n if ($transaction_response['error'] == 'ok') {\n // Success!\n $i=0;\n $j=0;\n foreach ($transaction_response['result'] as $key=>$id_transaction) {\n\n $update_status = UserMembership::where('transaction_id', $key)->first();\n if ($id_transaction['status'] == 100){\n $update_status->status = 'A';\n\n if ($update_status->save()) {\n $i++;\n }\n\n }else {\n $j++;\n }\n\n $status_payment = new MembershipPaymentStatus();\n $status_payment->id_user_membership = $update_status->id;\n $status_payment->id_transaction = $key;\n $status_payment->status = $id_transaction['status'];\n $status_payment->status_description = $id_transaction['status_text'];\n $status_payment->type_coin = $id_transaction['coin'];\n $status_payment->payment_received = $id_transaction['amount'];\n $status_payment->save();\n }\n\n echo 'Pagos confirmados : '.$i.' Pagos por confirmar : '.$j;\n } else {\n // Something went wrong!\n echo 'Error: ' . $transaction_response['error'];\n\n return back();\n }\n }",
"public function getTransactionId()\n {\n return $this->getParameter('transactionId');\n }",
"public function testGetOrderDetailByTransactionIdInvalid(){\n \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL); \n \n \t$parameters = array(PayUParameters::TRANSACTION_ID => 'InvalidTransactionId');\n \n \t$response = PayUReports::getOrderDetailByReferenceCode($parameters);\n \n }",
"function buyAirtime($network, $phone, $amount, $transaction_id){\n $request = \"\";\n $param = [];\n $param[\"username\"] = $GLOBALS['username_mobileNig'];\n $param[\"api_key\"] = $GLOBALS['Mobile_api'];\n $param[\"network\"] = $network;\n $param[\"amount\"] = $amount;\n $param[\"phoneNumber\"] = $phone;\n $param[\"trans_id\"] = $transaction_id;\n\n\n\n //return $network.$phone.$amount.$transaction_id;\n //unique id, you can use time()\n foreach($param as $key=>$val) //traverse through each member of the param array\n {\n $request .= $key . \"=\" . urlencode($val); //we have to urlencode the values\n $request .= '&'; //append the ampersand (&) sign after each paramter/value pair\n }\n $len = strlen($request) - 1;\n $request = substr($request, 0, $len); //remove the final ampersand sign from the request\n\n $url = \"https://mobilenig.com/API/airtime?\". $request . \"&return_url=https://mywebsite.com/order_status.asp\"; //The URL given in the documentation without parameters\n //return $url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"$url$request\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return as a variable\n $response = json_decode(curl_exec($ch));\n curl_close($ch);\n return $response;\n}"
] | [
"0.66778415",
"0.62705874",
"0.58167255",
"0.57398343",
"0.5689048",
"0.55037504",
"0.5437178",
"0.5373847",
"0.5354669",
"0.53213954",
"0.52628136",
"0.5240162",
"0.5238329",
"0.5237284",
"0.51873827",
"0.51801026",
"0.5153205",
"0.51145875",
"0.51037",
"0.5050703",
"0.5007901",
"0.5005467",
"0.49999288",
"0.49929994",
"0.4981871",
"0.496986",
"0.49553356",
"0.4945692",
"0.49440002",
"0.49278826"
] | 0.7807558 | 0 |
Create request for operation 'apiPaymentV3TransactionTechnicalTransactionIdPatch' | public function apiPaymentV3TransactionTechnicalTransactionIdPatchRequest($technicalTransactionId, $transactionUpdate = null)
{
// verify the required parameter 'technicalTransactionId' is set
if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdPatch'
);
}
$resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($technicalTransactionId !== null) {
$resourcePath = str_replace(
'{' . 'technicalTransactionId' . '}',
ObjectSerializer::toPathValue($technicalTransactionId),
$resourcePath
);
}
/*
*/
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/hal+json', 'application/problem+json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/hal+json', 'application/problem+json'],
['application/json']
);
}
// for model (json/xml)
if (isset($transactionUpdate)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($transactionUpdate));
} else {
$httpBody = $transactionUpdate;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \http_build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
if (!empty($this->config->getAccessToken())) {
$headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = http_build_query($queryParams);
return new Request(
'PATCH',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiPaymentV3TransactionTechnicalTransactionIdGetRequest($technicalTransactionId)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionPostRequest($transaction = null)\n {\n\n $resourcePath = '/api/payment/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($transaction)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($transaction));\n } else {\n $httpBody = $transaction;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiMerchantV3TransactionTransactionIdGetRequest($transactionId)\n {\n // verify the required parameter 'transactionId' is set\n if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transactionId when calling apiMerchantV3TransactionTransactionIdGet'\n );\n }\n\n $resourcePath = '/api/merchant/v3/transaction/{transactionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($transactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'transactionId' . '}',\n ObjectSerializer::toPathValue($transactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest = null)\n {\n // verify the required parameter 'technicalTransactionId' is set\n if ($technicalTransactionId === null || (is_array($technicalTransactionId) && count($technicalTransactionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $technicalTransactionId when calling apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPost'\n );\n }\n\n $resourcePath = '/api/payment/v3/transaction/{technicalTransactionId}/authorization';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($technicalTransactionId !== null) {\n $resourcePath = str_replace(\n '{' . 'technicalTransactionId' . '}',\n ObjectSerializer::toPathValue($technicalTransactionId),\n $resourcePath\n );\n }\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($authorizationRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode(ObjectSerializer::sanitizeForSerialization($authorizationRequest));\n } else {\n $httpBody = $authorizationRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createUpdateTransactionRequest()\n\t{\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<updatetransaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) . '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) . '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) . '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<invoiceid>' . $this->xmlEscape($this->transaction['invoice_id']) . '</invoiceid>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<shipdate>' . $this->xmlEscape($this->transaction['shipdate']) \t. '</shipdate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t</updatetransaction>';\n \n\t\treturn $request;\n\t}",
"protected function rechargeTransactionsByTransactionIdGetRequest($transaction_id)\n {\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_id when calling rechargeTransactionsByTransactionIdGet'\n );\n }\n\n $resourcePath = '/recharge/transactions/{transaction_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transaction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_id' . '}',\n ObjectSerializer::toPathValue($transaction_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function build_payment_request(Transaction $transaction)\n {\n $request = array();\n $request['amount'] = $transaction->amount;\n $request['currency'] = config_item('store_currency_code');\n $request['transactionId'] = $transaction->id;\n $request['description'] = lang('store.order').' #'.$transaction->order->id;\n $request['transactionReference'] = $transaction->reference;\n $request['returnUrl'] = $this->build_return_url($transaction);\n $request['notifyUrl'] = $request['returnUrl'];\n $request['cancelUrl'] = $transaction->order->cancel_url;\n $request['clientIp'] = $this->ee->input->ip_address();\n\n // custom gateways may wish to access the order directly\n $request['order'] = $transaction->order;\n $request['orderId'] = $transaction->order->id;\n\n // these only apply to PayPal\n $request['noShipping'] = 1;\n $request['allowNote'] = 0;\n\n return $request;\n }",
"public function apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostWithHttpInfo($technicalTransactionId, $authorizationRequest = null)\n {\n $request = $this->apiPaymentV3TransactionTechnicalTransactionIdAuthorizationPostRequest($technicalTransactionId, $authorizationRequest);\n\n try {\n // $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\AuthenticationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Teambank\\RatenkaufByEasyCreditApiV3\\Model\\PaymentConstraintViolation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function apiMerchantV3TransactionGetRequest($firstname = null, $lastname = null, $orderId = null, $pageSize = 100, $page = null, $status = null, $minOrderValue = null, $maxOrderValue = null, $tId = null)\n {\n if ($tId !== null && count($tId) > 1000) {\n throw new \\InvalidArgumentException('invalid value for \"$tId\" when calling TransactionApi.apiMerchantV3TransactionGet, number of items must be less than or equal to 1000.');\n }\n\n\n $resourcePath = '/api/merchant/v3/transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($firstname !== null) {\n if('form' === 'form' && is_array($firstname)) {\n foreach($firstname as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['firstname'] = $firstname;\n }\n }\n // query params\n if ($lastname !== null) {\n if('form' === 'form' && is_array($lastname)) {\n foreach($lastname as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['lastname'] = $lastname;\n }\n }\n // query params\n if ($orderId !== null) {\n if('form' === 'form' && is_array($orderId)) {\n foreach($orderId as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['orderId'] = $orderId;\n }\n }\n // query params\n if ($pageSize !== null) {\n if('form' === 'form' && is_array($pageSize)) {\n foreach($pageSize as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['pageSize'] = $pageSize;\n }\n }\n // query params\n if ($page !== null) {\n if('form' === 'form' && is_array($page)) {\n foreach($page as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['page'] = $page;\n }\n }\n // query params\n if ($status !== null) {\n if('form' === 'form' && is_array($status)) {\n foreach($status as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['status'] = $status;\n }\n }\n // query params\n if ($minOrderValue !== null) {\n if('form' === 'form' && is_array($minOrderValue)) {\n foreach($minOrderValue as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['minOrderValue'] = $minOrderValue;\n }\n }\n // query params\n if ($maxOrderValue !== null) {\n if('form' === 'form' && is_array($maxOrderValue)) {\n foreach($maxOrderValue as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['maxOrderValue'] = $maxOrderValue;\n }\n }\n // query params\n if ($tId !== null) {\n if('form' === 'form' && is_array($tId)) {\n foreach($tId as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tId'] = $tId;\n }\n }\n\n\n\n /*\n */\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json', 'application/problem+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\http_build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n if (!empty($this->config->getAccessToken())) {\n $headers['Content-signature'] = 'sha256=' . hash('sha256', $httpBody . $this->config->getAccessToken());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createTransactionRequest()\n\t{\n\t\t$issuer \t\t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->issuer))\n\t\t{\n\t\t\t$issuer \t\t\t\t\t\t=\t' issuer=\"'.$this->xmlEscape($this->issuer).'\"';\n\t\t}\n \n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<redirecttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) \t. '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t\t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t\t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<referrer>' . $this->xmlEscape($this->customer['referrer']) \t\t\t. '</referrer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<user_agent>' . $this->xmlEscape($this->customer['user_agent']) \t\t\t. '</user_agent>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state']) \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t <transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t\t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) \t\t. '</daysactive>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<gateway'.$issuer.'>'.$this->xmlEscape($this->transaction['gateway']) \t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t </transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t <signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</redirecttransaction>';\n \n\t\treturn $request;\n\t}",
"public function setTransactionId() : string;",
"public function transactionRequest($type, $amount, $customerCode, $additional_transaction_no, $date = false)\n {\n $request = new \\Illuminate\\Http\\Request();\n\n $request->replace([\n 'type' => $type,\n 'date' => $date,\n 'category' => 'customer',\n 'tmode' => 'cash',\n 'other_transaction_no' => $additional_transaction_no,\n 'amount' => $amount,\n 'description' => '',\n 'receiver_id' => $customerCode\n ]);\n\n if(Transaction::insertion($request)){\n return true;\n }\n\n return false;\n }",
"public function generateTransactionId($parameters = []);",
"public function new_ticket_transaction(){\n if(wp_verify_nonce($_POST['_wpnonce'], 'aact_continue_to_payment')){\n $api_key = DPAPIKEY;\n $orderid = $this->order->get_order_id();\n $order = $this->order->get_order($orderid);\n $_SESSION['cancelkey'] = wp_generate_uuid4();\n $order['complete_url'] = get_permalink(get_page_by_path('ticket-order-complete'));\n $order['cancel_url'] = get_permalink(get_page_by_path('ticket-test'));\n $order['return_url'] = get_permalink(get_page_by_path('confirm-ticket-order'));\n $order['cancel_key'] = $_SESSION['cancelkey'];\n $transaction = $this->transaction->send_transcation_info($order, $api_key);\n\n\n if(!is_wp_error($transaction)){\n $url = add_query_arg( 'ticket_token', $transaction->ticket_token, $transaction->redirect_url);\n wp_redirect( $url );\n exit;\n }\n\n $_SESSION['alert'] = $transaction->get_error_message().' Order Ref: '.$order['details']->orderID;\n $this->transaction->register_transaction();\n }\n }",
"function FormatTnTRequest() {\n\t\tglobal $pkg;\n\t\t$sBody = '<?xml version=\"1.0\"?>';\n\t\t$sBody .= NL . '<AccessRequest xml:lang=\"en-US\">';\n\t\t$sBody .= NL . '<AccessLicenseNumber>' . MODULE_SHIPPING_UPS_ACCESS_KEY . '</AccessLicenseNumber>';\n\t\t$sBody .= NL . '<UserId>' . MODULE_SHIPPING_UPS_USER_ID . '</UserId>';\n\t\t$sBody .= NL . '<Password>' . MODULE_SHIPPING_UPS_PASSWORD . '</Password>';\n\t\t$sBody .= NL . '</AccessRequest>';\n\t\t$sBody .= NL . '<?xml version=\"1.0\"?>';\n\t\t$sBody .= NL . '<TimeInTransitRequest xml:lang=\"en-US\">';\n\t\t$sBody .= NL . '<Request>';\n\t\t$sBody .= NL . '<TransactionReference>';\n\t\t$sBody .= NL . '<CustomerContext>Time in Transit Request</CustomerContext>';\n\t\t$sBody .= NL . '<XpciVersion>1.0002</XpciVersion>';\n\t\t$sBody .= NL . '</TransactionReference>';\n\t\t$sBody .= NL . '<RequestAction>' . 'TimeInTransit' . '</RequestAction>';\t// pre-set to TimeInTransit\n\t\t$sBody .= NL . '</Request>';\n\t\t$sBody .= NL . '<TransitFrom>';\n\t\t$sBody .= NL . '<AddressArtifactFormat>';\n\t\t// PoliticalDivision2 required for outside US shipments\n\t\tif ($pkg->ship_city_town) $sBody .= NL . '<PoliticalDivision2>' . $pkg->ship_city_town . '</PoliticalDivision2>';\n\t\tif ($pkg->ship_state_province) $sBody .= NL . '<PoliticalDivision1>' . $pkg->ship_state_province . '</PoliticalDivision1>';\n\t\tif ($pkg->ship_postal_code) $sBody .= NL . '<PostcodePrimaryLow>' . $pkg->ship_postal_code . '</PostcodePrimaryLow>';\n//\t\t$country_name = gen_get_country_iso_2_from_3($pkg->ship_country_code);\n\t\t$sBody .= NL . '<CountryCode>' . $pkg->ship_from_country_iso2 . '</CountryCode>';\n\t\t$sBody .= NL . '</AddressArtifactFormat>';\n\t\t$sBody .= NL . '</TransitFrom>';\n\t\t$sBody .= NL . '<TransitTo>';\n\t\t$sBody .= NL . '<AddressArtifactFormat>';\n\t\t// PoliticalDivision2 required for outside US shipments\n\t\tif ($pkg->ship_to_city) $sBody .= NL . '<PoliticalDivision2>' . $pkg->ship_to_city . '</PoliticalDivision2>';\n\t\tif ($pkg->ship_to_state) $sBody .= NL.'<PoliticalDivision1>' . $pkg->ship_to_state . '</PoliticalDivision1>';\n\t\tif ($pkg->ship_to_postal_code) $sBody .= NL.'<PostcodePrimaryLow>' . $pkg->ship_to_postal_code . '</PostcodePrimaryLow>';\n//\t\t$country_name = gen_get_country_iso_2_from_3($pkg->ship_to_country_code);\n\t\t$sBody .= NL . '<CountryCode>' . $pkg->ship_to_country_iso2 . '</CountryCode>';\n\t\tif ($pkg->residential_address) $sBody .= NL . '<ResidentialAddressIndicator/>';\n\t\t$sBody .= NL . '</AddressArtifactFormat>';\n\t\t$sBody .= NL . '</TransitTo>';\n\t\t$sBody .= NL . '<PickupDate>' . date('Ymd', strtotime($pkg->ship_date)) . '</PickupDate>';\n\t\t$sBody .= NL . '</TimeInTransitRequest>';\n\t\t$sBody .= NL;\n\t\treturn $sBody;\n\t}",
"public function createTransaction(Request $request){\n\n $from = $request->from;\n $to = $request->to;\n $extraId = $request->extraId;\n $amount = $request->amount;\n $address = $request->address;\n $refundAddress = '1GhPXFa8p9Chdd4hHrBuknpv8o7cfyuYqH';\n $response = $this->changellyHelper->getChangellyData('createTransaction',[\n 'from'=> $from,\n 'to'=> $to ,\n 'address'=>$address,\n 'extraId'=>$extraId,\n 'amount'=>$amount,\n 'refundAddress'=> $refundAddress\n ]);\n\n if(isset($response['error'])){\n return $response;\n }\n $transactionData = $response['result'];\n $trans = new ExchangeTransaction();\n $trans->trans_id = $transactionData['id'];\n $trans->user_id = Auth::guard('user')->id();\n $trans->apiExtraFee = $transactionData['apiExtraFee'];\n $trans->changellyFee = $transactionData['changellyFee'];\n $trans->payinExtraId = $transactionData['payinExtraId'];\n $trans->payoutExtraId = $transactionData['payoutExtraId'];\n $trans->amountExpectedFrom = $transactionData['amountExpectedFrom'];\n $trans->amountExpectedTo = $transactionData['amountExpectedTo'];\n $trans->status = $transactionData['status'];\n $trans->currencyFrom = $transactionData['currencyFrom'];\n $trans->currencyTo = $transactionData['currencyTo'];\n $trans->amountTo = $transactionData['amountTo'];\n $trans->payinAddress = $transactionData['payinAddress'];\n $trans->payoutAddress = $transactionData['payoutAddress'];\n $trans->save();\n\n return redirect()->route('walletPaying',['id'=>$trans->trans_id]);\n }",
"protected function customerInvoicesV2PostRequest($id, $eu_third_party, $is_credit_invoice, $currency_code, $currency_rate, $created_by_user_id, $total_amount, $total_vat_amount, $total_roundings, $total_amount_invoice_currency, $total_vat_amount_invoice_currency, $set_off_amount_invoice_currency, $customer_id, $rows, $vat_specification, $invoice_date, $due_date, $delivery_date, $rot_reduced_invoicing_type, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_percent, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $persons, $rot_reduced_invoicing_automatic_distribution, $electronic_reference, $electronic_address, $edi_service_deliverer_id, $our_reference, $your_reference, $buyers_order_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_term_name, $delivery_method_code, $delivery_term_code, $customer_is_private_person, $terms_of_payment_id, $customer_email, $invoice_number, $customer_number, $payment_reference_number, $rot_property_type, $sales_document_attachments, $has_auto_invoice_error, $is_not_delivered, $reverse_charge_on_construction_services, $work_house_other_costs, $remaining_amount, $remaining_amount_invoice_currency, $referring_invoice_id, $created_from_order_id, $created_from_draft_id, $voucher_number, $voucher_id, $created_utc, $modified_utc, $reversed_construction_vat_invoicing, $includes_vat, $send_type, $payment_reminder_issued, $uses_green_technology, $rot_reduced_automatic_distribution = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'eu_third_party' is set\n if ($eu_third_party === null || (is_array($eu_third_party) && count($eu_third_party) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $eu_third_party when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'is_credit_invoice' is set\n if ($is_credit_invoice === null || (is_array($is_credit_invoice) && count($is_credit_invoice) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $is_credit_invoice when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null || (is_array($currency_code) && count($currency_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_code when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'currency_rate' is set\n if ($currency_rate === null || (is_array($currency_rate) && count($currency_rate) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_rate when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'created_by_user_id' is set\n if ($created_by_user_id === null || (is_array($created_by_user_id) && count($created_by_user_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_by_user_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'total_amount' is set\n if ($total_amount === null || (is_array($total_amount) && count($total_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_amount when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'total_vat_amount' is set\n if ($total_vat_amount === null || (is_array($total_vat_amount) && count($total_vat_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_vat_amount when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'total_roundings' is set\n if ($total_roundings === null || (is_array($total_roundings) && count($total_roundings) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_roundings when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'total_amount_invoice_currency' is set\n if ($total_amount_invoice_currency === null || (is_array($total_amount_invoice_currency) && count($total_amount_invoice_currency) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_amount_invoice_currency when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'total_vat_amount_invoice_currency' is set\n if ($total_vat_amount_invoice_currency === null || (is_array($total_vat_amount_invoice_currency) && count($total_vat_amount_invoice_currency) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_vat_amount_invoice_currency when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'set_off_amount_invoice_currency' is set\n if ($set_off_amount_invoice_currency === null || (is_array($set_off_amount_invoice_currency) && count($set_off_amount_invoice_currency) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $set_off_amount_invoice_currency when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'customer_id' is set\n if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rows' is set\n if ($rows === null || (is_array($rows) && count($rows) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rows when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'vat_specification' is set\n if ($vat_specification === null || (is_array($vat_specification) && count($vat_specification) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vat_specification when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_date' is set\n if ($invoice_date === null || (is_array($invoice_date) && count($invoice_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_date when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'due_date' is set\n if ($due_date === null || (is_array($due_date) && count($due_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $due_date when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_date' is set\n if ($delivery_date === null || (is_array($delivery_date) && count($delivery_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_date when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_type' is set\n if ($rot_reduced_invoicing_type === null || (is_array($rot_reduced_invoicing_type) && count($rot_reduced_invoicing_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_type when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_amount' is set\n if ($rot_reduced_invoicing_amount === null || (is_array($rot_reduced_invoicing_amount) && count($rot_reduced_invoicing_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_amount when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_percent' is set\n if ($rot_reduced_invoicing_percent === null || (is_array($rot_reduced_invoicing_percent) && count($rot_reduced_invoicing_percent) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_percent when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_property_name' is set\n if ($rot_reduced_invoicing_property_name === null || (is_array($rot_reduced_invoicing_property_name) && count($rot_reduced_invoicing_property_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_property_name when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_org_number' is set\n if ($rot_reduced_invoicing_org_number === null || (is_array($rot_reduced_invoicing_org_number) && count($rot_reduced_invoicing_org_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_org_number when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'persons' is set\n if ($persons === null || (is_array($persons) && count($persons) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $persons when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_automatic_distribution' is set\n if ($rot_reduced_invoicing_automatic_distribution === null || (is_array($rot_reduced_invoicing_automatic_distribution) && count($rot_reduced_invoicing_automatic_distribution) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_automatic_distribution when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'electronic_reference' is set\n if ($electronic_reference === null || (is_array($electronic_reference) && count($electronic_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $electronic_reference when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'electronic_address' is set\n if ($electronic_address === null || (is_array($electronic_address) && count($electronic_address) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $electronic_address when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'edi_service_deliverer_id' is set\n if ($edi_service_deliverer_id === null || (is_array($edi_service_deliverer_id) && count($edi_service_deliverer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $edi_service_deliverer_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'our_reference' is set\n if ($our_reference === null || (is_array($our_reference) && count($our_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $our_reference when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'your_reference' is set\n if ($your_reference === null || (is_array($your_reference) && count($your_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $your_reference when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'buyers_order_reference' is set\n if ($buyers_order_reference === null || (is_array($buyers_order_reference) && count($buyers_order_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $buyers_order_reference when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_customer_name' is set\n if ($invoice_customer_name === null || (is_array($invoice_customer_name) && count($invoice_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_customer_name when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_address1' is set\n if ($invoice_address1 === null || (is_array($invoice_address1) && count($invoice_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address1 when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_address2' is set\n if ($invoice_address2 === null || (is_array($invoice_address2) && count($invoice_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address2 when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_postal_code' is set\n if ($invoice_postal_code === null || (is_array($invoice_postal_code) && count($invoice_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_postal_code when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_city' is set\n if ($invoice_city === null || (is_array($invoice_city) && count($invoice_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_city when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_country_code' is set\n if ($invoice_country_code === null || (is_array($invoice_country_code) && count($invoice_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_country_code when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_customer_name' is set\n if ($delivery_customer_name === null || (is_array($delivery_customer_name) && count($delivery_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_customer_name when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_address1' is set\n if ($delivery_address1 === null || (is_array($delivery_address1) && count($delivery_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address1 when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_address2' is set\n if ($delivery_address2 === null || (is_array($delivery_address2) && count($delivery_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address2 when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_postal_code' is set\n if ($delivery_postal_code === null || (is_array($delivery_postal_code) && count($delivery_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_postal_code when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_city' is set\n if ($delivery_city === null || (is_array($delivery_city) && count($delivery_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_city when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_country_code' is set\n if ($delivery_country_code === null || (is_array($delivery_country_code) && count($delivery_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_country_code when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_name' is set\n if ($delivery_method_name === null || (is_array($delivery_method_name) && count($delivery_method_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_name when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_name' is set\n if ($delivery_term_name === null || (is_array($delivery_term_name) && count($delivery_term_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_name when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_code' is set\n if ($delivery_method_code === null || (is_array($delivery_method_code) && count($delivery_method_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_code when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_code' is set\n if ($delivery_term_code === null || (is_array($delivery_term_code) && count($delivery_term_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_code when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'customer_is_private_person' is set\n if ($customer_is_private_person === null || (is_array($customer_is_private_person) && count($customer_is_private_person) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_is_private_person when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'terms_of_payment_id' is set\n if ($terms_of_payment_id === null || (is_array($terms_of_payment_id) && count($terms_of_payment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $terms_of_payment_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'customer_email' is set\n if ($customer_email === null || (is_array($customer_email) && count($customer_email) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_email when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'invoice_number' is set\n if ($invoice_number === null || (is_array($invoice_number) && count($invoice_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_number when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'customer_number' is set\n if ($customer_number === null || (is_array($customer_number) && count($customer_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_number when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'payment_reference_number' is set\n if ($payment_reference_number === null || (is_array($payment_reference_number) && count($payment_reference_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $payment_reference_number when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'rot_property_type' is set\n if ($rot_property_type === null || (is_array($rot_property_type) && count($rot_property_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_property_type when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'sales_document_attachments' is set\n if ($sales_document_attachments === null || (is_array($sales_document_attachments) && count($sales_document_attachments) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sales_document_attachments when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'has_auto_invoice_error' is set\n if ($has_auto_invoice_error === null || (is_array($has_auto_invoice_error) && count($has_auto_invoice_error) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $has_auto_invoice_error when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'is_not_delivered' is set\n if ($is_not_delivered === null || (is_array($is_not_delivered) && count($is_not_delivered) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $is_not_delivered when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'reverse_charge_on_construction_services' is set\n if ($reverse_charge_on_construction_services === null || (is_array($reverse_charge_on_construction_services) && count($reverse_charge_on_construction_services) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $reverse_charge_on_construction_services when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'work_house_other_costs' is set\n if ($work_house_other_costs === null || (is_array($work_house_other_costs) && count($work_house_other_costs) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $work_house_other_costs when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'remaining_amount' is set\n if ($remaining_amount === null || (is_array($remaining_amount) && count($remaining_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $remaining_amount when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'remaining_amount_invoice_currency' is set\n if ($remaining_amount_invoice_currency === null || (is_array($remaining_amount_invoice_currency) && count($remaining_amount_invoice_currency) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $remaining_amount_invoice_currency when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'referring_invoice_id' is set\n if ($referring_invoice_id === null || (is_array($referring_invoice_id) && count($referring_invoice_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $referring_invoice_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'created_from_order_id' is set\n if ($created_from_order_id === null || (is_array($created_from_order_id) && count($created_from_order_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_from_order_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'created_from_draft_id' is set\n if ($created_from_draft_id === null || (is_array($created_from_draft_id) && count($created_from_draft_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_from_draft_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'voucher_number' is set\n if ($voucher_number === null || (is_array($voucher_number) && count($voucher_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $voucher_number when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'voucher_id' is set\n if ($voucher_id === null || (is_array($voucher_id) && count($voucher_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $voucher_id when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'created_utc' is set\n if ($created_utc === null || (is_array($created_utc) && count($created_utc) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_utc when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'modified_utc' is set\n if ($modified_utc === null || (is_array($modified_utc) && count($modified_utc) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $modified_utc when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'reversed_construction_vat_invoicing' is set\n if ($reversed_construction_vat_invoicing === null || (is_array($reversed_construction_vat_invoicing) && count($reversed_construction_vat_invoicing) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $reversed_construction_vat_invoicing when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'includes_vat' is set\n if ($includes_vat === null || (is_array($includes_vat) && count($includes_vat) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $includes_vat when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'send_type' is set\n if ($send_type === null || (is_array($send_type) && count($send_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $send_type when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'payment_reminder_issued' is set\n if ($payment_reminder_issued === null || (is_array($payment_reminder_issued) && count($payment_reminder_issued) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $payment_reminder_issued when calling customerInvoicesV2Post'\n );\n }\n // verify the required parameter 'uses_green_technology' is set\n if ($uses_green_technology === null || (is_array($uses_green_technology) && count($uses_green_technology) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $uses_green_technology when calling customerInvoicesV2Post'\n );\n }\n\n $resourcePath = '/v2/customerinvoices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($rot_reduced_automatic_distribution !== null) {\n $queryParams['rotReducedAutomaticDistribution'] = ObjectSerializer::toQueryValue($rot_reduced_automatic_distribution, null);\n }\n\n\n // form params\n if ($id !== null) {\n $formParams['Id'] = ObjectSerializer::toFormValue($id);\n }\n // form params\n if ($eu_third_party !== null) {\n $formParams['EuThirdParty'] = ObjectSerializer::toFormValue($eu_third_party);\n }\n // form params\n if ($is_credit_invoice !== null) {\n $formParams['IsCreditInvoice'] = ObjectSerializer::toFormValue($is_credit_invoice);\n }\n // form params\n if ($currency_code !== null) {\n $formParams['CurrencyCode'] = ObjectSerializer::toFormValue($currency_code);\n }\n // form params\n if ($currency_rate !== null) {\n $formParams['CurrencyRate'] = ObjectSerializer::toFormValue($currency_rate);\n }\n // form params\n if ($created_by_user_id !== null) {\n $formParams['CreatedByUserId'] = ObjectSerializer::toFormValue($created_by_user_id);\n }\n // form params\n if ($total_amount !== null) {\n $formParams['TotalAmount'] = ObjectSerializer::toFormValue($total_amount);\n }\n // form params\n if ($total_vat_amount !== null) {\n $formParams['TotalVatAmount'] = ObjectSerializer::toFormValue($total_vat_amount);\n }\n // form params\n if ($total_roundings !== null) {\n $formParams['TotalRoundings'] = ObjectSerializer::toFormValue($total_roundings);\n }\n // form params\n if ($total_amount_invoice_currency !== null) {\n $formParams['TotalAmountInvoiceCurrency'] = ObjectSerializer::toFormValue($total_amount_invoice_currency);\n }\n // form params\n if ($total_vat_amount_invoice_currency !== null) {\n $formParams['TotalVatAmountInvoiceCurrency'] = ObjectSerializer::toFormValue($total_vat_amount_invoice_currency);\n }\n // form params\n if ($set_off_amount_invoice_currency !== null) {\n $formParams['SetOffAmountInvoiceCurrency'] = ObjectSerializer::toFormValue($set_off_amount_invoice_currency);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['CustomerId'] = ObjectSerializer::toFormValue($customer_id);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // form params\n if ($vat_specification !== null) {\n $formParams['VatSpecification'] = ObjectSerializer::toFormValue($vat_specification);\n }\n // form params\n if ($invoice_date !== null) {\n $formParams['InvoiceDate'] = ObjectSerializer::toFormValue($invoice_date);\n }\n // form params\n if ($due_date !== null) {\n $formParams['DueDate'] = ObjectSerializer::toFormValue($due_date);\n }\n // form params\n if ($delivery_date !== null) {\n $formParams['DeliveryDate'] = ObjectSerializer::toFormValue($delivery_date);\n }\n // form params\n if ($rot_reduced_invoicing_type !== null) {\n $formParams['RotReducedInvoicingType'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_type);\n }\n // form params\n if ($rot_reduced_invoicing_amount !== null) {\n $formParams['RotReducedInvoicingAmount'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_amount);\n }\n // form params\n if ($rot_reduced_invoicing_percent !== null) {\n $formParams['RotReducedInvoicingPercent'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_percent);\n }\n // form params\n if ($rot_reduced_invoicing_property_name !== null) {\n $formParams['RotReducedInvoicingPropertyName'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_property_name);\n }\n // form params\n if ($rot_reduced_invoicing_org_number !== null) {\n $formParams['RotReducedInvoicingOrgNumber'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_org_number);\n }\n // form params\n if ($persons !== null) {\n $formParams['Persons'] = ObjectSerializer::toFormValue($persons);\n }\n // form params\n if ($rot_reduced_invoicing_automatic_distribution !== null) {\n $formParams['RotReducedInvoicingAutomaticDistribution'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_automatic_distribution);\n }\n // form params\n if ($electronic_reference !== null) {\n $formParams['ElectronicReference'] = ObjectSerializer::toFormValue($electronic_reference);\n }\n // form params\n if ($electronic_address !== null) {\n $formParams['ElectronicAddress'] = ObjectSerializer::toFormValue($electronic_address);\n }\n // form params\n if ($edi_service_deliverer_id !== null) {\n $formParams['EdiServiceDelivererId'] = ObjectSerializer::toFormValue($edi_service_deliverer_id);\n }\n // form params\n if ($our_reference !== null) {\n $formParams['OurReference'] = ObjectSerializer::toFormValue($our_reference);\n }\n // form params\n if ($your_reference !== null) {\n $formParams['YourReference'] = ObjectSerializer::toFormValue($your_reference);\n }\n // form params\n if ($buyers_order_reference !== null) {\n $formParams['BuyersOrderReference'] = ObjectSerializer::toFormValue($buyers_order_reference);\n }\n // form params\n if ($invoice_customer_name !== null) {\n $formParams['InvoiceCustomerName'] = ObjectSerializer::toFormValue($invoice_customer_name);\n }\n // form params\n if ($invoice_address1 !== null) {\n $formParams['InvoiceAddress1'] = ObjectSerializer::toFormValue($invoice_address1);\n }\n // form params\n if ($invoice_address2 !== null) {\n $formParams['InvoiceAddress2'] = ObjectSerializer::toFormValue($invoice_address2);\n }\n // form params\n if ($invoice_postal_code !== null) {\n $formParams['InvoicePostalCode'] = ObjectSerializer::toFormValue($invoice_postal_code);\n }\n // form params\n if ($invoice_city !== null) {\n $formParams['InvoiceCity'] = ObjectSerializer::toFormValue($invoice_city);\n }\n // form params\n if ($invoice_country_code !== null) {\n $formParams['InvoiceCountryCode'] = ObjectSerializer::toFormValue($invoice_country_code);\n }\n // form params\n if ($delivery_customer_name !== null) {\n $formParams['DeliveryCustomerName'] = ObjectSerializer::toFormValue($delivery_customer_name);\n }\n // form params\n if ($delivery_address1 !== null) {\n $formParams['DeliveryAddress1'] = ObjectSerializer::toFormValue($delivery_address1);\n }\n // form params\n if ($delivery_address2 !== null) {\n $formParams['DeliveryAddress2'] = ObjectSerializer::toFormValue($delivery_address2);\n }\n // form params\n if ($delivery_postal_code !== null) {\n $formParams['DeliveryPostalCode'] = ObjectSerializer::toFormValue($delivery_postal_code);\n }\n // form params\n if ($delivery_city !== null) {\n $formParams['DeliveryCity'] = ObjectSerializer::toFormValue($delivery_city);\n }\n // form params\n if ($delivery_country_code !== null) {\n $formParams['DeliveryCountryCode'] = ObjectSerializer::toFormValue($delivery_country_code);\n }\n // form params\n if ($delivery_method_name !== null) {\n $formParams['DeliveryMethodName'] = ObjectSerializer::toFormValue($delivery_method_name);\n }\n // form params\n if ($delivery_term_name !== null) {\n $formParams['DeliveryTermName'] = ObjectSerializer::toFormValue($delivery_term_name);\n }\n // form params\n if ($delivery_method_code !== null) {\n $formParams['DeliveryMethodCode'] = ObjectSerializer::toFormValue($delivery_method_code);\n }\n // form params\n if ($delivery_term_code !== null) {\n $formParams['DeliveryTermCode'] = ObjectSerializer::toFormValue($delivery_term_code);\n }\n // form params\n if ($customer_is_private_person !== null) {\n $formParams['CustomerIsPrivatePerson'] = ObjectSerializer::toFormValue($customer_is_private_person);\n }\n // form params\n if ($terms_of_payment_id !== null) {\n $formParams['TermsOfPaymentId'] = ObjectSerializer::toFormValue($terms_of_payment_id);\n }\n // form params\n if ($customer_email !== null) {\n $formParams['CustomerEmail'] = ObjectSerializer::toFormValue($customer_email);\n }\n // form params\n if ($invoice_number !== null) {\n $formParams['InvoiceNumber'] = ObjectSerializer::toFormValue($invoice_number);\n }\n // form params\n if ($customer_number !== null) {\n $formParams['CustomerNumber'] = ObjectSerializer::toFormValue($customer_number);\n }\n // form params\n if ($payment_reference_number !== null) {\n $formParams['PaymentReferenceNumber'] = ObjectSerializer::toFormValue($payment_reference_number);\n }\n // form params\n if ($rot_property_type !== null) {\n $formParams['RotPropertyType'] = ObjectSerializer::toFormValue($rot_property_type);\n }\n // form params\n if ($sales_document_attachments !== null) {\n $formParams['SalesDocumentAttachments'] = ObjectSerializer::toFormValue($sales_document_attachments);\n }\n // form params\n if ($has_auto_invoice_error !== null) {\n $formParams['HasAutoInvoiceError'] = ObjectSerializer::toFormValue($has_auto_invoice_error);\n }\n // form params\n if ($is_not_delivered !== null) {\n $formParams['IsNotDelivered'] = ObjectSerializer::toFormValue($is_not_delivered);\n }\n // form params\n if ($reverse_charge_on_construction_services !== null) {\n $formParams['ReverseChargeOnConstructionServices'] = ObjectSerializer::toFormValue($reverse_charge_on_construction_services);\n }\n // form params\n if ($work_house_other_costs !== null) {\n $formParams['WorkHouseOtherCosts'] = ObjectSerializer::toFormValue($work_house_other_costs);\n }\n // form params\n if ($remaining_amount !== null) {\n $formParams['RemainingAmount'] = ObjectSerializer::toFormValue($remaining_amount);\n }\n // form params\n if ($remaining_amount_invoice_currency !== null) {\n $formParams['RemainingAmountInvoiceCurrency'] = ObjectSerializer::toFormValue($remaining_amount_invoice_currency);\n }\n // form params\n if ($referring_invoice_id !== null) {\n $formParams['ReferringInvoiceId'] = ObjectSerializer::toFormValue($referring_invoice_id);\n }\n // form params\n if ($created_from_order_id !== null) {\n $formParams['CreatedFromOrderId'] = ObjectSerializer::toFormValue($created_from_order_id);\n }\n // form params\n if ($created_from_draft_id !== null) {\n $formParams['CreatedFromDraftId'] = ObjectSerializer::toFormValue($created_from_draft_id);\n }\n // form params\n if ($voucher_number !== null) {\n $formParams['VoucherNumber'] = ObjectSerializer::toFormValue($voucher_number);\n }\n // form params\n if ($voucher_id !== null) {\n $formParams['VoucherId'] = ObjectSerializer::toFormValue($voucher_id);\n }\n // form params\n if ($created_utc !== null) {\n $formParams['CreatedUtc'] = ObjectSerializer::toFormValue($created_utc);\n }\n // form params\n if ($modified_utc !== null) {\n $formParams['ModifiedUtc'] = ObjectSerializer::toFormValue($modified_utc);\n }\n // form params\n if ($reversed_construction_vat_invoicing !== null) {\n $formParams['ReversedConstructionVatInvoicing'] = ObjectSerializer::toFormValue($reversed_construction_vat_invoicing);\n }\n // form params\n if ($includes_vat !== null) {\n $formParams['IncludesVat'] = ObjectSerializer::toFormValue($includes_vat);\n }\n // form params\n if ($send_type !== null) {\n $formParams['SendType'] = ObjectSerializer::toFormValue($send_type);\n }\n // form params\n if ($payment_reminder_issued !== null) {\n $formParams['PaymentReminderIssued'] = ObjectSerializer::toFormValue($payment_reminder_issued);\n }\n // form params\n if ($uses_green_technology !== null) {\n $formParams['UsesGreenTechnology'] = ObjectSerializer::toFormValue($uses_green_technology);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract function getTransactionId();",
"protected function createAdditionalCostRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createAdditionalCost'\n );\n }\n\n $resourcePath = '/v1/additional_costs';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function postRequestMoneyPayApi()\n {\n $uid = request('user_id');\n $emailOrPhone = request('emailOrPhone');\n $amount = request('amount');\n $currency_id = request('currencyId');\n $note = request('note');\n $uuid = unique_code();\n $processedBy = $this->helper->getPrefProcessedBy();\n $emailFilterValidate = $this->helper->validateEmailInput(trim($emailOrPhone));\n $phoneRegex = $this->helper->validatePhoneInput(trim($emailOrPhone));\n $senderInfo = User::where(['id' => $uid])->first(['email']);\n $userInfo = $this->helper->getEmailPhoneValidatedUserInfo($emailFilterValidate, $phoneRegex, trim($emailOrPhone));\n $receiverName = isset($userInfo) ? $userInfo->first_name . ' ' . $userInfo->last_name : '';\n $arr = [\n 'unauthorisedStatus' => $this->unauthorisedStatus,\n 'emailFilterValidate' => $emailFilterValidate,\n 'phoneRegex' => $phoneRegex,\n 'processedBy' => $processedBy,\n 'user_id' => $uid,\n 'userInfo' => $userInfo,\n 'currency_id' => $currency_id,\n 'uuid' => $uuid,\n 'amount' => $amount,\n 'receiver' => $emailOrPhone,\n 'note' => $note,\n 'receiverName' => $receiverName,\n 'senderEmail' => $senderInfo->email,\n ];\n //Get response\n $response = $this->requestPayment->processRequestCreateConfirmation($arr, 'mobile');\n if ($response['status'] != 200)\n {\n if (empty($response['transactionOrReqPaymentId']))\n {\n return response()->json([\n 'status' => false,\n ]);\n }\n return response()->json([\n 'status' => true,\n 'requestMoneyMailErrorMessage' => $response['ex']['message'],\n 'tr_ref_id' => $response['transactionOrReqPaymentId'],\n ]);\n }\n return response()->json([\n 'status' => true,\n 'tr_ref_id' => $response['transactionOrReqPaymentId'],\n ]);\n }",
"protected function createTransactionCodeUsingPostRequest($transaction_request)\n {\n // verify the required parameter 'transaction_request' is set\n if ($transaction_request === null || (is_array($transaction_request) && count($transaction_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_request when calling createTransactionCodeUsingPost'\n );\n }\n\n $resourcePath = '/nucleus/v1/transaction_code';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($transaction_request)) {\n $_tempBody = $transaction_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setTransactionId($transaction_id)\r\n{\r\n$this->post_data['transactionId'] = $transaction_id;\r\n}",
"protected function quotesV2PostRequest($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_id' is set\n if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_id when calling quotesV2Post'\n );\n }\n // verify the required parameter 'due_date' is set\n if ($due_date === null || (is_array($due_date) && count($due_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $due_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'quote_date' is set\n if ($quote_date === null || (is_array($quote_date) && count($quote_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $quote_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'created_utc' is set\n if ($created_utc === null || (is_array($created_utc) && count($created_utc) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $created_utc when calling quotesV2Post'\n );\n }\n // verify the required parameter 'approved_date' is set\n if ($approved_date === null || (is_array($approved_date) && count($approved_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $approved_date when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null || (is_array($currency_code) && count($currency_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'status' is set\n if ($status === null || (is_array($status) && count($status) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $status when calling quotesV2Post'\n );\n }\n // verify the required parameter 'currency_rate' is set\n if ($currency_rate === null || (is_array($currency_rate) && count($currency_rate) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency_rate when calling quotesV2Post'\n );\n }\n // verify the required parameter 'company_reference' is set\n if ($company_reference === null || (is_array($company_reference) && count($company_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $company_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'eu_third_party' is set\n if ($eu_third_party === null || (is_array($eu_third_party) && count($eu_third_party) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $eu_third_party when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_reference' is set\n if ($customer_reference === null || (is_array($customer_reference) && count($customer_reference) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_reference when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_customer_name' is set\n if ($invoice_customer_name === null || (is_array($invoice_customer_name) && count($invoice_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address1' is set\n if ($invoice_address1 === null || (is_array($invoice_address1) && count($invoice_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_address2' is set\n if ($invoice_address2 === null || (is_array($invoice_address2) && count($invoice_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_postal_code' is set\n if ($invoice_postal_code === null || (is_array($invoice_postal_code) && count($invoice_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_city' is set\n if ($invoice_city === null || (is_array($invoice_city) && count($invoice_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'invoice_country_code' is set\n if ($invoice_country_code === null || (is_array($invoice_country_code) && count($invoice_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_customer_name' is set\n if ($delivery_customer_name === null || (is_array($delivery_customer_name) && count($delivery_customer_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_customer_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address1' is set\n if ($delivery_address1 === null || (is_array($delivery_address1) && count($delivery_address1) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address1 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_address2' is set\n if ($delivery_address2 === null || (is_array($delivery_address2) && count($delivery_address2) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_address2 when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_postal_code' is set\n if ($delivery_postal_code === null || (is_array($delivery_postal_code) && count($delivery_postal_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_postal_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_city' is set\n if ($delivery_city === null || (is_array($delivery_city) && count($delivery_city) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_city when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_country_code' is set\n if ($delivery_country_code === null || (is_array($delivery_country_code) && count($delivery_country_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_country_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_name' is set\n if ($delivery_method_name === null || (is_array($delivery_method_name) && count($delivery_method_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_method_code' is set\n if ($delivery_method_code === null || (is_array($delivery_method_code) && count($delivery_method_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_method_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_code' is set\n if ($delivery_term_code === null || (is_array($delivery_term_code) && count($delivery_term_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_code when calling quotesV2Post'\n );\n }\n // verify the required parameter 'delivery_term_name' is set\n if ($delivery_term_name === null || (is_array($delivery_term_name) && count($delivery_term_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_term_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'customer_is_private_person' is set\n if ($customer_is_private_person === null || (is_array($customer_is_private_person) && count($customer_is_private_person) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_is_private_person when calling quotesV2Post'\n );\n }\n // verify the required parameter 'includes_vat' is set\n if ($includes_vat === null || (is_array($includes_vat) && count($includes_vat) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $includes_vat when calling quotesV2Post'\n );\n }\n // verify the required parameter 'is_domestic' is set\n if ($is_domestic === null || (is_array($is_domestic) && count($is_domestic) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $is_domestic when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_type' is set\n if ($rot_reduced_invoicing_type === null || (is_array($rot_reduced_invoicing_type) && count($rot_reduced_invoicing_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_property_type' is set\n if ($rot_property_type === null || (is_array($rot_property_type) && count($rot_property_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_property_type when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_property_name' is set\n if ($rot_reduced_invoicing_property_name === null || (is_array($rot_reduced_invoicing_property_name) && count($rot_reduced_invoicing_property_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_property_name when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_org_number' is set\n if ($rot_reduced_invoicing_org_number === null || (is_array($rot_reduced_invoicing_org_number) && count($rot_reduced_invoicing_org_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_org_number when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_amount' is set\n if ($rot_reduced_invoicing_amount === null || (is_array($rot_reduced_invoicing_amount) && count($rot_reduced_invoicing_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rot_reduced_invoicing_automatic_distribution' is set\n if ($rot_reduced_invoicing_automatic_distribution === null || (is_array($rot_reduced_invoicing_automatic_distribution) && count($rot_reduced_invoicing_automatic_distribution) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rot_reduced_invoicing_automatic_distribution when calling quotesV2Post'\n );\n }\n // verify the required parameter 'persons' is set\n if ($persons === null || (is_array($persons) && count($persons) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $persons when calling quotesV2Post'\n );\n }\n // verify the required parameter 'terms_of_payment' is set\n if ($terms_of_payment === null || (is_array($terms_of_payment) && count($terms_of_payment) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $terms_of_payment when calling quotesV2Post'\n );\n }\n // verify the required parameter 'sales_document_attachments' is set\n if ($sales_document_attachments === null || (is_array($sales_document_attachments) && count($sales_document_attachments) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sales_document_attachments when calling quotesV2Post'\n );\n }\n // verify the required parameter 'rows' is set\n if ($rows === null || (is_array($rows) && count($rows) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rows when calling quotesV2Post'\n );\n }\n // verify the required parameter 'total_amount' is set\n if ($total_amount === null || (is_array($total_amount) && count($total_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $total_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'vat_amount' is set\n if ($vat_amount === null || (is_array($vat_amount) && count($vat_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vat_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'roundings_amount' is set\n if ($roundings_amount === null || (is_array($roundings_amount) && count($roundings_amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $roundings_amount when calling quotesV2Post'\n );\n }\n // verify the required parameter 'uses_green_technology' is set\n if ($uses_green_technology === null || (is_array($uses_green_technology) && count($uses_green_technology) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $uses_green_technology when calling quotesV2Post'\n );\n }\n\n $resourcePath = '/v2/quotes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($id !== null) {\n $formParams['Id'] = ObjectSerializer::toFormValue($id);\n }\n // form params\n if ($number !== null) {\n $formParams['Number'] = ObjectSerializer::toFormValue($number);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['CustomerId'] = ObjectSerializer::toFormValue($customer_id);\n }\n // form params\n if ($due_date !== null) {\n $formParams['DueDate'] = ObjectSerializer::toFormValue($due_date);\n }\n // form params\n if ($quote_date !== null) {\n $formParams['QuoteDate'] = ObjectSerializer::toFormValue($quote_date);\n }\n // form params\n if ($created_utc !== null) {\n $formParams['CreatedUtc'] = ObjectSerializer::toFormValue($created_utc);\n }\n // form params\n if ($approved_date !== null) {\n $formParams['ApprovedDate'] = ObjectSerializer::toFormValue($approved_date);\n }\n // form params\n if ($currency_code !== null) {\n $formParams['CurrencyCode'] = ObjectSerializer::toFormValue($currency_code);\n }\n // form params\n if ($status !== null) {\n $formParams['Status'] = ObjectSerializer::toFormValue($status);\n }\n // form params\n if ($currency_rate !== null) {\n $formParams['CurrencyRate'] = ObjectSerializer::toFormValue($currency_rate);\n }\n // form params\n if ($company_reference !== null) {\n $formParams['CompanyReference'] = ObjectSerializer::toFormValue($company_reference);\n }\n // form params\n if ($eu_third_party !== null) {\n $formParams['EuThirdParty'] = ObjectSerializer::toFormValue($eu_third_party);\n }\n // form params\n if ($customer_reference !== null) {\n $formParams['CustomerReference'] = ObjectSerializer::toFormValue($customer_reference);\n }\n // form params\n if ($invoice_customer_name !== null) {\n $formParams['InvoiceCustomerName'] = ObjectSerializer::toFormValue($invoice_customer_name);\n }\n // form params\n if ($invoice_address1 !== null) {\n $formParams['InvoiceAddress1'] = ObjectSerializer::toFormValue($invoice_address1);\n }\n // form params\n if ($invoice_address2 !== null) {\n $formParams['InvoiceAddress2'] = ObjectSerializer::toFormValue($invoice_address2);\n }\n // form params\n if ($invoice_postal_code !== null) {\n $formParams['InvoicePostalCode'] = ObjectSerializer::toFormValue($invoice_postal_code);\n }\n // form params\n if ($invoice_city !== null) {\n $formParams['InvoiceCity'] = ObjectSerializer::toFormValue($invoice_city);\n }\n // form params\n if ($invoice_country_code !== null) {\n $formParams['InvoiceCountryCode'] = ObjectSerializer::toFormValue($invoice_country_code);\n }\n // form params\n if ($delivery_customer_name !== null) {\n $formParams['DeliveryCustomerName'] = ObjectSerializer::toFormValue($delivery_customer_name);\n }\n // form params\n if ($delivery_address1 !== null) {\n $formParams['DeliveryAddress1'] = ObjectSerializer::toFormValue($delivery_address1);\n }\n // form params\n if ($delivery_address2 !== null) {\n $formParams['DeliveryAddress2'] = ObjectSerializer::toFormValue($delivery_address2);\n }\n // form params\n if ($delivery_postal_code !== null) {\n $formParams['DeliveryPostalCode'] = ObjectSerializer::toFormValue($delivery_postal_code);\n }\n // form params\n if ($delivery_city !== null) {\n $formParams['DeliveryCity'] = ObjectSerializer::toFormValue($delivery_city);\n }\n // form params\n if ($delivery_country_code !== null) {\n $formParams['DeliveryCountryCode'] = ObjectSerializer::toFormValue($delivery_country_code);\n }\n // form params\n if ($delivery_method_name !== null) {\n $formParams['DeliveryMethodName'] = ObjectSerializer::toFormValue($delivery_method_name);\n }\n // form params\n if ($delivery_method_code !== null) {\n $formParams['DeliveryMethodCode'] = ObjectSerializer::toFormValue($delivery_method_code);\n }\n // form params\n if ($delivery_term_code !== null) {\n $formParams['DeliveryTermCode'] = ObjectSerializer::toFormValue($delivery_term_code);\n }\n // form params\n if ($delivery_term_name !== null) {\n $formParams['DeliveryTermName'] = ObjectSerializer::toFormValue($delivery_term_name);\n }\n // form params\n if ($customer_is_private_person !== null) {\n $formParams['CustomerIsPrivatePerson'] = ObjectSerializer::toFormValue($customer_is_private_person);\n }\n // form params\n if ($includes_vat !== null) {\n $formParams['IncludesVat'] = ObjectSerializer::toFormValue($includes_vat);\n }\n // form params\n if ($is_domestic !== null) {\n $formParams['IsDomestic'] = ObjectSerializer::toFormValue($is_domestic);\n }\n // form params\n if ($rot_reduced_invoicing_type !== null) {\n $formParams['RotReducedInvoicingType'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_type);\n }\n // form params\n if ($rot_property_type !== null) {\n $formParams['RotPropertyType'] = ObjectSerializer::toFormValue($rot_property_type);\n }\n // form params\n if ($rot_reduced_invoicing_property_name !== null) {\n $formParams['RotReducedInvoicingPropertyName'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_property_name);\n }\n // form params\n if ($rot_reduced_invoicing_org_number !== null) {\n $formParams['RotReducedInvoicingOrgNumber'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_org_number);\n }\n // form params\n if ($rot_reduced_invoicing_amount !== null) {\n $formParams['RotReducedInvoicingAmount'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_amount);\n }\n // form params\n if ($rot_reduced_invoicing_automatic_distribution !== null) {\n $formParams['RotReducedInvoicingAutomaticDistribution'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_automatic_distribution);\n }\n // form params\n if ($persons !== null) {\n $formParams['Persons'] = ObjectSerializer::toFormValue($persons);\n }\n // form params\n if ($terms_of_payment !== null) {\n $formParams['TermsOfPayment'] = ObjectSerializer::toFormValue($terms_of_payment);\n }\n // form params\n if ($sales_document_attachments !== null) {\n $formParams['SalesDocumentAttachments'] = ObjectSerializer::toFormValue($sales_document_attachments);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // form params\n if ($total_amount !== null) {\n $formParams['TotalAmount'] = ObjectSerializer::toFormValue($total_amount);\n }\n // form params\n if ($vat_amount !== null) {\n $formParams['VatAmount'] = ObjectSerializer::toFormValue($vat_amount);\n }\n // form params\n if ($roundings_amount !== null) {\n $formParams['RoundingsAmount'] = ObjectSerializer::toFormValue($roundings_amount);\n }\n // form params\n if ($uses_green_technology !== null) {\n $formParams['UsesGreenTechnology'] = ObjectSerializer::toFormValue($uses_green_technology);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getTransactionCodeUsingGetRequest($transaction_code_id)\n {\n // verify the required parameter 'transaction_code_id' is set\n if ($transaction_code_id === null || (is_array($transaction_code_id) && count($transaction_code_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_code_id when calling getTransactionCodeUsingGet'\n );\n }\n\n $resourcePath = '/nucleus/v1/transaction_code/{transaction_code_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transaction_code_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_code_id' . '}',\n ObjectSerializer::toPathValue($transaction_code_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function createTransaction(): Transaction\n {\n return new Transaction([\n 'billerCode' => '5566778',\n 'paymentAccountBSB' => '084455',\n 'paymentAccountNumber' => '112233445',\n 'customerReferenceNumber' => '9457689335',\n 'amount' => '2599',\n 'lodgementReference1' => 'lodgeRef1',\n 'lodgementReference2' => 'lodgeRef2',\n 'lodgementReference3' => 'lodgeRef2',\n ]);\n }",
"public function testApiCall(){\n return $this->json('POST', \"api/test/\",[\n \"amount\" => 50000,\n \"payment_info\" => \"test111\",\n \"order_id\" => \"ord1d112\",\n \"mrc_id\" => \"MCP20170101\",\n \"customer_info\"=>\"Greg\",\n \"signature\" => \"dfe12e553a60a56a1662b6ff7a71ab9c65cb05c2e7f67c1ae823cba879d3147e\"\n ])->seeJson([\n \"status_message\" => \"Success create transaction\",\n \"status_code\" => 200,\n \"process_id\" => \"\",\n \"transaction_id\" => \"82a66e60-4bee-44eb-ae36-db3a4a61bb59\",\n \"order_id\" => \"ord1d112\",\n \"amount\" => 50000,\n \"payment_code\" => \"5491164033386312\",\n \"transaction_time\" => \"2017-01-16T16:54:30.997+07:00\",\n \"expired_time\" => \"2017-01-16T17:24:31.117+07:00\"\n ]);\n }",
"function getRequestParameters()\n {\n $params = $this->getRawParameters();\n\n $fingerprintOrder = array_merge(\n ['customerId', 'shopId', 'password', 'secret', 'language'],\n $this->fingerprintOrder\n );\n\n $requiredParameters = array_merge(\n ['customerId', 'requestFingerprint', 'password', 'language'],\n $this->requiredParameters\n );\n\n switch ($this->getParam('fundTransferType')) {\n case FundTransferType::EXISTINGORDER:\n $fingerprintOrder[] = 'sourceOrderNumber';\n $requiredParameters[] = 'sourceOrderNumber';\n break;\n case FundTransferType::MONETA:\n $fingerprintOrder[] = 'consumerWalletId';\n $requiredParameters[] = 'consumerWalletId';\n break;\n case FundTransferType::SEPA_CT:\n $fingerprintOrder[] = 'bankAccountOwner';\n $fingerprintOrder[] = 'bankBic';\n $fingerprintOrder[] = 'bankAccountIban';\n $requiredParameters[] = 'bankAccountOwner';\n $requiredParameters[] = 'bankBic';\n $requiredParameters[] = 'bankAccountIban';\n break;\n case FundTransferType::SKRILLWALLET:\n $fingerprintOrder[] = 'consumerEmail';\n $requiredParameters[] = 'consumerEmail';\n $requiredParameters[] = 'customerStatement';\n break;\n }\n\n $params['requestFingerprint'] = Fingerprint::fromParameters($params)\n ->setContext($this->getContext())\n ->setFingerprintOrder($fingerprintOrder);\n $this->assertParametersAreValid($params, $requiredParameters);\n\n return $params;\n }",
"public function submit($merchant_id, $format = 'json')\n {\n set_time_limit(0);\n \n $format = strtolower($format);\n\n // Format to view mapping\n $formats = [\n 'xml' => 'Xml',\n 'json' => 'Json',\n ];\n\n // Error on unknown type\n if (!isset($formats[$format])) {\n throw new NotFoundException(__('Unknown format.'));\n }\n $this->viewBuilder()->className($formats[ $format ]);\n\n // Get user information\n $user = $this->Auth->user();\n \n\n $startDate = $this->request->data('start');\n $endDate = $this->request->data('end');\n $startDateNtx = $this->request->data('start_ntx');\n $endDateNtx = $this->request->data('end_ntx');\n $ntx = $this->request->data('ntx');\n \n if ($startDate == 'null') {\n $startDate = null;\n }\n if ($endDate == 'null') {\n $endDate = null;\n }\n $req_txid = isset($this->request->data['txid']) ? $this->request->data('txid') : null;\n if (is_string($req_txid)) {\n $req_txid =empty($req_txid)? []: explode(',', trim($req_txid));\n }\n\n // Step 1 - Create single token. if any exist token found, stop here.\n $tokenLockPath = ROOT.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'SettlementBatch.lock';\n \n // Lock the state for preventing other process\n $tokenFp = tryFileLock($tokenLockPath);\n if (!$tokenFp) {\n $this->dataResponse(['status'=>'error','type'=>'CannotCreateToken']);\n return;\n }\n $this->log('Settlement token locked.', 'debug');\n \n\n\n $particulars = $this->request->data('particulars');\n $reportDate = $this->request->data('report_date');\n\n $params = compact('particulars', 'ntx');\n $params['start_date'] = $startDate;\n $params['end_date'] = $endDate;\n $params['start_date_ntx'] = $startDateNtx;\n $params['end_date_ntx'] = $endDateNtx;\n $params['report_date'] = $reportDate;\n $params['txid'] = $req_txid;\n\n $masterMerchant = $this->merchantService->getMasterMerchant($merchant_id, true);\n \n $batchData = $this->service->batchBuilder->create($masterMerchant, $params);\n $batchData->id = Text::uuid(); // Assign the batch id for the creation\n \n \n try {\n // Requesting client side to submit the total amount for comparing server-side result\n $requestedTotalSettlementAmount = assume($particulars, 'totalSettlementAmount', null);\n if (!isset($requestedTotalSettlementAmount['converted_amount'])) {\n throw new ProcessException('InvalidTotalSettlementAmount', 'submitBatch', 'Total settlement amount need to be submitted.');\n }\n\n $requestedTotalSettlementAmount['converted_amount'] = round(floatval($requestedTotalSettlementAmount['converted_amount']), 2);\n \n // Warning if total settlement amount is equal / lower than zero in server-side result\n $totalSettlementAmount = $batchData->getParticularData('totalSettlementAmount', $batchData->merchantCurrency);\n $totalSettlementAmount['converted_amount'] = round(floatval($totalSettlementAmount['converted_amount']), 2);\n\n if (round($totalSettlementAmount['converted_amount'], 2) != round($requestedTotalSettlementAmount['converted_amount'], 2)) {\n $response = [\n 'server'=>$totalSettlementAmount['converted_amount'],\n 'requested'=>$requestedTotalSettlementAmount['converted_amount'],\n 'particulars'=>$batchData->particulars,\n ];\n throw new ProcessException('UnmatchedTotalSettlementAmount', 'submitBatch', 'Submitted total settlement amount does not match server-side result.', $response);\n }\n \n\n $submittingChecksum = $batchData->getChecksum();\n \n $this->service->batchProcessor->submit($batchData, $user);\n \n $this->Flash->success('Settlement batch created.');\n $response = [\n 'status'=>'done',\n 'msg'=>'Batch created.',\n 'id'=>$batchData->id,\n 'url'=>Router::url(['action'=>'view', $batchData->id]),\n ];\n\n // Remove cached data after submit a batch.\n $this->removeBatchCache($submittingChecksum);\n\n $this->log($response, 'debug');\n\n // Update merchant unsettled records after batch created.\n $this->service->updateMerchantUnsettled();\n\n // Clear cache if checksum provided.\n $checksum = $this->request->data('checksum');\n if (!empty($checksum)) {\n $cacheKey = 'settlement_batch_cached_'.$checksum;\n Cache::delete($cacheKey);\n }\n } catch (ProcessException $exp) {\n $response = [\n 'status'=>'error',\n 'type'=>$exp->type,\n 'msg'=>$exp->message,\n ];\n if ($exp->data != null) {\n $response['data'] = $exp->data;\n }\n $this->log($response, 'error');\n } catch (\\Exception $exp) {\n $response = [\n 'status'=>'error',\n 'type'=>'Exception',\n 'exception'=>get_class($exp),\n 'msg'=>$exp->getMessage(),\n ];\n $this->log($response, 'error');\n }\n\n // Unlock path\n tryFileUnlock($tokenFp);\n @unlink($tokenLockPath);\n $this->log('Settlement token unlocked.', 'debug');\n\n return $this->dataResponse($response);\n }",
"public function send_transaction() {\n $data = array(\n 'recd' => '',\n 'sent' => array(\n 'info' => array(),\n 'postfields' => ''\n )\n );\n $endpoint = 'emails/deliver.json';\n\n $apiHeaders = array(\n 'Accept: application/json',\n 'Content-Type: application/json'\n );\n\n $payload = array(\n 'email' => array(\n 'campaign_id' => $this->campaign_id,\n 'content_id' => $this->content_id,\n 'contact' => array(\n 'email' => $this->to\n ),\n 'from_name' => $this->from_name,\n 'from_email' => $this->from_email,\n 'reply_to' => $this->reply_to,\n 'subject' => $this->subject,\n 'bcc' => $this->bcc,\n 'tags' => $this->tags\n )\n );\n $payload = json_encode($payload);\n $data['sent']['postfields'] = $payload;\n\n $ch = curl_init(self::API_ROOT .'/'. $this->account_id .'/'. $endpoint .'?auth_token=' . $this->api_key);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $apiHeaders);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n\n $data['recd'] = curl_exec($ch);\n $data['sent']['info'] = curl_getinfo($ch);\n\n curl_close($ch);\n return $data;\n }",
"public function createRequest($data = array()) {\n\t\treturn new Service24PayRequest($this, $data);\n\t}"
] | [
"0.72715694",
"0.61231923",
"0.6115888",
"0.6070649",
"0.58549476",
"0.5394017",
"0.5368101",
"0.5002788",
"0.48699018",
"0.48656014",
"0.48509663",
"0.4849934",
"0.48373893",
"0.4819124",
"0.48010737",
"0.4790018",
"0.4789428",
"0.47854462",
"0.47653896",
"0.47108048",
"0.4690318",
"0.46733207",
"0.46529463",
"0.46441048",
"0.46370733",
"0.4611733",
"0.45928076",
"0.45619106",
"0.45618552",
"0.45566514"
] | 0.7396444 | 0 |
Drops repeatable section and field elements from the given array. This is used in the filtering method that merges user input data with the saved options. If the user input data includes repeatable sections and the user removed some elements, then the corresponding elements also need to be removed from the options array. Otherwise, the user's removing element remains in the saved option array as the framework performs recursive array merge. | public function dropRepeatableElements( array $aOptions ) {
foreach( $aOptions as $_sFieldOrSectionID => $_aSectionOrFieldValue ) {
// If it's a section
if ( $this->isSection( $_sFieldOrSectionID ) ) {
$_aFields = $_aSectionOrFieldValue;
$_sSectionID = $_sFieldOrSectionID;
// Check the capability - do not drop if the level is insufficient.
if ( ! $this->isCurrentUserCapable( $_sSectionID ) ) {
continue;
}
if ( $this->isRepeatableSection( $_sSectionID ) ) {
unset( $aOptions[ $_sSectionID ] );
continue;
}
// An error may occur with an empty _default element.
if ( ! is_array( $_aFields ) ) { continue; }
// At this point, it is not a repeatable section.
foreach( $_aFields as $_sFieldID => $_aField ) {
if ( ! $this->isCurrentUserCapable( $_sSectionID, $_sFieldID ) ) {
continue;
}
if ( $this->isRepeatableField( $_sFieldID, $_sSectionID ) ) {
unset( $aOptions[ $_sSectionID ][ $_sFieldID ] );
continue;
}
}
continue;
}
// It's a field saved in the root dimension, which corresponds to the '_default' section of the stored registered fields array.
$_sFieldID = $_sFieldOrSectionID;
if ( ! $this->isCurrentUserCapable( '_default', $_sFieldID ) ) {
continue;
}
if ( $this->isRepeatableField( $_sFieldID, '_default' ) ) {
unset( $aOptions[ $_sFieldID ] );
}
}
return $aOptions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __cleanData(&$array, $section) {\n foreach ($array as $key => $row) {\n if (!isset($this->__flatData[$section][$key])) {\n unset ($array[$key]);\n } elseif (isset($row['children']) && $row['children']) {\n $this->__cleanData($array[$key]['children'], $section);\n }\n }\n }",
"private function removeOptions(array $fields)\n {\n foreach ($fields as $key => $field) {\n if (array_key_exists('options', $field)) {\n $fields[$key]['options'] = [];\n }\n }\n\n return $fields;\n }",
"function DeleteRepeats($array_entrada_repetidos)\n{\n\n\t$array_trim_mayus = array();\n\t$exit_array = array();\n\n\tforeach ($array_entrada_repetidos as $indice => $valor_array) {\n\n\t\tif ($valor_array != \"\") {\n\t\t\tarray_push($array_trim_mayus, trim(strtoupper($valor_array)));\n\t\t}\n\t}\n\n\t$eliminar_duplicados = array_unique($array_trim_mayus);\n\n\tforeach ($eliminar_duplicados as $key_nuevo => $valor_nuevo_array) {\n\n\t\tif ($valor_nuevo_array != \"\") {\n\t\t\tarray_push($exit_array, eliminar_tildes($valor_nuevo_array));\n\t\t}\n\t}\n\n\n\treturn $exit_array;\n}",
"function el_remove_field_from_fields(array $remove = array(), array $fields = array()) {\n\t\tif(!isset($remove) || !is_array($remove) || empty($fields) || !is_array($fields)) {\n\t\t\t\treturn false;\n\t\t}\n\t\tforeach($fields as $name => $type) {\n\t\t\t\tforeach($type as $datatype => $data) {\n\t\t\t\t\t\tforeach($data as $occurance => $field) {\n\t\t\t\t\t\t\t\tif(isset($field['name']) && in_array($field['name'], $remove)) {\n\t\t\t\t\t\t\t\t\t\tunset($fields[$name][$datatype][$occurance]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\treturn $fields;\n}",
"protected function resetItems()\n {\n foreach ($this->options as $op => $junk) {\n if (preg_match('#Items#', $op)) {\n unset($this->options[$op]);\n }\n }\n }",
"public function removeOptions()\n {\n while ($this->element != null && $this->element->hasChildNodes()) {\n $this->element->removeChild($this->element->childNodes->item(0));\n }\n }",
"public function removeElementsFromContent() {\r\n global $post;\r\n\r\n // Get advanced settings\r\n if (!isset($this->advanced_settings)) {\r\n $this->advanced_settings = get_option($this->tag.'_advanced_settings');\r\n }\r\n\r\n if (empty($this->advanced_settings)) {\r\n return;\r\n }\r\n\r\n foreach($this->advanced_settings as $element => $val) {\r\n if ($this->getAdvancedSettings($element) == true) {\r\n // Get regex of element shortcode\r\n $pattern = $this->getShortcodeRegex($element);\r\n // Find all element data\r\n $count = preg_match_all('/'.$pattern .'/s', $post->post_content, $found);\r\n\r\n // Check if there are elements found\r\n if ( is_array( $found ) && ! empty( $found[0] ) ) {\r\n if ( isset( $found[3] ) && is_array( $found[3] ) ) {\r\n foreach ( $found[3] as $key => $shortcode_atts ) {\r\n // Extract shortcode parameters\r\n $atts = shortcode_parse_atts( $shortcode_atts );\r\n\r\n // Filter shortcode\r\n if ($this->isShortcodeFiltered($atts) == true) {\r\n $post->post_content = str_replace($found[0][$key], '', $post->post_content);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }",
"function tfd_without($array) {\n if ($array instanceof ArrayAccess) {\n $filtered = clone $array;\n }\n else {\n $filtered = $array;\n }\n $args = func_get_args();\n unset($args[0]);\n foreach ($args as $arg) {\n if (isset($filtered[$arg])) {\n unset($filtered[$arg]);\n }\n }\n return $filtered;\n}",
"private function interpretFieldsArray(&$input)\n {\n foreach ($input['fields'] as $fIndex => $field) {\n if (isset($field['choices'])) {\n foreach($field['choices'] as $cIndex => $choice) {\n $input['fields'][$fIndex]['choices'][$choice['value']] = $choice['key'];\n\n unset($input['fields'][$fIndex]['choices'][$cIndex]);\n }\n }\n\n if(array_get($field, 'formType') == '') {\n unset($input['fields'][$fIndex]['formType']);\n }\n\n if(array_get($field, 'default') == '') {\n unset($input['fields'][$fIndex]['default']);\n }\n\n if(array_get($field, 'label') == '') {\n unset($input['fields'][$fIndex]['label']);\n }\n }\n }",
"function clean_up_array(\n $array\n ){\n foreach($array as $base_val){\n $counter = 0;\n foreach($array as $mask_key => $mask_val){\n if($base_val == $mask_val){\n ++$counter;\n if($counter > 1){\n unset($array[$mask_key]);\n }\n }\n }\n }\n \n return $array;\n }",
"public static function removeFields(&$array, $unwanted_key)\n\t{\n\t\tif (!empty($array)) {\n\n\t\t\tforeach ($unwanted_key as $v) {\n\t\t\t\tforeach ($array as $key => &$value) {\n\t\t\t\t\tif ($key == $v) {\n\t\t\t\t\t\tunset($array[$v]);\n\t\t\t\t\t}\n\t\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t\tself::removeFields($value, $unwanted_key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function _cleanOptions(&$options)\n {\n //Get the limits from the cart / fields settings\n $cart = geoCart::getInstance();\n $fields = geoFields::getInstance($cart->user_data['group_id'], $cart->item->getCategory());\n\n $text_length = (int)$fields->cost_options->text_length;\n $type_data = $fields->cost_options->type_data;\n $max_options = (int)substr($type_data, strpos($type_data, '|') + 1);\n\n $cleaned = $labels = array();\n $errorFree = $first = true;\n $count = 0;\n foreach ($options as $raw) {\n $count++;\n if ($count > $max_options) {\n //we reached the max number, don't allow going further. Since\n //there is UI \"enforcement\" of this, probably don't need error message\n break;\n }\n\n //make sure nothing \"extra\" is set since this is based on user input...\n $option = array();\n\n\n\n $label = trim($raw['label']);\n\n if ($label) {\n //clean it up, but don't bother unless it is non-empty\n\n //wordrap\n $label = geoString::breakLongWords($label, $cart->db->get_site_setting('max_word_width'), \" \");\n //check the value for badwords\n $label = geoFilter::badword($label);\n //check the value for disallowed html\n $label = geoFilter::replaceDisallowedHtml($label, 0);\n\n //make sure it doesn't go over max length\n $label = substr($label, 0, $text_length);\n\n //urlencode here to match/workaround the case where existing options NOT changed during a copy/edit are never decoded\n $label = geoString::toDB($label);\n }\n\n //NOTE: We do NOT remove \"blank\" labels, as it allows for \"nothing selected\" option.\n //but we don't allow multiple with same value!\n if (in_array($label, $labels)) {\n $errorFree = false;\n $option['error'] = 'Duplicate option';\n } elseif (!$first && !strlen($label)) {\n //and we don't allow blank entries other than in the first option\n $option['error'] = $this->messages[502226];\n }\n $labels[] = $option['label'] = $label;\n\n $option['cost_added'] = geoNumber::deformat($raw['cost_added']);\n\n /*\n * Note that it still preserves the ind_quantity_remaining regardless\n * of how the quantity is applied (cost_options_quantity) so that it\n * can be changed without loosing the quantity data\n */\n //make sure quantity remaining is a number and >= 0...\n $option['ind_quantity_remaining'] = max(0, (int)$raw['ind_quantity_remaining']);\n\n $option['file_slot'] = ((int)$raw['file_slot'] > 0 && (int)$raw['file_slot'] <= $this->maxImages) ? (int)$raw['file_slot'] : 0;\n\n if ($raw['option_id']) {\n $option['option_id'] = (int)$raw['option_id'];\n }\n\n $cleaned[] = $option;\n $first = false;\n }\n $options = $cleaned;\n return $errorFree;\n }",
"public function test_cannot_remove_all_slots_in_a_section() {\n $quizobj = $this->create_test_quiz(array(\n array('TF1', 1, 'truefalse'),\n array('TF2', 1, 'truefalse'),\n 'Heading 2',\n array('TF3', 2, 'truefalse'),\n ));\n $structure = \\mod_quiz\\structure::create_for_quiz($quizobj);\n\n $structure->remove_slot(1);\n $structure->remove_slot(2);\n }",
"function epub_remove_options()\n\t{\t\tdelete_option('epub_order');\n\t\tdelete_option('epub_general');\n\t\tdelete_option('epub_cover');\n\t\tdelete_option('epub_toc');\n\t\tdelete_option('epub_csun');\n\t\tdelete_option('epub_undergrad');\n\t\tdelete_option('epub_student-services');\n\t\tdelete_option('epub_special-programs');\n\t\tdelete_option('epub_gened');\n\t\tdelete_option('epub_grad');\n\t\tdelete_option('epub_credential');\n\t\tdelete_option('epub_courses');\n\t\tdelete_option('epub_policies');\n\t\tdelete_option('epub_faculty');\n\t\tdelete_option('epub_emeriti');\n\t}",
"private function removeField2args($name, $page) {\n $item = $fields[$name];\n if ($item == NULL)\n return FALSE;\n $acroForm = PdfReader::getPdfObject($reader->getCatalog()->get(PdfName::$ACROFORM), $reader->getCatalog());\n if ($acroForm == NULL)\n return FALSE;\n $arrayf = PdfReader::getPdfObject($acroForm->get(PdfName::$FIELDS), $acroForm);\n if ($arrayf == NULL)\n return FALSE;\n for ($k = 0; $k < count($item->widget_refs); ++$k) {\n $pageV = (integer)$item->page[$k];\n if ($page != -1 && $page != $pageV)\n continue;\n $ref = $item->widget_refs[$k];\n $wd = PdfReader::getPdfObject($ref);\n $pageDic = $reader->getPageN($pageV);\n $annots = PdfReader::getPdfObject($pageDic->get(PdfName::$ANNOTS), $pageDic);\n if ($annots != NULL) {\n if (removeRefFromArray($annots, $ref) == 0) {\n $pageDic->remove(PdfName::$ANNOTS);\n markUsed($pageDic);\n }\n else\n markUsed($annots);\n }\n PdfReader::killIndirect($ref);\n $kid = $ref;\n while (($ref = $wd->get(PdfName::$PARENT)) != $null) {\n $wd = PdfReader::getPdfObject($ref);\n $kids = PdfReader::getPdfObject($wd->get(PdfName::$KIDS));\n if (removeRefFromArray($kids, $kid) != 0)\n break;\n $kid = $ref;\n PdfReader::killIndirect($ref);\n }\n if ($ref == NULL) {\n removeRefFromArray($arrayf, $kid);\n markUsed($arrayf);\n }\n if ($page != -1) {\n unset($item->merged[$k]);\n unset($item->page[$k]);\n unset($item->values[$k]);\n unset($item->widget_refs[$k]);\n unset($item->widgets[$k]);\n --$k;\n }\n }\n if ($page == -1 || count($item->merged) == 0)\n unset($fields[$name]);\n return TRUE;\n }",
"function removeElement($array){\n foreach($array as $subKey => $subArray){\n if($subArray->getName() == \"delete\"){\n unset($array[$subKey]);\n }\n }\n return $array;\n }",
"public static function removeAll() {\n update_option(self::$config['optionName'], array());\n }",
"function RemoveItems($table_name, $ini)\n\t{\n\t\t// iterate groups\n\t\tforeach ($ini as $group => $options)\n\t\t{\n\t\t\tforeach ($options as $name => $value)\n\t\t\t{\n\t\t\t\t$this->db->qD($table_name, array('option_group' => $group, 'option_name' => $name));\n\t\t\t}\n\t\t} \t\n\t}",
"function sanitize_repeat_extra_field( $fields, $option ){\n\n\t\t$results = array();\n\t\tif (is_array($fields)) {\t\t\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t\n\t\t\t\t$field_id = isset($field['id']) ? $field['id'] : '';\n\t\t\t\t$field_label = isset($field['label']) ? $field['label'] : '';\n\t\t\t\t$field_index = isset($field['index']) ? $field['index'] : 0;\n\t\t\t\t\n\t\t\t\t$field_id = trim($field_id);\n\t\t\t\tif (empty($field_id) && !empty($field_label)) {\n\t\t\t\t\t$field_id = URLify::filter($field_label . '-' . $field_index);\n\t\t\t\t\t$field_id = str_replace(\"-\", \"_\", $field_id);\n\t\t\t\t\t$field['id'] = $field_id;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (isset($field['label']))\n\t\t\t\t\t$this->register_dynamic_string_for_translation($this->get_option_id_context($option['id']) . ' ' . $field['label'], $field['label']);\n\t\t\t\t\t\n\t\t\t\t$results[] = $field;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}",
"private function cleanUpFrom(array $data, array $fields)\n {\n $result = $data;\n\n foreach ($result as $_key => $_value)\n {\n if (in_array($_key, $fields))\n {\n unset($result[$_key]);\n }\n }\n\n return $result;\n }",
"function clean( $args, $assoc_args ) {\n extract( $assoc_args );\n\n $field_groups = acf_get_field_groups();\n $fields = \\ACFWPCLI\\Field::all();\n\n if ( empty( $field_groups[0] ) && empty( $fields ) ) {\n WP_CLI::warning( 'No field groups or fields found to clean up.' );\n }\n\n foreach ( $fields as $field ) {\n \\ACFWPCLI\\Field::destroy( $field->ID );\n }\n\n foreach ( $field_groups as $field_group ) {\n \\ACFWPCLI\\FieldGroup::destroy( $field_group['ID'] );\n WP_CLI::success( \"Removed field group: {$field_group['title']}\" );\n }\n }",
"function cleanupRecordArray($table, $row) {\r\n\t\t$allowedFields = $this->getTCAFieldListArray($table);\r\n\t\tforeach ($row as $field => $val) {\r\n\t\t\tif (!in_array($field, $allowedFields)) {\r\n\t\t\t\tunset($row[$field]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $row;\r\n\t}",
"public static function sanitize_options( $options ) {\r\n\r\n // start fresh\r\n $clean_options = array();\r\n $error = false;\r\n\r\n foreach($options as $k => $option){\r\n\r\n if( !empty($option) && $k == 'tag_cat'){\r\n $clean_options[$k] = sanitize_text_field(trim($option));\r\n\r\n }elseif(!empty($option) && ($k == 'new' || $k == 'mem' )){\r\n\r\n foreach($option as $item){\r\n if( !empty($item['tag']) && !empty($item['name']) ){\r\n $tmp = $item;\r\n //unset($tmp['tag']);\r\n $clean_options['member'][$item['tag']] = $tmp;\r\n\r\n //trim fields\r\n $clean_options['member'][$item['tag']]['name'] = sanitize_text_field(trim($clean_options['member'][$item['tag']]['name']));\r\n $clean_options['member'][$item['tag']]['level'] = sanitize_text_field(trim($clean_options['member'][$item['tag']]['level']));\r\n\r\n }elseif(!empty($item['tag']) && !empty($item['name'])){\r\n add_settings_error( $k, $k.'-error', __( 'Fields can not be empty', 'inf-member' ) );\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n if(!$error)\r\n return $clean_options;\r\n else\r\n return array();\r\n }",
"function sanitize_repeat_form_field( $fields, $option ) {\n\t\n\t\t$results = array();\n\t\t\n\t\tif (is_array($fields)) {\n\t\t\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t\n\t\t\t\t$field_id = isset($field['id']) ? trim($field['id']) : '';\n\t\t\t\t$field_label = isset($field['label']) ? $field['label'] : '';\n\t\t\t\t$field_index = isset($field['index']) ? $field['index'] : 0;\n\t\t\t\t\n\t\t\t\tif (empty($field_id) && !empty($field_label)) {\n\t\t\t\t\t$field_id = URLify::filter($field_label . '-' . $field_index);\n\t\t\t\t\t$field_id = str_replace(\"-\", \"_\", $field_id);\n\t\t\t\t\t$field['id'] = $field_id;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (isset($field['label'])) {\n\t\t\t\t\t$this->register_dynamic_string_for_translation($this->get_option_id_context($option['id']) . ' ' . $field['label'], $field['label']);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$results[] = $field;\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}",
"static public function cleanFormArray(array $array){\n // echo \"just got info to clean up ***********\";\n // var_dump($array);\n // get and store class specific validation columns to check if we need to clean up\n $cleanUpInfo_array = static::$validation_columns;\n // default array, fill with appropriate applicable form data\n $post_array = [];\n // loop through array and filter accordingly\n foreach ($array as $key => $value) {\n // If I want to change it, I needed it, get a value or no go\n if (isset($cleanUpInfo_array[$key]) && isset($cleanUpInfo_array[$key]['required'])) {\n // check to see if the information is blank or null, if it is do nothing, if it is not put in the array\n if (!is_blank($value)) {\n $post_array[$key] = trim($value);\n }\n // pass through everything else do validation later on\n } else {\n // let it pass through\n $post_array[$key] = trim($value);\n }\n }\n return $post_array;\n }",
"function simple_feed_form_selections_to_array($selections) {\n $selections_array = array_values($selections);\n foreach (array_keys($selections_array, '0') as $key) {\n unset($selections_array[$key]);\n }\n return array_values($selections_array); // reorder array\n}",
"function removeUnwanted(&$array)\n{\n unset($array[0]);\n unset($array[1]);\n}",
"function prune($ids = false, $user_id = false)\n {\n if(is_array($ids))\n {\n $sql = 'SELECT us_id AS US_ID, us_elements AS US_ELEMENTS '\n . 'FROM user_slideshows '\n . 'WHERE us_u_id = ' . intval($user_id) . ' ';\n\n $data = $this->dbh->query_all($sql);\n\n //loop through each slideshow\n foreach($data as $k => $v)\n {\n $update = false;\n\n $elements = jsonDecode($v['US_ELEMENTS']);\n // loop through the elements array\n // if $v['photoId_int'] is in the ids array\n // then unset that element\n if(is_array($elements))\n {\n foreach($elements as $k_element => $v_element)\n {\n if(in_array($v_element['photoId_int'], $ids))\n {\n // delete this element from the data array\n unset($elements[$k_element]);\n $update = true;\n }\n }\n }\n\n if($update === true)\n {\n //rewrite this slideshow\n $elements = jsonEncode($elements);\n $sql = 'UPDATE user_slideshows '\n . 'SET us_elements = ' . $this->dbh->sql_safe($elements) . ' '\n . 'WHERE us_id = ' . intval($v['US_ID']) . ' ';\n\n $this->dbh->execute($sql);\n }\n }\n }\n else\n {\n $sql = 'SELECT us_elements AS US_ELEMENTS '\n . 'FROM user_slideshows '\n . 'WHERE us_d_id = ' . intval($user_id) . ' ';\n\n $data = $this->dbh->query_all($sql);\n\n //loop through each slideshow\n foreach($data as $k => $v)\n {\n $update = false;\n $elements = jsonDecode($v['US_ELEMENTS']);\n // loop through the elements array\n // if $v['photoId_int'] is in the ids array\n // then unset that element\n if(is_array($elements))\n {\n foreach($elements as $k_element => $v_element)\n {\n if($v_element['photoId_int'] == $id)\n {\n unset($elements[$k_element]);\n $update = true;\n }\n }\n }\n\n if($update === true)\n {\n //rewrite this slideshow\n $elements = jsonEncode($elements);\n $sql = 'UPDATE user_slideshows '\n . 'SET us_elements = ' . $this->dbh->sql_safe($elements) . ' '\n . 'WHERE us_id = ' . intval($v['US_ID']) . ' ';\n\n $this->dbh->execute($sql);\n }\n }\n }\n }",
"protected function cleanDefaultsBeforeProcess() {\n\t\t$exclude = array();\n\n\t\t$data = isset($this->controller->request->data[$this->model]) ? $this->controller->request->data[$this->model] : array();\n\t\tforeach ($this->settings['advancedFilter'] as $fieldSet) {\n\t\t\tforeach ($fieldSet as $field => $fieldData) {\n\t\t\t\t$showKey = $field . '__show';\n\t\t\t\t$noneKey = $field . '__none';\n\t\t\t\t$compKey = $field . '__comp_type';\n\n\t\t\t\tif (isset($data[$showKey])) {\n\t\t\t\t\tif ($data[$showKey] === '0') {\n\t\t\t\t\t\tunset($this->controller->request->data[$this->model][$showKey]);\n\t\t\t\t\t\t$exclude[] = $showKey;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($data[$noneKey])) {\n\t\t\t\t\tif ($data[$noneKey] === '0') {\n\t\t\t\t\t\tunset($this->controller->request->data[$this->model][$noneKey]);\n\t\t\t\t\t\t$exclude[] = $noneKey;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($fieldData['filter']['method'] = 'findComplexType' && isset($data[$compKey])) {\n\t\t\t $queryClass = Inflector::classify($fieldData['type']) . 'Query';\n\t\t\t\t\tApp::uses($queryClass, 'Lib/AdvancedFilters/Query');\n\n\t\t\t\t\t$defaultComp = $queryClass::$defaultComparison;\n\n\t\t\t\t\tif ($data[$compKey] == $defaultComp) {\n\t\t\t\t\t\tunset($this->controller->request->data[$this->model][$compKey]);\n\t\t\t\t\t\t$exclude[] = $compKey;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $exclude;\n\t}",
"function lingotek_cleanup_field_collection_fields() {\n // todo: This function is MySQL-specific. Needs refactoring to be db-agnostic.\n\n $field_collection_field_types = field_read_fields(array('type' => 'field_collection'));\n $disabled_types = lingotek_get_disabled_bundles('field_collection_item');\n\n // Update all lines in field-collection field tables to be undefined,\n // ignoring duplicates, then delete all lines in field-collection\n // field tables that aren't undefined.\n\n $fc_fields_found = 0;\n $fc_dups_found = 0;\n foreach (array_keys($field_collection_field_types) as $fc_field_name) {\n $fc_langs = lingotek_cleanup_get_dirty_field_collection_fields(\"field_data_\" . $fc_field_name);\n if (!$fc_langs) {\n // No language-specific field-collection fields exist in this table\n continue;\n }\n if (in_array($fc_field_name, $disabled_types)) {\n // Lingotek does not manage this field-collection type. Abort.\n continue;\n }\n // Make sure one of each field has an undefined entry.\n // We do this by first adding the count of affected fields, and then\n // removing the remaining ones (duplicates) below, to avoid double counting\n // fields that were actually changed. (Some would already have language-\n // neutral and some would not.)\n foreach ($fc_langs as $fc_lang) {\n $fc_fields_found += (int) $fc_lang;\n }\n db_query(\"UPDATE IGNORE {field_data_\" . $fc_field_name . \"} SET language = '\" . LANGUAGE_NONE . \"'\");\n\n // Find all unnecessary fields (language-specific) for removal.\n $fc_langs = lingotek_cleanup_get_dirty_field_collection_fields(\"field_data_\" . $fc_field_name);\n // Subtract the ones that were not removed from the update above.\n foreach ($fc_langs as $dups) {\n $fc_dups_found += (int) $dups;\n $fc_fields_found -= (int) $dups;\n }\n db_query(\"DELETE FROM {field_data_\" . $fc_field_name . \"} WHERE language <> '\" . LANGUAGE_NONE . \"'\");\n db_query(\"UPDATE IGNORE {field_revision_\" . $fc_field_name . \"} SET language = '\" . LANGUAGE_NONE . \"'\");\n db_query(\"DELETE FROM {field_revision_\" . $fc_field_name . \"} WHERE language <> '\" . LANGUAGE_NONE . \"'\");\n }\n if ($fc_fields_found) {\n drupal_set_message(format_plural($fc_fields_found, t('Set 1 field-collection entry to be language neutral'), t('Set @ff field-collection entries to be language neutral.', array('@ff' => $fc_fields_found))));\n }\n if ($fc_dups_found) {\n drupal_set_message(format_plural($fc_dups_found, t('Removed 1 unnecessary language-specific field-collection entry'), t('Removed @ff unnecessary language-specific field-collection entries.', array('@ff' => $fc_dups_found))));\n }\n if (!$fc_fields_found && !$fc_dups_found) {\n drupal_set_message(t('All field-collection entries were already correctly set to be language neutral.'));\n }\n}"
] | [
"0.5684577",
"0.5581389",
"0.5529223",
"0.5395182",
"0.53199977",
"0.5312771",
"0.5264571",
"0.5242463",
"0.5219677",
"0.5201293",
"0.51923275",
"0.518278",
"0.5176548",
"0.5164029",
"0.5128723",
"0.5112503",
"0.5105027",
"0.5091654",
"0.5076048",
"0.5073176",
"0.5068283",
"0.50619394",
"0.50413495",
"0.5031693",
"0.5025263",
"0.50195163",
"0.5015258",
"0.49931988",
"0.49901202",
"0.49827033"
] | 0.6875674 | 0 |
Checks whether a section is repeatable from the given section ID. | private function isRepeatableSection( $sSectionID ) {
return isset( $this->aSections[ $sSectionID ]['repeatable'] ) && $this->aSections[ $sSectionID ]['repeatable'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isRepeatableField( $sFieldID, $sSectionID ) {\n \n return ( isset( $this->aFields[ $sSectionID ][ $sFieldID ]['repeatable'] ) && $this->aFields[ $sSectionID ][ $sFieldID ]['repeatable'] );\n \n }",
"public function isSection( $sID ) {\n \n // Integer IDs are not accepted.\n if ( is_numeric( $sID ) && is_int( $sID + 0 ) ) { return false; }\n \n // If the section ID is not registered, return false.\n if ( ! array_key_exists( $sID, $this->aSections ) ) { return false; }\n \n // the fields array's first dimension is also filled with the keys of section ids.\n if ( ! array_key_exists( $sID, $this->aFields ) ) { return false; } \n \n // Since numeric IDs are denied at the beginning of the method, the elements will not be sub-sections.\n $_bIsSeciton = false;\n foreach( $this->aFields as $_sSectionID => $_aFields ) { \n \n if ( $_sSectionID == $sID ) { $_bIsSeciton = true; }\n \n // a field using the ID is found, and it precedes a section match. \n if ( array_key_exists( $sID, $_aFields ) ) { return false; } \n \n }\n \n return $_bIsSeciton;\n \n }",
"function is_sectionpresent( $id, $docid ) {\n\t\t\tglobal $wpdb, $table_prefix;\n\t\t\t$table_name = $table_prefix.DOCUMENTORLITE_SECTIONS;\n\t\t\t$result = $wpdb->get_var( $wpdb->prepare( \"SELECT sec_id FROM $table_name WHERE post_id = %d AND doc_id = %d\", $id, $docid ) );\n\t\t\tif( $result == NULL ) { \n\t\t\t\treturn FALSE; \n\t\t\t}\n\t\t\telse { \n\t\t\t\treturn TRUE; \n\t\t\t}\t\n\t\t}",
"public function idExists($sectionId)\n {\n return (isset($this->sections[$sectionId]));\n }",
"public function hasSection(string $section): bool\n {\n return array_key_exists($section, $this->sections);\n }",
"public function containSection($section)\n {\n return isset($this->propertyData[$section]);\n }",
"public function hasSection($section) {\n foreach ($this->props as $p) {\n if (TRUE === $p->hasSection($section)) return TRUE;\n }\n\n return FALSE;\n }",
"public static function hasType($section_id,$type)\n {\n $opt = array('id'=>$section_id, 'mod'=>$type );\n $sql = 'SELECT * FROM `:prefix:sections` WHERE `section_id`=:id AND `module`=:mod';\n $sec = self::getInstance()->db()->query($sql,$opt);\n if($sec->rowCount())\n return true;\n return false;\n }",
"public static function section_is_active($section_id)\n {\n global $database;\n $now = time();\n $sql = 'SELECT COUNT(*) FROM `:prefix:sections` ';\n $sql .= 'WHERE (' . $now . ' BETWEEN `publ_start` AND `publ_end`) OR ';\n $sql .= '(' . $now . ' > `publ_start` AND `publ_end`=0) ';\n $sql .= 'AND `section_id`=' . $section_id;\n return($database->query($sql)->fetchColumn() != false);\n\t }",
"public function is_section_empty($sectionid) {\n global $DB;\n if ($DB->count_records('course_modules',\n array('course' => $this->course->id, 'section' => $sectionid))) {\n return false;\n }\n return true;\n }",
"public function isDuplicateSection($identity = null, $id = null) {\n if (!empty($identity)) {\n $params = [];\n $params[] = $identity;\n $sql = \"SELECT *\n FROM `{$this->tableSections}`\n WHERE `identity` = ?\";\n if (!Helper::isEmpty($id)) {\n $params[] = $id;\n $sql .= \" AND `id` = ?\";\n }\n $result = $this->Db->fetchAll($sql, $params);\n return (!empty($result)) ? true : false;\n }\n return false;\n }",
"private function checkSheetID($id){\n\t\tforeach($this->sheets as $sheet){\n\t\t\t$sheetID = $sheet->getID();\n\t\t\tif ($id == $sheetID){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"private function valid_section($section){\n\t\tswitch ($section) {\n\t\t\tcase \"highscore\":\n\t\t\tcase \"alliances\":\n\t\t\tcase \"players\":\n\t\t\tcase \"playerData\":\n\t\t\tcase \"universe\":\n\t\t\tcase \"serverData\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false; // if the name isn'T a valid section, stop here.\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function isSection()\n {\n return ($this->section && !$this->docname);\n }",
"public static function isSectionGroup($group) {\n\t\treturn !empty($group['sectionId']);\n\t}",
"private static function containsContentType($section, $type) {\n\t\treturn intval($section['contentType']['id'], 10) === $type;\n\t}",
"public function hasSections()\n {\n return null !== @$this->sections;\n }",
"public function hasSection($name){\n return isset(self::$section[$name]);\n }",
"protected function validateSectionsForSite($section, $subsection='',$language=''){\n \n $data = $this->getItemFromCache($this->sess->siteId . self::CACHE_KEY_COMPONENT_NO_DATA);\n \n if($data !== false && empty($data))\n return true;\n \n $cacheKeySection = $this->prependSiteIdPrefix() . self::CACHE_KEY_COMPONENT_SECTION_SUFFIX;\n $componentSections = $this->getItemFromCache($cacheKeySection);\n \n if($componentSections != null && !array_key_exists($section, $componentSections))\n return true;\n if($subsection != '' && $componentSections[$section]['subSections'] != null && !in_array($section, $componentSections[$section]['subSections']))\n return true;\n if($language != '' && $componentSections[$section]['language'] != null && !in_array($language, $componentSections[$section]['language']))\n return true;\n \n return false;\n }",
"public function isSection()\n {\n return false;\n }",
"public function checkSectionCategory(&$row, $include, $sections=array(), $catids=array(), $contentids=array()) {\r\n\t\t/* doc id excluded ? */\r\n\t\tif (in_array((($row->id == 0) ? -1 : $row->id), $contentids))\r\n\t\t\treturn false;\r\n\r\n\t\t/* category included or excluded ? */\r\n\t\t$result = in_array((($row->catid == 0) ? -1 : $row->catid), $catids);\r\n\t\tif (($include && !$result) || (!$include && $result))\r\n\t\t\treturn false; /* include and not found OR exclude and found */\r\n\r\n\t\treturn true;\r\n\t}",
"protected function isShowSectionHeader($section)\n {\n return parent::isShowSectionHeader($section) && !in_array($section, array(self::SECTION_SUMMARY));\n }",
"public final function isRepeatable() {\n\t\treturn $this->_isRepeatable;\n\t}",
"public function hasSection($sectionName)\n {\n return in_array($sectionName, $this->sectionNames);\n }",
"function check_section($key=''){\n\tglobal $wpdb;\n\t$result=false;\n\t$table=$wpdb->prefix .'cts_sections';\n\t$rows = $wpdb->get_results( \"SELECT * FROM $table where `key`='$key'\");\n\tif(!empty($rows)){\n\t\t$result=true;\n\t}\n\treturn $result;\n}",
"private function addConditionForSection() {\n $whereSectionUids = array();\n foreach(t3lib_div::trimExplode(',', $this->input['section']) as $section) {\n $whereSectionUids = array_merge($whereSectionUids, $this->getUIDsForSection($section));\n }\n $whereSectionUids = array_unique($whereSectionUids); // Remove duplicate section uids\n\n if (empty($whereSectionUids)) {\n $this->table_references = array('tx_newspaper_article'); // Reset table array\n $this->where = array('false'); // Unknown sections, so no article available for this search query\n return false; // No matching section found, so no article in search result\n }\n\n $this->addTableReference('JOIN tx_newspaper_article_sections_mm ON tx_newspaper_article.uid = tx_newspaper_article_sections_mm.uid_local');\n $this->addWhere('tx_newspaper_article_sections_mm.uid_foreign IN (' . implode(',', $whereSectionUids) . ')');\n\n return true;\n }",
"function mpo_section_exists () {\n global $wpdb;\n if ($this->section_identifier) {\n $res = $wpdb->get_row( $wpdb->prepare(\"SELECT section_name, section_meta_key, section_meta_value, length FROM {$wpdb->prefix}sections WHERE section_identifier = %s\", $this->section_identifier) );\n return $res;\n }\n }",
"protected function isShowSectionHeader($section)\n {\n return !in_array($section, array(self::SECTION_DEFAULT, self::SECTION_HIDDEN));\n }",
"public function duplicateSection($name = null, $id = null) {\n if (!empty($name)) {\n $params = [];\n $params[] = $name;\n $sql = \"SELECT *\n FROM `{$this->tableSections}`\n WHERE `name` = ?\";\n if (!Helper::isEmpty($id)) {\n $params[] = $id;\n $sql .= \" AND `id` = ?\";\n }\n return $this->Db->fetchOne($sql, $params);\n }\n return false;\n }",
"public function sectionExists(Product $product, string $version, string $page): bool;"
] | [
"0.7207018",
"0.6736432",
"0.6632722",
"0.6602915",
"0.6216111",
"0.62131524",
"0.6086567",
"0.60380995",
"0.60149074",
"0.5949861",
"0.5944562",
"0.5794515",
"0.5786709",
"0.5711765",
"0.567212",
"0.5597056",
"0.55790085",
"0.5561474",
"0.55232584",
"0.55210096",
"0.5503837",
"0.5495748",
"0.54883206",
"0.5483176",
"0.54715055",
"0.54369855",
"0.54074484",
"0.5406738",
"0.5393637",
"0.5392689"
] | 0.8074665 | 0 |
Checks whether a field is repeatable from the given field ID. | private function isRepeatableField( $sFieldID, $sSectionID ) {
return ( isset( $this->aFields[ $sSectionID ][ $sFieldID ]['repeatable'] ) && $this->aFields[ $sSectionID ][ $sFieldID ]['repeatable'] );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function is_repeat_limit_reached_for_field( $field ) {\n\t\tif ( ! isset( $field['repeat_limit'] ) || $field['repeat_limit'] !== '' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $field['value'] ) ) {\n\t\t\t$row_count = 1;\n\t\t} else if ( isset( $field['value']['row_ids'] ) ) {\n\t\t\tif ( is_array( $field['value']['row_ids'] ) ) {\n\t\t\t\t$row_count = count( $field['value']['row_ids'] );\n\t\t\t} else {\n\t\t\t\t$row_count = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t// When editing an entry, the value will be an array of child IDs on initial load\n\t\t\t$row_count = count( $field['value'] );\n\t\t}\n\n\t\treturn self::is_repeat_limit_reached( $field['repeat_limit'], $row_count );\n\t}",
"private function checkPersId($id, $field) {\n if (!$this->checkId($id, $field)) {\n return FALSE;\n } else {\n // Look up in type pers id for existance\n }\n return TRUE;\n }",
"public function hasField($fieldId){\n\t\tif(isset($this->fields[$fieldId])){\n\t\t\treturn true;\n\t\t}\n\t}",
"public function fieldExists($strField);",
"function fieldExists($field);",
"public function hasField($field);",
"public function hasField($field);",
"private function isRepeatableSection( $sSectionID ) {\n \n return isset( $this->aSections[ $sSectionID ]['repeatable'] ) && $this->aSections[ $sSectionID ]['repeatable'];\n \n }",
"protected function _checkDupFieldname($fieldname,$do_id)\n {\n $dataobj = BizSystem::GetObject($this->m_ReportFieldDO,1);\t\n $records = $dataobj->directFetch(\"[column]='$fieldname' AND [do_id]='$do_id'\",1);\n if (count($records)>=1)\n return true;\n return false;\n }",
"public function isReadable($field)\n {\n return $this->readable == null || $field == $this->uniqueField || in_array($field, $this->readable);\n }",
"public function fieldExists($strField)\n {\n return false;\n }",
"function has_sub_field( $field_name, $post_id = false ) {\n\n\t// vars\n\t$r = have_rows( $field_name, $post_id );\n\n\t// if has rows, progress through 1 row for the while loop to work\n\tif ( $r ) {\n\n\t\tthe_row();\n\n\t}\n\n\t// return\n\treturn $r;\n\n}",
"protected function checkFieldExist($field)\n {\n\treturn ((in_array($field, $this->builderFields)) ? true : false);;\n }",
"public final function isRepeatable() {\n\t\treturn $this->_isRepeatable;\n\t}",
"public function fieldExists($field_name)\n {\n return isset($this->fields[$field_name]) && $this->fields[$field_name] instanceof Field;\n }",
"public function has(string $id): bool\n {\n return array_key_exists($id, $this->fields) && ! empty($this->fields[$id]);\n }",
"function acf_is_field( $field, $selector = '' ) {\n\t\n\t// vars\n\t$keys = array(\n\t\t'ID',\n\t\t'name',\n\t\t'key',\n\t\t'_name',\n\t\t'__name',\n\t);\n\t\n\t\n\t// loop\n\tforeach( $keys as $k ) {\n\t\t\n\t\tif( isset($field[ $k ]) && $field[ $k ] === $selector ) return true;\n\t\t\n\t}\n\t\n\t\n\t// return\n\treturn false;\n\t\n}",
"public function isReadOnlyField($field)\n {\n $field = $this->getField($field);\n\n if ($field['fieldType'] == 'once') {\n return true;\n } else {\n return false;\n }\n }",
"public static function isApplicable(FieldDefinitionInterface $field_definition);",
"private function isUnique($field)\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query\n\t\t\t->select($db->quoteName($field))\n\t\t\t->from($db->quoteName($this->_tbl))\n\t\t\t->where($db->quoteName($field) . ' = ' . $db->quote($this->$field))\n\t\t\t->where($db->quoteName('id') . ' <> ' . (int)$this->{$this->_tbl_key});\n\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn ($db->getNumRows() == 0) ? true : false;\n\t}",
"public function has(IField $field)\n {\n // @todo Do a instance-equality check instead of just checking names?\n return isset($this->fields[$field->getName()]);\n }",
"function id_check($id) {\n $idData = $this->Webapi_model->idexists($id);\n\n if (!empty($idData)) {\n return TRUE;\n } else {\n $this->form_validation->set_message('id_check', 'The id field must contain an Existing Value.');\n\n return False;\n }\n }",
"public function hasField($field)\n {\n return in_array($field, $this->fields);\n }",
"public function hasField($name);",
"public function isField($key,$val){\n $ret_bool = false;\n if($this->existsField($key)){\n $ret_bool = $this->getField($key) == $val;\n }//if\n return $ret_bool;\n }",
"public function isField($key,$val){\n $ret_bool = false;\n if($this->existsField($key)){\n $ret_bool = $this->getField($key) == $val;\n }//if\n return $ret_bool;\n }",
"public function _fieldExists($table,$field)\n\t{\n\t\treturn true;\n\t}",
"public function hasFieldInfo($field_name);",
"public function isFieldExist(int $type): bool\n\t{\n\t\treturn (bool)$this->getFieldCollection()->getItemByType($type);\n\t}",
"public function hasField(string $name) : bool;"
] | [
"0.67707473",
"0.63633174",
"0.6340219",
"0.63135403",
"0.62905186",
"0.60694623",
"0.60694623",
"0.6027873",
"0.6001075",
"0.59639245",
"0.5932288",
"0.59118885",
"0.5888081",
"0.58865404",
"0.58509666",
"0.58417183",
"0.5825182",
"0.57933444",
"0.57916033",
"0.57655",
"0.5763781",
"0.574297",
"0.57378983",
"0.57254624",
"0.5718967",
"0.5718967",
"0.56935567",
"0.5688253",
"0.56573915",
"0.5649911"
] | 0.78899646 | 0 |
Determines whether the given ID is of a registered form section. Consider the possibility that the given ID may be used both for a section and a field. 1. Check if the given ID is not a section. 2. Parse stored fields and check their ID. If one matches, return false. | public function isSection( $sID ) {
// Integer IDs are not accepted.
if ( is_numeric( $sID ) && is_int( $sID + 0 ) ) { return false; }
// If the section ID is not registered, return false.
if ( ! array_key_exists( $sID, $this->aSections ) ) { return false; }
// the fields array's first dimension is also filled with the keys of section ids.
if ( ! array_key_exists( $sID, $this->aFields ) ) { return false; }
// Since numeric IDs are denied at the beginning of the method, the elements will not be sub-sections.
$_bIsSeciton = false;
foreach( $this->aFields as $_sSectionID => $_aFields ) {
if ( $_sSectionID == $sID ) { $_bIsSeciton = true; }
// a field using the ID is found, and it precedes a section match.
if ( array_key_exists( $sID, $_aFields ) ) { return false; }
}
return $_bIsSeciton;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_sectionpresent( $id, $docid ) {\n\t\t\tglobal $wpdb, $table_prefix;\n\t\t\t$table_name = $table_prefix.DOCUMENTORLITE_SECTIONS;\n\t\t\t$result = $wpdb->get_var( $wpdb->prepare( \"SELECT sec_id FROM $table_name WHERE post_id = %d AND doc_id = %d\", $id, $docid ) );\n\t\t\tif( $result == NULL ) { \n\t\t\t\treturn FALSE; \n\t\t\t}\n\t\t\telse { \n\t\t\t\treturn TRUE; \n\t\t\t}\t\n\t\t}",
"private function valid_section($section){\n\t\tswitch ($section) {\n\t\t\tcase \"highscore\":\n\t\t\tcase \"alliances\":\n\t\t\tcase \"players\":\n\t\t\tcase \"playerData\":\n\t\t\tcase \"universe\":\n\t\t\tcase \"serverData\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false; // if the name isn'T a valid section, stop here.\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static function hasType($section_id,$type)\n {\n $opt = array('id'=>$section_id, 'mod'=>$type );\n $sql = 'SELECT * FROM `:prefix:sections` WHERE `section_id`=:id AND `module`=:mod';\n $sec = self::getInstance()->db()->query($sql,$opt);\n if($sec->rowCount())\n return true;\n return false;\n }",
"public function idExists($sectionId)\n {\n return (isset($this->sections[$sectionId]));\n }",
"public function has(string $id): bool\n {\n return array_key_exists($id, $this->fields) && ! empty($this->fields[$id]);\n }",
"public function containSection($section)\n {\n return isset($this->propertyData[$section]);\n }",
"protected function validateSectionsForSite($section, $subsection='',$language=''){\n \n $data = $this->getItemFromCache($this->sess->siteId . self::CACHE_KEY_COMPONENT_NO_DATA);\n \n if($data !== false && empty($data))\n return true;\n \n $cacheKeySection = $this->prependSiteIdPrefix() . self::CACHE_KEY_COMPONENT_SECTION_SUFFIX;\n $componentSections = $this->getItemFromCache($cacheKeySection);\n \n if($componentSections != null && !array_key_exists($section, $componentSections))\n return true;\n if($subsection != '' && $componentSections[$section]['subSections'] != null && !in_array($section, $componentSections[$section]['subSections']))\n return true;\n if($language != '' && $componentSections[$section]['language'] != null && !in_array($language, $componentSections[$section]['language']))\n return true;\n \n return false;\n }",
"public function is_section_empty($sectionid) {\n global $DB;\n if ($DB->count_records('course_modules',\n array('course' => $this->course->id, 'section' => $sectionid))) {\n return false;\n }\n return true;\n }",
"private function isRepeatableSection( $sSectionID ) {\n \n return isset( $this->aSections[ $sSectionID ]['repeatable'] ) && $this->aSections[ $sSectionID ]['repeatable'];\n \n }",
"public function isDuplicateSection($identity = null, $id = null) {\n if (!empty($identity)) {\n $params = [];\n $params[] = $identity;\n $sql = \"SELECT *\n FROM `{$this->tableSections}`\n WHERE `identity` = ?\";\n if (!Helper::isEmpty($id)) {\n $params[] = $id;\n $sql .= \" AND `id` = ?\";\n }\n $result = $this->Db->fetchAll($sql, $params);\n return (!empty($result)) ? true : false;\n }\n return false;\n }",
"private function isRepeatableField( $sFieldID, $sSectionID ) {\n \n return ( isset( $this->aFields[ $sSectionID ][ $sFieldID ]['repeatable'] ) && $this->aFields[ $sSectionID ][ $sFieldID ]['repeatable'] );\n \n }",
"public static function isSectionGroup($group) {\n\t\treturn !empty($group['sectionId']);\n\t}",
"function mpo_section_exists () {\n global $wpdb;\n if ($this->section_identifier) {\n $res = $wpdb->get_row( $wpdb->prepare(\"SELECT section_name, section_meta_key, section_meta_value, length FROM {$wpdb->prefix}sections WHERE section_identifier = %s\", $this->section_identifier) );\n return $res;\n }\n }",
"public function hasSection(string $section): bool\n {\n return array_key_exists($section, $this->sections);\n }",
"public function hasSection($section) {\n foreach ($this->props as $p) {\n if (TRUE === $p->hasSection($section)) return TRUE;\n }\n\n return FALSE;\n }",
"function check_section($key=''){\n\tglobal $wpdb;\n\t$result=false;\n\t$table=$wpdb->prefix .'cts_sections';\n\t$rows = $wpdb->get_results( \"SELECT * FROM $table where `key`='$key'\");\n\tif(!empty($rows)){\n\t\t$result=true;\n\t}\n\treturn $result;\n}",
"public function isSection()\n {\n return ($this->section && !$this->docname);\n }",
"public function isConfigured(array $keys, string $section): bool;",
"public function is_section(): bool {\n\t\t/**\n\t\t * Filters the step is_section flag.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param bool $is_section Step is_section flag.\n\t\t * @param Step $step Step object.\n\t\t *\n\t\t * @ignore\n\t\t */\n\t\treturn (bool) apply_filters( 'learndash_template_step_is_section', $this->is_section, $this );\n\t}",
"public function sectionExists(Product $product, string $version, string $page): bool;",
"function bbp_admin_get_settings_fields_for_section($section_id = '')\n{\n}",
"public function isReady ($id = null) {\n\t\tif (!$this->valid($id)) return false;\n\t\treturn $this->field('section_id') != 0 && $this->field('course_type_id') != 0;\n\t}",
"public function isSection()\n {\n return false;\n }",
"public static function section_is_active($section_id)\n {\n global $database;\n $now = time();\n $sql = 'SELECT COUNT(*) FROM `:prefix:sections` ';\n $sql .= 'WHERE (' . $now . ' BETWEEN `publ_start` AND `publ_end`) OR ';\n $sql .= '(' . $now . ' > `publ_start` AND `publ_end`=0) ';\n $sql .= 'AND `section_id`=' . $section_id;\n return($database->query($sql)->fetchColumn() != false);\n\t }",
"public function duplicateSection($name = null, $id = null) {\n if (!empty($name)) {\n $params = [];\n $params[] = $name;\n $sql = \"SELECT *\n FROM `{$this->tableSections}`\n WHERE `name` = ?\";\n if (!Helper::isEmpty($id)) {\n $params[] = $id;\n $sql .= \" AND `id` = ?\";\n }\n return $this->Db->fetchOne($sql, $params);\n }\n return false;\n }",
"private function addConditionForSection() {\n $whereSectionUids = array();\n foreach(t3lib_div::trimExplode(',', $this->input['section']) as $section) {\n $whereSectionUids = array_merge($whereSectionUids, $this->getUIDsForSection($section));\n }\n $whereSectionUids = array_unique($whereSectionUids); // Remove duplicate section uids\n\n if (empty($whereSectionUids)) {\n $this->table_references = array('tx_newspaper_article'); // Reset table array\n $this->where = array('false'); // Unknown sections, so no article available for this search query\n return false; // No matching section found, so no article in search result\n }\n\n $this->addTableReference('JOIN tx_newspaper_article_sections_mm ON tx_newspaper_article.uid = tx_newspaper_article_sections_mm.uid_local');\n $this->addWhere('tx_newspaper_article_sections_mm.uid_foreign IN (' . implode(',', $whereSectionUids) . ')');\n\n return true;\n }",
"public function hasSections()\n {\n return null !== @$this->sections;\n }",
"public function isValid()\n {\n if ( !empty($this->formId)) {\n return true;\n }\n return false;\n }",
"public function findSection($section)\n {\n return $this->sectionMap[$section] ?? false;\n }",
"private static function containsContentType($section, $type) {\n\t\treturn intval($section['contentType']['id'], 10) === $type;\n\t}"
] | [
"0.6826027",
"0.6111914",
"0.60935426",
"0.6051518",
"0.58765274",
"0.57850826",
"0.5767945",
"0.5744877",
"0.5715378",
"0.5700633",
"0.569178",
"0.56427425",
"0.5638947",
"0.5600224",
"0.55969614",
"0.55839497",
"0.5541761",
"0.5417991",
"0.5414596",
"0.540659",
"0.5390902",
"0.53872585",
"0.53826964",
"0.5363594",
"0.5357274",
"0.5326953",
"0.53097796",
"0.53089935",
"0.52779627",
"0.5271154"
] | 0.75880426 | 0 |
Returns a fields model array that represents the structure of the array of saving data from the given fields definition array. The passed fields array should be structured like the following. This is used for page meta boxes. array( '_default' => array( // _default is reserved for the system. 'my_field_id' => array( .... ), 'my_field_id2' => array( .... ), ), 'my_secion_id' => array( 'my_field_id' => array( ... ), 'my_field_id2' => array( ... ), 'my_field_id3' => array( ... ), ), 'my_section_id2' => array( 'my_field_id' => array( ... ), ), ... ) It will be converted to array( 'my_field_id' => array( .... ), 'my_field_id2' => array( .... ), 'my_secion_id' => array( 'my_field_id' => array( ... ), 'my_field_id2' => array( ... ), 'my_field_id3' => array( ... ), ), 'my_section_id2' => array( 'my_field_id' => array( ... ), ), ... ) | public function getFieldsModel( array $aFields=array() ) {
$_aFieldsModel = array();
$aFields = empty( $aFields )
// @todo examine whether it should be the $this->aConditionedFields property rather than $this->aFields
? $this->aFields
: $aFields;
foreach ( $aFields as $_sSectionID => $_aFields ) {
if ( $_sSectionID != '_default' ) {
$_aFieldsModel[ $_sSectionID ] = $_aFields;
// $_aFieldsModel[ $_sSectionID ][ $_aField['field_id'] ] = $_aField;
continue;
}
// For default field items.
foreach( $_aFields as $_sFieldID => $_aField ) {
$_aFieldsModel[ $_aField['field_id'] ] = $_aField;
}
}
return $_aFieldsModel;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _fields($fields) { // fields as array\n if (! $fields)\n return [];\n if (! is_array($fields))\n $fields = explode(\" \", $fields);\n $T = $this->type;\n // if (! $T)\n // return $fields;\n if (isset($fields[0])) { // list of fields\n $r=[];\n foreach($fields as $f) {\n if (isset($T[$f]) && ($t = $T[$f]) && is_array($t) && $t[0]=='alias')\n $r[]=$t[1];\n else\n $r[] = $f;\n }\n return $r;\n }\n // field => t/f case\n $r=[];\n foreach($fields as $f => $v) {\n if (isset($T[$f]) && ($t = $T[$f]) && is_array($t) && $t[0]=='alias')\n $r[$t[1]] = $v;\n else\n $r[$f] = $v;\n }\n return $r;\n }",
"public function get_general_fields( $fields=[] ){\n\t\t\n\t\t$fields['nickname'] = array(\n\n\t\t\t'id' \t\t\t=> 'nickname',\n\t\t\t'label'\t\t\t=> 'Nickname',\n\t\t\t'description'\t=> '',\n\t\t\t'placeholder'\t=> 'Nickname',\n\t\t\t'type'\t\t\t=> 'text',\n\t\t\t'required'\t\t=> true\n\t\t);\n\t\t\n\t\t$fields['description'] = array(\n\n\t\t\t'id' \t\t\t=> 'description',\n\t\t\t'label'\t\t\t=> 'About me',\n\t\t\t'description'\t=> '',\n\t\t\t'placeholder'\t=> '',\n\t\t\t'type'\t\t\t=> 'textarea'\n\t\t);\n\t\t\n\t\t$fields['user_url'] = array(\n\t\t\n\t\t\t'id' \t\t\t=> 'user_url',\n\t\t\t'label'\t\t\t=> 'Web Site',\n\t\t\t'description'\t=> '',\n\t\t\t'placeholder'\t=> 'http://',\n\t\t\t'type'\t\t\t=> 'url'\t\t\t\n\t\t);\n\t\t\n\t\treturn $fields;\n\t}",
"private static function getFixedFieldsArray($p_fields){\n\tif(isset($p_fields) && is_array($p_fields) && count($p_fields)>0){\n\t\tforeach($p_fields as $k=>$v){\n\t\t\tif(is_array($v)){\n\t\t\t\t$x['value']=$v['value'];\n\t\t\t\t$x['type']=strtolower(trim($v['type']));\n\t\t\t\tif('datetime'==$x['type']) $x['value']=self::getMysqlFormatedDateTime($v['value']);\n\t\t\t\tif('date'==$x['type']) $x['value']=self::getMysqlFormatedDate($v['value']);\n\t\t\t\tif('time'==$x['type']) $x['value']=self::getMysqlFormatedTime($v['value']);\n\t\t\t\tif('datetime'==$x['type'] || 'date'==$x['type'] || 'time'==$x['type']) $x['type']='string';\n\t\t\t\tif('now'==$x['type']) $x['value']='now()';\n\t\t\t}else $x=array('type'=>'string', 'value'=>$v);\n\t\t\tif(is_null($x['value']) || strlen($x['value'])<=0){\n\t\t\t\t$x['type']='null';\n\t\t\t\t$x['value']='NULL';\n\t\t\t}\n\t\t\t$f_fields[$k]=$x;\n\t\t}\n\t\treturn $f_fields;\n\t}\n}",
"function parseFields( $fields ) {\n\n $allFields = explode(',', $fields );\n\n $allFieldArr = [];\n\n foreach( $allFields as $field ) {\n $thisFieldArr = explode(':', $field );\n list($name, $type) = $thisFieldArr;\n\n $fieldDetail = $type;\n\n if ( str_contains( $type, 'fr-' ) ) {\n $fieldDetail = \"int\";\n $this->foreignKeyArr[ trim($name) ] = $type;\n\n }\n $allFieldArr[ trim($name)] = $fieldDetail;\n\n }\n\n $this->fieldArr = $allFieldArr;\n\n }",
"protected function fieldsFromModel(array $fields)\n {\n $fieldNames = array_keys(Arr::except($fields, []));\n $pkName = $this->pkName;\n\n $fields = [$pkName => $this->model->$pkName];\n foreach ($fieldNames as $field) {\n $fields[$field] = $this->model->{$field};\n }\n\n return $fields;\n }",
"public function buildFieldDefinitions() {\n $fields = [];\n return $fields;\n }",
"public function fields(array $fields)\n{\n\t$a='attributes';$t='type';foreach($fields as$f=>&$o){$o=$o+array('label'=>ucwords($f),'value'=>post($f),$t=>'text',$a=>array('id'=>$f,'name'=>$f));if($o[$t]!='select'&&$o[$t]!='textarea'){$o[$a][$t]=$o[$t];$o[$t]='input';}}$this->fields=$fields;\n}",
"public function process_fields($fields) {\n foreach ($fields as $key => $value) {\n if ($value['type'] == 'datalist' || $value['type'] == 'dataSelect') {\n switch ($value['search']) {\n case 'users':\n $users = User::whereNull('play_id')->\n orderby('name', 'ASC')->pluck('name', 'id');\n $result = $users;\n break;\n }\n if ($value['type'] == 'dataSelect') {\n $value['arraykeyval'] = $result;\n } else {\n $value = $result;\n }\n }\n $list[$key] = $value;\n }\n return $list;\n }",
"public static function getFieldsForTable($fields)\n\t{\n\t\treturn [\n\t\t\t'TEMPLATE_ID' => $fields['ENTITY_ID'],\n\t\t\t'TITLE' => $fields['TITLE'],\n\t\t\t'SORT_INDEX' => $fields['SORT_INDEX'],\n\t\t\t'IS_COMPLETE' => $fields['IS_COMPLETE'],\n\t\t\t'IS_IMPORTANT' => $fields['IS_IMPORTANT'],\n\t\t];\n\t}",
"public function processDataFields($fields){\n $result = [];\n foreach($fields as $field){\n if($field[1] == 'text'){\n $result[$field[2]] = $this->processTextFields($field[0]);\n } else {\n $result[$field[2]] = $this->processAttrFields($field[0], $field[1]);\n }\n }\n return $result;\n }",
"public function buildFieldDefinitions();",
"private function _createFields($fields, $editData = array(), $returnFields = false)\n {\n // Remember created fields?\n if ($returnFields) {\n $fieldsInformation = array();\n }\n // Process the field groups first\n foreach ($fields as $fieldGroupName => $fieldGroupFields) {\n // Get field group ID\n $fieldGroupId = $this->_getFieldGroupId($fieldGroupName);\n // Process each field inside a field group\n foreach ($fieldGroupFields as $field) {\n // Remember current name if we need to return it\n if ($returnFields) {\n $nameBeforeEdit = $field['name'];\n }\n\n // Only install the field if we have to\n if (! $returnFields && count($this->_installFields) && ! in_array($field['name'], $this->_installFields)) {\n continue;\n }\n\n // Translations\n $vars = array(\n 'fieldName' => $field['name'],\n 'fieldType' => $field['type']\n );\n\n // Only install fields of which the type actually exists\n if (! isset($this->_currentFieldTypes[ $field['type'] ])) {\n AmInstallerPlugin::log(Craft::t('Skip creating the `{fieldName}` field, because the type `{fieldType}` doesn\\'t exist.', $vars));\n continue;\n }\n\n // Edit field before we continue?\n if (isset($field['for']) && isset($editData[ $field['for'] ]) && ! is_null($editData[ $field['for'] ])) {\n // Remember old name\n if ($returnFields) {\n $nameBeforeEdit = $field['name'];\n }\n // Get data from installed section\n $foundEditData = $editData[ $field['for'] ];\n // Translations\n $vars = array(\n 'sectionId' => $foundEditData->id,\n 'sectionName' => $foundEditData->name\n );\n $addSpaceForHandle = substr($field['handle'], 0, 1) != '{';\n $field['name'] = Craft::t($field['name'], $vars);\n // Add fieldName to translations\n $vars['fieldName'] = $addSpaceForHandle ? ' ' . $field['name'] : $field['name']; // Add a space for proper camelString convert on the handle\n // Edit the field handle\n $field['handle'] = $this->_camelString(Craft::t($field['handle'], $vars));\n // Edit the field instructions\n if (isset($field['instructions'])) {\n $field['instructions'] = Craft::t($field['instructions'], $vars);\n }\n // Edit the field value\n if (isset($field['value'])) {\n $field['value'] = Craft::t($field['value'], $vars);\n }\n }\n\n // Reset translations\n $vars = array(\n 'fieldName' => $field['name']\n );\n\n // Check whether the field already exists\n if (in_array($field['handle'], $this->_currentFields)) {\n AmInstallerPlugin::log(Craft::t('Skip creating the `{fieldName}` field, because it already exists.', $vars));\n continue;\n }\n\n // Create a new field\n AmInstallerPlugin::log(Craft::t('Creating the `{fieldName}` field.', $vars));\n\n $newField = new FieldModel();\n $newField->groupId = $fieldGroupId;\n $newField->name = $field['name'];\n $newField->handle = $field['handle'];\n $newField->translatable = isset($field['translatable']) ? $field['translatable'] : true;\n $newField->type = $field['type'];\n if (isset($field['instructions'])) {\n $newField->instructions = $field['instructions'];\n }\n if (isset($field['settings'])) {\n // Check whether it's an Entries field type, which is connected to a section that might not exist\n if ($newField->type == 'Entries' && isset($field['settings']['section'])) {\n $sectionId = array_search($field['settings']['section'], $this->_currentSections);\n if ($sectionId) {\n $sectionId = explode('-', $sectionId);\n $sectionId = $sectionId[0];\n $field['settings']['sources'] = array('section:' . $sectionId);\n }\n }\n $newField->settings = $field['settings'];\n }\n if (craft()->fields->saveField($newField)) {\n $this->_currentFields[$newField->id] = $newField->handle; // Add to current fields\n $this->_currentFieldsTypes[$newField->handle] = $newField->type; // Add to current fields types\n // Add to fields information for returning\n if ($returnFields) {\n $fieldsInformation[$nameBeforeEdit] = array(\n 'handle' => $newField->handle\n );\n if (isset($field['value'])) {\n $fieldsInformation[$nameBeforeEdit]['value'] = $field['value'];\n }\n }\n // Add Matrix Fields\n if ($newField->type == 'Matrix' && isset($field['settings']['blockTypes'])) {\n foreach ($field['settings']['blockTypes'] as $blockType) {\n foreach ($blockType['fields'] as $field) {\n $this->_currentFields[ 'MatrixBlock-' . $newField->id ] = $field['handle']; // Add to current fields\n $this->_currentFieldsTypes[ 'MatrixBlock-' . $newField->handle ] = $field['type']; // Add to current fields types\n }\n }\n }\n AmInstallerPlugin::log(Craft::t('Field `{fieldName}` created successfully.', $vars));\n } else {\n AmInstallerPlugin::log(Craft::t('Could not save the `{fieldName}` field.', $vars), LogLevel::Warning);\n }\n }\n }\n // Return information of created fields\n if ($returnFields) {\n return $fieldsInformation;\n }\n }",
"function getModelFields() {\n $fields = parent::getModelFields();\n foreach ($fields as $key => &$field) {\n switch ($key){\n case false:break;//needed\n case 'field10':\n case 'field11':\n case 'field12':\n case 'field13':\n case 'field14':\n case 'field15':\n case 'field16':\n case 'field17':\n case 'field18':\n $field['type'] = 'boolean';\n unset($field['useNull']);\n break;\n }\n }\n \n $fields['created'] = array(\n 'name' => 'created',\n 'type' => 'date', \n 'dateFormat' => 'Y-m-d H:i:s',\n 'persist' => 1,\n );\n \n return $fields;\n }",
"protected function setFields(array $fields)\n {\n $this->fields = $fields;\n\n foreach ($this->fields as $field_name => $field) {\n if ($field->isMapped()) {\n $this->mapped_fields[] = $field_name;\n }\n\n if ($field->isUnique()) {\n $this->unique_fields[] = $field_name;\n }\n\n if ($field->isProtected()) {\n $this->protected_fields[] = $field_name;\n }\n }\n }",
"public function save_fields() {\n\n\t\t$update_array = array(\n\t\t\t'call_id'\t\t\t\t=> $this->call_id, \n\t\t\t'current'\t\t\t\t=> $this->current, \n\t\t\t'updated_by'\t\t\t=> $this->updated_by,\n\t\t\t'tlc_assigned_to'\t\t=> $this->tlc_assigned_to,\n\t\t\t'its_assigned_group'\t=> $this->its_assigned_group,\n\t\t\t'comments'\t\t\t=> $this->comments,\n\t\t\t'datetime_assigned'\t\t=> $this->datetime_assigned,\n\t\t\t'date_assigned'\t\t=> $this->date_assigned,\n\t\t\t'time_assigned'\t\t=> $this->time_assigned,\n\t\t\t'call_status'\t\t\t=> $this->call_status,\n\t\t\t'call_priority'\t\t=> $this->call_priority,\n\t\t);\n\n\t\treturn $update_array;\n\t}",
"protected function prepareFields(array $fields)\n { \n return Collection::make($fields)->map(function($field) { \n return $field instanceof MergeValue \n ? $this->prepareFields($field->data) \n : [$field];\n })->flatten()->filter([$this, 'supporting'])->map([\n $this, 'prepareTranslationsFields'\n ])->flatten(1);\n }",
"function default_meta($fields){\n\n $out='';\n\n foreach ($fields as $obj){\n //echo_array($obj);\n $out=$this->standard_mapping($obj);\n //echo_array($z);exit;\n // first check to see if there is a key\n $key=$this->is_key($obj);\n if (isset($key)){\n $value=$key;\n }\n else\n {\n $value=NULL;\n }\n\n $out[$obj['name']]['key']=$key;\n //$out[$obj['name']]['input']='text_input';\n //up the field count\n $t[]=$out;\n\n }\n\n //set var\n $this->set_meta_field_spec($t);\n\n //echo_array($out);//exit;\n //echo_array($t);//exit;\n return $t;\n }",
"public function getFields() {\n $defaults = array(\n 'type' => 'string',\n 'crop' => '20',\n 'format'=> 'default',\n );\n \n // TODO move to yaml format\n $fields = array(\n array(\n 'name' => 'Nachname',\n 'property' => 'lastname'\n ),\n array(\n 'name' => 'Vorname',\n 'property' => 'firstname',\n ),\n array(\n 'name' => 'Geburtstag',\n 'property' => 'birthdate',\n 'format' => 'date' \n ),\n array(\n 'name' => 'Telefon',\n 'property' => 'phone',\n ),\n array(\n 'name' => 'Mobil',\n 'property' => 'cellphone',\n 'crop' => false,\n ),\n array(\n 'name' => 'Strasse',\n 'property' => 'str1',\n 'type' => 'string'\n ),\n array(\n 'name' => 'PLZ',\n 'property' => 'zip',\n 'type' => 'string'\n ),\n array(\n 'name' => 'City',\n 'property' => 'city',\n 'type' => 'string'\n ),\n array(\n 'name' => 'Email',\n 'property' => 'email',\n 'type' => 'string',\n 'format' => 'link.email'\n ),\n array(\n 'name' => 'Website',\n 'property' => 'website',\n 'format' => 'link.action'\n ),\n array(\n 'name' => 'Fax',\n 'property' => 'fax',\n ),\n array(\n 'name' => 'Facebook',\n 'property'=>'facebook'\n ),\n array(\n 'property' => 'comment', \n 'name' => 'Bemerkung',\n )\n );\n \n // set default values where no default given above\n $keys = array('type', 'format', 'crop');\n foreach($fields as $dk => $items) {\n foreach ($keys as $key) {\n if (! array_key_exists($key, $items)) {\n $fields[$dk][$key] = $defaults[$key];\n }\n }\n }\n \n return $fields;\n }",
"public function fields(array $fields = null);",
"protected function fieldsFromModel($id, array $fields)\n {\n $data = Event::findOrNew($id);\n\n $fieldNames = array_keys($fields);\n\n $fields = ['id' => $id];\n foreach ($fieldNames as $field) {\n $fields[$field] = $data->{$field};\n }\n\n return $fields;\n }",
"protected function _getBindModelCfg($fields = []) {\n\t\t$fieldsDb = $this->_modelConfigSync->getListFieldsDb();\n\t\t$fieldsLdap = $this->_modelConfigSync->getListFieldsLdap();\n\t\t$fieldsList = array_keys(array_flip($fieldsDb) + array_flip($fieldsLdap));\n\t\tif (!empty($fields)) {\n\t\t\t$fieldsList = array_intersect($fieldsList, (array)$fields);\n\t\t}\n\t\t$result = [];\n\t\tif (empty($fieldsList)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$bindModelCfg = $this->_getListBindModelCfg();\n\t\tforeach ($bindModelCfg as $checkField => $bindInfo) {\n\t\t\tif (!in_array($checkField, $fieldsList)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($bindInfo as $bindType => $targetModels) {\n\t\t\t\tforeach ($targetModels as $targetModel => $targetModelInfo) {\n\t\t\t\t\tswitch ($targetModel) {\n\t\t\t\t\t\tcase 'Department':\n\t\t\t\t\t\t\t$modelDepartment = ClassRegistry::init('Department', true);\n\t\t\t\t\t\t\tif ($modelDepartment !== false) {\n\t\t\t\t\t\t\t\t$targetModelInfo['className'] = 'Department';\n\t\t\t\t\t\t\t\t$useBlockDepartment = $modelDepartment->hasField('block');\n\t\t\t\t\t\t\t\tif ($useBlockDepartment) {\n\t\t\t\t\t\t\t\t\t$targetModelInfo['fields'][] = $targetModel . '.block';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'Manager':\n\t\t\t\t\t\tcase 'Subordinate':\n\t\t\t\t\t\t\t$modelEmployee = ClassRegistry::init('Employee', true);\n\t\t\t\t\t\t\tif ($modelEmployee !== false) {\n\t\t\t\t\t\t\t\t$targetModelInfo['className'] = 'Employee';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$targetModelInfo['fields'][] = $targetModel . '.' . $this->displayField . ' AS name';\n\t\t\t\t\t\t\tif ($targetModel === 'Subordinate') {\n\t\t\t\t\t\t\t\t$targetModelInfo['order'] = [$targetModel . '.' . $this->displayField => 'asc'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($this->hasField(CAKE_LDAP_LDAP_ATTRIBUTE_TITLE)) {\n\t\t\t\t\t\t\t\t$targetModelInfo['fields'][] = $targetModel . '.' . CAKE_LDAP_LDAP_ATTRIBUTE_TITLE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$result[$bindType][$targetModel] = $targetModelInfo;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"public static function getFields()\n {\n $fields = SELF::fields;\n foreach ($fields as &$field) {\n if (substr($field['name'], -3) == '_id') {\n $class = '\\\\App\\\\Models\\\\' . $field['model'];\n $field['data'] = $class::allToSelect();\n }\n }\n return $fields;\n }",
"protected function prepareFptData(array $fields)\n {\n foreach ($fields as &$field) {\n foreach ($this->fptData as $key => $data) {\n $field[$data['name']] = $this->fptData[$key]['data'][$field[$key]];\n unset($field[$key]);\n }\n $field['delete'] = '';\n }\n return $fields;\n }",
"public function getFields() {\n\t\tif (!$this->fields) {\n\t\t\t$fieldModelsList = array();\n\t\t\t$fieldIds = $this->getMappingSupportedFieldIdsList();\n\n\t\t\tforeach ($fieldIds as $fieldId) {\n\t\t\t\t$fieldModel = Settings_Leads_Field_Model::getInstance($fieldId, $this);\n\t\t\t\t$fieldModelsList[$fieldModel->getFieldDataType()][$fieldId] = $fieldModel;\n\t\t\t}\n\t\t\t$this->fields = $fieldModelsList;\n\t\t}\n\t\treturn $this->fields;\n\t}",
"public function as_array($fields = NULL)\n\t{\n\t\tif(func_num_args() > 1)\n\t\t{\n\t\t\t$fields = func_get_args();\n\t\t}\n\t\telseif( ! is_array($fields) OR empty($fields))\n\t\t{\n\t\t\t$fields = $this->getFields();\n\t\t}\n\n\t\t$fields = array_intersect($fields, $this->getFields());\n\t\t$result = array();\n\n\t\tforeach($fields as $field)\n\t\t{\n\t\t\t$method = 'get'.ucFirst($field);\n\t\t\t$result[$field] = $this->$method();\n\t\t}\n\n\t\treturn $result;\n\t}",
"function get_fields_grupo_fields($grupo_fields_id) {\n\t \tif(!is_null($orden = $this->ci->grupos_fields->get_fields_grupo_fields($grupo_fields_id))) {\n\t \t\tforeach ($orden->result() as $row)\n {\n $data[] = array(\n 'fields_nombre' => $row->fields_nombre, \n 'fields_id' => $row->fields_id, \n 'fields_label' => $row->fields_label, \n 'fields_instrucciones' => $row->fields_instrucciones, \n 'fields_value_defecto' => $row->fields_value_defecto, \n 'fields_requerido' => $row->fields_value_defecto, \n 'fields_hidden' => $row->fields_hidden, \n 'fields_posicion' => $row->fields_posicion,\n 'fields_type' => $this->get_field_type_by_id($row->fields_type_id),\n 'fields_constructor' => $this->ci->fieldstypes_frr->get_field_contructor($this->get_field_type_by_id($row->fields_type_id)),\n 'fields_option_items' => $row->fields_option_items\n );\n }\n return $data;\n\t\t} else {\n\t\t \treturn null;\n\t\t}\n\t }",
"public function getArray($fields = array('id', 'message', 'status_id', 'updated', 'created', 'deadline','priority')) {\n $output = array();\n \n foreach($fields as $field)\n $output[$field] = $this->$field;\n \n return $output;\n }",
"public function setDataFields($fields) {\n if (is_array($fields)) {\n foreach ($fields as $key => $value) {\n $this->_fields[$key] = $value;\n }\n }\n }",
"protected function getData(array &$fields){\n\t\t\tif( $this->entry->get( 'id' ) === null ){\n\t\t\t\t$info = pathinfo( $this->file_data['name'] );\n\t\t\t\t$title = basename( $this->file_data['name'], '.'.$info['extension'] );\n\n\t\t\t\t// Field: Multilingual Field\n\t\t\t\tforeach(FLang::getLangs() as $lc){\n\t\t\t\t\t$fields['title'][$lc] = $title;\n\t\t\t\t}\n\n\t\t\t\t// Field: Checkbox\n\t\t\t\t$fields['public'] = 'yes';\n\t\t\t}\n\n\t\t\t// cropper fields\n\t\t\t$ratios = array('1-1', '2-1', '3-1', '3-2', '4-1', '4-3', '16-9');\n\n\t\t\tforeach( $ratios as $ratio ){\n\t\t\t\t$this->imageCropper( $fields, $ratio );\n\t\t\t}\n\t\t}",
"public function getEditableFields() {\n\t\t$fieldsList = array(\n\t\t\tarray('name' => 'jfunction',\t\t'label' => 'LBL_SYNC_FUNC',\t\t'type' => 'text'),\n\t\t\tarray('name' => 'jtable', \t\t\t'label' => 'LBL_J_TABLENAME',\t'type' => 'text'),\n\t\t\tarray('name' => 'jfield',\t\t\t'label' => 'LBL_J_FIELDNAME',\t'type' => 'text'),\n\t\t\tarray('name' => 'vt_module',\t\t'label' => 'LBL_VT_MODULE_N',\t'type' => 'text'),\n\t\t\tarray('name' => 'vt_table',\t\t\t'label' => 'LBL_VT_TABLE_N',\t'type' => 'text'),\n\t\t\tarray('name' => 'vt_field',\t\t\t'label' => 'LBL_VT_FIELD_N',\t'type' => 'text'),\n\t\t\tarray('name' => 'push_to_joomla',\t'label' => 'LBL_PUSH_TO',\t\t'type' => 'radio'),\n\t\t\tarray('name' => 'pull_from_joomla',\t'label' => 'LBL_PULL_FROM',\t\t'type' => 'radio'),\n\t\t\tarray('name' => 'isactive',\t\t\t'label' => 'LBL_ACTIVE',\t\t'type' => 'radio'),\n\t\t\tarray('name' => 'description',\t\t'label' => 'LBL_DESC',\t\t\t'type' => 'text'),\n\t\t);\n\n\t\t$fieldModelsList = array();\n\t\tforeach ($fieldsList as $fieldInfo) {\n\t\t\t$fieldModelsList[$fieldInfo['name']] = Settings_Joomlabridge_Field_Model::getInstanceByRow($fieldInfo);\n\t\t}\n\t\treturn $fieldModelsList;\n\t}"
] | [
"0.68714404",
"0.6584089",
"0.6583834",
"0.6514978",
"0.63951504",
"0.6366839",
"0.6327122",
"0.6320435",
"0.6286507",
"0.62140334",
"0.6101323",
"0.60791355",
"0.60755503",
"0.600469",
"0.59596133",
"0.5957274",
"0.5943586",
"0.5926816",
"0.5916221",
"0.5914264",
"0.58740205",
"0.58620524",
"0.5838151",
"0.58361614",
"0.5832649",
"0.5821244",
"0.58044416",
"0.5786866",
"0.5777776",
"0.5763564"
] | 0.6996785 | 0 |
Applies filters to each conditioned field definition array. | public function applyFiltersToFields( $oCaller, $sClassName ) {
// Apply filters to each definition field.
foreach( $this->aConditionedFields as $_sSectionID => $_aSubSectionOrFields ) {
foreach( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) {
// If it is a sub-section array.
if ( is_numeric( $_sIndexOrFieldID ) && is_int( $_sIndexOrFieldID + 0 ) ) {
$_sSubSectionIndex = $_sIndexOrFieldID;
$_aFields = $_aSubSectionOrField;
$_sSectionSubString = '_default' == $_sSectionID ? '' : "_{$_sSectionID}";
foreach( $_aFields as $_aField ) {
$this->aConditionedFields[ $_sSectionID ][ $_sSubSectionIndex ][ $_aField['field_id'] ] = $this->addAndApplyFilter(
$oCaller,
"field_definition_{$sClassName}{$_sSectionSubString}_{$_aField['field_id']}",
$_aField,
$_sSubSectionIndex
);
}
continue;
}
// Otherwise, insert the formatted field definition array.
$_aField = $_aSubSectionOrField;
$_sSectionSubString = '_default' == $_sSectionID ? '' : "_{$_sSectionID}";
$this->aConditionedFields[ $_sSectionID ][ $_aField['field_id'] ] = $this->addAndApplyFilter(
$oCaller,
"field_definition_{$sClassName}{$_sSectionSubString}_{$_aField['field_id']}",
$_aField
);
}
}
// Apply filters to all the conditioned fields.
$this->aConditionedFields = $this->addAndApplyFilter(
$oCaller,
"field_definition_{$sClassName}",
$this->aConditionedFields
);
$this->aConditionedFields = $this->formatFields( $this->aConditionedFields, $this->sFieldsType, $this->sCapability );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addFieldFilters( $arr_filter, $strict = FALSE ) {\n\n\t\tif($this->lms_editions_filter === true) {\n\n\t\t\t// filter for the editions selected =====================================\n\t\t\t$fvalue = (isset($_POST[$this->id]['edition_filter'])\n\t\t\t\t? (int)$_POST[$this->id]['edition_filter']\n\t\t\t\t: '' );\n\n\t\t\tif($fvalue != false) {\n\t\t\t\t$acl_man =& Docebo::user()->getAclManager();\n\t\t\t\t$members = $acl_man->getGroupAllUser($fvalue);\n\t\t\t\tif($members && !empty($members)) {\n\t\t\t\t\t$this->data->addCustomFilter('', \"idst IN (\".implode(',', $members).\") \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($this->show_simple_filter === true) {\n\n\t\t\t// filter for userid firstname e lastname , fulltext search ====================\n\t\t\t$fvalue = (isset($_POST[$this->id]['simple_fulltext_search'])\n\t\t\t\t? strip_tags(html_entity_decode($_POST[$this->id]['simple_fulltext_search']))\n\t\t\t\t: '' );\n\n\t\t\tif(trim($fvalue !== '')) {\n\n\t\t\t\t$this->data->addCustomFilter('', \" ( userid LIKE '%\".$fvalue.\"%' OR firstname LIKE '%\".$fvalue.\"%' OR lastname LIKE '%\".$fvalue.\"%' ) \");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once($GLOBALS['where_framework'].'/modules/field/class.field.php');\n\t\t$field = new Field(0);\n\t\tforeach( $arr_filter as $fname => $fvalue ) {\n\t\t\tif(is_numeric($fname)) {\n\t\t\t\t$fname = \"cfield_\".$fname;\n\t\t\t}\n\t\t\tif( isset( $fvalue['value'] ) ) {\n\t\t\t\tif( isset( $fvalue['fieldname'] ) ) {\n\t\t\t\t\tif( $fvalue['field_type'] == 'upload' ) {\n\t\t\t\t\t\t$this->data->addFieldFilter( $fvalue['fieldname'], '', '<>');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif( $fvalue['value'] == '' ) {\n\t\t\t\t\t\t\t$search_op = \" = \";\n\t\t\t\t\t\t\t$search_val = \"\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif( $strict ) {\n\t\t\t\t\t\t\t\t$search_op = \" LIKE \";\n\t\t\t\t\t\t\t\t$search_val = \"%\".$fvalue['value'].\"%\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$search_op = \" = \";\n\t\t\t\t\t\t\t\t$search_val = $fvalue['value'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->data->addFieldFilter( $fvalue['fieldname'], $search_val, $search_op);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif( $fvalue[FIELD_INFO_TYPE] == 'upload' ) {\n\t\t\t\t\t\t$this->data->addCustomFilter( \t\" LEFT JOIN \".$field->_getUserEntryTable().\" AS \".$fname\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\" ON ( $fname.id_common = '\".(int)$fvalue[FIELD_INFO_ID].\"'\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\" AND $fname.id_user = idst ) \",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\" ($fname.user_entry IS \".(($fvalue['value']=='true')?'NOT':'').\" NULL ) \" );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif( $fvalue['value'] == '' )\n\t\t\t\t\t\t\t$where = \" ($fname.user_entry = '' OR $fname.user_entry IS NULL )\";\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif( $strict )\n\t\t\t\t\t\t\t\t$where = \" ($fname.user_entry = '\".$fvalue['value'].\"' ) \";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$where = \" ($fname.user_entry LIKE '%\".$fvalue['value'].\"%' ) \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->data->addCustomFilter( \t\" LEFT JOIN \".$field->_getUserEntryTable().\" AS \".$fname\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\" ON ( $fname.id_common = '\".(int)$fvalue[FIELD_INFO_ID].\"'\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\" AND $fname.id_user = idst ) \",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$where );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function updateFilterDefs()\n {\n // Start by collecting all of the filters rows within a statement\n $sql = 'SELECT\n id, filter_template, filter_definition, module_name\n FROM\n filters\n WHERE deleted = 0';\n $stmt = $this->db->getConnection()->executeQuery($sql);\n\n // For each row, investigate whether we need to update the data and, if so,\n // get it updated\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n // Run the row through the converter. If something changed then\n // handle saving that change\n $row = $this->convertRow($row);\n if ($row['converted']) {\n $this->handleUpdate($row['converted'], ['id' => $row['id']]);\n }\n }\n }",
"public function process()\n\t{\n\t\tforeach ($this->_elementList as $name => $value)\n\t\t{\n\t\t\tforeach ($this->_filterList as $filter) {\n\t\t\t\t$filter->filter($this);\n\t\t\t}\n\t\t}\n\t}",
"function processFilters($filters, $all_fields, $valSel, $primaryFormName)\n {\n\n global $module;\n\n $module->emDebug('all fields :' . print_r($all_fields, TRUE));\n\n $filtersql = \"\";\n\n foreach ($filters as $filter) {\n\n $filterstr = $this->filter_string($filter);\n\n // SRINI - 11/23/2020: Code shouldn't go into the following based on new approach of adding\n // forms to the spec. Keeping this code for reference. will remove once tested and confirmed.\n if (!in_array($filter->field, $all_fields)) {\n\n $filterstr = str_replace($filter->instrument . \".\" . $filter->field, $valSel, $filterstr);\n\n $filterstr = \" exists (select 1 from redcap_data rd, redcap_metadata rm \" .\n \" where rd.project_id = rm.project_id and rm.field_name = rd.field_name and rd.project_id = \" . $this->Proj->project_id . \" and \" .\n \" rd.field_name = '\" . $filter->field . \"' and \" . $filterstr .\n \" and rd.record = \" . $primaryFormName . \".record ) \";\n\n $filtersql = $filtersql . $filterstr . \" \" . $filter->boolean . \" \";\n } else {\n $filtersql = $filtersql . $filterstr . \" \" . $filter->boolean . \" \";\n }\n }\n\n if (substr($filtersql, -4) == \"AND \" || substr($filtersql, -4) == \"OR \")\n $filtersql = substr($filtersql, 0, strlen($filtersql) - 4);\n\n return $filtersql;\n\n }",
"public function filter($fields);",
"protected function defineFilters()\n {\n\n /*if (isset($this->request['filters'])) {\n\n foreach ($this->request['filters'] as $name => $value) {\n if ($value === null) {\n continue;\n }\n $method = 'processFilter' . ucfirst($name);\n if (!method_exists($this, $method)) {\n throw new \\Exception('invalid query filter: '\n . $name. ' (method: '.$method.')');\n }\n $this->$method($value);\n }\n }*/\n }",
"protected function composeFilters()\n {\n // Compose the term filter for the tags\n if (!empty($this->tagFilters)) {\n $this->filters[] = new \\Elastica\\Query\\Terms(\n Mapping::PREFIX_COMMON .TagsHandler::TAGS_FIELD .'.tags',\n $this->tagFilters\n );\n }\n\n // Compose the bool and term filter to exclude the tag module\n $tagFilter = new \\Elastica\\Query\\Terms(\"_type\", [\"Tags\"]);\n $boolFilter = new \\Elastica\\Query\\BoolQuery();\n $boolFilter->addMustNot($tagFilter);\n $this->filters[] = $boolFilter;\n }",
"function filters() {\n $aFilters = array();\n foreach ($this->aConfig as $sField => $aData) {\n if ($this->$sField !== false) {\n $aFilters[$sField] = $this->$sField;\n }\n }\n return $aFilters;\n }",
"protected function processRules()\n {\n foreach($this->_rules as $field => $rule)\n {\n //get type\n $type = $this->resolveType(Util::value('type', $rule, 'text'));\n\n $db_checks = Util::arrayValue('checks', $rule);\n if (array_key_exists('check', $rule))\n array_unshift($db_checks, $rule['check']);\n\n $this->_db_checks[$field] = array_map([$this, 'resolveDBChecks'], $db_checks);\n $this->_filters[$field] = Util::arrayValue('filters', $rule);\n $this->_rule_options[$field] = Util::arrayValue('options', $rule);\n\n $this->_rule_options[$field]['type'] = $this->_filters[$field]['type'] = $type;\n\n $required_if = Util::arrayValue(['requiredIf', 'requireIf'], $rule, []);\n $condition = Util::value('condition', $required_if, '');\n\n if ($condition !== '')\n {\n $required = false;\n\n $_field = Util::value('field', $required_if, '');\n $_field_value = Util::value($_field, $this->_source);\n\n $_value = Util::value('value', $required_if, '');\n\n //checkbox and radio inputs are only set if they are checked\n switch(strtolower($condition))\n {\n case 'checked':\n if (!$this->valueIsFalsy($_field_value))\n $required = true;\n break;\n\n case 'notchecked':\n if ($this->valueIsFalsy($_field_value))\n $required = true;\n break;\n\n case 'equals':\n case 'equal':\n if ($_value == $_field_value)\n $required = true;\n break;\n\n case 'notequals':\n case 'notequal':\n if ($_value != $_field_value)\n $required = true;\n break;\n }\n $rule['required'] = $required;\n }\n Util::unsetFromArray(['requiredIf', 'requireIf'], $rule);\n\n //boolean fields are optional by default\n if (Util::keyNotSetOrTrue('required', $rule) && $type !== 'bool')\n {\n $this->_required_fields[] = $field;\n $this->_hints[$field] = Util::value('hint', $rule, $field . ' is required');\n }\n else\n {\n $this->_optional_fields[] = $field;\n $this->_default_values[$field] = Util::value('default', $rule);\n }\n }\n }",
"protected function adjustComplexFilters(){\n\t\t$filtersArr = array();\n\t\tif(!empty($this->complexFilters))\n\t\t{\n\t\t\tforeach($this->complexFilters as $filter){\n\n\t\t\t\t$filtersArr[] = \"(\".$this->adjustFilter($filter[\"SQL1\"]).\" \" . $filter[\"JOIN\"]. \" \" . $this->adjustFilter($filter[\"SQL2\"]).\")\";\n\t\t\t}\n\t\t}\n\t\treturn $filtersArr;\n\t}",
"public function initFilters() {\n\t\tforeach($this->table->getFilters() as $oneFilter) {\n\t\t\t$createFilter = true;\n\t\t\t\n// \t\t\t$modelName = $oneFilter->getModelName();\n// \t\t\tif(!empty($modelName)) {\n// \t\t\t\t$model = \\rk\\model\\manager::get($modelName);\n\t\t\t\t\n// \t\t\t\tif($model->getPK() == $oneFilter->getAttributeName()) {\t// no filter for PKs\n// \t\t\t\t\t$createFilter = false;\n// \t\t\t\t}\n// \t\t\t}\n\t\t\t\n\t\t\tif($createFilter) {\n\t\t\t\tlist($fieldName, $type, $widgetParams) = $this->computeOptionsForTableFilter($oneFilter);\n\t\n\t\t\t\tswitch($type) {\n\t\t\t\t\tcase 'ignore':\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'hidden':\n\t\t\t\t\t\t$this->addWidgets(array(new \\rk\\form\\widget\\hidden($fieldName, $widgetParams)));\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\t$this->addWidgets(array(new \\rk\\form\\widget\\integer($fieldName, $widgetParams)));\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 'datetime':\n\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t$this->addWidgets(array(new \\rk\\form\\widget\\date($fieldName, $widgetParams)));\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'textCombo':\n\t\t\t\t\tcase 'richtext':\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t$this->addWidgets(array(new \\rk\\form\\widget\\text($fieldName, $widgetParams)));\n\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 'boolean':\n\t\t\t\t\t\t$this->addWidgets(array(new \\rk\\form\\widget\\checkbox($fieldName, $widgetParams)));\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'enum':\n\t\t\t\t\tcase 'select':\n\t\t\t\t\t\t$this->addWidgets(array(new \\rk\\form\\widget\\select($fieldName, $widgetParams)));\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new \\rk\\exception('unknown attribute type ' . $type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function defineFilters();",
"public function determineStartingFilters()\n {\n foreach (collect($this->filter)->except(self::EXCLUDED_FILTERS) as $key => $value) {\n $this->filter[$key] = [Trade::min($key), Trade::max($key)];\n }\n\n // Determine bounds for calculated fields\n $this->filter['total_volume'] = [\n Trade::min('units_per_hour') * Trade::min('duration'),\n Trade::max('units_per_hour') * Trade::max('duration'),\n ];\n }",
"function pullFilterCriteria($filters) {\n $filterCriteria = array();\n\n if (filterButtonClicked()) {\n foreach ($filters as $filter) {\n if ($_POST[$filter[\"name\"]] != \"[BLANK]\") {\n $filterCriteria[$filter[\"column\"]] = trim(sanitize_text_field($_POST[$filter[\"name\"]]));\n }\n }\n }\n\n return $filterCriteria;\n}",
"private function filter()\n {\n $this->builder->where(function ($builder) {\n collect($this->request->get('filter', []))->each(function ($value, $column) use ($builder) {\n $this->guardFilter($column);\n $this->filterColumn($builder, $column, $value);\n });\n });\n }",
"public function buildFilters()\n {\n $this->addFilter('code', new ORM\\StringFilterType('code'), 'Code du fichier',array(), true);\n $this->addFilter('filename', new ORM\\StringFilterType('filename'), 'Nom du fichier',array(), true);\n }",
"protected function makeFillableFiltersAndSorts()\n {\n // get fillable\n $fillable = $this->model->getFillable();\n \n $fillable[] = $this->model->getCreatedAtColumn();\n $fillable[] = $this->model->getUpdatedAtColumn();\n\n // add default filters\n foreach ($fillable as $field) {\n if (!in_array($field, $this->exactFilters)) {\n $this->allowedFilters[] = $field;\n }\n }\n\n //add exact filters\n /*foreach ($this->exactFilters as $filter) {\n $this->allowedFilters[] = Filter::exact($filter);\n }*/\n\n // configure sorts\n $this->allowedSorts = $fillable;\n $this->allowedSorts[] = 'id';\n }",
"protected function adjustFilters(){\n\t\t$filtersArr = array();\n\t\tif(!empty($this->filters))\n\t\t{\n\t\t\tforeach($this->filters as $filter){\n\t\t\t\t$filtersArr[] = $this->adjustFilter($filter);\n\t\t\t}\n\t\t}\n\t\treturn $filtersArr;\n\t}",
"public function filters();",
"public static function prepareCondition(Request $request){\n \n //\\App\\Jqwidgetshelper::writeDataToFile($request);\n \n if(isset($request->filterscount)) \n\t{\n \n //\\App\\Jqwidgetshelper::writeDataToFile($request->filtercondition.'0');\n \n\t$filterscount = $request->filterscount;\n\tif ($filterscount > 0)\n\t\t{\n\t\t$where = \" and (\";\n\t\t$tmpdatafield = \"\";\n\t\t$tmpfilteroperator = \"\";\n\t\t$valuesPrep = \"\";\n\t\t$values = [];\n\t\tfor ($i = 0; $i < $filterscount; $i++){ \n\t\t\t// get the filter's value.\n $filtervalue = $request->{'filtervalue'.$i};\n\t\t\t// get the filter's condition.\n $filtercondition = $request->{'filtercondition'.$i};\n\t\t\t// get the filter's column.\n $filterdatafield = $request->{'filterdatafield'.$i};\n\t\t\t// get the filter's operator.\n $filteroperator = $request->{'filteroperator'.$i};\n\t\t\tif ($tmpdatafield == \"\")\n\t\t\t\t{\n\t\t\t\t$tmpdatafield = $filterdatafield;\n\t\t\t\t}\n\t\t\t else if ($tmpdatafield <> $filterdatafield)\n\t\t\t\t{\n\t\t\t\t$where.= \")AND(\";\n\t\t\t\t}\n\t\t\t else if ($tmpdatafield == $filterdatafield)\n\t\t\t\t{\n\t\t\t\tif ($tmpfilteroperator == 0)\n\t\t\t\t\t{\n\t\t\t\t\t$where.= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t else $where.= \" OR \";\n\t\t\t\t}\n\t\t\t// build the \"WHERE\" clause depending on the filter's condition, value and datafield.\n\t\t\tswitch ($filtercondition)\n\t\t\t\t{\n\t\t\tcase \"CONTAINS\":\n\t\t\t\t$condition = \" LIKE \";\n\t\t\t\t$value = \"'%{$filtervalue}%'\";\n\t\t\t\tbreak;\n\t\t\tcase \"DOES_NOT_CONTAIN\":\n\t\t\t\t$condition = \" NOT LIKE \";\n\t\t\t\t$value = \"'%{$filtervalue}%'\";\n\t\t\t\tbreak;\n\t\t\tcase \"EQUAL\":\n\t\t\t\t$condition = \" = \";\n\t\t\t\t$value =\"'\". $filtervalue.\"'\";\n\t\t\t\tbreak;\n\t\t\tcase \"NOT_EQUAL\":\n\t\t\t\t$condition = \" <> \";\n\t\t\t\t$value =\"'\". $filtervalue.\"'\";\n\t\t\t\tbreak;\n\t\t\tcase \"GREATER_THAN\":\n\t\t\t\t$condition = \" > \";\n\t\t\t\t$value =\"'\". $filtervalue.\"'\";\n\t\t\t\tbreak;\n\t\t\tcase \"LESS_THAN\":\n\t\t\t\t$condition = \" < \";\n\t\t\t\t$value = \"'\".$filtervalue.\"'\";\n\t\t\t\tbreak;\n\t\t\tcase \"GREATER_THAN_OR_EQUAL\":\n\t\t\t\t$condition = \" >= \";\n\t\t\t\t$value =\"'\". $filtervalue.\"'\";\n\t\t\t\tbreak;\n\t\t\tcase \"LESS_THAN_OR_EQUAL\":\n\t\t\t\t$condition = \" <= \";\n\t\t\t\t$value =\"'\". $filtervalue.\"'\";\n\t\t\t\tbreak;\n\t\t\tcase \"STARTS_WITH\":\n\t\t\t\t$condition = \" LIKE \";\n\t\t\t\t$value = \"'{$filtervalue}%'\";\n\t\t\t\tbreak;\n\t\t\tcase \"ENDS_WITH\":\n\t\t\t\t$condition = \" LIKE \";\n\t\t\t\t$value = \"'%{$filtervalue}'\";\n\t\t\t\tbreak;\n\t\t\tcase \"NULL\":\n\t\t\t\t$condition = \" IS NULL \";\n\t\t\t\t$value = \"\";\n\t\t\t\tbreak;\n\t\t\tcase \"NOT_NULL\":\n\t\t\t\t$condition = \" IS NOT NULL \";\n\t\t\t\t$value = \"\";\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t$where.= \" \" . $filterdatafield . $condition .\" \".$value; //\"? \";\n//\t\t\t$valuesPrep = $valuesPrep . \"s\";\n//\t\t\t$values[] = & $value;\n\t\t\tif ($i == $filterscount - 1)\n\t\t\t\t{\n\t\t\t\t$where.= \")\";\n\t\t\t\t}\n\t\t\t$tmpfilteroperator = $filteroperator;\n\t\t\t$tmpdatafield = $filterdatafield;\n\t\t\t}\n\t\t// build the query.\n\t\treturn $where.' ';\n\t}\n }\n }",
"function getFilterData() {\n $vars = array();\n foreach ($this->getFields() as $f) {\n $tag = 'field.'.$f->get('id');\n if ($d = $f->getFilterData()) {\n if (is_array($d)) {\n foreach ($d as $k=>$v) {\n if (is_string($k))\n $vars[\"$tag$k\"] = $v;\n else\n $vars[$tag] = $v;\n }\n }\n else {\n $vars[$tag] = $d;\n }\n }\n }\n return $vars;\n }",
"function rest_api_filter_fields_magic( $data, $post, $request ){\n // Get the parameter from the WP_REST_Request\n // This supports headers, GET/POST variables.\n // and returns 'null' when not exists\n $fields = $request->get_param('fields');\n if($fields){\n\n // Create a new array\n $filtered_data = array();\n\n // Explode the $fields parameter to an array.\n $filter = explode(',',$fields);\n\n // If the filter is empty return the original.\n if(empty($filter) || count($filter) == 0)\n return $data;\n\n\n // The original data is in $data object in the property data\n // Foreach property inside the data, check if the key is in the filter.\n foreach ($data->data as $key => $value) {\n //echo $key;\n // If the key is in the $filter array, add it to the $filtered_data\n // original\n /*\n if (in_array($key, $filter)) {\n $filtered_data[$key] = $value;\n }\n */\n //echo $filter;\n \n if (in_array($key, $filter)) {\n\n switch ($key) {\n case \"acf\": {\n // need a case wher I didnt call for anything within acf fields.\n $acf = $data->data[\"acf\"];\n //echo $acf;\n\n foreach ($acf as $key_acf => $value_acf) {\n // echo $value_acf;\n if (in_array($key_acf, $filter)) {\n $filtered_data[\"acf\"][$key_acf] = $value_acf;\n }\n \n }\n }\n break;\n default:\n $filtered_data[$key] = $value;\n }\n\n\n /*\n if ($key == \"acf\") {\n // once it comes here it only hits once.\n $acf = $data->data[\"acf\"];\n //echo $acf;\n\n foreach ($acf as $key_acf => $value_acf) {\n // echo $value_acf;\n if (in_array($key_acf, $filter)) {\n $filtered_data[\"acf\"][$key_acf] = $value_acf;\n }\n \n }\n }\n else {\n $filtered_data[$key] = $value;\n }\n */\n\n \n \n \n }\n \n\n }\n\n }\n\n // return the filtered_data if it is set and got fields.\n return (isset($filtered_data) && count($filtered_data) > 0) ? $filtered_data : $data;\n\n}",
"protected function explodeConditions() {\n if (!empty($this->conditions)) {\n $value = implode(' ', $this->conditions);\n $this->addQuery('where', $value);\n }\n }",
"public function filters()\n {\n $filters = array();\n $filters[] = array(\n ZurmoBaseController::RIGHTS_FILTER_PATH .\n ' - modalList, autoComplete, details, profile, edit, auditEventsModalList, changePassword, ' .\n 'configurationEdit, emailConfiguration, securityDetails, ' .\n 'autoCompleteForMultiSelectAutoComplete, confirmTimeZone, changeAvatar, gameDashboard',\n 'moduleClassName' => 'UsersModule',\n 'rightName' => UsersModule::getAccessRight(),\n );\n $filters[] = array(\n ZurmoBaseController::RIGHTS_FILTER_PATH . ' + create',\n 'moduleClassName' => 'UsersModule',\n 'rightName' => UsersModule::getCreateRight(),\n );\n $filters[] = array(\n ZurmoBaseController::RIGHTS_FILTER_PATH . ' + massEdit, massEditProgressSave',\n 'moduleClassName' => 'ZurmoModule',\n 'rightName' => ZurmoModule::RIGHT_BULK_WRITE,\n );\n $filters[] = array(\n self::EMAIL_CONFIGURATION_FILTER_PATH . ' + emailConfiguration',\n 'controller' => $this,\n );\n return $filters;\n }",
"function generateFilterConditions($filter = null){\n\t\t$retval = array();\n\t\tif($filter){\n\t\t\tforeach($this->searchFields as $field){\n\t\t\t\t$retval['OR'][\"$field LIKE\"] = '%' . $filter . '%'; \n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}",
"public function getFilterableFields();",
"public function buildConditions($filterData = null, $filterConditions = null, $plugin = null, $limit = CAKE_THEME_FILTER_ROW_LIMIT) {\n\t\t$result = [];\n\t\tif (empty($filterData) || !is_array($filterData)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\tif (!is_array($filterConditions)) {\n\t\t\t$filterConditions = [];\n\t\t}\n\n\t\t$conditionsGroup = null;\n\t\tif (isset($filterConditions['group'])) {\n\t\t\t$conditionsGroup = $filterConditions['group'];\n\t\t}\n\t\t$conditionSignGroup = $this->_parseConditionGroup($conditionsGroup);\n\t\t$conditionsCache = [];\n\t\t$filterRowCount = 0;\n\t\t$limit = (int)$limit;\n\t\tif ($limit <= 0) {\n\t\t\t$limit = CAKE_THEME_FILTER_ROW_LIMIT;\n\t\t}\n\n\t\tforeach ($filterData as $index => $modelInfo) {\n\t\t\tif (!is_int($index) || !is_array($modelInfo)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$filterRowCount++;\n\t\t\tif ($filterRowCount > $limit) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tforeach ($modelInfo as $filterModel => $filterField) {\n\t\t\t\tif (!is_array($filterField)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($filterField as $filterFieldName => $filterFieldValue) {\n\t\t\t\t\tif ($filterFieldValue === '') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$condSign = null;\n\t\t\t\t\tif (isset($filterConditions[$index][$filterModel][$filterFieldName])) {\n\t\t\t\t\t\t$condSign = $filterConditions[$index][$filterModel][$filterFieldName];\n\t\t\t\t\t}\n\t\t\t\t\t$condition = $this->getCondition($filterModel . '.' . $filterFieldName, $filterFieldValue, $condSign, $plugin);\n\t\t\t\t\tif ($condition === false) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$cacheKey = md5(serialize($condition));\n\t\t\t\t\tif (in_array($cacheKey, $conditionsCache)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$result[$conditionSignGroup][] = $condition;\n\t\t\t\t\t$conditionsCache[] = $cacheKey;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($result[$conditionSignGroup]) && (count($result[$conditionSignGroup]) == 1)) {\n\t\t\t$result = array_shift($result[$conditionSignGroup]);\n\t\t}\n\n\t\treturn $result;\n\t}",
"protected function _prepareQueryConditions(&$conditions) {\n\t\tif (empty($conditions) || !is_array($conditions)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$bindFields = $this->_getListFieldsUpdateQueryConditions();\n\t\t$newConditions = [];\n\t\tforeach ($conditions as $field => &$value) {\n\t\t\tif (ctype_digit((string)$field)) {\n\t\t\t\t$field = $value;\n\t\t\t}\n\n\t\t\tif (in_array($field, ['AND', 'OR', 'NOT']) && is_array($value)) {\n\t\t\t\t$this->_prepareQueryConditions($value);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!is_string($field)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($bindFields as $bindField => $bindFieldInfo) {\n\t\t\t\t$fieldName = $field;\n\t\t\t\tif (strpos($fieldName, ' ') !== false) {\n\t\t\t\t\t$fieldName = explode(' ', $fieldName, 2);\n\t\t\t\t\t$fieldName = array_shift($fieldName);\n\t\t\t\t}\n\t\t\t\tif ($fieldName !== $this->alias . '.' . $bindField) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tunset($conditions[$field]);\n\t\t\t\t$field = str_replace($this->alias . '.' . $bindField, $bindFieldInfo['replace'], $field);\n\t\t\t\tif (!isset($bindFieldInfo['subQuery'])) {\n\t\t\t\t\t$newConditions[$field] = $value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$conditionsSubQuery = [$field => $value];\n\t\t\t\t$db = $this->getDataSource();\n\t\t\t\t$subQuery = $db->buildStatement(\n\t\t\t\t\t[\n\t\t\t\t\t\t'limit' => null,\n\t\t\t\t\t\t'offset' => null,\n\t\t\t\t\t\t'joins' => [],\n\t\t\t\t\t\t'conditions' => $conditionsSubQuery,\n\t\t\t\t\t\t'order' => null,\n\t\t\t\t\t\t'group' => null\n\t\t\t\t\t] + $bindFieldInfo['subQuery'],\n\t\t\t\t\t$this\n\t\t\t\t);\n\t\t\t\t$subQuery = 'Employee.id IN (' . $subQuery . ') ';\n\t\t\t\t$subQueryExpression = $db->expression($subQuery);\n\n\t\t\t\t$newConditions[] = $subQueryExpression;\n\t\t\t}\n\t\t}\n\t\t$conditions = array_merge($conditions, $newConditions);\n\t}",
"static function add_filters(): void {\n add_action('acf/init', [__CLASS__, 'add_updates']);\n add_action('acf/init', [__CLASS__, 'add_update_date']);\n add_action('acf/init', [__CLASS__, 'add_update_nature']);\n \n // Add validation function\n add_filter(sprintf('acf/validate_value/key=%s',\n self::qualify_field(self::update_date)),\n [__CLASS__, 'validate_update_date'], 10, 4);\n }",
"public function applyFilters($filters) {\n foreach($filters as $filter) {\n $key = key($filters);\n \n switch ($key) {\n case 'order_by':\n $filter_key = key($filter);\n $this->db->order_by($filter_key, $filter[$filter_key]);\n break;\n \n default:\n $this->db->{$key}($filter);\n break;\n }\n\n next($filters);\n }\n }"
] | [
"0.64492357",
"0.6202107",
"0.6146286",
"0.6116957",
"0.605893",
"0.6054971",
"0.5922598",
"0.5887072",
"0.5865357",
"0.58433986",
"0.58364177",
"0.58129275",
"0.57221854",
"0.5705605",
"0.5698688",
"0.56664574",
"0.56496936",
"0.5647706",
"0.5608653",
"0.55998075",
"0.5576534",
"0.5564745",
"0.5530794",
"0.55209017",
"0.5505772",
"0.54994065",
"0.549615",
"0.5489473",
"0.5481079",
"0.5470853"
] | 0.7167577 | 0 |
Get comments by event ID | public function getComments($eventId)
{
$sql = 'SELECT c.id, c.text, c.created_time, c.user_id, u.username
FROM comment c
LEFT JOIN user u ON c.user_id = u.id
WHERE c.event_id = :event_id
ORDER BY c.created_time DESC';
$result = $this->db->fetchAll($sql, [':event_id' => $eventId]);
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getByEventId(Event $event) {\n $items = CommentFacade::getActiveItemsByEventId($event->id);\n if($items->count())\n return $this->success(CommentsTransformer::transform($items));\n\n return $this->error('COMMENT_ERRORS', 'NO_COMMENTS');\n }",
"public function getEventComs($event) {\n $content = [];\n $q = $this->_db->query('SELECT id, content, userId, eventId FROM commentaires WHERE eventId = '.$event);\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $content[] = new Commentaires($donnees);\n }\n\n return $content;\n }",
"public static function getComments($videoplayer_id){\n\t\t$query = \"SELECT * FROM comment WHERE videoplayer_id={$videoplayer_id}\";\n\t\t$database = new Database();\n\t\treturn $database->getAll($query);\n\t}",
"public function commentEvent($id)\n\t{\n\t\t$validator = Validator::make(\n\t\t\tarray(\n\t\t\t\t\"comment\" => Input::get(\"comment\")\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"comment\" => \"required\"\n\t\t\t)\n\t\t);\n\n\t\t// Check if the validation fails.\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Response::json(array(\n\t\t\t\t\"message\" => \"Bad request.\"\n\t\t\t), 400);\n\t\t}\n\n\t\t$result = Action::comment(\"event\", $id, Input::get(\"comment\"));\n\n\t\tif ($result == false)\n\t\t{\n\t\t\treturn Response::json(array(\n\t\t\t\t\"message\" => \"Not authorized to use this resource.\"\n\t\t\t), 403);\n\t\t}\n\n\t\treturn Response::json(\"\", 204);\n\t}",
"public function findCommentById($id);",
"public function getComments($id = NULL){\n // if Comment id was supplied was supplied, load the associated Comment\n if(isset($id)) {\n // Load the Comment\n $sql = \"SELECT *\n FROM comments\n WHERE dreamID=?\n ORDER BY postDate DESC\";\n $q = $this->db->prepare($sql);\n $q->execute(array($id));\n\n $c = $q->fetchAll();\n\n return $c;\n } else {\n return $c = NULL;\n }\n }",
"public function getMediaComments($id);",
"public function getComments($id) {\n\n\t\t$conn = $this->connect();\n\t\t$comments = array();\n\n\t\t//Pull data from database\n\t\ttry {\n\n\t\t\t$stmt = $conn->prepare(\"SELECT * FROM comments WHERE anime_id = :id ORDER BY comment_num DESC\");\n\t\t\t$stmt->bindParam(':id', $id);\n\t\t\t$stmt->execute();\n\n\t\t\t$i = 0;\n\n\n\t\t\twhile($row = $stmt->fetch()) {\n\n\t\t\t\t$comments[$i]['comment_num'] = $row['comment_num'];\n\t\t\t\t$comments[$i]['user_id'] = $row['user_id'];\n\t\t\t\t$comments[$i]['anime_id'] = $row['anime_id'];\n\t\t\t\t$comments[$i]['time_stamp'] = $row['time_stamp'];\n\t\t\t\t$comments[$i]['comment'] = $row['comment'];\n\n\t\t\t\t$i++;\t\t\t\t\t\n\t\t\t}\n\n\t\t\treturn $comments;\n\t\t\t\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\techo \"Unable to get data from database: \" . $e->getMessage();\n\t\t}\n\t}",
"public function getComment($id)\n {\n $comments = $this->getComments();\n $comment = array_filter($comments, function ($key) use ($id) {\n return $key == $id;\n }, ARRAY_FILTER_USE_KEY);\n if (!empty($comment)) {\n $comment = $comment[$id];\n $comment[\"id\"] = $id;\n }\n return $comment;\n }",
"static function get_comment_by_id($id)\n {\n return $comment_data = Comment::where('id', $id)->first();\n }",
"public function getComments($id)\n {\n try{\n $task = Task::find($id);\n $task_comments = $task->comments;\n\n return $this->returnSuccess($task_comments);\n }catch (\\Exception $e) {\n return $this->returnError($e->getMessage());\n }\n }",
"public function getComment($id){\n // Load the Comment\n $sql = \"SELECT *\n FROM comments\n WHERE commentID=?\n LIMIT 1\";\n $q = $this->db->prepare($sql);\n $q->execute(array($id));\n\n $c = $q->fetch();\n\n return $c;\n }",
"public function get_event($id);",
"function getComments($id)\n{\n require('config/connect.php');\n $req = $bdd->prepare('SELECT * FROM comments WHERE article_id=?') ;\n $req->execute(array($id));\n $data = $req->fetchAll(PDO::FETCH_OBJ);\n return $data;\n $req->closeCursor();\n}",
"public function getComments($id)\n {\n $sql = \"SELECT * FROM `comments` WHERE `mailid` = '{$id}' ORDER BY `commentgroep` DESC\";\n\n $result = $this->dbQuery($sql);\n $value = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n if ($value) {\n return $value;\n }\n return null;\n }",
"public function get_comments($module, $id)\r\n\t{\r\n\t\t$query = $this->db->get_where('comments', array('module' => $module, 'module_link' => $id));\r\n\r\n\t\treturn $query->result();\r\n\t}",
"public function getMediaComments($id) {\n return $this->_makeCall('media/' . $id . '/comments', false);\n }",
"public static function find($id)\n {\n $conn = Db::getInstance();\n $stmt = $conn->prepare('SELECT c_task, c_id, c_author, c_text, c_time FROM comments WHERE c_id = ?');\n $stmt->bind_param(\"s\", $id);\n $stmt->execute();\n $stmt->bind_result($task, $id, $author, $text, $time);\n $stmt->fetch();\n return new Comment($task, $id, $author, $text, $time);\n }",
"function get_comments($entry_id)\r\n{\r\n global $mongo, $readPreference;\r\n \r\n $filter = ['parent_entry_id' => $entry_id];\r\n $query = new MongoDB\\Driver\\Query($filter);\r\n $cursor = $mongo->executeQuery('memoryatlas.comments', $query, $readPreference);\r\n\r\n $result = [];\r\n foreach($cursor AS $doc) {\r\n $result[] = $doc;\r\n }\r\n return $result;\r\n}",
"public function getComments($id, array $columns = ['*']);",
"public function getComments(Request $req, $id) {\n $user = $req->get('user');\n $order = PerformerProductTracking::where([\n 'id' => $id\n ])\n ->first();\n\n if (!$order) {\n return Response()->json([\n 'success' => false,\n 'data' => [\n 'message' => 'Order not found!'\n ]\n ]);\n }\n\n $items = PerformerProductTrackingComment::where(['orderId' => $id])->with('sender')->get();\n\n return Response()->json([\n 'success' => true,\n 'data' => $items\n ]);\n }",
"public static function GetComments($id)\n {\n $url = \"http://localhost:8080/api/comment/get_comments/$id\";\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response_json = curl_exec($ch);\n curl_close($ch);\n $response=json_decode($response_json, true);\n return $response;\n }",
"public function getCommentsById($id)\n {\n return \"/V1/creditmemo/{$id}/comments\";\n }",
"public function getComments() {\r\n\t\t\r\n\t\tif (isset($_GET['id'])) {\t\r\n\t\t\t$postid = $_GET['id'];\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"SELECT * FROM jf_comments WHERE post_id = '$postid' AND seen = '1' ORDER BY date DESC\";\r\n\t\t$result = $this->_connection->query($query);\r\n\t\t$rows = array();\r\n\t\t\r\n\t\twhile($row = $result->fetchObject()) {\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\r\n\t\treturn $rows;\r\n\r\n\t}",
"public function getById($id) {\n return Comment::applyScope($this->getDefaultScope())\n ->whereId($id)\n ->first();\n }",
"public function getComments($postID) {\n $postID = SQLFunctions::SQLNumber($postID);\n $sql = \"SELECT * FROM Instagram_Comment WHERE PostID = \" . $postID;\n $result = $this->doQuery($sql, true);\n return $result;\n }",
"static function getCommentById($id){\n\t\t$servername = self::$servername;\n\t\t$username = self::$username;\n\t\t$password = self::$password;\n\t\t$dbname = self::$dbname;\n\t\t$log = self::$log;\n $comment = new Comment();\n\t\t\n\t\ttry{\n\t\t\t$pdo = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n\n\t\t\t$stmt = $pdo -> prepare(\"SELECT id, account_id, question_id, answer_id, content, date FROM comments WHERE id = :id;\");\t\n\t\t\t$stmt -> bindParam(':id',$id );\n\t\t\n\t\t\t$stmt -> execute();\n\t\t\t\n\t\t\t// while there is a comment with specified account id\n\t\t\tif($result = $stmt -> fetch()){\n $c = new comment();\n\n\t\t\t\t$c->setId($result[0]);\n $c->setAccountId($result[1]);\n $c->setQuestionId($result[2]);\n $c->setAnswerId($result[3]);\n $c->setContent($result[4]);\n $c->setDate($result[5]);\n\n $comment = $c;\n\t\t\t}\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\t$log->lwrite($e -> getMessage());\n\t\t}\n\t\tfinally{\n\t\t\tunset($pdo);\n\t\t}\n\t\t// returns the comment array\n\t\treturn $comment;\n }",
"function getCommentById($id){\n\n\t$result = mysql_query(\"SELECT * FROM comments WHERE id = $id\");\n\n\t$data = mysql_fetch_assoc($result);\n\n\treturn $data;\n\n}",
"public function getCommentsById($idea_id)\n\t{\n\t\t$query = $this->db_con->query(\"SELECT * FROM comments WHERE Idea_Id = '\".$idea_id.\"' ORDER BY Added_Date DESC\");\n\t\t$result = array();\n \t\twhile ($row=$query->fetch_assoc()){\n \t\t\t$result[] = $row;\n \t\t}\n \t\treturn $result;\n\t}",
"public function getCookedComments($encounter_id)\n\t{\n\t\t$data = $this->find('first', array(\n\t\t\t\t'recursive' => -1,\n\t\t\t\t'fields' => 'EncounterRos.comments',\n\t\t\t\t'conditions' => array('EncounterRos.encounter_id' => $encounter_id)\n\t\t\t)\n\t\t);\n\t\tif(! $data ) {\n\t\t\treturn;\n\t\t}\n\t\t$ros = $data['EncounterRos'];\n\t\t$ros = json_decode($ros['comments'], true);\n\t\t\n\t\treturn $ros;\n\t}"
] | [
"0.77269596",
"0.68673944",
"0.6771332",
"0.67678344",
"0.6723108",
"0.6666838",
"0.6640014",
"0.66144407",
"0.6576671",
"0.65507543",
"0.650966",
"0.6474839",
"0.64645034",
"0.63030225",
"0.6259577",
"0.6245898",
"0.622958",
"0.6224868",
"0.6222861",
"0.62132514",
"0.6187934",
"0.61855763",
"0.61679876",
"0.6157405",
"0.61433256",
"0.6142234",
"0.61053306",
"0.61024517",
"0.61010987",
"0.6095051"
] | 0.76603156 | 1 |
Get all comments by userID | public function getUserComments($userId)
{
$sql = 'SELECT * FROM comment
WHERE user_id = :user_id
ORDER BY created_time DESC';
$result = $this->db->fetchAll($sql, [':user_id' => $userId]);
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCommentsForUser($userID)\n {\n $result = self::$dbInterface -> query(\"SELECT commentID, comment, card_cardID, user_userID \n FROM comment WHERE user_userID='$userID'\");\n return $result;\n }",
"public function getUserComments($userId)\n {\n return $this->db->select(\n \"SELECT * FROM `comments` WHERE `posted_by` = :id\",\n array(\"id\" => $userId)\n );\n }",
"public function getCommentsForUserReverse($userID)\n {\n $result = self::$dbInterface -> query(\"SELECT commentID, comment, card_cardID, user_userID \n FROM comment WHERE user_userID='$userID' ORDER BY commentID DESC\");\n return $result;\n }",
"public function getComments()\n {\n return Comment::whereIdFor(Auth()->user()->id)->get();\n }",
"function get_comments($id, $user_id) {\n $data = [];\n //$input = $this->validate_get_comments();\n $res = $this->TweetModel->get_comments($id);\n if ($res) {\n foreach ($res as $r) {\n $data[] = array(\n 'comment_id' => $r['id'],\n 'post_id' => $r['post_id'],\n 'comment' => $r['comment'],\n 'photo' => $this->check_image($r['photo']),\n 'likes' => $this->TweetModel->count_comment_like($r['id']),\n 'created_date' => $r['created_date'],\n 'update_date' => $r['update_date'],\n 'is_liked' => $this->check_comment_like_by_user($user_id, $r['id']),\n 'user_detail' => $this->TweetModel->get_user_short_data($r['user_id'])\n \n );\n }\n }\n return $data;\n //return_data(false, 'No Comment Found', array());\n }",
"function getUserComments($id){\n $select=$this->select('*')\n ->from('comments')->where('comments.user_id='.$id)\n ->setIntegrityCheck(false)\n ->joinInner('users','users.id = comments.user_id',array('*'))\n ;\n return $this->fetchAll($select)->toArray();\n }",
"public function getAllComments()\n {\n $result = self::$dbInterface -> query(\"SELECT commentID, comment, card_cardID, user_userID \n FROM comment\");\n return $result;\n }",
"public static function channelComments($userId)\n {\n return Comment::join('videos', 'comments.video_id', '=', 'videos.id')\n ->selectRaw('comments.*')\n ->where('videos.user_id', $userId);\n }",
"public function findComments($uid) {\n\t\t$query = $this->createQuery();\n\t\t$constraints = array();\n\t\t$constraints[] = $query->equals('form', 'COMMENT');\n\t\t$constraints[] = $query->equals('hash', $uid);\n\t\t$constraints[] = $query->greaterThan('published', 0);\n\t\t$query->matching($query->logicalAnd($constraints));\n\t\t$query->setOrderings(array(\n\t\t\t'date' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING\n\t\t));\n\t\treturn $query->execute();\n\t}",
"public function listComments()\n {\n $sql = $sql = \"SELECT * FROM comment JOIN user USING (idUser) JOIN activity USING (idActivity);\";\n return $this->query($sql);\n }",
"public function findCommentsById($id)\n\t{\n\t\t$sql = $this->dbh->prepare(\"SELECT * FROM commentaire AS c, user as u where c.id_et = u.id_u AND c.id_co = :id\");\n\t\t$sql->execute(array('id' => $id));\n\t\t$result= $sql-> fetchAll();\n\t\treturn ($result);\t\n\t}",
"public function index()\n {\n // test ORM\n $user = User::find(1);\n //get all post of user\n $posts = $user->posts;\n\n // get all comment of user\n $comments = $user->comments;\n\n //get all with condition\n $comments = $user->comments()->where('id', '>', 3)->get();\n\n dd($comments);\n \n }",
"public function getAllComments($id)\n {\n \n $comments = Comment::orderBy('created_at', 'desc')->with('user')->where('post_id',$id)->get();\n return response()->json($comments);\n }",
"public function findComments($questionID) \r\n \t{\r\n // ->from(\"comments AS c\")\r\n // \t->where(\"questions_id = ?\")\r\n // \t->join(\"user AS u\", \"u.id = c.user_id\");\r\n\r\n $sql = \"SELECT c.id, c.content, c.created, u.email, u.username, u.id AS user_id,\r\n\t \t\t(SELECT SUM(v.vote_value) FROM votes v WHERE c.id = v.comments_id) AS votes\r\n\t \t\tFROM comments c\r\n\t \t\t\tINNER JOIN user u ON u.id = c.user_id\r\n\t \t\tWHERE questions_id = ?\";\r\n\r\n $this->db->execute($sql, [$questionID]);\r\n return $this->db->fetchAll();\r\n\r\n \t}",
"public function queryUserComments(GWF_User $user=null)\n\t{\n\t $user = $user ? $user : GWF_User::current();\n\t return $this->queryComments()->where(\"comment_creator={$user->getID()}\");\n\t}",
"public function getComments($user, $repo, $issueId, $page = 0, $limit = 0)\n\t{\n\t\treturn $this->comments->getList($user, $repo, $issueId, $page, $limit);\n\t}",
"public function get_comments($username)\n {\n // gets account comments\n $account_comments = Comment::get_accounts_comments($username);\n\n // check if error when getting comments\n if(!isset($account_comments)){\n return response()->json([\n 'message' => 'Unable to retrieve comments'\n ], 400); \n }\n\n // check if there are any comments\n if(count($account_comments) < 1){\n return response()->json([\n 'message' => 'There are no comments for this account'\n ], 400);\n }\n\n // response\n return response()->json([\n 'comments' => $account_comments\n ], 200);\n }",
"protected function getAllItems($userId)\n {\n $comment = new Comment();\n $comment->setDb($this->di->get(\"database\"));\n\n $comments = [\"-1\" => \"Select an item...\"];\n foreach ($comment->findAllWhere(\"userId = ?\", $userId) as $obj) {\n $comments[$obj->id] = \"{$obj->published} ({$obj->id})\";\n }\n\n return $comments;\n }",
"public static function getCommentsWithUser($post_id) {\n\t\treturn static::join('users', 'comments.user', '=', 'users.id')->orderBy('comments.created_at', 'desc')->where('comments.post', '=', $post_id)->select('comments.*', 'users.name');\n\t}",
"public function getComments($eventId)\n {\n $sql = 'SELECT c.id, c.text, c.created_time, c.user_id, u.username\n FROM comment c\n LEFT JOIN user u ON c.user_id = u.id\n WHERE c.event_id = :event_id\n ORDER BY c.created_time DESC';\n $result = $this->db->fetchAll($sql, [':event_id' => $eventId]);\n\n return $result;\n }",
"public function getAllCommentsUser() {\n $profil = FALSE;\n $query = 'SELECT `id`, `username`, `comments`, DATE_FORMAT(`datehour`, \"%d/%m/%Y\") AS `date`, DATE_FORMAT(`datehour`, \"%H:%i\") AS `hour`, `id_ya_users`, `id_ya_flashcontent`, `id_ya_commentstate` FROM `ya_comments` WHERE `id_ya_users`= :id';\n $findProfil = $this->db->prepare($query);\n $findProfil->bindValue(':id', $this->id_ya_users, PDO::PARAM_INT);\n $findProfil->execute();\n return $profil = $findProfil->fetchAll(PDO::FETCH_OBJ);\n }",
"public function index($id)\n {\n $user = User::where('id', $id)->first();\n $comments = $user->comment_votes()->with('comment')->get();\n return $comments;\n }",
"public function comments()\n {\n return $this->hasMany(Comment::class, 'user_id');\n }",
"public function comments()\n {\n return $this->hasMany(Comment::class, 'user_id');\n }",
"public function getComments() {\r\n\t\t\r\n\t\tif (isset($_GET['id'])) {\t\r\n\t\t\t$postid = $_GET['id'];\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"SELECT * FROM jf_comments WHERE post_id = '$postid' AND seen = '1' ORDER BY date DESC\";\r\n\t\t$result = $this->_connection->query($query);\r\n\t\t$rows = array();\r\n\t\t\r\n\t\twhile($row = $result->fetchObject()) {\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\r\n\t\treturn $rows;\r\n\r\n\t}",
"public static function comments( $user )\n\t{\n\t}",
"function getAllComments($thread_id) {\n\t\t$r=$this->db->makeQuery(\"SELECT comment.id as cid,user.id as uid,comment.edit_by as edit_by,thread_id,image,fname,lname,username,body,comment.created_at ,comment.last_update FROM `comment`,`user` WHERE `thread_id`=$thread_id and `user_id`=user.id\");\n\t\treturn $r;\n\t}",
"public function getComments(){\n\n $query = $this->db->query(\"SELECT * FROM activereviews INNER JOIN gamescomments ON (activereviews.ID = gamescomments.ReviewID) INNER JOIN users ON (gamescomments.UserID = users.UID) ORDER BY gamescomments.UID DESC\");\n return $query->result();\n\n //This query gets everything from the active reviews, gamescomments and users\n }",
"public function getComments()\n\t\t{\n\t\t\t$query = $this->db->query('SELECT comments.comment,comments.post_id,comments.id,comments.time,comments.user_id,\n\t\t\t\t\t\t\t\t\t\t'.$this->table_users.'.name\n\t\t\t\t\t\t\t\t\t\tFROM comments\n\t\t\t\t\t\t\t\t\t\tINNER JOIN '.$this->table_users.'\n\t\t\t\t\t\t\t\t\t\tON comments.user_id='.$this->table_users.'.id\n\t\t\t\t\t\t\t\t\t\torder by comments.id DESC;');\n\t\t\t$query = $query->result_array();\n\t\t\treturn $query;\n\t\t}",
"public function getComments($id) {\n\n\t\t$conn = $this->connect();\n\t\t$comments = array();\n\n\t\t//Pull data from database\n\t\ttry {\n\n\t\t\t$stmt = $conn->prepare(\"SELECT * FROM comments WHERE anime_id = :id ORDER BY comment_num DESC\");\n\t\t\t$stmt->bindParam(':id', $id);\n\t\t\t$stmt->execute();\n\n\t\t\t$i = 0;\n\n\n\t\t\twhile($row = $stmt->fetch()) {\n\n\t\t\t\t$comments[$i]['comment_num'] = $row['comment_num'];\n\t\t\t\t$comments[$i]['user_id'] = $row['user_id'];\n\t\t\t\t$comments[$i]['anime_id'] = $row['anime_id'];\n\t\t\t\t$comments[$i]['time_stamp'] = $row['time_stamp'];\n\t\t\t\t$comments[$i]['comment'] = $row['comment'];\n\n\t\t\t\t$i++;\t\t\t\t\t\n\t\t\t}\n\n\t\t\treturn $comments;\n\t\t\t\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\techo \"Unable to get data from database: \" . $e->getMessage();\n\t\t}\n\t}"
] | [
"0.82868135",
"0.7763413",
"0.74522024",
"0.73886657",
"0.73525476",
"0.71892536",
"0.70674187",
"0.7000487",
"0.697663",
"0.6939331",
"0.6846531",
"0.68144244",
"0.6803902",
"0.67855215",
"0.67364854",
"0.67342496",
"0.6726137",
"0.66818637",
"0.6669817",
"0.66612124",
"0.6658575",
"0.6534092",
"0.6525096",
"0.6525096",
"0.6520626",
"0.6513544",
"0.65113187",
"0.6501167",
"0.6499732",
"0.6478544"
] | 0.793224 | 1 |
/ Get aq2emp_subscriber_tag by id | function get_aq2emp_subscriber_tag($id)
{
return $this->db->get_where('aq2emp_subscriber_tags',array('id'=>$id))->row_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_aq2emp_campaign_tag($id)\n {\n return $this->db->get_where('aq2emp_campaign_tags',array('id'=>$id))->row_array();\n }",
"function delete_aq2emp_subscriber_tag($id)\n {\n $response = $this->db->delete('aq2emp_subscriber_tags',array('id'=>$id));\n if($response)\n {\n return \"aq2emp_subscriber_tag deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting aq2emp_subscriber_tag\";\n }\n }",
"public function findTag($id);",
"public function getByID ($id) {\n\t\n\t\t// query database\n\t\t$sql = \"SELECT * FROM \".DB_PREFIX.\"subscribers WHERE subscriberID = \".intval($id);\n\t\t$rec = $this->db->query($sql);\n\t\t\n\t\t// return result\n\t\tif ($row = $rec->fetch()) {\n\t\t\treturn new Subscriber($row);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\n\t}",
"function get_tag_by_id($id){\n $this->load->database('default');\n $this->db->where('tag_id',$id);\n $q = $this->db->get('tag');\n $data = '';\n\n if($q->num_rows() > 0):\n $data = $q->row();\n endif;\n\n return $data;\n }",
"function bbp_get_topic_tags($topic_id = 0)\n{\n}",
"function bbp_get_topic_subscribers($topic_id = 0)\n{\n}",
"function bbp_get_topic_tag_id($tag = '')\n{\n}",
"public function getTagById($tag_id)\n {\n return $this->tag->findOrFail($tag_id)->tag;\n }",
"public function getTagById($tag_id)\n {\n return $this->tag->findOrFail($tag_id)->tag;\n }",
"function get_all_aq2emp_subscriber_tags()\n {\n return $this->db->get('aq2emp_subscriber_tags')->result_array();\n }",
"function update_aq2emp_subscriber_tag($id,$params)\n {\n $this->db->where('id',$id);\n $response = $this->db->update('aq2emp_subscriber_tags',$params);\n if($response)\n {\n return \"aq2emp_subscriber_tag updated successfully\";\n }\n else\n {\n return \"Error occuring while updating aq2emp_subscriber_tag\";\n }\n }",
"function add_aq2emp_subscriber_tag($params)\n {\n $this->db->insert('aq2emp_subscriber_tags',$params);\n return $this->db->insert_id();\n }",
"public function getTag();",
"public function loadTagById($id)\n {\n return $this->getEm()->createQueryBuilder()\n ->select('t')\n ->from('UnifikDoctrineBehaviorsBundle:Tag', 't')\n ->where('t.id = :id')\n ->setParameter('id', $id)\n ->getQuery()->getSingleResult();\n }",
"function bbp_topic_tag_id($tag = '')\n{\n}",
"public function getTagById($id) {\n $tag = new Tag();\n $tag->setId($id);\n\n\t\t$query = $this->db->prepare(\"SELECT * FROM tags WHERE tag_id = :tag_id\");\n\t\t$query->bindValue(\":tag_id\", $id);\n\t\t$query->setFetchMode(PDO::FETCH_ASSOC);\n $query->execute();\n if($row = $query->fetch()) {\n $tag->setValue($row['value']);\n } else {\n return null;\n }\n\n return $tag;\n\t}",
"function bbp_get_topic_tag_tax_id()\n{\n}",
"public function findTag($id)\n {\n return $this->doctrine->find('Cvut\\Fit\\BiPwt\\BlogBundle\\Entity\\Tag', $id);\n }",
"function bbp_get_topic_tag_list($topic_id = 0, $args = array())\n{\n}",
"public function get_subscriber($user_id){\n try{\n //get all user's id except this user\n $query = $this->db->select(array('id','user_name'))->from('users')->\n where(array('id !='=> (int) $user_id,'active'=>1))->get();\n $rows = $query->result_array();\n //get the user's already publishers\n $sql = $this->db->select('subscriber_id')->from('subscribers')->where('user_id', $user_id)->get();\n $array = array();\n //get user's publisher list\n foreach($sql->result() as $row)\n {\n $array[] = $row->subscriber_id;; // add each user id to the array\n }\n //set that other user's are publisher or not\n foreach($rows as $key => $value){\n if (in_array($value['id'], $array)) {\n $rows[$key]['subscriber'] = 1;\n }else{\n $rows[$key]['subscriber'] = 0;\n }\n }\n return $rows;\n }catch (Exception $e) {\n\t\t\t\t//echo json_encode($e->getMessage());die;\n\t\t\t\tlog_message('error', json_encode($e->getMessage()));\n\t\t\t\tshow_error('Sorry, this is embarrassing. We are on working hard to get it back online.', 500);\n\t\t\t}\n }",
"public function getTag(int $id)\n {\n $path = '/tags/' . urlencode($id);\n $url = $this->buildUrl($path);\n $response = $this->makeRequest('GET', $url);\n return $response;\n }",
"function findSubscriber( $id )\r\n {\r\n // Create a database connection\r\n global $dbhost, $dbuser, $dbpass, $dbname;\r\n \r\n $connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);\r\n\r\n $query = \"SELECT * from ilr_subscriber WHERE id = $id \";\r\n $result = mysqli_query($connection, $query );\r\n\r\n if( $result->num_rows > 0 ){\r\n echo \"USER FOUND<br>\" .\r\n \"===========<br><br>\";\r\n if ($result->num_rows > 0) {\r\n // output data of each row\r\n if($row = $result->fetch_assoc()) {\r\n echo \"<br> ID: \". $row[\"id\"].\r\n \" Name: \". $row[\"firstname\"]. \" \". $row[\"lastname\"]. \" \".\r\n \" Email: \". $row[\"email\"]. \" \".\r\n \" Zip: \". $row[\"zip\"]. \"<br>\";\r\n }\r\n }\r\n }\r\n else {echo \"DID NOT FIND USER\";}\r\n \r\n // close db connection\r\n mysqli_close($connection);\r\n\r\n // return true if record added; otherwise false;\r\n return $row;\r\n }",
"protected function subscriber($subscriber_id) {\n return PushSubscriber::instance($this->id, $subscriber_id, 'PuSHSubscription', PuSHEnvironment::instance());\n }",
"public function getSubscriberObjectId()\n {\n return $this->subscriberObjectId;\n }",
"public function getById($id)\n {\n return $this->tagsRepository->find($id);\n }",
"public function show($id)\n {\n $tag=Tag::find($id);\n return $tag;\n }",
"public function show($id)\n {\n return Tag::find($id);\n }",
"function bbp_get_forum_subscribers($forum_id = 0)\n{\n}",
"public function getById($id)\n {\n $data = $this->getRep()->find($id);\n if($data->tags) {\n $data->tags = explode(\"-\", $data->tags);\n }\n return $data;\n }"
] | [
"0.6810836",
"0.6609941",
"0.61289847",
"0.6102591",
"0.596669",
"0.5936912",
"0.58934635",
"0.5845943",
"0.5795093",
"0.5795093",
"0.5776731",
"0.5737588",
"0.5612486",
"0.5581326",
"0.55605596",
"0.5554236",
"0.5550157",
"0.5537923",
"0.55229694",
"0.5509609",
"0.5486406",
"0.54688764",
"0.5447257",
"0.54040474",
"0.53689593",
"0.53639585",
"0.5358992",
"0.5348085",
"0.531265",
"0.5301098"
] | 0.83329713 | 0 |
/ Get all aq2emp_subscriber_tags | function get_all_aq2emp_subscriber_tags()
{
return $this->db->get('aq2emp_subscriber_tags')->result_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_aq2emp_subscriber_tag($id)\n {\n return $this->db->get_where('aq2emp_subscriber_tags',array('id'=>$id))->row_array();\n }",
"function get_all_aq2emp_campaign_tags()\n {\n return $this->db->get('aq2emp_campaign_tags')->result_array();\n }",
"public static function get_tags() {\n\n $array = array();\n\n /* Mandrill can't accept user defined tags due to tag limitations\n $terms = wp_get_post_terms( self::$row->email_id , 'inbound_email_tag' );\n\n foreach ($terms as $term) {\n $array[] = $term->name;\n }\n */\n\n $array[] = self::$email_settings['email_type'];\n\n self::$tags[ self::$row->email_id ] = $array;\n }",
"private function getTags()\n\t{\n\t\t$db = Database::instance();\n\t\t$result = $db->query(Database::SELECT, 'SELECT tagId, tagDesc FROM tags')->as_array();\n\t\treturn $result;\n\t}",
"public static function getSubscribers()\n {\n $db = Database::getConnection();\n $sql = 'SELECT * FROM subscribers ORDER BY subscription_date DESC';\n\n $result = $db->prepare($sql);\n\n //Return the next row as an array indexed by column names\n $result->setFetchMode(PDO::FETCH_ASSOC);\n $result->execute();\n\n return $result->fetchAll();\n }",
"public function getTags(){}",
"private function __getTags() {\n $sql = 'SELECT \"tag\" FROM \"tag\"';\n $res = $this->__execSql($sql);\n return array_map(function($v) { return $v['tag']; }, $res);\n }",
"public function getTags();",
"public function getTags();",
"public function getTags();",
"public function getTags();",
"public function getTags();",
"public function getTags() {\n\n $id = (integer) $this->getId();\n if ($id <= 0) {\n return array();\n }\n\n $cacheTag = sprintf('serviceTags%d', $id);\n $tags = Default_Helpers_Cache::load($cacheTag);\n\n if ($tags == null) {\n \n $db = Zend_Registry::get('dbAdapterReadOnly');\n $select = $db->select()\n ->from(array('t' => 'tags'), array('tag' => 't.name'))\n ->join(array('rt' => 'restaurant_tags'), \"rt.tagId = t.id\", array())\n ->where(\"rt.restaurantId = ?\", $id);\n\n $tags = $db->fetchAll($select); \n Default_Helpers_Cache::store($cacheTag, $tags);\n }\n\n return $tags;\n }",
"public function getSubscribers()\n {\n //global $db;\n\n $sql=\"SELECT * FROM sms.subscriptions WHERE 1 AND last_call<CURDATE();\";\n $q=$this->db->query($sql) or die($db->error);\n $dat=[];\n while ($r=$q->fetch_assoc()) {\n $dat[]=$r;\n }\n return $dat;\n }",
"public function getAllTags();",
"public function getTags(): array;",
"public function getTags(): array;",
"public function getTags()\n {\n $this->endPoint = \"/Tags\";\n $this->get();\n }",
"public function subscribers(): BelongsToMany\n {\n return $this->belongsToMany(Subscriber::class, 'sendportal_tag_subscriber')->withTimestamps();\n }",
"public function getTags()\n {\n return $this->getDb()->fetchAll(\"SELECT DISTINCT (id) FROM cache_tags\");\n }",
"public function getTags() : array;",
"public function getList()\r\n {\r\n $query = $this->DbConn->select();\r\n $query->from(array('t' => 'view_tags__dictionary'), 't.id');\r\n $query->joinLeft(array('r' => 'zanby_tags__relations'), 't.id = r.tag_id');\r\n $query->where('r.entity_id = ?', $this->getEvent()->getId());\r\n $query->where('r.entity_type_id = ?', $this->EntityTypeId);\r\n $query->where('r.status = ?', 'user');\r\n $tags = $this->DbConn->fetchCol($query);\r\n foreach($tags as &$tag) $tag = new Warecorp_Data_Tag($tag);\r\n return $tags;\r\n }",
"public function getTags()\n {\n return $this->tags->findAll();\n }",
"public function getSubscribers(): array\n {\n return $this->_subscribers;\n }",
"function getTagsList() {\n\t\t\n\t\tee()->load->library('file_cache');\n\t\t\n\t\t$cache = ee()->file_cache->getCache('acs_bridge', 'tags_list', 2592000);\n\t\t\n\t\tif ($cache === FALSE) {\n\t\t\ttry {\n\t\t\t\t$TagsListArray = array(\n\t\t\t\t\t'token'\t\t=> $this->_getLoginToken(),\n\t\t\t\t);\n\t\t\t\n\t\t\t\t// Fetches and stores the XML/SOAP response\n\t\t\t\t$xml = ee()->event_client->getTagsList($TagsListArray);\n\t\t\t\t$xmlResponse = $xml->getTagsListResult->any;\n\n\t\t\t\t// Master array of keys to map\n\t\t\t\t$m = array('tagid','tagname','isactive');\n\t\t\t\t\n\t\t\t\t// Convert the XML to an array for easier management and caching\n\t\t\t\t$tagList = $this->_xml_parser($xmlResponse, $m);\n\t\t\t\n\t\t\t\t// Cache the array\n\t\t\t\tee()->file_cache->saveCache('acs_bridge', 'tags_list', $tagList);\n\t\t\t\n\t\t\t\treturn $tagList;\n\t\t\t} catch (SoapFault $f) {\n\t\t\t\tthrow new SoapFault($f->faultcode, $f->faultstring);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $cache['tags_list'];\n\t\t}\n\t}",
"function bbp_get_topic_tag_list($topic_id = 0, $args = array())\n{\n}",
"public function getAllTags(){\n return Tag::all();\n }",
"function get_tags () {\n $db = $this->getDatabase();\n\n $id = $db->escape($this->perso->id);\n $sql = \"SELECT tag_code, tag_class FROM \" . TABLE_PROFILES_TAGS\n . \" WHERE perso_id = '$id'\";\n if (!$result = $db->query($sql)) {\n message_die(SQL_ERROR, \"Can't get tags\", '', __LINE__, __FILE__, $sql);\n }\n $tags = [];\n while ($row = $db->fetchRow($result)) {\n $tags[$row['tag_class']][] = $row['tag_code'];\n }\n return $tags;\n }",
"public function getTagNames()\r\n {\r\n return $this->dao->select('id,tag')->from('blog_tag')->orderBy('id')->fetchAll();\r\n }",
"public function tags()\n {\n return [];\n }"
] | [
"0.7429823",
"0.6846258",
"0.6401675",
"0.6321386",
"0.631485",
"0.62409127",
"0.6231974",
"0.62126887",
"0.62126887",
"0.62126887",
"0.62126887",
"0.62126887",
"0.618392",
"0.6163281",
"0.6149766",
"0.6132009",
"0.6132009",
"0.6130951",
"0.60591763",
"0.6056378",
"0.6043074",
"0.601852",
"0.59925026",
"0.5938301",
"0.5929618",
"0.59261465",
"0.59104997",
"0.58914346",
"0.5884456",
"0.5882975"
] | 0.84204024 | 0 |
/ function to add new aq2emp_subscriber_tag | function add_aq2emp_subscriber_tag($params)
{
$this->db->insert('aq2emp_subscriber_tags',$params);
return $this->db->insert_id();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_aq2emp_campaign_tag($params)\n {\n $this->db->insert('aq2emp_campaign_tags',$params);\n return $this->db->insert_id();\n }",
"public function addTag(Tx_Addresses_Domain_Model_Tag $tag) {\n \t\t$this->tags[] = $tag;\n\t}",
"public function addTag($tag);",
"function InsertSubscriber($objSubscriber){\n if((int)$objSubscriber->intSubscriberId > 0){\n //update the subscriber\n return Database::Get()->UpdateSubscriber($objSubscriber);\n }\n else{\n return Database::Get()->InsertSubscriber($objSubscriber);\n }\n }",
"public function add()\n\t{\n\t\t$stmt = \"INSERT INTO tl_newsletter_recipients\n\t\t\t\t\t\t (pid, tstamp, email, active, addedOn, ip, token, salutation, title, firstname, lastname, company, street, ziploc, phone, comment)\n\t\t\t\t\t\t VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\n\t\t\\Database::getInstance()->prepare($stmt)->execute(\n\t\t\t$this->pid,\n\t\t\t$this->tstamp,\n\t\t\t$this->email,\n\t\t\t$this->active,\n\t\t\t$this->addedOn,\n\t\t\t$this->ip,\n\t\t\t$this->token,\n\t\t\t$this->salutation,\n\t\t\t$this->title,\n\t\t\t$this->firstname,\n\t\t\t$this->lastname,\n\t\t\t$this->company,\n\t\t\t$this->street,\n\t\t\t$this->ziploc,\n\t\t\t$this->phone,\n\t\t\t$this->comment\n\t\t);\n\n\t\t// Log activity\n\n\t\t\\Controller::log($this->email . ' subscribed to Channel with ID: ' . $this->pid, 'Subscriber add()', TL_NEWSLETTER);\n\t}",
"public function creating($tag)\n {\t\n\t\tparent::creating($tag);\n\n Log::Debug(\"Creating tag\", ['tag' => $tag->id]);\n }",
"public function addTag($tag) \n {\n $this->tags[] = $tag; \n }",
"function delete_aq2emp_subscriber_tag($id)\n {\n $response = $this->db->delete('aq2emp_subscriber_tags',array('id'=>$id));\n if($response)\n {\n return \"aq2emp_subscriber_tag deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting aq2emp_subscriber_tag\";\n }\n }",
"public static function addSubscription($arrSuscriptions){\r\n\t\t$db = new Db();\r\n $tableName = Utils::setTablePrefix('subscription_tracker');\r\n $subscriptId = $db->insert($tableName,$arrSuscriptions); \r\n\t\treturn $subscriptId;\r\n\t}",
"function tag_added2subcate()\n\t {\n\t\tif($this->Auth->request_access_check())\n\t {\n\t \t$tag_str = $this->input->post('tag_str',TRUE);\n\t \tif($tag_str)\n\t \t{\n\t \t\t$tag_arr = explode('@@',$tag_str);\n\t \t}\n\t \telse\n\t \t{\n\t \t\t$tag_arr = array();\n\t \t}\n\t \t$id_info_str = $this->input->post('id_info',TRUE);\n\t \tif($id_info_str)\n\t \t{\n\t \t\t$id_info = explode('_',$id_info_str);\n\t \t}\n\t \telse\n\t \t{\n\t \t\t$id_info = array();\n\t \t}\n\t\t\t$user_id = $this->session->userdata('uId');\n\t\t\t\n\t\t\t$data = array('uId'=>$user_id,'sub_cate_id'=>$id_info[1],'category_id'=>$id_info[0],'langCode'=>$_POST['langCode'],'tag_arr'=>$tag_arr);\n\t\t\t\n\t\t\t$this->User_privatetag_manage->privatetag_add_process($data);\n\t\t\techo $this->Check_process->get_prompt_msg(array('pre'=>'profile','code'=> UPDATE_SUCCESS));\n }\n\t }",
"protected function _SubscriptionTag_addTag(\\Hatchbuck\\Entity\\Contact $contact, $subscriptionId)\n {\n $tagList = $contact->getTagList();\n $isTaggedAlready = false;\n foreach ($tagList as $tag) {\n if ($tag->getId() == static::$HATCHBUCK_SUBSCRIPTION_TAG_MAP[$subscriptionId]) {\n $isTaggedAlready = true;\n break;\n }\n }\n \n // If the user is tagged already, we don't need to add the tag, so just finish here\n if ($isTaggedAlready) {\n return;\n }\n \n // Otherwise we need to add the tag\n $tagSubscription = new \\Hatchbuck\\Entity\\Tag();\n $tagSubscription->setId(static::$HATCHBUCK_SUBSCRIPTION_TAG_MAP[$subscriptionId]);\n \n $this->_hatchbuck->addTag($contact, [$tagSubscription]);\n }",
"function extendedforum_subscribe($userid, $extendedforumid) {\n\n if (record_exists(\"extendedforum_subscriptions\", \"userid\", $userid, \"extendedforum\", $extendedforumid)) {\n return true;\n }\n\n $sub = new object();\n $sub->userid = $userid;\n $sub->extendedforum = $extendedforumid;\n\n return insert_record(\"extendedforum_subscriptions\", $sub);\n}",
"public function addTag(string $tag): void;",
"public function addTag($tag) {\n $this->changes[] = [\n 'type' => 'tag',\n 'add' => $tag\n ];\n }",
"public function addTag($tag) {\n $this->tag[] = strtolower($tag);\n }",
"function addSubscriber( $first, $last, $email, $zip )\r\n {\r\n global $dbhost, $dbuser, $dbpass, $dbname;\r\n $connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);\r\n $query = \"INSERT INTO ilr_subscriber (\";\r\n $query .= \" firstname, lastname, email, zip\";\r\n $query .= \") VALUES (\";\r\n $query .= \" '{$first}', '{$last}', '{$email}', '{$zip}' \";\r\n $query .= \")\";\r\n $result = mysqli_query($connection, $query );\r\n\r\n if ($result) {\r\n // Success\r\n echo \"Success! Subsciber added to ilr_subscriber DB.\";\r\n } else {\r\n // Failure\r\n die(\"Database ilr_subscriber query failed. \" . mysqli_error($connection));\r\n }\r\n\r\n if ($result) {\r\n // Success\r\n echo \"Success! Subsciber added to wp_es_emaillist DB.\";\r\n } else {\r\n // Failure\r\n die(\"Database wp_es_emaillist query failed. \" . mysqli_error($connection));\r\n }\r\n\r\n // close db connection\r\n mysqli_close($connection);\r\n }",
"function update_aq2emp_subscriber_tag($id,$params)\n {\n $this->db->where('id',$id);\n $response = $this->db->update('aq2emp_subscriber_tags',$params);\n if($response)\n {\n return \"aq2emp_subscriber_tag updated successfully\";\n }\n else\n {\n return \"Error occuring while updating aq2emp_subscriber_tag\";\n }\n }",
"public function created($tag)\n {\n parent::created($tag);\n\n Log::Info(\"Created tag\", ['tag' => $tag->id]);\n }",
"private function addTagsToQuestion()\n {\n $this->di->dispatcher->forward([\n 'controller' => 'question-tag',\n 'action' => 'add',\n 'params' => [$this->lastInsertedId, $this->Value('tags')]\n ]);\n }",
"function video_addTag($videoid=null,$sessionid=null,$newtag=null) {\n \n $videodetails = $this->video_details($videoid,$sessionid);\n \n if (is_array($videodetails['video']['tags']['global']) && count($videodetails['video']['tags']['global']) > 1) {\n for ($i=0;$i<count($videodetails['video']['tags']['global']);$i++) {\n $videodetails['video']['tags']['global'][$i] = '\"'.$videodetails['video']['tags']['global'][$i].'\"';\n }\n $tags = implode(\",\",$videodetails['video']['tags']['global']);\n } else {\n $tags = $videodetails['video']['tags']['global'];\n }\n \n if ($tags == '') {\n $tags = $newtag;\n } else {\n $tags .= ','.$newtag;\n }\n \n $newvideodetails = $this->video_setdetails(array('video_id'=>$videoid,'sessionid'=>$sessionid,'tags'=>$tags));\n \n return $newvideodetails;\n \n }",
"public function addTag($tag)\n {\n $this->tags[] = $tag;\n }",
"public function addTag($tag)\n {\n $this->tags[] = $tag;\n }",
"public function addSubscription() {\n if(IS_DEVELOPMENT){\n $startTime = microtime(true);\n }\n AbuseDetection::check();\n $subscriptionData = array(\n 'answerID' => $this->input->post('answerID'),\n 'documentID' => $this->input->post('docId'),\n 'versionID' => $this->input->post('versionID')\n );\n\n $response = $this->model('Okcs')->addSubscription($subscriptionData);\n if(IS_DEVELOPMENT){\n $timingArray = $this->calculateTimeDifference($startTime, 'addSubscription | OkcsAjaxRequestController');\n $response->ajaxTimings = $timingArray;\n }\n\n if($response->errors) {\n $response = $this->getResponseObject($response);\n $response['result'] = array('failure' => Config::getMessage(ERROR_PLEASE_TRY_AGAIN_LATER_MSG));\n }\n $this->_renderJSON($response);\n }",
"function bbp_add_user_topic_subscription($user_id = 0, $topic_id = 0)\n{\n}",
"public function addSubscriber(SubscriberInterface $subscriber): string;",
"public function addSubscriber(Tx_MmForum_Domain_Model_User_FrontendUser $user) {\n\t\t$this->subscribers->attach($user);\n\t}",
"public function addSubscriber(Tx_MmForum_Domain_Model_User_FrontendUser $user) {\n\t\t$this->subscribers->attach($user);\n\t}",
"function add_status_tags($status_id, $uid)\n{\n\t$query_to_add_tags = \"Insert into StatusTag values ('\" . $status_id .\"','\". $uid .\"') \" ;\n\tquery_to_mysql($query_to_add_tags);\n}",
"function add_tag( $data ) {\n $this->load->database('default');\n \n $this->db->insert('tag', $data);\n \n $message = FALSE;\n \n //check if errors were encountered while inserting\n if( $this->db->_error_message() ): \n $message['type'] = \"error\";\n $message['body'] = $this->db->_error_message();\n else:\n $message['type'] = \"success\";\n $message['body'] = \"Successfully added Hadith Tag.\";\n endif;\n \n return $message;\n }",
"public function addSubscriberRole($subscriberRole);"
] | [
"0.6120276",
"0.5868395",
"0.5791823",
"0.5743869",
"0.5703064",
"0.5676327",
"0.56727624",
"0.56400084",
"0.56199545",
"0.5603999",
"0.55462456",
"0.5526218",
"0.5500141",
"0.5485219",
"0.54851747",
"0.5439472",
"0.54303694",
"0.539867",
"0.53848577",
"0.5376805",
"0.5376407",
"0.5376407",
"0.53330314",
"0.5314885",
"0.5296111",
"0.5281943",
"0.5281943",
"0.5281338",
"0.5280441",
"0.52458996"
] | 0.7434322 | 0 |
/ function to update aq2emp_subscriber_tag | function update_aq2emp_subscriber_tag($id,$params)
{
$this->db->where('id',$id);
$response = $this->db->update('aq2emp_subscriber_tags',$params);
if($response)
{
return "aq2emp_subscriber_tag updated successfully";
}
else
{
return "Error occuring while updating aq2emp_subscriber_tag";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_aq2emp_subscriber_tag($params)\n {\n $this->db->insert('aq2emp_subscriber_tags',$params);\n return $this->db->insert_id();\n }",
"public function updateSubscriberSubscription($is_active = true)\n {\n $wp_user = $this->getWordpressUser();\n\n if($is_active)\n {\n update_user_meta($wp_user->ID, 'wp_capabilities', array('employer'=>true));\n }\n }",
"public function updateCTag();",
"public function testUpdateSubscriber()\n {\n // Get auth token\n $token = $this->authenticate();\n\n // use factory to create Subscriber record\n $subscriber = factory(\\App\\Subscriber::class)->create();\n \n // set new data\n $data = [\n 'firstname' => $this->faker->name,\n 'state' => 'unsubscribed'\n ];\n \n // udpate subscriber\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer '. $token,\n ])->json('PATCH', route('subscribers.update', $subscriber->id), $data);\n \n // test successful response\n $response->assertStatus(200);\n }",
"public function changeSubscribeEmail(Varien_Event_Observer $observer) {\n\t\t$mapFields = Mage::getStoreConfig ( 'fourdem/fourdem_mapping' );\n\t\t$customFields = array ();\n\t\t$oldDataCustomer = $observer->getCustomer ()->getOrigData ();\n\t\t$newDataCustomer = $observer->getCustomer ()->getData ();\n\t\t\n\t\t$listID = Mage::getStoreConfig ( 'fourdem/system_access/customer_list' );\n\t\t$oldEmailCustomer = $oldDataCustomer ['email'];\n\t\t$newEmailCustomer = $newDataCustomer ['email'];\n\t\t$customerModel = Mage::getModel ( 'customer/customer' )->load ( $newDataCustomer ['entity_id'] );\n\t\t\n\t\tif (empty ( $oldEmailCustomer )) {\n\t\t\treturn;\n\t\t\t$oldEmailCustomer = $newEmailCustomer;\n\t\t}\n\t\t\n\t\tforeach ( $mapFields as $label => $customFieldID ) {\n\t\t\tif (! empty ( $customFieldID )) {\n\t\t\t\t$billingValueField = $customerModel->getData ( $label );\n\t\t\t\t\n\t\t\t\tif (! empty ( $billingValueField )) {\n\t\t\t\t\t\n\t\t\t\t\t// ************************** INIZIO MODIFICA CAMPI PERSONALIZZATI SELECT *************************************\n\t\t\t\t\t// Step 1 - Verifica se il campo è personalizzato e di tipo select\n\t\t\t\t\t$Custom_Var = Mage::getResourceModel ( 'customer/attribute_collection' )->addFieldToFilter ( 'is_user_defined', '1' )->addFieldToFilter ( 'attribute_code', $label )->addFieldToFilter ( 'frontend_input', 'select' )->getItems ();\n\t\t\t\t\t// Step 2 - Carica il valore testuale della selezione (il campo contiene l'ID della option selezionata dall'utente\n\t\t\t\t\tif (! empty ( $Custom_Var ) && isset ( $Custom_Var )) {\n\t\t\t\t\t\t$customerModel = Mage::getModel ( 'customer/customer' ); /* ->setStoreId ( $modelCustomer->getData ( 'store_id' ) ); */\n\t\t\t\t\t\t$attr = $customerModel->getResource ()->getAttribute ( $label );\n\t\t\t\t\t\tif ($attr->usesSource ()) {\n\t\t\t\t\t\t\t$currentStore = Mage::app ()->getStore ()->getCode ();\n\t\t\t\t\t\t\tMage::app ()->getStore ()->setId ( 0 );\n\t\t\t\t\t\t\t$billingValueField = $attr->getSource ()->getOptionText ( $billingValueField );\n\t\t\t\t\t\t\tMage::app ()->getStore ()->setId ( $currentStore );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// ************************** FINE MODIFICA CAMPI PERSONALIZZATI SELECT ************************************\n\t\t\t\t\t// Website and WebStore names\n\t\t\t\t\tif ($label == \"website_id\") {\n\t\t\t\t\t\t$billingValueField = Mage::app ()->getWebsite ( $billingValueField )->getName ();\n\t\t\t\t\t}\n\t\t\t\t\tif ($label == \"store_id\") {\n\t\t\t\t\t\t$billingValueField = Mage::app ()->getStore ( $billingValueField )->getName ();\n\t\t\t\t\t}\n\t\t\t\t\t// ----- end ---\n\t\t\t\t\t\n\t\t\t\t\t$key = 'Fields' . $customFieldID;\n\t\t\t\t\t$customFields [$key] = '&Fields[CustomField' . $customFieldID . ']=' . $billingValueField;\n\t\t\t\t} else {\n\t\t\t\t\tif (is_object ( $customerModel->getDefaultBillingAddress () )) {\n\t\t\t\t\t\t$billingDefaultAddress = $customerModel->getDefaultBillingAddress ()->getData ();\n\t\t\t\t\t\t$billingValueField = $billingDefaultAddress [$label];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// ************************** INIZIO MODIFICA CAMPI PERSONALIZZATI SELECT *************************************\n\t\t\t\t\t\t// Step 1 - Verifica se il campo è personalizzato e di tipo select\n\t\t\t\t\t\t$Custom_Var = Mage::getResourceModel ( 'customer/attribute_collection' )->addFieldToFilter ( 'is_user_defined', '1' )->addFieldToFilter ( 'attribute_code', $label )->addFieldToFilter ( 'frontend_input', 'select' )->getItems ();\n\t\t\t\t\t\t// Step 2 - Carica il valore testuale della selezione (il campo contiene l'ID della option selezionata dall'utente\n\t\t\t\t\t\tif (! empty ( $Custom_Var ) && isset ( $Custom_Var )) {\n\t\t\t\t\t\t\t$customerModel = Mage::getModel ( 'customer/customer' ); /* ->setStoreId ( $modelCustomer->getData ( 'store_id' ) ); */\n\t\t\t\t\t\t\t$attr = $customerModel->getResource ()->getAttribute ( $label );\n\t\t\t\t\t\t\tif ($attr->usesSource ()) {\n\t\t\t\t\t\t\t\t$currentStore = Mage::app ()->getStore ()->getCode ();\n\t\t\t\t\t\t\t\tMage::app ()->getStore ()->setId ( 0 );\n\t\t\t\t\t\t\t\t$billingValueField = $attr->getSource ()->getOptionText ( $billingValueField );\n\t\t\t\t\t\t\t\tMage::app ()->getStore ()->setId ( $currentStore );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// ************************** FINE MODIFICA CAMPI PERSONALIZZATI SELECT ************************************\n\t\t\t\t\t\t// Website and WebStore names\n\t\t\t\t\t\tif ($label == \"website_id\") {\n\t\t\t\t\t\t\t$billingValueField = Mage::app ()->getWebsite ( $billingValueField )->getName ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($label == \"store_id\") {\n\t\t\t\t\t\t\t$billingValueField = Mage::app ()->getStore ( $billingValueField )->getName ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// ----- end ---\n\t\t\t\t\t\t\n\t\t\t\t\t\t$key = 'Fields' . $customFieldID;\n\t\t\t\t\t\t$customFields [$key] = '&Fields[CustomField' . $customFieldID . ']=' . $billingValueField;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset ( $newDataCustomer ['is_subscribed'] ) && ! $newDataCustomer ['is_subscribed']) {\n\t\t\t// Se l'utente disabilita la newsletter lo disiscrivo da 4Marketing.it..\n\t\t\t$resource = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );\n\t\t\t$email = $newDataCustomer ['email'];\n\t\t\t$user = $resource->query ( \"SELECT * FROM devtrade_fourdem_users WHERE email_address = '\" . $email . \"'\" );\n\t\t\t$userRow = array_pop ( $user );\n\t\t\t$idUser = $userRow ['fourdem_id'];\n\t\t\t\n\t\t\tMage::helper ( 'fourdem' )->unsubscribeSubscriber ( $listID, $idUser, $email, true );\n\t\t\treturn;\n\t\t} elseif (isset ( $newDataCustomer ['is_subscribed'] ) && $newDataCustomer ['is_subscribed']) {\n\t\t\t// Se l'utente abilita la newsletter lo iscrivo nella lista 4Marketing.it impostata dall'utente.\n\t\t\t$email = $newDataCustomer ['email'];\n\t\t\t$ipAddress = $_SERVER ['REMOTE_ADDR'];\n\t\t\t\n\t\t\t//Mage::helper ( 'fourdem' )->newSubscriber ( $listID, $email, $ipAddress, $customFields, true, true );\n\t\t\tMage::helper ( 'fourdem' )->updateSubscriber ( $oldEmailCustomer, $newEmailCustomer, $listID, $customFields, true );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tMage::helper ( 'fourdem' )->updateSubscriber ( $oldEmailCustomer, $newEmailCustomer, $listID, $customFields, true );\n\t\treturn;\n\t}",
"protected function mergeSubscriberTags(string $content, Subscriber $subscriber): string\n {\n $tags = [\n 'email' => $subscriber->email,\n 'first_name' => $subscriber->first_name,\n 'last_name' => $subscriber->last_name,\n ];\n\n foreach ($tags as $key => $replace)\n {\n $search = '{{' . $key . '}}';\n\n $content = str_ireplace($search, $replace, $content);\n }\n\n return $content;\n }",
"public function addUpdateSubscriber( $data )\n {\n \n\t\t$AddUpdateSubscriber = new AddUpdateSubscriber;\n\n\t\t$AddUpdateSubscriber->setAccount( $this->Account )\n\t\t\t->setPassword( $this->Password )\n\t\t\t->setResAccount( $data['res_account'] )\n\t\t\t->setEmailAddress( $data['email_address'] )\n\t\t\t->setFirstName( $data['first_name'] )\n\t\t\t->setLastName( $data['last_name'] )\n\t\t\t->setAddress1( $data['address'] )\n\t\t\t->setAddress2( $data['address_2'] )\n\t\t\t->setCity( $data['city'] )\n\t\t\t->setState( $data['state'] )\n\t\t\t->setZip( $data['postal_code'] )\n\t\t\t->setPhone( $data['phone'] )\n\t\t\t->setSubscriptionLists( $data['subscription_lists'] )\n\t\t\t->setUnsubScribeLists( $data['unsubscribe_lists'] )\n\t\t\t->setGlobalUnsubscribeParm( $data['unsubscribe_param'] )\n\t\t\t->setCountry( $data['country'] );\n\t\t\n\t\t\n\t\t// Create SoapClient\n\t\t$client = new ReachSoapClient($this->WSDL, array('trace' => 1, 'encoding'=>'UTF-8'));\n\n\t\t// Invoke webservice method\n\t\t$response = $client->__soapCall(\"AddUpdateSubscriber\", array($AddUpdateSubscriber));\n\n\t\treturn $response;\n }",
"function InsertSubscriber($objSubscriber){\n if((int)$objSubscriber->intSubscriberId > 0){\n //update the subscriber\n return Database::Get()->UpdateSubscriber($objSubscriber);\n }\n else{\n return Database::Get()->InsertSubscriber($objSubscriber);\n }\n }",
"function tag_index_qid_update($data)\n\t {\n $sql = \"UPDATE tag_reverse_index SET question_id_str = concat(`question_id_str`,' {$data['nId']}') WHERE tag_id = {$data['tag_id']}\";\n $query = $this->db->query($sql);\n\t }",
"public function addSubscriber(SubscriberInterface $subscriber): string;",
"public function testUpdateSubscriberEmailExists()\n {\n // Get auth token\n $token = $this->authenticate();\n\n // use factory to create Subscriber record\n $subscriber = factory(\\App\\Subscriber::class)->create();\n $subscriber2 = factory(\\App\\Subscriber::class)->create();\n \n // set new data, including second subscriber email\n $data = [\n 'firstname' => $this->faker->name,\n 'state' => 'unsubscribed', \n 'email' => $subscriber2->email\n ];\n \n // udpate subscriber\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer '. $token,\n ])->json('PATCH', route('subscribers.update', $subscriber->id), $data);\n \n // test invalid request response\n $response->assertStatus(400);\n }",
"public function testUpdateSubscriptions()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function delete_aq2emp_subscriber_tag($id)\n {\n $response = $this->db->delete('aq2emp_subscriber_tags',array('id'=>$id));\n if($response)\n {\n return \"aq2emp_subscriber_tag deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting aq2emp_subscriber_tag\";\n }\n }",
"function bbp_admin_upgrade_user_topic_subscriptions()\n{\n}",
"public function notifyUpdateSubscription(SubscriptionEvent $event) {\n /*try {\n // Get the Stripe event.\n $subscription = $event->getSubscription();\n // Get the customer data.\n $customer = $event->getCustomer();\n $config = \\Drupal::config('stripe_subscription_and_customer.adminconfiguration');\n $mail_tid_update = $config->get('mail_tid_update');\n if(isset($mail_tid_update)) {\n // Send the email.\n $to = $customer->email;\n $term = Term::load($mail_tid_update);\n $s = $term->get('field_email_subject')->getValue();\n $m = $term->get('field_notification_full_message')->getValue();\n $langcode = LanguageInterface::LANGCODE_SITE_DEFAULT;\n $trail_end_raw = $subscription->__get('data')['object']['trial_end'];\n // $customer_first_name = explode(\" \",$customer->name)[0];\n $customer_user_id = $customer->metadata->user_uid;\n $customer_first_name = user_real_first_name($customer_user_id);\n $trail_end = date('n/j/Y', $trail_end_raw);\n $message = $m[0]['value'];\n $message = str_replace('{$trial_end_date}', $trail_end, $message);\n $message = str_replace('{$customer_first_name}', $customer_first_name, $message);\n $params = [\n 'subject' => $s[0]['value'],\n 'message' => $message,\n ];\n\n // Set a unique key for this mail.\n $key = 'stripe_subscription_and_customer_subscription_event';\n\n $message = $this->mailManager->mail('stripe_subscription_and_customer', $key, $to, $langcode, $params);\n if ($message['result']) {\n $this->logger->notice('Successfully sent email to %recipient.', ['%recipient' => $to]);\n }\n }\n }\n catch (\\Exception $e) {\n watchdog_exception('stripe_subscription_and_customer', $e);\n }*/\n }",
"function updateSignup_ET($email, $zip, $source, $group, $newsletter, $lid) {\n\t$wsdl = '../_includes/etframework.wsdl';\n\t\n\ttry{\n\t\t//echo \"got here\";\n\t\t\n\t\t/* Create the Soap Client */\n\t\t$client = new ExactTargetSoapClient($wsdl, array('trace'=>1));\n\t\n\t\t/* Set username and password here */\n\t\t$client->username = 'hdi_drm'; // was hdi-drm\n\t\t$client->password = 'exact@123'; // was campbuzz@1\n\t\n\t\t$subscriber = new ExactTarget_Subscriber(); \n\t\t$subscriber->EmailAddress = $email;\n\t\t$subscriber->Lists = array(); \n\t\t\t\t\t\n\t\t$attr_zip = new ExactTarget_Attribute();\n\t\t$attr_zip->Name = \"Zip Code\";\n\t\t$attr_zip->Value = $zip;\n\t\t\n\t\t$attr_source = new ExactTarget_Attribute();\n\t\t$attr_source->Name = \"Source\";\n\t\t$attr_source->Value = $source;\n\t\t\n\t\t$attr_group = new ExactTarget_Attribute();\n\t\t$attr_group->Name = \"group\";\n\t\t$attr_group->Value = $group;\n\t\t\n\t\t$attr_newsletter = new ExactTarget_Attribute();\n\t\t$attr_newsletter->Name = \"Newsletter\";\n\t\t$attr_newsletter->Value = $newsletter;\n\n\t\t$subscriber->Attributes=array($attr_zip, $attr_source, $attr_group, $attr_newsletter); \n\t\t\n\t\t$list = new ExactTarget_SubscriberList(); \n\t\t$list->ID = $lid;\n\t\t$subscriber->Lists[] = $list;\n\t\n\t\t$object = new SoapVar($subscriber, SOAP_ENC_OBJECT, 'Subscriber', \"http://exacttarget.com/wsdl/partnerAPI\");\n\t\n\t\t$request = new ExactTarget_UpdateRequest();\n\t\t$request->Options = NULL;\n\t\t$request->Objects = array($object);\n\t\n\t\t$results = $client->Update($request);\n\t\n//\t\techo \"<pre>\";\n//\t\t//echo \"what\";\n//\t\tvar_dump($results);\n//\t\techo \"</pre>\";\n\t\treturn $results;\n\t\n\t} catch (SoapFault $e) {\n\t\t\n\t\t// Add one to the counter\n\t\t$tries_updateSignup++;\n\t\t\n\t\t// Referring Page\n\t\t$ref = $_SERVER['HTTP_REFERER'];\n\t\t\n\t\t// If the form has failed less than three times,\n\t\tif ($tries_updateSignup <= 3) {\n\t\t\t\n\t\t\t// try again\n\t\t\tupdateSignup_ET($email, $zip, $source, $group, $newsletter, $lid);\n\t\t\t\n\t\t} else {\n\t\t\t// Alert [email protected] to ET API User locked out\n\t\t\tmailHDi();\n\t\t\t\n\t\t\t// Error message\n\t\t\techo \"<strong>Oops! There was an error in submitting the form.</strong><br>\n\t\t\tPlease <a href=\\\"javascript:history.go(-1);\\\">go back</a> to try signing up again.<br><br>\n\t\t\tIf you've been having difficulty submitting this form, please <a href=\\\"http://www.dreamfieldsfoods.com/dreamfields-pasta-contact.html\\\">contact Dreamfields</a> to let us know which web page caused you any trouble.<br><br>\n\t\t\tYou came from this page: {$ref}\";\n\t\t}\n\t\t\n//\t\techo \"oops\";\n//\t\techo \"<pre>\";\n//\t\t//echo \"what else\";\n//\t\tvar_dump($e);\n//\t\techo \"</pre>\";\n\t}\t\n\n}",
"public function incscribe2($subscribe_to) {\n\t $this->Userstat = ClassRegistry::init('Userstat');\n\t\t$this->Subscription = ClassRegistry::init('Subscription');\n\t\t//recoded begins for subscribes of user_id\n\t\t$user_id=$subscribe_to;\n\t\t$this->submitlog($user_id,\"incscribefast\");\n\t\t$userstatrow=$this->Userstat->find('first',array('conditions'=>array('Userstat.user_id'=>$user_id),'contain'=>false,'fields'=>array('Userstat.id')));\n\t\tif($userstatrow!=NULL)\n\t\t{\n\t\t$this->Userstat->id=$userstatrow['Userstat']['id'];\n\t }else{\n\t\t$this->Userstat->id=NULL;\n\t\t}\n\t\t$subscribe=$this->Subscription->find('count',array('conditions'=>array('Subscription.subscriber_id'=>$user_id)));\n\t\t $userstat_data=\n\t\t\tarray('Userstat' =>array(\n\t\t\t'user_id' => $user_id,\n\t\t\t'subscribe' => $subscribe));\n\t\t\t\n\t\tif($this->Userstat->save($userstat_data)){$this->potential($user_id);}\n\t\t//recoded ends\t\n\t\t//recoded begins for subscribeto of channel\n\t\t$userstatrow=$this->Userstat->find('first',array('conditions'=>array('Userstat.user_id'=>$subscribe_to),'contain'=>false,'fields'=>array('Userstat.id')));\n\t\tif($userstatrow!=NULL)\n\t\t{\n\t\t$this->Userstat->id=$userstatrow['Userstat']['id'];\n\t }else{\n\t\t//$this->Userstat->id=NULL;\n\t\t}\n\t\t$subscribeto=$this->Subscription->find('count',array('conditions'=>array('Subscription.subscriber_to_id'=>$subscribe_to)));\n\t\t$userstat_data2=\n\t\t\tarray('Userstat' =>array(\n\t\t\t'user_id' => $subscribe_to,\n\t\t\t'subscribeto' => $subscribeto));\n\t\t\n\t\tif($this->Userstat->save($userstat_data2)){$this->potential($subscribe_to);}\n\t\t//recoded ends\t\n\t}",
"function ActivateSubscriber()\n\t\t{\n\t\t\t$_REQUEST['mode'] \t\t= \"ActivateSubscriber\";\n\t\t\t$this->oModel->ActivateSubscriber($_REQUEST['identity']);\n\t\t\t//$this->oModel->ActivateEmployerJobs($_REQUEST['identity']);\n\t\t\t$err=\"Successfully Activated.\";\n\t\t\t$this->ListSubscriber($err);\t\t\t\n\t\t}",
"public function update_subscription( $subscription_code, $plan_id );",
"function bbp_form_topic_subscribed()\n{\n}",
"public function update(Request $request, Subscriber $subscriber)\n {\n //\n }",
"public function updateSubscription($id, $subscriber)\r\n {\r\n $stmt = $this->conn->prepare(\"UPDATE user_account SET subscription_type = ? WHERE user_id = ?\");\r\n $stmt->bind_param(\"ii\", $subscriber, $id);\r\n if($stmt->execute())\r\n {\r\n return true; \r\n } \r\n \r\n return false;\r\n }",
"function update_aq2emp_campaign_tag($id,$params)\n {\n $this->db->where('id',$id);\n $response = $this->db->update('aq2emp_campaign_tags',$params);\n if($response)\n {\n return \"aq2emp_campaign_tag updated successfully\";\n }\n else\n {\n return \"Error occuring while updating aq2emp_campaign_tag\";\n }\n }",
"public function setSubscriber($query = array(), $options = array()) {\n\t\tif (empty($query['email'])) {\n\t\t\treturn false;\n\t\t}\n\t\t$oAuth = $_SESSION['OAuth']['aweber'];\n\t\t$consumerKey = $oAuth['oauth_consumer_key'];\n\t\t$consumerSecret = $oAuth['oauth_consumer_secret'];\n\t\t$accessKey = $oAuth['oauth_token'];\n\t\t$accessSecret = $oAuth['oauth_token_secret'];\n\t\tApp::import('Vendor', 'Aweber.aweber/aweber_api/aweber');\n\t\t$aweber = new AWeberAPI($consumerKey, $consumerSecret);\n\t\t$account = $aweber->getAccount($accessKey, $accessSecret);\n\t\tif (isset($options['account_id'])) {\n\t\t\t$account_id = $options['account_id'];\n\t\t} else {\n\t\t\t$account_id = Set::extract($this->getAccounts(), 'entries.0.id');\n\t\t}\n\t\tif (isset($options['list_id'])) {\n\t\t\t$list_id = $options['list_id'];\n\t\t} else {\n\t\t\t$list_id = Set::extract($this->getLists(), 'entries.0.id');\n\t\t}\n\t\t$list = $account->loadFromUrl(\"/accounts/{$account_id}/lists/{$list_id}\");\n\t\t$subscribers = $list->subscribers;\n\t\t$new_subscriber = $subscribers->create($query);\n\t\treturn $new_subscriber;\n\t}",
"protected function getSubscriber() {\n\t $this->subscriber['firstname'] = $this->setFirstname();\n\t $this->subscriber['lastname'] = $this->setLastname();\n\t $this->subscriber['email'] = $this->setEmail();\n\t $this->subscriber['role'] = $this->setRole();\n\t $this->subscriber['mimetype'] = $this->setMimetype();\n\t $this->subscriber['password'] = $this->setPassword();\t\n\t}",
"function tag_update4question($data)\n\t {\n\t\t $tag_str = is_array($data['tag']) ? implode('|', $data['tag']):$data['tag'];\n\t\t $this->db->where('nId',$data['nId']);\n\t\t $this->db->set('tags',$tag_str);\n\t\t $this->db->update('questiontags');\n\t }",
"public function addUpdateSubscriber($data, $segments, $custom_fields,\n $send_welcome) {\n if (count($segments) > 0) {\n $data['grp'] = implode(',', $segments);\n }\n\n // Add any custom field values.\n foreach($custom_fields as $number => $value) {\n $data[\"custval{$number}\"] = $value;\n }\n\n if ($send_welcome) {\n $data['welcomeletter'] = '1';\n }\n\n if (variable_get('pm_signup_log', FALSE)) {\n db_insert('pm_signup_log')\n ->fields(array(\n 'handler' => 'bluehornet.api.inc',\n 'message' => 'api request',\n 'exception' => print_r($data, true),\n 'backtrace' => '',\n 'created' => REQUEST_TIME,\n ))\n ->execute();\n }\n\n // Add or update the subscriber.\n $response = $this->core->addUpdateSubscriber($data);\n\n return $response;\n }",
"function update_subscription($subscriptionId,$array){\n $return = Braintree_Subscription::update($subscriptionId,$array);\n /* echo \"<pre>\";\n print_r($return);\n exit;*/\n return $return;\n }",
"function addSignup_ET($email, $zip, $source, $group, $newsletter, $lid) {\n\t$wsdl = '../_includes/etframework.wsdl';\n\t\n\ttry{\n\t\t//echo \"got here\";\n\t\t\n\t\t/* Create the Soap Client */\n\t\t$client = new ExactTargetSoapClient($wsdl, array('trace'=>1));\n\t\n\t\t/* Set username and password here */\n\t\t$client->username = 'hdi_drm'; // was hdi-drm\n\t\t$client->password = 'exact@123'; // was campbuzz@1\n\t\n\t\t$subscriber = new ExactTarget_Subscriber(); \n\t\t$subscriber->EmailAddress = $email;\n\t\t$subscriber->Lists = array(); \n\n\t\t$attr_zip = new ExactTarget_Attribute();\n\t\t$attr_zip->Name = \"Zip Code\";\n\t\t$attr_zip->Value = $zip;\n\t\t\n\t\t$attr_source = new ExactTarget_Attribute();\n\t\t$attr_source->Name = \"Source\";\n\t\t$attr_source->Value = $source;\n\t\t\n\t\t$attr_group = new ExactTarget_Attribute();\n\t\t$attr_group->Name = \"group\";\n\t\t$attr_group->Value = $group;\n\t\t\n\t\t$attr_newsletter = new ExactTarget_Attribute();\n\t\t$attr_newsletter->Name = \"Newsletter\";\n\t\t$attr_newsletter->Value = $newsletter;\n\n\t\t$subscriber->Attributes=array($attr_zip, $attr_source, $attr_group, $attr_newsletter); \n\t\t\n\t\t$list = new ExactTarget_SubscriberList(); \n\t\t$list->ID = $lid; \n\t\t$subscriber->Lists[] = $list;\n\t\n\t\t$object = new SoapVar($subscriber, SOAP_ENC_OBJECT, 'Subscriber', \"http://exacttarget.com/wsdl/partnerAPI\");\n\t\n\t\t$request = new ExactTarget_UpdateRequest();\n\t\t$request->Options = NULL;\n\t\t$request->Objects = array($object);\n\t\n\t\t$results = $client->Update($request);\n\t\n//\t\techo \"<pre>\";\n//\t\t//echo \"what\";\n//\t\tvar_dump($results);\n//\t\techo \"</pre>\";\n\t\treturn $results;\n\t\n\t} catch (SoapFault $e) {\n\t\t\n\t\t// Add one to the counter\n\t\t$tries_addSignup++;\n\t\t\n\t\t// Referring Page\n\t\t$ref = $_SERVER['HTTP_REFERER'];\n\t\t\n\t\t// If the form has failed less than three times,\n\t\tif ($tries_addSignup <= 3) {\n\t\t\t\n\t\t\t// try again\n\t\t\taddSignup_ET($email, $zip, $source, $group, $newsletter, $lid);\n\t\t\t\n\t\t} else {\n\t\t\t// Alert [email protected] to ET API User locked out\n\t\t\tmailHDi();\n\t\t\t\n\t\t\t// Error message\n\t\t\techo \"<strong>Oops! There was an error in submitting the form.</strong><br>\n\t\t\tPlease <a href=\\\"javascript:history.go(-1);\\\">go back</a> to try signing up again.<br><br>\n\t\t\tIf you've been having difficulty submitting this form, please <a href=\\\"http://www.dreamfieldsfoods.com/dreamfields-pasta-contact.html\\\">contact Dreamfields</a> to let us know which web page caused you any trouble.<br><br>\n\t\t\tYou came from this page: {$ref}\";\n\t\t}\n\t\t\n//\t\techo \"oops\";\n//\t\techo \"<pre>\";\n//\t\t//echo \"what else\";\n//\t\tvar_dump($e);\n//\t\techo \"</pre>\";\n\t}\t\n\n}",
"function afww_lifecycle_update_subscriptions( $appid, $authtoken, $config )\n{\n \n $subs = afww_config_subscription( $config );\n \n foreach ( $subs as $sub )\n {\n afww_subscriptions_create( $appid, $authtoken, $sub );\n }\n}"
] | [
"0.6055641",
"0.58853686",
"0.55657226",
"0.54281956",
"0.5347486",
"0.53265154",
"0.5304892",
"0.5240149",
"0.5195789",
"0.5184688",
"0.5177401",
"0.5176082",
"0.5172687",
"0.5135927",
"0.5125444",
"0.51120955",
"0.5097966",
"0.508515",
"0.50318116",
"0.4987041",
"0.49834433",
"0.49794653",
"0.49743715",
"0.494932",
"0.49270293",
"0.49235827",
"0.49230734",
"0.49168548",
"0.4911885",
"0.49054122"
] | 0.6515594 | 0 |
/ function to delete aq2emp_subscriber_tag | function delete_aq2emp_subscriber_tag($id)
{
$response = $this->db->delete('aq2emp_subscriber_tags',array('id'=>$id));
if($response)
{
return "aq2emp_subscriber_tag deleted successfully";
}
else
{
return "Error occuring while deleting aq2emp_subscriber_tag";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DeleteSubscriber()\n\t\t{\t\t\t\t\t\t\t\n\t\t\t$_REQUEST['mode'] \t\t= \"DeleteSubscriber\";\n\t\t\t$this->oModel->DeleteSubscriber($_REQUEST['identity']);\n\t\t\t$err = \"Record(s) deleted successfully.\";\n\t\t\t$this->ListSubscriber($err);\n\t\t}",
"public function delete_tag($tag)\n\t{\n\t\t// Not implemented yet\n\t}",
"public function deleteTag($tag);",
"public function destroy(Subscriber $subscriber)\n {\n //\n }",
"function delete_aq2emp_campaign_tag($id)\n {\n $response = $this->db->delete('aq2emp_campaign_tags',array('id'=>$id));\n if($response)\n {\n return \"aq2emp_campaign_tag deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting aq2emp_campaign_tag\";\n }\n }",
"function delete() {\n\t\t\t$this->API->call(\"subscriptions?id=\".$this->ID,false,\"DELETE\");\n\t\t}",
"public function deleting($tag)\n {\n parent::deleting($tag);\n\n Log::Debug(\"Deleting tag\", ['tag' => $tag->id]);\n }",
"public function destroy($id)\n {\n $subscriber = Subscriber::find($id);\n if (count($subscriber) > 0) {\n $subscriber->delete();\n\n echo 1;\n exit;\n } else {\n echo 0;\n exit;\n }\n }",
"public function destroy( $id ) {\n\t\t$subscriber = Subscriber::find( $id );\n\t\tif ( count( $subscriber ) > 0 ) {\n\t\t\t$subscriber->delete();\n\n\t\t\techo 1;\n\t\t\texit;\n\t\t} else {\n\t\t\techo 0;\n\t\t\texit;\n\t\t}\n\t}",
"public function removeSubscriber() {\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t$subscribers = JRequest::getVar(\"subscriber_id\", array());\n\t\ttry\n\t\t{\n\t\t\t$model = $this->getModel(\"SubscribersModel\");\n\t\t\t$modelGroup = $this->getModel(\"NewsletterGroupsModel\");\n\t\t\t\n\t\t\tif (!count($subscribers) > 0) {\n\t\t\t\tthrow new ErrorException(sprintf(COM_POSTMAN_SELECT_NONE_ERROR, 'subscriber'), 1, 1, __FILE__, __NO__, null);\n\t\t\t}\n\n\t\t\t$nDeleted = 0;\t\t\t\n\t\t\tforeach($subscribers as $subscriberId) \n\t\t\t{\n\t\t\t\t$subscribedGroups = $model->getSubscribedGroupIds($subscriberId);\n\n\t\t\t\tforeach($subscribedGroups as $groupId) {\n\t\t\t\t\t$modelGroup->removeSubscriberFromGroup($subscriberId, $groupId);\n\t\t\t\t\t$this->LOG(sprintf(COM_POSTMAN_SUBSCRIBER_REMOVED, $subscriberId, $groupId));\n\t\t\t\t}\n\t\n\t\t\t\t$model->delete($subscriberId);\n\t\t\t\t$this->LOG(sprintf(COM_POSTMAN_SUBSCRIBER_DELETED, $subscriberId));\n\n\t\t\t\t$nDeleted++;\n\t\t\t}\n\n\t\t\tif ($nDeleted) {\n\t\t\t\t$msg = sprintf(COM_POSTMAN_N_ITEMS_REMOVED, $nDeleted, 'subscriber');\n\t\t\t\tJFactory::getApplication()->enqueueMessage($msg);\n\t\t\t}\n\t\t}catch(ErrorException $e){\n\t\t\t$this->handleError($e, sprintf(COM_POSTMAN_REMOVE_ERROR, 'subscriber'));\n\t\t}\n\t\t$this->listSubscribers();\n\t}",
"public function removeSubscriber(SubscriberInterface $subscriber): string;",
"public function testDeleteSubscriber()\n {\n // Get auth token\n $token = $this->authenticate();\n\n // use factory to create Subscriber record\n $subscriber = factory(\\App\\Subscriber::class)->create();\n \n // delete subscriber\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer '. $token,\n ])->json('DELETE', route('subscribers.destroy', $subscriber->id));\n \n // test successful response\n $response->assertStatus(200);\n }",
"function email_delete(){\n \n imap_delete($this->link, $this->msgid); \n\n }",
"public function destroy(string $consumerTag);",
"function unsubscribe($data, $mysql_credentials) {\n wh_log($data['email'] . ' just unsubscribed!');\n $dsn = DSN;\n $username = $mysql_credentials['user'];\n $password = $mysql_credentials['password'];\n $db_delete_h = new PDO($dsn, $username, $password);\n $sql = 'DELETE FROM subscribers WHERE email = :email';\n $vars = array('email' => $data['email']);\n $delete = $db_delete_h->prepare($sql);\n $delete->execute($vars);\n}",
"public function delete()\n {\n parent::delete();\n\n $this->channel->basic_ack($this->message->delivery_info['delivery_tag']);\n }",
"public function deleteTag($data)\r\n {\r\n $requiredKeys = ['id'];\r\n $this->requireKeys($requiredKeys, $data);\r\n\r\n return $this->makeRequest('/contacts/tags', self::DELETE, [], $data, ServerMessage::class);\r\n }",
"public function delete()\r\r\n {\r\r\n parent::delete();\r\r\n $this->queueInstance->deleteReserved($this->queue, $this->job);\r\r\n }",
"public function deleted($tag)\n {\n parent::deleted($tag);\n\n Log::Info(\"Deleted tag\", ['tag' => $tag->id]);\n }",
"public function delete()\n {\n @unlink(PIMCORE_LOG_MAIL_PERMANENT . '/email-' . $this->getId() . '-html.log');\n @unlink(PIMCORE_LOG_MAIL_PERMANENT . '/email-' . $this->getId() . '-text.log');\n $this->getResource()->delete();\n }",
"public function delete()\n\t{\n\t\t$db = PearDatabase::getInstance();\n\t\t$db->pquery('DELETE FROM vtiger_freetagged_objects WHERE tag_id = ? AND object_id = ?', array($this->get('tag_id'), $this->get('record')));\n\t}",
"public function testDeleteTag()\n {\n }",
"public function DeleteByTag($tagName);",
"function bbp_remove_user_topic_subscription($user_id = 0, $topic_id = 0)\n{\n}",
"function bbp_delete_topic($topic_id = 0)\n{\n}",
"public function delete($tag_name, $contact_id)\n {\n $this->Tag->delete($tag_name, $contact_id);\n }",
"public function testDeleteTag() {\n\t\t$tag = $this->_createTag('work');\n\t\t$id = $tag->getId();\n\t\t$tag2 = $this->service->deleteTag($tag);\n\n\t\t$this->assertTrue($tag == $tag, \"'deleteTag' method doesn't return proper object.\");\n\t\t$this->assertInstanceOf('Cvut\\Fit\\BiPwt\\BlogBundle\\Entity\\Tag', $tag2, \"'deleteTag' method doesn't return object of proper class.\");\n\n\t\ttry {\n\t\t\t$tag3 = $this->service->findTag($id);\n\t\t\t$this->assertNull($tag3, \"Deleted tag still can be found.\");\n\t\t} catch(\\Exception $e) {}\n\t}",
"function deleteSubscriber( $id )\r\n {\r\n global $dbhost, $dbuser, $dbpass, $dbname;\r\n\r\n // Create a database connection\r\n $connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);\r\n\r\n $query = \"DELETE from ilr_subscriber WHERE id = $id\";\r\n $result = mysqli_query($connection, $query );\r\n\r\n if( $result )\r\n echo \"USER DELETED <br>\";\r\n\r\n else\r\n echo \"DID NOT DELETE USER <br> \";\r\n \r\n // close db connection\r\n mysqli_close($connection);\r\n }",
"private function remove_tag($tag_obj)\n\t{\n\t\ttry {\t\t\n\t\t\tif (!$tag_obj->save())\n\t\t\t{\n\t\t\t\tKohana_Log::instance()->add(Kohana_Log::ERROR, 'Model_Question::remove_tag(): ' .\n\t\t\t\t\tsprintf('Error while saving tag with name: %s, id: %d', $tag_obj->value, $tag_obj->id));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tORM::factory('post', $this->id)->remove('tags', $tag_obj);\n\t\t}\n\t\tcatch (Exception $ex) {\n\t\t\tKohana_Log::instance()->add(Kohana_Log::ERROR, 'Model_Question::remove_tag(): ' . $ex->getMessage());\n\t\t}\n\t}",
"function bbp_untrash_topic($topic_id = 0)\n{\n}"
] | [
"0.66149276",
"0.64952886",
"0.6461639",
"0.63621205",
"0.63562924",
"0.6223901",
"0.61254674",
"0.603416",
"0.601854",
"0.5973424",
"0.59489036",
"0.5911201",
"0.5893431",
"0.58104557",
"0.575718",
"0.57443273",
"0.57312816",
"0.5730629",
"0.57271653",
"0.56366557",
"0.5635212",
"0.562078",
"0.56085765",
"0.5607169",
"0.5604056",
"0.55571556",
"0.55556095",
"0.55418944",
"0.55342567",
"0.55236524"
] | 0.7727372 | 0 |
Get the total number of sticky posts we have. | public static function count_sticky_posts() {
// Get the data from our option table.
$sticks = self::get_single_option( 'sticky_posts' );
// Return the count, or zero.
return ! empty( $sticks ) && is_array( $sticks ) ? count( $sticks ) : 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function KRS_STG_stt2_db_get_number_of_posts()\r\n\t{\r\n\t\t// wp_die($post_count);\r\n\t\tglobal $id;\r\n\t\tif (!isset($post_count)) {\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$sql = \"SELECT count(`ID`) FROM $wpdb->posts WHERE `post_status` = 'publish' AND `post_type` = 'post';\";\r\n\t\t\t$post_count = $wpdb->get_var($sql);\r\n\t\t\twp_cache_set('stt2_get_number_of_posts' . $id, $post_count, 3600);\r\n\t\t} else\r\n\t\t\t$post_count = wp_cache_get('stt2_get_number_of_posts' . $id);\r\n\t\treturn $post_count;\r\n\t}",
"public function count()\n {\n return count($this->posts);\n }",
"public function getAmountOfPosts()\n {\n $sql = \"SELECT COUNT(id) AS amount_of_postss FROM posts\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n return $query->fetch()->amount_of_postss;\n }",
"public function getNumPosts()\n {\n return $this->numPosts;\n }",
"public function getNumPosts()\n {\n return (int)$this->data['numPosts'];\n }",
"function getPostCount() {\n\t\tif ($this->postCount < 0) {\n\t\t\t$db = DB::getHandle();\n\t\t\t$db->query(\n\t\t\t\tClassForum_Queries::getQuery('replyCountForum',\n\t\t\t\t\tarray($this->_dao->getPrimaryKey())\n\t\t\t\t)\n\t\t\t);\n\t\t\t$db->nextRecord();\n\t\t\t$this->postCount = $db->record['num'];\n\t\t}\n\t\treturn $this->postCount;\n\t}",
"public function getTotalPosts()\n {\n return $this->totalPosts;\n }",
"public function countPosts()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) FROM posts');\n $req->execute();\n $countingPost = $req->fetchColumn();\n \n return $countingPost;\n }",
"public function getNumPosts() {\n return $this->numposts;\n }",
"public function getPostCount() {\n\t\treturn $this -> data['posts'];\n\t}",
"function affinity_mikado_get_sticky_scroll_amount() {\n\n\t\t//sticky menu scroll amount\n\t\tif(affinity_mikado_options()->getOptionValue('header_type') !== 'header-vertical' &&\n\t\t in_array(affinity_mikado_options()->getOptionValue('header_behaviour'), array(\n\t\t\t 'sticky-header-on-scroll-up',\n\t\t\t 'sticky-header-on-scroll-down-up'\n\t\t ))\n\t\t) {\n\n\t\t\t$sticky_scroll_amount = affinity_mikado_filter_px(affinity_mikado_get_meta_field_intersect('scroll_amount_for_sticky'));\n\n\t\t\treturn $sticky_scroll_amount !== '' ? intval($sticky_scroll_amount) : 0;\n\t\t}\n\n\t\treturn 0;\n\n\t}",
"public function numberPost()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) as total FROM posts');\n \n $result = $req->fetch();\n \n return $result;\n }",
"function post_count() {\n global $wpdb;\n return $wpdb->get_var(\"SELECT count(id)\n FROM $wpdb->posts\n WHERE post_type = 'post'\n AND post_status = 'publish'\");\n}",
"public function getNumPosts()\n {\n return $this->getConfigValue(self::CONFIG_NUM_POSTS);\n }",
"public function getPostCount()\n {\n return count($this->post);\n }",
"public function get_num_forum_posts()\n {\n return $this->connection->query_select_value('messages', 'COUNT(*)');\n }",
"public function getPostsCount(){\n\t\t\t$this->db->query(\"SELECT COUNT(id) as total_posts FROM posts\");\n\t\t\t$row = $this->db->single();\n\t\t\treturn $row;\n\t\t}",
"protected function _get_num_new_forum_posts()\n {\n return $this->connection->query_value_if_there('SELECT COUNT(*) FROM ' . $this->connection->get_table_prefix() . 'messages WHERE posterTime>' . strval(time() - 60 * 60 * 24));\n }",
"public function getPostCount() {\n\t\t$postCount = $this->postCount;\n\t\tforeach ($this->getChildren() as $child) {\n\t\t\t/** @var $child Tx_MmForum_Domain_Model_Forum_Forum */\n\t\t\t$postCount += $child->getPostCount();\n\t\t}\n\t\treturn $postCount;\n\t}",
"public function showPostsCount()\n {\n $key = 'show_posts_count';\n if (!$this->hasData($key)) {\n $this->setData($key, (bool)$this->_scopeConfig->getValue(\n 'mfblog/sidebar/'.$this->_widgetKey.'/show_posts_count',\n ScopeInterface::SCOPE_STORE\n ));\n }\n return $this->getData($key);\n }",
"function jpen_get_daily_posts_count( $date ) {\n $posts = jpen_get_daily_posts( $date );\n\n return sizeof( $posts );\n}",
"function countPosts(){\n \n $db = Connection::getInstance();\n $count=$db->query('SELECT COUNT(*) FROM posts');\n $count2=$count->fetchColumn();\n return $count2;\n \n }",
"public function countAll()\n {\n return $this->wp_query->found_posts;\n }",
"public function count(): int\n {\n $repository = $this;\n\n return (int)$this->cache->remember(\n 'trashed_items_count',\n 30,\n function () use (&$repository): int {\n $count = 0;\n\n /** @var Collection|LazyCollection $models */\n foreach ($repository->getTrashedItems() as [$models,]) {\n $count += $models->count();\n }\n\n return $count;\n }\n );\n }",
"public function getPostCount() {\n\t\treturn $this->postCount;\n\t}",
"public function getPostCount() {\n\t\treturn $this->postCount;\n\t}",
"function KRS_STG_stt2_db_get_number_of_posts_wo_traffic()\r\n\t{\r\n\t\t$post_count = wp_cache_get('stt2_number_of_posts_wo_traffic');\r\n\t\t// wp_die($post_count);\r\n\t\tif (!isset($post_count)) {\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$sql = \"SELECT count(`ID`) FROM $wpdb->posts WHERE `post_status` = 'publish' AND `post_type` = 'post' AND ID NOT IN ( \r\n\t\t\tSELECT post_id FROM \" . $wpdb->prefix . \"stt2_meta );\";\r\n\t\t\t$post_count = $wpdb->get_var($sql);\r\n\t\t\twp_cache_set('stt2_number_of_posts_wo_traffic', $post_count, 86400);\r\n\t\t}\r\n\t\treturn $post_count;\r\n\t}",
"public static function getCount(){\n $query = App::get()->db->prepare('SELECT COUNT(id) AS cnt FROM posts');\n $query->execute();\n $res = $query->fetch(\\PDO::FETCH_ASSOC);\n return $res['cnt'];\n }",
"static function get_post_counts( $post ) {\n\t\t\t$url = get_permalink( $post );\n\n\t\t\t$current = get_post_meta( $post->ID, 'sharedcount_count', true );\n\t\t\t$updated = get_post_meta( $post->ID, 'sharedcount_updated', true );\n\n\t\t\t// If never updated or updated more than an hour ago, get it\n\t\t\tif ( !$updated || ( time() - strtotime( $updated ) ) < 3600 ) {\n\t\t\t\t$count = self::get_total_count( get_permalink( $post ) );\n\n\t\t\t\t// Only update if larger\n\t\t\t\tif ( $count > $current ) {\n\t\t\t\t\tupdate_post_meta( $post->ID, 'sharedcount_count', $count );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$count = $current;\n\t\t\t}\n\n\t\t\treturn $count;\n\t\t}",
"function tp_count_post_views () { \n // Garante que vamos tratar apenas de posts\n if ( is_single() ) {\n \n // Precisamos da variável $post global para obter o ID do post\n global $post;\n \n // Se a sessão daquele posts não estiver vazia\n if ( empty( $_SESSION[ 'tp_post_counter_' . $post->ID ] ) ) {\n \n // Cria a sessão do posts\n $_SESSION[ 'tp_post_counter_' . $post->ID ] = true;\n \n // Cria ou obtém o valor da chave para contarmos\n $key = 'tp_post_counter';\n $key_value = get_post_meta( $post->ID, $key, true );\n \n // Se a chave estiver vazia, valor será 1\n if ( empty( $key_value ) ) { // Verifica o valor\n $key_value = 1;\n update_post_meta( $post->ID, $key, $key_value );\n } else {\n // Caso contrário, o valor atual + 1\n $key_value += 1;\n update_post_meta( $post->ID, $key, $key_value );\n } // Verifica o valor\n \n } // Checa a sessão\n \n } // is_single\n \n return;\n \n }"
] | [
"0.73750955",
"0.72827554",
"0.71286833",
"0.7089535",
"0.6990572",
"0.694425",
"0.69376063",
"0.6931141",
"0.6930224",
"0.69103736",
"0.6900842",
"0.6881061",
"0.68641347",
"0.68383956",
"0.68132627",
"0.6807369",
"0.6781679",
"0.6719478",
"0.66625965",
"0.6659517",
"0.6657616",
"0.6645612",
"0.6622363",
"0.66058093",
"0.6601308",
"0.6601308",
"0.65616995",
"0.6528818",
"0.65247464",
"0.6511688"
] | 0.85253185 | 0 |
Save errors to an option. | public function save_errors() {
update_option( 'cartzilla_meta_box_errors', self::$meta_box_errors );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function saveOptions() {\n $options = new Option;\n $options->allow_register = $this->options['allow_register'];\n $options->full_width = $this->options['full_width'];\n $options->homepage_id = $this->options['homepage_id'];\n $options->nav_brand = $this->options['nav_brand'];\n $options->site_name = $this->options['site_name'];\n $options->site_tagline = $this->options['site_tagline'];\n $options->site_url = $this->options['site_url'];\n return $options->save();\n }",
"private function save_options() {\n\t\n\t\tif (!$this->supports_feature('multi_options')) {\n\t\t\tthrow new Exception('save_options() can only be called on a storage method which supports multi_options (this module, '.$this->get_id().', does not)');\n\t\t}\n\t\n\t\tif (!$this->_instance_id) {\n\t\t\tthrow new Exception('save_options() requires an instance ID, but was called without setting one (either directly or via set_instance_id())');\n\t\t}\n\t\t\n\t\t$current_db_options = UpdraftPlus_Storage_Methods_Interface::update_remote_storage_options_format($this->get_id());\n\n\t\tif (is_wp_error($current_db_options)) {\n\t\t\tthrow new Exception('save_options(): options fetch/update failed ('.$current_db_options->get_error_code().': '.$current_db_options->get_error_message().')');\n\t\t}\n\n\t\t$current_db_options['settings'][$this->_instance_id] = $this->_options;\n\n\t\treturn UpdraftPlus_Options::update_updraft_option('updraft_'.$this->get_id(), $current_db_options);\n\t\n\t}",
"public function save(array $options = []);",
"public function save(array $options = array());",
"protected function saveErrors()\n {\n $this->flash->set(self::FLASH_KEY_ERRORS, $this->errors);\n }",
"function SaveOptions() {\n\t\t\treturn update_option(SIG_OPTIONS_NAME,$this->_options);\t\t\n\t\t}",
"function optionsframework_save_options_notice() {\n\tadd_settings_error( 'options-framework', 'save_options', __( 'Options saved.', 'options_framework_theme' ), 'updated fade' );\n}",
"public function err(): OptionInterface;",
"public function save_options() {\n //any options added here should also be added to function options_validate()\n $options = array();\n\n update_option('spine_js_options', $options);\n }",
"function save_options(){\r\n\t\tif ($this->option_name) {\r\n\t\t\t$stored_options = $this->options;\r\n\t\t\tif ( $this->serialize_with_json ){\r\n\t\t\t\t$stored_options = $this->json_encode($stored_options);\r\n\t\t\t}\r\n\r\n\t\t\tif ( $this->zlib_compression && function_exists('gzcompress') ) {\r\n\t\t\t\t/** @noinspection PhpComposerExtensionStubsInspection */\r\n\t\t\t\t$stored_options = 'gzcompress:' . base64_encode(gzcompress(serialize($stored_options)));\r\n\t\t\t}\r\n\r\n\t\t\tif ( $this->sitewide_options && is_multisite() ) {\r\n\t\t\t\treturn self::atomic_update_site_option($this->option_name, $stored_options);\r\n\t\t\t} else {\r\n\t\t\t\treturn update_option($this->option_name, $stored_options);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function store()\n\t{\n\t\t$options = Option::orderBy('option_title', 'asc')->get();\n\t\t\n\t\t$rules = array();\n\t\tforeach($options as $option)\n\t\t\t$rules[$option->option_key] = 'required';\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('setting')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::all());\n\t\t}\n\n\t\tforeach($options as $option) {\n\t\t\t\n\t\t\t$setting = Setting::where('option_key', '=', $option->option_key)->first();\n\t\t\tif(empty($setting))\n\t\t\t\t$setting = new Setting;\n\n\t\t\t$setting->option_key = $option->option_key;\n\t\t\t$setting->option_data = Input::get($option->option_key);\n\t\t\t$setting->save();\n\t\t}\n\n\t\tSession::flash('message', _('Settings saved successfully'));\n\t\treturn Redirect::to('setting');\n\n\t}",
"public function storeRuleFailed(array $errors);",
"protected function save_error_notice() {\n\t\t$this->notice( __( 'Error saving configuration to database.', 'machete' ), 'error' );\n\t}",
"function setError()\r\n\t{\r\n\t\t$this->error = true;\r\n\t}",
"public function save(array $options = [])\n {\n if ( ! self::isSuspendValidation())\n {\n if ($rules = $this::get_model_rules(null, $this->id ?: null))\n {\n $thing_to_validate = $this->parentToArray();\n $ValidatorObj = \\Validator::make($thing_to_validate, $rules);\n\n if ($ValidatorObj->fails())\n {\n $this->errors = $ValidatorObj->errors();\n $ValidationExceptionObj = new ValidationException($ValidatorObj->errors());\n $ValidationExceptionObj->setValidationErrors($ValidatorObj->errors());\n throw $ValidationExceptionObj;\n }\n }\n }\n parent::save($options);\n\n return $this;\n }",
"public function testSetOptionsThrowsErrors(): void\n {\n $this->expectException(LogException::class);\n $this->setOptionsTrait->setOption('ident', 'bla'); // as there are no options set, setOptions will throw an error\n }",
"public function save()\n {\n $this->itemsModified = array_unique($this->itemsModified);\n\n try {\n foreach ($this->itemsModified as $key) {\n if (!DB::table('yz_options')->where('option_name', $key)->first()) {\n DB::table('yz_options')\n ->insert(['option_name' => $key, 'option_value' => $this[$key]]);\n } else {\n DB::table('yz_options')\n ->where('option_name', $key)\n ->update(['option_value' => $this[$key]]);\n }\n \\app\\common\\modules\\option\\OptionRepository::flush();\n\n }\n\n // clear the list\n $this->itemsModified = [];\n } catch (QueryException $e) {\n return;\n }\n }",
"public function save() {\n\t if ( ! ( $this->has_valid_nonce() && current_user_can( 'manage_options' ) ) ) {\n\t // TODO: Display an error message.\n\t }\n\t // If the above are valid, sanitize and save the option.\n\t if ( null !== wp_unslash( $_POST['acme-message'] ) ) {\n\t \n\t $value = sanitize_text_field( $_POST['acme-message'] );\n\t update_option( 'movie-pro-custom-data', $value );\n\t \n\t }\n\t $this->redirect();\n\t}",
"function saveOptions ($options)\n\t{\n\t\tupdate_option($this->db_options_core, $options);\n\t\twp_cache_flush(); // Delete cache\n\t\t$this->setOptions($options);\n\t}",
"public function save(array $options = [])\n {\n // If no url is provided, we can't save this type\n if (!isset($this->details['url'])) {\n throw new Exception();\n }\n\n $details = $this->details;\n\n $path_info = pathinfo($details['url']);\n if($path_info['extension'] == 'gifv') {\n $mp4_path = str_replace('.gifv', '.mp4', $details['url']);\n if($this->checkPathExists($mp4_path)) {\n $details['url'] = $mp4_path;\n $this->details = $details;\n }\n }\n\n // Back to Eloquent Model->save to persist to db\n return parent::save($options);\n }",
"public function saveOptions( $options ) {\n\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$saved = [];\n\n\t\tforeach ( $options as $name => $option ) {\n\t\t\tif ( in_array( $name, $this->fields ) ) {\n\t\t\t\tswitch ( $name ) {\n\t\t\t\t\tcase 'account_name':\n\t\t\t\t\t\tif ( empty( $option ) ) {\n\t\t\t\t\t\t\t$option = $this->getDefaultOptions( 'account_name' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'api_call_type':\n\t\t\t\t\t\tif ( empty( $option ) ) {\n\t\t\t\t\t\t\t$option = $this->getDefaultOptions( 'api_call_type' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'api_key':\n\t\t\t\t\t\tif ( empty( $option ) ) {\n\t\t\t\t\t\t\t$option = $this->getDefaultOptions( 'api_key' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'api_query_params':\n\t\t\t\t\t\tif ( empty( $option ) ) {\n\t\t\t\t\t\t\t$option = $this->getDefaultOptions( 'api_query_params' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'application_url':\n\t\t\t\t\t\tif ( empty( $option ) ) {\n\t\t\t\t\t\t\t$option = $this->getDefaultOptions( 'application_url' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$saved[ $name ] = trim( $option );\n\t\t\t}\n\t\t}\n\n\t\treturn $saved;\n\t}",
"protected function save( $options )\n\t{\n\t\t$csm_options = $this->model->get_options();\n\t\tif( isset($options['contact_entry']) ) \n\t\t\t$csm_options['contact_entry'] = $options['contact_entry'];\n\t\tif( isset($options['contact_entry_filter']) ) \n\t\t\t$csm_options['contact_entry_filter'] = $options['contact_entry_filter'];\n\t\t$this->model->set_options( $csm_options );\n\t}",
"protected function set_saved_value() {\n\t\tif ( $this->use_key ) {\n\t\t\t$this->saved_value = $this->option_key;\n\t\t} else if ( is_array( $this->option ) ) {\n\t\t\tif ( $this->use_separate_values && isset( $this->option['value'] ) ) {\n\t\t\t\t$this->saved_value = $this->option['value'];\n\t\t\t} else {\n\t\t\t\t$this->saved_value = isset( $this->option['label'] ) ? $this->option['label'] : reset( $this->option );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->saved_value = $this->option;\n\t\t}\n\t}",
"public function save(array $options = [])\n {\n $this->validate();\n return parent::save($options);\n }",
"public function saveModelQuietly(array $options = []) {\n\n\t return static::withoutEvents(function () use ($options) {\n\t return $this->save($options);\n\t });\n\t}",
"private function Saveerrors($arrerror) {\n\t\t//print_r($arrerror); die();\n\t\t$model_form_errors = new TblAcaFormErrors ();\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$model_form_errors->error_desc = $arrerror ['error_desc'];\n\t\t\t$model_form_errors->error_type = $arrerror ['error_type']; // error_type 1= 1094, 2=1095, 3=pdf generation, 4= print & mail\n\t\t\t$model_form_errors->created_date = date ( 'Y-m-d H:i:s' );\n\n\t\t\tif(!empty($arrerror ['company_id'])){\n\t\t\t$model_form_errors->company_id = $arrerror ['company_id'];\n\t\t\t}\n\t\t\t\n\t\t\tif ($model_form_errors->validate () && $model_form_errors->save ()) {\n\t\t\t\t//echo 'hi'; die();\n\t\t\t}\n\t\t} catch ( \\Exception $e ) { // catching the exception\n\t\t\t//print_r($e); die();\n\t\t\t$e->getMessage ();\n\t\t\t// rollback transaction\n\t\t//\t$transaction->rollback ();\n\t\t}\n\t}",
"private function Saveerrors($arrerror) {\n\t\t$model_form_errors = new TblAcaFormErrors ();\n\t\t/**\n\t\t* transaction block for the sql transactions to the database\n\t\t*/\n\t\t\t\t\n\t\t$connection = \\yii::$app->db;\n\t\t\t\t\n\t\t// starting the transaction\n\t\t$transaction = $connection->beginTransaction ();\n\t\ttry {\n\t\t\t\n\t\t\t$model_form_errors->error_desc = $arrerror ['error_desc'];\n\t\t\t$model_form_errors->error_type = $arrerror ['error_type']; // error_type 1= 1094, 2=1095, 3=pdf generation, 4= print & mail,5=xml generate\n\t\t\t$model_form_errors->created_date = date ( 'Y-m-d H:i:s' );\n\n\t\t\tif(!empty($arrerror ['company_id'])){\n\t\t\t$model_form_errors->company_id = $arrerror ['company_id'];\n\t\t\t}\n\t\t\t\n\t\t\tif ($model_form_errors->validate () && $model_form_errors->save ()) {\n\t\t\t\t// commiting the model\n\t\t\t\t$transaction->commit ();\n\t\t\t}\n\t\t} catch ( \\Exception $e ) { // catching the exception\n\t\t\t\n\t\t\t$e->getMessage ();\n\t\t\t// rollback transaction\n\t\t\t$transaction->rollback ();\n\t\t}\n\t}",
"function setErrors($errors){\r\n $this->errors = $errors;\r\n }",
"public function setErrors($errors){\n $this->errors[] = $errors;\n }",
"function save_question_options($question) {\n // for numerical questions. This is not currently used by the editing\n // interface, but the GIFT format supports it. The multianswer qtype,\n // for example can make use of this feature.\n // Get old versions of the objects\n if (!$oldanswers = get_records(\"quiz_answers\", \"question\", $question->id)) {\n $oldanswers = array();\n }\n\n if (!$oldoptions = get_records(\"quiz_numerical\", \"question\", $question->id)) {\n $oldoptions = array();\n }\n\n $result = $this->save_numerical_units($question);\n if (isset($result->error)) {\n return $result;\n } else {\n $units = &$result->units;\n }\n\n // Insert all the new answers\n foreach ($question->answer as $key => $dataanswer) {\n if ($dataanswer != \"\") {\n $answer = new stdClass;\n $answer->question = $question->id;\n $answer->answer = trim($dataanswer);\n $answer->fraction = $question->fraction[$key];\n $answer->feedback = trim($question->feedback[$key]);\n\n if ($oldanswer = array_shift($oldanswers)) { // Existing answer, so reuse it\n $answer->id = $oldanswer->id;\n if (! update_record(\"quiz_answers\", $answer)) {\n $result->error = \"Could not update quiz answer! (id=$answer->id)\";\n return $result;\n }\n } else { // This is a completely new answer\n if (! $answer->id = insert_record(\"quiz_answers\", $answer)) {\n $result->error = \"Could not insert quiz answer!\";\n return $result;\n }\n }\n\n // Set up the options object\n if (!$options = array_shift($oldoptions)) {\n $options = new stdClass;\n }\n $options->question = $question->id;\n $options->answer = $answer->id;\n $options->tolerance = $this->apply_unit($question->tolerance, $units);\n\n // Save options\n if (isset($options->id)) { // reusing existing record\n if (! update_record('quiz_numerical', $options)) {\n $result->error = \"Could not update quiz numerical options! (id=$options->id)\";\n return $result;\n }\n } else { // new options\n if (! insert_record('quiz_numerical', $options)) {\n $result->error = \"Could not insert quiz numerical options!\";\n return $result;\n }\n }\n }\n }\n }"
] | [
"0.6047312",
"0.5999814",
"0.59860384",
"0.59218615",
"0.5808933",
"0.5791847",
"0.57482463",
"0.5602326",
"0.55338687",
"0.54841846",
"0.5447443",
"0.5417454",
"0.53889334",
"0.53750116",
"0.53739154",
"0.5371753",
"0.53552514",
"0.5341155",
"0.53339237",
"0.5331235",
"0.5299225",
"0.5288065",
"0.52828944",
"0.52642137",
"0.5255448",
"0.52552813",
"0.5237929",
"0.52154326",
"0.5209786",
"0.5203126"
] | 0.6940237 | 0 |
Gets query for [[ItemPedidos]]. | public function getItemPedidos()
{
return $this->hasMany(ItemPedido::className(), ['pk_produto' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function obtenerPedidos()\n {\n\t\t$this->db->order_by(\"id\", \"desc\");\n\t\t$this->db->where('estado', 2);\n\t\t$this->db->or_where('estado', 4);\n $query = $this->db->get('pedidos'); \n\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n }",
"public function get_pedido_productos(){\r\n\t\t\t$sql = 'SELECT * FROM productos_traspasos WHERE folio='.$_SESSION['folio'];\r\n\t\t\treturn $this->query($sql);\r\n\t\t}",
"public function getPedidos()\n {\n return $this->hasMany(Pedido::className(), ['id_empregado' => 'id_empregado']);\n }",
"public function index()\n {\n return ItemPedido::all();\n }",
"static public function ctrMostrarPedidosProveedores($item,$valor){\n\n\t\t$tabla = \"pedido\";\n\n\t\t$respuesta = ModeloPedidosProveedor::mdlMostrarPedidosProveedores($tabla,$item,$valor);\n\n\t\treturn $respuesta;\n\t\t\n\t}",
"function listarPedidos($nome = false, $id_venda = false, $dataInicial = false, $dataFinal = false, $lojaBusca, $situacao, $idPagamento, $multiplasFormas)\n {\n $sql = \"SELECT \n IFNULL(id_tiny, 0) id_tiny,\n v.id_venda id_venda,\n v.id_loja id_loja,\n c.nome nome_cliente,\n v.valor_total_pago total_venda,\n LEFT(DATE_FORMAT(v.dta_venda, '%d-%m-%Y'),\n 10) data_pedido,\n ifnull(p.situacao, 'Ok') situacao,\n ifnull(p.retorno, 'Sem Pedido') retorno,\n ifnull(id_nota_tiny, '') nota,\n ifnull(link, '') link,\n case when emitida = 1 then 'Sim' else 'Não' end as emitida\n FROM\n venda v\n LEFT JOIN\n cliente c USING (id_cliente)\n LEFT JOIN\n pedido p USING (id_venda)\n where case WHEN \" . $situacao . \" in (0,1) then ifnull(emitida,0) = \" . $situacao . \" else ifnull(emitida,0) in (0,1) end AND id_venda\n and (v.dta_cancelamento_venda IS NULL\n OR v.dta_cancelamento_venda = '0000-00-00') \";\n \n if ($lojaBusca > 0) {\n $sql = $sql . \" and v.id_loja = \" . $lojaBusca . \" \";\n }\n \n if ($dataInicial != NULL && $dataFinal != null) {\n $sql = $sql . \" and LEFT(v.dta_venda,10) BETWEEN '\" . $dataInicial . \"' and '\" . $dataFinal . \"' \";\n }\n \n if ($nome != NULL) {\n $sql = $sql . \" and c.nome LIKE '\" . $nome . \"%' \";\n }\n \n if ($id_venda != NULL) {\n $sql = $sql . \" and v.id_venda = '\" . $id_venda . \"' \";\n }\n \n if ($multiplasFormas == 's') {\n $sql = $sql . \" and (select count(*) from forma_pagamento_venda where id_venda = v.id_venda) > 1 \";\n }\n \n if ($multiplasFormas == 'n') {\n $sql = $sql . \" and (select count(*) from forma_pagamento_venda where id_venda = v.id_venda) = 1 \";\n }\n \n if ($idPagamento != 0) {\n $sql = $sql . \" and \" . $idPagamento . \" in (select id_forma_pagamento from forma_pagamento_venda fp where fp.id_venda = v.id_venda)\";\n }\n \n $sql = $sql . \" order by 2 desc limit 200; \";\n \n //Executa a query\n $resultado = $this->conexao->query($sql);\n \n //Se retornar algum erro\n if (!$resultado)\n return array(\n 'indicador_erro' => 1,\n 'dados' => null\n );\n \n //Se não retornar nenhuma linha\n if (mysqli_num_rows($resultado) == 0)\n return array(\n 'indicador_erro' => 0,\n 'dados' => null\n );\n \n $retorno = array();\n while ($linha = mysqli_fetch_array($resultado)) {\n $dados = array(\n 'id_tiny' => $linha['id_tiny'],\n 'id_venda' => $linha['id_venda'],\n 'id_loja' => $linha['id_loja'],\n 'nome_cliente' => strtoupper($linha['nome_cliente']),\n 'total_venda' => $linha['total_venda'],\n 'situacao' => $linha['situacao'],\n 'retorno' => $linha['retorno'],\n 'emitida' => $linha['emitida'],\n 'nota' => $linha['nota'],\n 'data_pedido' => $linha['data_pedido'],\n 'link' => $linha['link']\n );\n $retorno[] = $dados;\n }\n \n return array(\n 'indicador_erro' => 2,\n 'dados' => $retorno\n );\n }",
"public function getPedidos()\n {\n return $this->hasOne(Pedidos::className(), ['id' => 'pedidos_id']);\n }",
"public function getProductosByPedido($id){ //$id es el id de pedido detalle.php\n //$sql = \"SELECT * FROM productos WHERE id IN \" //sacame los productos cuyo id exista en esta sub consulta\n // . \"(SELECT producto_id FROM lineas_pedidos WHERE pedido_id={$id})\";\n $sql = \"SELECT pr.*, lp.unidades FROM productos pr \"\n . \"INNER JOIN lineas_pedidos lp ON pr.id = lp.producto_id \"\n . \"WHERE lp.pedido_id={$id}\";\n \n $productos = $this->db->query($sql);\n \n return $productos;\n }",
"public function getProductosByPedido($id){\n//\t\t\t\t. \"(SELECT producto_id FROM lineas_pedidos WHERE pedido_id={$id})\";\n\t\n\t\t$sql = \"SELECT v.id, p.descripcion, v.fecha, v.hora, v.total, vp.cantidad, vp.valor, e.nombre estado, ci.nombre ciudad, u.telefono, u.celular, u.direccion, dp.nombre departamento, i.nombre imagen FROM tbl_ventas v \"\n\t\t\t\t. \"INNER JOIN tbl_usuarios u ON v.cliente = u.id \"\n\t\t\t\t. \"INNER JOIN tbl_ciudades ci ON u.ciudad = ci.id \"\n\t\t\t\t. \"INNER JOIN tbl_departamentos dp ON ci.departamento = dp.id \"\n\t\t\t\t. \"INNER JOIN tbl_venta_productos vp ON vp.id_venta = v.id \"\n\t\t\t\t. \"INNER JOIN tbl_estados e ON v.estado = e.id \"\n\t\t\t\t. \"INNER JOIN tbl_productos p ON vp.id_producto = p.id \"\n\t\t\t\t. \"LEFT JOIN tbl_imagenes i ON p.imagen = i.id \"\n\t\t\t\t. \"WHERE vp.id_venta={$id}\";\n\t\t\t\t\n\t\t$productos = $this->db->query($sql);\n\t\t\t\n\t\treturn $productos;\n\t}",
"public\tfunction listaPedidos($filtro)\n\t{\n\t\treturn ejecutarSQL::consultar(\"SELECT * FROM pedido s,material m, tabopm o,tipodoc t WHERE $filtro s.id_material_saida=m.id and s.destino=o.cod_opm and t.id=s.tipo_doc order by id_pedido desc\");\n\t}",
"public function getClientePedidos($idCliente){\n $resultado = $this->database->select('pedido', \"*\",\n [\n 'idCliente' => $idCliente,\n \"ORDER\" => [ \"id\" => \"DESC\" ],\n ]);\n\n return $resultado;\n }",
"public function getProductoByPedido($id){\n\n\t\t\t//$sql = \"SELECT * FROM productos WHERE id_producto IN (SELECT fk_id_producto FROM lineas_pedidos WHERE fk_id_pedido = '{$id}')\";\n\n $sql = \"SELECT pr.*, lp.unidades FROM productos pr \"\n . \" INNER JOIN lineas_pedidos lp ON pr.id_producto = lp.fk_id_producto\"\n . \" WHERE lp.fk_id_pedido = '{$id}'\";\n\n $productos = $this->db->query($sql);\n\n return $productos;\n\t\t}",
"function getPedidos (){\n\t\tinclude \"../conexion.php\";\n\t\t$sql = \"SELECT p.id id,p.fecha fecha, p.status status,COUNT(DISTINCT(l.idLibroVendido)) libros, FORMAT(SUM(l.precio),2) precio \n\t\t\t\tFROM entrega p INNER JOIN librovendido l\n\t\t\t on p.id = l.Entregaid \n\t\t\t and l.vendidoLinea = 1\n\t\t\t GROUP BY p.id,p.fecha,p.status \";\n\t $query = mysqli_query($con, $sql);\n\t\treturn $query;\n\t}",
"public function mostrarTodosItem() {\n \n //FUNCION CON LA CONSULTA A REALIZAR\n $sql = \"SELECT * FROM ITEM_PRESUPUESTO\";\n $this->_conexion->ejecutar_sentencia($sql);\n return $this->_conexion->retorna_select();\n \n }",
"function getItemPedidoJSON($fk_idPedidos)\n\t\t{\n\t\t\t$this->connDataBase->query(\"SELECT i.idItem, i.nome, i.descricao, i.valor, i.idCategoria, i.ativo, IP.fk_idPedidos\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM item i\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN itemPedido IP ON (i.idItem = IP.fk_idItem)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE fk_idPedidos = :fk_idPedidos ;\");\n\t\t\t$this->connDataBase->bind(':fk_idPedidos', $fk_idPedidos);\n\t\t\t$rows = $this->connDataBase->resultset();\n\t\t\t$json = json_encode($rows);\n\t\t\treturn $rows;\n\t\t}",
"public function pedidos()\n {\n return $this->hasMany(Pedido::class);\n }",
"public function pedidos()\n {\n return $this->hasMany(Pedido::class);\n }",
"public function getPedidos()\n {\n try\n {\n return response()->json(['success' => true, 'data' => PedidoFacade::getAll()], 200);\n }\n catch (HttpException $httpException)\n {\n return response()->json(['success' => false, 'error_message' => $httpException->getMessage()], $httpException->getCode());\n }\n }",
"public static function GetPedidos(){\n $listaPedidos = PedidoDb::GetPedidos();\n return json_encode($listaPedidos);\n }",
"public function pedido_get()\n {\n $pedido = '';\n $pedidos = [];\n $id = null;\n if ($this->get('id')) {\n $id = $this->get('id');\n $pedido = $this->orderModel->getOrderById($id);\n } elseif ($this->get('ajaxListOrder')) {\n $pedidos = $this->orderModel->getOrderList();\n\n foreach ($orders as $order) {\n $id = $order->numPedido;\n $link = 'pedido/factura/'.$id;\n $order->options = '<a href=\"#\" onclick=\"editPedido('.$id.')\" class=\"btn btn-primary btn-sm\"><i class=\"glyphicon glyphicon-edit glyphicon-white\"></i> Editar</a> '.\n '<a href=\"'.$link.'\" class=\"btn btn-warning btn-sm\"><i class=\"glyphicon glyphicon-list-alt glyphicon-white\"></i> Factura</a> '.\n '<a href=\"#\" onclick=\"deletePedido('.$id.')\" class=\"btn btn-danger btn-sm\"><i class=\"glyphicon glyphicon-remove-sign glyphicon-white\"></i> Borrar</a>';\n }\n $data['data'] = $orders;\n $pedidos = $data;\n } elseif ($this->get('vendedor')) {\n $idVen = $this->get('idVendedor');\n $idUser = $this->get('idUser');\n $fecha = $this->get('fecha');\n //$fecha = '2019-01-28';\n $orders = $this->orderModel->getPedidosByDate($fecha, null, null, 'TODOS', $idVen);\n\n if ($this->get('dataFlag')) {\n $pedidos['data'] = $orders;\n } else {\n $pedidos = $orders;\n }\n } else {\n $pedidos = $this->orderModel->getOrderList();\n }\n\n $this->api_get($pedidos, 'pedido', $pedido, $id);\n }",
"static public function mdlMostrarPedidosMayoreo($tabla, $item, $valor){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT *FROM pedidos\");\n\n\t\t$stmt ->bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\t}",
"public function getAllByUser(){ //mis_pedidos.php\n $sql = \"SELECT p.* FROM pedidos p \" //quiero sacar todo de la tabla pedido,\n . \"WHERE p.usuario_id = {$this->getUsuario_id()} ORDER BY id DESC \"; //DONDE EL usuario_id sea igual al usuario que esta en el set, sacaen orden descentente la id\n $pedido = $this->db->query($sql);\n return $pedido;\n }",
"public function getAll(){\n\n $pedidos = $this->db->query(\"SELECT * FROM pedidos ORDER BY id_pedido DESC\");\n\n return $pedidos;\n }",
"public function buscarPedidos($validator){\n\t\t$parametros = array(\n\t\t\t'id' => $validator->getOptionalVar('id'),\n\t\t\t'credito' => $validator->getOptionalVar('credito'),\n\t\t\t'formaPago' => $validator->getOptionalVar('formaPago'),\n\t\t\t'estado' => $validator->getOptionalVar('estado')\n\t\t);\n\t\t//Iniciamos el query sacando todos los datos de la tabla\n\t\t$switch = 'true';\n\t\t$q = Doctrine::getTable('pedidos') -> createQuery('u');\n\t\tif($parametros['id'] > 0) {\n\t\t\t$q -> where('u.id_cliente = ?',$parametros['id']);\n\t\t\t$switch = 'false';\n\t\t}else{\n\t\t\t$q -> select('u.*');\n\t\t\t$q -> where('u.inactivo = ?','0');\n\t\t\t$switch = 'false';\n\t\t}\n\t\tif(isset($parametros['credito']) && ($parametros['credito'] != 'NO DATA')){\n\t\t\tif($switch=='true'){\n\t\t\t\t$q -> where('u.tipo_pago = ?',$parametros['credito']);\n\t\t\t\t$switch = 'false';\t\n\t\t\t}else{\n\t\t\t\t$q -> andwhere('u.tipo_pago = ?',$parametros['credito']);\n\t\t\t}\t\n\t\t}\n\t\tif(isset($parametros['formaPago']) && ($parametros['formaPago'] != 'NO DATA')){\n\t\t\tif($switch=='true'){\n\t\t\t\t$q -> where('u.forma_pago = ?',$parametros['formaPago']);\n\t\t\t\t$switch = 'false';\n\t\t\t}else{\n\t\t\t\t$q -> andwhere('u.forma_pago = ?',$parametros['formaPago']);\n\t\t\t}\t\t\n\t\t}\n\t\tif(isset($parametros['estado']) && ($parametros['estado'] != 'NO DATA')){\n\t\t\tif($switch=='true'){\n\t\t\t\t$q -> where('u.estado = ?',$parametros['estado']);\n\t\t\t\t$switch = 'false';\n\t\t\t}else{\n\t\t\t\t$q -> andwhere('u.estado = ?',$parametros['estado']);\n\t\t\t}\t\t\n\t\t}\n\t\t$qArray = $q -> fetchArray();\n\t\tif (count($qArray) >= 1) {\n\t\t\techo json_encode($qArray);\n\t\t} else {\n\t\t\techo \"[]\";\n\t\t}\t\n\t\treturn 'void';\n\t}",
"public static function GetPedidosProveedor(){\n $listaPedidos = PedidoDb::GetPedidos();\n $listaResultado;\n\n foreach($listaPedidos as $pedido){\n $proveedor = ProveedorDb::GetProveedorById($pedido->idProveedor);\n $item = array(\n \"producto\" => $pedido->producto,\n \"cantidad\" => $pedido->cantidad,\n \"idProveedor\" => $pedido->idProveedor,\n \"nombre\" => $proveedor->nombre\n );\n\n $listaResultado[] = $item;\n }\n \n return json_encode($listaResultado); \n }",
"public function MostrarListaPedidos()\r\n {\r\n require_once(\"../modelo/m_pedido.php\");\r\n $this->modelo=new M_Pedido();\r\n //require_once(\"../vista/v_lista_pedidos.php\");\r\n }",
"public function getPedidos($iduser) {\n $query = $this->db->query(\"SELECT *, pr.nombre 'nom_provincia' \"\n . \"FROM pedido pe \"\n . \"INNER JOIN provincias pr on pr.cod = pe.cod_provincia \"\n . \"WHERE idUsuario = $iduser \");\n\n return $query->result_array();\n }",
"public function pedidos()\n {\n return $this->hasMany('App\\Pedido');\n }",
"static public function mdlMostrarProveedores($tabla, $item, $valor){\n\n\t\tif($item != null){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla WHERE $item = :$item\");\n\n\t\t\t$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetch();\n\n\t\t}else{\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}",
"public function produtos()\n {\n return $this->hasMany('App\\Item', 'fornecedor_id', 'id');\n\n }"
] | [
"0.6735399",
"0.6639959",
"0.66283405",
"0.6586711",
"0.6535695",
"0.6378788",
"0.63618207",
"0.6356724",
"0.6323757",
"0.62451386",
"0.62275004",
"0.6208704",
"0.61992806",
"0.6184121",
"0.6131457",
"0.61086214",
"0.61086214",
"0.61014056",
"0.60998386",
"0.60807383",
"0.603766",
"0.60324126",
"0.6015077",
"0.5980637",
"0.5908118",
"0.58719826",
"0.58650404",
"0.5859584",
"0.58090377",
"0.57908535"
] | 0.7469997 | 0 |
Setup condition for every test. Forces player 1 to be the default starting player | public function setUp() {
parent::setUp();
$this->game = app('Game');
$this->player1 = $this->game->getPlayer1();
$this->player2 = $this->game->getPlayer2();
if($this->player1->getPlayerId() != $this->game->getActivePlayer()->getPlayerId()) {
$this->game->toggleActivePlayer();
}
$this->initPlayers();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testAutoPlayAlreadyWon(): void\n {\n $ROLL_VAL = 5;\n // set rand return value\n rand(-1, $ROLL_VAL);\n\n $this->player->autoPlay(22);\n\n $this->assertSame($this->player->getScore(), 0);\n }",
"public function setUp() {\n\t\t$this->Player = new Player('Fred');\n\t}",
"private function changeThePlayer() {\n\n if ($this->onMove == \"white\") {\n $this->onMove = \"black\";\n } else {\n $this->onMove = \"white\";\n }\n }",
"function checkPreselect(int $currentSeason): void\n{\n// While the team on the clock has a pick\n $teamId = getTeamOnClock($currentSeason);\n $selection = getPreselection($teamId);\n while ($selection[\"playerid\"]) {\n makePick($teamId, $selection[\"playerid\"], $currentSeason);\n $teamId = getTeamOnClock($currentSeason);\n $selection = getPreselection($teamId);\n }\n}",
"private function _switchPlayer() {\n $this->_lastActivePlayer = $this->_activePlayer;\n $this->_activePlayer = ($this->_activePlayer === 'X') ? 'Y' : 'X';\n }",
"public function testAutoPlay(): void\n {\n $ROLL_VAL = 5;\n // set rand return value\n rand(-1, $ROLL_VAL);\n\n $this->player->autoPlay(19);\n\n $this->assertSame($this->player->getScore(), 20);\n }",
"public function setUp() {\n\t\t$this->setUpDatabase();\n\t\t$this->player = new Player;\n\t}",
"private function shiftStartingPlayer(): void\n {\n $firstPlayer = array_shift($this->players);\n $this->players[3] = $firstPlayer;\n }",
"public function __construct(int $startPointsPlayer1 = 0, int $startPointsComputer = 0, string $currentPlayer = \"Dator\")\n {\n parent::__construct();\n $this->pointsPlayer1 = $startPointsPlayer1;\n $this->pointsComputer = $startPointsComputer;\n $this->setCurrentPlayer($currentPlayer);\n }",
"public function testComputersTurn()\n {\n session_start();\n $this->initSession();\n\n commandCheck('throw');\n commandCheck('stop');\n\n $actual = $_SESSION['game']['computerScore'];\n\n $this->assertGreaterThan(0, $actual);\n\n destroySession();\n }",
"public function setNextPlayer()\n {\n $this->currentPlayerIndex = $this->findNextPlayer();\n }",
"public function testInvalidPlayer()\r\n {\r\n\r\n }",
"public function testRunGameWithMockedConfigWithoutSkillsWhereOrderusStartsFirstAndWins()\n {\n $this->config->set('characters.' . PLAYER_1_NAME . '.skills', []);\n $this->config->set('characters.' . PLAYER_1_NAME . '.stats.strength', 100);\n $this->config->set('characters.' . PLAYER_1_NAME . '.stats.speed', 100);\n $this->config->set('characters.' . PLAYER_1_NAME . '.stats.luck', 100);\n\n $this->config->set('characters.' . PLAYER_2_NAME . '.skills', []);\n $this->config->set('characters.' . PLAYER_2_NAME . '.stats.speed', 50);\n $this->config->set('characters.' . PLAYER_2_NAME . '.stats.luck', 0);\n $this->config->set('characters.' . PLAYER_2_NAME . '.stats.defence', 0);\n\n $this->runGame();\n\n /** @var TestHandler $logHandler */\n $logHandler = $this->logger->popHandler();\n self::assertTrue($logHandler->hasInfoThatContains(PLAYER_1_NAME . ' is the fastest and will strike first.'));\n self::assertTrue($logHandler->hasInfoThatContains(PLAYER_1_NAME . ' is victorious!'));\n }",
"function testGame()\n {\n \n dbg(\"+\".__METHOD__.\"\");\n # id, date\n $this->getNew();\n # get highest player_id\n $testPlay = new Player();\n $testPlay->get_next_id();\n $high = $testPlay->get_member_id();\n $this->member_snack = rand(1,$high);\n $this->member_host = rand(1,$high);\n $this->member_gear = rand(1,$high);\n $this->member_caller = rand(1,$high);\n// $this->game_date = rand(1,$high);\n dbg(\"=\".__METHOD__.\":high=$high:{$this->game_id}:{$this->game_date}:{$this->member_snack}:{$this->member_host}:{$this->member_gear}:{$this->member_caller}\");\n unset($testPlay);\n dbg(\"-\".__METHOD__.\"\");\n }",
"function stNewTrick() {\r\n self::setGameStateInitialValue('firstPlayedColor', 0);\r\n\r\n // If there are 4 players, and there are 0 cards in the deck,\r\n // we need to show each other' cards to companions as well as all taken cards during the game!\r\n $players = self::loadPlayersBasicInfos();\r\n $cardsInDeck = $this->cards->countCardInLocation('deck');\r\n $showCardsPhaseDone = self::getGameStateValue('showCardsPhaseDone');\r\n if ($cardsInDeck == 0 && count($players) == 4 && $showCardsPhaseDone == 0) {\r\n self::setGameStateValue('showCardsPhaseDone', 1);\r\n $this->gamestate->nextState(\"finalPhase\");\r\n } else {\r\n $this->gamestate->nextState(\"nextPlayer\");\r\n }\r\n }",
"public function start()\n {\n while ($this->player->getHp() > 0 && $this->monster->getHp() > 0){\n // Comme $target n'éxiste pas au début de ma boucle et afin d'éviter une \"notice\" je vérifie si la variable\n // existe à l'aide de la methode isset, si elle n'existe pas alors je la crée et lui donne une valeur quelconque\n if(!isset($target)){\n $target = true;\n }\n // $target sera toujours une instance de Character et de PlayableInterface, mais ne pourra\n // être qu'une instance de Monster ou Player\n if($target instanceof Monster ){\n $target = $this->monster->attack('Massue en bois', $this->player);\n echo 'Le joueur perd 2 point de vie <br>';\n }else{\n $target = $this->player->attack('Epée en bois', $this->monster);\n echo 'Le monstre perd 2 point de vie <br>';\n }\n }\n // $winner = $this->player->getHp() > 0 ? 'Le joueur gagne' : 'Le monstre gagne';\n // echo $winner;\n if ($this->player->getHp() > 0 && $this->monster->getHp() <=0){\n echo \"Je joueur gagne et reçois 15 golds\";\n $entityManager = GetEntityManager();\n $player = $entityManager->getRepository(Player::class)->find($this->player->getId());\n $player->setGold($player->getGold()+15);\n $player->setXp($player->getXp()+15);\n if ($player->getXp() >=100) {\n $player->setLevel($player->getLevel()+1);\n $player->setXp(0);\n };\n \n $entityManager->flush();\n }\n else {\n echo \"Le monstre gagne\";\n };\n echo \"</br>\";\n echo \"<a href='index.php?p=/village&village=$_GET[village]&name=$_GET[name]' class='btn btn-primary'>Retour au village</a>\";\n }",
"private function _findGameDefaults()\n {\n $gameTable = new WordShuffle_Model_DbTable_Game();\n\n $where1 = $this->_db->quoteInto('idPlayer = ?',$this->_model->id);\n $selectRecentDate = \"(Select max(start) from WSGame where \".$this->_db->quoteInto(\"idPlayer = ?\",$this->_model->id).')';\n $where2 = 'start = '.$selectRecentDate;\n\n $select = $gameTable->select()->where($where1)->where($where2);\n $rowSet = $gameTable->fetchAll($select);\n\n // should only be one record\n if(count($rowSet) == 1) {\n $ret = $rowSet->toArray();\n // set the Player roundsPerGame and secondsPerRound default per the last game played\n $this->_model->roundsPerGame = (int) $ret[0]['roundsPerGame'];\n $this->_model->secondsPerRound = (int) $ret[0]['secondsPerRound'];\n }elseif(count($rowSet) == 0){\n // do nothing, game defaults set by Session object defaults, new Game record will be created on play event\n }else{\n throw new Exception($this->_className.'->_findGameDefaults() resulted in multiple records. There should only be one.');\n }\n\n }",
"public function testGameStatusPointsPlayer1Over100()\n {\n $game = new Game(101, 0);\n $res = $game->checkGameStatus();\n $exp = true;\n $this->assertEquals($exp, $res);\n }",
"private function setupNewHand() {\n\t\t$this->state = self::HAND_START;\n\t\t$this->currentRoundStarter = $this->findTwoOfClubsOwner();\n\t\t$this->currentRoundSuit = self::CLUBS;\n\t\t$this->currentHandPoints = array();\n\t\tfor ($i = 0; $i < self::N_OF_PLAYERS; ++$i) {\n\t\t\t$this->currentHandPoints[] = 0;\n\t\t}\n\t}",
"public function decideFirstPlayer(): IPlayer\n {\n if ($this->hero->getSpeed() !== $this->beast->getSpeed()) {\n $this->attacker = $this->hero->getSpeed() > $this->beast->getSpeed() ? $this->hero : $this->beast;\n return $this->attacker;\n } else {\n $this->attacker = $this->hero->getLuck() > $this->beast->getLuck() ? $this->hero : $this->beast;\n return $this->attacker;\n }\n }",
"protected function setUp()\n\t{\n\t\t$this->_object = new MW_Common_Criteria_Plugin_T3Status();\n\t}",
"public function __construct()\n {\n $this->numberOfDices = 5;\n $this->computer = new ComputerPlayer($this->numberOfDices);\n $this->player = new Player($this->numberOfDices);\n $this->currentRoundScore = 0;\n $this->currentRoundTurn = \"player\";\n }",
"public function testGetPointsPlayer1()\n {\n $game = new Game();\n $res = $game->getPointsPlayer1();\n $exp = 0;\n $this->assertEquals($exp, $res);\n }",
"public function init(GameSettings $config, Output $output): void\n {\n $this->battleSettings = $config->getSettings();\n $this->output = $output;\n $this->roundsLeft = $this->battleSettings['rounds'];\n if ($this->prefightCheck()) {\n $this->readyPlayerOne();\n $this->readyPlayerTwo();\n }\n }",
"function initializePlayers(&$players, $names, $cardsArr) {\n \n $userImages = array(false,false,false,false,false,false);\n for ($i = 0; $i < 4; $i++) {\n \n // Assign basic player information\n $player = [];\n $player[\"name\"] = $names[$i];\n $player[\"points\"] = 0;\n $player[\"winner\"] = 0;\n //$player[\"bgImage\"] = \"/Labs/Lab3/players/\".rand(1,6).\".png\";\n $player[\"bgImage\"] = \"/Labs/Lab3/players/\".getUserImageIndex($userImages).\".png\";\n $totalCards = 0;\n \n \n // Draw cards, count points, and print each card\n // Each player can draw up to 6 cards, but stops if they exceed 41 points\n $cards = [];\n $points = 0;\n for ($j = 0; $j < 6; $j++) {\n $newCard = pickCard($cardsArr, $usedCards);\n $cards[] = $newCard;\n $points += $newCard[\"value\"];\n $totalCards++;\n \n if ($points >= 42) {\n break;\n }\n }\n \n // Assign hand and total points to the player\n $player[\"totalCards\"] = $totalCards;\n $player[\"cards\"] = $cards;\n $player[\"points\"] = $points;\n \n \n // Adds player to array\n $players[$i] = $player;\n \n //echo \"Name: \" . $players[$i][\"name\"];\n //echo ', Points: ' . $players[$i][\"points\"] . '<br><br>';\n }\n \n // Determines winner(s)\n determineWinner($players);\n \n // Prints the player's information\n for ($i = 0; $i < 4; $i++) {\n printHand($players[$i][\"cards\"], $players[$i][\"totalCards\"], $players[$i][\"name\"], $players[$i][\"points\"], $players[$i][\"bgImage\"], $players[$i][\"winner\"]);\n }\n \n // Prints the case where nobody wins (Moved from determineWinner(), looks better printed below the game)\n $winnerExists = false;\n for ($i = 0; $i < 4; $i++) {\n if ($players[$i][\"winner\"] == true) {\n $winnerExists = true;\n break;\n }\n }\n \n if ($winnerExists == false) {\n echo \"Everyone went over 42. Nobody wins!\";\n }\n}",
"public function setUp()\r\n {\r\n // Todo: Replace later\r\n if (isset($_SESSION['board_state'])) {\r\n unset($_SESSION['board_state']);\r\n }\r\n\r\n $this->game = new App\\Game();\r\n\r\n }",
"protected function startAction()\n {\n if ($brandNewGame = !$this->gameStarted) {\n $this->status = 'Host wählt ersten Spieler...';\n $this->waitFor = self::SELECT_FIRST_PLAYER;\n }\n\n // Reset state\n $this->gameStarted = true;\n $this->gameFinished = false;\n $this->stack = $this->stackProvider->getStack();\n $this->protectedPlayers = [];\n $this->outOfGameCards = [];\n $this->activeCard = null;\n $this->resetGuardianEffect();\n $this->winners = [];\n $this->outOfGamePlayers = [];\n\n // Draw cards\n foreach ($this->players as $player) {\n if (!$state = $player->getPlayerState()) {\n $state = new PlayerState();\n $player->setPlayerState($state);\n } else {\n $state->reset();\n if ($brandNewGame) {\n $state->resetWins();\n }\n }\n $state->addCard($this->drawCard());\n }\n $this->reserve[0] = $this->drawCard();\n if ($this->players->count() === 2) {\n for ($i = 0; $i < 3; $i++) {\n $this->outOfGameCards[] = $this->drawCard();\n }\n }\n }",
"public function testcheckComputerContinue()\n {\n $dice = new DiceHand();\n $dice->setPlayerScore(15);\n $dice->setComputerScore(2);\n $res = $dice->checkComputerContinue(5);\n $exp = 0;\n $this->assertEquals($exp, $res);\n }",
"public function testCheckScore()\n {\n session_start();\n $this->initSession();\n\n commandCheck('throw');\n commandCheck('stop');\n\n $actual = $_SESSION['game']['winner'];\n\n $this->assertNotEquals('None', $actual);\n\n destroySession();\n }",
"protected function start($options)\n {\n $this->quizId = $options['quiz'];\n $this->questionsPerRound = $options['numberOfQuestions'];\n $this->timeLimit = intval($options['timeLimit']);\n if ($this->timeLimit === 0) $this->timeLimit = 999999; // almost infinite!\n else $this->timeLimit *= 10;\n $this->status = self::GAME_STATUS_PLAYERS_CHOOSING;\n $this->nextRound();\n }"
] | [
"0.5556383",
"0.55322397",
"0.5420037",
"0.54175586",
"0.5374685",
"0.5355003",
"0.53269035",
"0.53248894",
"0.53211457",
"0.53193235",
"0.5309224",
"0.52495265",
"0.5174147",
"0.5162297",
"0.513348",
"0.5114954",
"0.5109721",
"0.5099681",
"0.5066354",
"0.50399715",
"0.5039892",
"0.50323725",
"0.5015982",
"0.50139356",
"0.49944404",
"0.49818882",
"0.49793357",
"0.49447715",
"0.49414173",
"0.49267253"
] | 0.6382148 | 0 |
Play a weapon card | public function playWeaponCard($weapon_name, $player_id = 1, $targets = []) {
/** @var Player $player */
$player = $this->game->getPlayer1();
if ($player_id == 2) {
$player = $this->game->getPlayer2();
}
$card = Card::load($player, $weapon_name);
$player->play($card, $targets);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function playCard(int $card_id);",
"public function test_power_word_shield_gives_target_minion_two_health_and_draws_one_card() {\n $chillwind_yeti = $this->playCard('Chillwind Yeti', 1);\n $this->playCard('Power Word: Shield', 1, [$chillwind_yeti]);\n $this->assertEquals(7, $chillwind_yeti->getHealth());\n $this->assertEquals(1, $this->game->getPlayer1()->getHandSize());\n }",
"public function test_shield_block_gains_five_armor_and_draws_one_card() {\n $this->playCard('Shield Block', 1);\n $this->assertEquals(5, $this->game->getPlayer1()->getHero()->getArmor());\n $this->assertEquals(1, $this->game->getPlayer1()->getHandSize());\n }",
"public function test_fan_of_knives_deals_1_damage_to_all_enemy_minions_and_player_draws_card() {\n $wisp1 = $this->playCard('Wisp', 2);\n $chillwind_yeti = $this->playCard('Chillwind Yeti', 2);\n $this->playCard('Fan of Knives', 1);\n $this->assertEquals(1, $this->game->getPlayer1()->getHandSize());\n $this->assertFalse($wisp1->isAlive());\n $this->assertEquals(4, $chillwind_yeti->getHealth());\n }",
"public function playInstrument()\n {\n }",
"public function setWeapon(Weapon $weapon): void\n {\n $this->weapon = $weapon;\n }",
"function steal ($itemid) \n{\n global $player;\n global $smarty;\n global $title;\n global $newdata;\n global $db;\n \n if ($player -> clas != 'Złodziej')\n {\n error(ERROR);\n }\n checkvalue($itemid);\n if ($player -> hp <= 0) \n {\n error (E_DEAD);\n }\n if ($player -> crime <= 0) \n {\n error (E_CRIME);\n }\n if ($title != 'Łucznik') \n {\n\t$arritem = $db -> Execute(\"SELECT * FROM `equipment` WHERE `id`=\".$itemid);\n } \n else \n {\n\t$arritem = $db -> Execute(\"SELECT * FROM `bows` WHERE `id`=\".$itemid);\n }\n $roll = rand (1, ($arritem->fields['minlev'] * 100));\n\n $arrEquip = $player -> equipment();\n $player->curstats($arrEquip);\n $player->curskills(array('thievery'));\n\n $intStats = ($player->agility + $player->inteli + $player->thievery);\n /**\n * Add bonus from tools\n */\n if ($arrEquip[12][0])\n {\n\t$intStats += (($arrEquip[12][2] / 100) * $intStats);\n }\n\n $chance = $intStats - $roll;\n $strDate = $db -> DBDate(date(\"y-m-d\"));\n if ($chance < 1) \n {\n $cost = 1000 * $player -> level;\n $expgain = ceil ($arritem->fields['minlev'] / 10);\n checkexp($player -> exp, $expgain, $player -> level, $player -> race, $player -> user, $player -> id, 0, 0, $player -> id, 'thievery', 0.01);\n $db -> Execute(\"UPDATE `players` SET `miejsce`='Lochy', `crime`=`crime`-1 WHERE `id`=\".$player -> id);\n $db -> Execute(\"INSERT INTO `jail` (`prisoner`, `verdict`, `duration`, `cost`, `data`) VALUES(\".$player -> id.\", '\".VERDICT.\"', 7, \".$cost.\", \".$strDate.\")\") or die(\"Błąd!\");\n $db -> Execute(\"INSERT INTO log (`owner`, `log`, `czas`, `type`) VALUES(\".$player -> id.\",'\".S_LOG_INFO.\" \".$cost.\".', \".$strDate.\", 'T')\");\n\tif ($arrEquip[12][0])\n\t {\n\t $db->Execute(\"DELETE FROM `equipment` WHERE `id`=\".$arrEquip[12][0]);\n\t }\n\t$objTool = $db->Execute(\"SELECT `id` FROM `equipment` WHERE `owner`=\".$player->id.\" AND `type`='E' AND `status`='U'\");\n\tif ($objTool->fields['id'])\n\t {\n\t $intRoll = rand(1, 100);\n\t if ($intRoll < 50)\n\t {\n\t\t$db->Execute(\"DELETE FROM `equipment` WHERE `owner`=\".$player->id.\" AND `type`='E' AND `status`='U'\");\n\t }\n\t }\n\t$objTool->Close();\n error (CRIME_RESULT1);\n } \n else \n { \n $db -> Execute(\"UPDATE `players` SET `crime`=`crime`-1 WHERE `id`=\".$player -> id);\n $expgain = ($arritem->fields['minlev'] * 5); \n\t$fltThief = ($arritem->fields['minlev'] / 100);\n checkexp($player -> exp, $expgain, $player -> level, $player -> race, $player -> user, $player -> id, 0, 0, $player -> id, 'thievery', $fltThief);\n if ($arritem -> fields['type'] == 'R') \n {\n $test = $db -> Execute(\"SELECT id FROM equipment WHERE name='\".$arritem -> fields['name'].\"' AND owner=\".$player -> id.\" AND status='U' AND cost=1\");\n if (empty ($test -> fields['id'])) \n {\n $db -> Execute(\"INSERT INTO equipment (owner, name, power, cost, wt, szyb, minlev, maxwt, type) VALUES(\".$player -> id.\",'\".$arritem -> fields['name'].\"',\".$arritem -> fields['power'].\",1,\".$arritem -> fields['maxwt'].\",\".$arritem -> fields['szyb'].\",\".$arritem -> fields['minlev'].\",\".$arritem -> fields['maxwt'].\",'\".$arritem -> fields['type'].\"')\") or error(DB_ERROR2);\n } \n else \n {\n $db -> Execute(\"UPDATE equipment SET wt=wt+\".$arritem -> fields['maxwt'].\" WHERE id=\".$test -> fields['id']);\n $db -> Execute(\"UPDATE equipment SET maxwt=maxwt+\".$arritem -> fields['maxwt'].\" where id=\".$test -> fields['id']);\n }\n $test -> Close();\n } \n else \n {\n $test = $db -> Execute(\"SELECT id FROM equipment WHERE name='\".$arritem -> fields['name'].\"' AND wt=\".$arritem -> fields['maxwt'].\" AND type='\".$arritem -> fields['type'].\"' AND status='U' AND owner=\".$player -> id.\" AND power=\".$arritem -> fields['power'].\" AND zr=\".$arritem -> fields['zr'].\" AND szyb=\".$arritem -> fields['szyb'].\" AND maxwt=\".$arritem -> fields['maxwt'].\" and cost=1\");\n if (empty ($test -> fields['id'])) \n {\n if ($arritem -> fields['type'] == 'B') \n {\n $arritem -> fields['twohand'] = 'Y';\n }\n $db -> Execute(\"INSERT INTO equipment (owner, name, power, type, cost, zr, wt, minlev, maxwt, amount, szyb, twohand, repair) VALUES(\".$player -> id.\",'\".$arritem -> fields['name'].\"',\".$arritem -> fields['power'].\",'\".$arritem -> fields['type'].\"',1,\".$arritem -> fields['zr'].\",\".$arritem -> fields['maxwt'].\",\".$arritem -> fields['minlev'].\",\".$arritem -> fields['maxwt'].\",1,\".$arritem -> fields['szyb'].\",'\".$arritem -> fields['twohand'].\"', \".$arritem -> fields['repair'].\")\") or error(DB_ERROR3);\n } \n else \n {\n $db -> Execute(\"UPDATE equipment SET amount=amount+1 WHERE id=\".$test -> fields['id']);\n }\n $test -> Close();\n }\n\tif ($arrEquip[12][0])\n\t {\n\t $arrEquip[12][6] --;\n\t if ($arrEquip[12][6] <= 0)\n\t {\n\t\t$db->Execute(\"DELETE FROM `equipment` WHERE `id`=\".$arrEquip[12][0]);\n\t }\n\t else\n\t {\n\t\t$db->Execute(\"UPDATE `equipment` SET `wt`=`wt`-1 WHERE `id`=\".$arrEquip[12][0]);\n\t }\n\t }\n error (CRIME_RESULT2.\" \".$arritem -> fields['name'].CRIME_RESULT3.\" Zdobyłeś \".$fltThief.\" w umiejętności Złodziejstwo.\");\n }\n}",
"public function test_deadly_poison_adds_two_attack_to_friendly_weapon() {\n $this->playWeaponCard('Light\\'s Justice', 1);\n $this->playCard('Deadly Poison', 1);\n $this->assertEquals(3, $this->game->getPlayer1()->getHero()->getWeapon()->getAttack());\n }",
"public function test_blessing_of_kings_gives_wisp_4_4() {\n $wisp = $this->playCard('Wisp', 1);\n $this->playCard('Blessing of Kings', 1, [$wisp]);\n $this->assertEquals(5, $wisp->getAttack());\n $this->assertEquals(5, $wisp->getMaxHealth());\n $this->assertEquals(5, $wisp->getHealth());\n }",
"public function turn()\n\t{\n\t\t$this->switchPlayer();\n\t\t//promt for card index\n\t\t$card = $this->playerOnTurn->throwCard(0);\n\t\t\n\t\t//check if object is from DamageCard class\n\t\tif (!$card->isApplicableToCurrentPlayer()){\n\t\t\t$card->applyToPlayer($this->getOtherPlayer());\n\t\t}else{\n\t\t\t$card->applyToPlayer($this->playerOnTurn);\n\t\t}\n\t}",
"public function playSolo()\n {\n }",
"public function test_hammer_of_wrath_deals_three_damage_and_draws_one_card() {\n $chillwind_yeti = $this->playCard('Chillwind Yeti', 1);\n $this->playCardStrict('Hammer of Wrath', 2, 2, [$chillwind_yeti]);\n $this->assertEquals(2, $chillwind_yeti->getHealth());\n $this->assertEquals(1, $this->game->getPlayer2()->getHandSize());\n }",
"public function fight(): void\r\n {\r\n echo \"\\nGiving a sword slash!\";\r\n }",
"function reaction(){\n\t\tif(rand(1,10) == 1){\n\t\t\t$this->brain->setstate(\"stunned_attack\");\n\t\t} else {\n\t\t\t$this->brain->setstate(\"defend\");\n\t\t\t$this->damageresist = true;\n\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") defended at \" . $this->posx . \"-\" . $this->posy . \".\");\n\t\t}\n\t}",
"function reaction(){\n\t\tif(rand(1,4) == 1){\n\t\t\t$this->brain->setstate(\"stunned_attack\");\n\t\t} else {\n\t\t\t$this->brain->setstate(\"defend\");\n\t\t\t$this->damageresist = true;\n\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") defended at \" . $this->posx . \"-\" . $this->posy . \".\");\n\t\t}\n\t}",
"function playBook()\r\n { \r\n \r\n }",
"abstract protected function onPlay(int $quantity, WriteOnlyPlayer $player);",
"function play($nr) {\r\n\t\t$this->sendCommand(\"play $nr\");\r\n\t}",
"function hunterslodge_customweapon_install(){\n\t//module_addhook(\"charstats\");\n\tmodule_addhook(\"newday\");\n\tmodule_addhook(\"mysticalshop-buy\");\n\t//module_addhook(\"iitems-use-item\");\n\treturn true;\n}",
"public function createRandomWeapon(){\n $this->randomWeapon = self::ARMOURY[rand(1,3)];\n return($this->randomWeapon);\n }",
"public function unequipWeapon() {\n $this->strength = 2;\n $this->accuracy = 50;\n $this->equippedWeapon = NULL;\n }",
"public function makeSound()\n // este metodo implementa un metodo abstracto\n {\n echo \"Guau\\n\";\n }",
"function weaponEffectiveness(string $weapon)\n {\n switch ($weapon)\n {\n case 'glock': return 0.7 + (rand(0, 10) / 100);\n case 'shotgun': return 0.8 + (rand(0, 10) / 100);\n case 'ak-47': return 0.9 + (rand(0, 10) / 100);\n case 'm-16': return 1.0;\n default: return 0.7 + (rand(0, 10) / 100);\n }\n }",
"public static function equipWeapon(Weapon $weapon, Character $character, int $hand)\r\n {\r\n $tmpWeapons = $character->getWeapons();\r\n\r\n if ($weapon->gettype() <= $character->getHands()) {\r\n if ($weapon->gettype() == 1) {\r\n $tmpWeapons[$hand] = $weapon;\r\n GameAnnouncer::anounceEquipOneHand($character, $weapon, $hand);\r\n $character->setHands($character->getHands() - 1);\r\n } else {\r\n $tmpWeapons[0] = $weapon;\r\n $tmpWeapons[1] = $weapon;\r\n\r\n GameAnnouncer::anounceEquipTwoHand($character, $weapon);\r\n $character->setHands(0);\r\n }\r\n } else {\r\n GameAnnouncer::anounceCannotEquip($character);\r\n }\r\n $character->setWeapons($tmpWeapons);\r\n }",
"public function fire(){\n echo $this ->sound ;\n }",
"public static function MOB_ARMOR_STAND_HIT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_ARMOR_STAND_HIT);\n }",
"public function play() {\n\t\t$myDrones = $this->teams[$this->myTeamId]->drones;\n\n\t\tforeach ($myDrones as $droneId => $drone) {\n\t\t\tprint \"3999 1799\\n\";\n\t\t}\n\t}",
"public function mire(){\n echo $this ->sound ;\n }",
"public function PlayM3U(){\n\n \n }",
"public function fight(Playerable $striker, Playerable $defender);"
] | [
"0.62743974",
"0.6064218",
"0.6048547",
"0.59743226",
"0.5815664",
"0.5814988",
"0.5799424",
"0.5754665",
"0.57107574",
"0.5691427",
"0.56847227",
"0.5672684",
"0.56679916",
"0.5657523",
"0.563838",
"0.5592192",
"0.55913424",
"0.55802494",
"0.5551164",
"0.55464613",
"0.554217",
"0.55278736",
"0.5482245",
"0.5417486",
"0.54102546",
"0.5389627",
"0.5364507",
"0.5356097",
"0.53278536",
"0.53262955"
] | 0.6315825 | 0 |
Get the active player id | public function getActivePlayerId() {
return $this->game->getActivePlayer()->getPlayerId();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getId() {\r\n return $this->playerId;\r\n }",
"function player() {\n\t\t$playerid = Session::getCookie('spieler_id');\n\t\tif (empty($playerid))\n\t\t\t$playerid = 0;\n\t\treturn $playerid;\n\t}",
"public function getActive()\n\t{\n\t\treturn $_SESSION['player']['active'];\n\t}",
"public function get_playerid(){return $this->_playerid;}",
"public function getPlayerStatusId() {\n\t\treturn $this->_player_status;\n\t}",
"public function getCurrentPlayer()\n {\n return $this->currentPlayerIndex;\n }",
"public function getCurrentPlayer()\r\n\t{\r\n\t\treturn $this->currentPlayer;\r\n\t}",
"public function getPlayerStatisticPlayerId() {\n\t\treturn ($this->playerStatisticPlayerId);\n\t}",
"public function getCurrentPlayer() : string\n {\n return $this->currentPlayer;\n }",
"public static function getActiveInstanceID()\n {\n return static::$activeInstanceID;\n }",
"function get_player_id($player_mac_address)\n\t{\n\t\tglobal $Error;\n\t\t$fail = $Error;\n\t\t$db = db_init();\n\t\t$result = mysqli_query($db, \"select PlayerId from user where MacAddress = '\".$player_mac_address.\"';\");\n\t\t$fail = show_error($db);\n\t\t$row = mysqli_fetch_row($result);\n\t\tmysqli_close($db);\n\t\treturn $row[0];\n\t}",
"function getActivePlayer($gameID) {\n try {\n $query_result = dbSelect(\"SELECT active_player FROM games WHERE games_id = '$gameID';\"); // from dbConnect.php\n if (empty($query_result)) {\n return FAILED; //from constants.php\n }\n $result_decoded = decodeSelectFirstResult($query_result)['active_player']; //from decoder.php\n return $result_decoded;\n }\n catch(PDOException $e)\n {\n die ('PDO error in getActivePlayer()\": ' . $e->getMessage() );\n }\n }",
"public function getCurrentId()\n {\n return $this->id;\n }",
"public function getPlayer(): string {\n\t\treturn $this->player;\n\t}",
"public function getDefendingPlayerId() {\n return $this->game->getDefendingPlayer()->getPlayerId();\n }",
"public function getCurrentId() {\n return !empty($this->arCurrent['id']) ? $this->arCurrent['id'] : 0;\n }",
"public function getGameId() {\n }",
"public function getCurrentPlayer()\n\t\t{\n\t\t\tif ($this->turn === 1)\n\t\t\t{\n\t\t\t\treturn $this->player1;\n\t\t\t}\t//end if\n\t\t\t\n\t\t\treturn $this->player2;\n\t\t}",
"function _getParticipantId($active_id)\n\t{\n\t\tglobal $lng, $ilDB;\n\n\t\t$result = $ilDB->queryF(\"SELECT user_fi FROM tst_active WHERE active_id = %s\",\n\t\t\tarray(\"integer\"),\n\t\t\tarray($active_id)\n\t\t);\n\t\t$row = $ilDB->fetchAssoc($result);\n\t\treturn $row[\"user_fi\"];\n\t}",
"public function getActiveId(): string\n {\n if (!$this->isLoggedIn()) {\n throw Exceptional::Runtime('User is not logged in');\n }\n\n $id = $this->getProfile()->getId();\n\n if ($id === null) {\n throw Exceptional::Runtime('User does not have an ID');\n }\n\n return (string)$id;\n }",
"protected function getPlayer()\n {\n return $this->fixtures->getReference('player-1');\n }",
"public static function getBotId();",
"public function getPlayerTypeId() {\n\t\treturn $this->_player_type;\n\t}",
"public function getNumberPlayer()\n {\n return $this->numberPlayer;\n }",
"public function getPlayerStatisticGameId() {\n\t\treturn ($this->playerStatisticGameId);\n\t}",
"public function getCurrentId()\n {\n $sql = 'SELECT value FROM ' . $this->table . ' WHERE name = ?';\n\n $id = $this->db->fetchOne($sql, array($this->name));\n\n if (!empty($id) || '0' === $id || 0 === $id) {\n return (int) $id;\n }\n }",
"private function getCurrentCampaignId()\n {\n return $this->currentCampaign->id;\n }",
"public function getID() {\n\t\treturn \\Anemo\\ID::getInstance();\n\t}",
"function getUserid(){\n\t\terror_reporting(0);\n\t\tif(!isset($_COOKIE['fbsr_123059651225050'])){\n\t\t\tthrow new Exception('Invalid player');\n\t\t}\n\t\t$data = parse_signed_request($_COOKIE['fbsr_123059651225050']);\n\t\tif($data[\"user_id\"] == null){\n\t\t\tthrow new Exception('Invalid Cookie');\n\t\t}\n\t\treturn $data[\"user_id\"];\n\t}",
"public static function getCurrentId()\n {\n return rex_addon::get('structure')->getProperty('article_id', 1);\n }"
] | [
"0.7827696",
"0.7537159",
"0.7243066",
"0.7143613",
"0.7105579",
"0.7025621",
"0.69876873",
"0.68593097",
"0.6835582",
"0.6774794",
"0.66554064",
"0.66345334",
"0.66343874",
"0.6633631",
"0.66197675",
"0.6607459",
"0.6589028",
"0.6535655",
"0.65280503",
"0.64224684",
"0.6363743",
"0.6359981",
"0.63594306",
"0.6302064",
"0.6287472",
"0.626808",
"0.6232913",
"0.6220582",
"0.62063056",
"0.6196247"
] | 0.88093275 | 0 |
Get the defending player id | public function getDefendingPlayerId() {
return $this->game->getDefendingPlayer()->getPlayerId();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getId() {\r\n return $this->playerId;\r\n }",
"function player() {\n\t\t$playerid = Session::getCookie('spieler_id');\n\t\tif (empty($playerid))\n\t\t\t$playerid = 0;\n\t\treturn $playerid;\n\t}",
"public function getActivePlayerId() {\n return $this->game->getActivePlayer()->getPlayerId();\n }",
"public function getPlayerStatisticPlayerId() {\n\t\treturn ($this->playerStatisticPlayerId);\n\t}",
"public function get_playerid(){return $this->_playerid;}",
"public function getPlayerStatisticGameId() {\n\t\treturn ($this->playerStatisticGameId);\n\t}",
"public function getGameId() {\n }",
"public function getDefender(): IPlayer\n {\n return $this->attacker->getType() == 'hero' ? $this->beast : $this->hero;\n }",
"public function getFuzzyID()\n {\n return $this->isLoggedIn() ? $this->getSteamID() : $this->getIP();\n }",
"public static function getBotId();",
"protected function getPlayer()\n {\n return $this->fixtures->getReference('player-1');\n }",
"public function getBehelpedId()\n {\n $value = $this->get(self::BEHELPED_ID);\n return $value === null ? (integer)$value : $value;\n }",
"public function getPlayerTypeId() {\n\t\treturn $this->_player_type;\n\t}",
"public function getPlayerStatusId() {\n\t\treturn $this->_player_status;\n\t}",
"public function getSummonerId()\n {\n return $this->get('summonerId', '0');\n }",
"public function getGameid()\n {\n return $this->gameid;\n }",
"public function getPlayer(): string {\n\t\treturn $this->player;\n\t}",
"public function getFlashId();",
"public function defender()\n {\n return $this->belongsTo(Player::class);\n }",
"public function getNumberPlayer()\n {\n return $this->numberPlayer;\n }",
"public function getPlayerStatisticStatisticId() {\n\t\treturn ($this->playerStatisticStatisticId);\n\t}",
"function get_id() {\n\t\treturn '';\n\t}",
"public function getPlaylistId();",
"public function getDefaultId() {\n return !empty($this->arDefault['id']) ? $this->arDefault['id'] : 0;\n }",
"public function getMatchId() {\n if (!property_exists($this, 'id') || is_null($this->id)) {\n return NULL;\n }\n if (is_null($this->matchId)) {\n if ( !$cache = cache_get('getMatchId_' . $this->id, 'cache_tourney')) {\n $query = tourney_relation_query('tourney_game', $this->id);\n $query->entityCondition('bundle', 'has_game');\n $results = $query->execute();\n\n if (!empty($results)) {\n $relation = array_pop($results);\n $r = relation_load($relation->rid);\n $this->matchId = $r->endpoints[LANGUAGE_NONE][0]['entity_id'];\n }\n\n if (isset($this->matchId)) {\n cache_set('getMatchId_' . $this->id, $this->matchId, 'cache_tourney');\n }\n }\n else {\n $this->matchId = $cache->data;\n }\n }\n return $this->matchId;\n }",
"function get_player_id($player_mac_address)\n\t{\n\t\tglobal $Error;\n\t\t$fail = $Error;\n\t\t$db = db_init();\n\t\t$result = mysqli_query($db, \"select PlayerId from user where MacAddress = '\".$player_mac_address.\"';\");\n\t\t$fail = show_error($db);\n\t\t$row = mysqli_fetch_row($result);\n\t\tmysqli_close($db);\n\t\treturn $row[0];\n\t}",
"public function getEndingDisputeID()\n {\n return $this->endingDisputeID;\n }",
"public function getCurrentPlayer()\n {\n return $this->currentPlayerIndex;\n }",
"private function getMemberId()\n\t{\n\t\t$urabe = $this->urabe->get_clone();\n\t\t$sql = \"SELECT memberId FROM chat_members cm WHERE cm.chatId = @1 AND cm.userId = @2\";\n\t\t$sql = $urabe->format_sql_place_holders($sql);\n\t\t$this->memberId = $urabe->select_one($sql, array($this->chatId, $this->userAccess->userId));\n\t}",
"public function getOthePlayer()\n\t{\n\t\tif ($this->playerOnTurn === $this->playerOne){\n\t\t\treturn $this->playerTwo;\n\t\t}\n\t\treturn $this->playerOne;\n\t}"
] | [
"0.69963473",
"0.69640946",
"0.679695",
"0.6691843",
"0.65373164",
"0.6353069",
"0.6351444",
"0.61356443",
"0.6134915",
"0.61022043",
"0.6054267",
"0.604144",
"0.6007973",
"0.5961142",
"0.5908833",
"0.5871852",
"0.58234125",
"0.5816226",
"0.5812379",
"0.5783053",
"0.57641435",
"0.57435864",
"0.5724038",
"0.57209355",
"0.57126147",
"0.5681452",
"0.5668377",
"0.5662374",
"0.5651498",
"0.56229424"
] | 0.8976736 | 0 |
HasMany relations with mails. | public function mails()
{
return $this->hasMany(config('core.acl.mailbox'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mails()\n {\n return $this->hasMany('App\\Model\\Mail');\n }",
"public function hasManyReceivers();",
"public function relations()\n\t{\n\t\treturn array(\n\t\t\t'campaigns'\t=>\tarray(self::HAS_MANY, 'Campaign', 'emailbox'),\n\t\t);\n\t}",
"public function emails()\n {\n return $this->morphMany(Email::class, 'emailable');\n }",
"public function domains()\n {\n return $this->belongsToMany(Domain::class, 'domain_mx', 'mail_domain_id', 'domain_id');\n }",
"public function recipients()\n {\n return $this->hasMany('App\\Recipient');\n }",
"protected function relations()\r\n {\r\n return [\r\n 'photo' => ChatPhoto::className(),\r\n 'pinned_message' => Message::className()\r\n ];\r\n }",
"public function emails()\n {\n return $this->hasMany(\n __NAMESPACE__ . '\\CampaignEmail', 'campaign_id', 'id'\n );\n }",
"public function attachments() {\n return $this->hasMany(Attachment::class);\n }",
"public function contactFor(): HasMany\n {\n return $this->hasMany(Department::class, 'contact_user_id');\n }",
"public function adresseemails() {\n return $this->belongsToMany('App\\Adresseemail')\n ->withPivot('rang', 'statut_id')->withTimestamps();\n }",
"public function relates()\n {\n $attachmentRelatesModel = \\Config::get('up::attachmentRelates.model');\n\n if ( ! $attachmentRelatesModel)\n {\n $attachmentRelatesModel = '\\Teepluss\\Up\\AttachmentRelates\\Eloquent\\AttachmentRelate';\n }\n\n return $this->hasMany($attachmentRelatesModel);\n }",
"public function messages(): HasMany\n {\n return $this->hasMany(Message::class);\n }",
"public function messages(): HasMany\n {\n return $this->hasMany(Message::class);\n }",
"public function communications()\n {\n return $this->hasMany(UserCommunication::class);\n }",
"public function messages()\n{\n return $this->hasMany(Message::class);\n}",
"public function subscriptions(): HasMany;",
"public function contactpeople()\n {\n return $this->hasMany('App\\Contactperson');\n }",
"public function subscribers() :HasMany {\n\t\treturn $this->hasMany(User::class, Subscription::class);\n\t}",
"public function messages() {\n\t\treturn $this->hasMany('App\\Message');\n\t}",
"public function getMessageRecipients()\n {\n return $this->hasMany(MessageRecipient::className(), ['recipient_id' => 'id']);\n }",
"public function group_messages() {\n\t\treturn $this->belongsToMany('App\\MessageGroup');\n\t}",
"public function relatedItems(): MorphMany\n {\n return $this->morphMany(RelatedItem::class, 'subject')->orderBy('position');\n }",
"public function hasMany($related, $foreignKey=null, $localKey=null);",
"public function replies(): HasMany\n {\n return $this->hasMany(Reply::class);\n }",
"public function messages()\n {\n return $this->hasMany('App\\Models\\Message');\n }",
"public function messages()\n {\n return $this->hasMany('Md\\Message');\n }",
"public function files(): HasMany\n {\n return $this->hasMany(ForumFile::class, 'post', 'id');\n }",
"public function relations()\n\t{\n\t\t// class name for the relations automatically generated below.\n\t\treturn array(\n\t\t\t\t'posts' => array(self::HAS_MANY, 'post', 'author_id'),\n\t\t);\n\t}",
"public function recipients()\n {\n return $this->hasManyThrough('App\\Translation\\Recipient', 'App\\Translation\\Message', 'user_id', 'message_id');\n }"
] | [
"0.7806761",
"0.6826596",
"0.67922",
"0.66291344",
"0.64826924",
"0.64611226",
"0.63497764",
"0.6274474",
"0.62680763",
"0.6231616",
"0.61981815",
"0.61560416",
"0.6125691",
"0.6125691",
"0.61133444",
"0.6048637",
"0.60119754",
"0.5996412",
"0.5971835",
"0.5969217",
"0.59576887",
"0.59402084",
"0.5938696",
"0.59363395",
"0.59271264",
"0.59125876",
"0.5901433",
"0.58843696",
"0.58789605",
"0.58693916"
] | 0.7259973 | 1 |
ManytoMany relations with departments. | public function departments()
{
return $this->belongsToMany(
config('core.acl.department'),
config('core.acl.user_role_department')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDepartments()\n {\n return $this->hasMany(Department::className(), ['id' => 'department_id']);\n }",
"public function getDepartments()\n {\n return $this->hasMany(Department::className(), ['id' => 'department_id'])->viaTable('employers_lnk_departments', ['employer_id' => 'id']);\n }",
"public function getDepartments()\n {\n return $this->hasMany(Departments::className(), ['id_company' => 'id']);\n }",
"public function getDepartments()\n {\n return $this->hasMany(Departments::className(), ['center_id' => 'id']);\n }",
"public function department()\n {\n return $this->belongsToMany('App\\Department', 'department_price_rule', 'price_rule_id')->withTimestamps();\n }",
"public function contactFor(): HasMany\n {\n return $this->hasMany(Department::class, 'contact_user_id');\n }",
"public function getDepartments()\n {\n return $this->hasMany(Departments::className(), ['id_branch' => 'id']);\n }",
"public function getEmployeeDepartments()\n {\n return $this->hasMany(EmployeeDepartment::className(), ['department_id' => 'id']);\n }",
"public function Department()\n {\n return $this->hasMany('App\\Department');\n }",
"public function departments(){\n\n return $this->hasMany('App\\Customer');\n }",
"public function departamentos(){\n return $this->hasMany('App\\Departamento','pais_id','id');\n }",
"public function departamento(){\n \treturn $this->hasMany('App\\Departamento');\n }",
"public function patients(): BelongsToMany\n {\n return $this->belongsToMany('App\\Models\\Patient', 'patient_connections', 'department_id', 'patient_id')->withTimestamps();\n }",
"public function getEmployersLnkDepartments()\n {\n return $this->hasMany(EmployersLnkDepartments::className(), ['employer_id' => 'id']);\n }",
"public function setDepartments(){\n $departments_temp = MobilefeedbacktooldepartmentsModel::model()->findAllByAttributes(array('game_id' => $this->gid));\n $departments_db = array();\n\n if(empty($departments_temp)){\n MobilefeedbacktooldepartmentsModel::initDepartments($this->gid);\n $departments_temp = MobilefeedbacktooldepartmentsModel::model()->findAllByAttributes(array('game_id' => $this->gid));\n }\n\n foreach ($departments_temp as $dept){\n $id = (int)$dept['id'];\n $title = trim($dept['title']);\n $departments_db[$title] = $id;\n $this->departments_by_id[$id] = $title;\n $this->departments_by_name[$title] = $id;\n }\n }",
"public function toMany() : ToManyRelationDefiner\n {\n return new ToManyRelationDefiner($this->callback, $this->mapperLoader, $loadIds = false);\n }",
"public function getAllDepartments()\n {\n $departments = Department::with(\n ['roles' => function ($q) {\n // $q->groupBy('id');\n }]\n )->get();\n\n if (!empty($departments)) {\n foreach ($departments as $department) {\n foreach ($department->roles as $role) {\n $role->users = Role::where('id', $role->id)->with(\n ['users' => function ($query) use ($department) {\n $query->wherePivot('department_id', $department->id);\n }]\n )->first()->users->count();\n }\n }\n }\n return $departments;\n }",
"public function getDepartmentEmployees()\n {\n return $this->hasMany(DepartmentEmployee::className(), ['department_id' => 'id']);\n }",
"public function apartments() : BelongsToMany\r\n {\r\n return $this->belongsToMany(LeadApartment::class, 'apartment_tag');\r\n }",
"public function branch_departments()\n {\n return $this->belongsTo(BranchDepartment::class, 'branch_dept_id');\n }",
"public function toManyIds() : ToManyRelationDefiner\n {\n return new ToManyRelationDefiner($this->callback, $this->mapperLoader, $loadIds = true);\n }",
"public function partners()\n {\n return $this->belongsToMany('App\\Partner');\n }",
"public function pedidos(){\n return $this->belongsToMany(Pedido::class);\n }",
"public function departamentos()\n {\n return $this->hasMany('App\\Departamentos','id_oficina','id_oficina');\n }",
"public function committee(){\n return $this->hasMany('App\\Committee','dept_id','id');\n }",
"public function deportes()\n {\n return $this->belongsToMany(static::$deportesModel, 'inv_productos_deportes', 'id_producto', 'id_deporte')->withTimestamps()->select(array('id', 'nombre as text'));\n }",
"public function users(){\n return $this->hasMany('App\\User','dept_id','id');\n }",
"public function cities()\n {\n return $this->hasMany(City::class, 'department_id', 'id');\n }",
"public function etudiants()\n {\n\n return $this->belongsToMany('App\\Etudiant');\n }",
"public function languages(): BelongsToMany\n {\n return $this->belongsToMany(config('pwweb.localisation.models.language'), 'system_localisation_country_languages');\n }"
] | [
"0.71676207",
"0.7102086",
"0.701923",
"0.6797038",
"0.67666644",
"0.67316794",
"0.67151934",
"0.67145723",
"0.6662031",
"0.6645467",
"0.63028723",
"0.6234457",
"0.6226716",
"0.61386186",
"0.60789365",
"0.6078695",
"0.60183495",
"0.59748787",
"0.59174716",
"0.59086806",
"0.58476686",
"0.58474135",
"0.58278555",
"0.58112794",
"0.581086",
"0.5792182",
"0.5753388",
"0.5746927",
"0.5738851",
"0.5717236"
] | 0.7242827 | 0 |
HasMany relations with ToDo. | public function toDo()
{
return $this->hasMany(config('core.acl.todo_model'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function todo()\n\n {\n return $this->hasMany('Todo');\n\n }",
"public function todos()\n {\n return $this->hasMany(Todo::class, 'to_do_resp_user');\n }",
"public function todo()\n {\n return $this->belongsTo(\\App\\Models\\Todo::class);\n }",
"public function tasks() {\n return $this->hasMany('App\\Task');\n }",
"public function questionsTo()\n {\n return $this->hasMany(Question::class, 'to_id');\n }",
"public function tasks()\n {\n return $this->hasMany('App\\Task');\n }",
"public function projectTasks(){\n return $this->hasManyThrough(Task::class, Project::class);\n }",
"public function tasks()\n {\n return $this->belongsToMany('App\\Task');\n }",
"public function tasks()\n\t{\n\t\treturn $this->hasMany('App\\Task');\n\t}",
"public function tasks(){\n // -- In this case it means a \"Project has many Tasks\"\n return $this->hasMany(Task::class);\n }",
"public function questions(): HasMany;",
"public function todolists()\n {\n return $this->belongsToMany('App\\ToDoList', 'category_todolist', 'category_id')->withTimestamps();\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Tasks::class);\n }",
"public function tasks()\n {\n \treturn $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasManyThrough('App\\Task', 'App\\Step');\n }",
"public function tasks(){\r\n return $this->hasMany('Nirland\\TaskyLand\\Models\\Task', 'project_id');\r\n }",
"public function conceptos()\n {\n return $this->hasMany('App\\Concepto', 'empleado_id');\n }",
"public function tasks(){\n return $this->hasMany('App\\Model\\Task', 'iduser');\n }",
"public function entries() {\n return $this->hasMany(TodoEntry::class, 'list_id');\n }",
"public function hasMany($related, $foreignKey=null, $localKey=null);",
"public function questions() : HasMany\n {\n return $this->hasMany(\"App\\Models\\Question\");\n }",
"public function tasks(): HasManyDeep\n {\n return $this->hasManyDeep(\n Task::class,\n ['team_user', User::class, 'task_user']\n );\n }",
"public function tips()\n {\n \n return $this->belongsToMany('App\\Tip');\n\n }",
"public function task() {\n return $this->hasMany(Task::class);\n }",
"public function pedidos(){\n return $this->belongsToMany(Pedido::class);\n }",
"public function notes()\n {\n return $this->belongsToMany(Note::class);\n }"
] | [
"0.7418792",
"0.6891597",
"0.6424822",
"0.6246558",
"0.6238764",
"0.6221363",
"0.6206371",
"0.6198821",
"0.6085566",
"0.60460263",
"0.6011194",
"0.60059774",
"0.5983066",
"0.5983066",
"0.5983066",
"0.5983066",
"0.5958275",
"0.5957729",
"0.5915234",
"0.5903107",
"0.5901533",
"0.5899784",
"0.5881814",
"0.58757806",
"0.5862681",
"0.5738835",
"0.57240707",
"0.5721025",
"0.56950146",
"0.5692597"
] | 0.6991556 | 1 |
HasMany relations with announcement. | public function announcement()
{
return $this->hasMany(config('core.acl.announcement'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function announcements() {\n return $this->hasMany('App\\Announcement');\n }",
"public function adjuntos(){\n return $this->belongsToMany('Adjunto','adjunto_mensaje','mensaje_id','adjunto_id');\n }",
"public function articles(): HasMany\n {\n return $this->hasMany(Article::class);\n }",
"public function announcement()\n {\n return $this->belongsTo('App\\Models\\Announcement');\n }",
"public function articles(){\n return $this->hasMany('App\\Article');\n }",
"public function achievements(){\r\n return $this->belongsToMany('App\\Achievement');\r\n }",
"public function articles() {\n\n return $this->hasMany('App\\Article');\n }",
"public function articles()\n\t{\n return $this->belongsToMany('App\\Article');\n }",
"public function articles():HasMany{\n return $this->hasMany(Article::class);\n }",
"public function articles()\n {\n return $this->hasMany('App\\Models\\Article');\n }",
"public function articles()\n {\n return $this->belongsToMany('App\\Article');\n }",
"public function articles()\n {\n return $this->belongsToMany('\\Batango\\entities\\Article');\n }",
"public function article()\n {\n return $this->belongsToMany('\\App\\Models\\Article');\n }",
"public function articles()\n {\n return $this->hasMany('App\\Models\\Articles');\n }",
"public function article()\n {\n return $this->hasMany('App\\Article');\n }",
"public function articles()\n {\n return $this->hasMany('App\\Article', 'author_id');\n }",
"public function advert()\n {\n return $this->belongsToMany(Advert::class);\n }",
"public function articles()\n {\n return $this->hasMany('App\\Models\\Article', 'author_id', 'id');\n }",
"public function articles()\n\t{\n\t\treturn $this->hasMany('App\\Article');\n\t}",
"public function articles(){\n return $this->hasMany(Article::class);\n }",
"public function news() :HasMany {\n\t\treturn $this->hasMany(CompanyNews::class);\n\t}",
"public function publications()\n {\n return $this->hasMany('App\\Models\\Applications\\Publication');\n }",
"public function article()\n {\n return $this->hasMany('App\\Models\\Articles');\n }",
"public function moviments(){\n return $this->hasMany(Moviment::class);\n }",
"public function publications()\n {\n return $this->hasMany(Publication::class);\n }",
"public function presentations(){\n return $this->belongsToMany('App\\Presentation');\n }",
"public function articles()\n {\n return $this->hasMany(Article::class);\n }",
"public function achievements(): BelongsToMany\n {\n return $this->belongsToMany(Achievement::class)->using(AchievementUser::class)->withTimestamps();\n }",
"public function articles() {\n return $this->hasMany('App\\Article', 'fournisseur_id');\n }",
"public function article() {\n \n return $this->belongsToMany(Article::class);\n }"
] | [
"0.79729015",
"0.66209084",
"0.6536515",
"0.6433633",
"0.63954973",
"0.63594615",
"0.6342339",
"0.63360226",
"0.63137496",
"0.62982863",
"0.6291888",
"0.6261524",
"0.62222815",
"0.62085485",
"0.62078863",
"0.6180034",
"0.61617935",
"0.61609817",
"0.6159733",
"0.61554325",
"0.6122333",
"0.6106248",
"0.6095983",
"0.6083052",
"0.608205",
"0.60786957",
"0.60463786",
"0.6040083",
"0.6038362",
"0.60378486"
] | 0.7287698 | 1 |
ManytoMany relations with meeting. | public function meetings()
{
return $this->belongsToMany(
config('core.acl.meeting_model'),
config('core.acl.meeting_members')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function participants()\n {\n return $this->belongsToMany('App\\Participant');\n }",
"public function match_meeting_details()\n\t{\n\t\treturn $this->belongsToMany('App\\MatchMeetingDetail', 'match_location_assocs','match_meeting_locations_id');\n\t}",
"public function hasManyReceivers();",
"public function adjuntos(){\n return $this->belongsToMany('Adjunto','adjunto_mensaje','mensaje_id','adjunto_id');\n }",
"public function participants()\n\t{ // $args are ('model', 'pivot_table_name', 'foreign_key_in_this_model', 'foreign_key_in_other_model')\n\t\treturn $this->belongsToMany('App\\Participant', config('aio.participant.participant_in_location_table'), 'location_id' , 'participant_id')->withTimestamps();\n\t}",
"public function parties() {\n return $this->belongsToMany('Party');\n }",
"public function getManyToManyRelations()\n {\n return $this->manyToManyRelations;\n }",
"public function getMeetings()\n {\n return $this->hasMany(Meeting::className(), ['house_id' => 'id']);\n }",
"public function partners()\n {\n return $this->belongsToMany('App\\Partner');\n }",
"public function talks()\n\t{\n\t\treturn $this->belongsToMany('Conferencer\\Models\\Talk')->orderBy('from', 'asc');\n\t}",
"public function participants()\n {\n return $this->hasMany(Participant::class);\n }",
"public function patients(): BelongsToMany\n {\n return $this->belongsToMany('App\\Models\\Patient', 'patient_connections', 'department_id', 'patient_id')->withTimestamps();\n }",
"public function subscribers(): BelongsToMany\n {\n return $this->belongsToMany(Subscriber::class, 'sendportal_tag_subscriber')->withTimestamps();\n }",
"public function conversations()\n {\n return $this->belongsToMany(Conversation::class)->withTimestamps();\n }",
"public function videos()\n {\n return $this->belongsToMany('App\\Video');\n }",
"public function questionnaires()\n {\n return $this->belongsToMany('App\\Models\\Questionnaire','questionnaire_video', 'video_id', 'questionnaire_id')->withTimestamps();\n }",
"public function activity(): BelongsToMany\n {\n return $this->belongsToMany('App\\Models\\Activity')->withTimestamps();\n }",
"public function tournaments()\n {\n return $this->belongsToMany('App\\Models\\Tournaments\\Tournament');\n }",
"public function subscriptions(): HasMany;",
"public function presentations(){\n return $this->belongsToMany('App\\Presentation');\n }",
"public function correspondents()\n {\n return $this->belongsToMany(\"Correspondent\");\n }",
"function isHasMany()\n {\n return true;\n }",
"public function appointments()\n {\n return $this->hasMany('App\\Appointment');\n }",
"public function appointments()\n {\n return $this->hasMany('App\\Appointment');\n }",
"public function videos()\n {\n return $this->belongsToMany(Video::class, 'video_news_collections');\n }",
"public function rooms()\n {\n return $this->belongsToMany('App\\Room', 'reservation_reservable', 'id_reserva', 'id_reservable')\n ->withPivot(\n 'adults',\n 'children',\n 'infants'\n );\n }",
"public function teams()\n {\n return $this->belongsToMany('App\\Team');\n }",
"public function actores(){ //1para tipo objecto devuelvue, tablainterm, 2 y 3parametro claves foraneas\n return $this->belongsToMany('App\\Actor', 'actor_movie', 'movie_id', 'actor_id' );\n\n}",
"public function etudiants()\n {\n\n return $this->belongsToMany('App\\Etudiant');\n }",
"public function passports(): BelongsToMany\n {\n return $this->belongsToMany(Passport::class, 'flight_passports')\n ->withTimestamps();\n }"
] | [
"0.6719977",
"0.643885",
"0.6343084",
"0.6228623",
"0.6221918",
"0.61864233",
"0.6122981",
"0.6081744",
"0.6079258",
"0.6075849",
"0.6050972",
"0.6043498",
"0.5993895",
"0.59928143",
"0.5984427",
"0.59531707",
"0.5949942",
"0.5949467",
"0.5932049",
"0.59238267",
"0.59076643",
"0.58934325",
"0.58929586",
"0.58929586",
"0.58888537",
"0.58762765",
"0.586353",
"0.58453196",
"0.5818057",
"0.5817883"
] | 0.7012655 | 0 |
HasMany relations with user activity. | public function userActivity()
{
return $this->hasMany(config('core.acl.user_activity'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function activity(): BelongsToMany\n {\n return $this->belongsToMany('App\\Models\\Activity')->withTimestamps();\n }",
"public function activities()\n {\n return $this->morphMany(UserActivity::class, 'observable');\n }",
"public function activitys()\n {\n return $this->hasMany('Fully\\Models\\Activity'); // F.K. activity_id\n }",
"public function activities()\n {\n return $this->hasMany('App\\Activity');\n }",
"public function activities() {\n return $this->hasMany(Activity::class, 'causer_id', 'id');\n }",
"public function activity() {\n return $this->hasMany('Modules\\Admin\\Models\\memberActivityLog', 'activity_type_id', 'id');\n }",
"public function users(): BelongsToMany\n {\n return $this->belongsToMany(config('multitenancy.user_model'))\n ->withTimestamps();\n }",
"public function achievements(): BelongsToMany\n {\n return $this->belongsToMany(Achievement::class)->using(AchievementUser::class)->withTimestamps();\n }",
"public function viewed_by_users()\n {\n return $this->belongsToMany('User', 'user_view');\n }",
"public function users(): BelongsToMany;",
"public function user(){\n return $this->belongsToMany('App\\user', 'user_id');\n }",
"public function users(): BelongsToMany\n {\n return $this->belongsToMany(User::class)\n ->withTimestamps();\n }",
"public function activity(): MorphMany\n {\n return $this->morphMany('App\\Activity', 'subject');\n }",
"public function users() : HasMany\n {\n return $this->hasMany(User::class);\n }",
"public function users()\r\n {\r\n return $this->belnogsToMany('App\\User');\r\n }",
"public function vaccinationUsers() : BelongsToMany\n {\n return $this->belongsToMany(User::class)->withTimestamps();\n }",
"public function users()\n {\n return $this->belongsToMany('App\\User')->withPivot('attended');\n }",
"public function users()\n {\n return $this->belongsToMany('App\\User', 'event_user', 'event_id', 'user_id')->withPivot('event_id', 'user_id'); // related model, table name, field current model, field joining model\n }",
"public function impression_by_users()\n {\n return $this->belongsToMany('User', 'user_impressions');\n }",
"public function users(): BelongsToMany\n {\n return $this->belongsToMany(User::class);\n }",
"public function users(): BelongsToMany\n {\n return $this->belongsToMany(User::class);\n }",
"public function user()\n {\n return $this->belongsToMany('App\\User');\n }",
"public function users() {\n return $this->belongsToMany('App\\User'); \n }",
"public function users(): BelongsToMany\r\n {\r\n return $this->belongsToMany(config('rabc.user'), 'role_user', 'user_id', 'role_id');\r\n }",
"public function user()\n {\n return $this->belongsToMany('App\\Models\\Users', 'user_id');\n }",
"public function user() \n {\n return $this->belongsToMany(User::class);\n }",
"public function users(): BelongsToMany\n {\n return $this->belongsToMany(config('auth.model') ?: config('auth.providers.users.model'))->withTimestamps();\n }",
"public function userFavoriteTour() {\n return $this->belongsToMany('App\\Tour', 'user_favorite_tour', 'user_id', 'tour_id')\n ->withTimestamps();\n }",
"public function users()\n {\n $this->belongsToMany(User::class);\n }",
"public function users() {\n return $this->belongsToMany('App\\User', 'bookmark_user', 'bookmarked_user_id', 'user_id');\n }"
] | [
"0.7090202",
"0.6995967",
"0.6894991",
"0.6855126",
"0.6767186",
"0.66146415",
"0.6489186",
"0.6414966",
"0.639982",
"0.63444316",
"0.6309029",
"0.62880266",
"0.6271172",
"0.6255267",
"0.62475383",
"0.62370247",
"0.6225005",
"0.62175304",
"0.6205023",
"0.6181479",
"0.6181479",
"0.61560035",
"0.61529195",
"0.6145937",
"0.6141932",
"0.6139312",
"0.6137301",
"0.61362183",
"0.6131575",
"0.61179084"
] | 0.750074 | 0 |
HasOne relations with settings. | public function settings()
{
return $this->hasOne(config('core.acl.user_setting_model'), 'user_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function settings()\n {\n return $this->hasOne(ChampionshipSettings::class);\n }",
"public function hasOne($related, $foreignKey=null, $localKey=null);",
"public function userSetting()\n {\n return $this->hasOne(UserSetting::class);\n }",
"public function getHasOne($model){ }",
"public function config(){\n return $this->hasOne('App\\Models\\LiteBriteConfig','id','config_id');\n }",
"public function setting(): BelongsTo\n {\n /** @var class-string<Model>|null $model */\n $model = config('laravel-settings.model');\n\n return $this->belongsTo($model ?? Setting::class);\n }",
"public function setHasOne($model, HasOne $relationship, $related): void;",
"public function user(): HasOne\n {\n return $this->hasOne(User::class, 'id');\n }",
"public function post(){\n return $this->hasOne('App\\Post');\n\n }",
"public function user(): HasOne\n {\n return $this->hasOne(User::class, 'id', 'user_id');\n }",
"public function addHasOne($model, $fields, $referenceModel, $referencedFields, $options=null){ }",
"public function admin(): HasOne\n {\n return $this->hasOne(Admin::class);\n }",
"public function venue(): HasOne\n {\n return $this->hasOne('App\\Models\\Entity', 'id', 'venue_id');\n }",
"public function settingPrice() {\n return $this->hasOne('App\\SettingPrice', 'id', 'setting_price_id');\n }",
"public function eventStatus(): HasOne\n {\n return $this->hasOne('App\\Models\\EventStatus', 'id', 'event_status_id');\n }",
"public function companySettings()\n {\n return $this->belongsTo('App\\Models\\CompanySettings');\n }",
"public function type()\n {\n return $this->belongsTo(SettingType::class);\n }",
"public function getArticle()\n{\n return $this->hasOne(Article::className(), ['id' => 'article_id']);\n}",
"public function series(): HasOne\n {\n return $this->hasOne(Series::class, 'id', 'series_id');\n }",
"public function getHasOne($model, HasOne $relationship, bool $linkage);",
"public function getSiteSettings()\n {\n return $this->hasOne(SiteSettings::class, ['user_id' => 'id']);\n }",
"public function eventType(): HasOne\n {\n return $this->hasOne('App\\Models\\EventType', 'id', 'event_type_id');\n }",
"public function personas(){return $this->hasOne(Personas::class,\"userId\");}",
"public function topic(): HasOne\n {\n return $this->hasOne(ForumTopic::class, 'id', 'topic_id');\n }",
"public function Metadata(){\n return $this->hasOne('Metadata');\n }",
"protected function hasOne($name, array $options = array())\n {\n $reverse = isset($options['reverse']) ? $options['reverse'] : false;\n\n if (isset($options['alias'])) {\n $alias = $options['alias'];\n } else {\n $alias = $name;\n }\n\n $this->relations['hasOne'][$alias] = new OneToOneRelation($this, $name, $reverse);\n }",
"public function hasOne($model, $local = null, $remote = null)\n {\n return (new OneToOne())->ini($model, $this, $local, $remote);\n }",
"public function persona(){\n return $this->hasOne('App\\Persona');\n }",
"public function category(): HasOne\n {\n return $this->hasOne(Category::class, 'id', 'category_id');\n }",
"public function promoter(): HasOne\n {\n return $this->hasOne(Entity::class, 'id', 'promoter_id');\n }"
] | [
"0.68043375",
"0.6740463",
"0.6628764",
"0.6606825",
"0.659847",
"0.65837324",
"0.6380343",
"0.62084657",
"0.6202088",
"0.6201341",
"0.619832",
"0.6191235",
"0.6115643",
"0.610219",
"0.6081457",
"0.60693634",
"0.6061508",
"0.6050644",
"0.60422814",
"0.5999624",
"0.5974999",
"0.5974899",
"0.59728056",
"0.5955616",
"0.59268844",
"0.59241015",
"0.5919742",
"0.5915166",
"0.59011847",
"0.59011763"
] | 0.7050947 | 0 |
ManytoMany relations with defects. | public function defects()
{
return $this->belongsToMany(
config('core.acl.defects_model'),
config('core.acl.defects_user_table'),
'user_id',
'defect_id'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function associations()\n\t{\n\t\treturn $this->belongsToMany('Emutoday\\ExpertCategory', 'expertcategory_associations', 'cat_id', 'assoc_id');\n\t}",
"public function associationsOtherway()\n\t{\n\t\treturn $this->belongsToMany('Emutoday\\ExpertCategory', 'expertcategory_associations', 'assoc_id', 'cat_id');\n\t}",
"public function comics()\n {\n return $this->belongsToMany('\\App\\Comics');\n }",
"public function issues(): HasMany\n {\n return $this->hasMany(Issue::class, 'fixed_version_id');\n }",
"public function contactFor(): HasMany\n {\n return $this->hasMany(Department::class, 'contact_user_id');\n }",
"public function califications()\n {\n return $this->belongsToMany('App\\Calification','id_chef', 'id');\n }",
"public function products(): BelongsToMany\n {\n return $this->belongsToMany(Product::class, 'category_product', 'category_id', 'product_id');\n }",
"public function designs()\n {\n return $this->hasMany(Design::class);\n }",
"public function subCategories(): HasMany\n {\n return $this->hasMany(SubCategory::class, 'category_id', 'id');\n }",
"public function tickets(){\n return $this -> hasMany(Ticket::class);\n }",
"public function addHasMany($model, $fields, $referenceModel, $referencedFields, $options=null){ }",
"public function definitions()\n {\n return $this->hasMany('App\\Definition');\n }",
"public function definitions()\n {\n return $this->hasMany('App\\Definition');\n }",
"protected function insertHasManyRelations(){\n\t\tif (is_array($this->acceptFilters)) {\n\t\t\tforeach ($this->acceptFilters as $fid) {\n\t\t\t\t$n = new Cpfilter();\n\t\t\t\t$n->type = 1;\n\t\t\t\t$n->cid = $this->id;\n\t\t\t\t$n->fid = $fid;\n\t\t\t\t$n->save();\n\t\t\t}\n\t\t}\n\t\tif (is_array($this->denyFilters)) {\n\t\t\tforeach ($this->denyFilters as $fid) {\n\t\t\t\t$n = new Cpfilter();\n\t\t\t\t$n->type = 0;\n\t\t\t\t$n->cid = $this->id;\n\t\t\t\t$n->fid = $fid;\n\t\t\t\t$n->save();\n\t\t\t}\n\t\t}\n\t\t// Worktimes\n\t\tif (is_array($this->cpworktimes)) {\n\t\t\tforeach ($this->cpworktimes as $tid){\n\t\t\t\t$n = new Cpworktime();\n\t\t\t\t$n->cid = $this->id;\n\t\t\t\t$n->tid = $tid;\n\t\t\t\t$n->save();\n\t\t\t}\n\t\t}\n\n\t\tif (is_array($this->cporders)) {\n\t\t\tforeach ($this->cporders as $oid){\n\t\t\t\t$n = new Cporder();\n\t\t\t\t$n->cid = $this->id;\n\t\t\t\t$n->oid = $oid;\n\t\t\t\t$n->save();\n\t\t\t}\n\t\t}\n\t}",
"public function chiefs()\n {\n return $this->belongsToMany(Employee::class, 'employees_approval', 'subordinate_id', 'chief_id');\n }",
"public function childCategories(): HasMany\n {\n return $this->hasMany(Category::class, 'category_id');\n }",
"public function categories(){\n return $this -> belongsToMany('Category');\n }",
"public function courses()\n\t{\n\t\treturn $this->belongsToMany('App\\Course');\n\t}",
"public function facilities()\n {\n return $this->belongsToMany('ShineOS\\Core\\Facilities\\Entities\\Facilities', 'facility_user', 'user_id', 'facility_id')->withPivot('facilityuser_id');\n }",
"public function competitions()\n {\n return $this->hasMany('App\\Competition');\n }",
"public function relations()\n\t{\n\t\t// class name for the relations automatically generated below.\n\t\treturn array(\n\t\t\t'deals' => array(self::MANY_MANY, 'MDeal', '{{DealCategoryAssoc}}(categoryId,dealId)', 'together' => true),\n\t\t\t'i18n' => array(self::HAS_MANY, 'MI18N', 'relatedId', 'on' => \"model='DealCategory'\"),\n\t\t);\n\t}",
"public function categories(): BelongsToMany\n {\n return $this->belongsToMany(Category::class, 'netcore_product__category_parameter');\n }",
"public function categories(): BelongsToMany {\n\t\treturn $this->belongsToMany(Category::class);\n\t}",
"public function courses() {\n return $this->belongsToMany(Course::class);\n }",
"public function categories() {\n return $this->belongsToMany('Category');\n }",
"public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }",
"public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }",
"public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }",
"public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }",
"public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }"
] | [
"0.6164462",
"0.6074082",
"0.5905159",
"0.58711237",
"0.5819145",
"0.5806676",
"0.5745278",
"0.57193863",
"0.569768",
"0.56895465",
"0.56788725",
"0.56307757",
"0.56307757",
"0.56246555",
"0.56117547",
"0.5607834",
"0.5607145",
"0.5602883",
"0.5576083",
"0.55741334",
"0.5554864",
"0.5550702",
"0.5536084",
"0.55272126",
"0.55097115",
"0.55042344",
"0.55042344",
"0.55042344",
"0.55042344",
"0.55042344"
] | 0.7364478 | 0 |
ManytoMany relations with incidents. | public function incidents()
{
return $this->belongsToMany(
config('core.acl.incidents_model'),
config('core.acl.incident_user_table'),
'user_id',
'incident_id'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function subscribers(): BelongsToMany\n {\n return $this->belongsToMany(Subscriber::class, 'sendportal_tag_subscriber')->withTimestamps();\n }",
"public function hasMany(iterable $collections);",
"public function parties() {\n return $this->belongsToMany('Party');\n }",
"public function entities(): BelongsToMany\n {\n return $this->belongsToMany('App\\Models\\Entity')->withTimestamps();\n }",
"public function hasMany($related, $foreignKey=null, $localKey=null);",
"public function getManyToManyRelations()\n {\n return $this->manyToManyRelations;\n }",
"public function ingredients()\n {\n return $this->belongsToMany('App\\Ingredient');\n }",
"public function correspondents()\n {\n return $this->belongsToMany(\"Correspondent\");\n }",
"public function items(): HasMany\n {\n return $this->hasMany(InvoiceItem::class);\n }",
"public function toManyIds() : ToManyRelationDefiner\n {\n return new ToManyRelationDefiner($this->callback, $this->mapperLoader, $loadIds = true);\n }",
"public function tags(): BelongsToMany\n {\n return $this->belongsToMany(Tag::class);\n }",
"public function roles(): BelongsToMany\n {\n return $this->belongsToMany(\n HCAclRole::class,\n 'hc_user_role_connection',\n 'user_id',\n 'role_id'\n );\n }",
"public function invites()\n\t{\n\t\treturn $this->hasMany(Invite::class);\n\t}",
"public function filterByHasMany($query, HasMany $relationship, array $ids): void;",
"public function entreprises()\n {\n return $this->belongsToMany('App\\Entreprises');\n }",
"public function invitations()\n {\n return $this->hasMany(Invitation::class);\n }",
"public function patients(): BelongsToMany\n {\n return $this->belongsToMany('App\\Models\\Patient', 'patient_connections', 'department_id', 'patient_id')->withTimestamps();\n }",
"public function achievements(): BelongsToMany\n {\n return $this->belongsToMany(Achievement::class)->using(AchievementUser::class)->withTimestamps();\n }",
"public function getHasMany($model, HasMany $relationship, bool $linkage): array;",
"public function notitions(): HasMany\n {\n return $this->hasMany(Notitions::class);\n }",
"public function items()\n {\n return $this->belongsToMany('App\\InvItem', 'inv_item_list', 'list_id', 'item_id');\n }",
"public function partners()\n {\n return $this->belongsToMany('App\\Partner');\n }",
"public function participants()\n {\n return $this->belongsToMany('App\\Participant');\n }",
"public function belongsToMany($model, $intermediate = null, $local = null, $remote = null)\n {\n return (new ManyToMany())->ini($model, $this, $intermediate, $local, $remote);\n }",
"public function inventories(): \\Illuminate\\Database\\Eloquent\\Relations\\HasMany\n {\n return $this->hasMany('Easy\\Commerce\\Models\\Catalog\\Inventory', 'warehouse_id', 'id');\n }",
"public function tags(): BelongsToMany\n {\n return $this->belongsToMany('post_tag', 'post_id', 'tag_id');\n }",
"public function entities()\n {\n return $this->hasMany(Entity::class, 'campaign_id', 'id');\n }",
"public function industries(){\n return $this->belongsToMany(Industry::class);\n }",
"public function ingredients() : HasMany\n {\n return $this->hasMany(Ingredient::class);\n }",
"public function getHasMany($model){ }"
] | [
"0.619237",
"0.61577934",
"0.6151512",
"0.61189675",
"0.6008907",
"0.6008241",
"0.5980733",
"0.59480333",
"0.59129775",
"0.59129",
"0.58997506",
"0.5894501",
"0.5888796",
"0.58813643",
"0.5874856",
"0.58591336",
"0.5853546",
"0.58474094",
"0.5845482",
"0.5829319",
"0.5809935",
"0.5789088",
"0.57852304",
"0.5782375",
"0.5780351",
"0.5779663",
"0.5773854",
"0.57671666",
"0.5722052",
"0.5700578"
] | 0.717111 | 0 |
action swf untuk nampilin video $_uname swf player | public function swfAction()
{
$youtube = new Zend_Gdata_YouTube();
try {
$lists = $youtube->getUserUploads(self::$_uname);
}
catch (Exception $ex) {
echo $ex->getMessage();
exit;
}
// masih ngawur, masih belum selesai, klo dibikin gini cuma keluar 1 video :p
// ntar aja dilanjut, ngantukkkkkkkkkkkkkkkkk
foreach($lists as $vids) {
$pub = new Zend_Date(
$vids->getPublished()->getText(),
Zend_Date::ISO_8601
);
// lempar ke view script
$this->view->videoTitle = $this->view->escape($vids->getVideoTitle());
$this->view->published = $pub;
$this->view->videoTags = join(', ', $vids->getVideoTags());
$this->view->desc = $this->view->escape($vids->getVideoDescription());
if($vids->isVideoEmbeddable()) {
$this->view->url = 'http://www.youtube.com/v/' . $vids->getVideoId(). '&fs=1';
$this->view->width = 320;
$height->view->height = 240;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function playerScript()\n {\n // TODO create secure token dynamically instead of static\n if($this->request->isPost())\n {\n $video_id=$this->request->getPost('video_id');\n $video=Videos::findFirst($video_id)->toArray();\n $filename=$video->name;\n\n echo '<script type=\"text/javascript\">jwplayer(\"video-body\").setup({',\n 'file: \"'.$filename.'\",',\n 'height: 300,\n width: 550,\n rtmp: {\n securetoken: \"d18bfcb0aa2416d5\"\n }\n });';\n\n $this->view->disable();\n }\n }",
"function VSWShowVideo($videosource,$videoid,$autoplaysetting,$videowidth,$videoheight,$admin,$shortcode){\n\n//admin = true to show in widget admin\n//admin = false to show in blog sidebar\n\n $v_autoplay2 = $autoplaysetting;\n $v_id2 = $videoid;\n\t\t$v_source = $videosource;\t\t\n $v_width2 = $videowidth;\n $v_height2 = $videoheight;\n \n \t$source = $v_source;\n \n\t\t//test for source and assign codes accordingly\t\n\t\tswitch ($source) {\n\t\t\n\t\tcase null:\n\t\t$value = null;\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n\t\tbreak;\t\t\n\t\t\n case YouTube:\n $value = \"http://www.youtube.com/v/$v_id2&autoplay=$v_autoplay2&loop=0&rel=0\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n break;\n\t\t\n\t\tcase Vimeo:\n\t\t$value = \"http://vimeo.com/moogaloop.swf?clip_id=$v_id2&server=vimeo.com&loop=0&fullscreen=1&autoplay=$v_autoplay2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n break;\n\t\t\n\t\tcase MySpace:\n\t\t$value = \"http://mediaservices.myspace.com/services/media/embed.aspx/m=$v_id2,t=1,mt=video,ap=$v_autoplay2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n break;\n\t\t\n\t\tcase Veoh:\n\t\t$value = \"http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.20.1002&\";\n\t\t$value.= \"permalinkId=$v_id2&player=videodetailsembedded&id=anonymous&videoAutoPlay=$v_autoplay2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n break;\n\t\t\n\t case Blip:\n\t\t$value = \"http://blip.tv/play/$v_id2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n break;\n\t\t\n\t case WordPress:\n\t\t$value = \"http://v.wordpress.com/$v_id2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n break;\n\t\t\n\t\tcase Viddler:\n\t\t$value = \"http://www.viddler.com/player/$v_id2\";\n\t\tif($v_autoplay2=='1'){\n\t\t$flashvar = \"<param name=\\\"flashvars\\\" value=\\\"autoplay=t\\\" />\\n\";\n\t\t$flashvar2 = 'flashvars=\"autoplay=t\" ';\n\t\t}\n break;\n\t\t\n\t\tcase DailyMotion:\n\t\t$value = \"http://www.dailymotion.com/swf/$v_id2&autoStart=$v_autoplay2&related=0\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n break;\n\t\t\t\t\n\t\t\n\t\tcase Revver:\n\t\t$value = \"http://flash.revver.com/player/1.0/player.swf?mediaId=$v_id2&autoStart=$v_autoplay2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n\t\tbreak;\n\t\t\n\t\tcase Metacafe:\n\t\t$id = split('/',$v_id2);\n\t\t$value = \"http://www.metacafe.com/fplayer/$id[0]/$id[1].swf\";\n\t\tif($v_autoplay2=='1'){\n\t\t$flashvar = null;\n\t\t$flashvar2 = 'flashVars=\"playerVars=showStats=no|autoPlay=yes|\"';\n\t\t}\n\t\tbreak;\n\t\t\n\t\tcase Tudou:\n\t\t$value = \"$v_id2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n\t\tbreak;\n\t\t\n\t\tcase Youku:\n\t\t$value = \"$v_id2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n\t\tbreak;\n\t\t\n\t\tcase cn6:\n\t\t$value = \"$v_id2\";\n\t\t$flashvar = null;\n\t\t$flashvar2 = null;\n\t\tbreak;\n\t\t\n\t\tcase Google:\n\t\t$value = \"http://video.google.com/googleplayer.swf?docid=$v_id2&hl=en&fs=true\";\n\t\tif($v_autoplay2=='1'){\n\t\t$flashvar = null;\n\t\t$flashvar2 = 'FlashVars=\"autoPlay=true&playerMode=embedded\"';\n\t\t}\n\t\tbreak;\n\t\t\n\t\tcase Tangle:\n\t\t$value = \"http://www.tangle.com/flash/swf/flvplayer.swf\";\n\t\tif($v_autoplay2=='1'){\n\t\t$flashvar = null;\n\t\t$flashvar2 = \"FlashVars=\\\"viewkey=$v_id2&autoplay=$v_autoplay2\\\"\";\n\t\t}else{\n\t\t$flashvar = null;\n\t\t$flashvar2 = \"FlashVars=\\\"viewkey=$v_id2\\\"\";\n\t\t}\n\t\tbreak;\n\t\n\t\t}\n\t\t\n\t\tif($shortcode==\"true\"){\n\t\t//added in version 2.3\n\t\t//return instead of echo video on blog using shortcode\n\t\t$vsw_code = \"\\n<object width=\\\"$v_width2\\\" height=\\\"$v_height2\\\">\\n\";\n\t\t$vsw_code .= $flashvar;\n\t\t$vsw_code .= \"<param name=\\\"allowfullscreen\\\" value=\\\"true\\\" />\\n\";\n\t\t$vsw_code .= \"<param name=\\\"allowscriptaccess\\\" value=\\\"always\\\" />\\n\";\n\t\t$vsw_code .= \"<param name=\\\"movie\\\" value=\\\"$value\\\" />\\n\";\n\t\t$vsw_code .= \"<param name=\\\"wmode\\\" value=\\\"transparent\\\">\\n\";\n\t\t$vsw_code .= \"<embed src=\\\"$value\\\" type=\\\"application/x-shockwave-flash\\\" wmode=\\\"transparent\\\" \";\n\t\t$vsw_code .= \"allowfullscreen=\\\"true\\\" allowscriptaccess=\\\"always\\\" \";\n\t\t$vsw_code .= $flashvar2;\n\t\t$vsw_code .= \"width=\\\"$v_width2\\\" height=\\\"$v_height2\\\">\\n\";\n\t\t$vsw_code .= \"</embed>\\n\";\n\t\t$vsw_code .= \"</object>\\n\\n\";\n\t\treturn $vsw_code;\n\t\t}\n\t\telseif($admin==\"true\"){\n\t\t// echo video in admin\n echo \"\\n<object width=\\\"212\\\" height=\\\"172\\\">\\n\";\n\t\techo $flashvar;\n\t\techo \"<param name=\\\"allowfullscreen\\\" value=\\\"true\\\" />\\n\";\n\t\techo \"<param name=\\\"allowscriptaccess\\\" value=\\\"always\\\" />\\n\";\n\t\techo \"<param name=\\\"movie\\\" value=\\\"$value\\\" />\\n\";\n\t\techo \"<param name=\\\"wmode\\\" value=\\\"transparent\\\">\\n\";\n\t\techo \"<embed src=\\\"$value\\\" type=\\\"application/x-shockwave-flash\\\" wmode=\\\"transparent\\\" \";\n\t\techo \"allowfullscreen=\\\"true\\\" allowscriptaccess=\\\"always\\\" \";\n\t\techo $flashvar2;\n\t\techo \"width=\\\"212\\\" height=\\\"172\\\">\\n\";\n\t\techo \"</embed>\\n\";\n\t\techo \"</object>\\n\\n\";\n\n }else{\n\t\t\n\t\t// echo video on blog\n\t\techo \"\\n<div class=\\\"video-widget-wrap\\\">\\n\";\n\t\techo \"\\n<object width=\\\"$v_width2\\\" height=\\\"$v_height2\\\">\\n\";\n\t\techo $flashvar;\n\t\techo \"<param name=\\\"allowfullscreen\\\" value=\\\"true\\\" />\\n\";\n\t\techo \"<param name=\\\"allowscriptaccess\\\" value=\\\"always\\\" />\\n\";\n\t\techo \"<param name=\\\"movie\\\" value=\\\"$value\\\" />\\n\";\n\t\techo \"<param name=\\\"wmode\\\" value=\\\"transparent\\\">\\n\";\n\t\techo \"<embed src=\\\"$value\\\" type=\\\"application/x-shockwave-flash\\\" wmode=\\\"transparent\\\" \";\n\t\techo \"allowfullscreen=\\\"true\\\" allowscriptaccess=\\\"always\\\" \";\n\t\techo $flashvar2;\n\t\techo \"width=\\\"$v_width2\\\" height=\\\"$v_height2\\\">\\n\";\n\t\techo \"</embed>\\n\";\n\t\techo \"</object>\\n\\n\";\n\t\techo \"\\n</div>\\n\";\n\t\t}\n\n\n}",
"public function videos();",
"function view_video() {\n\t\t$sandbox = isset($_GET['sandbox']) && $_GET['sandbox'] == 1;\n\t\t$id = $_GET['id'];\n\t\t\n\t\t$video = ($sandbox) ? $this->playwire->getSandboxVideo($id) : $this->playwire->getVideo($id);\n\t\tinclude 'view.tpl.php';\n\t\texit();\n\t}",
"function GetVideoElem($video_info)\n{\n\t$video_xref = $video_info[\"xref\"];\n\t$video_desc = $video_info[\"vname\"];\n\t$items = explode('\\\\',$video_xref);\n\t$items_ct = count($items);\n $video_path = $_SESSION[\"web_video_basepath\"] .\"/\".$items[$items_ct-3] .\"/\". $items[$items_ct-2].\"/\". $items[$items_ct-1];\n\techo \"<div class=\\\"video\\\">\\n\";\n\t//echo \"<video id='vidvid' controls>\\n\";\n //echo \"<source src=\\\"\".$video_path.\"\\\" type=\\\"video/mp4\\\">\\n\";\n //echo \"</video>\\n\";\n\techo \"<a href=\\\"\".$video_path.\"\\\" id=\\\"player\\\" style=\\\"display:block;width:320px;height:220px\\\" ></a>\";\n\techo \"<script>\\n\";\n\techo \"flowplayer(\\\"player\\\", \\\"flowplayer-3.2.16.swf\\\")\";\n\techo \"</script>\\n\";\n\t//echo \"<div id=\\\"vid_desc\\\">$video_desc</div>\\n\";\n\techo \"<div id=\\\"vid_desc\\\"></div>\\n\";\n echo \"</div>\\n\";\n}",
"function vsw_show_video_class($id,$source,$width,$height,$autoplay){\n\n $vsw_id = $id;\n\t\t$vsw_width = $width;\n\t\t$vsw_height = $height;\n \n\t\t//convert string of source to lowercase\n $source = strtolower($source);\n\n //should have used all lowercase in previous functions\n\t\t//now have to switch it.\n\t\tswitch ($source) {\n\t\t\n\t\tcase null:\n\t\t$vsw_source = null;\n\t\tbreak;\n\t\t\n\t\tcase youtube:\n\t\t$vsw_source = YouTube;\n\t\tbreak;\n\t\t\n\t\tcase vimeo:\n\t\t$vsw_source = Vimeo;\n break;\n\t\t\n\t\tcase myspace:\n\t\t$vsw_source = MySpace;\n break;\n\t\t\n\t\tcase veoh:\n\t\t$vsw_source = Veoh;\n break;\n\t\t\n\t case bliptv:\n\t\t$vsw_source = Blip;\n break;\n\t\t\n\t case wordpress:\n\t\t$vsw_source = WordPress;\n break;\n\t\t\n\t\tcase viddler:\n\t\t$vsw_source = Viddler;\n break;\n\t\t\n\t\tcase dailymotion:\n\t\t$vsw_source = DailyMotion;\n break;\n\t\t\t\t\n\t\t\n\t\tcase revver:\n\t\t$vsw_source = Revver;\n\t\tbreak;\n\t\t\n\t\tcase metacafe:\n\t\t$vsw_source = Metacafe;\n\t\tbreak;\n\t\t\n\t\tcase tudou:\n\t\t$vsw_source = Tudou;\n\t\tbreak;\n\t\t\n\t\tcase youku:\n\t\t$vsw_source = Youku;\n\t\tbreak;\n\t\t\n\t\tcase cn6:\n\t\t$vsw_source = cn6;\n\t\tbreak;\n\t\t\n\t\tcase google:\n\t\t$vsw_source = Google;\n\t\tbreak;\n\t\t\n\t\tcase tangle:\n\t\t$vsw_source = Tangle;\n\t\tbreak; \n\t\t\n\t\t}\n\t\t\n\t\t//string to lowercase\n\t\t$autoplay = strtolower($autoplay);\n\t\t\n\t\t//switch autoplay yes or no to 1 or 0\n\t\tswitch ($autoplay) {\n\t\t\n\t\tcase null:\n\t\t$vsw_autoplay = 0;\n\t\tbreak;\n\t\t\n\t\tcase no:\n\t\t$vsw_autoplay = 0;\n\t\tbreak;\n\t\t\n\t\tcase yes:\n\t\t$vsw_autoplay = 1;\n\t\tbreak;\n\t\t\n\t\t}\n\t\t\t\n\t\n$vsw_code = VSWShowVideo($vsw_source,$vsw_id,$vsw_autoplay,$vsw_width,$vsw_height,'false','true');\n\nreturn $vsw_code;\n\n}",
"public function PlayM3U(){\n\n \n }",
"public static function video( $params )\n\t{\n\t}",
"function urlVideoController($vid)\r\n {\r\n if (file_exists($vid)) {\r\n\r\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\r\n $mime_type = finfo_file($finfo, $vid); \r\n finfo_close($finfo);\r\n if (preg_match('/video\\/*/', $mime_type)) {\r\n\r\n $video_attributes = _get_video_attributes($vid, $this -> ffmpeg_path);\r\n\r\n print_r('Codec: ' . $video_attributes['codec'] . '<br/>');\r\n\r\n print_r('Dimension: ' . $video_attributes['width'] . ' x ' . $video_attributes['height'] . ' <br/>');\r\n\r\n print_r('Duration: ' . $video_attributes['hours'] . ':' . $video_attributes['mins'] . ':'\r\n . $video_attributes['secs'] . '.' . $video_attributes['ms'] . '<br/>');\r\n\r\n print_r('Size: ' . _human_filesize(filesize($vid)));\r\n } else {\r\n return 'Video uzantısıdır.';\r\n }\r\n } else {\r\n return 'Video uzantısı değildir.';\r\n }\r\n }",
"function video(){\n \t//SET LANGUAGE\n\t\t$lang = $_GET['lang'];\n\t\tif ($lang == 'id'){require('lang/id.php');}\n\t\telseif ($lang == 'en'){require('lang/eng.php');}\n\t\telseif ($lang == 'uz'){require('lang/uzbek.php');}\n\t\telse{require('lang/eng.php');}\n\n\t\tsession_start();\n \t$_SESSION['lang'] = $lang;\n \t$this->view->assign('language',$LANG);\n\n\t\t//GET VIDEO\n\t\t$getVideo = $this->contentHelper->getVideo();\n\t\tforeach ($getVideo as $key => $value) {\n\t\t\t$getVideo[$key]['content_en'] = html_entity_decode($value['content_en'],ENT_QUOTES, 'UTF-8');\n\t\t}\n\t\t$this->view->assign('video',$getVideo);\t\n\t\t\n\t\treturn $this->loadView('video');\n }",
"private function __flv() {\n\n $is_video = strpos($this->field('mime_type'), 'video');\n if ($is_video === 0) {\n $file_name = explode('.', $this->field('slug'));\n\n $flv_file = $this->conf['flvDir'] . DS . $file_name[0] . '.flv';\n if (file_exists($flv_file)) {\n $this->setField('flv_path', '/nodeattachment/flv/' . $file_name[0] . '.flv'\n );\n return;\n }\n\n if ($file_name[1] == 'flv') {\n $this->setField('flv_path', $this->field('path')\n );\n }\n }\n }",
"public function fau_videoportal()\n {\n if ($this->options->fau_videoportal->active == true) {\n $this->registerHandler('fau_videoportal');\n }\n }",
"function display() {\r\n\t\tglobal $bp;\r\n\t\t$root_url = get_bloginfo( \"url\" ) . \"/\";\r\n\t\t\r\n\t\t$baseurl=$root_url . \"wp-content/plugins/videowhisper-video-presentation/vp/\";\r\n\t\t$swfurl=$baseurl.\"consultation.swf?room=\".urlencode($bp->groups->current_group->slug);\r\n\t\t?>\r\n\t <div id=\"videowhisper_videopresentation\" style=\"height:650px\" >\r\n\t\t<object width=\"100%\" height=\"100%\">\r\n <param name=\"movie\" value=\"<?=$swfurl?>\" /><param name=\"base\" value=\"<?=$baseurl?>\" /><param name=\"scale\" value=\"noscale\" /><param name=\"salign\" value=\"lt\"></param><param name=\"wmode\" value=\"transparent\" /><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed width=\"100%\" height=\"100%\" scale=\"noscale\" salign=\"lt\" src=\"<?=$swfurl?>\" base=\"<?=$baseurl?>\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed>\r\n </object>\r\n\t\t<noscript>\r\n\t\t<p align=\"center\"><strong>Video Whisper <a href=\"http://www.videowhisper.com/?p=WordPress+Video+Presentation\">Live Web Video presentation Software</a> requires the Adobe Flash Player:\r\n\t\t<a href=\"http://get.adobe.com/flashplayer/\">Get Latest Flash</a></strong>!</p>\r\n\t\t</noscript>\r\n\t\t</div>\r\n\t\t\t<?php\r\n\t}",
"public function getName()\n {\n return 'oo_video';\n }",
"function videoUploadSrc() {\n $per = $this->checkpermission($this->role_id, 'add');\n if ($per) {\n $this->data['welcome'] = $this;\n //$this->data['result'] = $this->videos_model->edit_profile($this->data['id']);\n $tab = $this->uri->segment(3);\n switch ($tab) {\n case \"Upload\":\n //$this->upload();\n $this->data['tab'] = $tab;\n $this->show_view('ads/upload_video', $this->data);\n break;\n case \"Other\":\n //$this->upload_other(); \n $this->data['tab'] = $tab;\n $this->show_view('upload_video', $this->data);\n break;\n case \"Youtube\":\n //$this->upload_other(); \n $this->data['tab'] = $tab;\n $this->show_view('upload_video', $this->data);\n break;\n default:\n $this->data['tab'] = 'Upload';\n $this->show_view('upload_video', $this->data);\n }\n } else {\n $this->session->set_flashdata('message', $this->_errormsg($this->loadPo($this->config->item('error_permission'))));\n redirect(base_url() . 'video');\n }\n }",
"function gfycat_embed( $video ) {\n\n?>\n<div class=\"gfycat\"><iframe src=\"https://gfycat.com/ifr/<?php echo $video; ?>\" frameborder=\"0\" scrolling=\"no\" allowfullscreen></iframe></div>\n<?php\n\n}",
"public function suppvideoAction()\n {\n\n\t\t$sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n\t\t//$this->_helper->layout->disableLayout();\n \t\t$this->_helper->layout()->setLayout('layoutpublic');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n $id = (int) $this->_request->getParam('id');\n if (isset($id) && $id != 0) {\n\n $video = new Application_Model_EuVideo();\n $videoM = new Application_Model_EuVideoMapper();\n $videoM->find($id, $video);\n\t\t\n $videoM->delete($video->video_id);\n\t\t//unlink($video->video_url);\t\n\n }\n\n\t\t$this->_redirect('/administration/listvideo');\n }",
"function youku($atts, $content=null){\r\nextract(shortcode_atts(array(\"width\"=>'500', \"height\"=>'375'),$atts));\r\nreturn'<embed type=\"application/x-shockwave-flash\" src=\"'.$content.'\" id=\"movie_player\" name=\"movie_player\" bgcolor=\"#FFFFFF\" quality=\"high\" allowfullscreen=\"true\" flashvars=\"isShowRelatedVideo=false&showAd=0&show_pre=1&show_next=1&isAutoPlay=true&isDebug=false&UserID=&winType=interior&playMovie=true&MMControl=false&MMout=false&RecordCode=1001,1002,1003,1004,1005,1006,2001,3001,3002,3003,3004,3005,3007,3008,9999\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" width=\"'.$width.'\" height=\"'.$height.'\">';}",
"function video_embed_jwplayer_video_callback($url, $settings) {\n //\n // get media id\n $output = array();\n $media_id = video_embed_jwplayer_get_media_id($url);\n if (!$media_id) {\n // We can't decode the URL - just return the URL as a link.\n $output['#markup'] = l($url, $url);\n return $output;\n }\n\n //\n // add player script in HEAD\n $player_uri = video_embed_jwplayer_get_player_uri($media_id, $settings);\n drupal_add_js($player_uri,\n array('type' => 'external', 'scope' => 'header', 'weight' => 1000)\n );\n //\n // Comscore: add streaming tag plugin for unified digital measurement\n drupal_add_js('https://sb.scorecardresearch.com/c2/plugins/streamingtag_plugin_jwplayer.js', 'external');\n\n //\n // get skin settings and add skn css to HEAD\n $skin_settings = $settings['jwplayer_skinning'];\n $selected_skin = $skin_settings['jwplayer_skin'];\n if (substr($selected_skin, 0, strlen(JWPLAYER_CUSTOM_SKINS_PREFIX)) === JWPLAYER_CUSTOM_SKINS_PREFIX) {\n //\n // add the custom css file to HEAD\n $selected_skin = str_replace(JWPLAYER_CUSTOM_SKINS_PREFIX, '', $selected_skin);\n $skin_file = drupal_get_path('module', 'video_embed_jwplayer') . '/css/' . $selected_skin . '.css';\n drupal_add_css($skin_file, array('type' => 'file', 'scope' => 'header') );\n }\n $active_color = !empty($skin_settings['jwplayer_skin_active_color']) ? ('\", active: \"' . $skin_settings['jwplayer_skin_active_color']) : '';\n $inactive_color = !empty($skin_settings['jwplayer_skin_active_color']) ? ('\", inactive: \"' . $skin_settings['jwplayer_skin_inactive_color']) : '';\n $background_color = !empty($skin_settings['jwplayer_skin_background_color']) ? ('\", background: \"' . $skin_settings['jwplayer_skin_background_color']) : '';\n\n //\n // define video embed\n $do_sign_url = $settings['jwplayer_secure_video_url'];\n $video_conversions = video_embed_jwplayer_get_available_video_conversions($media_id);\n $autoplay = $settings['jwplayer_autostart'] ? 'true' : 'false';\n $mute = $settings['jwplayer_mute'] ? 'true' : 'false';\n $repeat = $settings['jwplayer_repeat'] ? 'true' : 'false';\n $show_controls = $settings['jwplayer_controls'] ? 'true' : 'false';\n $display_title = $settings['jwplayer_displaytitle'] ? 'true' : 'false';\n $display_desc = $settings['jwplayer_displaydescription'] ? 'true' : 'false';\n $playlist = 'playlist: [{' .\n 'image: \"' . video_embed_jwplayer_get_media_url($media_id, 'jpg', $do_sign_url) . '\", ' .\n 'mediaid: \"' . $media_id . '\", ' .\n 'sources: [' .\n //'{file: \"' . video_embed_jwplayer_get_media_url($media_id, 'mpd', $do_sign_url) . '\"}, ' .\n '{file: \"' . video_embed_jwplayer_get_media_url($media_id, 'm3u8', $do_sign_url) . '\"}';\n $first = false;\n foreach ($video_conversions as $key => $conversion) {\n if (!$first) $playlist .= ', ';\n $first = false;\n $playlist .= '{file: \"' . video_embed_jwplayer_get_media_url($media_id, $conversion['format'], $do_sign_url, $key) .\n '\", label: \"' . $conversion['name'] . '\"}';\n }\n $playlist .= ']}],';\n\n $video_embed = '<div id=\"jwplayer-video-embed\"></div><script type=\"text/javaScript\">' .\n 'jwplayer(\"jwplayer-video-embed\").setup({' .\n $playlist .\n 'skin: { ' .\n 'name: \"' . $selected_skin .\n $active_color . $inactive_color . $background_color .\n '\"}, ' .\n 'autostart: ' . $autoplay . ', ' .\n 'mute: ' . $mute . ', ' .\n 'repeat: ' . $repeat . ', ' .\n 'controls: ' . $show_controls . ', ' .\n 'displaytitle: ' . $display_title . ', ' .\n 'displaydescription: ' . $display_desc . ', ' .\n 'stretching: \"' . $settings['jwplayer_stretching'] . '\", ' .\n 'abouttext: \"' . $settings['jwplayer_about_text'] . '\", ' .\n 'aboutlink: \"' . $settings['jwplayer_about_link'] . '\", ' .\n '});' .\n 'jwplayer().on(\"ready\", function () {' .\n ' ns_.StreamingAnalytics.JWPlayer(jwplayer(), {' .\n ' publisherId: \"31749351\",' . // Swiss1 Comscore Publisher ID\n ' labelmapping: \"' . video_embed_jwplayer_comscore_label_mapping($media_id) . '\"' .\n ' }); ' .\n '});' .\n 'jwplayer().on(\"playlistComplete\", function () {' . // reload playlist to re-initialise player\n ' var playlist = jwplayer().getPlaylist();' .\n ' jwplayer().load(playlist);' .\n ' jwplayer().pause();' .\n '});' .\n '</script>';\n\n //\n // return render array\n $output['#markup'] = $video_embed;\n return $output;\n}",
"public function seleccionarVideoconferencia( ) {\n AccesoGui::$guiDispositivos->seleccionarVideoconferencia();\n }",
"function getmembervideo() {\n $user = JFactory::getUser();\n $session = JFactory::getSession();\n $db = $this->getDBO();\n $where = $order = '';\n $search = '';\n $pageno = 1;\n if (JRequest::getVar('deletevideo', '', 'post', 'int')) {\n $id = JRequest::getVar('deletevideo', '', 'post', 'int'); //Getting the video id which is going to be deleted\n // Query for deleting a selected video\n $query = \"UPDATE #__hdflv_upload SET published = -2 WHERE id=$id\";\n $db->setQuery($query);\n $db->query();\n }\n /* Video Delete function Ends here */\n\n // Following code for displaying videos of the particular member when he logged in\n\n if ($user->get('id')) {\n $memberid = $user->get('id'); //Setting the loginid into session\n }\n $hiddensearchbox = $searchtextbox = $hidden_page = '';\n $searchtextbox = JRequest::getVar('searchtxtboxmember', '', 'post', 'string');\n $hiddensearchbox = JRequest::getVar('hidsearchtxtbox', '', 'post', 'string');\n if ($searchtextbox) {\n $search = $searchtextbox;\n } else {\n $search = $hiddensearchbox;\n }\n if (JRequest::getVar('page', '', 'post', 'int')) {\n $pageno = JRequest::getVar('page', '', 'post', 'int');\n }\n\n $search = $this->phpSlashes($search);\n if ($search) {\n $where = \" AND (a.title like '%$search%' OR a.description like '%$search%' OR a.tags like '%$search%' OR b.category like '%$search%')\";\n }\n // Query to get the total videos for user\n $myvideostotal = \"SELECT count(a.id)\n \t\t\t \t FROM #__hdflv_upload a \n LEFT JOIN #__users d on a.memberid=d.id\n \t\t\t LEFT JOIN #__hdflv_category b on b.id=a.playlistid\n \t\t\t\t WHERE a.published=1 AND b.published=1 AND a.memberid=$memberid $where\";\n $db->setQuery($myvideostotal);\n $total = $db->loadResult();\n $limitrow = $this->getmyvideorowcol();\n $thumbview = unserialize($limitrow[0]->thumbview);\n $length = $thumbview['myvideorow'] * $thumbview['myvideocol'];\n //Query is to select the videos of the logged in users\n $myvideorowcolquery = \"SELECT allowupload\n \t\t\t\t\t FROM #__hdflv_user \n \t\t\t\t\t WHERE member_id=\" . $memberid;\n $db = $this->getDBO();\n $db->setQuery($myvideorowcolquery);\n $row = $db->LoadObjectList();\n if (count($row) != 0) {\n $allowupload = $row[0]->allowupload;\n } else {\n $dispenable = unserialize($limitrow[0]->dispenable);\n $allowupload = $dispenable['allowupload'];\n }\n $pages = ceil($total / $length);\n if ($pageno == 1)\n $start = 0;\n else\n $start= ( $pageno - 1) * $length;\n\n if (JRequest::getVar('sorting', '', 'post', 'int')) {\n $session = JFactory::getSession();\n $session->set('sorting', JRequest::getVar('sorting', '', 'post', 'int'));\n }\n /* quries to display myvideos based on sorting */\n if ($session->get('sorting', 'empty') == \"1\") {\n // Query is to display the myvideos results order by title\n $order = \"ORDER BY a.title asc\";\n } else if ($session->get('sorting', 'empty') == \"2\") {\n // Query is to display the myvideos results order by added date\n $order = \"ORDER BY a.addedon desc\";\n } else if ($session->get('sorting', 'empty') == \"3\") {\n // Query is to display the myvideos results order by time of views\n $order = \"ORDER BY a.times_viewed desc\";\n } else if (strlen(JRequest::getVar('searchtxtboxmember', '', 'post', 'string')) > 0) {\n // Query for display the myvideos results based on search value\n $where = \" AND (a.title like '%$search%' OR a.description like '%$search%' OR a.tags like '%$search%' OR b.category like '%$search%')\";\n } else {\n // Query is to display the myvideos results\n $order = \"ORDER BY a.id desc\";\n }\n // Query is to display the myvideos results\n $query = \"SELECT a.*,b.category,b.seo_category,d.username,e.*,count(f.videoid) as total\n\t \t\t FROM #__hdflv_upload a \n\t \t\t LEFT JOIN #__users d on a.memberid=d.id \n\t \t\t LEFT JOIN #__hdflv_video_category e on e.vid=a.id \n\t \t\t LEFT JOIN #__hdflv_category b on e.catid=b.id \n\t \t\t LEFT JOIN #__hdflv_comments f on f.videoid=a.id \n\t \t\t WHERE a.published=1 AND b.published=1 AND a.memberid=$memberid $where\n\t \t\t GROUP BY a.id \n\t \t\t $order \n\t \t\t LIMIT $start,$length\";\n\n $db->setQuery($query);\n $rows = $db->LoadObjectList();\n $row1['allowupload'] = $allowupload;\n if (count($rows) > 0) {\n $rows['pageno'] = $pageno;\n $rows['pages'] = $pages;\n $rows['start'] = $start;\n $rows['length'] = $length;\n }\n return array('rows' => $rows, 'row1' => $row1);\n }",
"public function video() {\n if($this->isLogin() == false) {\n redirect(base_url('admin/login'));\n }\n else {\n $this->load->view('admin/video/list');\n }\n }",
"function hwdsb_vp_the_video() {\n\t$meta = get_post_meta( get_the_ID() );\n\n\tif ( empty( $meta['vp_video_source'] ) ) {\n\t\treturn;\n\t}\n\n\t$source = $meta['vp_video_source'][0];\n\t$content = '';\n\n\tswitch( $source ) {\n\t\tcase 'local' :\n\t\tcase 'vimeo' :\n\t\t\tif ( true === function_exists( 'mexp_vimeo_get_shortcode_tag' ) ) {\n\t\t\t\t$autoplay = ! empty( $_GET['playlist'] ) ? ' autoplay=\"1\"' : '';\n\t\t\t\t$content = '[' . mexp_vimeo_get_shortcode_tag() . ' height=\"360\" id=\"' . $meta['vp_video_id'][0] . '\"' . $autoplay . ']';\n\t\t\t\t$media = do_shortcode( $content );\n\n\t\t\t// Old way.\n\t\t\t} else {\n\t\t\t\t$content = '[video src=\"https://vimeo.com/' . $meta['vp_video_id'][0] . '\"]';\n\n\t\t\t\t$content = apply_filters( 'the_content', $content );\n\t\t\t\t$media = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );\n\t\t\t\tif ( ! empty( $media ) ) {\n\t\t\t\t\t$media = $media[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tif ( ! empty( $media ) ) {\n\t\tprintf( '<div class=\"post-media jetpack-video-wrapper\">%s</div>', $media );\n?>\n\n<script>\n/*! fluidvids.js v2.4.1 | (c) 2014 @toddmotto | License: MIT | https://github.com/toddmotto/fluidvids */\n!function(e,t){\"function\"==typeof define&&define.amd?define(t):\"object\"==typeof exports?module.exports=t:e.fluidvids=t()}(this,function(){\"use strict\";function e(e){return new RegExp(\"^(https?:)?//(?:\"+d.players.join(\"|\")+\").*$\",\"i\").test(e)}function t(e,t){return parseInt(e,10)/parseInt(t,10)*100+\"%\"}function i(i){if((e(i.src)||e(i.data))&&!i.getAttribute(\"data-fluidvids\")){var n=document.createElement(\"div\");i.parentNode.insertBefore(n,i),i.className+=(i.className?\" \":\"\")+\"fluidvids-item\",i.setAttribute(\"data-fluidvids\",\"loaded\"),n.className+=\"fluidvids\",n.style.paddingTop=t(i.height,i.width),n.appendChild(i)}}function n(){var e=document.createElement(\"div\");e.innerHTML=\"<p>x</p><style>\"+o+\"</style>\",r.appendChild(e.childNodes[1])}var d={selector:[\"iframe\",\"object\"],players:[\"www.youtube.com\",\"player.vimeo.com\"]},o=[\".fluidvids {\",\"width: 100%; max-width: 100%; position: relative;\",\"}\",\".fluidvids-item {\",\"position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;\",\"}\"].join(\"\"),r=document.head||document.getElementsByTagName(\"head\")[0];return d.render=function(){for(var e=document.querySelectorAll(d.selector.join()),t=e.length;t--;)i(e[t])},d.init=function(e){for(var t in e)d[t]=e[t];d.render(),n()},d});\n\n// init\nfluidvids.init({\n\tselector: ['iframe'],\n\tplayers: ['.'] // remove default youtube / vimeo restriction.\n});\n</script>\n\n<?php\n\t}\n}",
"public function the_video_player( $args = array() ) {\n\t\t$default = array(\n\t\t\t'url' => '',\n\t\t\t'seek' => '',\n\t\t\t'player' => 'plyr',\n\t\t);\n\t\t$args = $args + $default;\n\t\t$post = $this->post;\n\n\t\tif ( ! is_string( $args['url'] ) || trim( $args['url'] ) === '' ) {\n\t\t\t$output = '';\n\t\t} else {\n\n\t\t\tif ( strpos( $args['url'], 'facebook.' ) !== false ) {\n\t\t\t\twp_enqueue_script( 'wpfc-sm-fb-player' );\n\n\t\t\t\tparse_str( parse_url( $args['url'], PHP_URL_QUERY ), $query );\n\n\t\t\t\t$output = '<div class=\"fb-video\" data-href=\"' . $args['url'] . '\" data-width=\"' . ( isset( $query['width'] ) ? ( is_numeric( $query['width'] ) ? $query['width'] : '600' ) : '600' ) . '\" data-allowfullscreen=\"' . ( isset( $query['fullscreen'] ) ? ( 'yes' === $query['width'] ? 'true' : 'false' ) : 'true' ) . '\"></div>';\n\t\t\t} else {\n\t\t\t\t$player = strtolower( \\SermonManager::getOption( 'player' ) ?: 'plyr' );\n\n\t\t\t\tif ( strtolower( 'WordPress' ) === $player ) {\n\t\t\t\t\t$attr = array(\n\t\t\t\t\t\t'src' => $args['url'],\n\t\t\t\t\t\t'preload' => 'none',\n\t\t\t\t\t);\n\n\t\t\t\t\t$output = wp_video_shortcode( $attr );\n\t\t\t\t} else {\n\t\t\t\t\t$is_youtube_long = strpos( strtolower( $args['url'] ), 'youtube.com' );\n\t\t\t\t\t$is_youtube_short = strpos( strtolower( $args['url'] ), 'youtu.be' );\n\t\t\t\t\t$is_youtube = $is_youtube_long || $is_youtube_short;\n\t\t\t\t\t$is_vimeo = strpos( strtolower( $args['url'] ), 'vimeo.com' );\n\t\t\t\t\t$extra_settings = '';\n\t\t\t\t\t$output = '';\n\n\t\t\t\t\tif ( is_numeric( $args['seek'] ) ) {\n\t\t\t\t\t\t// Sanitation just in case.\n\t\t\t\t\t\t$extra_settings = 'data-plyr_seek=\\'' . intval( $args['seek'] ) . '\\'';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( 'plyr' === $player && ( $is_youtube || $is_vimeo ) ) {\n\t\t\t\t\t\t$output .= '<div data-type=\"' . ( $is_youtube ? 'youtube' : 'vimeo' ) . '\" data-video-id=\"' . $args['url'] . '\" class=\"wpfc-sermon-video-player video-' . ( $is_youtube ? 'youtube' : 'vimeo' ) . ( 'mediaelement' === $player ? 'mejs__player' : '' ) . '\" ' . $extra_settings . '></div>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= '<video controls preload=\"metadata\" class=\"wpfc-sermon-video-player ' . ( 'mediaelement' === $player ? 'mejs__player' : '' ) . '\" ' . $extra_settings . '>';\n\t\t\t\t\t\t$output .= '<source src=\"' . $args['url'] . '\">';\n\t\t\t\t\t\t$output .= '</video>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Allows to filter the player HTML.\n\t\t *\n\t\t * @since 1.0.0-beta.1\n\t\t *\n\t\t * @param string $output The HTML.\n\t\t * @param \\WP_Post $post The sermon.\n\t\t * @param array $args The settings.\n\t\t */\n\t\techo apply_filters( 'smp/shortcodes/the_video_player', $output, $post, $args );\n\t}",
"function _HCM_flash($cesta=\"\", $sirka=null, $vyska=null){\n \n //prednastavene rozmery\n $defwidth=\"320\"; $defheight=\"240\";\n \n //nacteni parametru\n $cesta=_htmlStr($cesta);\n if(!_isAbsolutePath($cesta)){$cesta=_url.\"/\".$cesta;}\n if(!isset($sirka)){$sirka=$defwidth; $sirka_def=true;}else{$sirka=intval($sirka); $sirka_def=false;}\n if(!isset($vyska)){\n if(!$sirka_def){$vyska=round(0.75*$sirka);}\n else{$vyska=$defheight;}\n } else{$vyska=intval($vyska);}\n \n //sestaveni kodu\n return \"\n<!--[if !IE]> -->\n<object type='application/x-shockwave-flash' data='\".$cesta.\"' width='\".$sirka.\"' height='\".$vyska.\"'>\n<!-- <![endif]-->\n\n<!--[if IE]>\n<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='$sirka' height='$vyska'>\n<param name='movie' value='\".$cesta.\"' />\n<!--><!---->\n<param name='loop' value='true' />\n<param name='menu' value='false' />\n\n\".$GLOBALS['_lang']['hcm.player.alt'].\"\n</object>\n<!-- <![endif]-->\n\";\n \n}",
"function viewVideo(){\n \t//SET LANGUAGE\n\t\t$lang = $_GET['lang'];\n\t\tif ($lang == 'id'){require('lang/id.php');}\n\t\telseif ($lang == 'en'){require('lang/eng.php');}\n\t\telseif ($lang == 'uz'){require('lang/uzbek.php');}\n\t\telse{require('lang/eng.php');}\n\n\t\tsession_start();\n \t$_SESSION['lang'] = $lang;\n \t$this->view->assign('language',$LANG);\n\n\t\t$id = $_GET['id'];\n\t\t\n\t\t//VIEW VIDEO\n\t\t$viewVideo = $this->contentHelper->viewVideo($id);\n\t\tforeach ($viewVideo as $key => $value) {\n\t\t\t$viewVideo[$key]['content_en'] = html_entity_decode($value['content_en'],ENT_QUOTES, 'UTF-8');\n\t\t}\n\t\t$this->view->assign('viewVideo',$viewVideo);\t\n\t\t\n\t\treturn $this->loadView('viewVideo');\n }",
"function theme_gs_helper_field_video($vars) {\n $output = '';\n\n if (!empty($vars['image_file'])) {\n $items['movie'] = (array) $vars['video_file'];\n \n $items['poster'] = (array) $vars['image_file'];\n \n $video_vars = array(\n 'items' => $items,\n 'attributes' => array(\n 'width' => 600,\n // 'height' => 300,\n ),\n 'player_id' => 'file-' . $vars['video_file']['fid'],\n );\n \n $output = '<div class=\"video-content\">' . theme('videojs', $video_vars) . '</div>';\n }\n \n return $output;\n}",
"public function watchVideo() {\n\n\t\t\t$detect = new MobileDetect();\n\n\t\t\tif ($detect->isMobile()) {\n\t\t\t\t$height = 'style=\"height:70%; width:70% \"';\n\t\t\t} else {\n\t\t\t\t$height = 'height=\"360\" width=\"640\" ';\n\t\t\t}\n\t\t\t$this->content =\n\t\t\t\t\t'<video id=\"video\" '.$height.' preload=\"none\" >\n\t\t\t\t\t\t<!-- Pseudo HTML5 -->\n \t\t\t\t\t\t<source src=\"'.$this->download.'\" />\n\t\t\t\t\t</video>';\n\n\n\t\t}",
"function clippy($text='copy-me', $dir = 'lib/') { ?>\n <object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"\n width=\"110\"\n height=\"14\"\n id=\"clippy\" >\n <param name=\"movie\" value=\"<?php echo $dir; ?>clippy.swf\"/>\n <param name=\"allowScriptAccess\" value=\"always\" />\n <param name=\"quality\" value=\"high\" />\n <param name=\"scale\" value=\"noscale\" />\n <param NAME=\"FlashVars\" value=\"text=<?php echo urlencode($text); ?>\">\n <param name=\"bgcolor\" value=\"#FFFFFF\">\n <embed src=\"<?php echo $dir; ?>clippy.swf\"\n width=\"110\"\n height=\"14\"\n name=\"clippy\"\n quality=\"high\"\n allowScriptAccess=\"always\"\n type=\"application/x-shockwave-flash\"\n pluginspage=\"http://www.macromedia.com/go/getflashplayer\"\n FlashVars=\"text=<?php echo urlencode($text); ?>\"\n bgcolor=\"#FFFFFF\"\n />\n </object>\n<?php }",
"public function handleStreamingVideos()\n {\n if (preg_match(\"#(?<=v=|v\\/|vi=|vi\\/|youtu.be\\/)[a-zA-Z0-9_-]{11}#\", $this->url, $matches)) {\n $this->content = '<iframe width=\"560\" height=\"315\" src=\"//www.youtube.com/embed/'.$matches[0].'\" frameborder=\"0\"></iframe>';\n $this->skip_processing = true;\n }\n }"
] | [
"0.72170675",
"0.62526023",
"0.61286926",
"0.61068726",
"0.6082697",
"0.602322",
"0.6017994",
"0.5941197",
"0.59113896",
"0.5817579",
"0.5795606",
"0.5781055",
"0.57523084",
"0.5736195",
"0.56970286",
"0.5694417",
"0.56943494",
"0.5683555",
"0.565829",
"0.55899733",
"0.5585826",
"0.5570313",
"0.55694604",
"0.55689955",
"0.5566722",
"0.55472577",
"0.549901",
"0.54676104",
"0.54661167",
"0.5460996"
] | 0.74959296 | 0 |
Binds JS handlers to make Theme Customizer preview reload changes asynchronously with customizer.js Also localize the customizer options so they can be added dynamically in customizer.js | function localize_customizer() {
//deregister twentytwelves theme customizer js. Need a more unviersal way to do this.
//wp_deregister_script('twentytwelve-customizer');
$handle = 'customizer-preview';
$src = SCF_PATH.'/js/customizer.js';
//$src = get_template_directory_uri().'/options/js/customizer.js';
$deps = array( 'jquery' );
$ver = 1;
$in_footer = true;
wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
//localize script with the css bits we need
wp_localize_script( $handle, 'custStyle', $this->customizerData);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function twentytwenty_customize_preview_init() {\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\n\twp_enqueue_script( 'twentytwenty-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $theme_version, true );\n\twp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );\n\twp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyPreviewEls', twentytwenty_get_elements_array() );\n\n\twp_add_inline_script(\n\t\t'twentytwenty-customize-preview',\n\t\tsprintf(\n\t\t\t'wp.customize.selectiveRefresh.partialConstructor[ %1$s ].prototype.attrs = %2$s;',\n\t\t\twp_json_encode( 'cover_opacity' ),\n\t\t\twp_json_encode( twentytwenty_customize_opacity_range() )\n\t\t)\n\t);\n}",
"function s42_customizer_js() {\n wp_enqueue_script(\n 's42_theme_customizer',\n get_template_directory_uri() . '/js/theme-customizer.js',\n array( 'jquery', 'customize-preview' ),\n '',\n true\n);\n}",
"function robotTheme_load_customizer_script() {\n wp_enqueue_script( 'robotTheme-customizer-custom-js', get_template_directory_uri() . '/customizer/customizer-library/js/customizer-custom.js', array('jquery'), robotTheme_THEME_VERSION, true );\n\n $upgrade_button = array(\n \t'link' => admin_url( 'themes.php?page=premium_upgrade' ),\n \t'text' => __( 'Upgrade To Premium »', 'robotTheme' )\n );\n \n wp_localize_script( 'robotTheme-customizer-custom-js', 'upgrade_button', $upgrade_button );\n \n wp_enqueue_style( 'robotTheme-customizer', get_template_directory_uri() . '/customizer/customizer-library/css/customizer.css' );\n}",
"function twentytwentyone_customize_preview_init() {\n\twp_enqueue_script(\n\t\t'twentytwentyone-customize-helpers',\n\t\tget_theme_file_uri( '/assets/js/customize-helpers.js' ),\n\t\tarray(),\n\t\twp_get_theme()->get( 'Version' ),\n\t\ttrue\n\t);\n\n\twp_enqueue_script(\n\t\t'twentytwentyone-customize-preview',\n\t\tget_theme_file_uri( '/assets/js/customize-preview.js' ),\n\t\tarray( 'customize-preview', 'customize-selective-refresh', 'jquery', 'twentytwentyone-customize-helpers' ),\n\t\twp_get_theme()->get( 'Version' ),\n\t\ttrue\n\t);\n}",
"public function init() {\n\t\tparent::init();\n\t\tadd_action( 'customize_preview_init', array( $this, 'enqueue_customizer_script' ) );\n\t}",
"function customtheme_customizer_live_preview(){\r\n wp_enqueue_script( 'customtheme-themecustomizer', get_template_directory_uri().'/js/customizer.js', array( 'jquery','customize-preview' ), '', true);\r\n}",
"public function on_theme_customizer_load(){\n\t\t$_GET['noheader'] = true;\n\t\tif( !defined( 'IFRAME_REQUEST' ) ){\n\t\t\tdefine( 'IFRAME_REQUEST', true );\n\t\t}\n\t\t\n\t\t// Add the action to the footer to output the modal window.\n add_action( 'admin_footer', array( $this, 'tax_selection_modal' ) );\n\t\t\n\t\t// if saving action wasn't triggered, stop\n\t\tif( !isset( $_POST['fa_nonce'] ) ){\n\t\t\treturn;\n\t\t}\n\t\t// check referer\n\t\tif( !check_admin_referer('fa-save-color-scheme', 'fa_nonce') ){\n\t\t\twp_die( __( 'Nonce error, please try again.', 'fapro') );\n\t\t}\n\t\t\n\t\trequire_once fa_get_path('includes/admin/libs/class-fa-theme-editor.php');\n\t\t$editor = new FA_Theme_Editor( $_POST['theme'] );\n\t\tif( !isset( $_GET['color'] ) || empty( $_GET['color'] ) ){\n\t\t\t$edit = false;\t\t\t\n\t\t}else{\n\t\t\t$edit = $_GET['color'];\n\t\t}\n\t\t\n\t\t$result = $editor->save_color_scheme( $_POST['color_name'] , $edit, $_POST );\n\t\t\n\t\tif( is_wp_error( $result ) ){\n\t\t\t$message = $result->get_error_message();\n\t\t\twp_die( $message );\t\t\t\t\n\t\t}else{\n\t\t\t$redirect = add_query_arg( array(\n\t\t\t\t'theme' => $_POST['theme'],\n\t\t\t\t'color' => $result\n\t\t\t), menu_page_url('fa-theme-customizer', false));\n\t\t\twp_redirect( $redirect );\n\t\t\tdie();\n\t\t}\t\t\t\t\n\t}",
"function me_rb4_customize_preview_js() {\n\twp_enqueue_script( 'me_rb4_customizer', get_template_directory_uri() . '/assets/scripts/customizer.js', array( 'customize-preview' ), '20151215', true );\n}",
"function mdlwp_customize_preview_js() {\n\twp_enqueue_script( 'mdlwp_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function futures_customize_preview_js()\n\t{\n\twp_enqueue_script('futures_customizer', get_template_directory_uri() . '/js/customizer.js', array(\n\t\t'customize-preview'\n\t) , '20130508', true);\n\t}",
"function oleville_customize_preview_js() {\n\twp_enqueue_script( 'oleville_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"public function import_customizer_script() {\n\t\t?>\n\t\t<script>\n\t\t\tjQuery(function ($) {\n\t\t\t\t$('body').on('click', '.csco-demo-import', function (event) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\twp_customize: 'on',\n\t\t\t\t\t\taction: 'customizer_import',\n\t\t\t\t\t\tdemo: $(this).closest('.csco-theme-demo').attr('data-demo'),\n\t\t\t\t\t\tnonce: '<?php echo esc_attr( wp_create_nonce( 'customizer-import' ) ); ?>'\n\t\t\t\t\t};\n\n\t\t\t\t\tvar r = confirm( \"<?php esc_html_e( 'Warning: Activating a demo will reset all current customizations.', 'authentic' ); ?>\" );\n\n\t\t\t\t\tif (!r) return;\n\n\t\t\t\t\t$(this).attr('disabled', 'disabled');\n\n\t\t\t\t\t$(this).siblings('.spinner').addClass('is-active');\n\n\t\t\t\t\t$('#customize-preview').css( 'opacity', ' 0.6' );\n\n\t\t\t\t\t$.post(ajaxurl, data, function ( response ) {\n\t\t\t\t\t\twp.customize.state('saved').set(true);\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar info = $.parseJSON( JSON.stringify(response) );\n\n\t\t\t\t\t\t\tif( typeof info.success != 'undefined' && info.success == true ){\n\t\t\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif( typeof info.data != 'undefined' ){\n\t\t\t\t\t\t\t\t\talert( info.data );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\talert( '<?php esc_html_e( 'Server error!', 'authentic' ); ?>' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\talert( response );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}",
"function register_preview_scripts() {\n wp_enqueue_script( 'codeless_google_fonts', 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js', array(\n 'customize-preview',\n 'jquery' \n ) );\n \n // Live Edit Options JS Functions\n wp_enqueue_script( 'codeless_css_preview', get_template_directory_uri() . '/includes/codeless_customizer/js/codeless_postMessages.js', array(\n 'customize-preview',\n 'jquery',\n 'codeless_google_fonts' \n ) );\n \n \n wp_localize_script( 'codeless_css_preview', 'cl_options', codeless_dynamic_css_register_tags() );\n }",
"function _cp_enqueue_customizer_color_previewer() {\n\tglobal $cp_options;\n\n\t$suffix_js = cp_get_enqueue_suffix();\n\n\twp_enqueue_script( 'cp_themecustomizer', get_template_directory_uri().\"/includes/js/theme-customizer{$suffix_js}.js\", array( 'customize-controls' ), CP_VERSION, true );\n\n\t$params = array(\n\t\t'color_scheme' => $cp_options->stylesheet,\n\t\t'colors' => cp_get_customizer_color_defaults('all'),\n\t);\n\n\twp_localize_script( 'cp_themecustomizer', 'customizer_params', $params );\n}",
"function mptheme_customizer_live_preview(){\n\twp_enqueue_script( \n\t\t 'mptheme-customizer',//Give the script an ID\n\t\t get_template_directory_uri() . '/assets/js/customizer.mptheme.js',//Point to file\n\t\t array( 'jquery','customize-preview' ),\t//Define dependencies\n\t\t '',\t\t\t\t\t\t//Define a version (optional) \n\t\t true\t\t\t\t\t\t//Put script in footer?\n\t);\n}",
"function underskeleton_customize_preview_js() {\n wp_enqueue_script( 'underskeleton_customizer', get_template_directory_uri() . '/js/customizer.min.js', array( 'customize-preview' ), '20151215', true );\n}",
"public function seb_customize_preview_js() {\n\t\twp_enqueue_script( 'seb-customizer', plugins_url( '/assets/js/customizer.min.js', __FILE__ ), array( 'customize-preview' ), '1.1', true );\n\t}",
"function kultalusikka_customize_preview_js() {\n\n\twp_enqueue_script( 'kultalusikka-customizer', trailingslashit( get_template_directory_uri() ) . 'js/customize/kultalusikka-customizer.js', array( 'customize-preview' ), '20121019', true );\n\t\n}",
"function visual_customize_preview_js() {\n wp_enqueue_script( 'visual_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20120827', true );\n}",
"function holyarchers_customize_preview_js() {\n\twp_enqueue_script( 'holyarchers_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function jacobarriola_customize_preview_js() {\n\twp_enqueue_script( 'jacobarriola_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function nisarg_customize_preview_js() {\n\twp_enqueue_script( 'nisarg_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function themeideas_customize_preview_js() {\n\twp_enqueue_script( 'themeideas_customizer', get_template_directory_uri() . '/assets/js/customizer.min.js', array( 'customize-preview' ), '20130304', true );\n}",
"public static function customize_preview_init() {\n\t\t\twp_enqueue_script( 'wprt-typography-customize-preview',\n\t\t\t\tget_template_directory_uri() .'/framework/customizer/typography-customize.js',\n\t\t\t\tarray( 'customize-preview' ),\n\t\t\t\t'1.0.0',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\twp_localize_script( 'wprt-typography-customize-preview', 'wprt', array(\n\t\t\t\t'googleFontsUrl' => wprt_get_google_fonts_url()\n\t\t\t) );\n\t\t}",
"function konmi_customize_preview_js() {\n\twp_enqueue_script( 'konmi_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function expire_customizer_live_preview() {\n\twp_enqueue_script( 'expire-themecustomizer', EXPIRE_TEMPPATH . '/inc/customizer/js/customizer.js', array( 'jquery', 'customize-preview' ), expire_theme_version() );\n}",
"function customizer_scripts() {\n\twp_enqueue_script(\n\t\t'jw_login_page_preview',\n\t\tJW_LOGIN_PAGE_CUSTOMIZER_URL . \"dist/js/customizer.min.js\",\n\t\t['customize-preview', 'jquery'],\n\t\tJW_LOGIN_PAGE_CUSTOMIZER_VERSION,\n\t\ttrue\n\t);\n}",
"function parkview_customize_preview_js() {\n\twp_enqueue_script( 'parkview_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function wpexpert_customize_preview_js() {\n\twp_enqueue_script( 'wpexpert-customizer', get_template_directory_uri() . '/asset/js/customizer.js', array( 'customize-preview' ), '20151215', true );\n}",
"function wpg_custom_customize_enqueue() {\n\n\twp_enqueue_script( 'jquery');\n\t// Register the script\n\twp_enqueue_script( 'wpg_customizer_js', get_template_directory_uri() . '/inc/customizer/assets/js/theme-customize.js', '','', true);\n\t// Set variables for script\n\twp_localize_script( 'wpg_customizer_js', 'wpgCustomizerFontsL10n', set_font_list(false, true));\n\t// Register the css style\n\twp_enqueue_style( 'wpg_css_control', get_template_directory_uri() . '/inc//customizer/assets/css/customizer.css');\n\n}"
] | [
"0.7507354",
"0.70821613",
"0.70581144",
"0.7057025",
"0.700536",
"0.699542",
"0.6965032",
"0.6956769",
"0.6948525",
"0.69482005",
"0.6907188",
"0.68861204",
"0.6877416",
"0.68685323",
"0.685439",
"0.6846663",
"0.68366164",
"0.68176806",
"0.6815779",
"0.6800079",
"0.6790208",
"0.6776221",
"0.67714244",
"0.6738354",
"0.67376095",
"0.6730956",
"0.67259526",
"0.67214817",
"0.6714584",
"0.6701205"
] | 0.7546811 | 0 |
Customizer Color Control Loop | public function customzier_color_loop() {
//Not sure why I have to do this first thing
global $wp_customize;
//CREATE SECTIONS
//include sections
include(SCF_PATH.'/scf-sections.php');
//set counter for priorities at 100
$count = 100;
//make the sections happen
foreach ($sections as $section) {
//If current item has a priority set, use it, if not use the counter.
if (! isset($section['priority']) ) {
$priority = $count;
}
else {
$priority = $section['priority'];
}
//make the sections id from theme slug and setting slug and put it in $id
$id = 'scf_'.$section['slug'];
//create the section
$wp_customize->add_section($id, array(
'title' => __($section['label'], 'scf'),
'priority' => $priority,
));
//increase the counter
$count++;
}
//CREATE CONTROLS AND SETTINGS
foreach ($this->customizerData as $things) {
$wp_customize->add_setting( $things['id'], array(
'type' => 'option',
'transport' => 'postMessage',
'capability' => 'edit_theme_options',
'default' => $things['default'],
) );
$control =
new WP_Customize_Color_Control(
$wp_customize, $slug,
array(
'label' => $things['label'],
'section' => $things['section'],
'priority' => $things['priority'],
'settings' => $things['id'],
)
);
$wp_customize->add_control($control);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nisarg_customize_control_js() {\n\twp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20141216', true );\n\twp_localize_script( 'color-scheme-control', 'colorScheme', nisarg_get_color_schemes() );\n}",
"function wd_acf_color_palette() { ?>\n <script type=\"text/javascript\">\n (function($) {\n acf.add_filter('color_picker_args', function( args, $field ){\n args.palettes = ['#E40A19', '#413E6B', '#1A1A1A', '#6A6A6A', '#BEBEBE', '#E3E3E3', '#EBAF88', '#CBE19C', '#F8C0C9', '#92C6ED', '#F1E2C3', '#FFF']\n return args;\n });\n })(jQuery);\n </script>\n <?php }",
"function ndotone_customize_control_js()\n{\n\twp_enqueue_script('color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array('customize-controls', 'iris', 'underscore', 'wp-util'), '20150926', true);\n\twp_localize_script('color-scheme-control', 'colorScheme', ndotone_get_color_schemes());\n}",
"function start_theme_customizer( $wp_customize ){\r\n $wp_customize->add_setting(\r\n 'primary_color',\r\n array(\r\n 'default' => '#ff5c36'\r\n )\r\n );\r\n $wp_customize->add_control(\r\n new WP_Customize_Color_Control(\r\n $wp_customize,\r\n 'primary_color',\r\n array(\r\n 'label' => __('Primary color', 'start'),\r\n 'section' => 'colors',\r\n 'priority' => 9\r\n )\r\n )\r\n );\r\n $wp_customize->add_setting(\r\n 'header_bg_color',\r\n array(\r\n 'default' => '#f5f5f5'\r\n )\r\n );\r\n $wp_customize->add_control(\r\n new WP_Customize_Color_Control(\r\n $wp_customize,\r\n 'header_bg_color',\r\n array(\r\n 'label' => __('Header background color', 'start'),\r\n 'section' => 'background_image',\r\n 'priority' => 9\r\n )\r\n )\r\n );\r\n}",
"function _cp_enqueue_customizer_color_previewer() {\n\tglobal $cp_options;\n\n\t$suffix_js = cp_get_enqueue_suffix();\n\n\twp_enqueue_script( 'cp_themecustomizer', get_template_directory_uri().\"/includes/js/theme-customizer{$suffix_js}.js\", array( 'customize-controls' ), CP_VERSION, true );\n\n\t$params = array(\n\t\t'color_scheme' => $cp_options->stylesheet,\n\t\t'colors' => cp_get_customizer_color_defaults('all'),\n\t);\n\n\twp_localize_script( 'cp_themecustomizer', 'customizer_params', $params );\n}",
"public function getColorQuantum() { }",
"public function __construct()\r\n {\r\n $this->foreground_colors['green'] = '0;32';\r\n $this->foreground_colors['light_green'] = '1;32';\r\n $this->foreground_colors['red'] = '0;31';\r\n $this->foreground_colors['light_red'] = '1;31';\r\n }",
"function section_colors_customizations($wp_customize) {\n require_once( dirname( __FILE__ ) . '/alpha-color-picker/alpha-color-picker.php' );\n \n $panel = 'section_panel';\n \n $wp_customize->add_panel( $panel, array(\n 'priority' => 1,\n 'title' => 'Section Colors/Backgrounds',\n 'description' => 'Set general section styles.',\n ));\n\n // Section Contact >>>-------**|>\n \n $section = 'section_contact';\n $wp_customize->add_section($section, array(\n 'title' => 'Section Contact Form',\n 'panel' => $panel,\n 'priority' => 10\n ));\n\n /* ---------------------------- */\n\n $setting = $section.'_form_color_1_background';\n $wp_customize->add_setting($setting, array(\n 'default' => '#fefefe'\n ));\n\n\t$wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, $setting.'_control', array(\n 'label' => 'Form -COLOR 1- Background',\n 'description' => 'Both colors are part of gradient.',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 30,\n 'show_opacity' => true,\n 'palette'\t=> array(\n '#fe2600', \n '#333333',\n '#111111',\n '#ffffff',\n '#ff6600',\n '#33DAFF',\n '#00D62A',\n '#FFFC1E',\n '#1E8BFF',\n '#AD1EFF',\n '#FF1E66'\n )\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_form_color_2_background';\n $wp_customize->add_setting($setting, array(\n 'default' => '#f5f5f5'\n ));\n\n $wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, $setting.'_control', array(\n 'label' => 'Form -COLOR 2- Background',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 40,\n 'show_opacity' => true,\n 'palette'\t=> array(\n '#fe2600', \n '#333333',\n '#111111',\n '#ffffff',\n '#ff6600',\n '#33DAFF',\n '#00D62A',\n '#FFFC1E',\n '#1E8BFF',\n '#AD1EFF',\n '#FF1E66'\n )\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_form_image_background';\n $wp_customize->add_setting($setting);\n\n $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Form -IMAGE- Background',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 50,\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_info_color_1_background';\n $wp_customize->add_setting($setting, array(\n 'default' => '#fefefe'\n ));\n\n\t$wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, $setting.'_control', array(\n 'label' => 'Info -COLOR 1- Background',\n 'description' => 'Both colors are part of gradient.',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 60,\n 'show_opacity' => true,\n 'palette'\t=> array(\n '#fe2600', \n '#333333',\n '#111111',\n '#ffffff',\n '#ff6600',\n '#33DAFF',\n '#00D62A',\n '#FFFC1E',\n '#1E8BFF',\n '#AD1EFF',\n '#FF1E66'\n )\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_info_color_2_background';\n $wp_customize->add_setting($setting, array(\n 'default' => '#f5f5f5'\n ));\n\n $wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, $setting.'_control', array(\n 'label' => 'Info -COLOR 2- Background',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 70,\n 'show_opacity' => true,\n 'palette'\t=> array(\n '#fe2600', \n '#333333',\n '#111111',\n '#ffffff',\n '#ff6600',\n '#33DAFF',\n '#00D62A',\n '#FFFC1E',\n '#1E8BFF',\n '#AD1EFF',\n '#FF1E66'\n )\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_info_image_background';\n $wp_customize->add_setting($setting);\n\n $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Info -IMAGE- Background',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 80,\n )));\n\n /* ---------------------------- */\n \n $setting = $section.'_info_text_color';\n $wp_customize->add_setting($setting, array(\n 'default' => '#fefefe'\n ));\n\n\t$wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, $setting.'_control', array(\n 'label' => 'Info Text Color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 90,\n 'show_opacity' => true,\n 'palette'\t=> array(\n '#fe2600', \n '#333333',\n '#111111',\n '#ffffff',\n '#ff6600',\n '#33DAFF',\n '#00D62A',\n '#FFFC1E',\n '#1E8BFF',\n '#AD1EFF',\n '#FF1E66'\n )\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_form_text_color';\n $wp_customize->add_setting($setting, array(\n 'default' => '#fefefe'\n ));\n\n $wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, $setting.'_control', array(\n 'label' => 'Form Text Color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 100,\n 'show_opacity' => true,\n 'palette'\t=> array(\n '#fe2600', \n '#333333',\n '#111111',\n '#ffffff',\n '#ff6600',\n '#33DAFF',\n '#00D62A',\n '#FFFC1E',\n '#1E8BFF',\n '#AD1EFF',\n '#FF1E66'\n )\n )));\n\n // Section Featured Services >>>-------**|>\n\n $section = 'section_feat_serv';\n $wp_customize->add_section($section, array(\n 'title' => 'Section Featured Services',\n 'panel' => $panel,\n 'priority' => 30\n ));\n\n // Settings for Featured Services >>>-------**|>\n\n $setting = $section.'_background';\n $wp_customize->add_setting($setting, array(\n 'default' => '#000'\n ));\n \n $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Background Color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 10,\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_text';\n $wp_customize->add_setting($setting, array(\n 'default' => '#fff'\n ));\n \n $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Text Color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 20,\n )));\n\n\n // Section Fifty Fifty >>>-------**|>\n\n $section = 'section_fifty';\n $wp_customize->add_section($section, array(\n 'title' => 'Section Fifty Fifty',\n 'panel' => $panel,\n 'priority' => 40\n ));\n\n // Settings for Fifty Fifty >>>-------**|>\n \n $setting = $section.'_overlay_color';\n $wp_customize->add_setting($setting, array(\n 'default' => '#000'\n ));\n \n $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Overlay Color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 10,\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_tooltip_color';\n $wp_customize->add_setting($setting, array(\n 'default' => '#000'\n ));\n \n $wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, $setting.'_control', array(\n 'label' => 'Tooltip Color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 20,\n 'show_opacity' => true,\n 'palette'\t=> array(\n '#fe2600', \n '#333333',\n '#111111',\n '#ffffff',\n '#ff6600',\n '#33DAFF',\n '#00D62A',\n '#FFFC1E',\n '#1E8BFF',\n '#AD1EFF',\n '#FF1E66'\n )\n )));\n\n /* ---------------------------- */\n\n $setting = $section.'_tooltip_text_color';\n $wp_customize->add_setting($setting, array(\n 'default' => '#000'\n ));\n \n $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Tooltip Text Color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 30,\n )));\n\n\n // Header behavior\n $section = 'header';\n $wp_customize->add_section($section, array(\n 'title' => 'Navigation',\n 'priority' => 100,\n 'panel' => $panel\n ));\n\n $setting = $section.'_scroll_behavior';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Header scroll behavior',\n 'section' => $section,\n 'settings' => $setting,\n 'description' => 'Scroll: Header will be transparent until page is scrolled. Solid Color: Header will load Solid and not change on scroll.',\n 'priority' => 10,\n 'type' => 'select',\n 'choices' => array(\n 'default' => 'Default',\n 'scroll' => 'Change On Scroll',\n 'no_scroll' => 'Solid Color'\n )\n )));\n\n $setting = $section.'_nav_color';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Header nav color',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 20\n )));\n\n $setting = $section.'_nav_color_hover';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Header nav color on hover',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 30\n )));\n\n\n\n // Map Settings\n $section = 'geomap';\n $wp_customize->add_section($section, array(\n 'title' => 'Map Settings',\n 'priority' => 110,\n 'panel' => $panel\n ));\n\n $setting = $section.'_marker';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Marker icon',\n 'description' => 'Use square PNG for best results.',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 10\n )));\n\n $setting = $section.'_center';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Map center coordinates',\n 'description' => 'The center point of map. ( Example: 51.5, -0.09 ), Latitude and Longitude, separate by single comma. Visit geojson.io to get exact coordinates. If map does not work, try reversing the values.',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 20\n )));\n\n $setting = $section.'_marker_center';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Main marker coordinates',\n 'description' => 'Main marker center coordinates. Use same value as map center to place marker at center of map.',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 30\n )));\n\n $setting = $section.'_marker_size';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Main map marker size (px)',\n 'description' => 'Use square PNG for best results.',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 40,\n 'type' => 'select',\n 'choices' => array(\n 'default' => 'Default',\n '40,40' => '2x Small (40x40 pixels)',\n '60,60' => '1x Small (60x60 pixels)',\n '70,70' => 'Small (70x70 pixels)',\n '80,80' => 'Medium (80x80 pixels)',\n '90,90' => 'Large (90x90 pixels)',\n '100,100' => '1X Large (100x100 pixels)',\n '110,110' => '2X Large (110x110 pixels)',\n '120,120' => '3X Large (120x120 pixels)',\n '130,130' => '4X Large (130x130 pixels)',\n '140,140' => '5X Large (140x140 pixels)',\n '150,150' => '6X Large (150x150 pixels)',\n '160,160' => '7X Large (160x160 pixels)',\n '170,170' => '8X Large (170x170 pixels)',\n '180,180' => '9X Large (180x180 pixels)',\n )\n )));\n\n $setting = $section.'_marker_tooltip';\n $wp_customize->add_setting($setting, array(\n 'default' => 'Popup text Here'\n ));\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Main marker popup text',\n 'description' => 'Appears on marker mouseover, basic info text',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 45,\n 'type' => 'textarea'\n )));\n\n $setting = $section.'_zoom';\n $wp_customize->add_setting($setting, array(\n 'default' => '10'\n ));\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Map zoom Level',\n 'description' => '4 -> 18 (maximum zoom)',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 50,\n 'type' => 'select',\n 'choices' => array(\n '4' => 'Level 4',\n '5' => 'Level 5',\n '6' => 'Level 6',\n '7' => 'Level 7',\n '8' => 'Level 8',\n '9' => 'Level 9',\n '10' => 'Level 10 (Recommended)',\n '11' => 'Level 11',\n '12' => 'Level 12',\n '13' => 'Level 13',\n '14' => 'Level 14',\n '15' => 'Level 15',\n '16' => 'Level 16',\n '17' => 'Level 17',\n '18' => 'Level 18',\n )\n )));\n\n $setting = $section.'_additional_markers';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Additional map markers',\n 'description' => 'Coordinate sets separated by :: ( double colon), every set of coordinates will produce a marker on the map. Example: 51.5,-0.09::50.5,-0.09::71.75,-56.24',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 60,\n 'type' => 'textarea'\n )));\n\n $setting = $section.'_additional_markers_tooltips';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Popups for additional map markers',\n 'description' => 'First popup text gets matched to first addidional marker set, second to second, etc. Separate by :: (double colon).',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 64,\n 'type' => 'textarea'\n )));\n\n $setting = $section.'_alt_marker_size';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Additional markers size (px)',\n 'description' => 'Distinguish these secondary markers by making them a different size. All sizes are meant for square PNG',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 65,\n 'type' => 'select',\n 'choices' => array(\n 'default' => 'Default',\n '40,40' => '2x Small (40x40 pixels)',\n '60,60' => '1x Small (60x60 pixels)',\n '70,70' => 'Small (70x70 pixels)',\n '80,80' => 'Medium (80x80 pixels)',\n '90,90' => 'Large (90x90 pixels)',\n '100,100' => '1X Large (100x100 pixels)',\n '110,110' => '2X Large (110x110 pixels)',\n '120,120' => '3X Large (120x120 pixels)',\n '130,130' => '4X Large (130x130 pixels)',\n '140,140' => '5X Large (140x140 pixels)',\n '150,150' => '6X Large (150x150 pixels)',\n '160,160' => '7X Large (160x160 pixels)',\n '170,170' => '8X Large (170x170 pixels)',\n '180,180' => '9X Large (180x180 pixels)',\n )\n )));\n\n $setting = $section.'_additional_icon';\n $wp_customize->add_setting($setting);\n \n $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, $setting.'_control', array(\n 'label' => 'Icon for Additional markers',\n 'description' => 'If blank, this will default to main marker Icon, is main marker icon is not set it will default to base icon.',\n 'section' => $section,\n 'settings' => $setting,\n 'priority' => 70\n )));\n\n\n\n}",
"public static function zr_wooswatches_variation_color_script(){\n\t\twp_enqueue_style( 'wp-color-picker' ); \n\t\twp_enqueue_script('category_color_picker_js', WSURL . '/js/admin/category_color_picker.js', array( 'wp-color-picker' ), false, true);\n\t}",
"function nisarg_color_scheme_css_template() {\n\t$colors = array(\n\t\t'accent_color' => '{{ data.accent_color }}',\n\t);\n\t?>\n\t<script type=\"text/html\" id=\"tmpl-nisarg-color-scheme\">\n\t\t<?php echo nisarg_get_color_scheme_css( $colors ); ?>\n\t</script>\n\t<?php\n}",
"function source_color($options)\n{\n\t$colors = array();\n\tif(array_key_exists(\"color\", $options))\n\t{\n\t\t$colors = array( $options[\"color\"] );\n\t}\n\telse if(array_key_exists(\"colors\", $options))\n\t{\n\t\t$colors = $options[\"colors\"];\n\t}\n\telse \n\t{\n\t\treturn;\n\t}\n\t\n\t$color = $colors[rand(0, count($colors) - 1)];\n\techo \"background-color: \" . $color . \";\";\n}",
"function semplicemente_color_primary_register( $wp_customize ) {\r\n\t$colors = array();\r\n\t\r\n\t$colors[] = array(\r\n\t'slug'=>'color_primary', \r\n\t'default' => '#888888',\r\n\t'label' => __('Primary Color ', 'semplicemente')\r\n\t);\r\n\t\r\n\t$colors[] = array(\r\n\t'slug'=>'color_link', \r\n\t'default' => '#404040',\r\n\t'label' => __('Link Color ', 'semplicemente')\r\n\t);\r\n\t\r\n\t$colors[] = array(\r\n\t'slug'=>'color_secondary', \r\n\t'default' => '#36c1c8',\r\n\t'label' => __('Secondary Color ', 'semplicemente')\r\n\t);\r\n\t\r\n\tforeach( $colors as $color ) {\r\n\t// SETTINGS\r\n\t$wp_customize->add_setting(\r\n\t\t$color['slug'], array(\r\n\t\t\t'default' => $color['default'],\r\n\t\t\t'type' => 'option', \r\n\t\t\t'sanitize_callback' => 'sanitize_hex_color',\r\n\t\t\t'capability' => 'edit_theme_options'\r\n\t\t)\r\n\t);\r\n\t// CONTROLS\r\n\t$wp_customize->add_control(\r\n\t\tnew WP_Customize_Color_Control(\r\n\t\t\t$wp_customize,\r\n\t\t\t$color['slug'], \r\n\t\t\tarray('label' => $color['label'], \r\n\t\t\t'section' => 'colors',\r\n\t\t\t'settings' => $color['slug'])\r\n\t\t)\r\n\t);\r\n\t}\r\n\t\r\n}",
"function compete_themes_custom_colors($wp_customize) {\n\n /* Add the color section. */\n $wp_customize->add_section(\n 'ct-colors',\n array(\n 'title' => esc_html__( 'Colors', 'done' ),\n 'priority' => 60,\n 'capability' => 'edit_theme_options'\n )\n );\n /* Add the color setting. */\n $wp_customize->add_setting(\n 'compete_themes_accent_color',\n array(\n 'default' => '#3cbd78',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'sanitize_callback' => 'sanitize_hex_color',\n //'transport' => 'postMessage'\n )\n );\n /* add the color picker */\n $wp_customize->add_control(\n new WP_Customize_Color_Control(\n $wp_customize,\n 'accent_color',\n array(\n 'label' => __( 'Accent Color', 'done' ),\n 'section' => 'ct-colors',\n 'settings' => 'compete_themes_accent_color',\n ) )\n );\n /* Add the color setting. */\n $wp_customize->add_setting(\n 'compete_themes_accent_color_dark',\n array(\n 'default' => '#2c8a58',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'sanitize_callback' => 'sanitize_hex_color',\n //'transport' => 'postMessage'\n )\n );\n /* add the color picker */\n $wp_customize->add_control(\n new WP_Customize_Color_Control(\n $wp_customize,\n 'accent_color_dark',\n array(\n 'label' => __( 'Accent Color (Dark)', 'done' ),\n 'section' => 'ct-colors',\n 'settings' => 'compete_themes_accent_color_dark',\n ) )\n );\n}",
"public function run()\n {\n $colors = [\n 'gray' => '#9CA3AF',\n 'red' => '#F87171',\n 'yellow' => '#FBBF24',\n 'green' => '#34D399',\n 'blue' => '#60A5FA',\n 'purple' => '#A78BFA',\n 'pink' => '#F472B6'\n ];\n\n foreach ($colors as $key => $value)\n Color::create([\n 'name' => $key,\n 'code' => $value\n ]);\n }",
"public function __construct() {\n $this->foreground_colors['black'] = '0;30';\n $this->foreground_colors['dark_gray'] = '1;30';\n $this->foreground_colors['blue'] = '0;34';\n $this->foreground_colors['light_blue'] = '1;34';\n $this->foreground_colors['green'] = '0;32';\n $this->foreground_colors['light_green'] = '1;32';\n $this->foreground_colors['cyan'] = '0;36';\n $this->foreground_colors['light_cyan'] = '1;36';\n $this->foreground_colors['red'] = '0;31';\n $this->foreground_colors['light_red'] = '1;31';\n $this->foreground_colors['purple'] = '0;35';\n $this->foreground_colors['light_purple'] = '1;35';\n $this->foreground_colors['brown'] = '0;33';\n $this->foreground_colors['yellow'] = '1;33';\n $this->foreground_colors['light_gray'] = '0;37';\n $this->foreground_colors['white'] = '1;37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }",
"public function __construct() {\n $this->foreground_colors['black'] = '0;30';\n $this->foreground_colors['dark_gray'] = '1;30';\n $this->foreground_colors['blue'] = '0;34';\n $this->foreground_colors['light_blue'] = '1;34';\n $this->foreground_colors['green'] = '0;32';\n $this->foreground_colors['light_green'] = '1;32';\n $this->foreground_colors['cyan'] = '0;36';\n $this->foreground_colors['light_cyan'] = '1;36';\n $this->foreground_colors['red'] = '0;31';\n $this->foreground_colors['light_red'] = '1;31';\n $this->foreground_colors['purple'] = '0;35';\n $this->foreground_colors['light_purple'] = '1;35';\n $this->foreground_colors['brown'] = '0;33';\n $this->foreground_colors['yellow'] = '1;33';\n $this->foreground_colors['light_gray'] = '0;37';\n $this->foreground_colors['white'] = '1;37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }",
"function wpbss_customize_default_color_section($wp_customize){\n\n\n //###########################################################\n //Add option \"Default color\"\n $wp_customize->add_setting(\n\t\t'default_color',\n\t\tarray(\n\t\t\t'default' => '#fff', // по умолчанию - белый\n\t\t)\n\t);\n\n $wp_customize->add_control(\n \t\tnew WP_Customize_Color_Control(\n $wp_customize,\n 'default_color_control',\n array(\n 'section' => 'default_color_section',\n 'label' => 'Основной цвет элементов',\n 'settings' => 'default_color'\n )\n )\n );\n\n //###########################################################\n //Add option \"Default color on hover\"\n $wp_customize->add_setting(\n\t\t'default_color_on_hover',\n\t\tarray(\n\t\t\t'default' => '#e7e7e7', // по умолчанию - белый\n\t\t)\n\t);\n\n $wp_customize->add_control(\n \t\tnew WP_Customize_Color_Control(\n $wp_customize,\n 'default_color_on_hover_control',\n array(\n 'section' => 'default_color_section',\n 'label' => 'Основной цвет элементов при наведении',\n 'settings' => 'default_color_on_hover'\n )\n )\n );\n\n //###########################################################\n //Add option \"Default color text for element\"\n $wp_customize->add_setting(\n\t\t'default_color_text',\n\t\tarray(\n\t\t\t'default' => '#000', // по умолчанию - черный\n\t\t)\n\t);\n\n $wp_customize->add_control(\n \t\tnew WP_Customize_Color_Control(\n $wp_customize,\n 'default_color_text_control',\n array(\n 'section' => 'default_color_section',\n 'label' => 'Основной цвет текста элементов',\n 'settings' => 'default_color_text'\n )\n )\n );\n\n //###########################################################\n //Add option \"Link color\"\n\t$wp_customize->add_setting(\n\t\t'link_color', // id\n\t\tarray(\n\t\t\t'default' => '#337ab7', // по умолчанию - черный\n\t\t)\n\t);\n\t$wp_customize->add_control(\n\t\tnew WP_Customize_Color_Control(\n\t\t\t$wp_customize,\n\t\t\t'link_color_control', // id\n\t\t\tarray(\n\t\t\t 'label' => 'Цвет ссылок',\n\t\t\t 'section' => 'default_color_section', // Стандартная секция - Цвета\n\t\t\t 'settings' => 'link_color' // id\n\t\t\t)\n\t\t)\n\t);\n\n //###########################################################\n //Add option \"Link color on hover\"\n\t$wp_customize->add_setting(\n\t\t'link_color_on_hover', // id\n\t\tarray(\n\t\t\t'default' => '#337ab7', // по умолчанию - черный\n\t\t)\n\t);\n\t$wp_customize->add_control(\n\t\tnew WP_Customize_Color_Control(\n\t\t\t$wp_customize,\n\t\t\t'link_color_on_hover_control', // id\n\t\t\tarray(\n\t\t\t 'label' => 'Цвет ссылок при наведении',\n\t\t\t 'section' => 'default_color_section', // Стандартная секция - Цвета\n\t\t\t 'settings' => 'link_color_on_hover' // id\n\t\t\t)\n\t\t)\n\t);\n\n //###########################################################\n //Add option \"Link color on hover\"\n\t$wp_customize->add_setting(\n 'text_color', // id\n array(\n 'default' => '#000000',\n )\n\t );\n\t$wp_customize->add_control(\n\t\tnew WP_Customize_Color_Control(\n\t\t\t$wp_customize,\n\t\t\t'text_color_control', // id\n\t\t\tarray(\n\t\t\t 'label' => 'Цвет текста',\n\t\t\t 'section' => 'default_color_section', // Стандартная секция - Цвета\n\t\t\t 'settings' => 'text_color' // id\n\t\t\t)\n\t\t)\n\t);\n\n //###########################################################\n //Add section\n $wp_customize->add_section(\n\t\t'default_color_section',\n\t\tarray(\n\t\t\t'title' => 'Основные цвета',\n\t\t\t'priority' => 100,\n\t\t\t'description' => 'Выберите основной цвет элементов сайта'\n\t\t)\n\t);\n\n}",
"function thistle_customize_theme_color( $wp_customize ) {\n $wp_customize->add_setting( 'thistle_themecolor', array(\n 'default' => get_option( 'thistle_themecolor', '' ),\n 'type' => 'option',\n 'capability' => 'manage_options'\n ) );\n\n $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'thistle_themecolor', array(\n 'label' => __( 'Color', THISTLE_TEXT_DOMAIN ),\n 'description' => __( 'Defines the default theme color for an application. This sometimes affects how the application is displayed by the OS (e.g., on Android\\'s task switcher, the theme color surrounds the application).', THISTLE_TEXT_DOMAIN ),\n 'section' => 'title_tagline',\n 'settings' => 'thistle_themecolor',\n 'priority' => 61,\n ) ) );\n }",
"function tend_colour_scheme() {\n\twp_admin_css_color(\n\t '10degrees',\n\t __( '10°' ),\n\t get_template_directory_uri() . '/assets/css/wp-admin-colours.css',\n\t array( '#07273E', '#14568A', '#6e949c', '#bb3131' ),\n\t array( 'base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff' )\n\t);\n\n}",
"public function getColorCount () {}",
"function custom_text_colors( $wp_customize ) {\n \n $colors = array();\n $colors[] = array(\n 'slug' =>'content_text_color', \n 'default' => '#333',\n 'label' => __('Content Text Color', '_i3-base')\n );\n $colors[] = array(\n 'slug' =>'content_link_color', \n 'default' => '#4285f4',\n 'label' => __('Content Link Color', '_i3-base')\n );\n $colors[] = array(\n 'slug' =>'content_link_hover_color', \n 'default' => '#76a7fa',\n 'label' => __('Content Link Hover Color', '_i3-base')\n );\n foreach( $colors as $color ) {\n // SETTINGS\n $wp_customize->add_setting( $color['slug'], array(\n 'default' => $color['default'],\n 'type' => 'option', \n 'capability' => 'edit_theme_options'\n )\n );\n // CONTROLS\n $wp_customize->add_control(\n new WP_Customize_Color_Control( $wp_customize, $color['slug'], array(\n 'label' => $color['label'], \n 'section' => 'colors',\n 'settings' => $color['slug'])\n )\n );\n }\n\n }",
"function customize_options_register($wp_customize){\n $wp_customize->add_setting('wp_link_color', array(\n 'default' => '#006ec3',\n 'transport' => 'refresh',\n ));\n $wp_customize->add_setting('wp_btn_color', array(\n 'default' => '#006ec3',\n 'transport' => 'refresh',\n ));\n $wp_customize->add_setting('wp_btn_hover_color', array(\n 'default' => '#258ad7',\n 'transport' => 'refresh',\n ));\n $wp_customize->add_section('wp_standard_color', array(\n 'title' => __('Standard Colors', 'myFirstTheme'),\n 'priorty' => 30,\n ));\n $wp_customize->add_control(new WP_Customize_Color_control($wp_customize, 'wp_link_color_control', array(\n 'label' => __('Link Color', 'myFirstTheme'),\n 'section' => 'wp_standard_color',\n 'settings' => 'wp_link_color',\n )));\n $wp_customize->add_control(new WP_Customize_Color_control($wp_customize, 'wp_btn_color_control', array(\n 'label' => __('Button Color', 'myFirstTheme'),\n 'section' => 'wp_standard_color',\n 'settings' => 'wp_btn_color',\n )));\n $wp_customize->add_control(new WP_Customize_Color_control($wp_customize, 'wp_btn_hover_color_control', array(\n 'label' => __('Button Hover Color', 'myFirstTheme'),\n 'section' => 'wp_standard_color',\n 'settings' => 'wp_btn_hover_color',\n )));\n}",
"abstract protected function getColor();",
"function us_output_custom_colors() {\n\t$colors = us_get_hex_colors();\n\t$primary = sanitize_hex_color( get_theme_mod( 'us_primarycolor', $colors[0] ) );\n\t$secondary = sanitize_hex_color( get_theme_mod( 'us_secondarycolor', $colors[0] ) );\n\t$title = sanitize_hex_color( get_theme_mod( 'us_titlecolor', $colors[1] ) );\n\t$secondary_accent = sanitize_hex_color( get_theme_mod( 'us_secondaryaccentcolor', $colors[1] ) );\n\t?>\n\t<style>\n\t\ta {\n\t\t\tcolor: <?php echo $secondary; ?>;\n\t\t}\n\t\t.header {\n\t\t\tbackground-color: <?php echo $primary; ?>;\n\t\t}\n\t\t.header .header-content a {\n\t\t\tcolor: <?php echo $title; ?>;\n\t\t}\n\t\t.open-menu, .close-menu {\n\t\t\tcolor: <?php echo $secondary_accent; ?>;\n\t\t\tbackground-color: <?php echo $primary; ?>;\n\t\t}\n\n\t\t.comments-title, \n\t\t#comments h3,\n\t\t.search-container i:hover {\n\t\t\tcolor: <?php echo $secondary; ?>;\n\t\t}\n\n\t\t.nav-previous a, \n\t\t.nav-next a {\n\t\t\tcolor: <?php echo $title; ?>;\n\t\t\tbackground-color: <?php echo $primary; ?>;\n\t\t}\n\n\t\t.archive-title {\n\t\t\tcolor: <?php echo $primary; ?>;\n\t\t}\n\t</style>\n\t<?php\n}",
"function header_footer_color_customizer($wp_customize) {\n\t$default_menu_bgcolor = \"#ffd480\";\n\t$default_menu_textcolor = \"#811b4d\";\n\t$default_theme_bgcolor1 = \"#ff9999\";\n\n\t$wp_customize->add_setting('themename_menu_bgcolor', array(\n\t\t'default' => $default_menu_bgcolor,\n\t\t'wp-head-callback' => 'scm_test_style',\n\t\t'transport' => 'postMessage'\n\t));\n\t$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'themename_menu_bgcolor', array(\n\t\t'label' => 'Menu Background Color',\n\t\t'section' => 'colors',\n\t\t'settings' => 'themename_menu_bgcolor',\n\t)));\n\t$wp_customize->add_setting('themename_menu_textcolor', array(\n\t\t'default' => $default_menu_textcolor,\n\t\t'wp-head-callback' => 'scm_test_style',\n\t\t'transport' => 'postMessage'\n\t));\n\t$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'themename_menu_textcolor', array(\n\t\t'label' => 'Text Color',\n\t\t'section' => 'colors',\n\t\t'settings' => 'themename_menu_textcolor',\n\t)));\n\t$wp_customize->add_setting('themename_theme_bgcolor', array(\n\t\t'default' => $default_theme_bgcolor1,\n\t\t'wp-head-callback' => 'scm_test_style',\n\t\t'transport' => 'postMessage'\n\t));\n\t$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'themename_theme_bgcolor', array(\n\t\t'label' => 'Theme Background Color1',\n\t\t'section' => 'colors',\n\t\t'settings' => 'themename_theme_bgcolor',\n\t)));\n\n}",
"function nectar_select_color_styles() {\n\t\n\tglobal $nectar_options;\n\n\t$nectar_accent_color = (!empty($nectar_options[\"accent-color\"])) ? $nectar_options[\"accent-color\"] : 'transparent';\n\t$nectar_extra_color_1 = (!empty($nectar_options[\"extra-color-1\"])) ? $nectar_options[\"extra-color-1\"] : 'transparent';\n\t$nectar_extra_color_2 = (!empty($nectar_options[\"extra-color-2\"])) ? $nectar_options[\"extra-color-2\"] : 'transparent';\n\t$nectar_extra_color_3 = (!empty($nectar_options[\"extra-color-3\"])) ? $nectar_options[\"extra-color-3\"] : 'transparent';\n\n\t$nectar_color_css = '.vc_edit-form-tab .chosen-container .chosen-results li.Default:before, \n\t.vc_edit-form-tab .chosen-container .chosen-results li.default:before, \n\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"].Default + .chosen-container > a:before, \n\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"].default + .chosen-container > a:before { background: linear-gradient(to right, #444 49%, #fff 51%); } \n\t\n\t.vc_edit-form-tab .chosen-container .chosen-results li[class*=\"Accent-Color\"]:before,\n\t.vc_edit-form-tab .chosen-container .chosen-results li.Default-Accent-Color:before, \n\t.vc_edit-form-tab .chosen-container .chosen-results li[class*=\"accent-color\"]:before, \n\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"].Default-Accent-Color + .chosen-container > a:before, \n\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"Accent-Color\"] + .chosen-container > a:before, \n\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"accent-color\"] + .chosen-container > a:before, \n\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"cta_button_style\"].accent-color + .chosen-container > a:before { background-color: '.$nectar_accent_color.'; } \n\t\n .vc_edit-form-tab .chosen-container .chosen-results li[class*=\"Extra-Color-1\"]:before, \n\t\t.vc_edit-form-tab .chosen-container .chosen-results li[class*=\"extra-color-1\"]:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"Extra-Color-1\"] + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"extra-color-1\"] + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"cta_button_style\"].extra-color-1 + .chosen-container > a:before { background-color: '.$nectar_extra_color_1.'; }\n\t\t\n .vc_edit-form-tab .chosen-container .chosen-results li[class*=\"Extra-Color-2\"]:before, \n\t\t.vc_edit-form-tab .chosen-container .chosen-results li[class*=\"extra-color-2\"]:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"Extra-Color-2\"] + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"extra-color-2\"] + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"cta_button_style\"].extra-color-2 + .chosen-container > a:before { background-color: '.$nectar_extra_color_2.'; }\n\t\t\n .vc_edit-form-tab .chosen-container .chosen-results li[class*=\"Extra-Color-3\"]:before, \n\t\t.vc_edit-form-tab .chosen-container .chosen-results li[class*=\"extra-color-3\"]:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"Extra-Color-3\"] + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"][class*=\"extra-color-3\"] + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"cta_button_style\"].extra-color-3 + .chosen-container > a:before { background-color: '.$nectar_extra_color_3.'; }';\n\n\tif( !empty($nectar_options[\"extra-color-gradient\"]) && $nectar_options[\"extra-color-gradient\"]['to'] && $nectar_options[\"extra-color-gradient\"]['from']) {\n\t\t$nectar_gradient_1_from = $nectar_options[\"extra-color-gradient\"]['from'];\n\t\t$nectar_gradient_1_to = $nectar_options[\"extra-color-gradient\"]['to'];\n\n\t\t$nectar_color_css .= '.vc_edit-form-tab .chosen-container .chosen-results li.extra-color-gradient-1:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"].extra-color-gradient-1 + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"button_color\"].extra-color-gradient-1 + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name=\"icon_color\"].extra-color-gradient-1 + .chosen-container > a:before { background: linear-gradient(to right, '.$nectar_gradient_1_from.', '.$nectar_gradient_1_to.'); }';\n\t}\n\n\tif( !empty($nectar_options[\"extra-color-gradient-2\"]) && $nectar_options[\"extra-color-gradient-2\"]['to'] && $nectar_options[\"extra-color-gradient-2\"]['from']) {\n\t\t$nectar_gradient_2_from = $nectar_options[\"extra-color-gradient-2\"]['from'];\n\t\t$nectar_gradient_2_to = $nectar_options[\"extra-color-gradient-2\"]['to'];\n\n\t\t$nectar_color_css .= '.vc_edit-form-tab .chosen-container .chosen-results li.extra-color-gradient-2:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"color\"].extra-color-gradient-2 + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name*=\"button_color\"].extra-color-gradient-2 + .chosen-container > a:before, \n\t\t.vc_edit-form-tab .vc_shortcode-param[data-param_type=\"dropdown\"] select[name=\"icon_color\"].extra-color-gradient-2 + .chosen-container > a:before { background: linear-gradient(to right, '.$nectar_gradient_2_from.', '.$nectar_gradient_2_to.'); }';\n\t}\n\n \n wp_add_inline_style( 'nectar-vc', $nectar_color_css );\n}",
"function colorize($value)\n\t{\n\t\t$this->label->setTextColor(\"fff\");\n\t\t$this->backGround->setSubStyle(\"BgButtonMediumSpecial\");\n\t\t$this->backGround->setModulateColor($value);\n\t}",
"public function generate_dynamic_css_color( $color ) {\r\n\r\n\t\t$dynamic_css_color = '\r\n\t\t\t.lscf-template2-woocommerce-display .lscf-template2-add-to-cart{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-template3-onsale{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-template3-woocommerce-display .lscf-template3-add-to-cart{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-template1-image::before{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.4 );\r\n\t\t\t}\r\n\t\t\t.lscf-li-title::before{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.4 );\r\n\t\t\t}\r\n\t\t\t.lscf-masonry-grid-cf{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.4 );\r\n\t\t\t}\r\n\t\t\t.lscf-woocommerce-grid-cf{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.2 );\r\n\t\t\t}\r\n\t\t\t.lscf-woocommerce-grid-2-cf{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.6);\r\n\t\t\t}\r\n\t\t\t.viewMode div.active{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\r\n\t\t\t.lscf-sorting-opt .lscf-sort-up.active .glyphicon, .lscf-sorting-opt .lscf-sort-down.active .glyphicon{\r\n\t\t\t\tcolor: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-woo-grid-2-onsale{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . '!important;\r\n\t\t\t}\r\n\t\t\t.lscf-woo-grid-2-add-to-cart{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.9 )!important;\r\n\t\t\t}\r\n\t\t\t.customRange .range_draggable{\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\t\r\n\t\t\t.customRange label{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px_checkbox:after{\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.post-list .price label, .post-list .block-price label{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.post-list .post-featuredImage .post-overlay{\r\n\t\t\t\tbackground: rgba(' . esc_attr( $color['rgb'] ) . ', 0.7 );\r\n\t\t\t}\r\n\t\t\t.view.block-view .block-price{\r\n\t\t\t\tbackground: ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.view.block-view .block-price:before{\r\n\t\t\t\tborder-bottom:34px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.view.block-view .block-price:after{\r\n\t\t\t\tborder-top:34px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px-select-box.active-val div.select{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.pxSearchField .px-focus{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\tinput[type=\"radio\"]:checked + label.pxRadioLabel:before{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\tinput[type=\"radio\"]:checked + label.pxRadioLabel:after{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px-select-box.active-val div.select .options{\r\n\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.px-cross .px-cross-child-1, .px-cross .px-cross-child-2{\r\n\t\t\t\tbackground:' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .block-featuredImage .block-price {\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.6 );\r\n\t\t\t} \r\n\t\t\t.lscf-portrait .block-featuredImage .block-price:after{\r\n\t\t\t\tborder-left:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\tborder-bottom:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .block-featuredImage .block-price:before{\r\n\t\t\t\tborder-right:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\tborder-top:3px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .post-overlay{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.9 );\r\n\t\t\t}\r\n\t\t\t.lscf-portrait .post-overlay .eyeglass{\r\n\t\t\t\tbackground:rgba(' . esc_attr( $color['rgb'] ) . ', 0.9 );\r\n\t\t\t}\r\n\t\t\t.px_capf-field .lscf-see-more{\r\n\t\t\t\tcolor:' . esc_attr( $color['hex'] ) . ';\t\r\n\t\t\t}\r\n\t\t\t@media (max-width:770px) {\r\n\t\t\t\t.px-capf-wrapper .px-filter-fields .px-fiels-wrapper .px-filter-label-mobile{\r\n\t\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\t}\r\n\t\t\t\t.px-capf-wrapper .px-filter-fields .px-fiels-wrapper.active .px-filter-label-mobile{\r\n\t\t\t\t\tborder-bottom:0px;\r\n\t\t\t\t}\r\n\t\t\t\t.px-capf-wrapper .px-filter-fields .px-fiels-wrapper .px-field-wrapper-container{\r\n\t\t\t\t\tborder:1px solid ' . esc_attr( $color['hex'] ) . ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t';\r\n\r\n\t\treturn $dynamic_css_color;\r\n\t}",
"function _alm_paging_color_callback() {\n\n\t $options = get_option( 'alm_settings' );\n\n\t\tif(!isset($options['_alm_paging_color']))\n\t\t $options['_alm_paging_color'] = '0';\n\n\t $color = $options['_alm_paging_color'];\n\n\t\t $selected0 = '';\n\t\t if($color == 'default') $selected0 = 'selected=\"selected\"';\n\n\t\t $selected1 = '';\n\t\t if($color == 'blue') $selected1 = 'selected=\"selected\"';\n\n\t\t $selected2 = '';\n\t\t if($color == 'green') $selected2 = 'selected=\"selected\"';\n\n\t\t $selected3 = '';\n\t\t if($color == 'red') $selected3 = 'selected=\"selected\"';\n\n\t\t $selected4 = '';\n\t\t if($color == 'purple') $selected4 = 'selected=\"selected\"';\n\n\t\t $selected5 = '';\n\t\t if($color == 'grey') $selected5 = 'selected=\"selected\"';\n\n\t\t $selected6 = '';\n\t\t if($color == 'white') $selected6 = 'selected=\"selected\"';\n\n\t $html = '<label for=\"alm_settings_paging_color\">'.__('Choose your paging navigation color', 'ajax-load-more-paging').'.</label><br/>';\n\t $html .= '<select id=\"alm_settings_paging_color\" name=\"alm_settings[_alm_paging_color]\">';\n\t $html .= '<option value=\"default\" ' . $selected0 .'>Default</option>';\n\t $html .= '<option value=\"blue\" ' . $selected1 .'>Blue</option>';\n\t $html .= '<option value=\"green\" ' . $selected2 .'>Green</option>';\n\t $html .= '<option value=\"red\" ' . $selected3 .'>Red</option>';\n\t $html .= '<option value=\"purple\" ' . $selected4 .'>Purple</option>';\n\t $html .= '<option value=\"grey\" ' . $selected5 .'>Grey</option>';\n\t $html .= '<option value=\"white\" ' . $selected6 .'>White</option>';\n\t $html .= '</select>';\n\n\t $html .= '<div class=\"clear\"></div>';\n\t $html .= '<div class=\"ajax-load-more-wrap pages paging-'.$color.'\"><span class=\"pages\">'.__('Preview', 'ajax-load-more-paging') .'</span>';\n\t $html .= '<ul class=\"alm-paging\" style=\"opacity: 1;\"><li class=\"active\"><a href=\"javascript:void(0);\"><span>1</span></a></li><li><a href=\"javascript:void(0);\"><span>2</span></a></li><li><a href=\"javascript:void(0);\"><span>3</span></a></li><li><a href=\"javascript:void(0);\"><span>4</span></a></li><li><a href=\"javascript:void(0);\"><span>5</span></a></li></ul>';\n\t $html .= '</div>';\n\t echo $html;\n\t ?>\n\n\t<script>\n \t//Button preview\n \tvar colorArray = \"paging-default paging-grey paging-purple paging-green paging-red paging-blue paging-white\";\n \tjQuery(\"select#alm_settings_paging_color\").change(function() {\n \t\tvar color = jQuery(this).val();\n\t\t\tjQuery('.ajax-load-more-wrap.pages').removeClass(colorArray);\n\t\t\tjQuery('.ajax-load-more-wrap.pages').addClass('paging-'+color);\n\t\t});\n\t\tjQuery(\"select#alm_settings_paging_color\").click(function(e){\n\t\t\te.preventDefault();\n\t\t});\n\n\t\t// Check if Disable CSS === true\n\t\tif(jQuery('input#alm_paging_disable_css_input').is(\":checked\")){\n\t jQuery('select#alm_settings_paging_color').parent().parent().hide(); // Hide button color\n \t}\n \tjQuery('input#alm_paging_disable_css_input').change(function() {\n \t\tvar el = jQuery(this);\n\t if(el.is(\":checked\")) {\n\t \tel.parent().parent('tr').next('tr').hide(); // Hide paging color\n\t }else{\n\t \tel.parent().parent('tr').next('tr').show(); // show paging color\n\t }\n\t });\n\n </script>\n\n\t<?php\n\t}",
"public function __construct() {\n $this->foreground_colors['Black'] = '30';\n $this->foreground_colors['Blue'] = '34';\n $this->foreground_colors['Green'] = '32';\n $this->foreground_colors['DarkGray'] = '36';\n $this->foreground_colors['Red'] = '31';\n $this->foreground_colors['Purple'] = '35';\n $this->foreground_colors['Yellow'] = '33';\n $this->foreground_colors['LightGray'] = '37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }"
] | [
"0.65000856",
"0.6422209",
"0.64015627",
"0.6399484",
"0.6342103",
"0.6301474",
"0.627299",
"0.6239824",
"0.62076265",
"0.6172653",
"0.6098416",
"0.60932255",
"0.60766673",
"0.60757333",
"0.6058382",
"0.6058382",
"0.60411155",
"0.60292614",
"0.6016006",
"0.60090286",
"0.5989494",
"0.59600246",
"0.5941715",
"0.59325755",
"0.59221727",
"0.59192854",
"0.59135777",
"0.5912973",
"0.5902615",
"0.589605"
] | 0.74650186 | 0 |
For diagnostic purposes: var_dump customizerData at end of header Presumes: Theme Hook Alliance hooks are in use. Note: action is disabled by default. | public function data_dump() {
var_dump($this->customizerData);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tfc_nathan_small_customizer( $wp_customize ) {\r\n $wp_customize->add_section(\r\n 'tfc_nathan_small_options',\r\n array(\r\n 'title' => __( 'TFC Theme Settings', 'tfc-nathan-small' ),\r\n 'description' => __( 'Settings specific to the TFC theme for Nathan Small', 'tfc-nathan-small' ),\r\n 'priority' => 140,\r\n )\r\n );\r\n\r\n $wp_customize->add_setting(\r\n 'blue_bar',\r\n array(\r\n 'default' => __( 'Blue bar at top of site', 'tfc-nathan-small' ),\r\n 'sanitize_callback' => 'tfc_nathan_small_sanitize_textarea',\r\n )\r\n );\r\n\r\n $wp_customize->add_control(\r\n 'blue_bar',\r\n array(\r\n 'label' => __( 'Blue bar text', 'tfc-nathan-small' ),\r\n 'section' => 'tfc_nathan_small_options',\r\n 'type' => 'textarea',\r\n )\r\n );\r\n\r\n $wp_customize->add_setting(\r\n 'cta_header',\r\n array(\r\n 'default' => __( 'Call to Action', 'tfc-nathan-small' ),\r\n 'sanitize_callback' => 'tfc_nathan_small_sanitize_text',\r\n )\r\n );\r\n\r\n $wp_customize->add_control(\r\n 'cta_header',\r\n array(\r\n 'label' => __( 'Footer Call to Action Header', 'tfc-nathan-small' ),\r\n 'section' => 'tfc_nathan_small_options',\r\n 'type' => 'text',\r\n )\r\n );\r\n\r\n $wp_customize->add_setting(\r\n 'cta_button_text',\r\n array(\r\n 'default' => __( 'Click Here', 'tfc-nathan-small' ),\r\n 'sanitize_callback' => 'tfc_nathan_small_sanitize_text',\r\n )\r\n );\r\n\r\n $wp_customize->add_control(\r\n 'cta_button_text',\r\n array(\r\n 'label' => __( 'Footer Call to Action Button Text', 'tfc-nathan-small' ),\r\n 'section' => 'tfc_nathan_small_options',\r\n 'type' => 'text',\r\n )\r\n );\r\n\r\n $wp_customize->add_setting(\r\n 'cta_button_link',\r\n array(\r\n 'default' => home_url(),\r\n 'sanitize_callback' => 'tfc_nathan_small_sanitize_text',\r\n )\r\n );\r\n\r\n $wp_customize->add_control(\r\n 'cta_button_link',\r\n array(\r\n 'label' => __( 'Footer Call to Action Button Link', 'tfc-nathan-small' ),\r\n 'section' => 'tfc_nathan_small_options',\r\n 'type' => 'text',\r\n )\r\n );\r\n\r\n $wp_customize->add_setting(\r\n 'cta_text',\r\n array(\r\n 'default' => __( 'Descriptive text to make clicking irresistible', 'tfc-nathan-small' ),\r\n 'sanitize_callback' => 'tfc_nathan_small_sanitize_textarea',\r\n )\r\n );\r\n\r\n $wp_customize->add_control(\r\n 'cta_text',\r\n array(\r\n 'label' => __( 'Footer Call to Action Despcription', 'tfc-nathan-small' ),\r\n 'section' => 'tfc_nathan_small_options',\r\n 'type' => 'textarea',\r\n )\r\n );\r\n\r\n $wp_customize->add_setting( 'cta_background' );\r\n\r\n $wp_customize->add_control(\r\n new WP_Customize_Image_Control(\r\n $wp_customize,\r\n 'cta_background',\r\n array(\r\n 'label' => 'Image Upload',\r\n 'section' => 'tfc_nathan_small_options',\r\n )\r\n )\r\n );\r\n\r\n\r\n\r\n}",
"function mbt_customizer($wp_customizer) {\n\t// Use Header Textshadow?\n\t$wp_customizer->add_setting('header_textshadow', [\n\t\t'default' => false,\n\t]);\n\t$wp_customizer->add_control(\n\t\tnew WP_Customize_Control(\n\t\t\t$wp_customizer,\n\t\t\t'header_textshadow',\n\t\t\t[\n\t\t\t\t'label' => 'Header Textshadow',\t\t\t// Admin-visible name of the control\n\t\t\t\t'setting' => 'header_textshadow',\t\t\t// Which setting to load and manipulate\n\t\t\t\t'section' => 'colors', \t\t\t\t\t\t\t// ID of the section this control should render in\n\t\t\t\t'type' => 'checkbox',\n\t\t\t]\n\t\t)\n\t);\n\n\t// Header Textshadow Color\n\t$wp_customizer->add_setting('header_textshadow_color', [\n\t\t'default' => '#dddddd',\n\t]);\n\t$wp_customizer->add_control(\n\t\tnew WP_Customize_Color_Control(\n\t\t\t$wp_customizer,\n\t\t\t'header_textshadow_color',\n\t\t\t[\n\t\t\t\t'label' => 'Header Textshadow Color',\t\t\t// Admin-visible name of the control\n\t\t\t\t'setting' => 'header_textshadow_color',\t\t\t// Which setting to load and manipulate\n\t\t\t\t'section' => 'colors', \t\t\t\t\t\t\t// ID of the section this control should render in\n\t\t\t\t'sanitize_callback' => 'sanitize_hex_color',\t// Sanitize HEX color\n\t\t\t]\n\t\t)\n\t);\n\n\t// Header Textshadow offset-x\n\t$wp_customizer->add_setting('header_textshadow_offset_x', [\n\t\t'default' => '0',\n\t]);\n\t$wp_customizer->add_control(\n\t\tnew WP_Customize_Control(\n\t\t\t$wp_customizer,\n\t\t\t'header_textshadow_offset_x',\n\t\t\t[\n\t\t\t\t'label' => 'Header Textshadow Offset X',\t\t// Admin-visible name of the control\n\t\t\t\t'description' => 'Offset in pixels',\t\t\t// Admin-visible description of the control\n\t\t\t\t'setting' => 'header_textshadow_offset_x',\t\t// Which setting to load and manipulate\n\t\t\t\t'section' => 'colors', \t\t\t\t\t\t\t// ID of the section this control should render in\n\t\t\t\t'sanitize_callback' => 'mbt_sanitize_int',\t\t// Sanitize integer\n\t\t\t\t'type' => 'number',\n\t\t\t]\n\t\t)\n\t);\n\n\t// Header Textshadow offset-y\n\t$wp_customizer->add_setting('header_textshadow_offset_y', [\n\t\t'default' => '0',\n\t]);\n\t$wp_customizer->add_control(\n\t\tnew WP_Customize_Control(\n\t\t\t$wp_customizer,\n\t\t\t'header_textshadow_offset_y',\n\t\t\t[\n\t\t\t\t'label' => 'Header Textshadow Offset Y',\t\t// Admin-visible name of the control\n\t\t\t\t'description' => 'Offset in pixels',\t\t\t// Admin-visible description of the control\n\t\t\t\t'setting' => 'header_textshadow_offset_y',\t\t// Which setting to load and manipulate\n\t\t\t\t'section' => 'colors', \t\t\t\t\t\t\t// ID of the section this control should render in\n\t\t\t\t'sanitize_callback' => 'mbt_sanitize_int',\t\t// Sanitize integer\n\t\t\t\t'type' => 'number',\n\t\t\t]\n\t\t)\n\t);\n\n\t// Header Textshadow blur-radius\n\t$wp_customizer->add_setting('header_textshadow_blur_radius', [\n\t\t'default' => '0',\n\t]);\n\t$wp_customizer->add_control(\n\t\tnew WP_Customize_Control(\n\t\t\t$wp_customizer,\n\t\t\t'header_textshadow_blur_radius',\n\t\t\t[\n\t\t\t\t'label' => 'Header Textshadow Blur Radius',\t\t// Admin-visible name of the control\n\t\t\t\t'description' => 'Blur radius in pixels',\t\t// Admin-visible description of the control\n\t\t\t\t'setting' => 'header_textshadow_blur_radius',\t// Which setting to load and manipulate\n\t\t\t\t'section' => 'colors', \t\t\t\t\t\t\t// ID of the section this control should render in\n\t\t\t\t'sanitize_callback' => 'mbt_sanitize_int',\t\t// Sanitize integer\n\t\t\t\t'type' => 'number',\n\t\t\t\t'input_attrs' => [\n\t\t\t\t\t'min' => '0',\n\t\t\t\t],\n\t\t\t]\n\t\t)\n\t);\n\n\t// Blog Section\n\t$wp_customizer->add_section('mbt_blog', [\n\t\t'title' => 'Blog Settings',\n\t\t'priority' => 30,\n\t]);\n\n\t// Blog sidebar\n\t$wp_customizer->add_setting('blog_sidebar', [\n\t\t'default' => 'right',\n\t]);\n\t$wp_customizer->add_control('blog_sidebar', [\n\t\t'label' => 'Blog Sidebar Location',\n\t\t'description' => 'This applies to devices ≥768px.',\n\t\t'setting' => 'blog_sidebar',\n\t\t'section' => 'mbt_blog',\n\t\t'type' => 'radio',\n\t\t'choices' => [\n\t\t\t'left' => 'Left',\n\t\t\t'right' => 'Right',\n\t\t],\n\t]);\n}",
"function bones_theme_customizer($wp_customize)\n{\n // $wp_customize calls go here.\n //\n // Uncomment the below lines to remove the default customize sections\n\n // $wp_customize->remove_section('title_tagline');\n // $wp_customize->remove_section('colors');\n // $wp_customize->remove_section('background_image');\n // $wp_customize->remove_section('static_front_page');\n // $wp_customize->remove_section('nav');\n\n // Uncomment the below lines to remove the default controls\n // $wp_customize->remove_control('blogdescription');\n\n // Uncomment the following to change the default section titles\n // $wp_customize->get_section('colors')->title = __( 'Theme Colors' );\n // $wp_customize->get_section('background_image')->title = __( 'Images' );\n}",
"function addCustomCustomizerOption()\n{\n add_option('custom_customizer_options', []);\n}",
"public function getCustomizerData()\n {\n return ['alleFylker' => Fylker::getAll()];\n }",
"function wpt_register_theme_customizer( $wp_customize ) {\n\n// Remove blogdescription option from customizer\n$wp_customize->remove_control('blogdescription');\n// Remove background image section\n$wp_customize->remove_section('background_image');\n\n// Rename Header option to Site Title\n$wp_customize->get_section('title_tagline')->title = __('Site Title');\n// Rename Colors section to something more descriptive\n$wp_customize->get_section('colors')->title = __('Text and Background Color');\n// Rename Header Image option to Jumbotron Image\n$wp_customize->get_section('header_image')->title = __('Jumbotron Image');\n}",
"public function reset_customizer_script() {\n\t\t?>\n\t\t<script>\n\t\t\tjQuery(function ($) {\n\t\t\t\t$('body').on('click', 'input[name=\"csco-demos-reset\"]', function (event) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\twp_customize: 'on',\n\t\t\t\t\t\taction: 'customizer_reset',\n\t\t\t\t\t\tnonce: '<?php echo esc_attr( wp_create_nonce( 'customizer-reset' ) ); ?>'\n\t\t\t\t\t};\n\n\t\t\t\t\tvar r = confirm( \"<?php esc_html_e( 'Warning: This action will reset all current customizations.', 'authentic' ); ?>\" );\n\n\t\t\t\t\tif (!r) return;\n\n\t\t\t\t\t$(this).attr('disabled', 'disabled');\n\n\t\t\t\t\t$(this).siblings('.spinner').addClass('is-active');\n\n\t\t\t\t\t$('#customize-preview').css( 'opacity', ' 0.6' );\n\n\t\t\t\t\t$.post(ajaxurl, data, function ( response ) {\n\t\t\t\t\t\twp.customize.state('saved').set(true);\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar info = $.parseJSON( JSON.stringify(response) );\n\n\t\t\t\t\t\t\tif( typeof info.success != 'undefined' && info.success == true ){\n\t\t\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif( typeof info.data != 'undefined' ){\n\t\t\t\t\t\t\t\t\talert( info.data );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\talert( '<?php esc_html_e( 'Error server!', 'authentic' ); ?>' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\talert( response );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}",
"public function import_customizer_script() {\n\t\t?>\n\t\t<script>\n\t\t\tjQuery(function ($) {\n\t\t\t\t$('body').on('click', '.csco-demo-import', function (event) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\twp_customize: 'on',\n\t\t\t\t\t\taction: 'customizer_import',\n\t\t\t\t\t\tdemo: $(this).closest('.csco-theme-demo').attr('data-demo'),\n\t\t\t\t\t\tnonce: '<?php echo esc_attr( wp_create_nonce( 'customizer-import' ) ); ?>'\n\t\t\t\t\t};\n\n\t\t\t\t\tvar r = confirm( \"<?php esc_html_e( 'Warning: Activating a demo will reset all current customizations.', 'authentic' ); ?>\" );\n\n\t\t\t\t\tif (!r) return;\n\n\t\t\t\t\t$(this).attr('disabled', 'disabled');\n\n\t\t\t\t\t$(this).siblings('.spinner').addClass('is-active');\n\n\t\t\t\t\t$('#customize-preview').css( 'opacity', ' 0.6' );\n\n\t\t\t\t\t$.post(ajaxurl, data, function ( response ) {\n\t\t\t\t\t\twp.customize.state('saved').set(true);\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar info = $.parseJSON( JSON.stringify(response) );\n\n\t\t\t\t\t\t\tif( typeof info.success != 'undefined' && info.success == true ){\n\t\t\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif( typeof info.data != 'undefined' ){\n\t\t\t\t\t\t\t\t\talert( info.data );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\talert( '<?php esc_html_e( 'Server error!', 'authentic' ); ?>' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\talert( response );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}",
"function start_theme_customizer( $wp_customize ){\r\n $wp_customize->add_setting(\r\n 'primary_color',\r\n array(\r\n 'default' => '#ff5c36'\r\n )\r\n );\r\n $wp_customize->add_control(\r\n new WP_Customize_Color_Control(\r\n $wp_customize,\r\n 'primary_color',\r\n array(\r\n 'label' => __('Primary color', 'start'),\r\n 'section' => 'colors',\r\n 'priority' => 9\r\n )\r\n )\r\n );\r\n $wp_customize->add_setting(\r\n 'header_bg_color',\r\n array(\r\n 'default' => '#f5f5f5'\r\n )\r\n );\r\n $wp_customize->add_control(\r\n new WP_Customize_Color_Control(\r\n $wp_customize,\r\n 'header_bg_color',\r\n array(\r\n 'label' => __('Header background color', 'start'),\r\n 'section' => 'background_image',\r\n 'priority' => 9\r\n )\r\n )\r\n );\r\n}",
"function localize_customizer() {\n\t\t//deregister twentytwelves theme customizer js. Need a more unviersal way to do this.\n\t\t//wp_deregister_script('twentytwelve-customizer');\n\t\t$handle = 'customizer-preview';\n\t\t$src = SCF_PATH.'/js/customizer.js';\n\t\t//$src = get_template_directory_uri().'/options/js/customizer.js';\n\t\t$deps = array( 'jquery' );\n\t\t$ver = 1;\n\t\t$in_footer = true;\n\t\twp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );\n\t\t//localize script with the css bits we need\n\t\twp_localize_script(\t$handle, 'custStyle', $this->customizerData);\n\t}",
"function bluegymn_main_callout($wp_customize){\n $wp_customize->add_section('bluegymn-main-callout-section',array(\n 'title'=>'Welcome Text',\n ));\n $wp_customize->add_setting('bluegymn-main-callout-headline',array(\n 'default'=>'Stay Healthy In all Seasons'\n ));\n\n $wp_customize->add_control(new WP_Customize_Control($wp_customize,'\n bluegymn-main-callout-headline-control',array(\n 'label'=>'Main Heading',\n 'section'=>'bluegymn-main-callout-section',\n 'settings'=>'bluegymn-main-callout-headline'\n )));\n /* settings and controls for the main welcome section */\n $wp_customize->add_setting('bluegymn-main-callout-message',array(\n 'default'=>'Get your ideal body with our programms that will help you stay motivated and stay fit in all seasons'\n ));\n\n $wp_customize->add_control(new WP_Customize_Control($wp_customize,'\n bluegymn-main-callout-message-control',array(\n 'label'=>'Welcome Message',\n 'section'=>'bluegymn-main-callout-section',\n 'settings'=>'bluegymn-main-callout-message',\n 'type'=>'textarea'\n )));\n $wp_customize->add_setting('bluegymn-cta-button-text',array(\n 'default'=>\"Start Now\"\n ));\n\n $wp_customize->add_control(new WP_Customize_Control($wp_customize,'\n bluegymn-cta-button-text-control',array(\n 'label'=>'Button Text',\n 'section'=>'bluegymn-main-callout-section',\n 'settings'=>'bluegymn-cta-button-text',\n 'type'=>'textarea'\n )));\n}",
"function cp_custom_css($hook)\n {\n if (isset($_GET['page']) && 'cp_customizer' === $_GET['page']) {\n echo '<style>\n\t\t\t #adminmenuwrap,\n\t\t\t #adminmenuback,\n\t\t\t #wpadminbar,\n\t\t\t #wpfooter,\n\t\t\t\t.media-upload-form .notice,\n\t\t\t\t.media-upload-form div.error,\n\t\t\t\t.update-nag,\n\t\t\t\t.updated,\n\t\t\t\t.wrap .notice,\n\t\t\t\t.wrap div.error,\n\t\t\t\t.wrap div.updated,\n\t\t\t\t.notice-warning,\n\t\t\t #wpbody-content .error,\n\t\t\t #wpbody-content .notice {\n\t\t\t\tdisplay: none !important;\n\t\t\t}\n\t\t\t</style>';\n\n // Remove WooCommerce's annoying update message.\n remove_action('admin_notices', 'woothemes_updater_notice');\n\n // Remove admin notices.\n remove_action('admin_notices', 'update_nag', 3);\n }\n }",
"public function on_theme_customizer_load(){\n\t\t$_GET['noheader'] = true;\n\t\tif( !defined( 'IFRAME_REQUEST' ) ){\n\t\t\tdefine( 'IFRAME_REQUEST', true );\n\t\t}\n\t\t\n\t\t// Add the action to the footer to output the modal window.\n add_action( 'admin_footer', array( $this, 'tax_selection_modal' ) );\n\t\t\n\t\t// if saving action wasn't triggered, stop\n\t\tif( !isset( $_POST['fa_nonce'] ) ){\n\t\t\treturn;\n\t\t}\n\t\t// check referer\n\t\tif( !check_admin_referer('fa-save-color-scheme', 'fa_nonce') ){\n\t\t\twp_die( __( 'Nonce error, please try again.', 'fapro') );\n\t\t}\n\t\t\n\t\trequire_once fa_get_path('includes/admin/libs/class-fa-theme-editor.php');\n\t\t$editor = new FA_Theme_Editor( $_POST['theme'] );\n\t\tif( !isset( $_GET['color'] ) || empty( $_GET['color'] ) ){\n\t\t\t$edit = false;\t\t\t\n\t\t}else{\n\t\t\t$edit = $_GET['color'];\n\t\t}\n\t\t\n\t\t$result = $editor->save_color_scheme( $_POST['color_name'] , $edit, $_POST );\n\t\t\n\t\tif( is_wp_error( $result ) ){\n\t\t\t$message = $result->get_error_message();\n\t\t\twp_die( $message );\t\t\t\t\n\t\t}else{\n\t\t\t$redirect = add_query_arg( array(\n\t\t\t\t'theme' => $_POST['theme'],\n\t\t\t\t'color' => $result\n\t\t\t), menu_page_url('fa-theme-customizer', false));\n\t\t\twp_redirect( $redirect );\n\t\t\tdie();\n\t\t}\t\t\t\t\n\t}",
"function riiskit_theme_customizer( $wp_customize ) {\n\t$wp_customize->remove_section( 'colors' );\n\t$wp_customize->remove_section( 'background_image' );\n\t$wp_customize->remove_section( 'static_front_page' );\n\n\n\t// MOBILE\n\t// Mobile sidr.js menu on/off\n\t$wp_customize->add_section('developer' , array(\n\t\t'title' => __('Developer', 'riiskit'),\n\t\t'priority' => 2,\n\t\t'description' => __( 'Options for the developer.', 'riiskit' ),\n\t) );\n\t// toggle/slideout selection\n\t$wp_customize->add_setting('developer_menu_type', array(\n\t\t'default' => 'toggle-menu',\n\t\t'type' => 'option',\n\t\t'capability' => 'activate_plugins',\n\t\t'sanitize_callback', 'riiskit_sanitize_menu_type',\n\t) );\n\t$wp_customize->add_control('developer_menu_type', array(\n\t\t'label' => __('Menutype', 'riiskit'),\n\t\t'section' => 'developer',\n\t\t'settings' => 'developer_menu_type',\n\t\t'type' => 'select',\n\t\t'choices' => array(\n 'toggle-menu' => 'Toggle',\n 'slideout-menu' => 'Slideout',\n ),\n\t) );\n\n\n\t// SOCIAL\n\t$wp_customize->add_section( 'social', array(\n\t\t'title' => __( 'Social', 'riiskit' ),\n\t\t'description' => __('Add links to your social profiles.', 'riiskit'),\n\t\t'priority' => 135,\n\t) );\n\t$social_links = array();\n // Facebook\n\t$social_links[] = array(\n 'slug'\t=> 'social_facebook_link',\n 'label'\t=> 'Facebook',\n );\n\t// Twitter\n $social_links[] = array(\n 'slug'\t=> 'social_twitter_link',\n\t\t'label'\t=> 'Twitter',\n );\n foreach( $social_links as $link ) {\n\t\t// SETTINGS\n\t\t$wp_customize->add_setting( $link['slug'], array(\n 'type' => 'option',\n\t\t\t'sanitize_callback' => 'riiskit_sanitize_url',\n ) );\n // CONTROLS\n $wp_customize->add_control( $link['slug'], array(\n\t\t\t'label' => $link['label'],\n\t\t\t'section' => 'social',\n\t\t\t'settings' => $link['slug'],\n\t\t\t'type' => 'text',\n\t\t) );\n\t}\n}",
"function _cp_enqueue_customizer_color_previewer() {\n\tglobal $cp_options;\n\n\t$suffix_js = cp_get_enqueue_suffix();\n\n\twp_enqueue_script( 'cp_themecustomizer', get_template_directory_uri().\"/includes/js/theme-customizer{$suffix_js}.js\", array( 'customize-controls' ), CP_VERSION, true );\n\n\t$params = array(\n\t\t'color_scheme' => $cp_options->stylesheet,\n\t\t'colors' => cp_get_customizer_color_defaults('all'),\n\t);\n\n\twp_localize_script( 'cp_themecustomizer', 'customizer_params', $params );\n}",
"function Blanche_customize_cta($wp_customize) {\n $wp_customize->add_panel('frontpagesections',array(\n 'title' => __('Front Page Sections','Blanche'),\n 'priority' => 10,\n 'capability'=>'edit_theme_options'\n )); \n \n $wp_customize->add_section('cta',array(\n 'title' => __('Call To Action section','Blanche'),\n 'description' => sprintf(__('Customize the Call To Action Section','Blanche')),\n 'priority' => 130,\n 'panel'=>'frontpagesections'\n )); \n \n //Give Admin choice of displaying this section or not\n $wp_customize->add_setting('Cta_Section_Display', array(\n \n 'default' => _x('No','Blanche'),\n 'type' => 'theme_mod'\n \n ));\n \n $wp_customize->add_control('Cta_Section_Display', array(\n \n 'label' => __('Do you want to display this section?','Blanche'),\n 'section' => 'cta',\n 'settings'=>'Cta_Section_Display',\n 'type'=>'radio',\n 'choices'=>array('No'=>'No','Yes'=>'Yes'),\n 'priority' => 1\n \n ));\n \n \n \n $wp_customize->add_setting('cta_image', array(\n \n 'default' => get_bloginfo('template_directory').'/assets/img/shop.jpg',\n 'capability' => 'edit_theme_options',\n \n \n ));\n \n $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize,'cta_image',array(\n \n 'label' => __('CTA Background Image','Blanche'),\n 'section' => 'cta',\n 'settings'=>'cta_image',\n 'priority' => 2\n \n \n )));\n \n $wp_customize->add_setting('cta_headline', array(\n \n 'default' => _x('Looking For The Perfect Holiday?','Blanche'),\n 'type' => 'theme_mod'\n \n ));\n \n $wp_customize->add_control('cta_headline', array(\n 'label' => __('CTA Headline','Blanche'),\n 'section' => 'cta',\n 'priority' => 3\n \n ));\n\n $wp_customize->add_setting('cta_text', array(\n \n 'default' => _x('We have amazing packages for every budget. Talk to us today','Blanche'),\n 'type' => 'theme_mod'\n \n ));\n \n $wp_customize->add_control('cta_text', array(\n 'label' => __('CTA Subtext','Blanche'),\n 'section' => 'cta',\n 'priority' => 4\n \n ));\n\n $wp_customize->add_setting('cta_button', array(\n \n 'default' => _x('Book Now','Blanche'),\n 'type' => 'theme_mod'\n \n ));\n \n $wp_customize->add_control('cta_button', array(\n 'label' => __('CTA Button Text','Blanche'),\n 'section' => 'cta',\n 'priority' => 5\n \n ));\n \n $wp_customize->add_setting('cta_button_link');\n \n $wp_customize->add_control('cta_button_link', array(\n 'label' => __('CTA Button Page Link','Blanche'),\n 'section' => 'cta',\n 'type'=>'dropdown-pages',\n 'priority' => 6\n \n ));\n\n\n \n \n\n \n }",
"function prefix_customizer_register( $wp_customize ) { \n \n /* -----------------------------------------------------------------------------\n \n PANELS\n \n ----------------------------------------------------------------------------- */\n \n /* This creats a Panel called Theme Options */\n\t$wp_customize->add_panel( 'panel_id', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'Theme Options', 'textdomain' ),\n\t 'description' => __( 'This panel is used to change settings of Sharp Theme v1.', 'textdomain' ),\n\t) );\n \n /* -----------------------------------------------------------------------------\n \n SECTIONS\n \n ----------------------------------------------------------------------------- */\n \n /* This creates a Section called About */\n\t$wp_customize->add_section( 'section_about', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'About', 'textdomain' ),\n\t 'description' => '',\n\t 'panel' => 'panel_id',\n\t) );\n \n /* This creates a Section called Background */\n $wp_customize->add_section( 'section_background', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'Background', 'textdomain' ),\n\t 'description' => '',\n\t 'panel' => 'panel_id',\n\t) );\n \n /* This creates a Section called Call to Action */\n $wp_customize->add_section( 'section_cta', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'Call to Action', 'textdomain' ),\n\t 'description' => 'To hide the call to action bar on your site simply leave the values below empty.',\n\t 'panel' => 'panel_id',\n\t) );\n \n /* This creates a Section called Hero */\n $wp_customize->add_section( 'section_hero', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'Hero', 'textdomain' ),\n\t 'description' => 'Greet your users to your homepage with a large image and some welcome text.',\n\t 'panel' => 'panel_id',\n\t) );\n \n /* This creates a Section called Image Well */\n $wp_customize->add_section( 'section_well', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'Image Well', 'textdomain' ),\n\t 'description' => 'The Image Well sits above the Footer and below the Call to Action bar. To hide the Image Well leave the values below empty.',\n\t 'panel' => 'panel_id',\n\t) );\n \n /* This creates a Section called Layout */\n $wp_customize->add_section( 'section_layout', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'Layout', 'textdomain' ),\n\t 'description' => 'Change the layout to suit your needs.',\n\t 'panel' => 'panel_id',\n\t) );\n \n /* This creates a Section called Social Media */\n $wp_customize->add_section( 'section_social', array(\n\t 'priority' => 10,\n\t 'capability' => 'edit_theme_options',\n\t 'theme_supports' => '',\n\t 'title' => __( 'Social Media', 'textdomain' ),\n\t 'description' => '',\n\t 'panel' => 'panel_id',\n\t) );\n \n /* -----------------------------------------------------------------------------\n \n SETTINGS & CONTROL\n \n ----------------------------------------------------------------------------- */\n \n /*------------------------------------*\\\n SOCIAL\n \\*------------------------------------*/\n \n /* This creates a Setting called url_field_id */\n $wp_customize->add_setting( 'social_facebook', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n /* This Controls url_field_id */\n $wp_customize->add_control( 'social_facebook', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Facebook', 'textdomain' ),\n 'description' => 'Enter your Facebook URL here',\n ) );\n \n $wp_customize->add_setting( 'social_twitter', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_twitter', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Twitter', 'textdomain' ),\n 'description' => 'Enter your Twitter URL here',\n ) );\n \n $wp_customize->add_setting( 'social_googleplus', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_googleplus', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Google Plus', 'textdomain' ),\n 'description' => 'Enter your Google Plus URL here',\n ) );\n \n /* This creates a Setting called url_field_id */\n $wp_customize->add_setting( 'social_youtube', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n /* This Controls url_field_id */\n $wp_customize->add_control( 'social_youtube', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Youtube', 'textdomain' ),\n 'description' => 'Enter your Youtube URL here',\n ) );\n \n $wp_customize->add_setting( 'social_instagram', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_instagram', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Instagram', 'textdomain' ),\n 'description' => 'Enter your Instagram URL here',\n ) );\n \n $wp_customize->add_setting( 'social_twitch', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_twitch', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Twitch', 'textdomain' ),\n 'description' => 'Enter your Twitch URL here',\n ) );\n \n $wp_customize->add_setting( 'social_youtube', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_youtube', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'YouTube', 'textdomain' ),\n 'description' => 'Enter your YouTube URL here',\n ) );\n \n $wp_customize->add_setting( 'social_tumblr', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_tumblr', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Tumblr', 'textdomain' ),\n 'description' => 'Enter your Tumblr URL here',\n ) );\n \n $wp_customize->add_setting( 'social_pinterest', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_pinterest', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Pinterest', 'textdomain' ),\n 'description' => 'Enter your Pinterest URL here',\n ) );\n \n $wp_customize->add_setting( 'social_skype', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_skype', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Skype', 'textdomain' ),\n 'description' => 'Enter your Skype URL here',\n ) );\n \n $wp_customize->add_setting( 'social_dribbble', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_dribbble', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Dribbble', 'textdomain' ),\n 'description' => 'Enter your Dribbble URL here',\n ) );\n \n $wp_customize->add_setting( 'social_rss', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_rss', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'RSS', 'textdomain' ),\n 'description' => 'Enter your RSS URL here',\n ) );\n \n $wp_customize->add_setting( 'social_soundcloud', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'social_soundcloud', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Sound Cloud', 'textdomain' ),\n 'description' => 'Enter your Sound Cloud URL here',\n ) );\n \n /* This creates a Setting called url_field_id */\n $wp_customize->add_setting( 'social_linkedin', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n /* This Controls url_field_id */\n $wp_customize->add_control( 'social_linkedin', array(\n 'type' => 'url',\n 'priority' => 10,\n 'section' => 'section_social',\n 'label' => __( 'Linked-In', 'textdomain' ),\n 'description' => 'Enter your Linked-In URL here',\n ) );\n \n /*------------------------------------*\\\n BACKGROUND\n \\*------------------------------------*/\n \n $wp_customize->add_setting('background_image');\n \n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'background_image', array(\n 'label' => 'Background Image',\n 'section' => 'section_background',\n 'settings' => 'background_image',\n 'description' => 'Display a background image on every page of the website.',\n ) ) );\n \n /*------------------------------------*\\\n IMAGE WELL\n \\*------------------------------------*/\n \n $wp_customize->add_setting('well_1');\n $wp_customize->add_setting('well_2');\n $wp_customize->add_setting('well_3');\n $wp_customize->add_setting('well_4');\n $wp_customize->add_setting('well_5');\n $wp_customize->add_setting('well_6');\n\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'well_1', array(\n 'label' => 'Well Image #1',\n 'section' => 'section_well',\n 'settings' => 'well_1',\n 'description' => '',\n ) ) );\n \n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'well_2', array(\n 'label' => 'Well Image #2',\n 'section' => 'section_well',\n 'settings' => 'well_2',\n 'description' => '',\n ) ) );\n \n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'well_3', array(\n 'label' => 'Well Image #3',\n 'section' => 'section_well',\n 'settings' => 'well_3',\n 'description' => '',\n ) ) );\n \n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'well_4', array(\n 'label' => 'Well Image #4',\n 'section' => 'section_well',\n 'settings' => 'well_4',\n 'description' => '',\n ) ) );\n \n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'well_5', array(\n 'label' => 'Well Image #5',\n 'section' => 'section_well',\n 'settings' => 'well_5',\n 'description' => '',\n ) ) );\n \n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'well_6', array(\n 'label' => 'Well Image #6',\n 'section' => 'section_well',\n 'settings' => 'well_6',\n 'description' => '',\n ) ) );\n \n /*------------------------------------*\\\n HERO\n \\*------------------------------------*/\n \n $wp_customize->add_setting( 'hero_text', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_textarea',\n ) );\n \n $wp_customize->add_control( 'hero_text', array(\n 'type' => 'textarea',\n 'priority' => 10,\n 'section' => 'section_hero',\n 'label' => __( 'Hero Text', 'textdomain' ),\n 'description' => 'Add a custom welcome message to your homepage ',\n ) );\n \n $wp_customize->add_setting('hero_image');\n \n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_image', array(\n 'label' => 'Hero Image',\n 'section' => 'section_hero',\n 'settings' => 'hero_image',\n 'description' => '',\n ) ) );\n \n /*------------------------------------*\\\n CALL TO ACTION\n \\*------------------------------------*/\n \n $wp_customize->add_setting( 'cta_text', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_textarea',\n ) );\n \n $wp_customize->add_control( 'cta_text', array(\n 'type' => 'textarea',\n 'priority' => 10,\n 'section' => 'section_cta',\n 'label' => __( 'Call to Action Text', 'textdomain' ),\n 'description' => 'This is the Call to Action bar it appears on every page above the footer. Use it promote content! ',\n ) );\n \n $wp_customize->add_setting( 'cta_button', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_textarea',\n ) );\n \n $wp_customize->add_control( 'cta_button', array(\n 'type' => 'textarea',\n 'priority' => 20,\n 'section' => 'section_cta',\n 'label' => __( 'Call to Action Button', 'textdomain' ),\n 'description' => 'Keep the button text short and try to make it as appealing as possible.',\n ) );\n \n $wp_customize->add_setting( 'cta_link', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_url',\n ) );\n \n $wp_customize->add_control( 'cta_link', array(\n 'type' => 'url',\n 'priority' => 30,\n 'section' => 'section_cta',\n 'label' => __( 'Call to Action Link', 'textdomain' ),\n 'description' => 'Enter the link of the URL you want your visitors to see.',\n ) );\n \n /*------------------------------------*\\\n ABOUT SECTION\n \\*------------------------------------*/\n \n $wp_customize->add_setting( 'textarea_field_id', array(\n 'default' => '',\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => '',\n 'sanitize_callback' => 'esc_textarea',\n ) );\n \n $wp_customize->add_control( 'textarea_field_id', array(\n 'type' => 'textarea',\n 'priority' => 10,\n 'section' => 'section_about',\n 'label' => __( 'About Me', 'textdomain' ),\n 'description' => 'The about me box will appear on every page of the website. Keep it short and keep it interesting.',\n ) );\n\n $wp_customize->add_setting('about_image');\n\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'your_theme_logo', array(\n 'label' => 'About Image',\n 'section' => 'section_about',\n 'settings' => 'about_image',\n 'description' => 'This image will appear on every page of the website. Take a picture of yourself and dont forget the smile.',\n ) ) );\n \n /*------------------------------------*\\\n LAYOUT OPTIONS\n \\*------------------------------------*/\n \n $wp_customize->add_setting( 'sharp_theme_style', array(\n 'capability' => 'edit_theme_options',\n 'default' => 'style1',\n ) );\n \n $wp_customize->add_control( 'sharp_theme_style', array(\n 'type' => 'radio',\n 'section' => 'section_layout', // Add a default or your own section\n 'label' => __( 'Layout Style' ),\n 'description' => __( 'There are three options available for this theme.' ),\n 'choices' => array(\n 'style1' => __( 'Default' ),\n 'style2' => __( 'Card Design' ),\n 'style3' => __( 'Boxed Design' ),\n ), ) );\n \n $wp_customize->add_setting( 'sharp_theme_featured', array(\n 'capability' => 'edit_theme_options',\n 'default' => 'featured-layout-1',\n ) );\n \n $wp_customize->add_control( 'sharp_theme_featured', array(\n 'type' => 'radio',\n 'section' => 'section_layout', // Add a default or your own section\n 'label' => __( 'Featured Layout' ),\n 'description' => __( 'There are three options available for this theme.' ),\n 'choices' => array(\n 'featured-layout-1' => __( 'Default' ),\n 'featured-layout-2' => __( 'Layout 2' ),\n ), ) );\n\n }",
"function twentytwenty_customize_preview_init() {\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\n\twp_enqueue_script( 'twentytwenty-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $theme_version, true );\n\twp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );\n\twp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyPreviewEls', twentytwenty_get_elements_array() );\n\n\twp_add_inline_script(\n\t\t'twentytwenty-customize-preview',\n\t\tsprintf(\n\t\t\t'wp.customize.selectiveRefresh.partialConstructor[ %1$s ].prototype.attrs = %2$s;',\n\t\t\twp_json_encode( 'cover_opacity' ),\n\t\t\twp_json_encode( twentytwenty_customize_opacity_range() )\n\t\t)\n\t);\n}",
"function td_register_customizer($wp_customize) {\n $td_customizer = new td_customizer_wrap($wp_customize);\n $td_customizer->render(td_util::$td_customizer_settings->get_map());\n\n}",
"function aniline_customizer_register( $wp_customize ) {\r\n\tclass Aniline_Textarea_Control extends WP_Customize_Control {\r\n\t public $type = 'textarea';\r\n\r\n\t public function render_content() {\r\n\t ?>\r\n\t <label>\r\n\t <span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\r\n\t <textarea rows=\"5\" style=\"width:100%;\" <?php $this->link(); ?>>\r\n\t \t<?php echo esc_textarea( $this->value() ); ?>\r\n\t </textarea>\r\n\t </label>\r\n\t <?php\r\n\t }\r\n\t}\r\n\r\n\t// Excerpts\r\n\t$wp_customize->add_section( 'aniline_excerpts', array(\r\n\t\t'title' => __( 'Estractos', 'aniline' ),\r\n 'priority' => 200\r\n ) );\r\n\r\n\t$wp_customize->add_setting( 'aniline-theme[display_excerpts]', array(\r\n \t'default' => false,\r\n \t'type' => 'option'\r\n\t) );\r\n\r\n $wp_customize->add_control( 'display_excerpts', array(\r\n 'label' => __( 'Mostrar extractos en los archivos', 'aniline' ),\r\n 'section' => 'aniline_excerpts',\r\n\t\t'settings' => 'aniline-theme[display_excerpts]',\r\n\t\t'type' => 'checkbox'\r\n ) );\r\n\r\n}",
"function hbd_disable_customizer_cs_defaults(){\n\t$options \t= array(); // for removing customizer defaults by cs framework\t\n\treturn $options;\n}",
"function header_footer_color_customizer($wp_customize) {\n\t$default_menu_bgcolor = \"#ffd480\";\n\t$default_menu_textcolor = \"#811b4d\";\n\t$default_theme_bgcolor1 = \"#ff9999\";\n\n\t$wp_customize->add_setting('themename_menu_bgcolor', array(\n\t\t'default' => $default_menu_bgcolor,\n\t\t'wp-head-callback' => 'scm_test_style',\n\t\t'transport' => 'postMessage'\n\t));\n\t$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'themename_menu_bgcolor', array(\n\t\t'label' => 'Menu Background Color',\n\t\t'section' => 'colors',\n\t\t'settings' => 'themename_menu_bgcolor',\n\t)));\n\t$wp_customize->add_setting('themename_menu_textcolor', array(\n\t\t'default' => $default_menu_textcolor,\n\t\t'wp-head-callback' => 'scm_test_style',\n\t\t'transport' => 'postMessage'\n\t));\n\t$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'themename_menu_textcolor', array(\n\t\t'label' => 'Text Color',\n\t\t'section' => 'colors',\n\t\t'settings' => 'themename_menu_textcolor',\n\t)));\n\t$wp_customize->add_setting('themename_theme_bgcolor', array(\n\t\t'default' => $default_theme_bgcolor1,\n\t\t'wp-head-callback' => 'scm_test_style',\n\t\t'transport' => 'postMessage'\n\t));\n\t$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'themename_theme_bgcolor', array(\n\t\t'label' => 'Theme Background Color1',\n\t\t'section' => 'colors',\n\t\t'settings' => 'themename_theme_bgcolor',\n\t)));\n\n}",
"public function init() {\n\t\tparent::init();\n\t\tadd_action( 'customize_preview_init', array( $this, 'enqueue_customizer_script' ) );\n\t}",
"function holyarchers_customize_preview_js() {\n\twp_enqueue_script( 'holyarchers_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function chapter_footer_callout($wp_customize) {\r\n\r\n\t$wp_customize->add_section('cht-footer-callout-section', array(\r\n\t\t'title' => 'Footer Callout'\r\n\t));\r\n\r\n\t/* Footer Callout Display */\r\n\t$wp_customize->add_setting('cht-footer-callout-display', array(\r\n\t\t'default' => 'No'\r\n\t));\r\n\r\n\t$wp_customize->add_control( new WP_Customize_Control($wp_customize, 'cht-footer-callout-display-control', array(\r\n\t\t'label' => 'Display this section?',\r\n\t\t'section' => 'cht-footer-callout-section',\r\n\t\t'settings' => 'cht-footer-callout-display',\r\n\t\t'type'\t=> 'select',\r\n\t\t'choices'\t=> array('No' => 'No', 'Yes' => 'Yes')\r\n\t)));\r\n\r\n\t/* Footer Callout Headline */\r\n\t$wp_customize->add_setting('cht-footer-callout-headline', array(\r\n\t\t'default' => 'Example Headline Text!'\r\n\t));\r\n\r\n\t$wp_customize->add_control( new WP_Customize_Control($wp_customize, 'cht-footer-callout-headline-control', array(\r\n\t\t'label' => 'Headline',\r\n\t\t'section' => 'cht-footer-callout-section',\r\n\t\t'settings' => 'cht-footer-callout-headline'\r\n\t)));\r\n\r\n\t/* Footer Callout Textarea */\r\n\t$wp_customize->add_setting('cht-footer-callout-text', array(\r\n\t\t'default' => 'Example paragraph text.'\r\n\t));\r\n\r\n\t$wp_customize->add_control( new WP_Customize_Control($wp_customize, 'cht-footer-callout-text-control', array(\r\n\t\t'label' => 'Headline',\r\n\t\t'section' => 'cht-footer-callout-section',\r\n\t\t'settings' => 'cht-footer-callout-text',\r\n\t\t'type'\t=> 'textarea'\r\n\t)));\r\n\r\n\t/* Footer Callout Dropdown Pages */\r\n\t$wp_customize->add_setting('cht-footer-callout-link');\r\n\r\n\t$wp_customize->add_control( new WP_Customize_Control($wp_customize, 'cht-footer-callout-link-control', array(\r\n\t\t'label' => 'Link',\r\n\t\t'section' => 'cht-footer-callout-section',\r\n\t\t'settings' => 'cht-footer-callout-link',\r\n\t\t'type'\t=> 'dropdown-pages'\r\n\t)));\r\n\r\n\t/* Footer Callout Image */\r\n\t$wp_customize->add_setting('cht-footer-callout-image');\r\n\r\n\t$wp_customize->add_control( new WP_Customize_Cropped_Image_Control($wp_customize, 'cht-footer-callout-image-control', array(\r\n\t\t'label' => 'Image',\r\n\t\t'section' => 'cht-footer-callout-section',\r\n\t\t'settings' => 'cht-footer-callout-image',\r\n\t\t'width' => 750,\r\n\t\t'height' => 500\r\n\t)));\r\n\r\n\r\n}",
"function maidesign_register_theme_customizer( $wp_customize ) {\r\n \t\r\n\t// Add Sections\r\n\t\r\n\t$wp_customize->add_section( 'maidesign_new_section_custom_css' , array(\r\n \t\t'title' => 'Custom CSS',\r\n \t\t'description'=> 'Add your custom CSS which will overwrite the theme CSS',\r\n \t\t'priority' => 103,\r\n\t) );\r\n\t\r\n\t$wp_customize->add_section( 'maidesign_new_section_footer' , array(\r\n \t\t'title' => 'Footer Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 97,\r\n\t) );\r\n\t\r\n\t$wp_customize->add_section( 'maidesign_new_section_social' , array(\r\n \t\t'title' => 'Social Settings',\r\n \t\t'description'=> 'Enter your social media usernames. Icons will not show if left blank.',\r\n \t\t'priority' => 96,\r\n\t) );\r\n\r\n\t$wp_customize->add_section( 'maidesign_new_section_page' , array(\r\n \t\t'title' => 'Page Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 95,\r\n\t) );\r\n\t\r\n\t$wp_customize->add_section( 'maidesign_new_section_post' , array(\r\n \t\t'title' => 'Post Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 94,\r\n\t) );\r\n\r\n $wp_customize->add_section( 'maidesign_new_section_related' , array(\r\n \t\t'title' => 'Related Posts Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 94,\r\n\t) );\r\n\t\r\n\t$wp_customize->add_section( 'maidesign_new_section_logo_header' , array(\r\n \t\t'title' => 'Header Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 92,\r\n\t) );\r\n\r\n\t$wp_customize->add_section( 'maidesign_new_section_promo' , array(\r\n \t\t'title' => 'Promo Box Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 90,\r\n\t) );\r\n\t$wp_customize->add_section( 'maidesign_new_section_carousel' , array(\r\n \t\t'title' => 'Slider area Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 91,\r\n\t) );\r\n\t$wp_customize->add_section( 'maidesign_new_section_general' , array(\r\n \t\t'title' => 'General Settings',\r\n \t\t'description'=> '',\r\n \t\t'priority' => 89,\r\n\t) );\r\n\r\n\t// Add Setting\r\n\t\t\r\n\t\t// General\r\n\t\t$wp_customize->add_setting(\r\n\t\t\t'md_favicon'\r\n\t\t);\r\n\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_blog_layout',\r\n\t array(\r\n\t 'default' => 'list'\r\n\t )\r\n\t ); \r\n\t $wp_customize->add_setting(\r\n\t 'md_background_about_me',\r\n\t array(\r\n\t 'default' => '#F6F6F6'\r\n\t )\r\n\t ); \r\n\t $wp_customize->add_setting(\r\n\t 'md_border_about_me',\r\n\t array(\r\n\t 'default' => '#EEE'\r\n\t )\r\n\t ); \r\n\t // Carousel slider\r\n $wp_customize->add_setting(\r\n\t 'md_show_carousel',\r\n array(\r\n\t 'default' => 'hide'\r\n\t )\r\n\t ); \r\n\r\n $wp_customize->add_setting(\r\n\t 'md_number_slide',\r\n array(\r\n\t 'default' => 5\r\n\t )\r\n\t ); \r\n\t\t\r\n // Related settings\r\n $wp_customize->add_setting(\r\n\t 'md_change_text_related',\r\n\t array(\r\n\t 'default' => 'You may also like'\r\n\t )\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_related_by',\r\n\t array(\r\n\t 'default' => 'cat'\r\n\t )\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_related_order',\r\n\t array(\r\n\t 'default' => 'rand'\r\n\t )\r\n\t ); \r\n \r\n $wp_customize->add_setting(\r\n\t 'md_show_date_related',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t ); \r\n \r\n //Promotion area \r\n\r\n $wp_customize->add_setting(\r\n\t 'md_title_box_1'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_title_box_2'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_title_box_3'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_link_box_1'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_link_box_2'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_link_box_3'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_image_box_1'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_image_box_2'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_image_box_3'\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_hide_promo',\r\n array(\r\n\t 'default' => false\r\n\t )\r\n\t ); \r\n\t $wp_customize->add_setting(\r\n\t 'md_show_only_promo_homepage',\r\n array(\r\n\t 'default' => false\r\n\t )\r\n\t ); \r\n\r\n\t\t// Header & Logo\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_logo'\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_logo_retina'\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_header_padding_top',\r\n\t array(\r\n\t 'default' => '110'\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_header_padding_bottom',\r\n\t array(\r\n\t 'default' => '24'\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_background_menu',\r\n\t array(\r\n\t 'default' => '#F6F6F6'\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_text_menu',\r\n\t array(\r\n\t 'default' => '#343434'\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_border_dropdown',\r\n\t array(\r\n\t 'default' => '#EEE'\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_hover_dropdown',\r\n\t array(\r\n\t 'default' => '#ECECEC'\r\n\t )\r\n\t );\r\n\t\t \r\n\t\t \r\n\t\t// Post Settings\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_font_style',\r\n\t array(\r\n\t 'default' => 'merriweather'\r\n\t )\r\n\t );\r\n\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_bold_title',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_post_date',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_post_date_list',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\t \r\n\t\t$wp_customize->add_setting(\r\n\t 'md_post_tags',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_post_author',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_post_related',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_post_thumb',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n $wp_customize->add_setting(\r\n\t 'md_post_thumb_front_page',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t ); \r\n\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_post_author_name',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_post_cat',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_cat_color',\r\n\t array(\r\n\t 'default' => '#242424'\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_cat_list_color',\r\n\t array(\r\n\t 'default' => '#B1B1B1'\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_link',\r\n\t array(\r\n\t 'default' => '#848484'\r\n\t )\r\n\t );\r\n\t $wp_customize->add_setting(\r\n\t 'md_share_button_color',\r\n\t array(\r\n\t 'default' => '#242424'\r\n\t )\r\n\t );\r\n\t \r\n \r\n\t\t// Page\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_page_date',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n \r\n $wp_customize->add_setting(\r\n\t 'md_page_author_name',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n \r\n\t\t// Social Media\r\n\t\t\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_facebook',\r\n\t array(\r\n\t 'default' => 'mai'\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_twitter',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_instagram',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_pinterest',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_tumblr',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_bloglovin',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_tumblr',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_google',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_youtube',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_rss',\r\n\t array(\r\n\t 'default' => ''\r\n\t )\r\n\t );\r\n\t\t\r\n\t\t// Footer Options\r\n\r\n\t $wp_customize->add_setting(\r\n\t 'md_footer_social',\r\n\t array(\r\n\t 'default' => false\r\n\t )\r\n\t );\r\n\r\n\t\t$wp_customize->add_setting(\r\n\t 'md_footer_copyright',\r\n\t array(\r\n\t 'default' => '© 2016 Your copyright. All Rights Reserved - Designed by <a href=\"http://www.mailovedesign.com\">Mai</a>'\r\n\t )\r\n\t );\t\r\n\t $wp_customize->add_setting(\r\n\t 'md_background_footer',\r\n\t array(\r\n\t 'default' => '#141414'\r\n\t )\r\n\t );\t\r\n\r\n\t $wp_customize->add_setting(\r\n\t 'md_text_footer',\r\n\t array(\r\n\t 'default' => '#C7C7C7'\r\n\t )\r\n\t );\r\n \t\t\r\n\t\t// Custom CSS\r\n\t\t$wp_customize->add_setting(\r\n\t\t\t'md_custom_css'\r\n\t\t);\r\n\r\n // Add Control\r\n\t\r\n\t\t// General\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Image_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'upload_favicon',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Upload Favicon',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_general',\r\n\t\t\t\t\t'settings' => 'md_favicon',\r\n\t\t\t\t\t'priority'\t => 1\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n \t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'blog_layout',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Homepage Layout',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_general',\r\n\t\t\t\t\t'settings' => 'md_blog_layout',\r\n\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t'priority'\t => 2,\r\n\t\t\t\t\t'choices' => array(\r\n\t\t\t\t\t\t'list' => 'First full - Then list',\r\n\t\t\t\t\t\t'normal' => 'Normal'\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'background_about_me',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Background About-me widget',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_general',\r\n\t\t\t\t\t'settings' => 'md_background_about_me',\r\n 'priority'\t => 4\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'border_about_me',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Border About-me widget',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_general',\r\n\t\t\t\t\t'settings' => 'md_border_about_me',\r\n 'priority'\t => 5\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t// Slider settings\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'show_carousel',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Slider Options:',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_carousel',\r\n\t\t\t\t\t'settings' => 'md_show_carousel',\r\n\t\t\t\t\t'type'\t\t => 'radio',\r\n\t\t\t\t\t'priority'\t => 1,\r\n\t\t\t\t\t'choices' => array(\r\n\t\t\t\t\t\t'all' => 'Show all pages',\r\n\t\t\t\t\t\t'only_home' => 'Show only homepage',\r\n\t\t\t\t\t\t'hide'\t=> \"Hide slider\"\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'number_slide',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Number of slide',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_carousel',\r\n\t\t\t\t\t'settings' => 'md_number_slide',\r\n\t\t\t\t\t'type'\t\t => 'number',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t); \r\n\t\t// Header and Logo\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Image_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'upload_logo',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Upload Logo',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_logo_header',\r\n\t\t\t\t\t'settings' => 'md_logo',\r\n\t\t\t\t\t'priority'\t => 6\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew Customize_Number_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'header_padding_top',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Top Header Padding',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_logo_header',\r\n\t\t\t\t\t'settings' => 'md_header_padding_top',\r\n\t\t\t\t\t'type'\t\t => 'number',\r\n\t\t\t\t\t'priority'\t => 8\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew Customize_Number_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'header_padding_bottom',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Bottom Header Padding',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_logo_header',\r\n\t\t\t\t\t'settings' => 'md_header_padding_bottom',\r\n\t\t\t\t\t'type'\t\t => 'number',\r\n\t\t\t\t\t'priority'\t => 9\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t); \r\n\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'background_menu',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Background Menu color',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_logo_header',\r\n\t\t\t\t\t'settings' => 'md_background_menu',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'text_menu',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Text color Menu',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_logo_header',\r\n\t\t\t\t\t'settings' => 'md_text_menu',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'border_dropdown',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Border dropdown menu color',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_logo_header',\r\n\t\t\t\t\t'settings' => 'md_border_dropdown',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'hover_dropdown',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hover dropdown menu color',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_logo_header',\r\n\t\t\t\t\t'settings' => 'md_hover_dropdown',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n //Promotion area\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'title_box_1',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Title box 1',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_title_box_1',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 1\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'title_box_2',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Title box 2',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_title_box_2',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 2\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'title_box_3',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Title box 3',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_title_box_3',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'link_box_1',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Link box 1',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_link_box_1',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 1\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'link_box_2',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Link box 2',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_link_box_2',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 2\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'link_box_3',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Link box 3',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_link_box_3',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Image_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'image_box_1',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Image box 1',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_image_box_1',\r\n\t\t\t\t\t'priority'\t => 1\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Image_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'image_box_2',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Image box 2',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_image_box_2',\r\n\t\t\t\t\t'priority'\t => 2\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Image_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'image_box_3',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Image box 3',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_image_box_3',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'hide_promo',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide Promo Box',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_hide_promo',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 5\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'show_only_promo_homepage',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Show Promo Box only homepage',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_promo',\r\n\t\t\t\t\t'settings' => 'md_show_only_promo_homepage',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 6\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t// Post Settings\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'font_style',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Select font for Heading (Title of post)',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_font_style',\r\n\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t'priority'\t => 2,\r\n\t\t\t\t\t'choices' => array(\r\n\t\t\t\t\t\t'merriweather' => 'Merriweather (serif)',\r\n\t\t\t\t\t\t'montserrat' => 'Montserrat (sans-serif)'\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'bold_title',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'No Bold title of post',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_bold_title',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 2\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_cat',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide Category',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_cat',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 2\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_date',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide date',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_date',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_date_list',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide date at list posts',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_date_list',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_author_name',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide Author Name',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_author_name',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_tags',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide Tags',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_tags',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 4\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_author',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide Author Box',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_author',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 6\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_related',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide Related Posts Box',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_related',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 7\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_thumb',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide Featured Image of Single Sost (Individual post)',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_thumb',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 8\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'post_thumb_front_page',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide All Featured Image of post',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_post_thumb_front_page',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 9\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'cat_color',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Categories color',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_cat_color',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'cat_list_color',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Categories of list color',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_cat_list_color',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'link',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Color for link',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_link',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'share_button_color',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Share button color',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_post',\r\n\t\t\t\t\t'settings' => 'md_share_button_color',\r\n 'priority'\t => 11\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\r\n //Related post settings\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'change_text_related',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Change text: Related',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_related',\r\n\t\t\t\t\t'settings' => 'md_change_text_related',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 8\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'related_by',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Related posts by',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_related',\r\n\t\t\t\t\t'settings' => 'md_related_by',\r\n\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t'priority'\t => 9,\r\n\t\t\t\t\t'choices' => array(\r\n\t\t\t\t\t\t'cat' => 'Categories',\r\n\t\t\t\t\t\t'tag' => 'Tags'\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'related_order',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Order of Related posts',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_related',\r\n\t\t\t\t\t'settings' => 'md_related_order',\r\n\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t'priority'\t => 10,\r\n\t\t\t\t\t'choices' => array(\r\n\t\t\t\t\t\t'rand' => 'random',\r\n\t\t\t\t\t\t'date' => 'Date'\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'show_date_related',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Show date at bottom of related posts',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_related',\r\n\t\t\t\t\t'settings' => 'md_show_date_related',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 11\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t// Page\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'page_date',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide date',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_page',\r\n\t\t\t\t\t'settings' => 'md_page_date',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 2\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n $wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'page_author_name',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Hide author name',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_page',\r\n\t\t\t\t\t'settings' => 'md_page_author_name',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n\t\t// Social Media\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'facebook',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Facebook',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_facebook',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 1\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'twitter',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Twitter',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_twitter',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 2\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'instagram',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Instagram',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_instagram',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 3\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'pinterest',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Pinterest',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_pinterest',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 4\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'bloglovin',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Bloglovin',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_bloglovin',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 5\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'google',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Google Plus',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_google',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 6\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'tumblr',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Tumblr',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_tumblr',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 7\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'youtube',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Youtube',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_youtube',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 8\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'rss',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'RSS Link',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_social',\r\n\t\t\t\t\t'settings' => 'md_rss',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 8\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t// Footer\r\n\t\t\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'footer_social',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Disable Footer Social',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_footer',\r\n\t\t\t\t\t'settings' => 'md_footer_social',\r\n\t\t\t\t\t'type'\t\t => 'checkbox',\r\n\t\t\t\t\t'priority'\t => 1\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'footer_copyright',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Footer Copyright Text',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_footer',\r\n\t\t\t\t\t'settings' => 'md_footer_copyright',\r\n\t\t\t\t\t'type'\t\t => 'text',\r\n\t\t\t\t\t'priority'\t => 7\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t); \r\n \t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'background_footer',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Background color of footer copyright',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_footer',\r\n\t\t\t\t\t'settings' => 'md_background_footer',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\t\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew WP_Customize_Color_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'text_footer',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Text color copyright',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_footer',\r\n\t\t\t\t\t'settings' => 'md_text_footer',\r\n 'priority'\t => 10\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\t\t\r\n\t\t\t\r\n\t\t// Custom CSS\r\n\t\t$wp_customize->add_control(\r\n\t\t\tnew Customize_CustomCss_Control(\r\n\t\t\t\t$wp_customize,\r\n\t\t\t\t'custom_css',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' => 'Custom CSS',\r\n\t\t\t\t\t'section' => 'maidesign_new_section_custom_css',\r\n\t\t\t\t\t'settings' => 'md_custom_css',\r\n\t\t\t\t\t'type'\t\t => 'custom_css',\r\n\t\t\t\t\t'priority'\t => 1\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n \r\n\t\r\n\t\t\r\n\t\r\n\r\n\t// Remove Sections\r\n\t$wp_customize->remove_section( 'title_tagline');\r\n\t$wp_customize->remove_section( 'nav');\r\n\t$wp_customize->remove_section( 'static_front_page');\r\n\t$wp_customize->remove_section( 'colors');\r\n\t$wp_customize->remove_section( 'background_image');\r\n\t\r\n \r\n}",
"function mdlwp_customize_preview_js() {\n\twp_enqueue_script( 'mdlwp_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}",
"function blueronald_customize_register( $wp_customize ) {\r\r\n\r\r\n\t$wp_customize->add_section(\r\r\n\t\t'blueronald_display_options',\r\r\n\t\tarray(\r\r\n\t\t\t'title' => 'Theme Options',\r\r\n\t\t\t'priority' => 200\r\r\n\t\t)\r\r\n\t);\r\r\n\r\r\n\t// logo control start\t\r\r\n\t$wp_customize->add_setting('blueronald_logo');\r\r\n\r\r\n\t$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blueronald_logo', array(\r\r\n\t 'label' => __( 'Logo', 'blueronald' ),\r\r\n\t 'section' => 'blueronald_display_options',\r\r\n\t 'settings' => 'blueronald_logo',\r\r\n\t 'sanitize_callback' => 'esc_url_raw'\r\r\n\t) ) );\r\r\n\t// logo control end\t\r\r\n\t\t\t\t\r\r\n\t// 2. control text start\t\r\r\n\t$wp_customize->add_setting(\r\r\n\t\t'blueronald_display_cpm',\r\r\n\t\tarray(\r\r\n\t\t\t'default' => 'Copyright © by ',\r\r\n\t\t\t'transport' => 'postMessage',\t\r\r\n\t\t\t'sanitize_callback' => 'blueronald_sanitize_text',\t\t\r\r\n\t\t)\r\r\n\t);\r\r\n\r\r\n\t$wp_customize->add_control(\r\r\n\t\t'blueronald_display_cpm',\r\r\n\t\tarray(\r\r\n\t\t\t'section' => 'blueronald_display_options',\r\r\n\t\t\t'label' => 'Set Copyright message',\r\r\n\t\t\t'type' => 'text'\r\r\n\t\t)\r\r\n\t);\r\r\n\t// 2. control text end\r\r\n}",
"function wpexpert_customize_preview_js() {\n\twp_enqueue_script( 'wpexpert-customizer', get_template_directory_uri() . '/asset/js/customizer.js', array( 'customize-preview' ), '20151215', true );\n}",
"public function add_customize_preview_styles() {\n\t\t?>\n\t\t/* Text meant only for screen readers; this is needed for wp.a11y.speak() */\n\t\t.screen-reader-text {\n\t\t\tborder: 0;\n\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t\t-webkit-clip-path: inset(50%);\n\t\t\tclip-path: inset(50%);\n\t\t\theight: 1px;\n\t\t\tmargin: -1px;\n\t\t\toverflow: hidden;\n\t\t\tpadding: 0;\n\t\t\tposition: absolute;\n\t\t\twidth: 1px;\n\t\t\tword-wrap: normal !important;\n\t\t}\n\t\tbody.wp-customizer-unloading {\n\t\t\topacity: 0.25 !important; /* Because AMP sets body to opacity:1 once layout complete. */\n\t\t}\n\t\t<?php\n\t}"
] | [
"0.6325553",
"0.60814804",
"0.60780275",
"0.60554135",
"0.60443664",
"0.59824246",
"0.59750885",
"0.59532",
"0.59501064",
"0.592437",
"0.59158516",
"0.59089637",
"0.5826754",
"0.58249116",
"0.5822883",
"0.58131886",
"0.57884073",
"0.5765914",
"0.5765477",
"0.5762707",
"0.5755162",
"0.5754923",
"0.57484907",
"0.57204306",
"0.57052517",
"0.56934035",
"0.5674268",
"0.56734383",
"0.5671029",
"0.56673753"
] | 0.6535113 | 0 |
Get the Period that matches the current date. | public function getCurrentPeriod()
{
return $this->getPeriod($this->date);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getCurrentPeriod()\n {\n $date = Period::getCurPeriodDate();\n $oPeriod = PeriodTable::getInstance()->findOneByDate($date);\n\n if (!($oPeriod instanceof Period)) {\n // выставить новые тарифы на новый период\n UserTable::setNewTariffs();\n\n $oPeriod = new Period();\n // вычислить стоимость 1к знаков\n if (($prev = Period::getPrevPeriod()) === false) {\n $price1k = SettingTable::getOptionByName('price1k')->getValue();\n } else {\n // рассчитать веса пользователей\n UserTable::countWeights($prev);\n if (($price1k = VoteTable::getVoted1k($prev)) === false) {\n $price1k = $prev->get1k();\n }\n }\n $oPeriod->set1k(number_format((float)$price1k, 2));\n // выставить процент\n $oPeriod->setR2rShare(number_format(Setting::getValueByName('percent_r2r'), 2, '.', ''));\n // --\n $oPeriod->setDate($date);\n $oPeriod->save();\n //throw new sfException('Cannot get current period. Error in DB data');\n }\n\n return $oPeriod;\n }",
"function current_payperiod() {\n\n\t$date = date('U');\n\n\treturn date_to_payperiod($date);\n}",
"public static function definePayPeriod($currentDate)\r\n {\r\n $referenceDate = new DateTime(REFERENCE_DATE);\r\n $dayOne = new DateTime($currentDate->format('Y-m-d'));\r\n $dayOne->setTime(8, 00, 00);\r\n\r\n $interval = intval(($dayOne->diff($referenceDate, TRUE)->format('%R%a')));\r\n\r\n $i = 0;\r\n while (($interval % 14) != 0) // If i have done my logic correctly, this will find the first\r\n { // day of the pay period prior to the user selected first day.\r\n $dayOne->modify(\"-1 day\");\r\n $interval = intval(($dayOne->diff($referenceDate, TRUE)->format('%R%a')));\r\n $i++;\r\n if ($i > 20)\r\n {\r\n Messages::setMsg('There was a problem finding the first day of the pay period', 'error');\r\n echo \"<META http-equiv='refresh' content='0;URL=\" . ROOT_URL . \"employees'>\";\r\n die();\r\n }\r\n }\r\n\r\n $middleDayObject = new DateTime($dayOne->format('Y-m-d'));\r\n $middleDayObject->add(new DateInterval('P7D'))->setTime(8, 00, 00);\r\n\r\n $lastDayObject = new DateTime($dayOne->format('Y-m-d'));\r\n $lastDayObject->add(new DateInterval('P14D'))->setTime(8, 00, 00);\r\n\r\n return ['firstDay' => $dayOne, 'middleDay' => $middleDayObject, 'lastDay' => $lastDayObject];\r\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getCurrentEventPeriod()\n\t{\n\t\ttry {\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$db = getDB(); \n\t\t\t$st = $db->prepare(\"SELECT *\n\t\t\t\tFROM event_voting_period\n\t\t\t\tWHERE start_date <= ? && end_date >= ?\");\n\t\t\t$st->execute(array($today,$today));\n\t\t\t$count=$st->rowCount(); \n\t\t\tif($count)\n\t\t\t{\n\t\t\t\t$data = $st->fetch();\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn false;\n\t\t} catch (PDOException $e) {\n\n\t\t}\n\n\t}",
"public function getBasePeriod() {\n\t\treturn $this->base_period;\n\t}",
"public function getPeriodo() {\n return $this->periodo;\n }",
"public static function getPollToday() {\n return self::find()\n ->where('date_beg<=:dateToday', ['dateToday' => date('Y-m-d')])\n ->andWhere('date_end>=:dateToday', ['dateToday' => date('Y-m-d')])\n ->one();\n }",
"private function getPeriod()\n {\n $time = [\n 'current' => [\n 'start' => ((new \\DateTime())->sub(new \\DateInterval('P30D'))->format('Y-m-d H:i:s')),\n 'end' => gmdate('Y-m-d H:i:s')\n ],\n 'previous' => [\n 'start' => ((new \\DateTime())->sub(new \\DateInterval('P60D'))->format('Y-m-d H:i:s')),\n 'end' => ((new \\DateTime())->sub(new \\DateInterval('P30D'))->format('Y-m-d H:i:s')),\n ]\n ];\n return $time;\n }",
"public function getCurrentPeriodBucket()\n {\n return $this->current_period_bucket;\n }",
"public function nextPeriod()\n {\n $endsAt = $this->current_period_ends_at;\n $interval = $this->plan->getBillableInterval();\n $intervalCount = $this->plan->getBillableIntervalCount();\n\n switch ($interval) {\n case 'month':\n $endsAt = $endsAt->addMonthsNoOverflow($intervalCount);\n break;\n case 'day':\n $endsAt = $endsAt->addDay($intervalCount);\n case 'week':\n $endsAt = $endsAt->addWeek($intervalCount);\n break;\n case 'year':\n $endsAt = $endsAt->addYearsNoOverflow($intervalCount);\n break;\n default:\n $endsAt = null;\n }\n\n return $endsAt;\n }",
"public function getPayPeriod() {\r\n return $this->payPeriod;\r\n }",
"function period($date, $format=\"F d, Y\")\n{\n\t$period\t=\tdate($format,$date);\n\treturn $period;\n}",
"public function getPeriodicalPayment() { return $this->get('periodicalPayment'); }",
"public function periodStartAt()\n {\n $startAt = $this->current_period_ends_at;\n $interval = $this->plan->getBillableInterval();\n $intervalCount = $this->plan->getBillableIntervalCount();\n\n switch ($interval) {\n case 'month':\n $startAt = $startAt->subMonthsNoOverflow($intervalCount);\n break;\n case 'day':\n $startAt = $startAt->subDay($intervalCount);\n case 'week':\n $startAt = $startAt->subWeek($intervalCount);\n break;\n case 'year':\n $startAt = $startAt->subYearsNoOverflow($intervalCount);\n break;\n default:\n $startAt = null;\n }\n\n return $startAt;\n }",
"public function findRenewablePolicy()\r\n {\r\n $dql = \"SELECT p FROM Policy\\Entity\\Policy p WHERE p.policyStatus = :status AND ((DATE_DIFF(p.endDate, CURRENT_DATE()) = 60 OR DATE_DIFF(p.endDate, CURRENT_DATE()) = 30 ) OR DATE_DIFF(p.endDate, CURRENT_DATE()) = 14 )) AND p.endDate > CURRENT_DATE()\";\r\n $query = $this->getEntityManager()\r\n ->createQuery($dql)\r\n ->setParameters(array(\r\n \"status\" => PolicyService::POLICY_STATUS_ISSUED_AND_VALID\r\n ))\r\n ->getResult();\r\n return $query;\r\n }",
"public function makePeriod()\n {\n ini_set('date.timezone', 'America/La_Paz');\n // $currentdateDMY = date(\"d-m-Y\");\n // echo date(\"d-m-Y\",strtotime($currentdateDMY)).'<br>'; \n // //sumo 12 meses\n // echo date(\"d-m-Y\",strtotime($currentdateDMY.\"+ 12 month\")).'<br>'; \n // //sumo 5 anio\n // echo date(\"d-m-Y\",strtotime($currentdateDMY.\"+ 5 year\"));\n \n $nPeriod = null;\n $currentdateYMD = date(\"Y-m-d\");\n $startdate = date(\"Y-m-d\",strtotime($currentdateYMD));\n $enddate = date(\"Y-m-d\",strtotime($currentdateYMD.\"+ 2 year\"));\n\n $periodData = [\n 'start_date' => $startdate,\n 'end_date' => $enddate\n ];\n \n $currentdate = strtotime(date('Y-m-d', time()));\n $period = (int)date(\"m\", $currentdate);\n $period <= 6 ? $periodData['period'] = 1 : $periodData['period'] = 2;\n\n $nPeriod = new Period([\n 'start_date'=> $periodData['start_date'],\n 'end_date'=> $periodData['end_date'],\n 'period'=> $periodData['period']\n ]);\n\n $nPeriod->save();\n \n return $nPeriod;\n }",
"public function getPeriodoInicial()\n {\n return $this->periodo_inicial;\n }",
"public function getPeriodo()\n {\n return $this->hasOne(Periodos::className(), ['codperiodo' => 'codperiodo']);\n }",
"public function getCurrentPeriod($class=null){\r\n $date = new \\DateTime();\r\n $periodquery = $this->em->createQuery(\"SELECT p \"\r\n . \" FROM \\Application\\Entity\\Academicyear p WHERE p.groupPeriod = (SELECT PC.group FROM \\Application\\Entity\\Programgroup PG Join PG.fkProgramid P Join P.fkProgramcategoryid PC WHERE PG.pkGroupid = :classid )\"\r\n . \" AND :currentdate BETWEEN p.startDate AND p.endDate \"\r\n . \" ORDER BY p.pkPeriodid\")\r\n ->setParameter('classid', $class)\r\n ->setParameter('currentdate', $date);\r\n\r\n foreach($periodquery->getResult() as $period ){\r\n\r\n }\r\n return $period;\r\n \r\n }",
"protected function add_pay_period() {\n $current_date = getdate();\n $monday = getdate(strtotime('last Monday'));\n $sunday = getdate(strtotime('next Sunday'));\n \n if ($current_date['weekday'] === 'Monday') {\n $monday = getdate(strtotime('Today'));\n }\n if ($current_date['weekday'] === 'Sunday') {\n $sunday = getdate(strtotime('Today'));;\n }\n \n $check_pay_period = $this->sys->db->query(\"SELECT `pay_period_id` FROM `pay_periods` WHERE `pay_period_monday`=:monday AND `pay_period_sunday`=:sunday\", array(\n ':monday' => (int) substr($monday[0], 0, 20),\n ':sunday' => (int) substr($sunday[0], 0, 20)\n ));\n \n if (!empty($check_pay_period)) {\n return $check_pay_period;\n }\n \n $add_pay_period = $this->sys->db->query(\"INSERT INTO `pay_periods` (`pay_period_id`, `pay_period_monday`, `pay_period_sunday`) VALUES ('', :monday, :sunday)\", array(\n ':monday' => (int) substr($monday[0], 0, 20),\n ':sunday' => (int) substr($sunday[0], 0, 20)\n ));\n \n $check_pay_period = $this->sys->db->query(\"SELECT `pay_period_id` FROM `pay_periods` WHERE `pay_period_monday`=:monday AND `pay_period_sunday`=:sunday\", array(\n ':monday' => (int) substr($monday[0], 0, 20),\n ':sunday' => (int) substr($sunday[0], 0, 20)\n ));\n \n return $check_pay_period;\n }",
"public function getReportPeriod()\n {\n if (array_key_exists(\"reportPeriod\", $this->_propDict)) {\n return $this->_propDict[\"reportPeriod\"];\n } else {\n return null;\n }\n }",
"public function period(): int;",
"public function getScheduledPeriod()\n {\n return $this->scheduledPeriod;\n }",
"public function period()\n {\n return $this->belongsTo('App\\Models\\PaymentPeriod', 'payment_period_id');\n }",
"public function getReviewPeriod() {\n\t\t\n\t $reviewPeriod = trim($this->datefrom) . \" - \" . trim($this->dateto); \n\t\t\n\t\treturn $reviewPeriod;\n\t}"
] | [
"0.7251254",
"0.67822033",
"0.6657449",
"0.6266904",
"0.6266904",
"0.6266904",
"0.6266904",
"0.6266904",
"0.6126219",
"0.61037594",
"0.598219",
"0.57531863",
"0.5726165",
"0.56345063",
"0.5626329",
"0.5613692",
"0.56102264",
"0.56027555",
"0.55770075",
"0.55342495",
"0.55003256",
"0.5437325",
"0.5390628",
"0.5381866",
"0.5359471",
"0.53459626",
"0.5323067",
"0.53134495",
"0.5303374",
"0.53019017"
] | 0.7755173 | 0 |
Did this country use VAT on the given date. | public function usedVATOnDate($date)
{
$period = $this->getPeriod($date);
return !is_null($period) && !empty($period->getStandardRate());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function usedVATOnCurrentDate()\n {\n return $this->usedVATOnDate($this->date);\n }",
"public function occursAt($date);",
"public function isOpenForApplyingLicense( $date ) {\n\n // This simple logic checks $day if it is in holiday / weekends / ...\n if( $this->isWeekend($date)) {\n return false;\n }\n\n return true;\n }",
"public function forDate(Carbon $date);",
"public function getVoucherDate()\n {\n return $this->voucherDate;\n }",
"function vat($voucher, $accountplan, $VAT, $oldVatID, $VatID, $VatPercent, $closed = false) {\n global $_lib;\n $html = '';\n\n if( ($accountplan->EnableVAT == 1) and ($voucher->DisableAutoVat != 1) )\n {\n if($accountplan->EnableVATOverride or $VAT->EnableVatOverride)\n {\n $html .= $VatID . ' ' . '<nobr>' . $_lib['form3']->text(array('name' => 'voucher.Vat', 'value' => $VatPercent, 'class' => 'voucher', 'width' => '4', 'tabindex' => $tabindex++, 'accesskey' => 'M', 'readonly' => $closed)) . '%</nobr>';\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatID', 'value' => $VatID));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatOld', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatIDOld', 'value' => $VatID));\n }\n else\n {\n if(isset($VatPercent))\n {\n #Not secure with hidden VAT code if security is very important\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.Vat', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatID', 'value' => $VatID));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatOld', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatIDOld', 'value' => $VatID));\n\n if($oldVatID != $VatID)\n $html .= $VatID . ' ' . '<font color=\"red\">'.$VatPercent.'%</font>';\n else\n $html .= $VatID . ' ' . $VatPercent.\"%\";\n }\n }\n } else {\n if($voucher->Vat > 0) {\n $html .= $voucher->VatID . ' ' . $voucher->Vat . \"%\";\n }\n }\n\n return $html;\n }",
"public function onDate($date) : self\n {\n return $this->filter->isOnDate($date);\n }",
"public function getCalculatedVAT()\n {\n return $this->calculatedVAT;\n }",
"public function testValidationOk($date)\n {\n // We set the \"fake\" time with timeTravel method\n $this->timeTravel($date);\n $notInTimeForCurrentDayConstraint = new NotInTimeForCurrentDay();\n $notInTimeForCurrentDayValidator = $this->initValidator();\n\n $date = new \\Datetime($date);\n $this->purchase->setDateOfVisit($date);\n $notInTimeForCurrentDayValidator->validate($this->purchase, $notInTimeForCurrentDayConstraint);\n }",
"public function getViseurDtAttest() {\n return $this->viseurDtAttest;\n }",
"private function dateHasPassed($date)\n\t{\n\t\t$timezone = new DateTimeZone('Europe/Stockholm');\n\t\t$now = new DateTime('now', $timezone);\n\t\t$now = $now->format('m/d/Y');\n\n\t\treturn $now > $date;\n\t}",
"public function isDateOfDeliveryAvailable($product)\n {\n if ($product->getTypeInstance()->isTypeVirtual($product)) {\n return true;\n }\n\n return false;\n }",
"private function isDateBooked($date)\n {\n return in_array($date, $this->bookedDates());\n }",
"public function show(Date $date)\n {\n //\n }",
"public function show(Date $date)\n {\n //\n }",
"function cek_approval_po($date,$currency)\n {\n $this->ci->db->where('dates', $date);\n $this->ci->db->where('currency', $currency);\n $this->ci->db->where('approved', 0);\n\n $query = $this->ci->db->get('purchase')->num_rows();\n if($query > 0) { return FALSE; } else { return TRUE; }\n }",
"public function canRegisterAbsenceOn($date) : bool\n {\n return $this->workingJorney->representsDate($date) &&\n ! $this->workingJorney->absences->contains->isOnDate($date);\n }",
"public function accidentStatisticalByDateAction(){\n $accidentLogic = new AccidentLogic($this->get('aws.dynamodb'));\n $common = new Common();\n $formatResponse = new FormatResponse();\n $valid = new UserValidateHelper();\n $date = date('Y/m/d');\n if(!$valid->validationDate($date)){\n $view = View::create();\n $view->setData($formatResponse->createResponseRegister($common->RESULT_CODE_FAIL, $common->STATISTICAL_BY_DATE_ERROR_REQUEST))->setStatusCode(200)->setHeader('Access-Control-Allow-Origin','*');\n return $view;\n }\n $response = $accidentLogic->AccidentStatistical($date);\n $view = View::create();\n $view->setData($formatResponse->getResultStatistical($common->RESULT_CODE_SUCCESS, $common->STATISTICAL_BY_DATE_SUCCESSFULLY, $response))->setStatusCode(200)->setHeader('Access-Control-Allow-Origin','*');\n return $view;\n //return $formatResponse->getResultStatistical($common->RESULT_CODE_SUCCESS, $common->STATISTICAL_BY_DATE_SUCCESSFULLY, $response);\n }",
"public function holidayAtDate($date) {\n if (is_null($date) || is_null($this->getId())) {\n return false;\n }\n\n $row = $this->getAdapter()->fetchRow(\"SELECT COUNT(DISTINCT(ro.id)) AS count\n FROM restaurant_openings_holidays ro\n JOIN city c ON c.stateId=ro.stateId\n JOIN restaurants r ON r.cityId=c.id\n WHERE ro.date='\" . $date . \"' AND r.id = \" . $this->getId() . \" LIMIT 1\");\n return $row['count'] > 0;\n }",
"public function destroy(Date $date)\n {\n $date->update(['active' => false]);\n }",
"public function getAmount(\\DateTime $date);",
"private function applyVat(){\n $vat =$this->vat * $this->total;\n $this->total+= $vat;\n $this->billDetails .= \"Taxes: \" . $vat .\" \". $this->currencyManager->getSymbol($this->currency) . \"\\n\";\n }",
"public function confirm_date() {\r\n\t\t/*\r\n\t\tConfirms the current proposed date has been booked\r\n\t\t */\r\n\t\tif ($this->date_id) {\r\n\t\t\t$sql = \"UPDATE badminton_dates SET confirmed = 1 WHERE date_id = '$this->date_id'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function setRentalDateAttribute($date)\n { \t\n \t$myDate = Carbon::createFromFormat('Y-m-d', $date);\n \tif($myDate > Carbon::now()){\n \t\t$this->attributes['rental_date'] = Carbon::parse($date);\n \t}else{\n \t\t$this->attributes['rental_date'] = Carbon::createFromFormat('Y-m-d', $date);\t\n \t}\n }",
"public function getVat()\n {\n return $this->vat;\n }",
"public function testValidationKo($date)\n {\n // We set the \"fake\" time with timeTravel method\n $this->timeTravel($date);\n $notInTimeForCurrentDayConstraint = new NotInTimeForCurrentDay();\n $notInTimeForCurrentDayValidator = $this->initValidator($notInTimeForCurrentDayConstraint->message);\n\n $date = new \\Datetime($date);\n $this->purchase->setDateOfVisit($date);\n $notInTimeForCurrentDayValidator->validate($this->purchase, $notInTimeForCurrentDayConstraint);\n\n }",
"function vencidos($date){\r\n\t\t//$date_max = date(\"Y-m-d\",$date_max_str);\r\n\t\t\r\n\t\t$vencidos = $this->find('list',array(\r\n\t\t\t'conditions'=> array(\r\n\t\t\t\t'date(created)' => $date,\r\n\t\t\t\t'ticket_status_id' => 2,\r\n\t\t\t\t'payed' => 0\r\n\t\t\t), 'fields'=>'Ticket.id'\r\n\t\t));\r\n\t\t\r\n\t\t$this->updateAll(\r\n\t\t\tarray('ticket_status_id' => 7),\r\n\t\t\tarray('Ticket.id' => $vencidos)\r\n\t\t);\r\n\t\t\r\n\t\treturn count($vencidos);\r\n\t}",
"public function afterVat()\n {\n return $this->totalPrice() * config('qalzam.vat');\n }",
"function DateCheck( $indate) {\r\n\treturn true;\r\n}",
"public function vat_rate()\n\t{\n\t\t// If we are using custom VAT codes module then calculate retail cost based upon this...else use default value from config.\n\t\treturn Caffeine::modules('vat_codes') ? $this->product->vat_code->value : Kohana::config('ecommerce.vat_rate');\n\t}"
] | [
"0.71777934",
"0.55682915",
"0.54478735",
"0.53379977",
"0.53289443",
"0.530105",
"0.5298251",
"0.5287324",
"0.5241506",
"0.52350044",
"0.522622",
"0.5211326",
"0.5189413",
"0.517661",
"0.517661",
"0.5144155",
"0.51203823",
"0.51151067",
"0.5095225",
"0.50771236",
"0.5037721",
"0.5034608",
"0.50339496",
"0.5033811",
"0.50293714",
"0.5029058",
"0.50259525",
"0.50255305",
"0.5003218",
"0.49809188"
] | 0.7586332 | 0 |
Did this country use VAT on the current date. | public function usedVATOnCurrentDate()
{
return $this->usedVATOnDate($this->date);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function usedVATOnDate($date)\n {\n $period = $this->getPeriod($date);\n\n return !is_null($period) && !empty($period->getStandardRate());\n }",
"public function afterVat()\n {\n return $this->totalPrice() * config('qalzam.vat');\n }",
"public function getCalculatedVAT()\n {\n return $this->calculatedVAT;\n }",
"public function vat_rate()\n\t{\n\t\t// If we are using custom VAT codes module then calculate retail cost based upon this...else use default value from config.\n\t\treturn Caffeine::modules('vat_codes') ? $this->product->vat_code->value : Kohana::config('ecommerce.vat_rate');\n\t}",
"public static function getDataAtual() {\n return Carbon::now()->toDateString();\n }",
"function vat($voucher, $accountplan, $VAT, $oldVatID, $VatID, $VatPercent, $closed = false) {\n global $_lib;\n $html = '';\n\n if( ($accountplan->EnableVAT == 1) and ($voucher->DisableAutoVat != 1) )\n {\n if($accountplan->EnableVATOverride or $VAT->EnableVatOverride)\n {\n $html .= $VatID . ' ' . '<nobr>' . $_lib['form3']->text(array('name' => 'voucher.Vat', 'value' => $VatPercent, 'class' => 'voucher', 'width' => '4', 'tabindex' => $tabindex++, 'accesskey' => 'M', 'readonly' => $closed)) . '%</nobr>';\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatID', 'value' => $VatID));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatOld', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatIDOld', 'value' => $VatID));\n }\n else\n {\n if(isset($VatPercent))\n {\n #Not secure with hidden VAT code if security is very important\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.Vat', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatID', 'value' => $VatID));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatOld', 'value' => $VatPercent));\n $html .= $_lib['form3']->hidden(array('name' => 'voucher.VatIDOld', 'value' => $VatID));\n\n if($oldVatID != $VatID)\n $html .= $VatID . ' ' . '<font color=\"red\">'.$VatPercent.'%</font>';\n else\n $html .= $VatID . ' ' . $VatPercent.\"%\";\n }\n }\n } else {\n if($voucher->Vat > 0) {\n $html .= $voucher->VatID . ' ' . $voucher->Vat . \"%\";\n }\n }\n\n return $html;\n }",
"public function getViseurDtAttest() {\n return $this->viseurDtAttest;\n }",
"public function getVoucherDate()\n {\n return $this->voucherDate;\n }",
"public function isDateOfDeliveryAvailable($product)\n {\n if ($product->getTypeInstance()->isTypeVirtual($product)) {\n return true;\n }\n\n return false;\n }",
"public function isInvoiced()\n {\n \n }",
"function podcast_pro_is_show_live() {\n\t$air_date = genesis_get_custom_field( 'air_date' );\n\tif ( current_time( 'timestamp', 0 ) > $air_date ) {\n\t\treturn true;\n\t}\n\treturn false;\n}",
"private function applyVat(){\n $vat =$this->vat * $this->total;\n $this->total+= $vat;\n $this->billDetails .= \"Taxes: \" . $vat .\" \". $this->currencyManager->getSymbol($this->currency) . \"\\n\";\n }",
"public function isCurrentDate(): bool;",
"public function getVat()\n {\n return $this->vat;\n }",
"public function isUsedOnDay()\n {\n return $this->getFieldValue('is_used_on_day');\n }",
"public function isAired()\n {\n return Carbon::now() > Carbon::parse($this->aired);\n }",
"public function estVivant()\n {\n return $this->getDDeces() ? true : false;\n }",
"public function getUsageDate();",
"public function getVat()\n {\n if (!$this->hasVat() && $this->getVatId() > 0) {\n $this->setVat(\n Mage::getModel('innobyte_emag_marketplace/vat')\n ->load($this->getVatId())\n );\n }\n return $this->getData('vat');\n }",
"public function isToday();",
"public function getBuyDate() {\n return $this->buyDate;\n }",
"public function confirm_date() {\r\n\t\t/*\r\n\t\tConfirms the current proposed date has been booked\r\n\t\t */\r\n\t\tif ($this->date_id) {\r\n\t\t\t$sql = \"UPDATE badminton_dates SET confirmed = 1 WHERE date_id = '$this->date_id'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function isTatApplicable() {\n\n //First test: is the reference cancelled?\n if($this->_reference->status->state == Model_Referencing_ReferenceStates::CANCELLED) {\n\n return false;\n }\n\n\t\t//Next test: does the product merit a TAT?\n $product = $this->_reference->productSelection->product;\n \n if(empty($product->variables)) {\n\t\t\n return false;\n }\n else if(isset($product->variables[Model_Referencing_ProductVariables::CREDIT_REFERENCE])) {\n \n return false;\n }\n\n //Next test: only tenants can login.\n if($this->_reference->referenceSubject->type != Model_Referencing_ReferenceSubjectTypes::TENANT) {\n\n return false;\n }\n\t\t\n //Next test: is the reference over >= 30 days?\n if($this->isTatExpired()) {\n\n return false;\n }\n\n\n //Next test: has the agent opted out of the TAT?\n $tatOptedStatusDatasource = new Datasource_Referencing_TatOptedStatus();\n\t\t$tatOptedStatus = $tatOptedStatusDatasource->getOptedStatus($this->_reference->customer->customerId);\n if($tatOptedStatus == Model_Referencing_TatOptedStates::OPTED_OUT) {\n\n return false;\n }\n\n return true;\n }",
"public function isOldTrade()\n {\n $date = Carbon::parse(config('jp.new_company_trades_start_date'));\n $createdDate = new Carbon($this->created_date, Settings::get('TIME_ZONE'));\n\n return $date->gte($createdDate);\n }",
"function we_tag_ifCurrentDate(){\n\tif(isset($GLOBALS['lv']->calendar_struct)){\n\t\tswitch($GLOBALS['lv']->calendar_struct['calendar']){\n\t\t\tcase 'day' :\n\t\t\t\treturn (date('d-m-Y H', $GLOBALS['lv']->calendar_struct['date']) == date('d-m-Y H'));\n\t\t\t\tbreak;\n\t\t\tcase 'month' :\n\t\t\tcase 'month_table' :\n\t\t\t\treturn (date('d-m-Y', $GLOBALS['lv']->calendar_struct['date']) == date('d-m-Y'));\n\t\t\t\tbreak;\n\t\t\tcase 'year' :\n\t\t\t\treturn (date('m-Y', $GLOBALS['lv']->calendar_struct['date']) == date('m-Y'));\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn false;\n}",
"public function getBuyDate() {\n\t\treturn $this->buyDate;\n\t}",
"public function daily()\n {\n return $this->reportViewFor(1, Carbon::today());\n }",
"public function getPriceVat()\n {\n $priceVat = $this->price + $this->price*$this->vatRate;\n return $priceVat;\n }",
"function convExamples_getMyCurrentDate()\n{\n\treturn G::CurDate('Y-m-d');\n}",
"private function purchaseDate()\n {\n return null;\n }"
] | [
"0.69665474",
"0.5784294",
"0.5782091",
"0.5689698",
"0.56624055",
"0.56258714",
"0.55797654",
"0.55796206",
"0.55723786",
"0.55586016",
"0.55582577",
"0.5552573",
"0.5550595",
"0.5496187",
"0.53308505",
"0.5327043",
"0.53255177",
"0.5318213",
"0.52658623",
"0.52547985",
"0.5241484",
"0.5218886",
"0.51997423",
"0.51784986",
"0.5171476",
"0.5163661",
"0.5149932",
"0.5145017",
"0.5141669",
"0.5104575"
] | 0.7839634 | 0 |
Get the super reduced rates. | public function getSuperReducedRate()
{
$period = $this->getCurrentPeriod();
return ($period ? $period->getSuperReducedRate() : null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rates()\n {\n return $this->_rates;\n }",
"public function getRates()\n {\n return $this->_rates;\n }",
"public function getReducedRates()\n {\n $period = $this->getCurrentPeriod();\n\n return ($period ? $period->getReducedRates() : null);\n }",
"public function getRates()\n {\n return $this->rates;\n }",
"public function getRates()\n {\n return $this->rates;\n }",
"public function getBaseRate()\n { \n\n return $this->_price;\n }",
"public function getRate()\n {\n return $this->rate;\n }",
"public function getExchangeRates() {\n return parent::_requestData('get','exchangerates');\n }",
"public function getRate()\n {\n return $this->rate;\n }",
"public function getPerItemRate()\n {\n return 0;\n }",
"public static function getRates()\n {\n //Reference: ReadTheDocs, link: https://guzzle.readthedocs.io/en/latest/\n //$client = new \\GuzzleHttp\\Client();\n //$res = $client->request('GET','http://data.fixer.io/api/latest?access_key=afd6c48270d18d80d6740d5fc77c4b1c&format=1');\n //$body = json_decode($res->getBody()->getContents());\n //$uzs = round(($body->rates->UZS)/($body->rates->USD),2);\n $uzs = 8450.0;\n return $uzs;\n }",
"public function fetchDropRate(): float {\n switch ($this->value) {\n case self::INCREASE_STATS_BY_TWO_HUNDRED_FIFTY:\n return 0.02;\n case self::INCREASE_STATS_BY_FIVE_HUNDRED:\n return 0.05;\n case self::INCREASE_STATS_BY_ONE_THOUSAND:\n return 0.08;\n case self::INCREASE_STATS_BY_TWO_THOUSAND:\n return 0.10;\n case self::INCREASE_STATS_BY_THREE_THOUSAND:\n return 0.14;\n default:\n // @codeCoverageIgnoreStart\n return 0.0;\n // @codeCoverageIgnoreEnd\n }\n }",
"public function rates() {\n $result = $this->getRequest(\"rates\");\n if (!empty($result['error']))\n throw new ALFAcoins_Exception(\"Invalid rates result, error: \" . $result['error']);\n return $result;\n }",
"public function getListExchangeRate()\n {\n return $this->listExchangeRate;\n }",
"public function getRates();",
"public function getRates();",
"public function getDiscounts(\n RateRequest $request\n ) {\n\n // known possible problem: $request->getBaseSubtotalInclTax can be empty in some cases, same problem with\n // free shipping. This is because shipping total collector is called before tax subtotal collector, and so\n // BaseSubtotalInclTax is not updated yet.\n\n $basketValue = $request->getBaseSubtotalInclTax();\n if ($basketValue == 0 && $request->getPackageValueWithDiscount()>0) {\n $basketValue = $request->getPackageValueWithDiscount() * 1.25;\n }\n\n $discounts = $this->helper->getDiscounts();\n\n $discountAmount = 0;\n $this->_logger->debug(json_encode($discounts));\n foreach($discounts as $discount) {\n $this->_logger->debug(json_encode($discounts));\n $this->_logger->debug($basketValue);\n if ((int)trim($discount['minimumbasket']) < $basketValue) {\n //Basket is eligible\n if ((int)trim($discount['discount']) > $discountAmount) {\n //best discount\n $discountAmount = (int)trim($discount['discount']);\n }\n }\n }\n\n $this->session->setPbDiscount($discountAmount);\n $this->_logger->debug('pbdiscount' . $this->session->getPbDiscount());\n return $discountAmount;\n }",
"public function getConsumption() {\n\n\t}",
"public function getRate(): float\n {\n return $this->rate;\n }",
"public function rates()\n {\n return $this->morphMany('App\\UserRate', 'ratable');\n }",
"public function getCalculationRate()\n {\n return $this->calculationRate;\n }",
"public function getMaxRate()\n {\n return 0;\n }",
"public function getShippingRatesCollection()\n {\n // Check if extension enabled\n if (Mage::getStoreConfig('autoship_general/general/enabled', $this->getQuote()->getStore()) != '1') {\n return parent::getShippingRatesCollection();\n }\n // Call parent method to collect rates\n parent::getShippingRatesCollection();\n // Now filter out the subscription shipping method if appropriate\n if (!$this->allowSubscriptionShippingMethod()) {\n $subscriptionShippingMethod = Mage::getStoreConfig('autoship_subscription/subscription/shipping_method', $this->getQuote()->getStore());\n // Iterate rates and look for one matching our subscription method\n foreach ($this->_rates as $key => $rate) {\n $rateData = $rate->getData();\n if (isset($rateData['code']) && $rateData['code'] == $subscriptionShippingMethod) {\n // If we find a rate matching our subscription method, remove it, making it unavailable\n $this->_rates->removeItemByKey($key);\n }\n }\n }\n\n return $this->_rates;\n }",
"public function getCharges()\n {\n return $this->Charges;\n }",
"public function getRentalRate()\n {\n return $this->rentalRate;\n }",
"public function getEstimateRates() {\n if (empty($this->_rates)) {\n $groups = $this->getQuote()->getShippingAddress()->getGroupedAllShippingRates();\n $this->_rates = $groups;\n }\n return $this->_rates;\n }",
"public function getSourceCurrencyBaseRate()\n {\n return $this->sourceCurrencyBaseRate;\n }",
"public function rates():array\n {\n if ($this->rates) {\n return $this->rates;\n }\n\n return $this->rates = (array)json_decode(Cache::remember($this->cacheKey, 360, function () {\n return json_encode($this->fresh());\n }), true);\n }",
"public function getBreakfastRates()\n {\n return $this->breakfastRates;\n }",
"public function getSurcharge();"
] | [
"0.71406835",
"0.6878949",
"0.6863623",
"0.68275064",
"0.68275064",
"0.6369267",
"0.62780315",
"0.6268484",
"0.62580436",
"0.6189573",
"0.615756",
"0.6143391",
"0.6121175",
"0.6115032",
"0.60959107",
"0.60959107",
"0.60804635",
"0.6062512",
"0.597377",
"0.59283274",
"0.58902496",
"0.5846165",
"0.58061343",
"0.57374823",
"0.5737453",
"0.5713199",
"0.5678705",
"0.5656484",
"0.5645688",
"0.5635619"
] | 0.724891 | 0 |
Get the reduced rates. | public function getReducedRates()
{
$period = $this->getCurrentPeriod();
return ($period ? $period->getReducedRates() : null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rates()\n {\n return $this->_rates;\n }",
"public function getRates()\n {\n return $this->rates;\n }",
"public function getRates()\n {\n return $this->rates;\n }",
"public function getRates()\n {\n return $this->_rates;\n }",
"public function rates() {\n $result = $this->getRequest(\"rates\");\n if (!empty($result['error']))\n throw new ALFAcoins_Exception(\"Invalid rates result, error: \" . $result['error']);\n return $result;\n }",
"public function getRates();",
"public function getRates();",
"public static function getRates()\n {\n //Reference: ReadTheDocs, link: https://guzzle.readthedocs.io/en/latest/\n //$client = new \\GuzzleHttp\\Client();\n //$res = $client->request('GET','http://data.fixer.io/api/latest?access_key=afd6c48270d18d80d6740d5fc77c4b1c&format=1');\n //$body = json_decode($res->getBody()->getContents());\n //$uzs = round(($body->rates->UZS)/($body->rates->USD),2);\n $uzs = 8450.0;\n return $uzs;\n }",
"public function getExchangeRates() {\n return parent::_requestData('get','exchangerates');\n }",
"public function getExchangeRates()\n {\n $rates = $this->getExchangeRatesFromHttpApi();\n $this->cache->save($rates);\n return $rates;\n }",
"public function getListExchangeRate()\n {\n return $this->listExchangeRate;\n }",
"public function getSuperReducedRate()\n {\n $period = $this->getCurrentPeriod();\n\n return ($period ? $period->getSuperReducedRate() : null);\n }",
"public function rates():array\n {\n if ($this->rates) {\n return $this->rates;\n }\n\n return $this->rates = (array)json_decode(Cache::remember($this->cacheKey, 360, function () {\n return json_encode($this->fresh());\n }), true);\n }",
"public function getEstimateRates() {\n if (empty($this->_rates)) {\n $groups = $this->getQuote()->getShippingAddress()->getGroupedAllShippingRates();\n $this->_rates = $groups;\n }\n return $this->_rates;\n }",
"function _commerce_collector_get_rates() {\n return array(\n 'IF_3_001' => t('3 months, 0% interest rate, 95,- initial charge'),\n 'IF_6_001' => t('6 months, 0% interest rate, 195,- initial charge'),\n 'IF_12_001' => t('12 months, 0% interest rate, 295,- initial charge'),\n 'AN_24_001' => t('24 months, 9,95% interest rate, 295,- initial charge'),\n 'AN_36_001' => t('36 months, 14,95% interest rate, 395,- initial charge'),\n );\n}",
"public function getRate()\n {\n return $this->rate;\n }",
"protected function getAvailableCurrenciesRate(): object\n {\n $currencies = $this->getAvailableCurrencies();\n $url = self::CURRENCY_RATE_URL . implode(',', $currencies) . '&' . env('CURRENCY_API_KEY');\n return collect(Http::get($url)['data'])->map(function($item, $key) {\n $exchange_currencies = str_split($key, 3);\n return [\n 'from' => $exchange_currencies[0],\n 'to' => $exchange_currencies[1],\n 'rate' => $item,\n ];\n });\n }",
"public function getRate()\n {\n return $this->rate;\n }",
"public function fetchDropRate(): float {\n switch ($this->value) {\n case self::INCREASE_STATS_BY_TWO_HUNDRED_FIFTY:\n return 0.02;\n case self::INCREASE_STATS_BY_FIVE_HUNDRED:\n return 0.05;\n case self::INCREASE_STATS_BY_ONE_THOUSAND:\n return 0.08;\n case self::INCREASE_STATS_BY_TWO_THOUSAND:\n return 0.10;\n case self::INCREASE_STATS_BY_THREE_THOUSAND:\n return 0.14;\n default:\n // @codeCoverageIgnoreStart\n return 0.0;\n // @codeCoverageIgnoreEnd\n }\n }",
"private function getRates() {\n // note: impossible to do with join\n $rates = [];\n $result = app('db')\n ->table('score')\n ->select(app('db')->raw('key, SUM(score) as totalScore'))\n ->groupBy('key')\n ->get();\n if ($result === false) {\n $this->response->databaseErr();\n return false;\n }\n\n foreach ($result as $row) {\n $fileId = $row->key;\n $score = $row->totalScore;\n $rates[$fileId] = $score;\n }\n\n return $rates;\n }",
"public function getRates()\n {\n $rates = $this->_context->getScopeConfig()->getValue(self::XML_PATH_CED_CSMARKETPLACE_VENDOR_RATES);\n return json_decode(json_encode($rates), true);\n }",
"public function getPerItemRate()\n {\n return 0;\n }",
"public function getMaxRate()\n {\n return 0;\n }",
"public function getConstants()\n {\n $reflect = new \\ReflectionClass(Rate::class);\n return $reflect->getConstants();\n }",
"public function rates()\n {\n return $this->morphMany('App\\UserRate', 'ratable');\n }",
"public function getDiscountRates(): ?string\n {\n return $this->discountRates;\n }",
"public function getDiscounts(\n RateRequest $request\n ) {\n\n // known possible problem: $request->getBaseSubtotalInclTax can be empty in some cases, same problem with\n // free shipping. This is because shipping total collector is called before tax subtotal collector, and so\n // BaseSubtotalInclTax is not updated yet.\n\n $basketValue = $request->getBaseSubtotalInclTax();\n if ($basketValue == 0 && $request->getPackageValueWithDiscount()>0) {\n $basketValue = $request->getPackageValueWithDiscount() * 1.25;\n }\n\n $discounts = $this->helper->getDiscounts();\n\n $discountAmount = 0;\n $this->_logger->debug(json_encode($discounts));\n foreach($discounts as $discount) {\n $this->_logger->debug(json_encode($discounts));\n $this->_logger->debug($basketValue);\n if ((int)trim($discount['minimumbasket']) < $basketValue) {\n //Basket is eligible\n if ((int)trim($discount['discount']) > $discountAmount) {\n //best discount\n $discountAmount = (int)trim($discount['discount']);\n }\n }\n }\n\n $this->session->setPbDiscount($discountAmount);\n $this->_logger->debug('pbdiscount' . $this->session->getPbDiscount());\n return $discountAmount;\n }",
"public function getRegularRates(&$rates) {\n $rate_usd = @file_get_contents('https://api.exchangeratesapi.io/latest?base=USD');\n \n // if API is out it will try another\n if (empty($rate_usd)) {\n $rate_usd = @file_get_contents('http://api.openrates.io/latest?base=USD');\n }\n\n if (!empty($rate_usd)) {\n $json_usd = json_decode($rate_usd);\n $rates['EUR'] = round($json_usd->rates->EUR,6); // euro\n $rates['BRL'] = round($json_usd->rates->BRL,6); // brazilian real\n }\n }",
"public function getRate(): array\n {\n $url = 'https://www.cbr-xml-daily.ru/daily_json.js';\n\n $request = Request::factory($url);\n $response = $request->execute();\n\n $rate = json_decode($response, true)['Valute'];\n\n return $rate;\n }",
"public function getRate($currency);"
] | [
"0.7561063",
"0.7314421",
"0.7314421",
"0.72628605",
"0.7092425",
"0.69109935",
"0.69109935",
"0.668246",
"0.6602015",
"0.65019107",
"0.6361656",
"0.62899894",
"0.6272739",
"0.6240244",
"0.62268305",
"0.61348575",
"0.61192864",
"0.61159885",
"0.60852975",
"0.6059489",
"0.603057",
"0.5998298",
"0.5990813",
"0.5924195",
"0.5913758",
"0.5876327",
"0.5875824",
"0.5875425",
"0.5796721",
"0.5796199"
] | 0.77837026 | 0 |
Subsets and Splits