query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
FORM HtmlBlock: Prepare Saving of HtmlBlock. | public function prepareSaveHtmlBlock(&$a_html_block)
{
global $ilCtrl;
$a_html_block->setType($this->getBlockType());
$a_html_block->setContextObjId($ilCtrl->getContextObjId());
$a_html_block->setContextObjType($ilCtrl->getContextObjType());
} | [
"public function outputFormHtmlBlock()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\t$lng->loadLanguageModule(\"block\");\n\t\t\n\t\tinclude(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t\n\t\t$form_gui = new ilPropertyFormGUI();\n\t\t\n\t\t$values = $this->getValuesHtmlBlock();\n\t\t\n\t\t// Property Title\n\t\t$alert = ($this->form_check[\"HtmlBlock\"][\"Title\"][\"error\"] != \"\")\n\t\t\t? $this->form_check[\"HtmlBlock\"][\"Title\"][\"error\"]\n\t\t\t: \"\";\n\t\t$form_gui->addTextProperty($lng->txt(\"block_html_block_title\"),\n\t\t\t\"block_title\",\n\t\t\t$values[\"Title\"],\n\t\t\t\"\", $alert, true\n\t\t\t, \"200\");\n\t\t\n\t\t// Property Content\n\t\t$alert = ($this->form_check[\"HtmlBlock\"][\"Content\"][\"error\"] != \"\")\n\t\t\t? $this->form_check[\"HtmlBlock\"][\"Content\"][\"error\"]\n\t\t\t: \"\";\n\t\t$form_gui->addTextAreaProperty($lng->txt(\"block_html_block_content\"),\n\t\t\t\"block_content\",\n\t\t\t$values[\"Content\"],\n\t\t\t\"\", $alert, false\n\t\t\t, \"40\", \"8\", true);\n\t\t\n\t\t// save and cancel commands\n\t\tif (in_array($this->getFormEditMode(), array(IL_FORM_CREATE,IL_FORM_RE_CREATE)))\n\t\t{\n\t\t\t$form_gui->addCommandButton(\"saveHtmlBlock\", $lng->txt(\"save\"));\n\t\t\t$form_gui->addCommandButton(\"cancelSaveHtmlBlock\", $lng->txt(\"cancel\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form_gui->addCommandButton(\"updateHtmlBlock\", $lng->txt(\"save\"));\n\t\t\t$form_gui->addCommandButton(\"cancelUpdateHtmlBlock\", $lng->txt(\"cancel\"));\n\t\t}\n\t\t\n\t\t$form_gui->setTitle($lng->txt(\"block_html_block_head\"));\n\t\t$form_gui->setFormAction($this->ctrl->getFormAction($this));\n\t\t\n\t\t// individual preparation of form\n\t\t$this->prepareFormHtmlBlock($form_gui);\n\t\t\n\t\treturn $form_gui->getHTML();\n\n\t}",
"public function saveFeedBlock()\n\t{\n\t\t$this->initFormFeedBlock(IL_FORM_CREATE);\n\t\tif ($this->form_gui->checkInput())\n\t\t{\n\t\t\t$this->external_feed_block = new ilExternalFeedBlock();\n\t\t\t$this->external_feed_block->setTitle($this->form_gui->getInput(\"block_title\"));\n\t\t\t$this->external_feed_block->setFeedUrl($this->form_gui->getInput(\"block_feed_url\"));\n\t\t\t$this->prepareSaveFeedBlock($this->external_feed_block);\n\t\t\t$this->external_feed_block->create();\n\t\t\t$this->exitSaveFeedBlock();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->form_gui->setValuesByPost();\n\t\t\treturn $this->form_gui->getHtml();\n\t\t}\n\n\t}",
"public function updateHtmlBlock()\n\t{\n\t\tinclude_once(\"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php\");\n\t\tif ($this->checkInputHtmlBlock())\n\t\t{\n\t\t\t\n\t\t\t$this->html_block->setTitle(ilUtil::stripSlashes($_POST[\"block_title\"]));\n\t\t\t$this->html_block->setContent(ilUtil::stripSlashes($_POST[\"block_content\"]\n\t\t\t\t,true, ilObjAdvancedEditing::_getUsedHTMLTagsAsString()));\n\t\t\t$this->html_block->update();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setFormEditMode(IL_FORM_RE_EDIT);\n\t\t\treturn $this->outputFormHtmlBlock();\n\t\t}\n\n\t}",
"public function saveAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t// check if form is posted\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$arrData = array();\n\t\t\t$arrData['module'] \t\t= $this->_request->getPost('module');\n\t\t\t$arrData['description'] = $this->_request->getPost('description');\n\t\t\t$arrData['delta'] \t\t= $this->_request->getPost('delta');\n\t\t\t$arrData['weight'] \t\t= $this->_request->getPost('weight');\n\t\t\t$arrData['section'] \t= $this->_request->getPost('section');\n\t\t\t$arrData['layout'] \t\t= $this->_request->getPost('layout');\n\t\t\t$arrData['status']\t \t= $this->_request->getPost('status');\n\t\t\t$layout = $this->_request->getPost('layout');\n\t\t\t$id = $this->_request->getPost('id');\n\t\t\t$model->updateBlock($arrData, $id);\n\t\t\t$this->_redirect('/admin/block/list/layout/' . $layout);\n\t\t}\n\t\telse\n\t\t\t$this->_redirect('/admin/block/list');\n\t }",
"protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n [\n 'data' => ['id' => 'wysiwyg_edit_form', 'action' => $this->getData('action'), 'method' => 'post'],\n ]\n );\n\n $config['document_base_url'] = $this->getData('store_media_url');\n $config['store_id'] = $this->getData('store_id');\n $config['add_variables'] = true;\n $config['add_widgets'] = true;\n $config['add_directives'] = true;\n $config['use_container'] = true;\n $config['container_class'] = 'hor-scroll';\n\n $form->addField(\n $this->getData('editor_element_id'),\n 'editor',\n [\n 'name' => 'content',\n 'style' => 'width:725px;height:460px',\n 'required' => true,\n 'force_load' => true,\n 'config' => $this->_wysiwygConfig->getConfig($config)\n ]\n );\n $this->setForm($form);\n return parent::_prepareForm();\n }",
"function codeblock() {\r\n\t\t$this->data['Editor'] = $this->params['form'];\r\n\t}",
"function block_skinChooser(){\n //Show first part\n echo '<form action=\"php/profile/form_skinChooser.php\" method=\"post\" id=\"columnBack\">';\n echo '<h1 class=\"title is-4\">- Custom skin chooser -</h1>';\n showSuccess(2);\n\n block_skinChooser_body();\n \n //Show last part\n echo <<<EOF\n <br>\n <br>\n <input type=\"submit\" value=\"Save all modifications\" class=\"button is-light\"/>\n </form>\nEOF;\n}",
"function dvbanner_block_add_submit ($form_id, $form_values) {\n $delta = db_next_id ('{dvbanner_block}_delta');\n \n db_query (\n \"INSERT INTO {dvbanner_block} (delta, type, title, data) VALUES (%d, '%s', '%s', '%s')\", \n $delta, $form_values['type'], $form_values['title'], serialize (array ('limitation' => 1))\n );\n \n // Thông báo: đã tạo bannner block thành công\n drupal_set_message (t(\n \"Created banner block <strong>!title</strong>\", \n array ('!title' => check_plain ($form_values['title']))\n ));\n \n // redirect to block setting form\n drupal_goto ('admin/build/block/configure/dvbanner/' . $delta, 'destination=admin/build/block/dvbanner');\n}",
"function editor()\n\t{\n\t\t// -------------------------------------\n\t\t// Retrieve and validate POST data\n\t\t// -------------------------------------\n\t\t\n\t\t$block = $this->addon->input->post('block_type');\n\t\t\n\t\tif( ! $block ):\n\t\t\n\t\t\techo $this->show_error( 'invalid_post_data' );\n\t\t\n\t\tendif;\n\t\t\n\t\t// -------------------------------------\n\t\t// Load Block\n\t\t// -------------------------------------\n\t\t\n\t\t$block = $this->addon->blocks->load_block($block);\n\t\t\n\t\tif( ! $block ):\n\t\t\n\t\t\techo $this->show_error( 'failed_to_load_block' );\n\t\t\n\t\tendif;\n\n\t\t// -------------------------------------\n\t\t// Is this block Local or Global?\n\t\t// -------------------------------------\n\t\t\n\t\t$region_class = $this->addon->input->post('region_class');\n\t\t\n\t\tif( $region_class == 'mojoblock_global_region' ):\n\t\t\n\t\t\t$global = TRUE;\n\t\t\n\t\telse:\n\t\t\t\n\t\t\t$global = FALSE;\n\t\t\n\t\tendif;\n\t\t\n\t\t// -------------------------------------\n\t\t// Validation\n\t\t// -------------------------------------\n\t\t\n\t\t$this->addon->load->library('form_validation');\n\t\t\n\t\t$this->addon->load->helper('form');\n\t\t\n\t\t// -------------------------------------\n\t\t// Set validation and create form fields\n\t\t// -------------------------------------\n\t\t\n\t\tforeach( $block->block_fields as $slug => $data ):\n\t\t\n\t\t\t$this->addon->form_validation->set_rules($slug, $data['label'], $data['validation']);\n\t\t\t\t\t\n\t\tendforeach;\n\t\t\n\t\t$this->addon->form_validation->set_error_delimiters('<p class=\"error\">', '</p>');\n\n\t\t// -------------------------------------\n\t\t// Was this submitted before and kicked back for a validation error?\n\t\t// If so we need to go ahead and get some data.\n\t\t// -------------------------------------\n\n\t\t$validated = FALSE;\n\n\t\tif( isset($_POST['form_submit']) && $_POST['form_submit'] == 'true' ):\n\t\t\n\t\t\t$form_data = $this->addon->blocks->clean_form_input_data( $_POST );\n\t\t\t\n\t\t\t$validated = TRUE;\n\t\t\t\n\t\telse:\n\n\t\t\t// -------------------------------------\t\t\n\t\t\t// Otherwise, is this saved in the DB?\n\t\t\t// -------------------------------------\n\t\t\t\n\t\t\t$single_block = $this->addon->blocks_mdl->get_single_block(\n\t\t\t\t\t$this->addon->input->post('page_url_title'),\n\t\t\t\t\t$this->addon->input->post('layout_id'),\n\t\t\t\t\t$this->addon->input->post('block_type'),\n\t\t\t\t\t$this->addon->input->post('region_id'),\n\t\t\t\t\t$global\n\t\t\t\t);\n\t\t\t\t\n\t\t\tif( $single_block ):\n\t\t\t\n\t\t\t\t$form_data = $this->addon->blocks->clean_db_input_data( $single_block );\n\n\t\t\t\t// -------------------------------------\t\t\t\n\t\t\t\t// Form pre-editng processing\n\t\t\t\t// -------------------------------------\t\t\t\n\t\t\t\t// If this is saved in the DB, then we \n\t\t\t\t// can run it through the pre-processor\n\t\t\t\t// in the block if defined. \t\t\t\n\t\t\t\t// -------------------------------------\n\t\t\t\t\n\t\t\t\tif( method_exists($block, 'pre_editor') ):\n\t\t\t\t\n\t\t\t\t\t$processed = $block->pre_editor( $form_data['form_fields'] );\n\t\t\t\t\t\n\t\t\t\t\tif( is_array($processed) ):\n\t\t\t\t\t\n\t\t\t\t\t\t$form_data['form_fields'] = $processed;\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t// -------------------------------------\n\t\t\n\t\t\telse:\n\t\t\t\n\t\t\t\t// We have a brand new block. Just get the basics.\n\t\t\t\n\t\t\t\t$form_data = $this->addon->blocks->clean_new_data( $_POST );\n\t\t\n\t\t\tendif;\n\n\t\t\t// -------------------------------------\n\n\t\tendif;\n\t\t\n\t\t// -------------------------------------\n\t\t// Tag Parameters Processing\n\t\t// -------------------------------------\n\t\t// Add tag parameters \n\t\t// -------------------------------------\n\t\t\n\t\t// Did we get the block data already on the validation run?\n\t\t// If not, get it.\n\t\t\n\t\tif( !isset($single_block) ):\n\t\t\n\t\t\t$single_block = $this->addon->blocks_mdl->get_single_block(\n\t\t\t\t\t$this->addon->input->post('page_url_title'),\n\t\t\t\t\t$this->addon->input->post('layout_id'),\n\t\t\t\t\t$this->addon->input->post('block_type'),\n\t\t\t\t\t$this->addon->input->post('region_id'),\n\t\t\t\t\t$global\n\t\t\t\t);\n\t\t\n\t\tendif;\n\t\t\t\n\t\tif( $single_block ):\n\t\n\t\t\t$hidden = $single_block['tag_settings'];\n\n\t\telse:\n\t\t\n\t\t\t// Looks like the blocks isn't in the DB yet.\n\t\t\t// Check if it is in the flash data\n\t\t\t\n\t\t\t$passed_params = $this->addon->session->userdata( $block->block_slug.'_'.$this->addon->input->post('region_id').'_flash_params' );\n\t\t\t\t\t\t\t\t\n\t\t\tif( $passed_params ):\n\t\t\t\n\t\t\t\t// Send over the passed params.\n\t\t\t\t// We will get rid of the session data later on submit\n\n\t\t\t\t$hidden = $passed_params;\n\t\t\t\t\t\t\t\t\n\t\t\telse:\n\t\t\t\n\t\t\t\t$hidden = array();\n\t\t\t\n\t\t\tendif;\n\t\t\n\t\tendif;\n\t\t\t\t\n\t\t// -------------------------------------\n\t\t// Form Validation and Processing\n\t\t// -------------------------------------\n\t\t// Return the render function or process the form\n\t\t// -------------------------------------\n\t\t\n\t\t// Little workaround for form_validation relying on empty $_POST\n\t\t// var. Without this bad things happen.\n\t\t\n\t\t$post_count = count($_POST);\n\t\t\n\t\tif( $post_count == 5 ):\n\t\t\n\t\t\t$post_count = FALSE;\n\t\t\n\t\telse:\n\t\t\n\t\t\t$post_count = TRUE;\n\t\t\n\t\tendif;\n\t\n\t\t// -------------------------------------\n\t\t\n\t\tif ( $this->addon->form_validation->run() == FALSE || !$post_count ):\n\t\t\n\t\t\t// Pass global thing readable\n\t\t\t\n\t\t\t$_POST['global'] = $global;\n\t\t\t\t\t\n\t\t\t// Did this get kicked back? Ok, we need some info to pass\t\n\t\t\t\n\t\t\tif( isset($form_data) ): \n\t\t\t\n\t\t\t\t$validation_data['field_values'] \t= $form_data['form_fields'];\n\t\t\t\t$validation_data['validated'] \t\t= $validated;\n\t\t\t\t\n\t\t\t\t// Pass the row ID if we need to\n\t\t\t\t\n\t\t\t\tif( isset($form_data['page_data']['row_id']) ):\n\t\t\t\t\n\t\t\t\t\t$_POST['row_id'] = $form_data['page_data']['row_id'];\n\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t$this->addon->blocks->render_editor( $block, $_POST, $validation_data, $hidden );\n\t\t\t\n\t\t\telse:\n\t\t\t\n\t\t\t\t$this->addon->blocks->render_editor( $block, $_POST, array(), $hidden );\n\t\t\t\n\t\t\tendif;\n\t\t\n\t\telse:\n\t\t\n\t\t\t// So it's good. We just need to process the form and add the data back in\n\t\t\t\n\t\t\t$result = $this->_form_process( $block, $form_data, $global );\n\t\t\t\n\t\t\tif( $result && is_numeric($result) ):\n\t\t\t\n\t\t\t\t// If we have session data set for the block, get rid of it.\n\t\t\t\t\n\t\t\t\t$this->addon->session->unset_userdata( $block->block_slug.'_'.$this->addon->input->post('region_id').'_flash_params' );\n\t\t\t\n\t\t\t\techo $result;\n\t\t\t\n\t\t\telse:\n\t\t\t\n\t\t\t\techo 'BLOCKS_FORM_INPUT_FAILURE';\n\t\t\t\n\t\t\tendif;\n\t\t\n\t\tendif;\n\t}",
"public function meta_box_save()\n\t\t{\n\t\t\t\n\t\t\tif( isset( $_POST['post_ID'] ) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * New states have been saved already in handler_before_save_alb_post_data\n\t\t\t\t */\n\t\t\t\t$builder_stat = $this->get_alb_builder_status();\n\t\t\t\t$parser_state = $this->get_posts_shortcode_parser_state();\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Copy balanced shortcodes to content field so the shortcode tree can be built\n\t\t\t\t * \n\t\t\t\t */\n if( 'active' == $builder_stat )\n {\n\t\t\t\t\t$this->get_shortcode_parser()->set_builder_save_location( 'content' );\n\t\t\t\t\tif( isset( $_POST['_aviaLayoutBuilderCleanData'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_POST['content'] = ShortcodeHelper::clean_up_shortcode( $_POST['_aviaLayoutBuilderCleanData'], 'content' );\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/**\n\t\t\t\t\t\t *\t_aviaLayoutBuilderCleanData should be set by default, so this is only a fallback\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$_POST['content'] = ShortcodeHelper::clean_up_shortcode( $_POST['content'], 'content' );\n\t\t\t\t\t}\n }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_POST['content'] = $this->post_content;\n\t\t\t\t}\n \n\t\t\t\t/**\n\t\t\t\t * Save the hidden container and balance the shortcodes\n\t\t\t\t */\n if(isset($_POST['_aviaLayoutBuilderCleanData'])) \n {\n\t\t\t\t\t$this->get_shortcode_parser()->set_builder_save_location( 'clean_data' );\n \tupdate_post_meta( (int)$_POST['post_ID'], '_aviaLayoutBuilderCleanData', ShortcodeHelper::clean_up_shortcode( $_POST['_aviaLayoutBuilderCleanData'], 'balance_only' ) );\n }\n \n\t\t\t\t\n //extract all ALB shortcodes from the post array and store them so we know what we are dealing with when the user opens a page. \n //usesfull for special elements that we might need to render outside of the default loop like fullscreen slideshows\n//\t\t\t\t$matches = array();\n//\t\t\t preg_match_all(\"/\".ShortcodeHelper::get_fake_pattern().\"/s\", $_POST['content'], $matches, PREG_OFFSET_CAPTURE );\n\t\t\t\t\n\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Extract all ALB shortcodes from the post array and store them so we know what we are dealing with when the user opens a page.\n\t\t\t\t * Usesfull for special elements that we might need to render outside of the default loop like fullscreen slideshows.\n\t\t\t\t * \n\t\t\t\t * We always save this tree so we can be sure to have the correct state of the page when we load this post meta.\n\t\t\t\t */\n\t\t\t\t$tree = ShortcodeHelper::build_shortcode_tree( $_POST['content'] );\n\t\t\t\tupdate_post_meta( (int) $_POST['post_ID'], '_avia_builder_shortcode_tree', $tree );\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Now we can save the postmeta data to revision post\n\t\t\t\t */\n\t\t\t\t$this->save_alb_revision_data();\n }\n\t\t}",
"function write_html_form ($html) {\n write_js(\"parent.parent.document.getElementById('ecu_preview')\"\n . \".innerHTML = \\\"$html\\\"\"\n . \"+ parent.parent.document.getElementById('ecu_preview')\"\n . \".innerHTML\");\n }",
"protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n 'method' => 'post',\n 'field_name_suffix' => 'record',\n 'enctype' => 'multipart/form-data'\n )\n );\n\n\n\n $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('adminhtml')->__('测试数据')));\n\n $fieldset->addField('Status', 'text', array(\n 'name' => 'Status',\n 'label' => Mage::helper('adminhtml')->__('状态'),\n 'value' => Mage::registry('credits_test')->getStatus(),\n ));\n $fieldset->addField('title', 'text', array(\n 'name' => 'title',\n 'label' => Mage::helper('adminhtml')->__('标题'),\n 'value' => Mage::registry('credits_test')->getTitle(),\n ));\n $fieldset->addField('test_type','select', array(\n 'name' => 'test_type',\n 'label' => Mage::Helper('adminhtml')->__('类型'),\n 'values' => array('小说' => '小说'\n , '散文' => '散文', '诗歌' => '诗歌'),\n\n ));\n $fieldset->addField('content', 'text', array(\n 'name' => 'content',\n 'label' => Mage::helper('adminhtml')->__('内容'),\n 'value' => Mage::registry('credits_test')->getContent(),\n ));\n $fieldset->addField('time', 'text', array(\n 'name' => 'time',\n 'label' => Mage::helper('adminhtml')->__('时间'),\n 'value' => date(\"Y-m-d H:m:s\", Mage::getModel('core/date')->timestamp(time())),\n ));\n $fieldset->addField('email', 'text', array(\n 'name' => 'email',\n 'label' => Mage::helper('adminhtml')->__('邮箱'),\n 'value' => Mage::registry('credits_test')->getEmail(),\n ));\n\n $fieldset->addField('filename', 'image', array(\n 'label' => $this->__('Image'),\n 'required' => true,\n 'name' => 'filename',\n // 'renderer' => 'd1m_credits/adminhtml_credittest_grid_column_renderer_image', //get the image HTML code\n 'value' => Mage::registry('credits_test')->getImg()\n ));\n\n\n $form->setUseContainer(true);\n $this->setForm($form);\n return parent::_prepareForm();\n\n }",
"public function save(){\n $blockid = (int) requested('blockid');\n $block = \\GridManager::find($blockid);\n $block_info = get_block_info($block->name);\n $params = requested('params');\n $tpl = requested('tpl');\n $block->params = $params;\n $block->tpl = $tpl;\n if($block->save()){\n return \\Redirect::to('backend/blockmanager')->withMessage($this->notifyView(t('messages.block_saved'),'success'));\n }\n return Redirect::to('backend/blockmanager')->withMessage($this->notifyView(t('messages.error_occured'),'danger'));\n }",
"public function saveContentAction() \n {\n $session = Mage::getSingleton('adminhtml/session');\n\n if($data = $this->getRequest()->getPost())\n {\n $blockModel = Mage::getModel('zblocks/zblocks')->load($data['zblock_id']);\n if(!$blockModel->getId())\n {\n $session->addError($this->__('Parent block no longer exists'));\n $this->_redirect('*/*/'); \n return;\n }\n\n $model = Mage::getModel('zblocks/content');\n try\n {\n $model\n ->setData($data)\n ->setId($this->getRequest()->getParam('id'))\n ->save();\n\n $session->addSuccess($this->__('Block %s was successfully saved', '"'.$model->getTitle().'"'));\n // $session->setZBlocksContentData(false);\n\n if($this->getRequest()->getParam('back'))\n $this->_redirect('*/*/editContent', array('id' => $model->getId(), 'block_id' => $data['zblock_id']));\n else\n $this->_redirect('*/*/edit', array('id' => $data['zblock_id'], 'tab' => 'content'));\n\n return;\n } \n catch (Exception $e) {\n $session->addError($e->getMessage());\n $session->setZBlocksContentData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n $session->addError($this->__('Unable to find a block to save'));\n $this->_redirect('*/*/');\n }",
"function whos_amung_us_configuration_form_submit($form, &$form_state) {\n\n $config = array(\n 'widget' => $form_state['values']['widget'],\n 'foreground' => $form_state['values']['foreground'],\n 'background' => $form_state['values']['background'],\n 'position' => $form_state['values']['position'],\n 'map' => $form_state['values']['map'],\n 'marker' => $form_state['values']['marker'],\n 'width' => $form_state['values']['width'],\n 'height' => $form_state['values']['height'],\n );\n\n db_insert('whos_amung_us_block')\n ->fields(\n array(\n 'info' => $form_state['values']['name'],\n 'machine_name' => $form_state['values']['mname'],\n 'config' => serialize($config),\n )\n )\n ->execute();\n\n drupal_set_message(t('Block saved.'));\n drupal_goto('admin/structure/block');\n\n}",
"protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('banner_content_');\n\n $model = $this->_coreRegistry->registry('current_banner');\n\n $this->_eventManager->dispatch(\n 'adminhtml_banner_edit_tab_content_before_prepare_form',\n ['model' => $model, 'form' => $form]\n );\n\n $fieldsetHtmlClass = 'fieldset-wide';\n $fieldset = $this->_createDefaultContentFieldset($form, $fieldsetHtmlClass);\n\n if ($this->_storeManager->isSingleStoreMode() == false) {\n $this->_createDefaultContentForStoresField($fieldset, $form, $model);\n }\n\n $this->createStoreDefaultContentField($fieldset, $model, $form);\n\n if ($this->_storeManager->isSingleStoreMode() == false) {\n $this->_createStoresContentFieldset($form, $model);\n }\n $this->setForm($form);\n return parent::_prepareForm();\n }",
"public function save() {\n\t\t// must ensure that html is cleaned but safe html tags are passed through.\n\t\t$safehtml = SomeRequest::getString(\"content\",\"\",\"post\",JREQUEST_ALLOWHTML);\n\t\techo \"<pre>\";\n\t\techo htmlentities($safehtml);\t\t\n\t\techo \"</pre>\";\n\t\t$view = $this->getView('editor');\n\t\t$view->display();\n\t}",
"public function new() {\n $data = [];\n $this->form_validation->set_rules(Front::BLOCK_NAME, 'Name', Front::REQUIRED);\n $this->form_validation->set_rules(Front::BLOCK_ACRONYM, 'Acronym', Front::REQUIRED);\n $smiles = $this->input->post(Front::BLOCK_SMILES);\n if (!isset($smiles) || $smiles === \"\") {\n $this->form_validation->set_rules(Front::BLOCK_FORMULA, 'Formula', Front::REQUIRED);\n }\n if ($this->form_validation->run() === false) {\n $data[Front::ERRORS] = $this->errors;\n $this->renderNew($data);\n return;\n }\n $data[Front::ERRORS] = 'Block correctly saved';\n try {\n $blockTO = $this->setupNewBlock($smiles);\n $this->database->insert($blockTO);\n } catch (IllegalArgumentException $exception) {\n $data[Front::ERRORS] = $exception->getMessage();\n Logger::log(LoggerEnum::WARNING, $exception->getTraceAsString());\n } catch (UniqueConstraintException $exception) {\n $data[Front::ERRORS] = self::BLOCK_WITH_THIS_ACRONYM_ALREADY_IN_DATABASE;\n Logger::log(LoggerEnum::WARNING, $exception->getMessage());\n } catch (Exception $exception) {\n $data[Front::ERRORS] = $exception->getMessage();\n Logger::log(LoggerEnum::ERROR, $exception->getTraceAsString());\n } finally {\n Front::errorsCheck($data);\n $this->renderNew($data);\n }\n }",
"function smarty_block_form($params, $content, &$view)\n{\t\n\t//OBS: se o nome do modelo que o cara colocou como parametro não existir testar para não dar merda!!\n\t\n\t//QUANDO FECHA O BLOCO:\n\t\n if ( isset($content) ) \n {\n\t\t//Passa os parametros inúteis para o processamento direto para a tag\n\t\t$output = '<fieldset';\n\t\tforeach($params as $name => $value){\n\t\t\t$output .= \" $name='$value'\";\n\t\t}\n\t\t$output .= '>';\n \t$output .= $content; //joga os inputs na saida\n\t\t$output .= '</fieldset>';\n\n $modelArr = $view->getTemp('form_modelName');\n array_shift($modelArr);\n $view->unsetTemp('form_modelName');\n $view->setTemp('form_modelName', $modelArr); //unseta essa variavel temporária (nome do modelo)\n\n\t\treturn $output;\n }\n\t\n\t\n\t//QUANDO ABRE O BLOCO:\n\t\n\t//passa o nome do modelo para o input\n\n\tif ( isset($params['model']) ) \n\t{\n $modelArr = $view->getTemp('form_modelName');\n if ( substr($params['model'], 0, 1) == '/' ) $params['model'] = $modelArr[0].$params['model'];\n array_unshift($modelArr, $params['model']);\n\n $view->unsetTemp('form_modelName');\n\t\t$view->setTemp('form_modelName', $modelArr);\n\t\tunset($params['model']);\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should test that a coach can be created if the certification field is null | public function testShouldNotFailIfTheRequiredFieldCertificationIsNull() {
$entityRegistrant = $this->getRegistrant();
$entityCoach = new Coach;
$entityCoach->roles = 'Role 1, role 2, role 3...';
$entityCoach->years_of_experience = '5';
$entityRegistrant->save();
$entityRegistrant->coach()->save($entityCoach);
$this->assertTrue(!is_null($entityCoach->id));
} | [
"public function testShouldFailIfTheRequiredFieldRolesIsNull() {\n $this->expectException(\\PDOException::class);\n\n $entityRegistrant = $this->getRegistrant();\n\n $entityCoach = new Coach;\n $entityCoach->certifications = 'Certification 1, certification 2, cert 3...';\n $entityCoach->years_of_experience = '5';\n\n $entityRegistrant->save();\n $entityRegistrant->coach()->save($entityCoach);\n }",
"public function testAssignmentCampusMethod()\n {\n $assignment = factory(NonCourseAssignment::class)->create();\n $campus = factory(FormFieldLookup::class)->create();\n $assignment->campus()->associate($campus);\n $assignment->save();\n\n $this->assertDatabaseHas('non_course_assignments', [\n 'id' => $assignment->id,\n 'campus_id' => $campus->id,\n ]);\n }",
"function testCreateChute() {\n $chute = $this->client->chutes->create(array('name' => 'Testing things'));\n $this->assertEqual('Testing things', $chute->name);\n $this->assertNotNull($chute->id);\n $this->chuteId = $chute->id;\n //client.chutes.create name: 'Testing things', (err, chute) ->\n //chuteId = chute.id\n //err.should.equal(no) and chute.name.should.equal('Testing things')\n //do done\n }",
"public function testGetConcert() \r\n { \r\n $artiste = new Artiste(); \r\n\t\t$concert = new Concert();\r\n\t\t\r\n\t\t$concert->setNom(\"Musilac 2018\");\t\t\r\n $artiste->addConcert($concert); \r\n\t\t$resultat = $artiste->getConcert();\r\n \r\n $this->assertEquals($concert, $resultat); \r\n }",
"public function testChallengeMembersCreate()\n {\n }",
"public function testShouldCreateAPlayerIfNotRequiredFieldsAreNull() {\n\n $entityRegistration = $this->getRegistration();\n\n $entityPlayerRegistration = new PlayerRegistration;\n $entityPlayerRegistration->grade = 'K-12';\n $entityPlayerRegistration->height = '5.3';\n $entityPlayerRegistration->graduation_year = '2018';\n $entityPlayerRegistration->sports = 'my sports...';\n $entityPlayerRegistration->weight = '10';\n $entityPlayerRegistration->years_at_sport = '3';\n\n $entityRegistration->playerRegistration()->save($entityPlayerRegistration);\n\n $this->assertTrue(!is_null($entityPlayerRegistration->id));\n }",
"public function testOfferingCampusMethod()\n {\n $offering = factory(Offering::class)->create();\n $campus = factory(FormFieldLookup::class)->create();\n $offering->campus()->associate($campus);\n $offering->save();\n\n $this->assertDatabaseHas('offerings', [\n 'id' => $offering->id,\n 'campus_id' => $campus->id,\n ]);\n }",
"public function testGetInvalidCrewByCrewLocation() {\n\t\t//grab a company id that exceeds the maximum allowable company id\n\t\t$crew = Crew::getCrewByCrewLocation($this->getPDO(), \"nobody ever went here\");\n\t\t$this->assertNull ($crew);\n\t}",
"public function test_permitted_user_can_stor_on_course()\n {\n\n $this->actUser();\n auth()->user()->givePermissionTo(Permission::MANAGE_OWN_COURSES, Permission::TEACH);\n Storage::fake('local');\n $response = $this->post(route('courses.store'), $this->courseData());\n $response->assertRedirect(route('courses.index'));\n $this->assertEquals($this->count(), 1);\n\n\n }",
"public function test_guest_users_cannot_create_creatives(){\n\n $response = $this->post('creatives', [\n 'name' => 'Test Creative',\n 'fileUrl' => ''\n ]);\n\n $response->assertRedirect('login');\n }",
"public function test_it_should_return_an_invalid_certificate_on_bogus_certificate()\n {\n $web = new Web('somesource');\n $cert = $web->load();\n $this->assertInstanceOf(CertInfo::class, $cert);\n }",
"public function testCreativesAudienceVerifiedGet()\n {\n }",
"public function testCreateOfficialsSurveyPass()\n {\n $communityId = 5;\n $this->assertAlertable($communityId, 'createOfficialsSurvey');\n }",
"public function testCantCreateCompetitionWithoutCredits(): void\n {\n $user = $this->createUser();\n $team = $this->createTeam([$user], [MemberRole::CREATE_COMPETITIONS], 0);\n\n $response = $this->actingAs($user, 'api')\n ->postJson('/api/competitions', [\n 'title' => 'competition title',\n 'subtitle' => 'competition subtitle',\n 'registration_till' => Carbon::now()->addDays(2)->toDateTimeString(),\n 'organization_date' => Carbon::now()->addDays(3)->toDateTimeString(),\n 'team_id' => $team->id,\n ]);\n\n $response\n ->assertStatus(422)\n ->assertSeeText('insufficient credit amount');\n }",
"public function testBreederCreateCertificateRequest()\n {\n // Imitate AJAX request\n $response = $this->actingAs($this->breederUser)\n ->withHeaders([\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ])\n ->json('POST', '/breeder/certificates',\n [\n 'breederId' => 1,\n 'farmId' => 1,\n ]\n );\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'id' => 1,\n 'adminName' => '',\n 'dateRequested' => '',\n 'datePayment' => '',\n 'dateDelivery' => '',\n 'receiptNo' => '',\n 'status' => 'draft' \n ]);\n }",
"public function testCostValidation()\n {\n $aircraft = factory(\\App\\Aircraft::class)->create();\n $aircraft->cost = null;\n $this->assertFalse($aircraft->save());\n\n $aircraft->cost = 'a';\n $this->assertFalse($aircraft->save());\n\n $aircraft->cost = 0.5;\n $this->assertFalse($aircraft->save());\n\n $aircraft->cost = -3;\n $this->assertFalse($aircraft->save());\n\n $aircraft->cost = 50;\n $this->assertTrue($aircraft->save());\n }",
"public function testGetConcert() \r\n { \r\n $actu = new Actualite(); \r\n\t\t$concert = new Concert();\r\n\t\t\r\n\t\t$concert->setNom(\"Musilac 2018\");\t\t\r\n $actu->setConcert($concert);\r\n\t\t$resultat = $actu->getConcert()->getNom();\r\n \r\n $this->assertEquals(\"Musilac 2018\", $resultat); \r\n }",
"public function testCheckForEmployeeCreation()\n {\n //Create company first(FOREIGN KEY Constraint)\n factory('App\\Companies')->create();\n\n factory('App\\Employees')->create();\n\n $this->assertCount(1, Employees::all());\n }",
"public function testAddARandomDisciplineToARandomCourse()\n {\n $rndCourseId = Curso::all()->random()->id;\n $rndDisciplineId = Disciplina::all()->random()->id;\n $data = [\n 'disciplina_id' => $rndDisciplineId,\n 'curso_id' => $rndCourseId,\n 'obrigatoria' => true\n ];\n\n $validator = Validator::make($data, (new CourseDisciplinesRequest)->rules());\n $this->assertFalse($validator->fails());\n\n $courseDiscipline = DisciplinaCurso::create($data);\n $this->assertDatabaseHas('disciplinas_curso', ['id' => $courseDiscipline->id]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gives you all the doctors in the database | public function getAll_doctors()
{
$query = $this->db->get( 'doctors' );
$doctors = $query->result();
return $doctors;
} | [
"public function getAllFakeDoctors(){\n $toGetFakeDoctorData = $this->db->select('*')->from('fakedoctors')->get();\n return $toGetFakeDoctorData->result();\n }",
"public function doctors_get()\n {\n $result_dr = $this->DoctorModel->getAll_doctors();\n\n if( $result_dr )\n $this->response( $result_dr, RestController::HTTP_OK );\n\n $this->response( [\n 'status' => FALSE,\n 'message' => 'No doctors were found'\n ], RestController::HTTP_NOT_FOUND );\n }",
"public function doctors()\n {\n return $this->hasMany(Doctor::class);\n }",
"public function getDoctors()\n {\n //todo get from DB, using stub for now\n return [\n 5 => 'Катаева В. Р.',\n 24 => 'Воронин М. В.'\n ];\n }",
"public function getAllLocatedDoctors()\n {\n $toGetAllLocatedDocData = $this->db->select('dd.docid, dd.docname, dd.address, dd.regdate, dd.qualifications')->\n from('doclocation a')->\n join('docdetails dd','dd.docid = a.docid')->\n group_by('dd.docid')->get();\n return $toGetAllLocatedDocData->result();\n }",
"public function doctorsResourceCollection()\n {\n $doctors = Doctor::all();\n\n return DoctorResource::collection($doctors);\n }",
"public function doctors()\n {\n return $this->hasMany('App\\Models\\Doctors', 'city_id');\n }",
"public function _doctor_list()\n {\n $doctors = $this->bitauth->get_users_by_role('doctor');\n $doctor_list=array();\n $doctor_list[0]='Doctor Name';\n foreach ($doctors as $_doctor) \n {\n $doctor_list[$_doctor->user_id]=$_doctor->last_name.', '.$_doctor->first_name;\n }\n return $doctor_list;\n }",
"public function display_doctors(){\r\n\t\t$select = \"Doctor\";\r\n\t\t$this->db->where('vuser_post',$select);\r\n\t\t$query = $this->db->get('vuser');\r\n\t\treturn $query->result();\r\n\t}",
"public function doctors()\n {\n return $this->hasMany('App\\Doctor');\n }",
"public function doctors()\n {\n $total_doctors = doctor::all();\n $doctors = doctor::paginate(6);\n return view('doctor.index',compact('doctors','total_doctors'));\n }",
"public function findDoctors(Request $request) {\n $doctors = Appointment::with('doctor')->whereDate('date', $request->date)->get();\n return $doctors;\n }",
"public function doctors()\n {\n return $this->hasMany('App\\Models\\Doctors', 'location_id');\n }",
"public function retrieveDoctor() {\n\t\t\treturn $this->db->query(\"SELECT\n *\n FROM\n doctor WHERE name != 'admin'\");\n\t\t}",
"public function hospitalsHasDoctor()\n {\n return $hospitals = Hospital::whereHas('doctors')->get();\n }",
"public function getAllDoctors_Count() {\n //print_r($hosp_id);die();\n $result = $this->Dashboard_model->getAllDoctors_Count();\n return $result;\n }",
"public function hospitalhasdoctor(){\n\n $hospitals = Hospital::whereHas('doctors')->get();\n return $hospitals;\n\n\n }",
"public function get_day_doctors()\n {\n $list = $this->Queue_model->get_day_doctors($_POST['date']);\n\n // Output to json format\n echo json_encode($list);\n }",
"public function getDoctorsList(Request $request)\n {\n $status = 200;\n $doctors_data = OrganizationDistributor::with(['OrganizationData.WorkerData', 'Group'])->whereHas('Group', function ($query) use ($request) {\n $query->where('org_unique_id', $request->organization_id);\n })->whereHas('OrganizationData', function ($query) use ($request) {\n $query->whereNotNull('lanr')->where('worker_data_species_id', 'lang_doc')->orderBy('id', 'desc');\n })->get();\n if ($doctors_data) {\n $res = json_encode($doctors_data); //encode the data\n //to encrypt the response\n $passphrase = substr(Auth::guard('api')->user()->api_token, 0, 20);\n $encrypted_data = Helper::cryptoJsAesEncrypt($passphrase, $res);\n $encrypted_phrase = Helper::encrypt($passphrase, trim(Auth::guard('api')->user()->PatientData()->first()->public_key));\n $response = [\n 'success' => true,\n 'message' => \\Lang::get('lang.organization-doctor-fetched'),\n 'passphrase' => base64_encode($encrypted_phrase),\n 'data' => $encrypted_data,\n ];\n return response()->json($response, $status);\n } else {\n //if doctors are not found\n $err_response = [\n 'success' => false,\n 'errors' => \\Lang::get('lang.doctors-not-found')\n ];\n return response()->json($err_response, 200);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom WP API endpoint | function tsd_json_plugin_enable_api() {
// Ref: https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/
// Create json-api endpoint
// NOTE: When this is changed, remember to also update the `tsd-json.json` file
// in the client with the content on https://www.stanforddaily.com/wp-json/tsd/json/v1/.
add_action('rest_api_init', function () {
register_rest_route('tsd/json/v1', '/home', [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_home',
]);
register_rest_route('tsd/json/v1', '/home-mobile', [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_home_mobile',
]);
register_rest_route('tsd/json/v1', '/home/more/(?P<extraPageNumber>\d+)', [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_home_more',
]);
// Note that we use `postYear`, etc. because `year`, etc. is a reserved word in `WPAPI` in the client side.
register_rest_route('tsd/json/v1', "/posts/(?P<postYear>\d{4})/(?P<postMonth>\d{2})/(?P<postDay>\d{2})/(?P<postSlug>[\S]+)", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_post',
]);
register_rest_route('tsd/json/v1', "/postsId/(?P<postId>\d+)", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_post_by_id',
]);
register_rest_route('tsd/json/v1', "/page/(?P<pageSlug>[\S]+)", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_page',
]);
register_rest_route('tsd/json/v1', "/category/(?P<categorySlugs>[\S]+)/(?P<pageNumber>\d+)", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_category_posts',
]);
register_rest_route('tsd/json/v1', "/tag/(?P<tagSlugs>[\S]+)/(?P<pageNumber>\d+)", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_tag_posts',
]);
register_rest_route('tsd/json/v1', "/author/(?P<authorSlug>[\w-]+)/(?P<pageNumber>\d+)", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_author_posts',
]);
register_rest_route('tsd/json/v1', "/search/(?P<searchKeyword>[\S]+)/(?P<pageNumber>\d+)", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_search',
]);
register_rest_route('tsd/json/v1', "/nav", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_nav_info',
]);
register_rest_route( 'tsd/json/v1', "/most-viewed", [
'methods' => 'GET',
'callback' => 'tsd_json_plugin_return_most_viewed_posts',
]);
});
function tsd_json_plugin_query_not_featured_posts( $query ) {
$featured_category = get_category_by_slug('featured');
$featured_category_id = $featured_category->term_id;
$query[ 'category__not_in' ] = [ $featured_category_id ];
return query_posts( $query );
}
// Returns an array of author.
function tsd_json_plugin_get_author_info( $post, $include_author_description = false ) {
$author_objects = [];
if ( function_exists( 'get_coauthors' ) ) {
$author_objects = get_coauthors( $post->ID );
} else {
$author_objects[] = get_user_meta( $post->post_author );
}
$authors = [];
foreach ($author_objects as $author) {
$authors[] = copy_of_tsd_authors_plugin_author_info( $author );
};
return $authors;
}
function copy_of_tsd_authors_plugin_author_info( $user ) {
global $tsd_author_custom_fields;
if ( $user === false ) {
// User ID does not exist
return new WP_Error( 'no_author', 'Invalid author', ['status' => 404] );
}
$image_url = "https://www.stanforddaily.com/wp-content/themes/thestanforddaily/img/placeholder-avatar.png";
$image_id = get_user_meta( $user->ID, "tsd_profileImage", true );
if ( ! empty( $image_id ) ) {
$image_url = wp_get_attachment_image_src( $image_id, 'thumbnail' )[0];
}
// https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/#return-value
// "After your callback is called, the return value is then converted to JSON, and returned to the client."
// https://codex.wordpress.org/Function_Reference/get_user_meta
// "To avoid this, you may want to run a simple array_map() on the results of get_user_meta() in order to take only the first index of each result (this emulating what the $single argument does when $key is provided:"
$all_meta_for_user = array_map( function( $a ){ return $a[0]; }, get_user_meta( $user->ID, null ) );
$meta_to_return = [
'id' => $user->ID,
'displayName' => html_entity_decode( $user->display_name ),
'userNicename' => $user->user_nicename,
'url' => wp_make_link_relative( get_author_posts_url( $user->ID ) ),
'avatarUrl' => $image_url,
'description' => html_entity_decode( get_the_author_meta( 'description', $user->ID ) )
];
foreach ($all_meta_for_user as $key => $value) {
$shortKey = preg_replace('/^tsd_/', '', $key);
if (array_key_exists($shortKey, $tsd_author_custom_fields)) {
if (is_serialized($value)) {
// We have to unserialize array if it's serialized (e.g. "a:4:{i:0;s:2:"op";i:1;s:5:"grind";i:2;s:6:"sports";i:3;s:8:"copyedit";}")
$value = unserialize($value);
}
$meta_to_return[$shortKey] = $value;
}
}
return $meta_to_return;
}
function tsd_json_plugin_get_category( $category ) {
return [
'id' => $category->term_id,
'name' => html_entity_decode( $category->name ),
'slug' => $category->slug,
'url' => wp_make_link_relative( get_category_link( $category ) ),
];
}
// Returns a single category info.
function tsd_json_plugin_get_category_info( $post ) {
$primary_category_id = get_post_meta( $post->ID, '_yoast_wpseo_primary_category', true );
$primary_category = null;
if ( empty( $primary_category_id ) ) {
$main_categories = [ 'featured', 'NEWS', 'SPORTS', 'opinions', 'thegrind', 'arts-life' ];
foreach ( $main_categories as $main_category ) {
if ( in_category( $main_category, $post ) ) {
$primary_category = get_category_by_slug( $main_category );
break;
}
}
if ( is_null( $primary_category ) ) {
// If the post is not in any `$main_categories`, simply get the first post category.
$post_categories = get_the_category( $post->ID );
if ( count( $post_categories ) > 0 ) {
$primary_category = $post_categories[0];
}
}
} else {
$primary_category = get_category( $primary_category_id );
}
if ( ! is_null( $primary_category ) ) {
return tsd_json_plugin_get_category( $primary_category );
} else {
return null;
}
}
function tsd_json_plugin_get_processed_posts( $query, $options = [] ) {
$defaults_options = array(
'include_post_content' => false,
'exclude_featured_category' => false,
'include_category_info_for_each_post' => false,
'include_author_description' => false,
);
$options = wp_parse_args( $options, $defaults_options );
$post_objects = null;
if ( $options[ 'exclude_featured_category' ] ) {
$post_objects = tsd_json_plugin_query_not_featured_posts( $query );
} else {
$post_objects = query_posts( $query );
}
$posts = [];
foreach ( $post_objects as $post_object ) {
$post = tsd_json_plugin_convert_keys_to_camelCase( $post_object->to_array() );
$post[ 'postTitle' ] = html_entity_decode( apply_filters( 'the_title', $post[ 'postTitle' ] ) );
$post[ 'postExcerpt' ] = html_entity_decode( get_the_excerpt( $post_object ) );
if ( ! $options[ 'include_post_content' ] ) {
unset( $post[ 'postContent' ] );
unset( $post[ 'postContentFiltered' ] );
} else {
// https://codex.wordpress.org/Class_Reference/WP_Post#Accessing_the_WP_Post_Object
$post[ 'postContent' ] = apply_filters( 'the_content', $post[ 'postContent' ] );
}
foreach( $post[ 'tagsInput' ] as $key => $tag ) {
$post[ 'tagsInput' ][ $key ] = html_entity_decode( $tag );
}
$thumbnail_full_url = get_the_post_thumbnail_url( $post_object, 'full' );
if ( ! empty ( $thumbnail_full_url ) ) {
$thumbnail_info = [];
$thumbnail_info_urls = [];
$thumbnail_info_urls[ 'full' ] = $thumbnail_full_url;
$thumbnail_info_urls[ 'mediumLarge' ] = get_the_post_thumbnail_url( $post_object, 'medium_large' );
$thumbnail_info_urls[ 'thumbnail' ] = get_the_post_thumbnail_url( $post_object, 'thumbnail' );
$thumbnail_info[ 'urls' ] = $thumbnail_info_urls;
$thumbnail_info[ 'caption' ] = get_the_post_thumbnail_caption( $post_object );
$thumbnail_id = get_post_thumbnail_id( $post_object );
$thumbnail_alt = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
$thumbnail_info[ 'alt' ] = $thumbnail_alt;
$post[ 'thumbnailInfo' ] = $thumbnail_info;
}
if ( function_exists( 'get_the_subtitle' ) ) {
$post[ 'postSubtitle' ] = html_entity_decode( get_the_subtitle( $post_object, '', '', false ) );
}
$post[ 'tsdAuthors' ] = tsd_json_plugin_get_author_info( $post_object, $options[ 'include_author_description' ] );
if ( $options[ 'include_category_info_for_each_post' ] ) {
$category_info = tsd_json_plugin_get_category_info( $post_object );
if ( ! is_null( $category_info ) ) {
$post[ 'tsdPrimaryCategory' ] = $category_info;
}
$post[ 'tsdCategories' ] = [];
foreach ( $post[ 'postCategory' ] as $category_id ) {
$post[ 'tsdCategories' ][] = tsd_json_plugin_get_category( get_category( $category_id ) );
}
}
$post_date = strtotime( $post_object->post_date );
$post[ 'tsdUrlParameters' ] = [
"year" => date('Y', $post_date),
"month" => date('m', $post_date),
"day" => date('d', $post_date),
"slug" => $post_object->post_name,
];
$posts[] = $post;
}
return $posts;
}
function tsd_json_plugin_get_home_sections() {
$sections = [];
$sections[ 'featured' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'featured', 'posts_per_page' => 3 ] );
$sections[ 'news' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'NEWS', 'posts_per_page' => 4 ], [ 'exclude_featured_category' => true ] );
$sections[ 'sports' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'SPORTS', 'posts_per_page' => 7 ], [ 'exclude_featured_category' => true ] );
$sections[ 'opinions' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'opinions', 'posts_per_page' => 4 ], [ 'exclude_featured_category' => true ] );
$sections[ 'theGrind' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'thegrind', 'posts_per_page' => 4 ], [ 'exclude_featured_category' => true ] );
$sections[ 'artsAndLife' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'arts-life', 'posts_per_page' => 4 ], [ 'exclude_featured_category' => true ] );
$sections[ 'cartoons' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'cartoons', 'posts_per_page' => 1 ], [ 'exclude_featured_category' => true ] );
// $sections[ 'sponsored' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'sponsored', 'posts_per_page' => 4 ], [ 'exclude_featured_category' => true, 'include_category_info_for_each_post' => true ] );
$sections[ 'humor' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'humor', 'posts_per_page' => 4 ], [ 'exclude_featured_category' => true ] );
return $sections;
}
function tsd_json_plugin_get_home_mobile_sections() {
$sections = [];
$sections[ 'featured' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'featured', 'posts_per_page' => 3 ] );
$sections[ 'news' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'NEWS', 'posts_per_page' => 6 ], [ 'exclude_featured_category' => true ] );
$sections[ 'sports' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'SPORTS', 'posts_per_page' => 6 ], [ 'exclude_featured_category' => true ] );
$sections[ 'opinions' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'opinions', 'posts_per_page' => 6 ], [ 'exclude_featured_category' => true ] );
$sections[ 'theGrind' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'thegrind', 'posts_per_page' => 6 ], [ 'exclude_featured_category' => true ] );
$sections[ 'artsAndLife' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'arts-life', 'posts_per_page' => 6 ], [ 'exclude_featured_category' => true ] );
$sections[ 'cartoons' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'cartoons', 'posts_per_page' => 6 ], [ 'exclude_featured_category' => true ] );
$sections[ 'humor' ] = tsd_json_plugin_get_processed_posts( [ 'category_name' => 'humor', 'posts_per_page' => 6 ], [ 'exclude_featured_category' => true ] );
return $sections;
}
function tsd_json_plugin_get_home_more_from_the_daily( $home_sections, $paged = -1 ) {
$main_posts_id = [];
foreach ($home_sections as $section) {
foreach ($section as $post) {
$main_posts_id[] = $post[ 'id' ];
}
}
$posts_per_page = MORE_FROM_DAILY_POST_PER_PAGE;
if ( $paged === -1 ) {
$posts_per_page *= MORE_FROM_DAILY_INITIAL_NUMBER_OF_PAGES;
$paged = 1;
} else {
$paged += MORE_FROM_DAILY_INITIAL_NUMBER_OF_PAGES;
}
$more_from_the_daily = tsd_json_plugin_get_processed_posts(
[
'post__not_in' => $main_posts_id,
'posts_per_page' => $posts_per_page,
'paged' => $paged,
],
[ 'include_category_info_for_each_post' => true ]
);
return $more_from_the_daily;
}
function tsd_json_plugin_return_home() {
$sections = tsd_json_plugin_get_home_sections();
$sections[ 'moreFromTheDaily' ] = tsd_json_plugin_get_home_more_from_the_daily( $sections );
// `[]` here is important so that we can get info for homepage instead of anything queried above.
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer( [] );
$sections[ "tsdMeta" ] = $head_and_footer;
$sections[ "tsdMeta" ][ "categories" ] = tsd_json_plugin_get_categories_from_category_slugs( [
'featured',
'NEWS',
'SPORTS',
'opinions',
'arts-life',
'thegrind',
'cartoons',
], true );
return $sections;
}
function tsd_json_plugin_return_home_mobile() {
$sections = tsd_json_plugin_get_home_mobile_sections();
// `[]` here is important so that we can get info for homepage instead of anything queried above.
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer( [] );
$sections[ "tsdMeta" ] = $head_and_footer;
$sections[ "tsdMeta" ][ "categories" ] = tsd_json_plugin_get_categories_from_category_slugs( [
'featured',
'NEWS',
'SPORTS',
'opinions',
'arts-life',
'thegrind',
'cartoons',
], true );
return $sections;
}
function tsd_json_plugin_return_home_more( $request ) {
$extra_page_number = (int) $request[ "extraPageNumber" ];
if ( $extra_page_number <= 1 ) {
return new WP_Error( 'invalid_page_number', 'Extra page number number start from 2.', [ 'status' => 404 ] );
}
$home_sections = tsd_json_plugin_get_home_sections();
$more_from_the_daily = tsd_json_plugin_get_home_more_from_the_daily( $home_sections, $extra_page_number - 1 );
return $more_from_the_daily;
}
function tsd_json_plugin_get_wp_head_and_wp_footer( $query = null ) {
// https://wordpress.stackexchange.com/q/185287/75147
// https://stackoverflow.com/a/24766541/2603230
global $wp_query;
if ( ! is_null( $query ) ) {
$page_to_load = new WP_Query( $query );
$wp_query = $page_to_load;
} else {
// If is null, we will use the previous `$wp_query`.
}
the_post();
ob_start();
get_header( 'headonly' );
$head = ob_get_clean();
ob_start();
get_footer( 'footeronly' );
$footer = ob_get_clean();
wp_reset_query();
return [
"wpHead" => $head,
"wpFooter" => $footer,
];
}
function tsd_json_plugin_return_post( $request ) {
$year = (int) $request[ "postYear" ];
$month = (int) $request[ "postMonth" ];
$day = (int) $request[ "postDay" ];
$slug = (string) $request[ "postSlug" ];
if ( ! checkdate( $month, $day, $year ) ) {
return new WP_Error( 'invalid_date', 'The date is invalid.', [ 'status' => 404 ] );
}
$posts = tsd_json_plugin_get_processed_posts(
[
'year' => $year,
'monthnum' => $month,
'day' => $day,
'name' => $slug,
],
[
'include_post_content' => true,
'include_category_info_for_each_post' => true,
'include_author_description' => true,
]
);
if ( empty( $posts ) ) {
return new WP_Error( 'post_not_found', 'This post cannot be found.', [ 'status' => 404 ] );
}
if ( count( $posts ) > 1 ) {
return new WP_Error( 'more_than_one_post_found', 'It returns more than one post!', [ 'status' => 500 ] );
}
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer();
$posts[0][ "tsdMeta" ] = $head_and_footer;
return $posts[0];
}
function tsd_json_plugin_return_post_by_id( $request ) {
$id = (int) $request[ "postId" ];
$posts = tsd_json_plugin_get_processed_posts(
[
'p' => $id,
],
[
'include_post_content' => true,
'include_category_info_for_each_post' => true,
]
);
if ( empty( $posts ) ) {
return new WP_Error( 'post_not_found', 'This post cannot be found.', [ 'status' => 404 ] );
}
if ( count( $posts ) > 1 ) {
return new WP_Error( 'more_than_one_post_found', 'It returns more than one post!', [ 'status' => 500 ] );
}
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer();
$posts[0][ "tsdMeta" ] = $head_and_footer;
return $posts[0];
}
function tsd_json_plugin_return_page( $request ) {
$slug = (string) $request[ "pageSlug" ];
$pages = tsd_json_plugin_get_processed_posts(
[
'pagename' => $slug,
],
[
'include_post_content' => true,
]
);
if ( empty( $pages ) ) {
return new WP_Error( 'page_not_found', 'This page cannot be found.', [ 'status' => 404 ] );
}
if ( count( $pages ) > 1 ) {
return new WP_Error( 'more_than_one_page_found', 'It returns more than one page!', [ 'status' => 500 ] );
}
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer();
$pages[0][ "tsdMeta" ] = $head_and_footer;
return $pages[0];
}
function tsd_json_plugin_return_category_posts( $request ) {
$page_number = (int) $request[ "pageNumber" ];
if ( $page_number <= 0 ) {
return new WP_Error( 'invalid_page_number', 'Page number start from 1.', [ 'status' => 404 ] );
}
$category_slugs = $request[ "categorySlugs" ];
// https://stackoverflow.com/a/1361752/2603230
$pos = strrpos($category_slugs, '/');
$last_category_slug = $pos === false ? $category_slugs : substr($category_slugs, $pos + 1);
$category = get_category_by_slug( $last_category_slug );
if ( ! $category ||
// Make sure this is the correct subcategory
("/category/$category_slugs/") !== wp_make_link_relative( get_category_link( $category ) )
) {
return new WP_Error( 'category_not_found', 'Category not found.', [ 'status' => 404 ] );
}
$category_posts = tsd_json_plugin_get_processed_posts(
[
'cat' => $category->term_id,
'posts_per_page' => MORE_FROM_DAILY_POST_PER_PAGE,
'paged' => $page_number,
]);
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer();
$tsd_meta = $head_and_footer;
$tsd_meta[ "title" ] = html_entity_decode( $category->name );
return [
"tsdMeta" => $tsd_meta,
"posts" => $category_posts,
];
}
function tsd_json_plugin_return_tag_posts( $request ) {
$page_number = (int) $request[ "pageNumber" ];
if ( $page_number <= 0 ) {
return new WP_Error( 'invalid_page_number', 'Page number start from 1.', [ 'status' => 404 ] );
}
$tag_slugs = $request[ "tagSlugs" ];
$tag_posts = tsd_json_plugin_get_processed_posts(
[
'tag' => $tag_slugs,
'posts_per_page' => MORE_FROM_DAILY_POST_PER_PAGE,
'paged' => $page_number,
]);
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer();
$tsd_meta = $head_and_footer;
$tsd_meta[ "title" ] = html_entity_decode( $tag->name );
return [
"tsdMeta" => $tsd_meta,
"posts" => $tag_posts,
];
}
function tsd_json_plugin_return_author_posts( $request ) {
$page_number = (int) $request[ "pageNumber" ];
if ( $page_number <= 0 ) {
return new WP_Error( 'invalid_page_number', 'Page number start from 1.', [ 'status' => 404 ] );
}
$author_slug = $request[ "authorSlug" ];
$author = get_user_by( 'slug', $author_slug );
if ( ! $author ) {
return new WP_Error( 'author_not_found', 'Author not found.', [ 'status' => 404 ] );
}
$author_posts = tsd_json_plugin_get_processed_posts(
[
'author' => $author->ID,
'posts_per_page' => MORE_FROM_DAILY_POST_PER_PAGE,
'paged' => $page_number,
],
[
'include_category_info_for_each_post' => true,
]
);
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer();
$tsd_meta = $head_and_footer;
$tsd_meta[ "author" ] = copy_of_tsd_authors_plugin_author_info( $author );
return [
"tsdMeta" => $tsd_meta,
"posts" => $author_posts,
];
}
function tsd_json_plugin_return_search( $request ) {
$page_number = (int) $request[ "pageNumber" ];
if ( $page_number <= 0 ) {
return new WP_Error( 'invalid_page_number', 'Page number start from 1.', [ 'status' => 404 ] );
}
$search_keyword = (string) $request[ "searchKeyword" ];
if ( empty( $search_keyword ) ) {
return new WP_Error( 'invalid_search', 'Cannot be empty.', [ 'status' => 404 ] );
}
$search_posts = tsd_json_plugin_get_processed_posts(
[
's' => urldecode( $search_keyword ),
'posts_per_page' => MORE_FROM_DAILY_POST_PER_PAGE,
'paged' => $page_number,
],
[
'include_category_info_for_each_post' => true,
]
);
$head_and_footer = tsd_json_plugin_get_wp_head_and_wp_footer();
$tsd_meta = $head_and_footer;
return [
"tsdMeta" => $tsd_meta,
"posts" => $search_posts,
];
}
function tsd_json_plugin_get_categories_from_category_slugs( $category_slugs, $with_key = false ) {
$categories = [];
foreach ( $category_slugs as $category_slug ) {
$category_object = get_category_by_slug( $category_slug );
$tsd_category = tsd_json_plugin_get_category( $category_object );
if ( $with_key ) {
$categories[ $tsd_category[ "slug" ] ] = $tsd_category;
} else {
$categories[] = $tsd_category;
}
}
return $categories;
}
function tsd_json_plugin_return_nav_info() {
$nav_menu_items = wp_get_nav_menu_items( '(New) Primary Nav Menu' );
//return $nav_menu_items;
$categories = [];
foreach ( $nav_menu_items as $nav_menu_item ) {
if ( $nav_menu_item->object !== "category" ) {
continue;
}
$category_object = get_category( $nav_menu_item->object_id );
$category = tsd_json_plugin_get_category( $category_object );
$to_be_added_categories = &$categories;
if ( $nav_menu_item->menu_item_parent !== "0" ) {
$parent_category_object = get_category( $nav_menu_item->post_parent );
if ($parent_category_object->category_parent !== 0) {
// ignore second-level or up sub-category
continue;
}
$to_be_added_categories = &$categories[ $parent_category_object->slug ][ "children" ];
//return $parent_category_object;
}
$category[ "children" ] = [];
$to_be_added_categories[ $category[ "slug" ] ] = $category;
}
return json_decode(json_encode([
"top" => tsd_json_plugin_get_categories_from_category_slugs( [
'NEWS',
'SPORTS',
'opinions',
'arts-life',
'thegrind',
'magazine',
'data-vizzes',
] ),
"bottom" => $categories,
], JSON_FORCE_OBJECT));
}
function tsd_json_plugin_return_most_viewed_posts() {
$KEY_FILE_LOCATION = __DIR__ . '/MostPopularTsdPosts-71f9eba5b57a.json';
// Create and configure a new client object.
$client = new Google_Client();
return 1;
$client->setApplicationName("Hello Analytics Reporting");
$client->setAuthConfig($KEY_FILE_LOCATION);
$client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']);
$analytics = new Google_Service_AnalyticsReporting($client);
$VIEW_ID = "11659658";
// Create the DateRange object.
$dateRange = new Google_Service_AnalyticsReporting_DateRange();
$dateRange->setStartDate("7daysAgo");
$dateRange->setEndDate("today");
// Create the Metrics object.
$pageViews = new Google_Service_AnalyticsReporting_Metric();
$pageViews->setExpression("ga:uniquePageviews");
$pageViews->setAlias("pageviews");
// Create the Dimensions object.
$pagePathDimension = new Google_Service_AnalyticsReporting_Dimension();
$pagePathDimension->setName("ga:pagepath");
// Create the Ordering.
$ordering = new Google_Service_AnalyticsReporting_OrderBy();
$ordering->setOrderType("VALUE");
$ordering->setSortOrder("DESCENDING");
$ordering->setFieldName("ga:uniquePageviews");
// Create the ReportRequest object.
$request = new Google_Service_AnalyticsReporting_ReportRequest();
$request->setViewId($VIEW_ID);
$request->setDateRanges($dateRange);
$request->setDimensions($pagePathDimension);
$request->setOrderBys($ordering);
$request->setMetrics(array($pageViews));
$body = new Google_Service_AnalyticsReporting_GetReportsRequest();
$body->setReportRequests( array( $request) );
return json_encode($analytics->reports->batchGet( $body ));
}
// https://stackoverflow.com/a/31275117/2603230
function tsd_json_plugin_convert_keys_to_camelCase( $input ) {
$arr = [];
foreach ( $input as $key => $value ) {
$key = lcfirst( implode( '', array_map( 'ucfirst', explode( '_', strtolower( $key ) ) ) ) );
if ( is_array($value) ) {
$value = tsd_json_plugin_convert_keys_to_camelCase( $value );
}
$arr[$key] = $value;
}
return $arr;
}
} | [
"function register_api_endpoints()\n{\n global $wp;\n\n // Create URL endpoint\n if ($wp->request == 'api') {\n\n $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';\n $output = null;\n\n switch ($action) {\n\n case 'site-configuration':\n $object = new SiteDataConstructor('all');\n $output = $object->get_site_data();\n break;\n\n case 'list-all-events':\n $object = new PostDataConstructor('event', 'teaser', 'list');\n $output = $object->get_post_data();\n break;\n\n case 'list-all-stories':\n $object = new PostDataConstructor('story', 'teaser', 'list');\n $output = $object->get_post_data();\n break;\n\n case 'list-all-workshops':\n $object = new PostDataConstructor('workshop', 'teaser', 'list');\n $output = $object->get_post_data();\n break;\n\n case 'list-all-pages':\n $object = new PostDataConstructor('page', 'teaser', 'list');\n $output = $object->get_post_data();\n break;\n\n case 'event-data':\n $object = new PostDataConstructor('event', 'full', 'single');\n $output = $object->get_post_data();\n break;\n\n case 'story-data':\n $object = new PostDataConstructor('story', 'full', 'single');\n $output = $object->get_post_data();\n break;\n\n case 'workshop-data':\n $object = new PostDataConstructor('workshop', 'full', 'single');\n $output = $object->get_post_data();\n break;\n\n case 'page-data':\n $object = new PostDataConstructor('page', 'full', 'single');\n $output = $object->get_post_data();\n break;\n\n default:\n $output = ['error' => 'invalid action'];\n break;\n }\n\n if ($output) {\n // callback support for JSONP\n if (isset($_REQUEST[\"callback\"])) {\n header(\"Content-Type: application/javascript\");\n echo $_REQUEST['callback'] . '(' . json_encode($output) . ')';\n } else {\n header(\"Content-Type: application/json\");\n echo json_encode($output);\n }\n }\n die;\n }\n}",
"function rest_api_stuff() {\n\t\tregister_rest_route('ap/v1', '/webfinger', array(\n\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t'callback' => 'get_webfinger'\n\t\t));\n\n\t\tregister_rest_route('ap/v1', '/actor', array(\n\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t'callback' => 'get_webfinger_actor'\n\t\t));\n\t\t\n\t\tregister_rest_route('ap/v1', '/inbox', array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'get_inbox'\n\t\t));\n\t\t\n\t\tregister_rest_route('ap/v1', '/outbox', array(\n\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t'callback' => 'get_outbox'\n\t\t));\n\t\t\n\t\tregister_rest_route('ap/v1', '/followers', array(\n\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t'callback' => 'get_followers'\n\t\t));\n\t\t\n\t\tregister_rest_route('ap/v1', '/likes', array(\n\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t'callback' => 'get_likes'\n\t\t));\n\t\t\n\t\tregister_rest_route('ap/v1', '/shares', array(\n\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t'callback' => 'get_shares'\n\t\t));\n\t}",
"function cfwprapi_register_custom_route() {\n\n register_rest_field( 'todo',\n 'is_done',\n array(\n 'get_callback' => 'cfwprapi_get_is_done',\n 'update_callback' => 'cfwprapi_update_is_done',\n 'schema' => null,\n )\n );\n\n register_rest_route( 'wp/v2', '/' . 'posts/todos/', array(\n array(\n 'methods' => WP_REST_Server::READABLE, // GET method\n 'callback' => 'cfwprapi_get_todos',\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE, // POST Method\n 'callback' => 'cfwprapi_add_todos',\n 'permission_callback' => 'cfwprapi_can_user_have_access',\n ),\n ) );\n\n register_rest_route( 'wp/v2', '/posts/todos/delete/(?P<id>\\d+)', array(\n 'methods' => 'DELETE', // DELETE Method\n 'callback' => 'cfwprapi_delete_todos',\n 'permission_callback' => 'cfwprapi_can_user_have_access',\n )\n );\n\n register_rest_route( 'wp/v2', '/posts/todos/update', array(\n 'methods' => 'PUT', // PUT Method\n 'callback' => 'cfwprapi_update_todos',\n 'permission_callback' => 'cfwprapi_can_user_have_access',\n )\n );\n}",
"function prefix_do_api()\n {\n global $wp_query;\n\n // Check Params Class and Method\n $class = $wp_query->get('rewrite_class');\n $method = $wp_query->get('rewrite_method');\n if (empty($method) || empty($class)) {\n return;\n }\n\n // Check Show View Html Template\n if ($class == \"view\") {\n\n // Check Exist File\n $file_path = rtrim(get_template_directory()) . '/' . rtrim(self::getBasicViewDir(), \"/\") . \"/\" . str_ireplace(\".\", \"/\", $method) . '.php';\n if (!file_exists($file_path)) {\n wp_send_json_error(\n array(\n 'message' => __('The File not exist.', 'wp-rewrite-api-request'),\n 'file' => $file_path\n ),\n 403\n );\n }\n\n // Load Template\n ob_start();\n get_template_part(self::getBasicViewDir() . $method);\n $html = ob_get_clean();\n\n // Response\n wp_send_json_success(array(\n 'html' => $html\n ), 200);\n }\n\n // Check Exist Class\n $class_name = '\\\\' . __NAMESPACE__ . '\\\\' . $class;\n if (!class_exists($class_name)) {\n wp_send_json_error(\n array(\n 'message' => __('This class not exist.', 'wp-rewrite-api-request')\n ),\n 403\n );\n }\n\n // Check Exist Method\n if (substr($method, 0, 1) == \"_\" || !method_exists($class_name, $method)) {\n wp_send_json_error(\n array(\n 'message' => __('This method not exist.', 'wp-rewrite-api-request')\n ),\n 403\n );\n }\n\n // Before Run Method\n do_action('rewrite_api_request_before_run', $class_name, $method);\n\n // Check Nonce\n $nonce = apply_filters('rewrite_api_request_check_nonce', false);\n if ($nonce) {\n $nonce_field = apply_filters('rewrite_api_request_nonce_field', '_nonce');\n\n // Check Nonce\n if (!isset($_REQUEST[$nonce_field])) {\n self::invalid_param($nonce_field);\n }\n\n // Check Nonce\n if (!wp_verify_nonce($_REQUEST[$nonce_field], apply_filters('rewrite_api_request_nonce_field_security', 'rewrite-api-nonce'))) {\n wp_send_json_error(array(\n 'code' => 'require_nonce',\n 'message' => __('Security check!', 'wp-rewrite-api-request')\n ), 400);\n }\n }\n\n // Run Method\n $class_name::{$method}();\n }",
"function add_endpoints() {\n\n\t\tregister_rest_route( 'wp/v2', '/archives', array(\n\t\t\t'methods' => 'GET',\n\t\t\t'callback' => array( $this, 'get_callback' ),\n\t\t) );\n\n\t\tregister_rest_route( 'wp/v2', '/archives/(?P<type>[\\\\w-]+)', array(\n\t\t\t'methods' => 'GET',\n\t\t\t'callback' => array( $this, 'get_callback' ),\n\t\t\t'args' => array(\n\t\t\t\t'type' => array(\n\t\t\t\t\t'validate_callback' => function ( $param, $request, $key ) {\n\t\t\t\t\t\treturn is_string( $param );\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t)\n\t\t) );\n\t}",
"function query_wordpress_apis(){\r\n\t\t\t//TODO\r\n\t\t}",
"function registerEndpoints()\n{\n $namespace = 'travel-review-app/v1';\n\n register_rest_route(\n $namespace,\n '/destinations-default-wordpress',\n [\n 'methods' => 'GET',\n 'callback' => 'listDestinationsDefaultWordPress',\n ]\n );\n}",
"public function getApiEndpointProd();",
"public function getApiEndpoint();",
"private function include_rest_api() {\n\t\trequire_once wpcd_path . 'includes/core/apps/wordpress-app/rest-api/class-wpcd-rest-api-controller-base.php';\n\t\trequire_once wpcd_path . 'includes/core/apps/wordpress-app/rest-api/class-wpcd-rest-api-controller-servers.php';\n\t\trequire_once wpcd_path . 'includes/core/apps/wordpress-app/rest-api/class-wpcd-rest-api-controller-sites.php';\n\t\trequire_once wpcd_path . 'includes/core/apps/wordpress-app/rest-api/class-wpcd-rest-api-controller-tasks.php';\n\n\t\t/**\n\t\t * Need to add new REST API controllers from an add-on?\n\t\t * Then this action hook MUST be used! Otherwise, weird\n\t\t * stuff will happen and you will not know why!\n\t\t *\n\t\t * Third parties that need to add a plugin to extend\n\t\t * the rest api by adding new controllers should\n\t\t * ensure that the filter a few lines above is used\n\t\t * to add the new controller to the array so that\n\t\t * they can be instantiated.\n\t\t */\n\t\tdo_action( 'wpcd_wpapp_include_rest_api' );\n\n\t\t// List of controllers to instantiate.\n\t\t// This list should be added to by other plugins adding their own rest api controllers.\n\t\t$controllers = apply_filters(\n\t\t\t\"wpcd_app_{$this->get_app_name()}_rest_api_controller_list\",\n\t\t\tarray(\n\t\t\t\tWPCD_REST_API_Controller_Servers::class,\n\t\t\t\tWPCD_REST_API_Controller_Sites::class,\n\t\t\t\tWPCD_REST_API_Controller_Tasks::class,\n\t\t\t)\n\t\t);\n\n\t\t// Loop through list and instantiate.\n\t\tforeach ( $controllers as $controller_class ) {\n\t\t\t$controller = new $controller_class();\n\t\t\t$this->rest_controllers[ $controller->get_name() ] = $controller;\n\t\t}\n\n\t}",
"public function register_endpoint() {\n\n\t\tregister_rest_route(\n\t\t\t'wsuwp-network-manager/v1',\n\t\t\t'/updates',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => array( $this, 'the_response' ),\n\t\t\t)\n\t\t);\n\t}",
"public function custom_api() {\n\t\t$this->register_new_route( 'cases-status', '', WP_REST_Server::CREATABLE, array( $this, 'toggle_status' ) );\n\t}",
"function vp_rest_api_loaded() {\n if ( empty( $GLOBALS['wp']->query_vars['vp_rest_route'] ) ) {\n return;\n }\n\n /**\n * Whether this is a XML-RPC Request.\n *\n * @var bool\n * @todo Remove me in favour of VP_REST_REQUEST\n */\n define( 'XMLRPC_REQUEST', true );\n\n /**\n * Whether this is a REST Request.\n *\n * @var bool\n */\n define( 'VP_REST_REQUEST', true );\n\n /** @var WP_REST_Server $wp_vp_rest_server */\n global $wp_vp_rest_server;\n\n // Allow for a plugin to insert a different class to handle requests.\n $wp_vp_rest_server_class = apply_filters( 'wp_vp_rest_server_class', 'VersionPress\\\\Api\\\\BundledWpApi\\\\WP_REST_Server' );\n $wp_vp_rest_server = new $wp_vp_rest_server_class;\n\n /**\n * Fires when preparing to serve an API request.\n *\n * Endpoint objects should be created and register their hooks on this\n * action rather than another action to ensure they're only loaded when\n * needed.\n *\n * @param WP_REST_Server $wp_vp_rest_server Server object.\n */\n do_action( 'vp_rest_api_init', $wp_vp_rest_server );\n\n // Fire off the request.\n $wp_vp_rest_server->serve_request( $GLOBALS['wp']->query_vars['vp_rest_route'] );\n\n // We're done.\n die();\n}",
"public static function ngRestApiEndpoint();",
"function give_gutenberg_register_rest_api() {\n register_rest_route( 'give-api/v1', '/form/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => 'give_fetch_form_data',\n ));\n}",
"function berg_get_terms_endpoint() {\n\t\tregister_rest_route( 'wp/v2', '/berg_terms', array(\n\t\t\t'methods' => 'GET',\n\t\t\t'callback' => 'berg_rest_get_terms',\n\t\t\t'permission_callback' => function () {\n\t\t\t\treturn current_user_can( 'edit_posts' );\n\t\t\t},\n\t\t) );\n\t}",
"function register_hooks() {\n\n\tadd_action( 'rest_api_init', 'WPInfomate\\Rest\\register_rest_endpoints' );\n\n}",
"function tango_api_init() {\n\ttango_api_register_rewrites();\n\t//echo \"<h5>tango_api_init</h5>\";\n\n\tglobal $wp;\n\t$wp->add_query_var( 'tango_route' );\n}",
"function api_wines_routes_api(){\n register_rest_route( 'bestwines/v1', '/wines', array(\n 'methods' => 'GET',\n 'callback' => 'api_get_wines',\n ));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Operation deleteTaskLinkWithHttpInfo Delete task link. | public function deleteTaskLinkWithHttpInfo(Requests\DeleteTaskLinkRequest $request)
{
$returnType = '\Aspose\Tasks\Model\AsposeResponse';
$request = $this->DeleteTaskLinkRequest($request);
try {
$options = $this->_createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody() : null);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
if ($statusCode === 401) {
$this->_requestToken();
throw new RepeatRequestException("Request must be retried", $statusCode, $response->getHeaders(), $response->getBody());
}
throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody());
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
if ($this->config->getDebug()) {
$this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\Tasks\Model\AsposeResponse', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function deleteTaskLinkWithHttpInfo($id, $link_id)\n {\n $returnType = '';\n $request = $this->deleteTaskLinkRequest($id, $link_id);\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()->getBody()->getContents()\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deleteTaskLinkAsyncWithHttpInfo(Requests\\DeleteTaskLinkRequest $request) \n {\n $returnType = '\\Aspose\\Tasks\\Model\\AsposeResponse';\n $request = $this->DeleteTaskLinkRequest($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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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 \n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"public function deleteLinkWithHttpInfo($id, $link_id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling deleteLink');\n }\n // verify the required parameter 'link_id' is set\n if ($link_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $link_id when calling deleteLink');\n }\n // parse inputs\n $resourcePath = \"/Projects/{id}/Links/{linkId}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'text/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($link_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"linkId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($link_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\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 // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/Projects/{id}/Links/{linkId}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function deleteLinkWithHttpInfo($id, $link_id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling deleteLink');\n }\n // verify the required parameter 'link_id' is set\n if ($link_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $link_id when calling deleteLink');\n }\n // parse inputs\n $resourcePath = \"/Organisations/{id}/Links/{linkId}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'text/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($link_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"linkId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($link_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\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 // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/Organisations/{id}/Links/{linkId}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function deleteTaskLinkAsync(Requests\\DeleteTaskLinkRequest $request) \n {\n return $this->deleteTaskLinkAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function deleteTaskLinkRequest(Requests\\DeleteTaskLinkRequest $request)\n {\n // verify the required parameter 'name' is set\n if ($request->name === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $name when calling deleteTaskLink');\n }\n // verify the required parameter 'index' is set\n if ($request->index === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $index when calling deleteTaskLink');\n }\n\n $resourcePath = '/tasks/{name}/taskLinks/{index}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = \"\";\n $multipart = false;\n \n // path params\n if ($request->name !== null) {\n $localName = lcfirst('name');\n $resourcePath = str_replace('{' . $localName . '}', $request->name, $resourcePath);\n }\n // path params\n if ($request->index !== null) {\n $localName = lcfirst('index');\n $resourcePath = str_replace('{' . $localName . '}', $request->index, $resourcePath);\n }\n\n // query params\n if ($request->storage !== null) {\n $localName = lcfirst('storage');\n $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage;\n if (strpos($resourcePath, '{' . $localName . '}') !== false) {\n $resourcePath = str_replace('{' . $localName . '}', $localValue, $resourcePath);\n } else {\n $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue);\n }\n }\n // query params\n if ($request->folder !== null) {\n $localName = lcfirst('folder');\n $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder;\n if (strpos($resourcePath, '{' . $localName . '}') !== false) {\n $resourcePath = str_replace('{' . $localName . '}', $localValue, $resourcePath);\n } else {\n $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue);\n }\n }\n // query params\n if ($request->file_name !== null) {\n $localName = lcfirst('fileName');\n $localValue = is_bool($request->file_name) ? ($request->file_name ? 'true' : 'false') : $request->file_name;\n if (strpos($resourcePath, '{' . $localName . '}') !== false) {\n $resourcePath = str_replace('{' . $localName . '}', $localValue, $resourcePath);\n } else {\n $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue);\n }\n }\n \n \n $resourcePath = $this->_parseURL($resourcePath, $queryParams);\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 // for HTTP post (form)\n $httpBody = $formParams['file'];\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = $formParams[\"data\"];\n }\n }\n\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent();\n }\n \n $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion();\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n \n $req = new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath,\n $headers,\n $httpBody\n );\n if ($this->config->getDebug()) {\n $this->_writeRequestLog('DELETE', $this->config->getHost() . $resourcePath, $headers, $httpBody);\n }\n \n return $req;\n }",
"public function deleteLinkAsyncWithHttpInfo($id, $link_id)\n {\n $returnType = '';\n $request = $this->deleteLinkRequest($id, $link_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 deleteOrganisationLinkWithHttpInfo($id, $link_id)\n {\n $returnType = '';\n $request = $this->deleteOrganisationLinkRequest($id, $link_id);\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()->getBody()->getContents()\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function testDeleteLink()\n\t{\n\t\t$link = '156174391080008_235345346';\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 200;\n\t\t$returnData->body = true;\n\n\t\t$token = $this->oauth->getToken();\n\n\t\t$this->client->expects($this->once())\n\t\t->method('delete')\n\t\t->with($link . '?access_token=' . $token['access_token'])\n\t\t->will($this->returnValue($returnData));\n\n\t\t$this->assertThat(\n\t\t\t$this->object->deleteLink($link),\n\t\t\t$this->equalTo(true)\n\t\t);\n\t}",
"public function deleteBankLinkUsingDeleteWithHttpInfo($bank_link_id)\n {\n $returnType = '';\n $request = $this->deleteBankLinkUsingDeleteRequest($bank_link_id);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deleteNoteLinkAsyncWithHttpInfo($id, $link_id)\n {\n $returnType = '';\n $request = $this->deleteNoteLinkRequest($id, $link_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 deleteLinkFromIssue($linkId)\n {\n }",
"public function deleting(UsefulLink $useful_link)\n {\n //\n }",
"public function deleteLink($id)\n {\n $this->client->request('DELETE', \"/payouts/{$id}/link\");\n }",
"protected function deleteTaskLinkRequest($id, $link_id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling deleteTaskLink'\n );\n }\n // verify the required parameter 'link_id' is set\n if ($link_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $link_id when calling deleteTaskLink'\n );\n }\n\n $resourcePath = '/Tasks/{id}/TaskLinks/{linkId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($link_id !== null) {\n $resourcePath = str_replace(\n '{' . 'linkId' . '}',\n ObjectSerializer::toPathValue($link_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function delete_link($data)\n {\n \tif( ($link_id = $this->get_link_id($data['name'])) === NULL )\n \t\treturn;\n\n\t\tif( wp_delete_link($link_id) === false )\n\t\t{\n \t\t\t$this->log['error'][] = \"An error occured while deleting the link: \".$link['name'];\n }\n else\n {\n \t$this->imported++;\n }\n }",
"public function deleteSharedLinkWithHttpInfo($shared_id)\n {\n // verify the required parameter 'shared_id' is set\n if ($shared_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $shared_id when calling deleteSharedLink');\n }\n // parse inputs\n $resourcePath = \"/shared-links/{sharedId}\";\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']);\n\n // path params\n if ($shared_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"sharedId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($shared_id),\n $resourcePath\n );\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 // this endpoint requires HTTP basic authentication\n if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {\n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/shared-links/{sharedId}'\n );\n\n return [null, $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n default:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Alfresco\\Model\\Error', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function postTaskLink(Requests\\PostTaskLinkRequest $request)\n {\n try {\n list($response) = $this->postTaskLinkWithHttpInfo($request);\n return $response;\n }\n catch(RepeatRequestException $e) {\n list($response) = $this->postTaskLinkWithHttpInfo($request);\n return $response;\n } \n }",
"public function getTaskLinksWithHttpInfo(Requests\\GetTaskLinksRequest $request)\n {\n $returnType = '\\Aspose\\Tasks\\Model\\TaskLinksResponse';\n $request = $this->GetTaskLinksRequest($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(\"[{$e->getCode()}] {$e->getMessage()}\", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody() : null);\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n if ($statusCode === 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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($e->getResponseBody(), '\\Aspose\\Tasks\\Model\\TaskLinksResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Jefferson Lam 12613 Advanced PHP : Advanced : Registration Page FUNCTIONS validate_field($field) Given a field, checks if there have been any errors, and prints them out. | function validate_field($field){
if (isset($_SESSION['error'][$field])){
echo '<div class="error-msg">';
echo '<p>'.$_SESSION['error'][$field].'</p>';
echo '</div>';
}
} | [
"function validate_registration($fname, $lname, $email, $password){\r\n\r\n $errors='';\r\n\r\n # Check if any field is empty \r\n if(empty($fname))\r\n $errors = $errors . 'Enter your first name<br>';\r\n if(empty($lname))\r\n $errors = $errors . 'Enter your last name<br>';\r\n if(empty($email))\r\n $errors = $errors . 'Enter your email<br>';\r\n if(empty($password))\r\n $errors = $errors . 'Enter a password<br>';\r\n\r\n # Check lengths\r\n if(strlen($fname)>30)\r\n $errors = $errors . 'First name must be 30 characters or fewer<br>';\r\n if(strlen($lname)>30)\r\n $errors = $errors . 'Last name must be 30 characters or fewer<br>';\r\n if(strlen($email)>50)\r\n $errors = $errors . 'Email must be 50 characters or fewer<br>';\r\n if(strlen($password)>50)\r\n $errors = $errors . 'Pasword must be between 8 and 50 characters<br>';\r\n if(strlen($password)<8)\r\n $errors = $errors . 'Pasword must be between 8 and 50 characters<br>';\r\n\r\n # Validate email with regex\r\n $email_pattern = '/.+' . preg_quote('@marist.edu') . '/';\r\n if(!empty($email) and !preg_match($email_pattern,$email))\r\n $errors = $errors . 'Invalid email';\r\n\r\n return $errors;\r\n\r\n}",
"function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) {\n\n}",
"function validate_username($field)\r\n {\r\n if ($field == \"\") return \"No value was entered in username, please enter a username<br>\";\r\n else if (strlen($field) < 5)\r\n return \"Usernames must be at least 5 characters<br>\";\r\n else if (preg_match(\"/[^a-zA-Z0-9_-]/\", $field))\r\n return \"Only letters, numbers, - and _ in usernames<br>\";\r\n return \"\";\r\n }",
"function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}",
"function get_field_errors($field, $class_name) {\n\t$html = '';\n\tif(has_field_error($field)) {\n\t\t$html.= '<div class=\"'.$class_name.'\">';\n\t\t$html.= get_compiled_field_error_msgs($field);\n\t\t$html.= '</div>';\n\t}\n\treturn $html;\n}",
"function checkForErrorsInput($fieldName) {\n global $errors;\n\n if (in_array($fieldName, $errors)) {\n return \"error\";\n }\n\n return \"\";\n}",
"function wooc_registeration_email_field( $username, $email, $validation_errors ) {\r\n\t\r\n $res= Xverify_email($email);\r\n\t if($res['status']!=='valid'){\r\n\t\t $validation_errors->add( 'xverify_code', 'Email is invalid: '.$res['responsecode_str'] );\r\n\t }\r\n\r\n return $validation_errors;\r\n}",
"function validate_username($field)\n {\n if ($field == \"\")\n return \"No Username was provided.<br>\";\n else if (strlen($field) < 6)\n return \"Username must contain at least 6 characters.<br>\";\n else if (preg_match(\"/[^a-zA-Z0-9_-]/\", $field))\n return \"Only a-z, A-Z, 0-9, - and _ allowed in Usernames.<br>\";\n return \"\";\n }",
"function field_errors($field){\n\t\treturn $this->fields_errors([$field]);\n\t}",
"function ValidateField($field, $data)\r\n\t{\r\n\t\tswitch($field)\r\n\t\t{\r\n\t\t\tcase 'smartcard':\r\n\t\t\t\t$this->ValidateSmartCard($data);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'receiver':\r\n\t\t\t\t$this->ValidateReceiver($data);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'hardware':\r\n\t\t\t\t$this->ValidateHardware($data);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$this->results->Set('false', \"Invalid field type.\");\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"function field_validator($field_descr, $field_data, $field_type, $min_length=\"\", $max_length=\"\", $field_required=1) {\n # array for storing error messages\n global $messages;\n \n # first, if no data and field is not required, just return now:\n if(!$field_data && !$field_required){ return; }\n\n # initialize a flag variable - used to flag whether data is valid or not\n $field_ok=false;\n\n # this is the regexp for email validation:\n $email_regexp=\"^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|\";\n $email_regexp.=\"(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$\";\n\n # a hash array of \"types of data\" pointing to \"regexps\" used to validate the data:\n $data_types=array(\n \"email\"=>$email_regexp,\n \"digit\"=>\"^[0-9]$\",\n \"number\"=>\"^[0-9]+$\",\n \"alpha\"=>\"^[a-zA-Z]+$\",\n \"alpha_space\"=>\"^[a-zA-Z ]+$\",\n \"alphanumeric\"=>\"^[a-zA-Z0-9]+$\",\n \"alphanumeric_space\"=>\"^[a-zA-Z0-9 ]+$\",\n \"string\"=>\"\"\n );\n \n # check for required fields\n if ($field_required && empty($field_data)) {\n $messages[] = \"$field_descr is a required field.\";\n return;\n }\n \n # if field type is a string, no need to check regexp:\n if ($field_type == \"string\") {\n $field_ok = true;\n } else {\n # Check the field data against the regexp pattern:\n $field_ok = preg_match(\"/${data_types[$field_type]}/\", $field_data);\n }\n \n # if field data is bad, add message:\n if (!$field_ok) { \n $messages[] = \"Please enter a valid $field_descr.\";\n return;\n }\n\n # field data min length checking:\n if ($field_ok && ($min_length > 0)) {\n if (strlen($field_data) < $min_length) {\n $messages[] = \"$field_descr is invalid, it should be at least $min_length character(s).\";\n return;\n }\n }\n\n # field data max length checking:\n if ($field_ok && ($max_length > 0)) {\n if (strlen($field_data) > $max_length) {\n $messages[] = \"$field_descr is invalid, it should be less than $max_length characters.\";\n return;\n }\n }\n}",
"public function fieldHasError($field);",
"function registration_error($password, $repassword, $email) // TODO: do email validation\n{\n\tglobal $mysql_con;\n\t$email_query = mysqli_query($mysql_con, \"SELECT * FROM members WHERE email='$email'\");\n\t$error = \"There was a problem with your registration: <ul>\";\n\tif (mysqli_num_rows($email_query))\n\t\t$error .= \"<li>An account with this email already exists. <a href=\\\"Reset.php\\\">Forgot your password</a>?</li>\";\n//\tif (!preg_match('#[a-zA-Z0-9]+#i', $email))\n//\t\t$error .= \"<li>The email you entered is invalid.</li>\";\n\tif (strlen($password) < 7 || strlen($password) > 100)\n\t\t$error .= \"<li>Your password must be between 7 and 100 characters long.</li>\";\n\tif ($password != $repassword)\n\t\t$error .= \"<li>The two entered passwords do not match.</li>\";\n\t\n\treturn $error.\"</ul>\";\n}",
"function render_field_validation_settings($field)\n {\n }",
"public function error($field) {\n if (array_key_exists($field, $this->errors)) {\n return \"<font size=\\\"2\\\" color=\\\"#ff0000\\\">\" . $this->errors[$field] . \"</font>\";\n } else {\n return \"\";\n }\n }",
"function print_form( $valid=true){\n\tif(!$valid){\n\t echo \"<p>Please correct the following errors:</p>\";\t\n\t}\n?>\n<form action=\"<?php echo $_SERVER['PHP_SELF']; ?>\" method=\"post\">\n <?php\n\t // Email error\n\t $nameError = (isset( $GLOBALS['form']['name']['error']) && !empty( $GLOBALS['form']['name']['error']) ) ? '<span class=\"error\">Error: ' . htmlentities($GLOBALS['form']['name']['error']) . '</span>' : '';\n\t\t\n\t\t// Email Value\n\t\t$nameValue = (isset($GLOBALS['form']['name']['response']) && !empty($GLOBALS['form']['name']['response'])) ? 'value=\"' . htmlentities($GLOBALS['form']['name']['response']) . '\"' : '';\n\t?>\n <ul class=\"form-group\">\n <li><label for=\"name\">Name: <?php echo $nameError; ?></label><input type=\"text\" placeholder=\"Full Name\" id=\"name\" name=\"form[name]\" <?php echo $nameValue ?> /></li>\n <?php\n\t // Email error\n\t $emailError = (isset( $GLOBALS['form']['email']['error']) && !empty( $GLOBALS['form']['email']['error']) ) ? '<span class=\"error\">Error: ' . htmlentities($GLOBALS['form']['email']['error']) . '</span>' : '';\n\t\t\n\t\t// Email Value\n\t\t$emailValue = (isset($GLOBALS['form']['email']['response']) && !empty($GLOBALS['form']['email']['response'])) ? 'value=\"' . htmlentities($GLOBALS['form']['email']['response']) . '\"' : '';\n\t?>\n <li><label for=\"email\">Email: <?php echo $emailError; ?></label><input type=\"text\" id=\"email\" name=\"form[email]\" <?php echo $nameValue; ?> /></li>\n <?php\n\t /* Phone error\n\t\t$phoneError = (isset( $GLOBALS['form']['phone']['error']) && !is_numeric( $GLOBALS['form']['phone']['error'])) ? '<span class=\"error\">Error: ' .htmlentities($GLOBALS['form']['phone']['error']) : '';\n\t\t\n\t\t// Phone Value\n\t\t$phoneValue = (isset($GLOBALS['form']['phone']['response']) && is_numeric( $GLOBALS['form']['phone']['response'] )) ? 'value=\"' . htmlentities($GLOBALS['form']['phone']['response']) . '\"' : '';\n\t\t*/\n\t?>\n <li><label for=\"phone\">Phone:</label><input type=\"text\" placeholder=\"###-###-####\" id=\"phone\" name=\"form[phone]\"></li>\n <li><label for=\"message\">Message:</label><textarea name=\"form[message]\"></textarea></li>\n <li><div id=\"btn_form\"><input type=\"submit\" name=\"send\" id=\"send\" value=\"Send\" /></div></li>\n </ul>\n</form>\n<?php\n}",
"function validate_page()\n {\n }",
"function validateGender(&$errors, $field_list, $field_name) {\r\n\tif (!isset($field_list[$field_name])) {\r\n\t\t$errors[$field_name] = \"Please choose a Gender\";\r\n\t}\r\n}",
"private function validateRegistrationForm() {\n\t\t\t$require = $this->requiredRegistrationFields;\n\t\t\t$this->checkRequired($require);\n\t\t\t// country/state/postal info\n\t\t\t// this removes state from missing array if international\n\t\t\tif ($this->registrationForm['country'] == 'USA') {\n\t\t\t\t// US postal code incorrect length\n\t\t\t\tif (!is_numeric($this->registrationForm['postal']) || strlen($this->registrationForm['postal']) < 5) {\n\t\t\t\t\t$this->errorMsgs[] = 'Invalid zip code';\n\t\t\t\t\taddErrorField('postal');\n\t\t\t\t}\n\t\t\t\t// Valid state code abbreviation\n\t\t\t\tif (!($this->registrationForm['state']) || strlen($this->registrationForm['state']) > 2) {\n\t\t\t\t\t$this->errorMsgs[] = 'Invalid state';\n\t\t\t\t\taddErrorField('state');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveFromArray($this->missing, 'state');\n\t\t\t\t$this->registrationForm['state'] = '';\n\t\t\t}\n\t\t\t// check email\n\t\t\tif (!validEmail($this->registrationForm['email'])) {\n\t\t\t\t$this->errorMsgs[] = 'Please enter a valid email address';\n\t\t\t\taddErrorField('email');\n\t\t\t} else {\n\t\t\t\t// check for existing email\n\t\t\t\t$result = $this->dbh->query(\"SELECT * FROM `affiliates` WHERE `email` = '\".prepDB($this->registrationForm['email']).\"'\");\n\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t$this->errorMsgs[] = 'The email address already exists, please enter a new one or sign in';\n\t\t\t\t\taddErrorField('email');\n\t\t\t\t} else {\n\t\t\t\t\t// login defaults to email\n\t\t\t\t\tif (!$this->registrationForm['login']) {\n\t\t\t\t\t\t$this->registrationForm['login'] = $this->registrationForm['email'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// password confirmation\n\t\t\tif (!$this->registrationForm['password'] || $this->registrationForm['password'] != $this->registrationForm['confPassword']) {\n\t\t\t\tif ($this->registrationForm['password'] != $this->registrationForm['confPassword']) $this->errorMsgs[] = 'Password confirmation does not match';\n\t\t\t\taddErrorField('password');\n\t\t\t\taddErrorField('confirmPassword');\n\t\t\t}\n\t\t\tif (!empty($this->missing)) $this->errorMsgs[] = 'Missing required information';\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of the second roll in frame | public function getSecondRollInFrame($frameIndex) {
return $this->frames[$frameIndex]['secondRoll'];
} | [
"public function roll()\n {\n $val = 0;\n\n if ($this->faces > 0)\n {\n $val = rand(1, $this->faces);\n }\n\n return $val;\n }",
"public function getLastRoll()\n {\n // $lastRoll = $this->lastRoll;\n // return $lastRoll;\n // alt.:\n return $this->lastRoll;\n }",
"public function getLastRoll()\n {\n return $this->lastRoll;\n }",
"public function GetLastRoll() {\n \treturn $this->last;\n }",
"function roll() {\n // Choose a new value for $currentValue (random between 1 and 6)\n $this->currentValue = rand(1, 6);\n }",
"public function roll()\n {\n $this->lastRoll = [];\n for ($i = 0; $i < $this->dices; $i++) {\n array_push($this->lastRoll, $this->random());\n }\n return $this->lastRoll;\n }",
"function getDie2Value(){\n\t\t\treturn $this->die2->getValue();\n\t\t}",
"public function testLastRollTwentyOne()\n {\n $this->diceHand->roll();\n $res = $this->diceHand->lastRoll();\n $this->assertIsString($res);\n }",
"public function roll(): int\n {\n $this->rollResult = rand(1, $this->sides);\n\n return $this->rollResult;\n }",
"public function getRunningSecond()\n {\n return $this->get(self::RUNNING_SECOND);\n }",
"private function frameTotal($n) {\n return $this->rolls[$n] + $this->rolls[$n + 1];\n }",
"public function getSecond()\n {\n return $this->dateTime->getSecond();\n }",
"final protected function currentSecondInPeriod() : int {\n return ($this->timestamp % ($this->validForMinutes * 60)) + 1;\n }",
"function score() {\n $result = 0;\n\n for ($i = 0; $i < self::FRAMES_NUM; $i++) {\n $frame = isset($this->frames[$i]) ? $this->frames[$i] : false;\n if (!$frame)\n break;\n\n $score = $frame->score();\n $nextFrame = isset($this->frames[$i + 1]) ? $this->frames[$i + 1] : false;\n \n if ($frame instanceof Frame\\Strike) {\n $secondNext = $nextFrame->second;\n // Strike object always has 0 as second try. \n // If a strike object is a next roll, need to get roll after the strike.\n if ($nextFrame instanceof Frame\\Strike and \n isset($this->frames[$i + 2])) {\n $secondNext = $this->frames[$i + 2]->first; \n }\n\n $score += $nextFrame->first + $secondNext;\n } elseif ($frame instanceof Frame\\Spare){ \n $score += $nextFrame->first;\n }\n\n $result += $score;\n }\n\n return $result;\n }",
"public function getSecond() {\n\t\tif(!is_null($this->second))\n\t\t{\n\t\t\treturn AddZeros($this->second);\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t}",
"function second()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n\r\n return $second;\r\n }",
"public function firstRoll()\n {\n $this->startPlayer->roll();\n $this->startComputer->compRoll($this->player->total);\n }",
"public function roll()\n {\n $this->values[0] = $this->dices[0]->rollDice();\n $this->values[1] = $this->dices[1]->rollDice();\n }",
"public function testYatzyFirstDiceRoll()\n {\n $yatzy = new Yatzy();\n\n $yatzy->firstDiceRoll();\n\n $this->assertIsArray($_SESSION[\"lastroll\"]);\n $this->assertCount(5, $_SESSION[\"lastroll\"]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an empty batch. | public function create()
{
return new Batch();
} | [
"public function testEmptyBatchRequest(): void\n {\n $batch = $this->api->createBatchRequest();\n Assert::assertCount(0, iterator_to_array($batch->execute()));\n }",
"public function startNewBatch() :void;",
"public function testCreateBatch()\n {\n if ($this->only_priority_tests) {\n $this->markTestSkipped(\"Running only priority tests.\");\n }\n if (!$this->write_to_db) {\n $this->markTestSkipped(\"Skipping as this test writes to the Database.\");\n }\n\n $this->load('/batches', 'POST', [\n 'day' => '0',\n 'class_time'=> '15:00:13',\n 'project_id'=> '1',\n 'center_id' => '244'\n ]);\n\n $this->assertEquals($this->response_data->status, 'success');\n $created_batch_id = $this->response_data->data->batch->id;\n $this->assertEquals($this->response_data->data->batch->day, '0');\n $this->assertEquals($this->response_data->data->batch->year, $this->year);\n $this->assertEquals($this->response->getStatusCode(), 200);\n\n return $created_batch_id;\n }",
"public function beginBatch() {\n\t}",
"public function startBatch()\n {\n $values = [\n 'date' => date(\"Y-m-d\"),\n ];\n $batch = $this->db\n \t\t->table('batches')\n\t\t\t->create($values);\n }",
"public function testAnExceptionWillOccurIfEmptyArrayIsGivenWhenConstructing()\n {\n new BatchRequest(array());\n }",
"public function batchCreate(Request $request);",
"public function new_batch($batch_id = null)\n\t{\n\t\treturn new UM_MailChimp_Batch($this, $batch_id);\n\t}",
"public function reset()\n {\n $this->batch = new Core\\BatchRequest();\n }",
"public function testCreateAndDelete(): void\n {\n $id = \\str_repeat('0', 40);\n $batch_id = $this->startBatch($id);\n\n // Assert that we can see the batch and snapshot in the database.\n $this->seeInDatabase('batches', ['id' => $batch_id, 'snapshot_id' => $id]);\n $this->seeInDatabase('snapshots', ['id' => $id]);\n\n $this->delete('/batch/' . $batch_id);\n $this->assertResponseStatus(200);\n // Assert that the batch was deleted but the snapshot still exists.\n $this->missingFromDatabase('batches', ['id' => $batch_id, 'id' => $id]);\n $this->seeInDatabase('snapshots', ['id' => $id]);\n }",
"public function createBatch()\n {\n //creation url du batch\n $url=$this->url.\"/upload/\";\n\n //creation de la requete\n $reponse=\\Guzzle::post($url,[\n 'auth' => [ $this->user, $this->pass],\n ]);\n\n //récupère la réponse http contenant le batchid\n $out=$reponse->getBody();\n\n #decode le json en array\n $out=json_decode($out,true);\n\n /*print \"Batchid : \";\n print_r($out);*/\n\n //retourne l'uid du dossier/fichier créé\n return $out['batchId'];\n\n }",
"public function beginBatch(){\n $this->mode = Rest::BATCH_MODE;\n $this->resetBatchRequests();\n }",
"function batch_example_1() {\n $batch = array(\n 'operations' => array(\n array('batch_example_1_operation_1', array())\n )\n );\n batch_set($batch);\n batch_process('batch-example');\n}",
"public function testBatchDeleteEmptyModel() {\n\t\t\n\t\t$this->ApiResource->Api\n\t\t\t->expects($this->once())\n\t\t\t->method('setResponseCode')\n\t\t\t->with($this->equalTo(5002));\n\t\t\n\t\t$test = $this->ApiResource->batchDelete();\n\t\t\n\t\t$this->assertFalse($test);\n\t\t\n\t}",
"public function startBatch() : void\n {\n // Start a new batch if one isn't active, clear stack & set date\n if (!$this->batchStarted) {\n $this->consignmentStack = [];\n $this->batchDate = date('Y-m-d');\n $this->batchStarted = TRUE;\n }\n }",
"public function testIsBatchCreatableThrowInvalidArgumentException()\n {\n $this->expectException(\\Xendit\\Exceptions\\InvalidArgumentException::class);\n $params = [\n 'external_id' => 'demo_147580196270'\n ];\n\n Disbursements::createBatch($params);\n }",
"private static function create_generic_batch() {\n\t\t$batch_name = self::get_generic_batch_name();\n\t\t$batch_id = TranslationProxy_Batch::update_translation_batch( $batch_name );\n\n\t\treturn $batch_id;\n\t}",
"public function new_batch()\n {\n $id = $this->input->post('batch_id');\n $is_edit = (bool)$id;\n $data = new stdClass();\n $data->allow_num_edit = !$is_edit;\n\n if ($is_edit) {\n // it's an existing batch, get it\n $batch = Doctrine_Core::getTable('Batch')->find($id);\n $this->_dieIfQueryFailed($batch);\n\n $data->numsamples = $batch->Analysis->count();\n } else {\n $batch = new Batch();\n $data->numsamples = null;\n $batch->start_date = date('Y-m-d');\n }\n\n if ($this->input->post('is_refresh')) {\n $is_valid = $this->form_validation->run('batches');\n $batch->id = $this->input->post('batch_id');\n $batch->owner = $this->input->post('owner');\n $batch->description = $this->input->post('description');\n $data->numsamples = $this->input->post('numsamples');\n\n if ($is_edit) {\n $batch->start_date = $this->input->post('start_date');\n }\n\n if ($is_valid) {\n $new_batch = (!(bool)$batch->id);\n if ($new_batch) {\n // new batch: create the analyses linked to this batch\n for ($i = 1; $i <= $data->numsamples; $i++) {\n $analysis = new Analysis();\n $analysis->number_within_batch = $i;\n $batch->Analysis[] = $analysis;\n }\n }\n $batch->save();\n }\n }\n\n // set the rest of the view data\n $data->title = 'Add a batch';\n $data->main = 'quartz_chem/new_batch';\n $data->batch = $batch;\n $this->load->view('template', $data);\n }",
"public static function createBatch($request) {\n\t\tif(func_num_args() > 1 ) $request = func_get_args();\n\t\tif(is_array($request)) {\n\t\t\treturn new Tivoka_BatchRequest($request);\n\t\t}\n\t\tthrow new Tivoka_Exception('Object of invalid data type passed to Tivoka::createBatch.');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove content from group. API: $group>removeContent($content) | public function removeContent($content)
{
return DB::table('groupables')->where([
['group_id', '=', $this->id],
['group_type', '=', get_class($this)],
['groupable_id', '=', $content->id],
['groupable_type', '=', get_class($content)],
])->delete();
} | [
"public function delete_content() {\n \n // Delete content\n (new MidrubBaseAdminCollectionFrontendHelpers\\Contents)->delete_content();\n \n }",
"public function remove()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_delete_categories'))\n\t\t{\n\t\t\tshow_error(lang('unauthorized_access'), 403);\n\t\t}\n\n\t\t$group_id = ee()->input->post('content_id');\n\t\t$group = ee('Model')->get('CategoryGroup', $group_id)->first();\n\n\t\tif ( ! empty($group_id) && $group)\n\t\t{\n\t\t\t$group->delete();\n\n\t\t\tee()->logger->log_action(lang('category_groups_removed').':'.NBS.NBS.$group->group_name);\n\n\t\t\tee()->functions->clear_caching('all', '');\n\n\t\t\tee('CP/Alert')->makeInline('channels')\n\t\t\t\t->asSuccess()\n\t\t\t\t->withTitle(lang('category_groups_removed'))\n\t\t\t\t->addToBody(sprintf(\n\t\t\t\t\tlang('category_groups_removed_desc'),\n\t\t\t\t\thtmlentities($group->group_name, ENT_QUOTES, 'UTF-8')\n\t\t\t\t))\n\t\t\t\t->defer();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(lang('unauthorized_access'), 403);\n\t\t}\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('categories', ee()->cp->get_url_state()));\n\t}",
"public function delete_content(){\n\t\tglobal $db;\n\t\t$sQl_img = \"SELECT content,content_image FROM cms_content WHERE content_id = '\".$this->contentId.\"'\";\n\t\t$contentDtls = $db->get_row($sQl_img);\n\t\t$content = $contentDtls->content;\n\t\t$imgName = unserialize($contentDtls->content_image);\n\t\t$imgCount = count($imgName);\n\t\t$imgSrc =\"../images/\";\n\t\tforeach($imgName as $images){\n\t\t\tunlink($imgSrc.$images);\t\t\n\t\t}\n\t\t\n\t\t$content =\"../upload/content/\".$content;\n\t\tunlink($content);\n\t\t\n\t\t$sQl = \"DELETE FROM cms_content WHERE content_id = '\".$this->contentId.\"'\";\n\t\t$result = $db->query($sQl);\n\t\tif($result){\n\t\t\t$this->message = \"Content Deleted Successfully\";\n\t\t\treturn true;\t\t\n\t\t\t} else {\n\t\t\t$this->error = \"Connot Delete Content\";\n\t\t\treturn false;\t\t\n\t\t}\t\t\n\t}",
"protected function removeHeader($content) {\n\t\t$content = phpQuery::newDocumentHTML($content);\n\n\t\t// Remove items associated with the header.\n\t\tforeach ($content->find('div[type=HEADER]') as $header) {\n\t\t\t$header = pq($header);\n\t\t\t$header->remove();\n\t\t}\n\t\tforeach ($content->find('div[type=header]') as $header) {\n\t\t\t$header = pq($header);\n\t\t\t$header->remove();\n\t\t}\n\n\t\treturn $content->html();\n\t}",
"public function deleteContent()\n {\n //Entire section\n if ($this->docname === 'no-name') {\n foreach (glob(DOC_URI . $this->section . '/*') as $file) {\n unlink($file);\n }\n rmdir(DOC_URI . $this->section);\n unset($this->list['pages'][$this->section]);\n } else {\n if (file_exists(DOC_URI . $this->section . '/' . $this->docname . '.md')) {\n unlink(DOC_URI . $this->section . '/' . $this->docname . '.md');\n unset($this->list['pages'][$this->section][array_search($this->docname, $this->list['pages'][$this->section])]);\n }\n }\n $yaml = Yaml::dump($this->list, 2);\n file_put_contents(CONFIG_URI, $yaml);\n }",
"public function removeNodes($content)\r\n\t{\r\n\t\treturn preg_replace($this->_patterns['node'], '', $content);\r\n\t}",
"function removeGroupID($mysqli, $groupID){\n //must remove all content from group, all membership to group, and the group itself.\n\n //find all posts belonging to the group\n $result2 = $mysqli->query(\"SELECT CID FROM Content WHERE GroupID=\".$groupID.\";\");\n //now delete all\n while($row=mysqli_fetch_row($result2)){\n $mysqli->query(\"DELETE FROM Post WHERE CID=\".$row[0].\";\");\n $mysqli->query(\"DELETE FROM Content WHERE CID=\".$row[0].\";\");\n }\n\n //then remove all membership\n $mysqli->query(\"DELETE FROM Is_Member_Group WHERE GroupID=\".$groupID.\";\");\n //then remove group\n $mysqli->query(\"DELETE FROM Group_ WHERE GroupID=\".$groupID.\";\");\n return 'removeGroup: '.$mysqli->error;\n }",
"function action_removeFromGroup() {\n $this->auto_render = false;\n\n $user = Helper_User::getUser();\n $article = Doctrine::instance()->getRepository('Model_Article')->findOneBy(array('id' => $_POST['article']));\n $favorite = Doctrine::instance()->getRepository('Model_Favorite')->findOneByArticle($article);\n $group = Doctrine::instance()->getRepository('Model_Favoritegroup')->findOneBy(array('user' => $user->id, 'id' => $_POST['group']));\n\n if($user && $group && $favorite) {\n if($group->favorites->contains($favorite)) {\n $group->favorites->removeElement($favorite);\n $favorite->favoriteGroups->removeElement($group);\n Doctrine::instance()->persist($favorite);\n Doctrine::instance()->persist($group);\n Doctrine::instance()->flush();\n }\n }\n }",
"function remove_group($id){\n\t\t$ret = GalleryEmbed::deleteGroup($id);\n\t\treturn $ret;\n}",
"function metroshare_remove_from_the_content() {\n\tglobal $metro_share;\n\tremove_filter( 'the_content', array( $metro_share, 'show_the_content' ) );\n}",
"public function delete_contents() {\n \n // Delete contents\n (new MidrubBaseAdminCollectionFrontendHelpers\\Contents)->delete_contents();\n \n }",
"function project_manage_content_remove_callback($path, $id){\n $project = prepare_project_manage_page($path);\n //get content node\n $sql = 'SELECT id, node, project, title, title_path, r.type, permission, deletable FROM {research_projects_contents} AS r, {node} AS n WHERE id=%d AND project=%d AND node=nid LIMIT 1';\n $content = db_fetch_object(db_query($sql, $id, $project->id));\n if($content && $content->node>0 && $content->deletable==1){\n $project->subtitle = \"Delete content\";\n $content->project_path = $path;\n $right_part = '<p>You are deleting '.l($content->title, \"project/$path/content/{$content->title_path}\").' from project. This step can not be revoked.</p>';\n $project->right_part = $right_part.drupal_get_form('project_content_remove_form', $content);\n return theme('project_manage_page',$project);\n }else{\n drupal_not_found();\n }\n \n}",
"public static function deleteFor($content)\n {\n $content = $content->content;\n $mentions = SpaceMention::find()->where([\n 'related' => $content->id\n ])->all();\n\n foreach($mentions as $mention) {\n $mention->delete();\n }\n }",
"public static function onContentDelete($event) {\n foreach (ReputationContent::findAll(['content_id' => $event->sender->id]) as $reputationContent) {\n $reputationContent->delete();\n }\n }",
"public static function delete()\r\n {\r\n if(!self::user()->hasPerm('groups_delete'))\r\n Json::printError('You are not allowed for the requested action!');\r\n $val = \\CAT\\Helper\\Validate::getInstance();\r\n $id = $val->sanitizePost('id');\r\n if(!\\CAT\\Helper\\Groups::exists($id))\r\n Json::printError('No such group!');\r\n $group = \\CAT\\Groups::getInstance()->getGroup($id);\r\n if($group['builtin']=='Y')\r\n Json::printError('Built-in elements cannot be removed!');\r\n $res = \\CAT\\Helper\\Groups::removeGroup($id);\r\n Base::json_result($res,($res?'':'Failed!'),($res?true:false));\r\n }",
"public static function onContentDelete($event)\n {\n foreach (ReputationContent::model()->findAllByAttributes(array('object_id' => $event->sender->id)) as $reputationContent) {\n $reputationContent->delete();\n }\n }",
"public function removefromgroupAction()\n {\n \t//Don't display a new view\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t\n\t\t$itemid = $this->getRequest()->getParam('itemID');\n\t\t\n\t\t$group = GroupNamespace::getCurrentGroup();\n\t\tif (isset($itemid) && isset($group))\n\t\t{\n\t\t\t$item = $group->removeRecord($itemid);\n\t\t\t$item->setGroupID(NULL);\n\t\t\tItemDAO::getItemDAO()->saveItemIdentification($item, $item);\n\t\t}\n }",
"public function delete() {\r\n $contentTable = Engine_Api::_()->getDbtable('content', 'core');\r\n $contentTable->delete(array('page_id = ?' => $this->page_id)); \r\n // excute delete this object\r\n parent::delete();\r\n }",
"protected function deleteRelatedContent()\n\t{\n\t\t$typeConfig = Configure::read('jj.modules.' . $this->data[$this->alias]['type']);\n\t\t$Model =& ClassRegistry::init($typeConfig['model']);\n\t\treturn $Model->delete($this->data[$this->alias]['content_id']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that Querier::parseFileName parses file names in the expected format. | public function parseFileName($filename, $expectedPrefix, $expectedResponse) {
$mockClient = $this->getConnectedClientMock();
$observerDrupal = $this->getMock('EntityXliffFtp\Utils\DrupalHandler');
// We expect that DrupalHandler::variableGet() will be called exactly once.
$observerDrupal->expects($this->once())
->method('variableGet')
->with(Querier::FILEPREFIXVAR)
->willReturn($expectedPrefix);
$querier = new Querier($mockClient, $observerDrupal);
$this->assertEquals($expectedResponse, $querier->parseFilename($filename));
} | [
"public function testFileNameAccessor()\n {\n $f = 3; // function glob\\myprocess\n\n $this->assertEquals(\n self::$fixtures . 'namespaces.php',\n self::$models[$f]->getFileName(),\n self::$models[$f]->getName() . ' file name does not match.'\n );\n }",
"function testAcceptsAlphasNumericFilename()\n {\n $filter = new T_Filter_Filename();\n $expected = 'file13name.ext';\n $this->assertSame($filter->transform($expected),$expected);\n }",
"public function testBadFilename() {\n $parser = new \\snac\\util\\EACCPFParser();\n // $parser->setVocabulary(new TestVocabulary());\n try {\n $parser->parseFile(\"Not-a-valid-filename\");\n } catch (\\snac\\exceptions\\SNACParserException $e) {\n // Catching this exception passes\n $this->assertStringStartsWith(\n \"file_get_contents(Not-a-valid-filename): failed to open stream: No such file or directory\",\n $e->getMessage(),\n \"The wrong exception was encountered in the code, but it still correctly throw the SNACParserException\");\n } catch (\\Exception $e) {\n $this->fail(\"Parser threw the wrong exception\");\n }\n }",
"function fileNameOK($name = '') {\n\t\t$values = $this->badFileChars;\n\t\t$num = sizeof($values);\n\t\t$match = false;\n\t\tif (!is_string($name)) {\n\t\t\treturn false;\n\t\t}\n\t\t// names cannot start with a .\n\t\tif (substr($name, 0, 1) == '.') {\n\t\t\t$match = true;\n\t\t}\n\t\t// names cannot start with a -\n\t\tif (substr($name, 0, 1) == '-') {\n\t\t\t$match = true;\n\t\t}\n\t\t// names cannot have multiple spaces\n\t\tif (preg_match(\"/\\s\\s/si\", $name)) {\n\t\t\t$match = true;\n\t\t}\n\t\t// names cannot have multiple dots\n\t\tif (preg_match(\"/\\.\\./si\", $name)) {\n\t\t\t$match = true;\n\t\t}\n\t\t// name cannot be empty\n\t\tif (empty($name)) {\n\t\t\t$match = true;\n\t\t}\n\t\t// name cannot have illegal characters\n\t\tfor ($i=0; $i<$num; $i++) { \n\t\t\tif (stristr($name,$values[$i])) {\n\t\t\t\t$match = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->acceptedFileChars)) {\n\t\t\tif (preg_match($this->acceptedFileChars, $name)) $match = true;\n\t\t}\n\t\tif ($match) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function testGetFileAsName()\n {\n $subject = $this->_generateSubject();\n $task = Task::aTask($subject)->from('2010-01-01 12:34:56');\n\n $expected = $subject.' '.$task->getStartDate('YmdHi');\n $actual = $task->getFileAsName();\n\n $this->assertEquals($expected, $actual);\n\n }",
"public function testGetFileAsName()\n {\n $item = CalendarEvent::anEvent('subject')->from('2010-01-01 12:32');\n $expected = 'subject 201001011232';\n $actual = $item->getFileAsName();\n $this->assertEquals($expected, $actual);\n\n }",
"public function testAcceptFileNames()\n {\n $result = $this->loader->load(__DIR__ . '/../fixtures/definition.json');\n\n $this->assertDefinition(array(\n 'rows' => array(\n array('cells' => array(\n array('name' => 'foo', 'literal' => 'bar'),\n )),\n ),\n ), $result);\n }",
"public function test_fileName() \n {\n $clean_arr = Reflection::getProperty('_file_name_clean', 'Common\\RandomString', $this->_random_str);\n $random_str = new RandomString();\n\n $file_name = $random_str->fileName();\n\n foreach ($clean_arr as $clean) {\n $this->assertTrue(strpos($file_name, $clean[RandomString::FIND_KEY]) !== true);\n }\n }",
"public function testFilename(): void\n {\n $this->BackupExport->filename('backup.sql.bz2');\n $this->assertSame(Configure::read('DatabaseBackup.target') . 'backup.sql.bz2', $this->BackupExport->filename);\n $this->assertSame('bzip2', $this->BackupExport->compression);\n $this->assertSame('sql.bz2', $this->BackupExport->extension);\n\n //Compression is ignored, because there's a filename\n $this->BackupExport->compression('gzip')->filename('backup.sql.bz2');\n $this->assertSame('backup.sql.bz2', basename($this->BackupExport->filename));\n $this->assertSame('bzip2', $this->BackupExport->compression);\n $this->assertSame('sql.bz2', $this->BackupExport->extension);\n\n //Filename with `{$DATABASE}` pattern\n $this->BackupExport->filename('{$DATABASE}.sql');\n $this->assertSame('test.sql', basename($this->BackupExport->filename));\n\n //Filename with `{$DATETIME}` pattern\n $this->BackupExport->filename('{$DATETIME}.sql');\n $this->assertMatchesRegularExpression('/^\\d{14}\\.sql$/', basename($this->BackupExport->filename));\n\n //Filename with `{$HOSTNAME}` pattern\n $this->BackupExport->filename('{$HOSTNAME}.sql');\n $this->assertSame('localhost.sql', basename($this->BackupExport->filename));\n\n //Filename with `{$TIMESTAMP}` pattern\n $this->BackupExport->filename('{$TIMESTAMP}.sql');\n $this->assertMatchesRegularExpression('/^\\d{10}\\.sql$/', basename($this->BackupExport->filename));\n\n //With invalid extension\n $this->expectExceptionMessage('Invalid `txt` file extension');\n $this->BackupExport->filename('backup.txt');\n }",
"public function sanitizeFileNameUTF8FilesystemDataProvider() {}",
"public function testWithFilenameWithInvalidCharacter()\n {\n self::expectException(UrlPathInvalidArgumentException::class);\n self::expectExceptionMessage('Filename \"bar?baz\" contains invalid character \"?\".');\n\n UrlPath::parse('foo')->withFilename('bar?baz');\n }",
"public function testGetFilenames() {\n\n $pathname = getcwd() . \"/Tests/Utility/IO\";\n\n $this->assertContains(\"FileUtilityTest.php\", FileUtility::getFilenames($pathname));\n $this->assertContains(\"FileUtilityTest.txt\", FileUtility::getFilenames($pathname, \".txt\"));\n\n try {\n FileUtility::getFilenames(\"exception\");\n } catch (Exception $ex) {\n $this->assertInstanceOf(FileNotFoundException::class, $ex);\n $this->assertEquals(\"The file \\\"exception\\\" is not found\", $ex->getMessage());\n }\n }",
"public function testGetNamePossibilitiesForFMLName()\n {\n $expectedNameOptions = [['Megan', 'Spitz']];\n $name = 'Megan R Spitz';\n $nameOptions = EvaluationParser::getNamePossibilities($name);\n $this->assertEqualsCanonicalizing($nameOptions, $expectedNameOptions);\n }",
"function testTestCaseFileName() {\n\t\t$this->Task->path = '/my/path/tests/';\n\n\t\t$result = $this->Task->testCaseFileName('Model', 'Post');\n\t\t$expected = $this->Task->path . 'cases' . DS . 'models' . DS . 'post.test.php';\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$result = $this->Task->testCaseFileName('Helper', 'Form');\n\t\t$expected = $this->Task->path . 'cases' . DS . 'helpers' . DS . 'form.test.php';\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$result = $this->Task->testCaseFileName('Controller', 'Posts');\n\t\t$expected = $this->Task->path . 'cases' . DS . 'controllers' . DS . 'posts_controller.test.php';\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$result = $this->Task->testCaseFileName('Behavior', 'Containable');\n\t\t$expected = $this->Task->path . 'cases' . DS . 'behaviors' . DS . 'containable.test.php';\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$result = $this->Task->testCaseFileName('Component', 'Auth');\n\t\t$expected = $this->Task->path . 'cases' . DS . 'components' . DS . 'auth.test.php';\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$this->Task->plugin = 'TestTest';\n\t\t$result = $this->Task->testCaseFileName('Model', 'Post');\n\t\t$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php';\n\t\t$this->assertEqual($result, $expected);\n\t}",
"function validate_name($file) {\n $zip_pattern = \"/\\d\\d\\d\\d_\\d\\d_\\d\\d\\.zip/\";\n //$file_pattern = \"/^(probability|zscore)(_[a-z]+)+\\.tsv$/\";\n if (preg_match($zip_pattern, $file)) {\n return true;\n }\n return false;\n}",
"public function testGetNamePossibilitiesForAmbigious4Name()\n {\n $expectedNameOptions = [\n ['Megan', 'Second Third Spitz'],\n ['Megan Second', 'Third Spitz'],\n ['Megan Second Third', 'Spitz'],\n ];\n $name = 'Megan Second Third Spitz';\n $nameOptions = EvaluationParser::getNamePossibilities($name);\n $this->assertEqualsCanonicalizing($nameOptions, $expectedNameOptions);\n }",
"abstract protected function checkFilename($filename);",
"public function testWithFilenameWithInvalidCharacter()\n {\n self::expectException(FilePathInvalidArgumentException::class);\n self::expectExceptionMessage(\"Filename \\\"bar\\0baz\\\" contains invalid character \\\"\\0\\\".\");\n\n FilePath::parse('foo')->withFilename(\"bar\\0baz\");\n }",
"function parse_filename($filename) {\n $parts = explode(\".\", $filename);\n for($i=0;$i<4;$i++){\n if(strlen($parts[$i]) <=0){\n return false;\n \n }\n }\n $file['sorting'] = intval($parts[0]);\n $file['page_uid'] = intval($parts[1]);\n $file['templ_uid'] = intval($parts[2]);\n $file['type'] = $parts[3];\n $file['title'] = $parts[4];\n for($i=5;$i<count($parts);$i++){\n $file['title'] .= \".\".$parts[$i];\n }\n \n \n \n \n return $file;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to deregister the product sync. | public function unschedule_sync() {
$next_timestamp = wp_next_scheduled(ARALCO_SLUG . '_sync_products');
if ($next_timestamp){ // If sync is scheduled
wp_unschedule_event($next_timestamp, ARALCO_SLUG . '_sync_products');
}
} | [
"public static function unRegister();",
"function tuscblackchamber_ubercart_unpublish_product() {\n}",
"public function deactivation_callback() {\n\t\tTPM_Product_List::get_instance()->clear_cache();\n\t\tTPM_License_Manager::get_instance()->clear_cache();\n\t\tTPM_License_Manager::get_instance()->deactivate_all_licenses();\n\t\t$this->delete_tpm_version();\n\t\tdelete_option( 'tpm_bk_connection' );\n\t}",
"private function _unregisterDevice($token){\n\t\t$sql = \"UPDATE `apnDevices` \n\t\t\t\tSET `status`='uninstalled' \n\t\t\t\tWHERE `devicetoken`='{$token}' \n\t\t\t\tLIMIT 1;\";\n\t\t$this->db->query($sql);\n\t}",
"public function unlock()\n\t{\n\t\t//Call getProducts() to set $this->arrProducts array with existing locked data\n\t\t$this->getProducts();\n\t\t$this->blnLocked = false;\n\t}",
"public function unlockDependencyStorage()\n {\n // TODO: Implement unlockDependencyStorage() method.\n }",
"private function resumeSyncHooks() {\n\t\t$WCMLSynchronizeProductData = $this->getWCMLSynchronizeProductData();\n\n\t\tif ( false !== $WCMLSynchronizeProductData ) {\n\t\t\tadd_action( 'deleted_post_meta', [ $this->getWCMLSynchronizeProductData(), 'delete_empty_post_meta_for_translations' ], 10, 3 );\n\t\t}\n\n\t}",
"public function unregisterAction()\n {\n $connectionIds = Mage::app()->getRequest()->getParam('shopgate_connection_ids');\n if ($connectionIds && !is_array($connectionIds)) {\n $connectionIds = array($connectionIds);\n }\n\n $results = array();\n foreach ($connectionIds as $connection_id) {\n $results[] = Mage::getModel('shopgate/shopgate_connection')\n ->load($connection_id)\n ->unregister();\n }\n\n $hasErrors = false;\n foreach ($results as $result) {\n if (count($result->getErrors())) {\n $hasErrors = true;\n foreach ($result->getErrors() as $msg) {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shopgate')->__($msg));\n }\n ShopgateLogger::getInstance()->log(\n \"Unregister OAuth Shop Connection has failed \\\"\" . (string)$connectionIds . \"\\\"\",\n ShopgateLogger::LOGTYPE_ERROR\n );\n }\n }\n\n if (!$hasErrors) {\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('shopgate')->__('The connection/s have been removed successfully')\n );\n }\n\n $redirect = $this->getUrl('*/*/manage');\n\n $this->getResponse()->setRedirect($redirect);\n $this->getResponse()->sendResponse();\n }",
"public function __destruct()\n {\n if ($this->deployment instanceof Deployment\n && !$this->deployment instanceof \\In2code\\SurfGui\\Domain\\Model\\Deployment\n ) {\n if ($this->isLockerForRunningDeployment) {\n unlink($this->getLockFilePath() . $this->getLockFileName($this->deployment));\n echo 'LOCK FILE REMOVED' . PHP_EOL;\n }\n }\n }",
"public function unregister()\n {\n }",
"private function disconnect() {\n if ($this->stateManager->get('quickbooks_settings_access_token')) {\n $quickbooks_service = new QuickBooksService(FALSE);\n $quickbooks_service->oauthDisconnect();\n }\n\n // Delete QBO settings.\n $this->stateManager->delete('quickbooks_default_product');\n $this->stateManager->delete('quickbooks_term');\n\n $this->stateManager->delete('quickbooks_payment_method');\n $this->stateManager->delete('quickbooks_payment_account');\n\n // Clear access token.\n $this->stateManager->delete('quickbooks_settings_access_token');\n $this->stateManager->delete('quickbooks_settings_access_token_secret');\n $this->stateManager->delete('quickbooks_settings_realm_id');\n\n $this->stateManager->delete('quickbooks_settings_consumer_key');\n $this->stateManager->delete('quickbooks_settings_consumer_secret');\n\n // Remove counter since user disconnected QuickBooks.\n // Added again if reconnect occurs.\n $this->stateManager->delete('quickbooks_cron_started_on');\n\n // Delete cached responses.\n $this->cacheManager->delete('quickbooks_default_product_cache');\n $this->cacheManager->delete('quickbooks_terms_cache');\n $this->cacheManager->delete('quickbooks_payment_cache');\n $this->cacheManager->delete('quickbooks_account_cache');\n $this->cacheManager->delete('quickbooks_default_product_cache');\n }",
"public function unregister() {\n\t\tif ($this->isRegistered) {\n\t\t\trestore_error_handler();\n\t\t\trestore_exception_handler();\n\t\t\t$this->isRegistered = false;\n\t\t}\n\t}",
"public static function do_deferred_product_sync()\n {\n }",
"public function synchronizeDeleteProductsByQueue()\n {\n //Get product collection from delete queue\n $deleteFraisrProducts = Mage::getModel('fraisrconnect/config')->getProductsFromDeleteQueue();\n\n //For every product\n foreach ($deleteFraisrProducts as $product) {\n //Check if the script runtime is already close to exceed\n if (true === Mage::helper('fraisrconnect/synchronisation_product')\n ->isRuntimeExceeded($this->synchronisationStartTime)) {\n //Break the loop, stop the syncronisation and return\n return;\n }\n\n try {\n //Trigger delete request\n $this->requestDeleteProduct(\n $product['fraisr_id'],\n $product['sku']\n );\n\n //Remove product from delete queue\n Mage::getModel('fraisrconnect/config')->removeProductFromDeleteQueue($product['sku']);\n } catch (Fraisr_Connect_Model_Api_Exception $e) {\n //Add sku to delete products list\n $this->failedProductsReport[] = array(\n 'sku' => $product['sku'],\n 'fraisr_id' => $product['fraisr_id'],\n 'error_message' => $e->getMessage(),\n 'task' => 'delete'\n );\n }\n }\n }",
"public function testUnregisterDevice()\n {\n $pushwooshMock = new PushwooshMock();\n\n // At the beginning no pushwoosh requests have been sent\n $this->assertCount(0, $pushwooshMock->getPushwooshRequests());\n\n // Test call\n $unregisterDeviceRequest = UnregisterDeviceRequest::create();\n $unregisterDeviceResponse = $pushwooshMock->unregisterDevice($unregisterDeviceRequest);\n\n $this->assertNotNull($unregisterDeviceResponse);\n $this->assertSame(200, $unregisterDeviceResponse->getStatusCode());\n $this->assertSame('OK', $unregisterDeviceResponse->getStatusMessage());\n $this->assertTrue($unregisterDeviceResponse->isOk());\n\n // One more requests has been send\n $this->assertCount(1, $pushwooshMock->getPushwooshRequests());\n $this->assertSame($unregisterDeviceRequest, $pushwooshMock->getPushwooshRequests()[0]);\n }",
"public function ___uninstall() { }",
"public function unstallNotification()\n {\n\n $notifyData = [\n 'status' => Data::BSECURE_PLUGIN_STATUS_DISBALED, //Uninstall\n 'reason' => 'Module Uninstalled',\n 'reason_message' => 'Module Uninstalled',\n ];\n\n $this->logger->debug(\"-------------unstallNotification-----------\");\n $this->sendNotificationToBsecure($notifyData);\n }",
"function com_uninstall() {\n\trequire_once( $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_joomap/classes/JoomapConfig.php' );\n\tJoomapConfig::backup();\n\tJoomapConfig::remove();\n}",
"public function uninstall()\n\t{\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for creating a new AttachCourse. | public function create()
{
return view('attach_courses.create');
} | [
"public function create()\n\t{\n\t\treturn View::make('admin.courses.create');\n\t}",
"public function newAction() {\r\n\r\n $entity = new Course();\r\n $form = $this->createAddForm($entity);\r\n\r\n\r\n return $this->render('ABCCourseBundle:updatecourse:add.html.twig', array('entity' => $entity, 'form' => $form->createView()));\r\n }",
"public function actionCreate()\n {\n $model = new Course();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect('index');\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n $courses = Courses::all();\n return view('courses.create')->with('courses', $courses);\n }",
"private function createCreateForm(Course $course)\n {\n $form = $this->createForm(CourseType::class, $course, array(\n 'action' => $this->generateUrl('course_create'),\n 'method' => 'POST',\n ));\n\n\n $form->add('create', SubmitType::class, array('label' => 'forms.create', 'attr' => array('class'=>'btn btn-lg btn-danger btn-block')));\n return $form;\n }",
"public function create()\n {\n if (! Gate::allows('datacourse_create')) {\n return abort(401);\n }\n \n $users = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $courses = \\App\\Course::get()->pluck('title', 'id')->prepend(trans('global.app_please_select'), '');\n $certificates = \\App\\Coursescertificate::get()->pluck('title', 'id')->prepend(trans('global.app_please_select'), '');\n\n $generals = \\App\\General::get();\n\n return view('admin.datacourses.create', compact('users', 'courses', 'certificates', 'generals'));\n }",
"public function actionCreate()\n {\n $model = new Course();\n $post = Yii::$app->request->post();\n if ($model->load($post) && $model->save()) {\n //插入属性\n CourseAttr::insterAttr($model->id, $post['CourseAtts'], true);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $model->loadDefaultValues();\n $model->create_by = Yii::$app->user->id;\n return $this->render('create', [\n 'model' => $model,\n 'templates' => CourseTemplate::getTemplate(), //模板\n 'course_models' => ArrayHelper::map(CourseModel::find()->all(), 'id', 'name'),\n 'teachers' => ArrayHelper::map(Teacher::find()->all(), 'id', 'name'),\n ]);\n }\n }",
"public function add_new_course() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n\n $tenant_id = $this->user->tenant_id;\n\n $data['page_title'] = 'Add New Course';\n\n $data['main_content'] = 'course/addnewcourse';\n\n $this->load->view('layout', $data);\n\n }",
"public function newAction()\n {\n $entity = new Conference();\n $form = $this->createForm(new ConferenceType(), $entity);\n\n return $this->render('CfpConferenceBundle:Conference:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function createAction()\n {\n $username = $this->get('security.context')->getToken()->getUsername();\n $userid = $this->getDoctrine()->getManager()->getRepository('EnglishPeopleBundle:People')->findOneByUsername($username)->getId();\n \n $entity = new Course();\n \n $entity->setUserid($userid);\n \n $request = $this->getRequest();\n $form = $this->createForm(new CourseType(), $entity);\n $form->submit($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('course_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function actionCreate()\n {\n $model = new CertificateForm();\n $upload_form = new CertUploadForm();\n\n if (Yii::$app->request->isPost) {\n $post = Yii::$app->request->post();\n if ($model->load($post)) {\n $this->upload($upload_form, $model);\n\n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'upload_form' => $upload_form,\n ]);\n }",
"public function create()\n {\n return view('sport_courts.create');\n }",
"public function create()\n {\n return view('backend.course_categories.create');\n }",
"public function addCoursesPage(){\n return View('admin.addcourse');\n }",
"public function create()\n {\n return view(\"aasource.addform\");\n }",
"public function create()\n {\n return view('courseNames.create');\n }",
"public function newcourses() {\n $content = \"\";\n $query = $this->coursemodel->getCourseTable();\n foreach ($query->result() as $row) {\n $content .= '<option value=\"' . $row->course_cat_id . '\">' . $row->coursename . '</option>';\n }\n $data['CourseContent'] = $content;\n\n $this->loadpage($data, 'Courses', 'Add new event | BALIYOGHAR');\n }",
"public function add() {\r\n // Set meta data\r\n $metaData = array();\r\n $metaData['title'] = \"Manage courses - Add courses\"; \r\n $this->view->meta = $metaData;\r\n $this->view->dashboardAssets = false; \r\n $this->view->datatableAssets = false;\r\n $this->view->formAssets = true;\r\n $this->view->dropzoneAssets = false;\r\n $this->view->facultyDetails = $this->model->getFaculty();\r\n $this->view->countriesList = file_get_contents(SITEURL.\"index/getCountries\");\r\n // load course view page\r\n $this->view->LoadView('add_course', 'course');\r\n }",
"public function actionCreate()\n {\n $model = new Course();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->set('hint', '新增课程成功');\n\n return $this->redirect(['index']);\n } else {\n $model->starttime = $model->endtime = time();\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the serivce module directory | public static function get_module_dir(){
return dirname( __FILE__ ) . '/../modules';
} | [
"public function getModuleDir()\n {\n return starter_class::path('modules/' . $this->moduleName);\n }",
"public static function getModulePath()\n {\n return dirname(__DIR__);\n }",
"public function getModulePath(): string\n {\n $reflector = new ReflectionClass(get_class($this));\n $fn = $reflector->getFileName();\n $directory = dirname($fn);\n return $directory;\n }",
"public function get_module_dir(){\n\t\treturn $this->v_module_dir;\n\t}",
"public static function getModulePath()\n {\n return \\Orion::base() . \\Orion::MODULE_PATH . self::$MODULE_NAME . DS;\n }",
"protected static function getModulePath() {\n\t\treturn Context::getParameterHolder()->getModulePath();\n\t}",
"public final function get_module_dir() {\n\t\treturn 'modules/'.str_replace('_','/',$this->type).'/';\n\t}",
"private function getServiceDir()\n {\n return base_path() . '/app/Services/';\n }",
"private function getModuleDirUrl()\n {\n $module_dir = '';\n if ($this->checkSecureUrl()) {\n $module_dir = _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . str_replace(_PS_ROOT_DIR_ . '/', '', _PS_MODULE_DIR_);\n } else {\n $module_dir = _PS_BASE_URL_ . __PS_BASE_URI__ . str_replace(_PS_ROOT_DIR_ . '/', '', _PS_MODULE_DIR_);\n }\n return $module_dir;\n }",
"function moduleDir($module)\n {\n $modules = atkGetModules();\n if (isset($modules[$module]))\n {\n $dir = $modules[$module];\n if (substr($dir,-1)!='/') return $dir.\"/\";\n return $dir;\n }\n return \"\";\n }",
"private function getModulePath(): string\n {\n if (!$this->modulePath) {\n $this->modulePath = 'src/' . $this->moduleName;\n }\n\n return $this->modulePath;\n }",
"protected static function getModulesFilePath()\n {\n return LC_DIR_ROOT . static::MODULES_FILE_NAME;\n }",
"protected function getModuleDirUrl()\n {\n $module_dir = '';\n if ($this->checkSecureUrl()) {\n $module_dir = _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . str_replace(_PS_ROOT_DIR_ . '/', '', _PS_MODULE_DIR_);\n } else {\n $module_dir = _PS_BASE_URL_ . __PS_BASE_URI__ . str_replace(_PS_ROOT_DIR_ . '/', '', _PS_MODULE_DIR_);\n }\n return $module_dir;\n }",
"protected function getPackageDirectory()\n {\n return $this->getClassDirectory() . '/../..';\n }",
"public function getUtilsDir()\n {\n return __DIR__;\n }",
"public function getModulePath(): string\n {\n if ($this->modulePath === null) {\n $this->modulePath = str_replace(getcwd() . '/', '', realpath(__DIR__ . '/../..'));\n }\n return $this->modulePath;\n }",
"public function modulesFolder(): string;",
"public static function getModulePath()\n {\n }",
"protected function getServiceDirectoryFromConfig()\n {\n return substr(rtrim($this->getServiceDirectory(), '/\\\\'), 4);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step for executing conversion from storage | public function iExecuteConversionFromStoragePOSTSaveAs()
{
$this->response = $this->context->get_api()->saveAs($this->request);
} | [
"abstract protected function doActualConvert();",
"function convert_from_storage($source);",
"public function convert() {\n\n try {\n $this->log('creating the target directory', backup::LOG_DEBUG);\n $this->create_workdir();\n\n $this->log('executing the conversion', backup::LOG_DEBUG);\n $this->execute();\n\n $this->log('replacing the source directory with the converted version', backup::LOG_DEBUG);\n $this->replace_tempdir();\n } catch (Exception $e) {\n }\n\n // clean-up stuff if needed\n $this->destroy();\n\n // eventually re-throw the execution exception\n if (isset($e) and ($e instanceof Exception)) {\n throw $e;\n }\n }",
"public function convert(){\n $this->_exec(\"convert\");\n }",
"function convert() {\n\t\twp_suspend_cache_invalidation( true );\n\n\t\t$this->process_jobs();\n\t\t$this->process_taxonomies();\n\n\t\twp_suspend_cache_invalidation( false );\n\t}",
"public function convert()\n {\n $tmpfile = $this->getArchiveFile();\n $dbfile = $this->getWebFile();\n shell_exec(\"nice -n 15 ffmpeg -i '$tmpfile' -ab 192k -f mp3 - >'{$dbfile}'\");\n\n self::$db->query(\n 'UPDATE uryplayer.podcast SET file=$1 WHERE podcast_id=$2',\n [$this->getFile(), $this->getID()]\n );\n if (empty($this->submitted)) {\n $this->setSubmitted(time());\n }\n }",
"protected function doActualConvert()\n {\n/*\n $im = \\Jcupitt\\Vips\\Image::newFromFile($this->source);\n //$im->writeToFile(__DIR__ . '/images/small-vips.webp', [\"Q\" => 10]);\n\n $im->webpsave($this->destination, [\n \"Q\" => 80,\n //'near_lossless' => true\n ]);\n return;*/\n\n $im = $this->createImageResource();\n $options = $this->createParamsForVipsWebPSave();\n $this->webpsave($im, $options);\n }",
"function finish_conversion()\n\t{\n\t\tglobal $db, $phpbb_root_path, $phpEx, $convert, $config, $language, $user;\n\t\tglobal $cache, $auth, $phpbb_container, $phpbb_log;\n\n\t\tinclude_once ($phpbb_root_path . 'includes/functions_admin.' . $phpEx);\n\n\t\t$db->sql_query('DELETE FROM ' . CONFIG_TABLE . \"\n\t\t\tWHERE config_name = 'convert_progress'\n\t\t\t\tOR config_name = 'convert_options'\n\t\t\t\tOR config_name = 'convert_db_server'\n\t\t\t\tOR config_name = 'convert_db_user'\");\n\t\t$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);\n\n\t\t@unlink($phpbb_container->getParameter('core.cache_dir') . 'data_global.' . $phpEx);\n\t\tphpbb_cache_moderators($db, $cache, $auth);\n\n\t\t// And finally, add a note to the log\n\t\t$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_CONVERTED', false, array($convert->convertor_data['forum_name'], $config['version']));\n\n\t\t$url = $this->controller_helper->route('phpbb_convert_finish');\n\n\t\t$this->template->assign_vars(array(\n\t\t\t'L_SUBMIT'\t\t=> $user->lang['FINAL_STEP'],\n\t\t\t'U_ACTION'\t\t=> $url,\n\t\t));\n\n\t\t$this->meta_refresh($url);\n\t\treturn;\n\t}",
"public function startConversion()\n {\n $this->removeDirectory();\n $this->copyLaravelVirginVersion();\n $this->copyModules();\n $this->copyPlugins();\n $this->copyOctoberVendor();\n $this->copyTheme();\n\n //$this->createMainController();\n //$this->addTextInsideMainController();\n\n }",
"public function convert(): void\n {\n // go through files\n foreach ($this->getInFiles() as $file) {\n $bookmarks = $this->parse($file);\n // go through bookmarks\n foreach ($bookmarks as $name => $url) {\n // go through formats\n foreach ($this->formats as $format) {\n switch ($format) {\n case 'url':\n $contents = $this->urlContents($url);\n break;\n case 'webloc':\n $contents = $this->weblocContents($url);\n break;\n case 'desktop':\n $contents = $this->desktopContents($name, $url);\n break;\n default:\n // shouldn't be a case because of constructor validation\n break;\n }\n $this->writeFile($name, $format, $contents);\n }\n }\n }\n }",
"private function executeConversionCommand(Conversion $conversion)\n {\n $root = static::$kernel->getRootDir();\n $id = $conversion->getId();\n\n `php $root/console ecentinela:comiconv:process $id`;\n }",
"function _OOConversion() {\n \n // Conversion to odt file\n $output = array();\n $command = 'cd ' . $this->workDir;\n $command .= ' && sudo soffice --nofirststartwizard --headless --convert-to odt:\"writer8\" \"' . $this->userFileName . '\"';\n $return_var = shell_exec( $command );\n \n // Change original extension to \".odt\"\n $info = pathinfo($this->userFile);\n $this->workFileName = $info['filename'] . '.odt';\n $this->workFile = $this->workDir.'/'. $this->workFileName;\n \n if ( !file_exists($this->workFile) ) {\n $message = '<br>Missing file: ' . $this->workFile;\n $message .= '<br>Command: ' . $command;\n $message .= '<br>Return: '. $return_var;\n return $this->_msg( array('er_soffice',$message) );\n }\n \n $this->_msg(array('ok_info','Open Office conversion done'));\n \n return true;\n }",
"abstract protected function doTransload();",
"protected function convert() {\n\t\t$method = sprintf( 'convert_to_' . $this->rules['type'] );\n\t\tif ( method_exists( $this, $method ) ) {\n\t\t\tcall_user_func( array( $this, $method ) );\n\t\t}\n\t}",
"public function setUp() {\n $this->transformation = new Convert(array('type' => $this->extension));\n }",
"public function convert()\n {\n // On compile tous les fichiers en 1 seul\n $this->_concatLanguageFiles($this->getSearchDir());\n\n $languages = $this->_parseXmlFilesForLanguages();\n $this->setLanguages($languages);\n\n // on crée les répertoires pour toutes les langues définies\n $this->_createDirectories();\n\n foreach ($languages as $language) {\n // Pour chaque langue définie, on lance la récupération de toutes\n // les traductions présentes dans le répertoire controllers\n $this->_parseXmlFile($language);\n\n // on crée le fichier PO\n $content_po_file = $this->_createPoFile($language);\n\n $po_file = $this->_getGettextLanguageDir($language) . self::GETTEXT_DOMAIN . '.po';\n\n // on sauvegarde le contenu dans un fichier po\n $this->_savePoFile($po_file, $content_po_file);\n\n // on convertit le fichier po en mo\n $this->compilPo2Mo($po_file, $language);\n }\n }",
"abstract public function convert($type, $destination = null);",
"public function convert_to_storage()\n {\n if ($this->privilege) {\n // If we have sufficient privileges, we set all privilege accordingly.\n // otherwise we log this and exit silently.\n if ($this->get_privilege_object()) {\n $this->privilege->store();\n } else {\n debug_add(\"Could not synchronize privilege of field {$this->name}, access was denied, midgard:privileges is needed here.\",\n MIDCOM_LOG_WARN);\n }\n }\n }",
"public function process_conversions() {\n\t\t// Get next 5 new videos.\n\t\t$items = mpplt_get_items(\n\t\t\tarray(\n\t\t\t\t'completed' => 0,\n\t\t\t\t'status' => 'queued',\n\t\t\t\t'queue_type' => 'conversion',\n\t\t\t\t'orderby' => 'created_at',\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'per_page' => 5,\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $items ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $items as $item ) {\n\t\t\t$this->convert( $item );\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the impersonation property of the EWS Exchange client. Updates an existing Exchange client, seting the impersonation to the target account.. | protected function setImpersonation($ewsClient, $targetSmtpAddress)
{
$ei = new ExchangeImpersonationType();
$sid = new ConnectingSIDType();
$sid->PrimarySmtpAddress = $targetSmtpAddress;
$ei->ConnectingSID = $sid;
$ewsClient->setImpersonation($ei);
} | [
"protected function impersonator(): ImpersonatorContract\n {\n return $this->app[ImpersonatorContract::class];\n }",
"public function setSoapHeaderExchangeImpersonation(\\StructType\\ApiExchangeImpersonationType $exchangeImpersonation, string $namespace = 'http://schemas.microsoft.com/exchange/services/2006/types', bool $mustUnderstand = false, ?string $actor = null): self\n {\n return $this->setSoapHeader($namespace, 'ExchangeImpersonation', $exchangeImpersonation, $mustUnderstand, $actor);\n }",
"public function setImpersonating($id)\n {\n Session::put('impersonate', $id);\n }",
"public function GetImpersonatedUser() {\n return $this->impersonateUser;\n }",
"public function setSoapHeaderExchangeImpersonation(\\Ews\\StructType\\EwsExchangeImpersonationType $exchangeImpersonation, $nameSpace = 'http://schemas.microsoft.com/exchange/services/2006/types', $mustUnderstand = false, $actor = null)\n {\n return $this->setSoapHeader($nameSpace, 'ExchangeImpersonation', $exchangeImpersonation, $mustUnderstand, $actor);\n }",
"function auth_impersonate( $p_user_id ) {\n\tauth_ensure_can_impersonate( $p_user_id );\n\n\tauth_set_cookies( $p_user_id, /* perm_login */ false );\n\tauth_set_tokens( $p_user_id );\n}",
"public function testImpersonateDecoratorIgnored()\n {\n $impersonator = ['username' => 'mariano'];\n $impersonated = new ArrayObject(['username' => 'larry']);\n\n $this->request->getSession()->write('Auth', $impersonator);\n $this->service->authenticate($this->request);\n $identity = new Identity($impersonator);\n $request = $this->request\n ->withAttribute('identity', $identity)\n ->withAttribute('authentication', $this->service);\n $controller = new Controller($request, $this->response);\n $registry = new ComponentRegistry($controller);\n $component = new AuthenticationComponent($registry);\n\n $this->assertEquals($impersonator, $controller->getRequest()->getSession()->read('Auth'));\n $this->assertNull($controller->getRequest()->getSession()->read('AuthImpersonate'));\n\n $component->impersonate($impersonated);\n $this->assertEquals($impersonated, $controller->getRequest()->getSession()->read('Auth'));\n $this->assertEquals(new ArrayObject($impersonator), $controller->getRequest()->getSession()->read('AuthImpersonate'));\n\n $component->stopImpersonating();\n $this->assertNull($controller->getRequest()->getSession()->read('AuthImpersonate'));\n }",
"private function configLaravelImpersonatorPackage()\n {\n $config = $this->config();\n\n $config->set('impersonator', $config->get('arcanesoft.auth.impersonation', ['enabled' => false]));\n }",
"public function testImpersonateSelf() {\n\t\t$t_response = $this->builder()->get( '/users/me' )->impersonate( 'administrator' )->send();\n\t\t$this->assertEquals( HTTP_STATUS_FORBIDDEN, $t_response->getStatusCode() );\n\t}",
"public function impersonate()\n {\n $this->crud->hasAccessOrFail('impersonate');\n\n $entry = $this->crud->getCurrentEntry();\n\n backpack_user()->setImpersonating($entry->id);\n\n Alert::success('Impersonating '.$entry->name.' (id '.$entry->id.').')->flash();\n\n // load the view\n return redirect('/admin/user');\n }",
"public function impersonateAccount(\\TYPO3\\Flow\\Security\\Account $account = NULL) {\n\t\tif ($this->impersonatedAccount !== $account) {\n\t\t\t$this->impersonatedAccount = $account;\n\n\t\t\t$this->destroyRegisteredClientSessions();\n\n\t\t\t$this->emitAccountImpersonated($account);\n\t\t}\n\t}",
"public function setClient(Client &$client);",
"protected function impersonateOtherUser()\n {\n $this->otherUser = factory(User::class)->create([\n 'id' => rand(1000, 2000)\n ]);\n $this->actingAs($this->otherUser);\n }",
"public function getImpersonatedUser()\n {\n return isset($this->impersonated_user) ? $this->impersonated_user : null;\n }",
"public function currentUserFromImpersonation()\n {\n return $this->impersonate;\n }",
"public function impersonator()\n {\n return Auth::getImpersonator();\n }",
"abstract protected function setClient();",
"public function impersonate($user)\n {\n $oldSession = Session::get($this->sessionKey);\n\n $this->login($user, false);\n\n if (!$this->isImpersonator()) {\n Session::put($this->sessionKey.'_impersonate', $oldSession);\n }\n }",
"public static function impersonate(User $impersonate, $as = null)\n {\n $user = self::handleRoles($impersonate, $as);\n\n app(HistoryService::class)\n ->new([\n 'title' => 'User Impersonated',\n 'information' => '('.auth()->id().')' . optional(auth()->user())->getFullName() . ' is impersonating '. '('.optional($user)->id.')' .optional($user)->getFullName(),\n 'user_id' => auth()->id(),\n 'user_name' => auth()->user()->getFullName(),\n 'historyable_type' => User::class,\n 'historyable_id' => $user->id,\n 'type' => History::TYPE_IMPERSONATION,\n ]);\n\n if ($user->id !== ($original = auth()->id())) {\n session()->put(static::IMPERSONATED, $impersonate->id);\n session()->put(static::IMPERSONATER, $original);\n }\n return $user;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [missiondisplaydate] column value. | public function getMissiondisplaydate()
{
return $this->missiondisplaydate;
} | [
"public function getMissiondate()\n\t{\n\t\treturn $this->missiondate;\n\t}",
"private function getTheDate()\n {\n return $this->content[$this->getProfileCursor()][self::$DATE_CURSOR];\n }",
"public function getDate() {\n return $this->getEvalAttribute('date');\n }",
"function getDateAssigned() {\n\t\treturn $this->getData('dateAssigned');\n\t}",
"public function getIssueDate()\n {\n return isset($this->issue_date) ? $this->issue_date : '';\n }",
"public function getDateOfEmission(){\n\t\treturn $this->dateOfEmission;\n\t}",
"public function getDate_record()\n\t{\n\t\treturn $this->date_record;\n\t}",
"public function getDateAttribution()\n {\n return $this->dateAttribution;\n }",
"public function humanDate() {\r\n return $this->time->HumanDate;\r\n }",
"function hm_events_render_admin_col( $column_name, $post_id ) { \n if ( 'event_date' != $column_name ) {\n return; \n }\n \n if( get_post_meta( $post_id, 'hm-events_date', true ) ) { \n $value = date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), get_post_meta( $post_id, 'hm-events_date', true ) ); \n echo $value;\n } else {\n _e( 'None', 'hm-events' );\n }\n\n}",
"public function getMeetingDateAttribute()\n {\n return data_get($this->program, 'full_date');\n }",
"public function getEntryDate();",
"public function getPublishedAtColumn()\n\t{\n\t\treturn defined('static::PUBLISHED_AT') ? static::PUBLISHED_AT : 'published_at';\n\t}",
"public function getDataDismissione(){\n if($this->cmp_data_dismissione == '9999-12-31') {\n return '31/12/9999';\n }\n else {\n return date( 'd/m/Y', strtotime($this->cmp_data_dismissione));\n }\n }",
"public function getDateAttendance(): string\n {\n return $this->dateAttendance;\n }",
"public function getEntryDate(): ?string\n {\n return $this->entryDate;\n }",
"public function getIssueDate()\n {\n return $this->issue_date;\n }",
"public function getEndRegistrationDateDisplay()\n {\n return Carbon::parse($this->getEndRegistrationDate())->locale('id')->diffForHumans();\n }",
"public static function get_date_field()\n {\n return self::instance()->getDateField();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Feature values list if values, successive in time, are requested. If the requested number of values is greater than the number of existing Feature values, nonexistent values are omitted instead of being returned as empty. Generated from protobuf field .google.cloud.aiplatform.v1.FeatureValueList values = 2; | public function setValues($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FeatureValueList::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public function getMultivariateFeatureStateValues(): MultivariateFeatureStateValueModelList\n {\n return $this->multivariate_feature_state_values;\n }",
"public function getValuesLists()\r\n {\r\n return $this->valuesList;\r\n }",
"public function setValues($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Yoti\\Protobuf\\Attrpubapi\\MultiValue\\Value::class);\n $this->values = $arr;\n\n return $this;\n }",
"public function setValues(&$var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Datastore\\V1beta3\\Value::class);\n $this->values = $arr;\n }",
"public function getValues()\n {\n return $this->_values;\n }",
"public function _getAllowedValueList()\n {\n return self::$valueList;\n }",
"public function ListValue(): array\n {\n $location = $this->tokenizer->getLastLocation();\n\n $this->eat(\"[\");\n\n $valueList = $this->lookahead[\"type\"] !== \"]\" ? [$this->Value()] : [];\n\n while ($this->lookahead[\"type\"] !== \"]\") {\n $this->eat(\",\");\n $valueList[] = $this->Value();\n }\n\n $this->eat(\"]\");\n\n return [\n \"kind\" => \"ListValue\",\n \"values\" => $valueList,\n \"loc\" => $location\n ];\n }",
"public function values(): array\n {\n return array_values($this->list);\n }",
"public static function values(): array\n {\n return array_column(array: self::cases(), column_key: 'value');\n }",
"public function getFacetValues()\n {\n return $this->facetValues;\n }",
"public function getValuesArray(){\n\t\treturn $this->valuesArray;\n\t}",
"public function setValues($value)\n {\n return $this->set('Values', $value);\n }",
"public function values()\n\t{\n\t\treturn $this->hasMany(StoreFeatureValue::class, 'feature_id');\n\t}",
"public function getPossibleValues() {\n return $this->possibleValues;\n }",
"public function getAcceptsMultipleValues()\n {\n return $this->accepts_multiple_values;\n }",
"private function buildValues($learnosityValues)\n {\n $values = [];\n if (is_array($learnosityValues)) {\n foreach ($learnosityValues as $value) {\n $values[] = new Value($value);\n }\n } else {\n $values[] = new Value($learnosityValues);\n }\n return $values;\n }",
"public function setValues($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->values = $arr;\n\n return $this;\n }",
"public function getCommaSeparatedValues(): array\n {\n return array_filter(array_map('trim', explode(',', (string) $this->value)));\n }",
"public function hasValueDataProvider()\n {\n return [\n [\n 'myvalue1',\n 'some text',\n 'myvalue1',\n true,\n ],\n [\n 'myvalue1',\n 'some text',\n 'myvalue2',\n false,\n ],\n [\n null,\n 'some text',\n 'myvalue3',\n false,\n ],\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ISPConfig onLoad hook. Register the plugin for some site related events. | function onLoad() {
global $app;
$app->plugins->registerEvent('web_domain_insert', $this->plugin_name, 'ssl');
$app->plugins->registerEvent('web_domain_update', $this->plugin_name, 'ssl');
$app->plugins->registerEvent('web_domain_delete', $this->plugin_name, 'ssl');
$app->plugins->registerEvent('web_domain_insert', $this->plugin_name, 'insert');
$app->plugins->registerEvent('web_domain_update', $this->plugin_name, 'update');
$app->plugins->registerEvent('web_domain_delete', $this->plugin_name, 'delete');
$app->plugins->registerEvent('client_delete', $this->plugin_name, 'client_delete');
} | [
"function onLoad() {\n\t\tglobal $app;\n\n\t\t/*\n\t\t * Register for those events, the plugin needs to do something\n\t\t * this fills the $event_name var from the functions\n\t\t */\n\n\t\t$app->plugins->registerEvent('web_domain_insert', $this->plugin_name, 'insert');\n\t\t$app->plugins->registerEvent('web_domain_update', $this->plugin_name, 'update');\n\t\t$app->plugins->registerEvent('web_domain_delete', $this->plugin_name, 'delete');\n\n\t\t$app->plugins->registerEvent('client_delete', $this->plugin_name, 'client_delete');\n\n\t}",
"function onLoad() {\n\t\tglobal $app;\n\n\t\t//* Databases\n\t\t$app->plugins->registerEvent('database_insert', $this->plugin_name, 'db_insert');\n\t\t$app->plugins->registerEvent('database_update', $this->plugin_name, 'db_update');\n\t\t$app->plugins->registerEvent('database_delete', $this->plugin_name, 'db_delete');\n\n\t\t//* Database users\n\t\t$app->plugins->registerEvent('database_user_insert', $this->plugin_name, 'db_user_insert');\n\t\t$app->plugins->registerEvent('database_user_update', $this->plugin_name, 'db_user_update');\n\t\t$app->plugins->registerEvent('database_user_delete', $this->plugin_name, 'db_user_delete');\n\t}",
"public function init()\n {\n parent::init();\n\n self::$plugin = $this;\n\n // Register our site routes\n Event::on(\n UrlManager::class,\n UrlManager::EVENT_REGISTER_SITE_URL_RULES,\n function (RegisterUrlRulesEvent $event) {\n $event->rules['hasura/auth'] = 'hasura/auth';\n $event->rules['hasura/webhook'] = 'hasura/webhook';\n }\n );\n\n Craft::info(\n Craft::t(\n 'hasura',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function plugins_loaded() {\n // register this as an event area type\n do_action_ref_array( 'qsot-register-event-area-type', array( &$this ) );\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n $config = Craft::$app->getConfig()->getGeneral();\n if (!$config->allowAdminChanges) {\n // Do nothing if admin changes aren't allowed\n return;\n }\n\n $request = Craft::$app->getRequest();\n if (!$request->getIsCpRequest() || $request->getIsConsoleRequest()) {\n // Also do nothing if this is a console or site request\n return;\n }\n\n // Handler: EVENT_AFTER_LOAD_PLUGINS\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_LOAD_PLUGINS,\n function () {\n $this->doIt();\n }\n );\n\n Craft::info(\n Craft::t(\n 'cp-field-inspect',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function onLoad()\n {\n $plugins = $this->getPluginHandler();\n $plugins->getPlugin('Message');\n }",
"public function init(){\n\n\t\t// Before init action\n\t\tdo_action( 'before_masterslider_init' );\n\n\t\t// Load plugin text domain\n\t\t$this->load_plugin_textdomain();\n\n\t\t// Init action\n\t\tdo_action( 'masterslider_init' );\n\t}",
"public function onPluginsLoaded(){\n\t\t$this->Slim->Event->emit('plugins_loaded');\n\t}",
"public function Initate() {\n\t\tif(!$this->isInitiated) {\n\n\t\t\tload_plugin_textdomain('sitemap',false,dirname( plugin_basename( __FILE__ ) ) . '/lang');\n\n\t\t\t$this->freqNames = array(\n\t\t\t\t\"always\" => __(\"Always\", \"sitemap\"),\n\t\t\t\t\"hourly\" => __(\"Hourly\", \"sitemap\"),\n\t\t\t\t\"daily\" => __(\"Daily\", \"sitemap\"),\n\t\t\t\t\"weekly\" => __(\"Weekly\", \"sitemap\"),\n\t\t\t\t\"monthly\" => __(\"Monthly\", \"sitemap\"),\n\t\t\t\t\"yearly\" => __(\"Yearly\", \"sitemap\"),\n\t\t\t\t\"never\" => __(\"Never\", \"sitemap\")\n\t\t\t);\n\n\n\t\t\t$this->LoadOptions();\n\t\t\t$this->LoadPages();\n\n\t\t\t//Register our own priority providers\n\t\t\tadd_filter(\"sm_add_prio_provider\", array($this, 'AddDefaultPrioProviders'));\n\n\t\t\t//Let other plugins register their providers\n\t\t\t$r = apply_filters(\"sm_add_prio_provider\", $this->prioProviders);\n\n\t\t\t//Check if no plugin return null\n\t\t\tif($r != null) $this->prioProviders = $r;\n\n\t\t\t$this->ValidatePrioProviders();\n\n\t\t\t$this->isInitiated = true;\n\t\t}\n\t}",
"function init() {\n\n\t// Load plugin text domain.\n\tload_plugin_textdomain(\n\t\t'dashboard-summary',\n\t\tfalse,\n\t\tdirname( DS_BASENAME ) . '/languages'\n\t);\n\n\t// If this is in the must-use plugins directory.\n\tload_muplugin_textdomain(\n\t\t'dashboard-summary',\n\t\tdirname( DS_BASENAME ) . '/languages'\n\t);\n\n\t/**\n\t * Class autoloader\n\t *\n\t * The autoloader registers plugin classes for later use,\n\t * such as running new instances below.\n\t */\n\trequire_once DS_PATH . 'includes/autoloader.php';\n\n\t// Settings and core methods.\n\tnew Classes\\Settings;\n\tnew Classes\\Summary;\n\tnew Classes\\User_Options;\n\n\t// Add settings link to plugin row.\n\tadd_filter( 'plugin_action_links_' . DS_BASENAME, [ __NAMESPACE__ . '\\Classes\\Settings', 'settings_link' ], 99 );\n\tadd_filter( 'network_admin_plugin_action_links_' . DS_BASENAME, [ __NAMESPACE__ . '\\Classes\\Settings', 'settings_link' ], 99 );\n}",
"public function onLoad()\n\t{\n\t\t// Registering your API.\n\t\t// If you haven't implemented ipcCommands() you will also need to provide\n\t\t// a command map (see the next example).\n\t\t$this->getPluginHandler()->getPlugin('Ipc')->addApi($this);\n\t\t\n\t\t// Registering an API for a different plugin:\n\t\t// First we retrieve the instance of the plugin we want to add, in our case\n\t\t// the Command plugin.\n\t\t// Note that most plugins won't be suitable since their event handlers\n\t\t// require an event object and/or use the bot to send their response. In\n\t\t// those cases you're better off writing your own wrapper methods.\n\t\t$plugin = $this->getPluginHandler()->getPlugin('Command');\n\t\t// Next we define our command map, where we map the command \"list\" to the\n\t\t// plugin method \"getMethods\". This is optional for plugins that already\n\t\t// implement the method ipcCommands(), but even then it is handy to limit\n\t\t// the list of available commands or use different command names.\n\t\t$map = array('list' => 'getMethods');\n\t\t// Finally we get the Ipc plugin and tell it to add our new API by providing\n\t\t// the plugin instance, the command map and the API alias. If we had left\n\t\t// out the \"cmd\" alias, Ipc would use \"Command\" instead.\n\t\t$this->getPluginHandler()->getPlugin('Ipc')->addApi($plugin, $map, 'cmd');\n\t\t// Tip: You can use the optional alias to add a plugin multiple times using\n\t\t// different API aliases and command maps.\n\t}",
"function init() {\n //plugin_event_hook( 'EVENT_MENU_ISSUE', 'worklogmenu' );\n // plugin_event_hook('EVENT_LAYOUT_RESOURCES', 'resources');\n\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n $this->_registerLogger();\n $this->_redirectAfterInstall();\n $this->_registerEvents();\n\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n if (Craft::$app->request->getIsSiteRequest()) {\n Craft::$app->view->registerTwigExtension(new VatCheckerTwigExtension());\n }\n\n Event::on(\n Fields::class,\n Fields::EVENT_REGISTER_FIELD_TYPES,\n function (RegisterComponentTypesEvent $event) {\n $event->types[] = VatField::class;\n }\n );\n\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n }\n }\n );\n\n Craft::info(\n Craft::t(\n 'vat-checker',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"protected function initPluginEvents()\n {\n $this->setupPluginEvents();\n $this->_registerPluginEvents();\n }",
"public function register_plugin_settings(){\n register_setting(\"EventPluginSettings\",'past_events');\n register_setting(\"EventPluginSettings\",'events_per_page');\n }",
"public function init() {\n\n\t\tadd_filter( 'site_status_tests', array( $this, 'register_pro_site_status_tests' ) );\n\n\t\t// The priority is set a bit lower, so the core plugin can register the core debug info fields.\n\t\tadd_filter( 'debug_information', array( $this, 'register_pro_debug_information' ), 20 );\n\n\t\t// Register async test hooks.\n\t\tadd_action( 'wp_ajax_health-check-pro-license_test', array( $this, 'pro_license_test' ) );\n\t\tadd_action( 'wp_ajax_health-check-wpmailsmtpdotcom-communication_test', array( $this, 'wpmailsmtpdotcom_communication_test' ) );\n\t}",
"public function on_start()\n {\n // Add custom logic here that needs to be executed during CMS boot, things\n // such as registering services, assets, etc.\n }",
"function onPluginsLoaded() {\r\n\r\n\t\t\t// Register the widget-method that displays images from\r\n\t\t\t// the local YAPB installation\r\n\r\n\t\t\tregister_sidebar_widget('YAPB Sidebar Widget', array(&$this, 'onDrawLocal'));\r\n\t\t\tregister_widget_control('YAPB Sidebar Widget', array(&$this, 'onControlLocal'));\r\n\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get validator rule renderer | public static function getValidatorRuleRenderer()
{
return self::$_defaultValidatorRuleRenderer;
} | [
"public function renderer()\n {\n return $this->renderer;\n }",
"public function getRenderer()\n {\n return $this->renderer;\n }",
"public function getRenderer()\n {\n return $this->_renderer;\n }",
"final public function renderer()\r\n\t{\r\n\t\t// return it\r\n\t\treturn $this->renderer;\r\n\t}",
"public function getFormRenderer();",
"public function getRule();",
"public function getValidator(){\n\t\treturn $this->_validator;\n\t}",
"public function getFormRenderer() : FormRenderer;",
"public function getValidRuleHelper() {\n\t\t$rules = $this->validRuleProvider();\n\t\treturn $rules[0][0];\n\n\t}",
"public function getRenderer()\n\t{\n\t\treturn isset($this->renderer) ? $this->renderer : NULL;\n\t}",
"public function getValidator()\n {\n return $this->validator;\n }",
"public function get_renderer() {\n global $PAGE;\n if ($this->output) {\n return $this->output;\n }\n $this->output = $PAGE->get_renderer('mod_ereflect');\n return $this->output;\n }",
"protected function determineRenderer(): callable\n {\n if ($this->contentType !== null && array_key_exists($this->contentType, $this->errorRenderers)) {\n $renderer = $this->errorRenderers[$this->contentType];\n } else {\n $renderer = $this->defaultErrorRenderer;\n }\n\n return $this->callableResolver->resolve($renderer);\n }",
"public function getRuleProvider()\n {\n return $this->ruleProvider;\n }",
"public function getRule()\n {\n return $this->rule;\n }",
"public function getRuleParser()\n {\n return $this->ruleParser;\n }",
"public function getRule(): string;",
"public function getRenderer();",
"protected function getRenderer()\n {\n return $this->renderer === null ?\n new HtmlRenderer :\n $this->renderer;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the settings for api ip access | public function actionApi_ip_access()
{
$request = Yii::app()->request;
$notify = Yii::app()->notify;
$model = new OptionApiIpAccess();
if ($request->isPostRequest) {
$model->unsetAttributes();
$model->attributes = (array)$request->getPost($model->modelName, array());
if (!$model->save()) {
$notify->addError(Yii::t('app', 'Your form contains a few errors, please fix them and try again!'));
} else {
$notify->addSuccess(Yii::t('app', 'Your form has been successfully saved!'));
}
Yii::app()->hooks->doAction('controller_action_save_data', $collection = new CAttributeCollection(array(
'controller' => $this,
'success' => $notify->hasSuccess,
'model' => $model,
)));
if ($collection->success) {
$this->redirect(array('settings/api_ip_access'));
}
}
$this->setData(array(
'pageMetaTitle' => $this->getData('pageMetaTitle') . ' | ' . Yii::t('settings', 'Settings'),
'pageHeading' => Yii::t('settings', 'Settings'),
'pageBreadcrumbs' => array(
Yii::t('settings', 'Settings') => $this->createUrl('settings/index'),
Yii::t('settings', 'Api settings') => $this->createUrl('settings/api'),
Yii::t('settings', 'IP access'),
)
));
$this->render('api-ip-access', compact('model'));
} | [
"private function validateApiIp() {\n\n\t\t//make sure it's a string\n\t\tValidate::string($this->settings['apiIp'], $this->errorPrefix.'API IP');\n\t\tValidate::ip($this->settings['apiIp'], $this->errorPrefix.'API IP');\n\t}",
"public function adminipAction() {\n if ($this->checkToken()) {\n if (!filter_var($this->getRequest()->getParam('ip'), FILTER_VALIDATE_IP) === false) {\n Mage::getModel('core/config')->saveConfig('peerius/general/adminip', $this->getRequest()->getParam('ip'));\n }\n }\n }",
"private function _set_ip() {\n\t\tif (!property_exists($this->application,'ip')) {\n\t\t\tif (!$this->application->property_exists('ip')) {\n\t\t\t\tif (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\t\t\t$this->application->ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->_set_ip_null_check();\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_set_ip_null_check();\n\t\t}\n\t}",
"function checkIpAllowed()\n {\n $ip_list = explode(',', config('bogpayment.allowed_ips'));\n\n if ($ip_list) {\n $client_ip = request()->getClientIp();\n\n if (!in_array($client_ip, $ip_list)) {\n abort(403, 'Access denied for IP: ' . $client_ip);\n }\n }\n }",
"private function _validateIP() {\n \n if(!$this->data->getIp()){\n if(isset($_SERVER[\"REMOTE_ADDR\"])){\n $this->data->setIp($_SERVER[\"REMOTE_ADDR\"]);\n }else{\n $this->data->setIp($this->_getRemoteIp());\n }\n }\n }",
"private function initAccessByIP( )\r\n {\r\n // No access by default\r\n $this->bool_accessByIP = false;\r\n\r\n // Get list with allowed IPs\r\n $csvIP = $this->arr_extConf['allowedIPs'];\r\n $currentIP = t3lib_div :: getIndpEnv( 'REMOTE_ADDR' );\r\n\r\n // Current IP is an element in the list\r\n $pos = strpos( $csvIP, $currentIP );\r\n if( ! ( $pos === false ) )\r\n {\r\n $this->bool_accessByIP = true;\r\n }\r\n // Current IP is an element in the list\r\n }",
"function setIp()\n\t{\n\t\t$this->customer['ipaddress'] = $_SERVER['REMOTE_ADDR'];\n\t\n\t\tif(!isset($this->customer['user_agent']))\n\t\t{\n\t\t\t$this->customer['user_agent']\t= $_SERVER['HTTP_USER_AGENT'];\n\t\t}\n\t\n\t\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t{\n\t\t\t$this->customer['forwardedip'] \t= $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\t}",
"function setIp(){\n $this->customer['ipaddress'] = $_SERVER['REMOTE_ADDR'];\n\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){\n $this->customer['forwardedip'] = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }",
"public function getIp()\n {\n $default = '192.168.56.' . mt_rand(10,240);\n $this->setSetting('ip', CLI::getLine('Please fill in the local IP of your devbox', $default));\n }",
"public function restrict_by_ip()\n {\n\n if($this->config['restrictbyip'] == 'On'){\n\n $allowedip = false;\n\n foreach($this->config['allowediplist'] as $ip){\n\n /*echo 'REMOTE_ADDR: ' . $_SERVER['REMOTE_ADDR'] . ' - ALLOWED IP: ' . $ip . '<br/>';\n\n echo 'STRPOS RESULT: ' . strpos($_SERVER['REMOTE_ADDR'], $ip) . '<br/>';*/\n\n if(strpos($_SERVER['REMOTE_ADDR'], $ip) === 0){\n\n $allowedip = true;\n\n break;\n\n }\n\n }\n\n if( $allowedip === false ){\n\n header(\"HTTP/1.0 404 Not Found\");\n die();\n\n }\n\n }\n\n }",
"private function _is_api_request_allowed()\n\t{\n\t\t// STEP 1: Check to see if site is private\n\t\tif(Kohana::config('settings.private_deployment'))\n\t\t{\n\t\t\tif ( ! $this->_login())\n\t\t\t{\n\t\t\t\t// @todo better error message\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// STEP 2: Check if the IP has been banned\n\t\t$banned_count = ORM::factory('api_banned')\n\t\t\t\t\t\t->where('banned_ipaddress', $this->request_ip_address)\n\t\t\t\t\t\t->count_all();\n\n\t\tif ($banned_count > 0)\n\t\t\treturn FALSE;\n\n\t\t// STEP 3: Check if the IP address has exceeded the request quota\n\n\t\t// Get the API settings\n\t\t$api_settings = new Api_Settings_Model(1);\n\n\t\t// Check if an API request quota has been set\n\t\tif ( ! isset ($api_settings->max_requests_per_ip_address))\n\t\t\treturn TRUE;\n\n\t\t// Get the API request quota\n\t\t$request_quota = $api_settings->max_requests_per_ip_address;\n\n\t\t// Get the quota basis\n\t\t$quota_basis = (isset($api_settings->max_requests_quota_basis))\n\t\t\t? $api_settings->max_requests_quota_basis\n\t\t\t: NULL;\n\n\t\t$num_api_requests = -1; // Will hold the number of API requests for the specified IP\n\n\t\t// Database table prefix\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\n\t\t// Template query\n\t\t$template_query = \"SELECT COUNT(*) AS record_count \";\n\t\t$template_query .= \"FROM \".$table_prefix.\"api_log \";\n\t\t$template_query .= \"WHERE DATE_FORMAT(api_date, '%s') = '%s' \";\n\t\t$template_query .= \"AND api_ipaddress = '\".$this->request_ip_address.\"'\";\n\n\t\t// Get the number of api requests logged depending on the quota basis\n\t\tswitch ($quota_basis)\n\t\t{\n\t\t\t// Per day quota\n\t\t\tcase 0:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m-%d', date('Y-m-d', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\n\t\t\t// Per month quota\n\t\t\tcase 1:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m', date('Y-m', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Return value\n\t\treturn ($num_api_requests >= $request_quota)? FALSE : TRUE;\n\t}",
"private function setIP() {\n\t\t$this->strIP = $_SERVER[\"SERVER_ADDR\"];\n\t\n\t}",
"public function proxy_settings()\n {\n $data['body'] = \"admin/social_apps/proxy_settings\";\n $data['page_title'] = $this->lang->line('Proxy Settings');\n $this->_viewcontroller($data);\n }",
"function process_ip()\n\t{\n\t\tglobal $show, $vbphrase, $stylevar;\n\n\t\t$post =& $this->post;\n\n\t\t$this->post['iplogged'] = '';\n\t\tif ($this->post['ip'] != '')\n\t\t{\n\t\t\tif ($this->registry->options['logip'] == 2)\n\t\t\t{\n\t\t\t\t$show['ip'] = true;\n\t\t\t\teval('$this->post[\\'iplogged\\'] = \"' . fetch_template('postbit_ip') . '\";');\n\t\t\t}\n\t\t\telse if ($this->registry->options['logip'] == 1 AND can_moderate($this->thread['forumid'], 'canviewips'))\n\t\t\t{\n\t\t\t\t$show['ip'] = false;\n\t\t\t\teval('$this->post[\\'iplogged\\'] = \"' . fetch_template('postbit_ip') . '\";');\n\t\t\t}\n\t\t}\n\t}",
"public function handleIP() {\n\t\t$this->verConstant(\"HANDLEIP_DBHOST\");\n\t\t$this->verConstant(\"HANDLEIP_DBNAME\");\n\t\t$this->verConstant(\"HANDLEIP_DBUSER\");\n\t\t$this->verConstant(\"HANDLEIP_DBPASS\");\n\t\t$this->verConstant(\"HANDLEIP_TABLE\");\n\t\t$this->verConstant(\"HANDLEIP_URLOMIT\");\n\t\t$this->verConstant(\"HANDLEIP_NUMATTEMPTS\");\n\t\t$this->connect2DB(); # Open the Connection\n\t\t$this->checkIP(HANDLEIP_TABLE, HANDLEIP_URLOMIT, TRUE, HANDLEIP_NUMATTEMPTS); # Do stuff\n\t\t$this->closeDB(); # Close the Connection\n\t}",
"private function init_accessByIP()\n {\n // No access by default\n $this->bool_accessByIP = false;\n\n // Get list with allowed IPs (< version 4.0)\n $this->str_developer_csvIp = $this->arr_extConf[ 'updateWizardAllowedIPs' ];\n // Get list with allowed IPs (>= version 4.0)\n $csvIP = $this->arr_extConf[ 'updateWizardAllowedIPs' ];\n $currentIP = t3lib_div :: getIndpEnv( 'REMOTE_ADDR' );\n\n // Current IP is an element in the list\n $pos = strpos( $csvIP, $currentIP );\n if ( !( $pos === false ) )\n {\n $this->bool_accessByIP = true;\n }\n // Current IP is an element in the list\n // RETURN no DRS prompt\n if ( !$this->b_drs_all )\n {\n return;\n }\n // RETURN no DRS prompt\n // DRS prompt\n $prompt = $currentIP . ' is an element of ' . $csvIP;\n t3lib_div::devLog( '[INFO/ALL] ' . $prompt, $this->extKey, 0 );\n // DRS prompt\n }",
"private function set_ip_address() {\n\t\t$ip = $this->action === 'submit' && rgars( $this->form, 'personalData/preventIP' ) ? GFFormsModel::get_ip() : rgar( $this->entry, 'ip' );\n\n\t\tif ( ! empty( $ip ) ) {\n\t\t\t$ip = preg_replace( '/[^0-9A-F:.]/i', '', $ip );\n\t\t}\n\n\t\t$this->ip = $ip;\n\t}",
"private function get_host_ip_info()\n {\n $this->host_ip_info = $this->get_ip_info($this->wireguard_interface['Address']);\n }",
"private function sniff_ip() {\n\n\t\tif ( $this->ip_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\t$this->ip_data = [ '127.0.0.1', 'CLI' ];\n\n\t\t\treturn;\n\t\t}\n\n\t\t$ip_server_keys = [ 'REMOTE_ADDR' => '', 'HTTP_CLIENT_IP' => '', 'HTTP_X_FORWARDED_FOR' => '', ];\n\t\t$ips = array_intersect_key( $_SERVER, $ip_server_keys );\n\t\t$this->ip_data = $ips ? [ reset( $ips ), key( $ips ) ] : [ '0.0.0.0', 'Hidden IP' ];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if this day is a Friday. | public function isFriday(); | [
"function isFriday(){ return $this->getIsoWeekDay()==5; }",
"public function isFriday()\n {\n return $this->dayOfWeek === ChronosInterface::FRIDAY;\n }",
"public function isFriday(): bool\n {\n return $this->day_of_week == 5;\n }",
"protected function _isFriday($date)\n {\n return ($this->_formatDeliveryDate($date, \"N\") == 5);\n }",
"public function isWeekday()\n {\n return ($this->numeric(\"N\") <= Days::FRIDAY);\n }",
"public function isFridayToday($date = null)\n {\n $date = $this->isDate($date) ? $date : 'today';\n\n $todayOrDate = new \\DateTime($date);\n $day_of_week = $todayOrDate->format('D');\n return $day_of_week == 'Fri';\n }",
"public function isSaturday(): bool;",
"public function isSaturday();",
"public static function IsDateFri($Daytest)\n{\n $Daytest = new \\DateTime($Daytest);\n $timestamp = strtotime($Daytest->format('Y-m-d'));\n $cakeDay = date('D', $timestamp);\n \n \n if ($cakeDay == \"Fri\"){\n return true;\n }\n else\n {\n return false;\n }\n}",
"public function isSaturday()\n {\n return $this->getDayOfWeek() == 6;\n }",
"public function isThursday(): bool;",
"public function isSaturday(): bool\n {\n return $this->dayOfWeek === Chronos::SATURDAY;\n }",
"public function isSaturday()\n {\n return $this->dayOfWeek === ChronosInterface::SATURDAY;\n }",
"public function isThursday();",
"public function IsWeekDay()\r\n\t{\r\n\t\treturn( ( $this->DayOfWeek( 1 ) < 6 ) ? true : false );\r\n\t}",
"public function isSunday();",
"public function isWednesday(): bool\n {\n return $this->dayOfWeek === static::WEDNESDAY;\n }",
"public function isWeekDay()\n {\n $w = $this->getDay();\n\n return ($w > 0 && $w < 6) ? true : false;\n }",
"public function isWeekday();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Success test for method isTimeoutReached. | public function testIsTimeoutReached() {
$message = $this->_createMessage();
$this->assertFalse($message->isTimeoutReached());
// TODO set start time and test true state
} | [
"public function checkTimeout();",
"public function isInTimeout();",
"public function checkTimeout(){ }",
"public function hasTimeLimitReached();",
"public function isTimedOut(): bool\n {\n return $this->status === static::STATUS_TIMEOUT;\n }",
"public function shouldFailOnTimeout()\n {\n return $this->payload()['failOnTimeout'] ?? false;\n }",
"public function hasTimeLimitReached(): bool;",
"public function isTimeoutError() {\n return static::isTimeoutErrorCode($this->PelecardStatusCode);\n }",
"public function isTimeoutRequest ();",
"public function isTimedOut()\n {\n if (! $this->exists() || ! $this->user->canTimeout)\n {\n return false;\n }\n\n if ($this->status == 1) \n {\n return true;\n }\n \n $cutoff = strtotime(date('Y-m-d H:i:s', strtotime(\"-\" . TIMEOUT_MINUTES . \" minutes\")));\n if (strtotime($this->lastActive) < $cutoff)\n {\n $this->timeOut();\n return true;\n }\n \n return false;\n }",
"public function hasTimeLimitReached(): bool\n\t{\n\t\treturn $this->instanceTimer()->hasTimeLimitReached();\n\t}",
"public function hasTimeLimitReached()\n\t{\n\t\treturn $this->instanceTimer()->hasTimeLimitReached();\n\t}",
"public function isInTimeout()\n {\n return $this->inTimeout;\n }",
"private function timeout()\n {\n $waiting = $this->authorize\n ->created_at\n ->addMinutes(15);\n if (now() >= $waiting) {\n return true;\n }\n return false;\n }",
"public function IsTimeOut()\n {\n if (!$this->IsRun())\n return true;\n\n return $this->_cheakTimeout();\n }",
"public function testRequestTimeout()\n {\n $testTimeout = '1';\n\n EasyPost::setResponseTimeout($testTimeout);\n $connectionTimeout = EasyPost::getResponseTimeout();\n\n $this->assertEquals($testTimeout, $connectionTimeout);\n }",
"#[@test]\n public function timeouts() {\n $r= $this->suite->runTest(new SimpleTestCase('timeouts'));\n $this->assertEquals(1, $r->failureCount());\n }",
"public function timeout()\n {\n $this->processor->timeout();\n\n $this->waitingForAnswer = false;\n }",
"public function getTimeout();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes default pagebreaks from the content so the normal pagination will not interfere with the mobile pagination. | function pglContentMcsmobilepagebreakRemoveDefaultPagebreaks(&$row) {
$regex = '#<hr([^>]*?)class=(\"|\')system-pagebreak(\"|\')([^>]*?)\/*>#iU';
$row->text = preg_replace( $regex, '<br />', $row->text );
} | [
"function removeInPagePagination($post)\n {\n if (false !== strpos($post->post_content, '<!--nextpage-->')) \n {\n /*Reset the global $pages:*/\n $GLOBALS['pages'] = [$post->post_content];\n \n /*Reset the global $numpages:*/\n $GLOBALS['numpages'] = 0;\n \n /*Reset the global $multipage:*/\n $GLOBALS['multipage'] = false;\n }\n }",
"function sanitize_pagination($content) {\n // Remove h2 tag\n $content = preg_replace('#<h2.*?>(.*?)<\\/h2>#si', '', $content);\n return $content;\n}",
"public function removePages() {}",
"public function remove_content_filter() {\n\t\t// @todo also check if this page supports blocks.\n\t\tif ( is_page() ) {\n\t\t\tremove_filter( 'the_content', 'wpautop', 10 );\n\t\t\tadd_filter( 'the_content', array( $this, 'spineautop' ), 10 );\n\t\t}\n\t}",
"public function ignore_pagebreaks( $form_data ) {\n\n\t\tforeach ( $form_data['fields'] as $id => $field ) {\n\t\t\tif ( 'pagebreak' !== $field['type'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tunset( $form_data['fields'][ $id ] );\n\t\t}\n\n\t\treturn $form_data;\n\t}",
"function remove_whitespace($wp_list_pages) {\n\treturn str_replace(array(\"\\n\", \"\\r\", \"\\t\"), \"\", $wp_list_pages);\t\n}",
"protected function disablePagination()\n {\n $this->perPage = 0;\n }",
"protected function breakDataInPages()\n {\n\n if (false !== strpos($this->data, '<div class=\"page-break\"')) {\n\n // Set navigation links\n $this->loadNavigationLinks($this->data);\n\n // Set array of pages, each of which is a substring of data\n $this->pages = preg_split(\n '#<div class=\"page-break\" data-button-previous=\"(.*?)\" data-button-next=\"(.*?)\"></div>#s',\n $this->data\n );\n\n // Set number of pages\n $this->numberOfPages = count($this->pages);\n\n if ($this->numberOfPages === 1) {\n $this->pages = preg_split(\n '#<div class=\"page-break\" data-button-next=\"(.*?)\" data-button-previous=\"(.*?)\"></div>#s',\n $this->data\n );\n // Set number of pages\n $this->numberOfPages = count($this->pages);\n }\n\n } else {\n\n // Set array of pages with one page\n $this->pages = array($this->data);\n\n // Set number of pages\n $this->numberOfPages = 1;\n\n }\n\n }",
"public function acceptPageBreak();",
"function clean_query_after_initial_projects_load(){\n $page = empty($_GET['pp']) ? 0 : (int)$_GET['pp'];\n if($page && (is_search() || is_archive()) && !isset($_GET['dyn_part'])){\n //change pagination values to build navigation links\n global $wp_query, $paged;\n $wp_query->set('paged', $page);\n $paged = $page;\n $totalPages = ceil($wp_query->found_posts / get_option('posts_per_page'));\n $wp_query->max_num_pages = $totalPages;\n $wp_query->is_paged = true;\n }\n}",
"public function remove_pagination() {\n\t\t$this->pagination->limit = null;\n\n\t}",
"public function disablePagination() {\n $this->_enabledPagination = false;\n }",
"public function removePageSupport(){\n\t\tremove_post_type_support( 'page', 'author' );\n\t\tremove_post_type_support( 'page', 'custom-fields' );\n\t}",
"private function bootstrapPages()\n {\n $this->pages = array_fill(0, $this->total_pages, 0);\n }",
"public function removePages(): void;",
"public function prePageContent();",
"final public function removePages(): void\n {\n $this->pages = [];\n $this->index = [];\n }",
"public static function removeContentEditorForPages() {\n\t\tremove_post_type_support('page', 'editor');\n\t}",
"function remove_pages_from_search() {\n \tglobal $wp_post_types;\n \t$wp_post_types['page']->exclude_from_search = true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for sendOrderUnit Mark an order unit as sent. | public function testSendOrderUnit()
{
} | [
"public function testSendOrderPerSms() {\n\n $orderId = $this->placeOrder(array('finalize' => false));\n $order = new Yourdelivery_Model_Order($orderId);\n\n $restaurant = $order->getService();\n $restaurant->setNotify('sms');\n $restaurant->save();\n\n $order->setService($restaurant);\n $order->send(false);\n\n $history = $order->getStateHistory()->toArray();\n $status = array_pop($history);\n $this->assertEquals($status['comment'], 'Send out order to service via sms');\n\n $rows = $order->getSendbyHistory();\n foreach ($rows as $row) {\n $this->assertEquals($row->sendBy, 'sms');\n }\n }",
"public function testInvoiceMarkAsSent()\n {\n }",
"public function testSend() {\n\t\t$invoiceId = 13150403;\n\t\t$expectedArray = $this->getFixture( 'invoice-message-27835326' );\n\n\t\t$api = $this->getApiMock();\n\t\t$api->expects( $this->once() )\n\t\t\t->method( 'post' )\n\t\t\t->with( '/invoices/' . $invoiceId . '/messages', [ 'event_type' => 'send' ] )\n\t\t\t->will( $this->returnValue( $expectedArray ) );\n\n\t\t$this->assertEquals( $expectedArray, $api->send( $invoiceId ) );\n\t}",
"abstract public function testSendSuccess();",
"public function given_message_when_send_Then_SendsMessageToRequestedDestination() {\n\n $client = new NexmoMockClient;\n $repository = new NexmoRepository($client);\n\n // Act\n $repository->send(\"foo message\", \"+34-123456789\");\n\n // Assert\n self::assertNotNull($client->message->sendCalled);\n self::assertEquals($client->message->payload['text'], \"foo message\");\n self::assertEquals($client->message->payload['to'], \"34123456789\");\n self::assertEquals($client->message->payload['from'], env('SMS_EMISOR_NAME', 'Opencash'));\n }",
"public function testSend()\n {\n }",
"public function testSendWithoutCustomer()\n {\n $order = $this->createOrder();\n $shipment = $this->createShipment($order);\n\n /** @var ShipmentIdentity $shipmentIdentity */\n $shipmentIdentity = $this->createShipmentEntity();\n /** @var ShipmentSender $shipmentSender */\n $shipmentSender = $this->createShipmentSender($shipmentIdentity);\n\n $this->assertEmpty($shipment->getEmailSent());\n $result = $shipmentSender->send($shipment, true);\n\n $this->assertEquals(self::ORDER_EMAIL, $shipmentIdentity->getCustomerEmail());\n $this->assertTrue($result);\n $this->assertNotEmpty($shipment->getEmailSent());\n }",
"public function sendOrder($order) {\n\t\tif ($order) {\n\t\t\t$this->create();\n\t\t\t$this->data = $order;\t\t\t\t\t\t\n\t\t\t$this->save($this->data, false);\n\t\t}\n\t}",
"public function sendTestMessage(): void\n {\n $siteName = $this->commerce->getOption('site_name');\n\n // Grab the last order to send as a test\n $c = $this->adapter->newQuery('comOrder');\n $c->where([\n 'test' => $this->commerce->isTestMode(),\n ]);\n $c->sortby('received_on', 'DESC');\n $order = $this->adapter->getObject('comOrder', $c);\n if ($order instanceof comOrder && $status = $order->getOne('Status')) {\n $response = $this->sendOrderToSlack($order, $status);\n if ($response->getStatusCode() !== 200) {\n $body = (string)$response->getBody();\n $this->setProperty('last_response', $body);\n $this->save();\n return;\n }\n }\n\n // Send another message confirming it worked\n $payload = new Message($this->adapter->lexicon('commerce_slack.success', ['site_name' => $siteName]));\n $payload->addBlock([\n 'type' => 'section',\n 'text' => [\n 'type' => 'mrkdwn',\n 'text' => $this->adapter->lexicon('commerce_slack.success', ['site_name' => $siteName]) . ' :tada:'\n ]\n ]);\n $sender = new Sender($this->getProperty('webhook_url'));\n $response = $sender->send($payload);\n if ($response->getStatusCode() !== 200) {\n $body = $response->getBody()->getContents();\n $this->setProperty('last_response', $body);\n }\n }",
"public function testSendSuccess()\n {\n $this->setMockHttpResponse('MakeApplePayRequestSuccess.txt');\n $response = $this->request->send();\n $this->assertTrue($response->isSuccessful());\n $this->assertEquals(487016, $response->getData()['order_id']);\n }",
"public function testSendPTT()\n {\n }",
"public function testPurchaseOrdersSemdMail()\n {\n }",
"public function testSubmitOrder()\n\t{\n\t\t$d = new Destination('United States', 'TX', '78755');\n\t\t$c = new Customer('Austin', null, '123 Road', 'Austin');\n\t\t$o = (new KunakiOrder($d, $c))->addProduct(EXAMPLE_PRODUCT, 1);\n\t\t$o->setShippingOption($o->getShippingOptions()[0]);\n\t\t$o->submitOrder(true);\n\t\t$this->assertEquals($o->getOrderId(), '00000');\n\t}",
"public function testSendString()\n {\n\n }",
"public function testSendOrderPerFax() {\n\n $restaurant = $this->getRandomService();\n $notify = $restaurant->getNotify();\n $restaurant->setNotify('fax');\n $restaurant->save();\n\n $orderId = $this->placeOrder(array('service'=> $restaurant));\n $order = new Yourdelivery_Model_Order($orderId);\n\n $order->send(false);\n\n $history = $order->getStateHistory();\n $status = $history->current();\n $this->assertEquals($status['comment'], 'Send out order to service via fax ('.$restaurant->getFaxService().\") to \".$restaurant->getFax());\n\n $rows = $order->getSendbyHistory();\n foreach ($rows as $row) {\n $this->assertEquals($row->sendBy, 'fax');\n }\n\n // reset service to origin notify\n $restaurant->setNotify($notify);\n $restaurant->save();\n\n }",
"public function testOrderItemsPresentInEmail()\n {\n $order = $this->getOrder('100000001');\n $invoice = $this->getInvoiceByOrder($order);\n $this->emailSender->send($order, $invoice);\n $message = $this->transportBuilder->getSentMessage();\n $this->assertStringContainsString(\n 'SKU: simple',\n $message->getBody()->getParts()[0]->getRawContent(),\n 'Expected text wasn\\'t found in message.'\n );\n }",
"public function testSendTestData()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testSalesOrderPutByorderNbr()\n {\n }",
"public function testPostOrderMailSuccess()\n {\n Mail::fake();\n\n // Assert that no mailables were sent...\n Mail::assertNothingSent();\n\n // Set product id and email\n $email = 'purchaser@email.com';\n $this->data['email'] = $email;\n $this->data['product_id'] = Product::first()->id;\n\n // Send order\n $response = $this->json('post', $this->endpoint, $this->data);\n\n // Success response\n $response->assertStatus(200);\n\n // Mail has been sent to admin\n Mail::assertSent(function (OrderedAdminNotification $mail) {\n return $mail->order->id === Order::first()->id;\n });\n\n // Mail has been sent to purchaser\n Mail::assertSent(function (OrderedPurchaserNotification $mail) use ($email) {\n return $mail->hasTo($email);\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
single supplier view return here | public function view_supplier($id){
$single = DB::table('suppliers')
->where('id',$id)
->first();
return view('supplier.view_supplier')->with("single",$single);
} | [
"public function supplier()\n {\n $data['title'] = 'Admin | Supplier';\n $data['supplier'] = $this->M_apotik->supplier();\n $this->template->load('MasterAdmin','Apotik/supplier/data-supplier',$data);\n }",
"public function supplier_list()\n {\n $suppliers = DB::table('supplier_record')\n ->orderBy('supplier_id','desc')\n ->get();\n\n return view('admin.admin-manage-supplier')->with('suppliers',$suppliers);\n\n }",
"public function getContents() \n {\n $this->db->select('*');\n $this->db->from('supplier');\n $query = $this->db->get();\n return $result = $query->result();\n $this->load->view('edit_data', $result);\n }",
"abstract public function display_view();",
"function singleView() {\n\n\t\t$this->recordtemplate = $this->cObj->getSubpart(\n\t\t\t$this->template,\n\t\t\t'###RECORD_SINGLE###'\n\t\t);\n\n\t\t$record = $this->fetchLocalized(FALSE, '*', 'tx_multicatalog_product', 'uid = ' . intval($this->piVars['uid']) . $this->cObj->enableFields('tx_multicatalog_product'));\n\t\t$content = $this->renderRecord($record, $this->getFieldsConf('product'), $this->recordtemplate);\n\t\treturn $content;\n\n\t}",
"function retriewSupplierNameAndID()\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//create a supplierService object and call the retriewSupplierNameAndID() method by providing the supplierObject model\r\n\t\t\t\r\n\t\t\t$supplierModel = new SupplierModel();\r\n\t\t\t$supplierService = new SupplierService();\r\n\t\t\t\r\n\t\t\t$supplierModel->setSupplierName();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\techo 'sfjksdgjdflj';\r\n\t\t}",
"public function supplier_payment($id){\n $supplier_payment = Inventory::orderBy('id', 'desc')->where('supplier',$id)->get();\n return view('admin.supplier.payment_supplier' ,compact('supplier_payment'));\n }",
"public function spri(Request $request){\n $suppliers = DB::select(\"SELECT DISTINCT suppliers.supplier_name,purchase_details.supplier_id from suppliers,purchase_details where suppliers.id = purchase_details.supplier_id\");\n $purchases = '';\n return view('backend.admin.report.purchase.supplier_report_index',compact('suppliers','purchases'));\n }",
"function getSupplierItems();",
"public function show(){\n\t\treturn array('supplier' => $this->_mSupplier->getName(), 'product_sku' => $this->_mProductSKU);\n\t}",
"abstract public function toView();",
"public function view()\n\t{\n\t\t$dis = Access::model_show();\n\t\treturn $dis;\n\t}",
"public function VatAddSupplierView() {\n return view('board.pages.ajaxPages.addVatSupplier');\n }",
"public function generateView() \r\n {\r\n }",
"public function get_view(){ return $this->_view; }",
"public function pia_getBenefits()\n { \n return View::make('main.benefits');\n }",
"public function viewSingleProduct($singleProductId){\n return Product::find($singleProductId);\n }",
"function getSupplier() {\n\t\treturn mofilmSupplier::getInstance($this->getSupplierID());\n\t}",
"function viewProvider(){\n $sql = \"select * from provider where provider_id=:provider_id\";\n $args = [':provider_id'=>$this->provider_id];\n return DB::run($sql,$args);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add text before regular price and sale price | function sls_rrp_sale_price_html( $price, $product ) {
$has_sale_text = array(
'<del>' => '<del>Retail Price: ',
'<ins>' => 'Your Price: <ins>'
);
$return_string = str_replace(array_keys( $has_sale_text ), array_values( $has_sale_text ), $price);
return $return_string;
} | [
"function wc_custom_replace_sale_text( $html ) {\n\n $_product = wc_get_product( get_the_id() );\n\n $diff = $_product->get_regular_price() - $_product->get_sale_price();\n\n return str_replace( __( 'Sale!', 'oakworld' ), __( 'Save<br/>'.wc_price($diff), 'oakworld' ), $html );\n}",
"function us_add_to_cart_text_replace( $html, $product, $args ) {\r\n\t$html = str_replace( '{{us_add_to_cart_start}}', '<i class=\"g-preloader type_1\"></i><span class=\"w-btn-label\">', $html );\r\n\t$html = str_replace( '{{us_add_to_cart_end}}', '</span>', $html );\r\n\r\n\treturn $html;\r\n}",
"public function add_to_cart_text()\n {\n }",
"function get_price_line( $product ){ return '$'.wp_invoice_currency_format( $product->price_in_cents / 100).' for '.$product->interval.' '.$product->interval_unit.'(s)'; }",
"public function single_add_to_cart_text()\n {\n }",
"private function addResselerMarkup($price)\n {\n $markupToAdd = Premium::markupForCost($price);\n return $price + ($price * $markupToAdd / 100);\n }",
"function never5_lwp_upgrade_price_notes() {\n\t?><p><small>Additional VAT may be added on checkout if you're based in the EU.</small></p><?php\n}",
"function sp_woo_product_add_to_cart_text( $text ) {\n\treturn '<i class=\"icon-plus\" aria-hidden=\"true\"></i> ' . $text;\n}",
"function crypton_blog_woocommerce_get_price_html($price='') {\n\t\tif (!is_admin() && !empty($price)) {\n\t\t\t$sep = get_option('woocommerce_price_decimal_sep');\n\t\t\tif (empty($sep)) $sep = '.';\n\t\t\t$price = preg_replace('/([0-9,]+)(\\\\'.trim($sep).')([0-9]{2})/', '\\\\1<span class=\"decimals\">\\\\3</span>', $price);\n\t\t}\n\t\treturn $price;\n\t}",
"function platty_price(){\n\tglobal $post;\n\t$price = get_post_meta( $post->ID, 'price', true );\n\t\tif($price){\n\t?>\n\t<span class=\"price\">\n\t\t<?php echo $price; ?>\n\t</span>\n\t<?php } //end of price\n}",
"function mehedi_add_to_cart_text_change_single_page(){\n return \"Order Now\";\n }",
"function theme_uc_webform_render_product($product) {\n $output = '<span>' . check_plain($product['title']) . ', ' . t('Price:') . ' ' . variable_get('uc_currency_sign', '$') . check_plain($product['price']) . '</span>';\n\n return $output;\n}",
"function product_options_wholesale_price() {\r\n\t\t\twoocommerce_wp_text_input(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'id' => '_wholesale_price',\r\n\t\t\t\t\t'label' => __( 'Wholesale Price', 'woocommerce' ),\r\n\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t'desc_tip' => 'true',\r\n\t\t\t\t\t'description' => __( 'Enter a wholesale price.', 'woocommerce' ),\r\n\t\t\t\t\t'data_type' => 'price'\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}",
"function spanThePMProLevelCostText($text)\r\n{\r\n\t//generate a pattern like $[0-9]*.[0-9][0-9]\r\n\t$pattern = str_replace(\"$\", \"\\$\",\r\n\t\t\t\tstr_replace(\"1\", \"[0-9]\", \r\n\t\t\t\tstr_replace(\"1.\", \"[0-9]*\\.\", \r\n\t\t\t\tpmpro_formatPrice(\"1.11\")\r\n\t\t\t)));\r\n\t\t\t\r\n\t//replace with span wrapped version\r\n\t$level_cost = preg_replace(\"/(\" . $pattern . \")/i\", \"<span>$1</span>\", $text);\r\n\t\r\n\t//return\r\n\treturn $level_cost;\r\n}",
"public function _add_sale_price_to_theme( $price, $product_id ) {\n\n\t\tif ( it_exchange_is_product_sale_active( $product_id ) ) {\n\n\t\t\t$original = it_exchange_get_product_feature( $product_id, 'base-price' );\n\n\t\t\t$price = \"<del>$original</del> \";\n\t\t\t$price .= \"<ins>{$this->total}</ins>\";\n\t\t}\n\n\t\treturn $price;\n\t}",
"public function product_add_to_cart_text( $text, $product ) {\n $text = 'Customize';\n return $text;\n }",
"function hypnotherapy_woocommerce_get_price_html($price='') {\n\t\tif (!empty($price)) {\n\t\t\t$sep = get_option('woocommerce_price_decimal_sep');\n\t\t\tif (empty($sep)) $sep = '.';\n\t\t\t$price = preg_replace('/([0-9,]+)(\\\\'.trim($sep).')([0-9]{2})/', '\\\\1<span class=\"decimals\">\\\\3</span>', $price);\n\t\t}\n\t\treturn $price;\n\t}",
"public function get_price_html() {\n\n\t\tif ( $this->price !== '' ) {\n\t\t\tif ( $this->price == $this->sale_price && $this->sale_price < $this->regular_price ) {\n\n\t\t\t\t$price = '<del>' . carton_price( $this->regular_price ) . '</del> <ins>' . carton_price( $this->sale_price ) . '</ins>';\n\t\t\t\t$price = apply_filters( 'carton_variation_sale_price_html', $price, $this );\n\n\t\t\t} elseif ( $this->price > 0 ) {\n\n\t\t\t\t$price = carton_price( $this->price );\n\t\t\t\t$price = apply_filters( 'carton_variation_price_html', $price, $this );\n\n\t\t\t} else {\n\n\t\t\t\t$price = __( 'Free!', 'carton' );\n\t\t\t\t$price = apply_filters( 'carton_variation_free_price_html', $price, $this );\n\n\t\t\t}\n\t\t} else {\n\t\t\t$price = apply_filters( 'carton_variation_empty_price_html', '', $this );\n\t\t}\n\t\treturn $price;\n\t}",
"function tanvas_output_cart_price_notice(){\n\techo do_shortcode(\n\t\t'[box type=\"info\"]'.\n\t\t\t__('Dear customer our new cart has just been launched, while we have endeavored to ensure all pricing is correct we reserve the right to revise all pricing in line with our current listed prices. We thank you for your understanding.', TANVAS_DOMAIN).'<br/>'.\n\t\t'[/box]'\n\t);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Required. Used: in admin, PricePlanItemManage class in various places. Return true to display this order item planItem settings in the admin, or false to hide it in the admin. | public function displayInAdmin()
{
return true;
} | [
"public function isEnabledInAdminDisplay()\n {\n return $this->_enable_in_admin_display;\n }",
"public function adminPlanItemConfigDisplay($planItem)\n {\n $admin = $db = 1;\n include GEO_BASE_DIR . 'get_common_vars.php';\n\n $reg = geoAddon::getRegistry('charity_tools');\n\n $tpl_vars = array();\n $tpl_vars['enabled'] = $planItem->getEnabled();\n $tpl_vars['price'] = $planItem->get('price', 0.00);\n $tpl_vars['pre'] = $db->get_site_setting('precurrency');\n $tpl_vars['post'] = $db->get_site_setting('postcurrency');\n\n $tpl = new geoTemplate('addon', 'charity_tools');\n $tpl->assign($tpl_vars);\n return $tpl->fetch('addon/charity_tools/admin/plan_settings.tpl');\n }",
"static function shouldDisplay()\n {\n\n $admin = new Administration();\n $admin->retrieveSettings();\n\n if (!isset($admin->settings['sugarfeed_enabled']) || $admin->settings['sugarfeed_enabled'] != '1') {\n return false;\n } else {\n return true;\n }\n }",
"public function adminDisplaySettings()\n {\n $db = DataAccess::getInstance();\n\n $allow_paypal_check = ($db->get_site_setting('paypal_allow_sb') == 1) ? \"checked\" : \"\";\n\n $html = \"\n\t\t<div class='col_hdr'>Paypal</div>\n\t\t<div class='form-group'>\n\t\t\t<label class='control-label col-xs-12 col-sm-5'>Enable Paypal Seller-Buyer Gateway \" . geoHTML::showTooltip('Enable Paypal Seller-Buyer Gateway', \"This allows winning auction bidders to pay the seller directly via a PayPal link\") . \"</label>\n\t\t\t<div class='col-xs-12 col-sm-6'>\n\t\t\t\t<input type=\\\"checkbox\\\" name=\\\"paypal_allow_sb\\\" value=\\\"1\\\" $allow_paypal_check/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='form-group'>\n\t\t\t<label class='control-label col-xs-12 col-sm-5'>Official Paypal Images (use in templates or text)</label>\n\t\t\t<div class='col-xs-12 col-sm-6 vertical-form-fix'><a href='https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/general/AcceptanceMarkLogos-outside' target='_blank'>Click to view Images</a></div>\n\t\t</div>\n\";\n //TODO: hide these settings when main allow_sb setting is off\n $checked = $db->get_site_setting('pp_chain_enable') ? \"checked='checked'\" : '';\n $html .= '\n\t\t<div class=\"col_hdr\">Advanced Paypal Settings</div>\n\t\t<div class=\"form-group\">\n\t\t\t<label class=\"control-label col-xs-12 col-sm-5\">Enable Chain Payments</label>\n\t\t\t<div class=\"col-xs-12 col-sm-6\"><input type=\"checkbox\" name=\"pp_chain_enable\" value=\"1\" onclick=\"jQuery(\\'#chainSettings\\').toggle(this.checked);\" ' . $checked . ' /></div>\n\t\t</div>\n\t\t<div id=\"chainSettings\" ' . (!$checked ? 'style=\"display: none;\"' : '') . '>\n\t\t\t<div class=\"page_note\" style=\"text-align: center;\">This requires at least a Paypal Business account, and special configuration/approval from Paypal. Most sites will not need to use this.</div>\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label class=\"control-label col-xs-12 col-sm-5\">Partner Name<br><small>You will not have this until your account is fully approved by paypal but you can still test using the settings below</small></label>\n\t\t\t\t<div class=\"col-xs-12 col-sm-6\"><input type=\"text\" name=\"pp_chain_partner\" class=\"form-control col-md-7 col-xs-12\" value=\"' . $db->get_site_setting('pp_chain_partner') . '\" /></div>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label class=\"control-label col-xs-12 col-sm-5\">Developer Username</label>\n\t\t\t\t<div class=\"col-xs-12 col-sm-6\"><input type=\"text\" name=\"pp_chain_username\" class=\"form-control col-md-7 col-xs-12\" value=\"' . $db->get_site_setting('pp_chain_username') . '\" /></div>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label class=\"control-label col-xs-12 col-sm-5\">Developer Password</label>\n\t\t\t\t<div class=\"col-xs-12 col-sm-6\"><input type=\"text\" name=\"pp_chain_password\" class=\"form-control col-md-7 col-xs-12\" value=\"' . $db->get_site_setting('pp_chain_password') . '\" /></div>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label class=\"control-label col-xs-12 col-sm-5\">Developer Signature</label>\n\t\t\t\t<div class=\"col-xs-12 col-sm-6\"><input type=\"text\" name=\"pp_chain_signature\" class=\"form-control col-md-7 col-xs-12\" value=\"' . $db->get_site_setting('pp_chain_signature') . '\" /></div>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label class=\"control-label col-xs-12 col-sm-5\">Application ID</label>\n\t\t\t\t<div class=\"col-xs-12 col-sm-6\"><input type=\"text\" name=\"pp_chain_appid\" class=\"form-control col-md-7 col-xs-12\" value=\"' . $db->get_site_setting('pp_chain_appid') . '\" placeholder=\"leave blank for development\"/></div>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label class=\"control-label col-xs-12 col-sm-5\">User ID to receive payments (final fees) on behalf of site<br />(This user must have a Paypal account configured for use with seller-buyer)</label>\n\t\t\t\t<div class=\"col-xs-12 col-sm-6\"><input type=\"number\" name=\"pp_chain_site_recipient\" class=\"form-control col-md-7 col-xs-12\" value=\"' . $db->get_site_setting('pp_chain_site_recipient') . '\" /></div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t';\n //TODO: make pp_chain_site_recipient a auto-search field on usernames\n return $html;\n }",
"public function canDisplay()\n {\n if ($this->isRevolvingMethodAvailable() &&\n !$this->isProductAttributeSetProhibited() &&\n $this->marketingHelper->isPaymentMarketingEnabled()\n && $this->marketingHelper->canShowBlockInPDP()) {\n return true;\n }\n return false;\n }",
"function adminDisplayPricePlanSettings($vars){\n\t\tif (PHP5_DIR) $menu_loader = geoAdmin::getInstance();\n\t\telse $menu_loader =& geoAdmin::getInstance();\n\t\tif (!$this->_paypalAllowed()){\n\t\t\treturn ''; //main setting turned off, nothing to display...\n\t\t}\n\t\t$price_plan_id = $vars['price_plan_id'];\n\t\t$category = $vars['category'];\n\t\t\n\t\t$sb = geoSellerBuyer::getInstance();\n\t\t$allow_paypal_check = ($sb->getPlanSetting($price_plan_id, $category, 'paypal_allow_sb'))? 'checked=\"checked\" ': '';\n\t\t$html = \"\n\t<div class=\\\"col_hdr\\\"> {$this->paypal_logo}Paypal for Auction Winning Bidder to pay Seller</div>\n\t<div class=\\\"row_color1\\\">\n\t\t<div class=\\\"leftColumn\\\">Enable Paypal</div>\n\t\t<div class=\\\"rightColumn\\\">\n\t\t\t<input type=\\\"checkbox\\\" name=\\\"paypal_allow_sb\\\" value=\\\"1\\\" $allow_paypal_check/>\n\t\t</div>\n\t\t<div class=\\\"clearColumn\\\"></div>\n\t</div>\n\t\t\t\";\n\t\treturn $html;\n\t}",
"public function adminPlanItemConfigUpdate($planItem)\n {\n $settings = $_POST['auction'];\n\n if (is_array($settings) && isset($settings['form_submitted'])) {\n $allow_buy_now = (int)$settings['allow_buy_now'];\n $allow_buy_now_only = ($allow_buy_now) ? $settings['allow_buy_now_only'] : 0; // if allow_buy_now not on, force to be false\n $planItem->set('allow_buy_now', $allow_buy_now);\n $planItem->set('allow_buy_now_only', $allow_buy_now_only);\n\n $buy_now_only_none_left = (isset($settings['buy_now_only_none_left']) && in_array($settings['buy_now_only_none_left'], array('close','sold'))) ? $settings['buy_now_only_none_left'] : 'close';\n $planItem->set('buy_now_only_none_left', $buy_now_only_none_left);\n\n //reverse: note that can set to \"false\" since we do not default to be turned on\n $allow_reverse = (isset($settings['allow_reverse']) && $settings['allow_reverse']) ? 1 : false;\n $allow_reverse_buy_now = ($allow_reverse && isset($settings['allow_reverse_buy_now']) && $settings['allow_reverse_buy_now']) ? 1 : false;\n $charge_reverse_final_fees = ($allow_reverse && isset($settings['charge_reverse_final_fees']) && $settings['charge_reverse_final_fees']) ? 1 : false;\n\n $planItem->set('allow_reverse', $allow_reverse);\n $planItem->set('allow_reverse_buy_now', $allow_reverse_buy_now);\n $planItem->set('charge_reverse_final_fees', $charge_reverse_final_fees);\n\n $planItem->set('force_single_quantity', (int)$settings['force_single_quantity']);\n }\n\n return true;\n }",
"public function adminPlanItemConfigUpdate($planItem)\n {\n $settings = (isset($_GET['storefront_subscription'])) ? $_GET['storefront_subscription'] : $_POST['storefront_subscription'];\n $enabled = (isset($settings['enabled']) && $settings['enabled']) ? 1 : false;\n\n if (is_array($settings)) {\n $attached_periods = array();\n if ($enabled) {\n //also save period attachments..\n\n if ($settings['free_storefronts']) {\n $planItem->set('periods', false); //setting free-for-all; turn off all periods\n $planItem->set('free_storefronts', $settings['free_storefronts']);\n } else {\n if (is_array($settings['storefront_periods'])) {\n $periods = $settings['storefront_periods'];\n foreach ($periods as $key => $value) {\n if ($value) {\n $attached_periods [$key] = $key;\n }\n }\n }\n if (count($attached_periods) > 0) {\n $planItem->set('periods', $attached_periods);\n $planItem->set('free_storefronts', false); //setting one or more periods; turn off free-for-all\n } else {\n //don't save anything, they don't have valid settings set.\n echo 'You must enable at least one storefront period.<hr />';\n return false;\n }\n }\n } else {\n //not enabled...make sure free storefronts isn't left on...\n $planItem->set('free_storefronts', false);\n }\n }\n $planItem->setEnabled($enabled);\n return true;\n }",
"public static function showSettingsForm()\n {\n return true;\n }",
"public function isDisplayQty()\n {\n return Mage::getStoreConfig(self::XML_PATH_WISHLIST_LINK_USE_QTY);\n }",
"public function canShow()\n {\n return Mage::helper('shipnote')->isEnabled() || $this->getRateCount() < 1;\n }",
"public function is_visible() {\n\t\t\t$show = true;\n\n\t\t\treturn apply_filters( 'learn-press/course-item-visible', $show, $this->get_item_type(), $this->get_id() );\n\t\t}",
"public function getVisible()\n {\n return !$this->item->isHidden;\n }",
"public function canShow()\n {\n if ( ! $this->hasProduct() ) {\n return false;\n }\n \n return true;\n }",
"public function getShowTrierOption()\n {\n return (bool) (!Mage::getStoreConfig('qquoteadv/layout/layout_disable_trier_option', $this->getStoreId()));\n }",
"public function showsItemExtra() : bool\n {\n return $this->showItemExtra;\n }",
"private function isPluginSettingsPage() {\n $uri = Uri::getInstance();\n $layout = $uri->getVar('layout');\n $ext_id = $uri->getVar('extension_id');\n if ( isset($layout, $ext_id) && $layout === 'edit' && $ext_id == $this->_id ) {\n return true;\n }\n return false;\n }",
"public function canSeePaymentInfo(){\r\n \treturn Mage::getStoreConfig('vendors/sales/view_payment_info');\r\n }",
"protected function _canBeShown()\n {\n if (!Mage::helper('factfinder_campaigns')->getIsResultListingPage()) {\n return false;\n }\n\n return (bool) Mage::helper('factfinder')->isEnabled('campaigns');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return value: > "null" = $IPAddr does not exist > WP_Watchdog_AntiFloodObject = obj. containing all the details for the IP | public function findOne( $IPAddr ) {
global $wpdb;
$entry = $wpdb->get_results("SELECT * FROM $this->entryTableName WHERE ip='$IPAddr'", ARRAY_A );
if ( !$entry ) {
return null;
}
return WP_Watchdog_AntiFloodObject::fromDbObject( $entry[0] );
} | [
"private function getFloodIdentifier() {\n // Register flood events based on the IP only.\n return $this->request->getClientIP();\n }",
"public function getLogIPAddress(){\n\t\t$result = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getIndpEnv('REMOTE_ADDR');\n\t\tif ($this->pObj->config['config']['stat_IP_anonymize']) {\n\t\t\tif (strpos($result, ':')) {\n\t\t\t\t$result = $this->stripIPv6($result);\n\t\t\t} else {\n\t\t\t\t$result = $this->stripIPv4($result);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"protected static function getUserIP()\r\n {\r\n /*\r\n if($_SERVER[\"HTTP_X_FORWARDED_FOR\"] != \"\"){\r\n $IP = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\r\n $proxy = $_SERVER[\"REMOTE_ADDR\"];\r\n $host = @gethostbyaddr($_SERVER[\"HTTP_X_FORWARDED_FOR\"]);\r\n }else{\r\n $IP = $_SERVER[\"REMOTE_ADDR\"];\r\n $proxy = \"No proxy detected\";\r\n $host = @gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]);\r\n }\r\n * Work in progress\r\n */\r\n $IP = $_SERVER[\"REMOTE_ADDR\"];\r\n $proxy = \"No proxy detected\";\r\n $host = @gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]);\r\n $data = new ArrayObject();\r\n $data['User_IP'] = $IP;\r\n $data['Proxy'] = $proxy;\r\n $data['Host'] = $host;\r\n return $data;\r\n }",
"function checkIP() {\n /* Check if IP exists in cache */\n $banDuration=$this->configuration['CakephpIDS']['ban_duration'];\n Cache::set(array('duration'=>\"+$banDuration days\"));\n $ipBanned=Cache::read('banned_ip_'.$this->getIP());\n\n /* This IP is banned! Exiting! */\n if($ipBanned==1 && $this->configuration['CakephpIDS']['production_mode'])\n exit();\n }",
"protected function get_ip_data()\n\t{\n\t\t$fields = array (\n\t\t\t'HTTP_X_FORWARDED_FOR',\n\t\t\t'REMOTE_ADDR',\n\t\t\t'HTTP_CLIENT_IP'\n\t\t);\n\t\t$fields = apply_filters( 't5_404_ip_fields', $fields );\n\t\t$url = apply_filters(\n\t\t\t't5_404_ip_check_url',\n\t\t\t'http://ip.toscho.de/?ip=%s'\n\t\t);\n\n\t\t$out = array ();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\tisset ( $_SERVER[ $field ] )\n\t\t\t\tand $out[ $field ] = sprintf( $url, $_SERVER[ $field ] );\n\t\t}\n\n\t\treturn $out;\n\t}",
"function sucuri_cloudproxy_api_blacklist_ip($ip) {\n try {\n $params = array('a' => 'blacklist_ip', 'ip' => $ip);\n return _sucuri_cloudproxy_call_api($params);\n }\n catch (Exception $ex) {\n drupal_set_message($ex->getMessage(), 'error');\n }\n return false;\n}",
"public static function visitorIpAddress () {\n $ipAddress = NULL;\n\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) == TRUE && trim($_SERVER['HTTP_X_FORWARDED_FOR']) != '' && $_SERVER['HTTP_X_FORWARDED_FOR'] != 'unknown') {\n $ipAddress = Request::validateIpAddress($_SERVER['HTTP_X_FORWARDED_FOR']);\n }\n\n if ($ipAddress == NULL && isset($_SERVER['HTTP_CLIENT_IP']) == TRUE && trim($_SERVER['HTTP_CLIENT_IP']) != '' && $_SERVER['HTTP_CLIENT_IP'] != 'unknown') {\n $ipAddress = Request::validateIpAddress($_SERVER['HTTP_CLIENT_IP']);\n }\n\n if ($ipAddress == NULL && isset($_SERVER['REMOTE_ADDR']) == TRUE && trim($_SERVER['REMOTE_ADDR']) != '' && $_SERVER['REMOTE_ADDR'] != 'unknown') {\n $ipAddress = Request::validateIpAddress($_SERVER['REMOTE_ADDR']);\n }\n\n // add checks for the following:\n //HTTP_PRAGMA, HTTP_XONNECTION, HTTP_CACHE_INFO, HTTP_XPROXY, HTTP_PROXY, HTTP_PROXY_CONNECTION, HTTP_VIA, HTTP_X_COMING_FROM, HTTP_X_FORWARDED, HTTP_COMING_FROM, HTTP_FORWARDED_FOR, HTTP_FORWARDED, ZHTTP_CACHE_CONTROL\n\n if ($ipAddress == NULL) {\n $ipAddress = '0.0.0.0';\n }\n\n return $ipAddress;\n }",
"function wp_check_comment_flood($is_flood, $ip, $email, $date, $avoid_die = \\false)\n {\n }",
"public function getReflexiveIPAddress()\n {\n if (array_key_exists(\"reflexiveIPAddress\", $this->_propDict)) {\n return $this->_propDict[\"reflexiveIPAddress\"];\n } else {\n return null;\n }\n }",
"public function blacklist($ip)\r\n {\r\n $data = $this->ip($ip, 'ban');\r\n return $data;\r\n }",
"public function testValidIpRejectedDueToWhitelist()\n {\n $_SERVER = array(\n 'REMOTE_ADDR' => '24.24.24.24',\n 'HTTP_X_FORWARDED_FOR' => '32.32.32.32'\n );\n $lookup = new Whip(\n $_SERVER,\n Whip::PROXY_HEADERS,\n array(\n Whip::PROXY_HEADERS => array(\n Whip::IPV4 => array(\n '127.0.0.1/24'\n ),\n Whip::IPV6 => array(\n '::1'\n )\n )\n )\n );\n $this->assertTrue(false === $lookup->getIpAddress());\n }",
"public function self_ip() {\r\n $cloudflareIPRanges = array(\r\n '2400:cb00::/32',\r\n '2606:4700::/32',\r\n '2803:f800::/32',\r\n '2405:b500::/32',\r\n '2405:8100::/32',\r\n '2a06:98c0::/29',\r\n '2c0f:f248::/32',\r\n '204.93.240.0/24',\r\n '204.93.177.0/24',\r\n '199.27.128.0/21',\r\n '173.245.48.0/20',\r\n '103.21.244.0/22',\r\n '103.22.200.0/22',\r\n '103.31.4.0/22',\r\n '141.101.64.0/18',\r\n '108.162.192.0/18',\r\n '190.93.240.0/20',\r\n '188.114.96.0/20',\r\n '197.234.240.0/22',\r\n '198.41.128.0/17',\r\n '162.158.0.0/15'\r\n );\r\n //Ensure we have a IP not an malicious content\r\n if(isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) && filter_var($_SERVER[\"HTTP_CF_CONNECTING_IP\"], FILTER_VALIDATE_IP)) {\r\n $validCFRequest = false;\r\n foreach($cloudflareIPRanges as $range){\r\n if($this->ip_in_range($_SERVER['REMOTE_ADDR'], $range)) {\r\n $validCFRequest = true;\r\n break;\r\n }\r\n }\r\n if($validCFRequest)\r\n return $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n else\r\n return $_SERVER['REMOTE_ADDR'];\r\n }\r\n else\r\n return $_SERVER['REMOTE_ADDR'];\r\n }",
"private function IPuser() {\n\t$returnar =\"\";\nif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n $returnar=$_SERVER['HTTP_X_FORWARDED_FOR'];}\nif (!empty($_SERVER['HTTP_CLIENT_IP'])){\n $returnar=$_SERVER['HTTP_CLIENT_IP'];}\nif(!empty($_SERVER['REMOTE_ADDR'])){\n\t $returnar=$_SERVER['REMOTE_ADDR'];}\nreturn $returnar;\n}",
"public function testIPv4AddressRejectedDueToEmptyWhitelist()\n {\n $_SERVER = array(\n 'REMOTE_ADDR' => '127.0.0.1',\n 'HTTP_X_FORWARDED_FOR' => '24.24.24.24'\n );\n $lookup = new Whip(\n $_SERVER,\n Whip::PROXY_HEADERS,\n array(\n Whip::PROXY_HEADERS => array(\n Whip::IPV6 => array(\n '::1/32'\n )\n )\n )\n );\n $this->assertTrue(false === $lookup->getIpAddress());\n }",
"private function get_host_ip_info()\n {\n $this->host_ip_info = $this->get_ip_info($this->wireguard_interface['Address']);\n }",
"public function getIP()\n {\n return isset($this->IP) ? $this->IP : null;\n }",
"function checkIp()\n\t{\t\t\t\t\t\n\t\t//get entries which matches ip and agent\t\t\n\t\t$result = $this->spambotInDb();\n\t\t\n\t\t//do we have the entry in our database?\n\t\tif ($result->id == 0){\n\t\t\treturn false;\n\t\t}\n\t\t//we have the entry but do we still block it?\n\t\telse if ($result->until < time()){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\t\t\n\t}",
"public function getIPDbBlockedByPost()\n {\n global $wpdb;\n $sql = $wpdb->prepare(\"SELECT `IP` FROM wp_yaurau_ip_blocked WHERE id = %s\", $this->id);\n return $wpdb->get_results($sql, OBJECT);\n }",
"private static function get_remote_address() {\n\t\tif ( defined( 'WP_FAIL2BAN_PROXIES' ) ) {\n\t\t\tif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $_SERVER ) ) {\n\t\t\t\t$ip = ip2long( $_SERVER['REMOTE_ADDR'] );\n\t\t\t\tforeach ( explode( ',', WP_FAIL2BAN_PROXIES ) as $proxy ) {\n\t\t\t\t\t$cidr = explode( '/', $proxy );\n\t\t\t\t\tif ( count( $cidr ) === 2 ) {\n\t\t\t\t\t\t$net = ip2long( $cidr[0] );\n\t\t\t\t\t\t$mask = ~ ( pow( 2, ( 32 - $cidr[1] ) ) - 1 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$net = ip2long( $proxy );\n\t\t\t\t\t\t$mask = -1;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( $ip & $mask ) === $net ) {\n\t\t\t\t\t\t$len = strpos( $_SERVER['HTTP_X_FORWARDED_FOR'], ',' );\n\t\t\t\t\t\tif ( false === $len ) {\n\t\t\t\t\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn substr( $_SERVER['HTTP_X_FORWARDED_FOR'], 0, $len );\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}\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks whether the span contains the given date | public function containsDate(int|string|DateTime|Date $date): bool
{
$date = Date::castFrom($date);
if (!$this->start->isBefore($date) && !$this->start->equals($date)) {
return false;
}
if (!$this->end->isAfter($date) && !$this->end->equals($date)) {
return false;
}
return true;
} | [
"public function containsCalculatesCorrectResult()\n {\n $dateSpanDay = new stubDateSpanDay('2007-04-04');\n $this->assertFalse($dateSpanDay->contains(new stubDate('2007-04-03')));\n $this->assertTrue($dateSpanDay->contains(new stubDate('2007-04-04')));\n $this->assertFalse($dateSpanDay->contains(new stubDate('2007-04-05')));\n }",
"public function contains( $date ){\n\n $dateTime = DateTime::create( $date );\n return $dateTime >= $this->start && $dateTime <= $this->end;\n }",
"public function dateMatchesWith($date): bool;",
"public function contains(Date $date) : bool\n {\n return $this->start->comesBeforeOrEqual($date) && $this->end->comesAfterOrEqual($date);\n }",
"function ercore_reporting_date_callback(&$within_date, array &$dates) {\n\n if ($within_date == NULL) {\n return FALSE;\n }\n else {\n $within_date = str_replace(\"T\", \" \", $within_date);\n $within_date = strtotime($within_date);\n return (($dates[0]) <= $within_date && ($dates[1]) >= $within_date);\n }\n}",
"function test_valid_date() {\n\n return (!empty($this->fields[\"begin\"])\n && !empty($this->fields[\"end\"])\n && (strtotime($this->fields[\"begin\"]) < strtotime($this->fields[\"end\"])));\n }",
"public function hasDate() : bool;",
"public function containsCalculatesCorrectResult()\n {\n $dateSpanMonth = new stubDateSpanMonth(2007, 4);\n $this->assertFalse($dateSpanMonth->contains(new stubDate('2007-03-31')));\n $this->assertTrue($dateSpanMonth->contains(new stubDate('2007-04-01')));\n $this->assertTrue($dateSpanMonth->contains(new stubDate('2007-04-02')));\n $this->assertTrue($dateSpanMonth->contains(new stubDate('2007-04-15')));\n $this->assertTrue($dateSpanMonth->contains(new stubDate('2007-04-29')));\n $this->assertTrue($dateSpanMonth->contains(new stubDate('2007-04-30')));\n $this->assertFalse($dateSpanMonth->contains(new stubDate('2007-05-01')));\n }",
"private function compare_with_date()\n {\n }",
"public function action_check_date()\n\t{\n\t\t$post = $this->request->post();\n\n\t\tif (array_key_exists('start', $post))\n\t\t{\n\t\t\tif (strtotime($post['start']) <= strtotime($post['end']))\n\t\t\t\techo TRUE;\n\t\t\telse\n\t\t\t\techo 'Dates are invalid.';\n\t\t}\n\t}",
"public function contains(Date $date)\n {\n $startIsOpen = !$this->hasStart();\n $containsStart = $startIsOpen || $this->start <= $date;\n\n $endIsOpen = !$this->hasEnd();\n $containsEnd = $endIsOpen || $this->end >= $date;\n\n return $containsStart && $containsEnd;\n }",
"function IsInside( $date )\n {\n if( $this->periods == null )\n {\n if( $this->days[date_get_day( $date )] > 0 )\n return true;\n\n return false;\n }\n\n foreach( $this->periods as $period )\n {\n if( $period[0] > $date )\n return false;\n if( ($period[0] <= $date) && ($period[1] >= $date) )\n return true;\n }\n\n return false;\n }",
"function date_between($dt){\n\tif($dt >= mktime(0, 0, 0, 12, 28, 2016) && $dt <=mktime(0, 0, 0, 1, 9, 2017)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function checkAvailability($date) {\n $dateTime = DateTime::createFromFormat('d/m/Y', $date)->getTimestamp();\n $startDateTime = $this->startDate->getTimestamp();\n $endDateTime = $this->endDate->getTimestamp();\n return ($dateTime >= $startDateTime && $dateTime <= $endDateTime);\n }",
"public function test_has(){\n\t\t$yts = $this->make_yearly_timespan();\n\t\t$this->assertEquals( false, $yts->has('date', new DateTime() ) );\n\t\t$this->assertEquals( false, $yts->has('date', DateTime::createFromFormat( 'd.m', '02.02' ) ) );\n\t\t$this->assertEquals( true, $yts->has('date', DateTime::createFromFormat( 'd.m', '01.01' ) ) );\n\t\t$this->assertEquals( true, $yts->has('name', 'Wintersemester' ) );\n\t\t$this->assertEquals( true, $yts->has('type', 'Offset-Semester' ) );\n\t\t$this->assertEquals( true, $yts->has('date', 'any' ) );\n\t\t$this->assertEquals( true, $yts->has('type', 'any' ) );\n\t\t$this->assertEquals( false, $yts->has('name', 'foo' ) );\n\t}",
"public function searchByDate()\n {\n return (!$this->getSearchParam('everything')\n && $this->getSearchParam('year') \n && $this->getSearchParam('month')\n );\n \n }",
"private function digestSpansMultipleDays(): bool\n {\n $digest = $this->getDigest();\n if (!$digest) {\n return false;\n }\n\n $startedAt = $digest->getStartedAtDateTime();\n $finishedAt = $digest->getFinishedAtDateTime();\n\n $startedAt = $this->timezone->date($startedAt);\n $compareTo = $this->timezone->date($finishedAt);\n\n return $startedAt->format('Y-m-d') !== $compareTo->format('Y-m-d');\n }",
"public function hasDate(string $date)\n {\n return $this->where('report_created', $date)->exists();\n }",
"function overlapping_dates($start_date, $end_date, $test_date){\r\n\t\tif($test_date >= $start_date && $test_date <= $end_date)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation taskWorkOperationsSetProfessionalRoleByTaskIds This call sets the professional roles users for multiple TaskWork Ids | public function taskWorkOperationsSetProfessionalRoleByTaskIds($professional_role_id, $user_to_assign_id, $task_work_ids)
{
$this->taskWorkOperationsSetProfessionalRoleByTaskIdsWithHttpInfo($professional_role_id, $user_to_assign_id, $task_work_ids);
} | [
"public function testTaskWorkOperationsSetProfessionalRoleByTaskIds()\n {\n }",
"protected function taskWorkOperationsGetProfessionalRoleByTaskIdsRequest($task_work_ids)\n {\n // verify the required parameter 'task_work_ids' is set\n if ($task_work_ids === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_work_ids when calling taskWorkOperationsGetProfessionalRoleByTaskIds'\n );\n }\n\n $resourcePath = '/api/TaskOperations/professionalroleoperation';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($task_work_ids)) {\n $_tempBody = $task_work_ids;\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 // 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 taskWorkOperationsSetProfessionalRoleByTaskIdsAsync($professional_role_id, $user_to_assign_id, $task_work_ids)\n {\n return $this->taskWorkOperationsSetProfessionalRoleByTaskIdsAsyncWithHttpInfo($professional_role_id, $user_to_assign_id, $task_work_ids)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function taskWorkOperationsSetUsersForProfessionalRoleSelectionRequest($task_work_id, $professional_role_id, $user_id)\n {\n // verify the required parameter 'task_work_id' is set\n if ($task_work_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_work_id when calling taskWorkOperationsSetUsersForProfessionalRoleSelection'\n );\n }\n // verify the required parameter 'professional_role_id' is set\n if ($professional_role_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $professional_role_id when calling taskWorkOperationsSetUsersForProfessionalRoleSelection'\n );\n }\n // verify the required parameter 'user_id' is set\n if ($user_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $user_id when calling taskWorkOperationsSetUsersForProfessionalRoleSelection'\n );\n }\n\n $resourcePath = '/api/TaskOperations/professionalroleoperation/{professionalRoleId}/setuserbytaskwork/{taskWorkId}/{userId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($task_work_id !== null) {\n $resourcePath = str_replace(\n '{' . 'taskWorkId' . '}',\n ObjectSerializer::toPathValue($task_work_id),\n $resourcePath\n );\n }\n // path params\n if ($professional_role_id !== null) {\n $resourcePath = str_replace(\n '{' . 'professionalRoleId' . '}',\n ObjectSerializer::toPathValue($professional_role_id),\n $resourcePath\n );\n }\n // path params\n if ($user_id !== null) {\n $resourcePath = str_replace(\n '{' . 'userId' . '}',\n ObjectSerializer::toPathValue($user_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 // \\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 // 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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function taskWorkOperationsSetProfessionalRoleByTaskIdsWithHttpInfo($professional_role_id, $user_to_assign_id, $task_work_ids)\n {\n $returnType = '';\n $request = $this->taskWorkOperationsSetProfessionalRoleByTaskIdsRequest($professional_role_id, $user_to_assign_id, $task_work_ids);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function testTaskWorkOperationsGetProfessionalRoleByTaskIds()\n {\n }",
"public function testTaskWorkOperationsSetUsersForProfessionalRoleSelection()\n {\n }",
"public function taskWorkOperationsSetProfessionalRoleByTaskIdsAsyncWithHttpInfo($professional_role_id, $user_to_assign_id, $task_work_ids)\n {\n $returnType = '';\n $request = $this->taskWorkOperationsSetProfessionalRoleByTaskIdsRequest($professional_role_id, $user_to_assign_id, $task_work_ids);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 taskWorkOperationsGetUsersForProfessionalRoleSelection($task_work_id, $professional_role_id)\n {\n list($response) = $this->taskWorkOperationsGetUsersForProfessionalRoleSelectionWithHttpInfo($task_work_id, $professional_role_id);\n return $response;\n }",
"public static function _bulkUserRoleEdit() {\n\t\tif ( ! empty( $_GET[ stripslashes( __CLASS__ ) . '-nonce' ] ) && wp_verify_nonce(\n\t\t\t\tfilter_input( INPUT_GET, stripslashes( __CLASS__ ) . '-nonce', FILTER_SANITIZE_STRING ),\n\t\t\t\t__FILE__ . get_current_user_id() . __CLASS__\n\t\t\t)\n\t\t) {\n\t\t\t$addRole = filter_input( INPUT_GET, stripslashes( __CLASS__ ) . '-add-role', FILTER_SANITIZE_STRING );\n\t\t\t$removeRole = filter_input( INPUT_GET, stripslashes( __CLASS__ ) . '-remove-role', FILTER_SANITIZE_STRING );\n\t\t\t$userIds = array_map( 'absint', (array) filter_input( INPUT_GET, 'users', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ) );\n\n\t\t\tif ( ! empty( $userIds ) && ( ! empty( $addRole ) || ! empty( $removeRole ) ) ) {\n\t\t\t\t// Loop through all selected users and verify current user can edit them.\n\t\t\t\tforeach ( $userIds as $userId ) {\n\t\t\t\t\t// Verify user has permission to promote the user\n\t\t\t\t\tif ( ! current_user_can( 'promote_user', $userId ) ) {\n\t\t\t\t\t\twp_die( sprintf(\n\t\t\t\t\t\t/* Translator note: %d is the user ID that cannot be edited. */\n\t\t\t\t\t\t\tesc_html__( 'You can\\'t edit user with ID %d', 'dfwood-wp-multiple-roles' ),\n\t\t\t\t\t\t\t$userId\n\t\t\t\t\t\t) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the user doesn't already belong to the blog, bail.\n\t\t\t\t\tif ( is_multisite() && ! is_user_member_of_blog( $userId ) ) {\n\t\t\t\t\t\twp_die(\n\t\t\t\t\t\t\t'<h1>' . esc_html__( 'Cheatin’ uh?', 'dfwood-wp-multiple-roles' ) . '</h1>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'One of the selected users is not a member of this site.', 'dfwood-wp-multiple-roles' ) . '</p>',\n\t\t\t\t\t\t\t403\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Verify the user isn't trying to promote themselves, prevents accidental loss of privileges.\n\t\t\t\t\tif ( get_current_user_id() === $userId ) {\n\t\t\t\t\t\twp_die( esc_html__( 'You are not allowed to edit your own user role(s)!', 'dfwood-wp-multiple-roles' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we make it here, then there are no known issues adding/removing requested roles.\n\t\t\t\t// We are doing a second loop to avoid updating any users if we can't update all of them.\n\t\t\t\tforeach ( $userIds as $userId ) {\n\t\t\t\t\t$user = get_userdata( $userId );\n\n\t\t\t\t\tif ( ! empty( $addRole ) ) {\n\t\t\t\t\t\t$user->add_role( $addRole );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $removeRole ) ) {\n\t\t\t\t\t\t$user->remove_role( $removeRole );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Go back to the users page, ensure our GET args are cleared out and show confirmation message.\n\t\t\t\twp_safe_redirect( add_query_arg( 'update', 'promote', admin_url( 'users.php' ) ) );\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}",
"function setAssignorInRecipients($task)\n {\n $recipTable = mapi_message_getrecipienttable($task);\n\n // Delete all MAPI_TO recipients\n $recips = mapi_table_queryallrows($recipTable, array(PR_ROWID), array(RES_PROPERTY,\n array( RELOP => RELOP_EQ,\n ULPROPTAG => PR_RECIPIENT_TYPE,\n VALUE => MAPI_TO\n )));\n foreach($recips as $recip) {\n mapi_message_modifyrecipients($task, MODRECIP_REMOVE, array($recip));\n }\n\n $recips = array();\n $taskReqProps = mapi_getprops($this->message, array(PR_SENT_REPRESENTING_NAME, PR_SENT_REPRESENTING_EMAIL_ADDRESS, PR_SENT_REPRESENTING_ENTRYID, PR_SENT_REPRESENTING_ADDRTYPE));\n $associatedTaskProps = mapi_getprops($task, array($this->props['taskupdates'], $this->props['tasksoc'], $this->props['taskmultrecips']));\n\n // Build assignor info\n $assignor = array( PR_ENTRYID => $taskReqProps[PR_SENT_REPRESENTING_ENTRYID],\n PR_DISPLAY_NAME => $taskReqProps[PR_SENT_REPRESENTING_NAME],\n PR_EMAIL_ADDRESS => $taskReqProps[PR_SENT_REPRESENTING_EMAIL_ADDRESS],\n PR_RECIPIENT_DISPLAY_NAME => $taskReqProps[PR_SENT_REPRESENTING_NAME],\n PR_ADDRTYPE => empty($taskReqProps[PR_SENT_REPRESENTING_ADDRTYPE]) ? 'SMTP' : $taskReqProps[PR_SENT_REPRESENTING_ADDRTYPE],\n PR_RECIPIENT_FLAGS => recipSendable\n );\n\n // Assignor has requested task updates, so set him/her as MAPI_CC in recipienttable.\n if ((isset($associatedTaskProps[$this->props['taskupdates']]) && $associatedTaskProps[$this->props['taskupdates']])\n && !(isset($associatedTaskProps[$this->props['taskmultrecips']]) && $associatedTaskProps[$this->props['taskmultrecips']] == tmrReceived)) {\n $assignor[PR_RECIPIENT_TYPE] = MAPI_CC;\n $recips[] = $assignor;\n }\n\n // Assignor wants to receive an email report when task is mark as 'Complete', so in recipients as MAPI_BCC\n if ($associatedTaskProps[$this->props['tasksoc']]) {\n $assignor[PR_RECIPIENT_TYPE] = MAPI_BCC;\n $recips[] = $assignor;\n }\n\n if (!empty($recips)) {\n mapi_message_modifyrecipients($task, MODRECIP_ADD, $recips);\n }\n }",
"public function taskWorkOperationsGetProfessionalRoleByTaskIdsAsyncWithHttpInfo($task_work_ids)\n {\n $returnType = '\\Swagger\\Client\\Model\\ProfessionalRoleOperationDTO[]';\n $request = $this->taskWorkOperationsGetProfessionalRoleByTaskIdsRequest($task_work_ids);\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 setTeamRoles(array $team_roles): self;",
"public function taskWorkOperationsSetUsersForProfessionalRoleSelectionAsyncWithHttpInfo($task_work_id, $professional_role_id, $user_id)\n {\n $returnType = '';\n $request = $this->taskWorkOperationsSetUsersForProfessionalRoleSelectionRequest($task_work_id, $professional_role_id, $user_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 setSubordinates($array_of_ids)\n {\n\n $table = (new Employee())->table;\n DB::table($table)\n ->where('belongs_to_manager', $this->id)\n ->update(['belongs_to_manager' => null]);\n DB::table($table)\n ->whereIn('id', $array_of_ids)\n ->update(['belongs_to_manager' => $this->id]);\n }",
"public function setRoleAssignmentIds(?array $value): void {\n $this->getBackingStore()->set('roleAssignmentIds', $value);\n }",
"public function actionAssignBulkUser()\n {\n \t$data = Yii::$app->request->post('servicetasks'); // servicetasks[33][tasklist]\n \t$data1 = Yii::$app->request->post('Servicetask');\n \t$displayResult = Yii::$app->request->post('displayResult');\n \t$caseId = Yii::$app->request->post('caseId');\n \t$dropdownVal = Yii::$app->request->post('dropdownVal');\n \t\n \t$role_id = Yii::$app->user->identity->role_id;\n \t$role_name = Role::findOne($role_id);\n \tif(!empty($data)){\n \t\tforeach ($data as $key => $value){\n\t\t\t $data[$key] = array_merge((array)$data1['servicetasks'][$key], (array)$value);\n\t\t\t}\n\t\t\tforeach($data as $servicetask_id => $value){\n\t\t\t\t$servicetask_data = Servicetask::findOne($servicetask_id);\n \t\t\t$task_ids = explode(\",\",$value['tasklist']);\n \t\t\tif ($value['assigntouser'] > 0) {\n \t\t\t\t$sql = \"SELECT tu.*,t.client_case_id from tbl_tasks_units as tu \n \t\t\t\t\t\tINNER JOIN tbl_tasks as t ON t.id = tu.task_id\n\t\t\t\t\t\t\tINNER JOIN tbl_task_instruct_servicetask as ts ON ts.id=tu.task_instruct_servicetask_id\n\t\t\t\t\t\t\tWHERE tu.task_id IN(\".$value['tasklist'].\") AND ts.servicetask_id =\".$servicetask_id;\n\t\t\t\t\t$taskunits = \\Yii::$app->db->createCommand($sql)->queryAll();\n\t\t\t\t\t$userId = $value['assigntouser']; // Assign userId\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($taskunits)){\n \t\t\t\t\tforeach($taskunits as $taskuni){\n \t\t\t\t\t\tYii::$app->db->createCommand(\"UPDATE tbl_tasks_units SET tbl_tasks_units.unit_assigned_to=\".$userId.\", tbl_tasks_units.modified = '\".date('Y-m-d H:i:s').\"' WHERE tbl_tasks_units.id=\".$taskuni['id'])->execute();\n \t\t\t\t\t\t\n \t\t\t\t\t\t$taskAssigned = new TasksUnitsTransactionLog;\n \t\t\t\t\t\t//$taskAssigned->task_id = $taskuni['task_id'];\n \t\t\t\t\t\t$taskAssigned->tasks_unit_id = $taskuni['id'];\n \t\t\t\t\t\t$taskAssigned->user_assigned = $userId;\n \t\t\t\t\t\t$taskAssigned->transaction_type = 5; \n \t\t\t\t\t\t$taskAssigned->current_time = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$taskAssigned->current_time = time();\n \t\t\t\t\t\t$taskAssigned->duration = \"0 days 0 hours 0 min\";\n \t\t\t\t\t\t$taskAssigned->transaction_by = $userId;\n \t\t\t\t\t\t$taskAssigned->transaction_date = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$taskAssigned->created_by = $userId;\n \t\t\t\t\t\t$taskAssigned->created = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$taskAssigned->modified_by = $userId;\n \t\t\t\t\t\t$taskAssigned->modified = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$taskAssigned->save();\n \t\t\t\t\t\t/*(new SettingsEmail)->sendEmail(12, 'is_sub_self_assign',\n\t \t\t\t\t\t\t$data=array(\n\t \t\t\t\t\t\t\t'case_id'=>$caseId,\n\t \t\t\t\t\t\t\t'project_id'=>$taskuni['task_id'],\n\t \t\t\t\t\t\t\t'task_unit_id'=>$taskuni['id']\n\t \t\t\t\t\t\t)\n\t \t\t\t\t\t);*/\n \t\t\t\t\t\t$activityLog = new ActivityLog();\n \t\t\t\t\t\t$activityLog->generateLog('Project','AssignedTask', $taskuni['id'], $taskuni['task_id'].\"|project#:\".$taskuni['task_id'].\"|unit#:\".$taskuni['id']);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t$query = \"SELECT ttu.*,t.client_case_id FROM tbl_tasks_units_todos as ttu\n \t\t\t\t\t\tINNER JOIN tbl_tasks_units AS tu ON ttu.tasks_unit_id=tu.id\n \t\t\t\t\t\tINNER JOIN tbl_tasks as t ON t.id = tu.task_id\n\t\t\t\t\t\t\tINNER JOIN tbl_task_instruct_servicetask AS ts ON ts.id=tu.task_instruct_servicetask_id\n\t\t\t\t\t\t\tWHERE tu.task_id IN(\".$value['tasklist'].\") AND ts.servicetask_id=\".$servicetask_id;\n \t\t\t\t$taskunitstodos = \\Yii::$app->db->createCommand($query)->queryAll();\n \t\t\t\t\n \t\t\t\tif(!empty($taskunitstodos)){\n \t\t\t\t\tforeach($taskunitstodos as $taskuni){\n \t\t\t\t\t\tYii::$app->db->createCommand(\"UPDATE tbl_tasks_units_todos SET tbl_tasks_units.assigned=\".$userId.\", tbl_tasks_units.modified='\".date('Y-m-d H:i:s').\"' WHERE tbl_tasks_units.id=\".$taskuni['id'])->execute();\n \t\t\t\t\t\t\n \t\t\t\t\t\t$TasksUnitsTodo = new TasksUnitsTodoTransactionLog;\n \t\t\t\t\t\t$TasksUnitsTodo->task_id = $taskuni['task_id'];\n \t\t\t\t\t\t$TasksUnitsTodo->tasks_unit_id = $taskuni['tasks_unit_id'];\n \t\t\t\t\t\t$TasksUnitsTodo->user_assigned = $userId;\n \t\t\t\t\t\t$TasksUnitsTodo->todo_id = $taskuni['id'];\n \t\t\t\t\t\t$TasksUnitsTodo->transaction_type = 5; \n \t\t\t\t\t\t$TasksUnitsTodo->current_time = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$TasksUnitsTodo->current_time = time();\n \t\t\t\t\t\t$TasksUnitsTodo->duration = \"0 days 0 hours 0 min\";\n \t\t\t\t\t\t$TasksUnitsTodo->transaction_by = $userId;\n \t\t\t\t\t\t$TasksUnitsTodo->transaction_date = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$TasksUnitsTodo->created_by = $userId;\n \t\t\t\t\t\t$TasksUnitsTodo->created = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$TasksUnitsTodo->modified_by = $userId;\n \t\t\t\t\t\t$TasksUnitsTodo->modified = date('Y-m-d H:i:s A');\n \t\t\t\t\t\t$TasksUnitsTodo->save();\n \t\t\t\t\t\t\n \t\t\t\t\t\t/*(new SettingsEmail)->sendEmail(16, 'is_todos_assign_to_me', \n\t \t\t\t\t\t\t$data = array(\n\t \t\t\t\t\t\t\t\t'case_id' => $caseId, \n\t \t\t\t\t\t\t\t\t'todo_id' => $taskuni['id'], \n\t \t\t\t\t\t\t\t\t'service_id' => $servicetask_id, \n\t \t\t\t\t\t\t\t\t'project_id' => $taskuni['task_id'],\n\t \t\t\t\t\t\t\t\t'task_unit_id' => $taskuni['tasks_unit_id']\n\t \t\t\t\t\t\t\t)\n\t \t\t\t\t\t\t);*/\n\n \t\t\t\t\t\t$activityLog = new ActivityLog();\n \t\t\t\t\t\t$activityLog->generateLog('ToDo','Assigned/Transitioned', $taskuni['id'], $taskuni['task_id'].\"|project#:\".$taskuni['task_id'].\"|unit#:\".$taskuni['tasks_unit_id'].\"|ToDo#:\".$taskuni['id']);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\t\n \t}\t\n \techo \"Done\";\n }",
"public static function assignRoleToUser($user_id,$role_id);",
"public function taskWorkOperationsGetProfessionalRoleOperationsByExitCodeAndTaskWorkIdsWithHttpInfo($task_exit_code)\n {\n $returnType = '\\Swagger\\Client\\Model\\ProfessionalRoleOperationDTO[]';\n $request = $this->taskWorkOperationsGetProfessionalRoleOperationsByExitCodeAndTaskWorkIdsRequest($task_exit_code);\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 '\\Swagger\\Client\\Model\\ProfessionalRoleOperationDTO[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OneToOne (owning side) Get fkPessoalAssentamentoAfastamentoTemporario | public function getFkPessoalAssentamentoAfastamentoTemporario()
{
return $this->fkPessoalAssentamentoAfastamentoTemporario;
} | [
"public function getFkPessoalAssentamento()\n {\n return $this->fkPessoalAssentamento;\n }",
"public function getFkPessoalContrato()\n {\n return $this->fkPessoalContrato;\n }",
"public function getFkTesourariaTransferencia()\n {\n return $this->fkTesourariaTransferencia;\n }",
"public function getFornecedorFk()\n {\n return $this->hasOne(Fornecedor::class, ['id_fornecedor' => 'id_fornecedor_fk']);\n }",
"public function getFkPessoalCondicaoAssentamento()\n {\n return $this->fkPessoalCondicaoAssentamento;\n }",
"public function getFkPessoalDependente()\n {\n return $this->fkPessoalDependente;\n }",
"public function getFkTesourariaTransferencias1()\n {\n return $this->fkTesourariaTransferencias1;\n }",
"public function getFkPessoalPensao()\n {\n return $this->fkPessoalPensao;\n }",
"public function poaParticipante()\n {\n return $this->hasOne(PoaParticipante::class);\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkTcemgContratoEmpenho()\n {\n return $this->fkTcemgContratoEmpenho;\n }",
"public function GetIdPalestra()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"palestra_participante_ibfk_1\");\n\t}",
"public function getAsignatura()\n {\n return $this->hasOne(Asignatura::className(), ['id_asignatura' => 'id_asignatura']);\n }",
"public function getIdDepartamento0()\n {\n return $this->hasOne(Departamentos::className(), ['idDepartamento' => 'idDepartamento']);\n }",
"public function getFkPessoalClassificacaoAssentamento()\n {\n return $this->fkPessoalClassificacaoAssentamento;\n }",
"public function getFkPessoalPensionista()\n {\n return $this->fkPessoalPensionista;\n }",
"public function getPaciente()\n {\n return $this->hasOne(Paciente::className(), ['id' => 'id_paciente']);\n }",
"public function getFkPessoalAssentamentoGerado()\n {\n return $this->fkPessoalAssentamentoGerado;\n }",
"public function getFkEmpenhoEmpenho()\n {\n return $this->fkEmpenhoEmpenho;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field dlyp_idcard | public function getDlypIdcard()
{
return $this->dlyp_idcard;
} | [
"public function getCardid()\n {\n return $this->cardid;\n }",
"public function getIdCard()\n {\n return $this->id_card;\n }",
"public function getIdCard() {\n\t\treturn $this->idCard;\n\t}",
"public function getCardId() {\n return $this->cardId;\n }",
"public function getCardId()\n {\n return $this->cardId;\n }",
"function k_CardId():string {return 'card';}",
"public function getCardId()\n {\n return $this->getData(self::CC_ID);\n }",
"public function getCardcode()\n {\n return $this->cardcode;\n }",
"public function getCardNo();",
"public function getIDCardNumber()\n {\n return isset($this->IDCardNumber) ? $this->IDCardNumber : null;\n }",
"public function get_credit_card();",
"public function getCardNumber(){\n\t\treturn $this->cardNumber;\n\t}",
"public function getIdcardDown()\n {\n return $this->idcard_down;\n }",
"public function getIdentityCard()\n {\n return $this->identity_card;\n }",
"public static function getDataByIdcard($idcard)\n {\n return self::find()->where(['idcard'=>$idcard])->one();\n }",
"public function getCardNumber()\n {\n return $this->cardNumber;\n }",
"public function getCardNumber()\r\n {\r\n return $this->payment->getAdditionalInformation('card_number') ?? '****';\r\n }",
"public function card()\n {\n return $this->card;\n }",
"public function getCardNumber() {\n return $this->cardNumber;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [oehdtakendate] column value. | public function getOehdtakendate()
{
return $this->oehdtakendate;
} | [
"public function getDate() {\n return $this->getEvalAttribute('date');\n }",
"public function get_date_achat()\n {\n return $this->_date_achat;\n }",
"public function getDate()\n {\n if ($this->type != PropertyType::DATE) {\n return PropertyType::convertType($this->value, PropertyType::DATE);\n }\n return $this->value;\n }",
"public function getDate()\n {\n if (!isset($this->data['date'])) {\n return null;\n }\n try {\n return (class_exists('\\Carbon\\Carbon')) ?\n new \\Carbon\\Carbon($this->data['date'], 'GMT') :\n $this->data['date'];\n } catch (\\Exception $e) {\n return null;\n }\n }",
"public function getReturnDateWithDayAttribute()\n {\n return transformDateFormat($this->return_date, 'l, j F Y H:i');\n }",
"public function getDate_adoption()\n {\n return $this->Date_adoption;\n }",
"public function getDate()\n {\n\n if ($this->lodge_date === null) {\n return null;\n } else {\n\n $lodgedDateTime = \\DateTime::createFromFormat('Y-m-d', $this->lodge_date);\n return $lodgedDateTime;\n }\n\n }",
"public function getSpendEntryDateAttribute()\n {\n return $this->cost->created_at->format($this->dateFormat);\n }",
"public function getOedtcancdate()\n {\n return $this->oedtcancdate;\n }",
"public function getOedhcancdate()\n {\n return $this->oedhcancdate;\n }",
"public function getOehdcancdate()\n {\n return $this->oehdcancdate;\n }",
"public function getJoinedDate()\n {\n return $this->getValueByKey($this->response, 'joinedDateUtc');\n }",
"public function getOehdtakentime()\n {\n return $this->oehdtakentime;\n }",
"public function getDateValue()\n {\n return $this->readOneof(5);\n }",
"public function getEngagementDateLongAttribute()\n {\n if($value = data_get($this->engagement, 'start_date')){\n return Carbon::parse($value)->format(config('betta.long_date'));\n }\n }",
"public function getOehdverifydate()\n {\n return $this->oehdverifydate;\n }",
"public function getDoDate()\n {\n return $this->data['fields']['do_date'];\n }",
"public function getOehdarrvdate()\n {\n return $this->oehdarrvdate;\n }",
"public function getDATE()\n {\n return $this->DATE;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the nb dsn evt fin contrat. | public function getNbDsnEvtFinContrat(): ?int {
return $this->nbDsnEvtFinContrat;
} | [
"public function getNbDsnEvtFinContratFact() {\n return $this->nbDsnEvtFinContratFact;\n }",
"public function getCdNfentrada()\n {\n return $this->cd_nfentrada;\n }",
"public function getNfentradaCdNfentrada()\n {\n return $this->nfentrada_cd_nfentrada;\n }",
"public function setNbDsnEvtFinContrat($nbDsnEvtFinContrat) {\n $this->nbDsnEvtFinContrat = $nbDsnEvtFinContrat;\n return $this;\n }",
"public function getIndFrete()\n {\n return $this->ind_frete;\n }",
"function getNSU_Bd() {\r\n\r\n\tglobal $db_nfe;\r\n\t$max = $db_nfe->lookup(\"select count(id_nfesyslog_entrada_lista) from t_nfesyslog_entrada_lista where nsu is not null\");\r\n\t\r\n\tif ($max[0][0]==0) {\r\n\t\t$nsu = \"0\";\r\n\t} else {\r\n\t\t$dtnsu = $db_nfe->lookup(\"select nsu from t_nfesyslog_entrada_lista order by data_autorizacao desc limit 0,1\");\r\n\t\t$nsu = $dtnsu[0][0];\r\n\t}\r\n\treturn $nsu;\r\n}",
"public function getEmitenteNf()\n {\n return $this->emitente_nf;\n }",
"public function setNbDsnEvtFinContratADeduire(?int $nbDsnEvtFinContratADeduire): Compteur {\n $this->nbDsnEvtFinContratADeduire = $nbDsnEvtFinContratADeduire;\n return $this;\n }",
"public function getNfeNfeid()\n {\n return $this->nfe_nfeid;\n }",
"public function getCodiceEvento()\n {\n return $this->codice_evento;\n }",
"public function getCdNfservico()\n {\n return $this->cd_nfservico;\n }",
"public function getCodigoEvento() {\n \n return $this->iCodigoEvento;\n }",
"public function getFinca_idfinca(){\n return $this->finca_idfinca;\n }",
"public function getOehdcontfaxnbr()\n {\n return $this->oehdcontfaxnbr;\n }",
"public function getSesionFin(){\n\t\treturn $this->sesion_fin;\n\t}",
"public function get_fin_sejour()\n {\n return $this->_fin_sejour;\n }",
"public function getSerieNf()\n {\n return $this->serie_nf;\n }",
"public function getIndExeDR()\n {\n return $this->valorDRExento > 0 ? 1 : 0;\n }",
"public function setNbDsnEvtArretFact(?int $nbDsnEvtArretFact): Compteur {\n $this->nbDsnEvtArretFact = $nbDsnEvtArretFact;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserta nueva medicion grupocompetemcia competencia | public function nuevo_medicion_grupocompetencia_competencia($datos){
$datosBD = array(
'ID_Medicion' => $this->input->post('ID_Medicion'),
'ID_GrupoCompetencia' => $this->input->post('ID_Grupo_Competencia'),
'ID_Competencia' => $this->input->post('ID_Competencia'),
'Porcentaje' => $this->input->post('Porcentaje'),
);
$this->db->insert('Medicion_GrupoCompetencia_Competencia', $datosBD);
} | [
"function insert(){\n // $sql \"INSERT INTO grupos ('desc_grupo) VALUES ('desc_grupo')\";\n //$sql=\"INSERT INTO grupos (id_grupo,dec_grupos) VALUES ('$id_grupo[0]','$desc_grupo[0]')\";\n $sql=\"INSERT INTO grupos (id_grupo,desc_grupo) VALUES ('.$id_grupo.','.$desc_grupo.')\";\n $this->conexion->QuerySimple($sql);\n\n }",
"public function insert($tipo_proyecto);",
"public function inserir_grupo() {\n $this->load->model('produto_model');\n\n $categorias = $this->produto_model->mostra_categoria();\n\n $data['categorias'] = $categorias;\n\n $data['usuario'] = $this->session->userdata('usuario');\n $this->template->showAdmin('admin/insere_grupo', $data);\n }",
"public function insert($equipo_has_mantenimiento);",
"public function insert($gastocomun);",
"public function insert($puesto);",
"function crearGeneroPelicula($id_genero,$id_pelicula){\n $sentencia = $this->db->prepare(\"INSERT INTO genero_pelicula(fk_id_pelicula,fk_id_genero) VALUES(?,?)\");\n $sentencia->execute(array($id_pelicula,$id_genero));\n }",
"function create(){\n $sql=\"INSERT INTO alumnos(nombre,apellido_p,apellido_m,id_g,id_n) VALUES ('\".$this->matricula.\"','\".$this->nombre.\"','\".$this->apellidopat.\"','\".$this->apellidomat.\"','\".$this->id_grado.\"','\".$this->id_nivel.\"','1')\";\n $link->query($sql);\n }",
"static function grupos_inserir(){\n $Registro = &Registro::getInstacia();\n $db = &$Registro->_Conexao;\n // Caso Categoria Não existe, continua\n $sql = $db->query(\n 'SELECT * FROM '.MYSQL_CAT.' C LEFT JOIN '.MYSQL_CAT_ACESSO.' CA '.\n 'ON C.id WHERE CA.mod_acc=\\'usuario_grupo\\'' \n ,true);\n $categoria = $sql->fetch_object();\n // Caso nao Exista, cria as categorias\n if($categoria===NULL){\n $manutencao = new \\Framework\\Classes\\SierraTec_Manutencao();\n \n // Gerais\n $db->query(\n 'INSERT INTO '.MYSQL_CAT.' (log_date_add,servidor,parent,nome,deletado)\n VALUES (\\''.APP_HORA.'\\',\\''.SRV_NAME_SQL.'\\',0,\\'Gerais\\',0);'\n ,true);\n $gerais_id = (int) $db->ultimo_id();\n $cadastrar = $db->query(\n 'INSERT INTO '.MYSQL_CAT_ACESSO.' (log_date_add,servidor,categoria,mod_acc)\n VALUES (\\''.APP_HORA.'\\',\\''.SRV_NAME_SQL.'\\','.$gerais_id.',\\'usuario_grupo\\');'\n ,true);\n $manutencao->Alterar_Config('CFG_TEC_CAT_ID_ADMIN',$gerais_id);\n \n // Clientes\n $db->query(\n 'INSERT INTO '.MYSQL_CAT.' (log_date_add,servidor,parent,nome,deletado)\n VALUES (\\''.APP_HORA.'\\',\\''.SRV_NAME_SQL.'\\',0,\\'Clientes\\',0);'\n ,true);\n $clientes_id = (int) $db->ultimo_id();\n $cadastrar = $db->query(\n 'INSERT INTO '.MYSQL_CAT_ACESSO.' (log_date_add,servidor,categoria,mod_acc)\n VALUES (\\''.APP_HORA.'\\',\\''.SRV_NAME_SQL.'\\','.$clientes_id.',\\'usuario_grupo\\');'\n ,true);\n $manutencao->Alterar_Config('CFG_TEC_CAT_ID_CLIENTES',$clientes_id);\n \n // Funcionarios\n $db->query(\n 'INSERT INTO '.MYSQL_CAT.' (log_date_add,servidor,parent,nome,deletado)\n VALUES (\\''.APP_HORA.'\\',\\''.SRV_NAME_SQL.'\\',0,\\'Funcionários\\',0);'\n ,true);\n $funcionarios_id = (int) $db->ultimo_id();\n $cadastrar = $db->query(\n 'INSERT INTO '.MYSQL_CAT_ACESSO.' (log_date_add,servidor,categoria,mod_acc)\n VALUES (\\''.APP_HORA.'\\',\\''.SRV_NAME_SQL.'\\','.$funcionarios_id.',\\'usuario_grupo\\');'\n ,true);\n $manutencao->Alterar_Config('CFG_TEC_CAT_ID_FUNCIONARIOS',$funcionarios_id);\n }else{\n \n $gerais_id = (int) CFG_TEC_CAT_ID_ADMIN;\n $clientes_id = (int) CFG_TEC_CAT_ID_CLIENTES;\n $funcionarios_id = (int) CFG_TEC_CAT_ID_FUNCIONARIOS;\n }\n \n \n $grupos = $db->Sql_Select('Sistema_Grupo');\n if($grupos===false){\n \n // Admin Master\n $grupo = new \\Sistema_Grupo_DAO();\n //$grupo->id = 1;\n $grupo->nome = __('Admin Master');\n $grupo->categoria = $gerais_id;\n $db->Sql_Inserir($grupo);\n \n // Admin\n $grupo = new \\Sistema_Grupo_DAO();\n //$grupo->id = 2;\n $grupo->nome = __('Admin');\n $grupo->categoria = $gerais_id;\n $db->Sql_Inserir($grupo);\n \n // Cliente\n $grupo = new \\Sistema_Grupo_DAO();\n //$grupo->id = 3;\n $grupo->nome = \\Framework\\App\\Acl::Sistema_Modulos_Configs_Funcional('usuario_Cliente_nome');\n $grupo->categoria = $clientes_id;\n $db->Sql_Inserir($grupo);\n \n // Funcionario\n $grupo = new \\Sistema_Grupo_DAO();\n //$grupo->id = 3;\n $grupo->nome = __('Funcionário');\n $grupo->categoria = $funcionarios_id;\n $db->Sql_Inserir($grupo);\n \n // Newsletter\n $grupo = new \\Sistema_Grupo_DAO();\n //$grupo->id = 4;\n $grupo->nome = __('Newsletter');\n $grupo->categoria = $funcionarios_id;\n $db->Sql_Inserir($grupo);\n }\n \n \n }",
"public function Guardaropcion()\n\t{\n\t\t$query=\"INSERT INTO grupoopcion (opcion,costo,idgrupo) VALUES ('$this->opcion','$this->costo','$this->idgrupo')\";\n\t\t\n\t\t$resp=$this->db->consulta($query);\n\t\t\n\t\t\n\t}",
"function insert()\n {\n if (empty($this->padre)) {\n $sql = \"INSERT INTO categorias (id, nombre) VALUES (null, '$this->nombre')\";\n } else {\n $sql = \"INSERT INTO categorias VALUES (null,'$this->nombre', '$this->padre')\";\n }\n conexion()->query($sql);\n }",
"protected function insertar()\n {\n }",
"function insertarRegistroCambioGrupoEstudianteMysql() {\n $cadena_sql=$this->sql->cadena_sql(\"registrar_actualizar_espacio_mysql\", $_REQUEST);\n $resultado_insertarRegistroCancelado=$this->ejecutarSQL($this->configuracion, $this->accesoGestion, $cadena_sql,\"\" );\n return $this->totalAfectados($this->configuracion, $this->accesoGestion);\n }",
"public function insertMedico() {\n\t\t$msgRetorno = $this->insertMedicoCompleto(\t$this->nome, \n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->senha, \n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->cpf,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->especialidade,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->planoDeSaude,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->dtNascimento,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->endereco,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->telefone,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->email\n\t\t);\n\t\tif (strcmp($msgRetorno, \"Inserção realizada com sucesso!\") != 0) {\n\t\t\treturn $msgRetorno; // Significa que deu erro.\n\t\t}\n\t\t$this->codigo = $this->getCodigoByMedico($this);\n\t\t$this->reg_date = $this->getMedicoByCodigo($this->codigo)[0]->reg_date;\n\t\treturn $msgRetorno;\n\t}",
"function insertGrupo(Grupo $grupo){\n $arrayGrupos = $this->arrayGruposSinLimit();\n \n foreach($arrayGrupos as $g){\n if( ( $g[nombre] == $grupo->getNombre() ) && ( $g[nivel] == $grupo->getNivel() ) ){\n return false;\n }\n }\n \n $manager = new ManageGrupo();\n return $manager->add($grupo);\n }",
"public function insert($grupo_investigacion){\n $id=$grupo_investigacion->getId();\n$nombre=$grupo_investigacion->getNombre();\n$sigla=$grupo_investigacion->getSigla();\n$unidad_academica=$grupo_investigacion->getUnidad_academica();\n$fecha_creacion=$grupo_investigacion->getFecha_creacion();\n$fecha_gruplac=$grupo_investigacion->getFecha_gruplac();\n$codigo_gruplac=$grupo_investigacion->getCodigo_gruplac();\n$clas_colciencias=$grupo_investigacion->getClas_colciencias();\n$cate_colciencias=$grupo_investigacion->getCate_colciencias();\n\n try {\n $sql= \"INSERT INTO `grupo_investigacion`( `id`, `nombre`, `sigla`, `unidad_academica`, `fecha_creacion`, `fecha_gruplac`, `codigo_gruplac`, `clas_colciencias`, `cate_colciencias`)\"\n .\"VALUES ('$id','$nombre','$sigla','$unidad_academica','$fecha_creacion','$fecha_gruplac','$codigo_gruplac','$clas_colciencias','$cate_colciencias')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }",
"public function insertarProyecto($datos){\n try{\n $correo = $datos['correo'];\n $idUsuario = 0;\n $idDocente = 0;\n \n //Consultas para obtener el Id del docente\n $query_1 = $this->db->connect()->query(\"SELECT Id FROM usuario WHERE correo_usuario = '$correo' Limit 1\");\n while($row = $query_1->fetch()){\n $idUsuario = $row['Id']; \n }\n $query_2 = $this->db->connect()->query(\"SELECT Id FROM docente WHERE IdUsuario = '$idUsuario' Limit 1\");\n while($row = $query_2->fetch()){\n $idDocente = $row['Id']; \n }\n //Consulta para insertar una nueva metodología\n $query_3 = $this->db->connect()->prepare(\"INSERT INTO `proyecto`(`NombreProyecto`,`FechaFin`, `IdDocente`, `IdMetodologia`, `IdEstado`) VALUES (:nombreProyecto,:fechaFin,:idDocente,:idMetodologia,:idEstado)\");\n $query_3->execute(['nombreProyecto' => $datos['nombreProyecto'], 'fechaFin' => $datos['fechaFin'], 'idDocente' => $idDocente, 'idMetodologia' => $datos['idMetodologia'], 'idEstado' => $datos['idEstado']]);\n \n $nombreProyecto = $datos['nombreProyecto'];\n\n $query_4 = $this->db->connect()->query(\"SELECT Id FROM proyecto WHERE NombreProyecto = '$nombreProyecto' Limit 1\");\n while($row = $query_4->fetch()){\n $idProyecto = $row['Id']; \n }\n\n $query_3 = $this->db->connect()->prepare(\"INSERT INTO `grupoproyecto`(`IdGrupo`, `IdProyecto`) VALUES (:idGrupo,:idProyecto)\");\n $query_3->execute(['idGrupo' => $datos['grupo'], 'idProyecto' => $idProyecto]);\n\n return true;\n }catch(PDOException $e){\n return false;\n }\n }",
"public function addMembro($id_usuario, $id_grupo) {\n $sql = \"INSERT INTO grupos_membros SET id_usuario = '$id_usuario', id_grupo = '$id_grupo'\";\n $this->db->query($sql);\n }",
"public function insert(){\n $sql = \"insert into discipina (codigo,nome,carga,ementa,semestre,id_curso) values (:codigo,:nome,:carga,:ementa,:semestre,:id_curso)\";\n\n $stmt = $this->conexao->prepare($sql);\n\n $stmt->bindValue(':codigo',$this->codigo);\n $stmt->bindValue(':nome',$this->nome);\n $stmt->bindValue(':carga',$this->carga);\n $stmt->bindValue(':ementa',$this->ementa);\n $stmt->bindValue(':semestre',$this->semestre);\n $stmt->bindValue(':id_curso',$this->idCurso);\n\n try{\n $stmt->execute();\n } catch(PDOException $e){\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get secure cookie value Verifies the integrity of the cookie data and decrypts it. If cookie is invalid, it can be automatically destroyed (default). | public function get_secure_value($value)
{
// get cookie data
$values = explode('|', $value);
if ((count($values) === 4) && ($values[1] == 0 || $values[1] >= time()))
{
// prepare cookie data
$key = hash_hmac(self::$halg, $values[0] . $values[1], self::$key);
$session_data = base64_decode($values[2]);
if (self::get_hi_c() && !empty($session_data))
$data = $this->decrypt($session_data, $key, md5($values[1]));
else
$data = $session_data;
// verify data
if (self::$ssl && isset($_SERVER['SSL_SESSION_ID']))
$verify_key = hash_hmac(
self::$halg,
$values[0] . $values[1] . $data . $_SERVER['SSL_SESSION_ID'],
$key
);
else
$verify_key = hash_hmac(
self::$halg,
$values[0] . $values[1] . $data,
$key
);
if ($verify_key == $values[3]) return $data;
}
// return false
return false;
} | [
"public function getCookieSecure() {\n return $this->cookie_secure;\n }",
"function get_secure_cookie_data($key)\n{\n $app = \\Liten\\Liten::getInstance();\n $data = $app->cookies->getSecureCookie($key);\n return $data;\n}",
"public static function secureCookie()\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn self::instance()->component('securecookie');\n\t\t}\n\t\tcatch (Exception\\Component\\NotFoundException $e)\n\t\t{\n\t\t\tthrow new \\RuntimeException(\"Can't get SecureCookie instance.\");\n\t\t}\n\t}",
"public static function get($key, $default = null)\n {\n if ( ! ake($key, $_COOKIE)) {\n // The cookie does not exist\n return $default;\n }\n\n // Get the cookie value\n $cookie = $_COOKIE[$key];\n\n // Find the position of the split between salt and contents\n $split = strlen(self::salt($key, null));\n\n if (isset($cookie[$split]) && $cookie[$split] === '~') {\n // Separate the salt and the value\n list ($hash, $value) = explode('~', $cookie, 2);\n\n if (FTV_Cookie::salt($key, $value) === $hash) {\n // Cookie signature is valid\n return $value;\n }\n\n // The cookie signature is invalid, delete it\n FTV_Cookie::delete($key);\n }\n\n return $default;\n }",
"public static function get($key, $default = null)\n {\n if (!isset($_COOKIE[$key])) {\n // The cookie does not exist\n return $default;\n }\n\n // Get the cookie value\n $cookie = $_COOKIE[$key];\n\n // Find the position of the split between salt and contents\n $split = strlen(static::salt($key, null));\n\n if (isset($cookie[$split]) && $cookie[$split] === '~') {\n // Separate the salt and the value\n list ($hash, $value) = explode('~', $cookie, 2);\n\n if (static::salt($key, $value) === $hash) {\n // Cookie signature is valid\n return $value;\n }\n\n // The cookie signature is invalid, delete it\n static::delete($key);\n }\n\n return $default;\n }",
"public static function get($name = NULL, $default = NULL, $xss_clean = FALSE)\n\t{\n\t\t// Return an array of all the cookies if we don't have a name\n\t\tif ($name === NULL)\n\t\t{\n\t\t\t$cookies = array();\n\n\t\t\tforeach($_COOKIE AS $key => $value)\n\t\t\t{\n\t\t\t\t$cookies[$key] = cookie::get($key, $default, $xss_clean);\n\t\t\t}\n\t\t\treturn $cookies;\n\t\t}\n\n\t\tif ( ! isset($_COOKIE[$name]))\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\n\t\t// Get the cookie value\n\t\t$cookie = $_COOKIE[$name];\n\n\t\t// Find the position of the split between salt and contents\n\t\t$split = strlen(cookie::salt($name, NULL));\n\n\t\tif (isset($cookie[$split]) AND $cookie[$split] === '~')\n\t\t{\n\t\t\t // Separate the salt and the value\n\t\t\tlist ($hash, $value) = explode('~', $cookie, 2);\n\n\t\t\tif (cookie::salt($name, $value) === $hash)\n\t\t\t{\n\t\t\t\tif ($xss_clean === TRUE AND Kohana::config('core.global_xss_filtering') === FALSE)\n\t\t\t\t{\n\t\t\t\t\treturn Input::instance()->xss_clean($value);\n\t\t\t\t}\n\t\t\t\t// Cookie signature is valid\n\t\t\t\treturn $value;\n\t\t\t}\n\n\t\t\t // The cookie signature is invalid, delete it\n\t\t\tcookie::delete($name);\n\t\t}\n\n\t\treturn $default;\n\t}",
"public function getCookie();",
"public function getEncryptedCookie( $name ) {\n $value = $this->response->getCookieJar()->getCookieValue($name);\n return ($value === false) ? null : $value;\n }",
"protected function read_cookie() {\r\n\r\n $this->load->library('gibberish');\r\n\r\n $cookie = $this->input->cookie($this->cookie_name, true);\r\n\r\n if (!$cookie) {\r\n return false;\r\n }\r\n\r\n $data = @unserialize($this->gibberish->decrypt($cookie, $this->encryption_key));\r\n\r\n if (isset($data['user_id']) && isset($data['series_id']) && isset($data['token'])) {\r\n return $data;\r\n }\r\n\r\n return false;\r\n }",
"function getLoginCookie() {\n\t//voodoo\n\tlist($encryptedData, $iv) = explode(\":\", $_COOKIE[\"usr\"]);\n\t$rawData = mcrypt_decrypt(\n\t\tMCRYPT_RIJNDAEL_256,\n\t\tgetSecret(),\n\t\tbase64_decode($encryptedData),\n\t\tMCRYPT_MODE_CBC,\n\t\t$iv\n\t);\n\treturn unserialize($rawData);\n}",
"public static function decodeSecureCookie($value, $secret, $algorithm, $mode)\n {\n if ($value) {\n $value = explode('|', $value);\n if (count($value) === 3 && ((int) $value[0] === 0 || (int) $value[0] > time())) {\n $key = hash_hmac('sha1', $value[0], $secret);\n $iv = self::getIv($value[0], $secret);\n $data = Encrypter::decrypt(\n base64_decode($value[1]),\n $key,\n $iv,\n array(\n 'algorithm' => $algorithm,\n 'mode' => $mode\n )\n );\n $verificationString = hash_hmac('sha1', $value[0] . $data, $key);\n if ($verificationString === $value[2]) {\n return $data;\n }\n }\n }\n\n return false;\n }",
"public function decrypt(string $cookieData): CookieValue\n {\n try {\n // Decryption: (we use the default encoding: Halite::DECODE_BASE64URLSAFE)\n $decryptedData = Crypto::decrypt(\n $cookieData,\n $this->encryptionKey\n );\n } catch (Exception $e) {\n throw new DecryptionFailedException(\n 'Decrypting the CookieValue failed, see embedded error message for details',\n $e\n );\n }\n return CookieValue::deserialize($decryptedData->getString());\n }",
"private function readCookie() {\n $cipher = new Cipher();\n $auth = $cipher->decrypt($_COOKIE['auth']);\n list($user, $pass) = explode('|', $auth);\n $this->authUser(base64_decode($user), base64_decode($pass));\n }",
"public function getForceCookieAsSecure() : string\n {\n return $this->getValue('nb_site_force_cookie_as_secure');\n }",
"function readCartCookie()\n {\n return unserialize(base64_decode($_COOKIE[$this->cookieName])); // unserialize cookie \n }",
"public static function read($id) {\n /* If no cookie is set, just dropi it! */\n if(!isset($_COOKIE[self::$_name])) {\n return false;\n }\n\n /* Read from store and decrypt. */\n $sessData = phpsec::$store->read('session', $_COOKIE[self::$_name]);\n if($sessData !== false ) {\n $return = phpsecCrypt::decrypt($sessData, self::$_secret);\n } else {\n $return = false;\n }\n return $return;\n }",
"public function cookieValue() {\n\t\treturn $this->cookie;\n\t}",
"function suhosin_encrypt_cookie($name, $value){}",
"static function getSecureToken(){\r\n\t\treturn (isSet($_SESSION[\"SECURE_TOKEN\"])?$_SESSION[\"SECURE_TOKEN\"]:FALSE);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$this>con = (new Database())>getConnection(); | public function __construct()
{
$this->con = Database::getConnection();
} | [
"public function __construct() {\n $db= Db::getInstance();\n $this->conn=$db->getConnection();\n }",
"function connectToDB(){\n $this->dbconn = connectToDB();\n }",
"public function __construct() {\r\n $this->conn = ConnectDataBase::conectaBD();\r\n }",
"protected function __construct(){\n $this->connection = new mysqli('localhost', 'root','','jsstore');\n }",
"function __construct() {\r\n\t\t$this->connBanco = new Db();\r\n\t}",
"public function __construct() {\n $this->db = Database::conectar();\n }",
"function connectToDB(){\n $this->dbconn = connectToDB();\n }",
"public function __construct() {\n\n $this -> db = new dboperation();\n\n}",
"public function __construct()\n {\n $this->connection = $this->createConnection();\n }",
"public function __construct() {\n $this->conn = parent::dbConnect();\n }",
"private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getIntance()->get('db_host'))\n\t\t\t->setUser(Stack::getIntance()->get('db_user'))\n\t\t\t->setPassword(Stack::getIntance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getIntance()->get('db_table'))\t\n\t\t\t->connect();\n\t\t\n\n\t\t$this->dbinfo = new Connection();\n\t\t$this->dbinfo\n\t\t\t->setHost(Stack::getIntance()->get('db_host'))\n\t\t\t->setUser(Stack::getIntance()->get('db_user'))\n\t\t\t->setPassword(Stack::getIntance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getIntance()->get('information_schema'))\t\n\t\t\t->connect();\n\t\t\n\t\tStack::getIntance()->set('db_host', null);\n\t\tStack::getIntance()->set('db_user', null);\n\t\tStack::getIntance()->set('db_pass', null);\n\t}",
"public function __construct(){\r\n\t\t//creating connection of DatabaseConfigsss\r\n$this->dbobj = new DatabaseConfig;\r\n\t}",
"function openMySQLConn(){\n\t\t$this->conn = new ConexionMySQL($this->dataBase);\n\t}",
"public function connect(){\r\n $this->conn = new mysqli(self::HOST, self::USER, self::PASS, $this->db);\r\n\r\n //pass the object\r\n return $this->conn;\r\n }",
"public function __construct() \n {\n \t$this->connectToDatabase();\n }",
"public function __construct(){\n\n $this->db = new Database(); // I crate Object for Database Class\n \n\t}",
"public function setConnection()\r\n {\r\n $this->con = $this->db->getConnection();\r\n }",
"public function __construct()\n {\n //$this->con = new mysqli(\"localhost\",\"dulip\",\"dulip123\",\"salondb\");\n $this->con = new mysqli(\"localhost\",\"root\",\"\",\"salondb\");\n\n }",
"public function __construct(){\n \t\t\n \t $this->con = null;\t\n \t \t \t\t\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This should return the api version of the object url endpoint. For example a User class object that returns "1" will end with the endpoint: /1/classes/ | public static function getApiVersion(); | [
"public function getApiVersionUrl(): string\n {\n return $this->host . '/api/v1';\n }",
"protected function getApiUrl()\n {\n return 'api/'.$this->getApiVersion().'/';\n }",
"public function getApiUrl()\n {\n $config = $this->getConfigHelper();\n \n $versionUrl = $config->getApiVersionUrl();\n return $versionUrl;\n }",
"public function getApiUrl() {\n\t\treturn implode('/', array($this->getApiBase(), $this->getApiVersion())) . \"/\";\n\t}",
"public function getApiEndpointProd();",
"public function getApiUrl();",
"public function api_uri() {\r\n return $this->api_url . $this->api_version . \"/\";\r\n }",
"protected function getEndpointWithVersion()\n {\n return $this->endpoint . $this->getParameter('apiVersion');\n }",
"public function version()\n {\n return $this->call_api_url($this->base_url,[\n 'function' => 'version'\n ]);\n }",
"public function getApiEndpoint();",
"function get_api_version() {\n\t\treturn $this->do_encode($this->myPostApiVersion);\n\t}",
"public function getObjectUrlAttribute()\n {\n return url('api/v1/'.static::getLabel('slug').'/'.$this->id);\n }",
"protected function getApiVersion()\n {\n return Mage::helper('apruvepayment')->getApiVersion();\n }",
"public function getApiVersion()\n {\n return $this->_apiVersion;\n }",
"public function getApiVersion(): string\n {\n return config('global.api_version');\n }",
"public function getApiVersion()\n {\n return $this->_call('getAPIVersion');\n }",
"public function get_full_api_class_path();",
"public function getApiUrl()\n {\n $url = $this->getBaseApiUrl();\n\n $url = str_replace('{name}', $this->getApiName(), $url);\n $url = str_replace('{version}', $this->getApiVersion(), $url);\n\n return $url;\n }",
"public function getApiUrl(){\n if(1 == $this->getLiveMode()){\n return $this->live_api_host_name;\n } else {\n return $this->stage_api_host_name;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check that FileEngine generates an error when a configured Path does not exist. | function testErrorWhenPathDoesNotExist() {
if ($this->skipIf ( is_dir ( TMP . 'tests' . DS . 'file_failure' ), 'Cannot run test directory exists. %s' )) {
return;
}
$this->expectError ();
Cache::config ( 'failure', array (
'engine' => 'File',
'path' => TMP . 'tests' . DS . 'file_failure'
) );
Cache::drop ( 'failure' );
} | [
"public function testInvalidFilePath()\n {\n $this->loader->addFile('/path/to/non/existing/file');\n }",
"public function testAddInvalidPath(): void\n {\n $profiler = new Profiler();\n $finder = $this->prophesize(TemplateFinder::class)->reveal();\n $tracker = new Tracker($profiler, $finder, $this->root_dir, $this->asset_dir, $this->output_dir, []);\n\n $this->expectException(FileNotFoundException::class);\n $this->expectExceptionMessage('File \"/i/dont/exist\" could not be found.');\n\n $tracker->addPath('/i/dont/exist');\n }",
"public function testBadFilePath()\n\t{\n\t\t$loader = LoadManager::getInstance();\n\n\t\t$config1 = tempnam(\"./\", \"config1\");\n\t\t$handle1 = fopen($config1, \"w\");\n\t\tfwrite($handle1, '{\"load\":'.'\"'.$config1.'nonexisting\"}'); // non existing filepath\n\n\t\ttry{\n\t\t\tLoadManager::load($config1);\n\t\t\t$this->fail('Did not throw an exception with a configuration path.');\n\t\t} catch(\\Vcms\\Exception\\NotFound $e) {}\n\n\t\tfclose($handle1);\n\t\tunlink($config1);\n\t}",
"public function checkPath();",
"public function assertFileDoesNotExist()\n {\n if ($this->exists()) {\n throw new ConfigExistsException($this->getFilePath(false));\n }\n }",
"private function validatePath() {\n\t\tif ( empty( $this->path ) ) {\n\t\t\tthrow new \\Exception( 'The logging path is empty' );\n\t\t}\n\n\t\tif ( !is_writable( $this->path ) ) {\n\t\t\tif ( !touch( $this->path ) ) {\n\t\t\t\tthrow new \\Exception( 'The logging path is not writable!' );\n\t\t\t}\n\t\t}\n\t}",
"public function testInvalidPath() {\n AbstractTemplate::setPath(DATA_DIR.'no-templates');\n }",
"public function testValidFileWhenItDoesntExist()\n {\n $invalidName = __DIR__ . self::FILENAME_INVALID;\n $code = $this->productLoader->validFile($invalidName);\n\n $this->assertEquals(false, $code);\n Phake::verify($this->logger, Phake::times(1))->warning(sprintf('Invalid filename: %s', $invalidName));\n }",
"public function testVerifyDebugFileThrowsAnExceptionWhenTheFileDoesNotExist()\n\t{\n\t\t$this->object->debugFile(__DIR__ . '/data/not-existing.ini');\n\t}",
"public function testInvalidFileIsFile()\n {\n $this->assertFalse($this->fileSystem->isFile(__DIR__));\n }",
"public function testGettingFilesWithInvalidPath()\n {\n $this->assertEquals([], $this->fileSystem->getFiles(__FILE__));\n }",
"public function test_invalid_file_path() {\n $this->assertEquals(\n \"Import CSV IOException triggered: Could not open tests/users.csv for reading! File does not exist.\\n\",\n insert_or_update_users($this->invalid_file_path, false)\n );\n }",
"abstract protected function getInvalidConfigPath();",
"public function testAddFileMethodThrowsExpectedExceptionForFileThatNotExists()\n {\n $engine = $this->createEngineFixture();\n $engine->addFile($this->createRunResourceURI('pdepend_'));\n }",
"public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}",
"public function testReadErrorsWithInvalidFilePath()\n\t{\n\t\t$path = __DIR__ . '/Files';\n\n\t\t$loader = new Legacy($path);\n\n\t\t$this->setExpectedException('Hubzero\\\\Config\\\\Exception\\\\FileNotFoundException');\n\n\t\t$loader->read($path . '/configuration.php');\n\t}",
"function file_exists_fatal($file_path)\n{\n\tif(file_exists($file_path) == false)\n\t{\n\t\t// controller not found\n\t\traise_error(500, '500 internal server error<br>');\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}",
"protected function checkVerifierPath()\n {\n if (!file_exists($this->verifierPluginPath)) {\n throw new VerifierPluginNotExistsException();\n }\n }",
"public function testInvalidFile()\n {\n //$this->markTestSkipped('Do not use Duality error_handler.');\n $config = array(\n 'logger' => array(\n 'buffer' => 'dummy'\n )\n );\n $app = new \\Duality\\App(dirname(__FILE__).'/../../..', $config);\n $logger = $app->call('logger');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Fungsi dalam modul portal get list menu by portal id with indentation | function get_list_menu_select_by_portal_id($params) {
// variabel data
$data = array();
// get parent list menu by id
foreach ($this->_get_parent_menu_by_portal_id($params) as $dt_menu) {
$data[] = $dt_menu;
// get child if exist
$data = $this->_get_child($dt_menu['menu_id'], $data, 0);
}
return $data;
} | [
"function liMenu($idNivel)\n {\n // Obtener menu de la base de datos\n $db = dbConnect(\"resint\");\n $rs = $db->query( \"CALL resint.menuNivel('$idNivel')\" );\n foreach ( $rs as $row )\n {\n array_push($this->opciones,$row);\n }\n\n // Generah <li></li>s HTML para el menu\n $this->menu .= '<ul class=\"jd_menu jd_menu_slate\">' . \"\\n\";\n $this->procesarHijos(1);\n $this->menu .= '</ul>' . \"\\n\";\n }",
"public function menus_listados() {\n $cols = 'menus.' . join(',menus.', $this->fields) . \",r.recurso,m2.nombre as padre\";\n $joins = 'INNER JOIN recursos as r ON r.id = recursos_id ';\n $joins .= 'LEFT JOIN menus as m2 ON m2.id = menus.menus_id ';\n return $this->find(\"columns: $cols\", \"join: $joins\");\n }",
"function listarMenu(){\r\n\t\r\n\t\t//echo $parametro->getOrdenacion;\r\n\t\t//var_dump('aaa',$this->objParam);\r\n\t\t\r\n\t\t$this->procedimiento='segu.ft_menu_sel';\r\n\t\t$this->transaccion='SEG_MENU_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';\r\n\t\t\r\n\t\t$this->setCount(false);\r\n\t\t\t\t\t\t\r\n\t\t$this->setParametro('id_padre','id_padre','varchar');\r\n\t\t$this->setParametro('busqueda','busqueda','varchar');\r\n\t\t$this->setParametro('codigo','codigo','varchar');\r\n\t\t\t\t\r\n\t\t//defino varialbes que se captran como retornod e la funcion\r\n\t\t$this->captura('id_gui','integer');\r\n\t\t$this->captura('nombre','varchar');\r\n\t\t$this->captura('codigo_gui','varchar');\r\n\t\t$this->captura('descripcion','text');\r\n\t\t$this->captura('nivel','integer');\r\n\t\t$this->captura('orden_logico','integer');\r\n\t\t$this->captura('ruta_archivo','text');\r\n\t\t$this->captura('clase_vista','varchar'); \r\n\t\t$this->captura('tipo_dato','varchar');\r\n\t\t$this->captura('icono','varchar');\r\n\t\t$this->captura('json_parametros','text');\r\n\t\t\t\t\t\r\n\t\t\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\treturn $this->respuesta;\t\r\n\t\t\r\n\t\t\t\r\n\t}",
"public function getMenusInativo();",
"protected function module_list_menus(){\n\t\t//get all menus\n\t\t$this->menus = db\\orm::find('menus');\n\t\treturn $this->view_list_menus($this->menus);\n\t}",
"abstract public function getMenus();",
"public function getQuickLinkTwolbMenuDetailsById($id)\n { \n $dbtable = new Zend_Db_Table('hierarchy_menu');\n $select = $dbtable->select()->where('parent_id = ?',$id);\n $result = $dbtable->fetchAll($select);\n //echo \"<pre>\";print_r($result);die;\n return $result;\n }",
"function getPanelListByMenuId($idMenu){\n \n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->select('idPanel');\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->select('panel_header');\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->from($this->table_name);\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idMenu', $idMenu);\n $query = SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->get();\n \n $panelList = $query->result_array();\n $list = array();\n foreach($panelList as $panel) {\n $list[$panel['idPanel']] = $panel['idPanel'] . ' - ' . (SHIN_Core::$_language->line($panel['panel_header']) ? SHIN_Core::$_language->line($panel['panel_header']) : $panel['panel_header']); \n } \n return $list; \n }",
"public function getMenusAtivo();",
"public function actionListLokasi()\n {\n $menuid = 14;\n $parentmenuid = 6;\n $userid_actor = Yii::app()->request->getParam('userid_actor');\n $idgroup = FHelper::GetGroupId($userid_actor);\n \n if(FHelper::AllowMenu($menuid, $idgroup, 'read'))\n {\n $Criteria = new CDbCriteria();\n $Criteria->condition = 'is_del = \\'N\\'';\n \n $branch_list = mtr_branch::model()->findAll($Criteria);\n $TheMenu = FHelper::RenderMenu(0, $userid_actor, $parentmenuid);\n \n $this->layout = 'setting';\n $html = $this->renderPartial(\n 'v_list_lokasi',\n array(\n 'userid_actor' => $userid_actor,\n 'idlokasi' => $idlokasi,\n 'branch_list' => $branch_list,\n 'menuid' => $menuid\n ),\n true\n );\n \n $bread_crumb_list = \n '<li>Data Master</li>' .\n \n '<li>'.\n '<span> > </span>'.\n 'Cabang/Toko/Outlet'.\n '</li>';\n \n echo CJSON::encode(\n array(\n 'html' => $html, \n 'bread_crumb_list' => $bread_crumb_list\n )\n );\n }\n else\n {\n $this->actionShowInvalidAccess($userid_actor);\n }\n }",
"public function getMenuDetailsById($id)\n { \n $dbtable = new Zend_Db_Table('hierarchy_menu');\n $select = $dbtable->select()->where('id = ?',$id);\n $result = $dbtable->fetchRow($select);\n return $result;\n }",
"Public function get_menu_list()\n {\n // realizamos la consulta para obtener las categorías\n $obj = $this->db->query('SELECT id, nombre, menu FROM menu',false,false);\n // seteamos la variable\n $retorno = array();\n // obtenemos cada uno de los registros (categorías) y agregamos un índice\n while($value = $obj->fetchrow())\n {\n $retorno[]=$value;\n }\n // retornamos el listado en html.\n return $retorno;\n }",
"public function populateMenuList()\n\t\t\t{\n\n\t\t\t\t$sql = 'SELECT * FROM '.$this->CFG['db']['tbl']['menu'].' WHERE 1';\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt, array());\n\t\t\t\tif (!$rs)\n\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t$inc=0;\n\t\t\t\t$this->menuDetail_arr =array();\n\t\t\t\twhile($row = $rs->FetchRow())\n\t\t\t\t\t{\n\t\t\t\t\t\tif((empty($row['module'])) or\n\t\t\t\t\t\t\t((!empty($row['module']) and in_array($row['module'], $this->CFG['site']['modules_arr']))\n\t\t\t\t\t\t\t\t and chkAllowedModule(array($row['module']))))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t \t\t\t$this->menuDetail_arr[$inc]['id']=$row['id'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['menu_name']=$row['menu_name'];\n\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['normal_querystring']=$row['normal_querystring'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['seo_querystring']=$row['seo_querystring'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['folder']=$row['folder'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['module']=$row['module'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['member_menu']=$row['is_member_menu'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['hide_member_menu']=$row['is_member_hide_menu'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['is_module_home_page']=$row['is_module_home_page'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['file_name_static']['normal']='';\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['file_name_static']['seo']='';\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['file_name']=$row['file_name'];\n\t\t\t\t\t\t\t\tif($row['menu_page_type']=='normal')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$row['menu_page_type'] ='Rayzz File';\n\t\t\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['file_name']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if($row['menu_page_type'] =='static')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$row['menu_page_type'] ='Static page';\n\t\t\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['file_name_static']['normal']=$this->CFG['site']['url'].'staticPage.php?pg='.$row['file_name'];\n\t\t\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['file_name_static']['seo']=$this->CFG['site']['url'].'static/'.$row['file_name'].'.html';\n\t\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\t{\n\t\t\t\t\t\t\t\t\t\t$row['menu_page_type'] ='External Url';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['page_type']=$row['menu_page_type'];\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['order']=$row['menu_order'];\n\n\t\t\t\t\t\t\t\tif($row['menu_status']=='Ok')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$row['menu_status']='Y';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->menuDetail_arr[$inc]['menu_status']=$row['menu_status'];\n\t\t\t\t\t\t\t\t$inc++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t}",
"function listado()\r\n\t{\r\n\t\t\r\n\t\t//Consultamos la base de datos para que nos ofresca los menus.\r\n\t\t$Consulta = '\r\n\t\t\tselect *\r\n\t\t\tfrom menu\r\n\t\t\torder by id_menu_padre asc, id_menu asc\r\n\t\t';\r\n\t\t\r\n\t\t//Ejecuto la consulta\r\n\t\t$Resultado = $this->db->query($Consulta);\r\n\t\t\r\n\t\t//Guardare los menus en este array, prestar atencion a como se guardaran\r\n\t\t//jerarquicamente\r\n\t\t$Menu = array();\r\n\t\tforeach($Resultado->result_array() as $Fila)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif('0' == $Fila['id_menu_padre'])\r\n\t\t\t{//Si es el menu principal\r\n\t\t\t\t//Creo un indice con el id_menu el cual a su vez sera un array de elementos\r\n\t\t\t\t//Dentro de el se almacenan la etiqueta y el enlace\r\n\t\t\t\t$Menu[$Fila['id_menu']]['etiqueta'] = $Fila['etiqueta'];\r\n\t\t\t\t$Menu[$Fila['id_menu']]['enlace'] = $Fila['enlace'];\r\n\t\t\t\t$Menu[$Fila['id_menu']]['activo'] = $Fila['activo'];\r\n\t\t\t\t//Se crea un indice adicional en el cual se guardaran los submenus\r\n\t\t\t\t$Menu[$Fila['id_menu']]['submenu'] = array();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{//Si es el sub_menu voy agregando los elementos bajo el id de su grupo\r\n\t\t\t\t//Se crea un indice bajo submenu con el id_menu para identificar a cada\r\n\t\t\t\t//uno, guardamos su etiqueta y su enlace.\r\n\t\t\t\t$Menu[$Fila['id_menu_padre']]['submenu'][$Fila['id_menu']]['etiqueta'] = $Fila['etiqueta'];\r\n\t\t\t\t$Menu[$Fila['id_menu_padre']]['submenu'][$Fila['id_menu']]['enlace'] = $Fila['enlace'];\r\n\t\t\t\t$Menu[$Fila['id_menu_padre']]['submenu'][$Fila['id_menu']]['activo'] = $Fila['activo'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Regreso el array con los grupos encontrados\r\n\t\treturn $Menu;\r\n\t\t\r\n\t\t\r\n\t}",
"public function __get_menus(){\n //if(empty($ids)) return array();\n //$_menus = $this->_controller->ObjItemTree->find('threaded', array('tid' => 'cms_link', 'conditions' => array('(ObjItemTree.lft IS NOT NULL OR (ObjItemTree.lft IS NULL AND ObjItemTree.parent_id IN ('.sqlimplode(',', array_keys($ids)).')))'), 'order' => array('ObjItemTree.lft' => 'ASC', 'ObjItemTree.extra_3' => 'ASC', 'ObjItemTree.title' => 'ASC')));\n $_menus = $this->_controller->ObjItemTree->find('threaded', array('tid' => 'cms_link', 'conditions' => array('ObjItemTree.extra_1 <>' => '6'), 'order' => array('ObjItemTree.lft' => 'ASC', 'ObjItemTree.title' => 'ASC')));\n foreach($_menus as $_menu){\n if($_menu['ObjItemTree']['extra_1'] == '1'){\n $menus[$_menu['ObjItemTree']['code']]['data'] = $_menu['ObjItemTree'];\n $menus[$_menu['ObjItemTree']['code']]['links'] = $this->__get_menu_content($_menu);\n //$menus[$_menu['ObjItemTree']['code']]['links'] = $this->__get_menu_data($_menu['children']);\n $this->_ids[$_menu['ObjItemTree']['id']] = $_menu['ObjItemTree']['code'];\n }\n }\n $this->_controller->set('menus', $menus);\n }",
"private function _showPublic(){\n $omenu = D('Menu');\n $amodules = $omenu->getModules();\n $this->assign('modules',$amodules);\n $amenu = $omenu->getMenuByModelName(MODULE_NAME);\n $asubNav = array();\n $amenus = array();\n $asubmenus = array();\n $temp = array();\n foreach($amenu as $v){\n if(!$this->_auth($v['name'])) continue;\n switch(count(explode(',',$v['level']))){\n case 2:\n $amenus[$v['id']] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'icon' => $v['icon']\n );\n if(MODULE_NAME == $v['name']){\n $anav[] = array(\n 'title' => $amodules[$v['pId']]['title'],\n 'URL' => $amodules[$v['pId']]['URL'],\n 'icon' => $amodules[$v['pId']]['icon']\n );\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n $amenus[$v['id']]['active'] = true;\n $icon = $v['icon'];\n }else{\n $amenus[$v['id']]['active'] = false;\n }\n break;\n case 3:\n $amenus[$v['pId']]['submenu'][$v['id']] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n if($foundSubNav){\n $stop = true;\n break;\n }else{\n $asubNav = array();\n }\n\n if($v['name'] == MODULE_NAME.'_'.ACTION_NAME){\n $bnatchNav || $bmatchNav = true;\n $foundSubNav = true;\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'class' => 'current'\n );\n $tcontentTitle = $v['title'];\n }else{\n $temp = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n );\n $bmatchNav && $bmatchNav = false;\n }\n break;\n case 4:\n if($foundSubNav && $stop) break;\n if($bmatchNav){\n $asubNav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n $tsubContentTitle = $tcontentTitle;\n }else{\n $asubNav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n //$tsubContentTitle = $temp['name'];\n if(MODULE_NAME.'_'.ACTION_NAME == $v['name']){\n $foundSubNav = true;\n $tsubContentTitle = $v['title'];\n $tcontentTitle = $temp['title'];\n $anav[] = array(\n 'title' => $temp['title'],\n 'URL' => $temp['URL']\n );\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'class' => 'current'\n );\n $asubNav[count($asubNav)-1]['active'] = true;\n }\n }\n break;\n }\n }\n $this->assign('menu',$amenus);\n $this->assign('nav',$anav);\n $this->assign('contentTitle',$tcontentTitle);\n $this->assign('subnav',$asubNav);\n $this->assign('subContentTitle',$tsubContentTitle);\n $this->assign('icon',$icon);\n }",
"function get_childs($id)\n {\n $has_subcats = FALSE;\n \n $html_out = '';\n \n $html_out .= \"\\t\\t\\t\\t\\t\".'<ul>'.\"\\n\";\n \n // query q me ejecuta el submenu filtrando por usuario y para buscar el submenu segun el id que traigo\n $query = $this->ci->db->query(\"select * from lms_privilege where parent_id = $id\");\n \n foreach ($query->result() as $row)\n {\n $id = $row->lms_modules_id;\t\t\t\t\n\t\t\t\t$module_name = $row->module_name;\n\t\t\t\t$display_name = $row->display_name;\n\t\t\t\t$url = base_url('/lmsadmin/').$module_name; \n\t\t\t\t$position = $row->position;\n\t\t\t\t$parent_id = $row->parent_id;\n\t\t\t\t$is_parent = $row->is_parent;\n\t\t\t\t$show_menu = $row->show_menu;\n \n $has_subcats = TRUE;\n \n if ($is_parent == TRUE)\n {\n\t\t\t\t\t$html_out .= \"\\t\\t\\t\\t\\t\\t\".'<li>'.anchor($url, $display_name, 'name=\"'.$display_name.'\" id=\"'.$id.'\"');\n \n }\n else\n {\n $html_out .= \"\\t\\t\\t\\t\\t\\t\".'<li>'.anchor($url, $display_name, 'name=\"'.$display_name.'\" id=\"'.$id.'\" ');\n }\n \n // Recurse call to get more child submenus.\n $html_out .= $this->get_childs($id);\n }\n $html_out .= '</li>' . \"\\n\";\n $html_out .= \"\\t\\t\\t\\t\\t\".'</ul>' . \"\\n\";\n \n \n return ($has_subcats) ? $html_out : FALSE;\n \n }",
"public static function putMenuInLayout(){\n $parentContent = \\Default_Model_Content::getInstanceByCode('CONTENT');\n\n $illigalContentTypes = array('news', 'agenda');\n \n $mainmenu = array();\n if($parentContent){\n $mainmenuItems = Tree::getInstance()->getChildrenOf($parentContent->getId());\n foreach($mainmenuItems as $mainmenuItem){\n \tif(!in_array(strtolower($mainmenuItem->getObjecttype()->getCode()), $illigalContentTypes)){\n \t $mainmenu[] = $mainmenuItem;\n \t} \n }\n }\n\n $object = self::getCurrentObject();\n\n if(! $object){ // no page selected, get first page of main menu\n $object = reset($mainmenu);\n }\n\n // get menu's\n $submenuParents = array();\n $submenuItems = array();\n $activeSubmenuId = 0;\n $activeMainmenuId = 0;\n $levelsCounter = 0;\n foreach($mainmenu as $menuItem){\n $mainMenuIds[] = $menuItem->getId();\n }\n $tempObject = $object;\n while ( count($submenuItems) == 0 && $levelsCounter < 10 ){\n if(! $tempObject)\n break;\n if(in_array($tempObject->getParent(),$mainMenuIds)){ // my parent is part of the submenu\n $activeSubmenuId = $tempObject->getId();\n $selectedMainMenu = \\Default_Model_Content::getInstanceByPk($tempObject->getParent());\n $activeMainmenuId = $selectedMainMenu->getId();\n $submenuItems = $selectedMainMenu->getChildren();\n }else if(in_array($tempObject->getId(),$mainMenuIds)){ // i am part of the main menu\n $activeMainmenuId = $tempObject->getId();\n $submenuItems = $tempObject->getChildren();\n }else{ // i am my parent are not part of the submenu, lets check my parent\n $tempObject = \\Default_Model_Content::getInstanceByPk($tempObject->getParent());\n }\n $levelsCounter ++;\n }\n \n $submenu = array();\n foreach($submenuItems as $submenuItem){\n \tif(!in_array(strtolower($submenuItem->getObjecttype()->getCode()), $illigalContentTypes)){\n \t\t$submenu[] = $submenuItem;\n \t}\n }\n\n \\Zend_Layout::getMvcInstance()->assign('mainmenu',$mainmenu);\n \\Zend_Layout::getMvcInstance()->assign('activeSubmenuId',$activeSubmenuId);\n \\Zend_Layout::getMvcInstance()->assign('activeMainmenuId',$activeMainmenuId);\n \\Zend_Layout::getMvcInstance()->assign('showsubmenu',count($submenu));\n \\Zend_Layout::getMvcInstance()->assign('submenu',$submenu);\n }",
"public function getgroupmenu($group_id,$role_id,$id)\n {\n $priveleges_model = new Default_Model_Privileges();\n $group_model = new Default_Model_Groups();\n $group_data = $group_model->getGroupDataById($group_id);\n \n \n $res = $this->getMenuArray($role_id,$group_id);\n $tmpArr = array(); \n $tmpMenuArr = array();\n $tmpMenuDataArr = array();\n \n for($i = 0; $i < sizeof($res); $i++)\n {\n $tmpMenuArr[$res[$i]['id']] = $res[$i]['parent'];\n $tmp = array();\n $tmp['id'] = $res[$i]['id'];\n $tmp[\"parent\"] = $res[$i]['parent'];\n $tmp[\"menuName\"] = $res[$i]['menuName'];\n $tmp[\"iconPath\"] = $res[$i]['iconPath'];\n $tmp[\"url\"] = $res[$i]['url'];\n $tmp['default_permissions'][\"addpermission\"] = $res[$i]['addpermission'];\n $tmp['default_permissions'][\"editpermission\"] = $res[$i]['editpermission'];\n $tmp['default_permissions'][\"deletepermission\"] = $res[$i]['deletepermission'];\n $tmp['default_permissions'][\"viewpermission\"] = $res[$i]['viewpermission'];\n $tmp['default_permissions'][\"uploadattachments\"] = $res[$i]['uploadattachments'];\n $tmp['default_permissions'][\"viewattachments\"] = $res[$i]['viewattachments'];\n\n $tmpMenuDataArr[$res[$i]['id']] = $tmp;\n }\n\n \n\n /**\n ** prepare an array with parent and second level menus - $tmpArr\n **/\n $emptyArr = array();\n foreach($tmpMenuArr as $key => $value)\n {\n if($value == 0 && !array_key_exists($value,$tmpArr))\n {\n $tmpArr[$key] = $emptyArr;\n $tmpArr[$key] = $tmpMenuDataArr[$key];\n }\n else if(array_key_exists($value,$tmpArr) && !array_key_exists($key,$tmpArr[$value]))\n $tmpArr[$value]['childs'][$key] = $tmpMenuDataArr[$key];\t\t\t\t\n }\n\n foreach($tmpArr as $key => $value_arr)\n {\n if(is_array($value_arr))\n {\n if(isset($value_arr['childs']) && is_array($value_arr['childs']))\n {\n foreach($value_arr['childs'] as $c_key => $ch_value)\n { \n foreach($tmpMenuArr as $tkey => $tvalue)\n { \n if($tvalue == $c_key && !array_key_exists($tkey,$tmpArr))\n { \n $tmpArr[$key]['childs'][$c_key]['childs'][$tkey] = $tmpMenuDataArr[$tkey];\n }\n } \n }\n }\n }\n }//end of foreach.\n \n $menu_data = array();\n $menu_data_post = array();\n $permission_data = array();\n if($id != '')\n { \n $mdata = $priveleges_model->getMenuItemsByRoleId($id); \n foreach($mdata as $val_arr)\n {\n $menu_data[] = $val_arr['object'];\n $menu_data_post[$val_arr['id']] = $val_arr['object'];\n if(isset($tmpMenuArr[$val_arr['object']]))\n {\n if($tmpMenuArr[$val_arr['object']] != 0) \n $menu_data[] = $tmpMenuArr[$val_arr['object']];\n }\n $permission_data[$val_arr['object']]['addpermission'] = $val_arr['addpermission'];\n $permission_data[$val_arr['object']]['editpermission'] = $val_arr['editpermission'];\n $permission_data[$val_arr['object']]['deletepermission'] = $val_arr['deletepermission'];\n $permission_data[$val_arr['object']]['viewpermission'] = $val_arr['viewpermission'];\n $permission_data[$val_arr['object']]['uploadattachments'] = $val_arr['uploadattachments'];\n $permission_data[$val_arr['object']]['viewattachments'] = $val_arr['viewattachments'];\n }\n $menu_data1 = array();\n foreach($menu_data as $menu_id)\n {\n if(array_key_exists($menu_id, $tmpMenuArr))\n $menu_data1[] = $tmpMenuArr[$menu_id];\n }\n\n $menu_data1 = array_unique($menu_data1); \n $menu_data = array_unique($menu_data); \n $menu_data = array_merge_recursive($menu_data,$menu_data1);\n \n \n }\n \n $return_arr = array('tmpArr' => $tmpArr,'menu_data_post' => $menu_data_post,\n 'menu_data' => $menu_data,'permission_data' => $permission_data,'group_data' => $group_data);\n \n return $return_arr;\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove relations from portfolio | private function dropRelations()
{
// удаление связей между таблицами портфолио и тегами
$this->dropForeignKey('fk_portfolio_links_work_to_tag_work_id', '{{%portfolio_links_work_to_tag}}');
$this->dropForeignKey('fk_portfolio_links_work_to_tag_tag_id', '{{%portfolio_links_work_to_tag}}');
$this->dropIndex('ix_portfolio_links_work_to_tag_work_id', '{{%portfolio_links_work_to_tag}}');
$this->dropIndex('ix_portfolio_links_work_to_tag_tag_id', '{{%portfolio_links_work_to_tag}}');
// удаление связей между таблицами портфолио и категориями
$this->dropForeignKey('fk_portfolio_links_work_to_category_work_id', '{{%portfolio_links_work_to_category}}');
$this->dropForeignKey('fk_portfolio_links_work_to_category_category_id', '{{%portfolio_links_work_to_category}}');
$this->dropIndex('ix_portfolio_links_work_to_category_work_id', '{{%portfolio_links_work_to_category}}', 'work_id');
$this->dropIndex('ix_portfolio_links_work_to_category_category_id', '{{%portfolio_links_work_to_category}}', 'category_id');
} | [
"public function remover() {\n $sql = \"delete from portfolio where portfolio_id = $this->portfolio_id\";\n $this->db->query(\"$sql\"); \n //$this->delete(\"portfolio\", \"portfolio_id = '$this->portfolio_id'\");\n }",
"public function delete()\n\t{\n\t\t// Remove all references to this Portfolio by Assignments\n\t\tforeach ($assignments = Model::factory('Assignment')\n\t\t\t->where('portfolio_id', $this->id())\n\t\t\t->find_many() as $assign)\n\t\t{\n\t\t\t$assign->portfolio_id = NULL;\n\t\t\t$assign->save();\n\t\t}\n\n\t\t// Remove all references to this Portfolio by Projects/sub-Portfolios/super-Portfolios\n\t\tforeach ($projects = Model::factory('PortfolioProjectMap')\n\t\t\t->where('port_id', $this->id())\n\t\t\t->find_many() as $proj)\n\t\t{\n\t\t\t$proj->delete();\n\t\t}\n\t\tforeach ($superPorts = Model::factory('PortfolioProjectMap')\n\t\t\t->where('child_id', $this->id())\n\t\t\t->find_many() as $port)\n\t\t{\n\t\t\t$port->delete();\n\t\t}\n\t\t\n\t\t// Remove all Groups' permissions on this Portfolio\n\t\t//\t(unfortunately, we cannot clean up Groups specifically made for this Portfolio easily,\n\t\t//\tthus they will remain and clutter the database.)\n\t\tforeach ($groups = $this->groupsWithPermission() as $group=>$permissions)\n\t\t{\n\t\t\tforeach ($permissions as $perm)\n\t\t\t{\n\t\t\t\tModel::factory('PortfolioAccessMap')\n\t\t\t\t\t->where('port_id', $this->id())\n\t\t\t\t\t->where('group_id', $group)\n\t\t\t\t\t->where('access_type', $perm)\n\t\t\t\t\t->find_one()\n\t\t\t\t\t->delete();\n\t\t\t}\n\t\t}\n\n\t\treturn parent::delete();\n\t}",
"public function removeAllRelatedPosts() {}",
"public function removeUnusedRelations(): void\n {\n $this->unusedRelationsRemover->run();\n }",
"public function dropRelatedArticles()\n {\n Yii::$app->getDb()->createCommand()->delete('{{%article_to_related_article}}', 'article_id = :article_id',\n [':article_id' => $this->id]\n )->execute();\n }",
"public function removeAllRelatedAlbums() {\n\t\t$this->relatedAlbums = new Tx_Extbase_Persistence_ObjectStorage();\n\t}",
"function removeRelation($pid){\n $queryArray = [\"DELETE FROM Prayer_Tags WHERE prayid = $pid\",\n \"DELETE FROM Prayer_Religions WHERE prayid = $pid\",\n \"DELETE FROM Comments WHERE prayid = $pid\",\n \"DELETE FROM Likes WHERE prayid = $pid\"];\n foreach($queryArray as $i) {\n $this->db->deleteQuery($i);\n }\n }",
"public function deleteRelatedData(){\n $modelManager = \\Phalcon\\Di::getDefault()->getShared('modelsManager');\n $relations = $modelManager->getRelations(get_class( $this ));\n foreach($relations as $relation)\n {\n if($relation->getType() == 2){ //only has many\n $referenceModel = $relation->getReferencedModel();\n $this->$referenceModel->delete();\n }\n }\n }",
"public function removeAllRelatedPosts() {\n\t\t$relatedPosts = clone $this->relatedPosts;\n\t\t$this->relatedPosts->removeAll($relatedPosts);\n\t}",
"protected function dropRelationPessoa()\n {\n $this->schema()->drop('pessoa');\n }",
"function remove_tag_relation(){\n\t\tglobal $db;\n\t\t$tagList = $this->delete_tag_array;\n\t\t$remCount = count($tagList);\n\t\t\n\t\t//do the loop and remove data\n\t\tfor($x = 0; $x < $remCount; $x++)\n\t\t\t{\n\t\t\t//get the id of this tag name\n\t\t\t$tag_id = $this->get_tagId_by_name($tagList[$x]);\n\t\t\t$sQl = \"delete from `cms_tbl_tag_relation` where tagId = '\".$tag_id.\"' && contentId = '\".$this->contentId.\"'\";\n\t\t\t$result = $db->query($sQl);\n\t\t\tif (!$result)\n\t\t\t\t{\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\treturn true;\n\t}",
"public function removeRelation($name)\n\t{\n\t\tunset($this->relations[$name]);\n\t}",
"public function removeReferences()\n\t{\n\t\t$this->loadSchemas();\n\t\t\n\t\tif (!empty($this->app_schema)) {\n\t\t\tforeach($this->app_schema as $bundle_name=>$models) {\n\t\t\t\tif (!empty($models)) {\n\t\t\t\t\tforeach($models as $model_name=>$model_data) {\n\t\t\t\t\t\tif (!empty($model_data)) {\n\t\t\t\t\t\t\tforeach($model_data as $property_name=>$property_data) {\n\t\t\t\t\t\t\t\tunset($this->app_schema[$bundle_name][$model_name][$property_name]['_ref']);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($property_name == '_params' && empty($this->app_schema[$bundle_name][$model_name][$property_name])) {\n\t\t\t\t\t\t\t\t\tunset($this->app_schema[$bundle_name][$model_name][$property_name]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\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\t\n\t\t\tforeach($this->app_schema as $bundle_name=>$models) {\n\t\t\t\t$schema_content = \\Sybil\\Yaml::dump($models,2,4);\n\t\t\t\t$schema_directory = $_SERVER['PWD'].'/bundle/'.$bundle_name.'/';\n\t\t\t\t$schema_file = $schema_directory.'schema.yml';\n\t\t\t\t\n\t\t\t\tif (file_exists($schema_file)) {\n\t\t\t\t\tfile_put_contents($schema_file, $schema_content);\n\t\t\t\t\tchmod($schema_file, 0777);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (file_exists($schema_directory.'_schema.yml')) {\n\t\t\t\t\tunlink($schema_directory.'_schema.yml');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\techo \"References have been removed from every schema.\\n\";\n\t}",
"public function deleteRelationWithYax() {\n $this->adservers()->detach(1);\n $sites = $this->sites;\n foreach ($sites as $site1) {\n $site = Site::find($site1->getId());\n if ($site->isValidated()) {\n //detach sitio - adserver 1\n $site->adservers()->detach(1);\n\n //-----------------------Espacios\n //traer section\n $sections = $site->sections;\n foreach ($sections as $section) {\n //eliminar section\n $section->delete();\n }\n }\n }\n }",
"function removeAllRelations(IEntity $entity, $relName);",
"abstract public function removeQuestionSetRelatedData();",
"function dz_jetpack_remove_relatedposts() {\n if ( class_exists( 'Jetpack_RelatedPosts' ) && is_singular( 'albums' ) ) {\n $jprp = Jetpack_RelatedPosts::init();\n $callback = array( $jprp, 'filter_add_target_to_dom' );\n remove_filter( 'the_content', $callback, 40 );\n }\n}",
"public function deleteById($portfolio_id);",
"function jetpackme_remove_rp() {\n\tif (class_exists('Jetpack_RelatedPosts')) {\n\t\t$jprp = Jetpack_RelatedPosts::init();\n\t\t$callback = array( $jprp, 'filter_add_target_to_dom' );\n\t\tremove_filter( 'the_content', $callback, 40 );\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/=================================================== MASTER ADMIN Approve or Block MORE Users ===================================================== | function approve_block_more_users($users_id, $users_type){
if( isset($_POST[$users_id]) ){
global $base;
user::users_manipulation($_POST[$users_id], $_POST[$users_type]);
redirect('../../master_admin.php');
}
} | [
"public function testUsersMustBeManuallyApprovedByAnAdmin() {\n\t\t$this->markTestIncomplete('Requires manual testing for now');\n\t}",
"public function bbclms_blockusers_admin_areas() {\n\t\t\tglobal $pagenow;\n\t\t\tif ( is_admin() ){\n\t\t\t\tif ( current_user_can( 'subscriber' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {\t\t\t\n\t\t\t\t\twp_redirect( home_url() );\n\t\t\t\t\texit;\n\t\t\t\t} elseif ( current_user_can( 'group_leader' ) && $pagenow == 'profile.php' ){\n\t\t\t\t\twp_redirect( home_url() );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t} \n\t\t}",
"function requireAdmin() {\r\n requireLogin();\r\n if(USER_PRIVILEGES != 2) {\r\n redirectToRoot();\r\n }\r\n}",
"function users_admin_deny()\n{\n if (!SecurityUtil::confirmAuthKey('Users')) {\n return LogUtil::registerAuthidError(pnModURL('Users', 'admin'));\n }\n\n // API call will check security\n\n $userid = FormUtil::getPassedValue('userid');\n $confirmed = FormUtil::getPassedValue('confirmed');\n\n if (isset($confirmed) && $confirmed) {\n $return = pnModAPIFunc('Users', 'admin', 'deny', array('userid' => $userid));\n\n if ($return == true) {\n LogUtil::registerStatus(__('Done! Deleted user account.'));\n } else {\n LogUtil::registerError(__('Error! Could not remove the pending application.'));\n }\n return pnRedirect(pnModUrl('Users', 'admin', 'main'));\n } else {\n // User hit the OK button (check mark) but did not check the confirmed box.\n return LogUtil::registerStatus(__('Cancelled! The confirmation check box was not checked, therefore the application was not denied.'),\n pnModUrl('Users', 'admin', 'viewapplications'));\n }\n}",
"private function grantAdminAccess()\n {\n if ($this->checkColumn(\"shopgate\", TABLE_ADMIN_ACCESS)) {\n // Create column shopgate in admin_access...\n xtc_db_query(\n \"alter table \" . TABLE_ADMIN_ACCESS\n . \" ADD shopgate INT( 1 ) NOT NULL\"\n );\n\n // ... grant access to to shopgate for main administrator\n xtc_db_query(\n \"update \" . TABLE_ADMIN_ACCESS\n . \" SET shopgate=1 where customers_id=1 LIMIT 1\"\n );\n\n if (!empty($_SESSION['customer_id'])\n && $_SESSION['customer_id'] != 1\n ) {\n // grant access also to current user\n xtc_db_query(\n \"update \" . TABLE_ADMIN_ACCESS\n . \" SET shopgate = 1 where customers_id='\"\n . $_SESSION['customer_id']\n . \"' LIMIT 1\"\n );\n }\n\n xtc_db_query(\n \"update \" . TABLE_ADMIN_ACCESS\n . \" SET shopgate = 5 where customers_id = 'groups'\"\n );\n }\n }",
"public function amLoggedInAsAdmin() {\n\t\t$this->loginAsAdmin();\n\t}",
"function block_admin_access() {\n global $pagenow, $current_user;\n\n // bail out if we are from WP Cli\n if ( defined( 'WP_CLI' ) ) {\n return;\n }\n\n $no_access = dokan_get_option( 'admin_access', 'dokan_general', 'on' );\n $valid_pages = array( 'admin-ajax.php', 'admin-post.php', 'async-upload.php', 'media-upload.php' );\n $user_role = reset( $current_user->roles );\n\n if ( ( $no_access == 'on' ) && ( !in_array( $pagenow, $valid_pages ) ) && in_array( $user_role, array( 'seller', 'customer' ) ) ) {\n wp_redirect( home_url() );\n exit;\n }\n }",
"private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }",
"public function check_admin_access()\n {\n return;\n $role = self::_get_role();\n if ('admin' !== $role) {\n PeepSo::redirect(get_home_url());\n }\n\n // if it's a \"peepso_\" user, redirect to the front page\n//\t\t$sRole = self::get_user_role();\n//\t\tif (substr($sRole, 0, 7) == 'peepso_') {\n//\t\t\tPeepSo::redirect(get_home_url());\n//\t\t\tdie;\n//\t\t}\n }",
"public function bulk_approve() {\n\n\t\tcheck_admin_referer( 'bulk-users' );\n\n\t\t$this->set_up_role_context();\n\t\t$this->do_approve();\n\t}",
"public function canEdit(){\t\t\n\t\t//if(Yii::app()->user->getState('access_lvl_id')=='4') return true;//superusers have super access\n\t\treturn ($this->reliever_approve===NULL and $this->sup_approve===NULL and $this->hr_approve===NULL);//exit();\t\t\n\t}",
"protected function ensureAdminRoleIfRequested() {}",
"private function admin_elect()\n {\n //Load and store parameters\n $target_id = (int)$this->Request->get('target_id');\n $this->responseSetParam('target_id', $target_id);\n\n //Elect target user as admin\n $UsersLib = new UsersLib($this->DB, $this->User);\n $UsersLib->elect_admin($target_id);\n }",
"function intervention_block_core_team_leads() {\n\n $role_core_team_lead = user_role_load_by_name('Core Team Lead');\n $role_pio = user_role_load_by_name('PIO');\n $role_webmaster = user_role_load_by_name('Webmaster');\n\n $ctl_users = intervention_get_users_in_role($role_core_team_lead);\n $pios_users = intervention_get_users_in_role($role_pio);\n $webmaster_users = intervention_get_users_in_role($role_webmaster);\n\n # exclude PIO and webmasters from being blocked:\n $users = array_diff($ctl_users, $pios_users, $webmaster_users);\n\n user_user_operations_block($users);\n\n}",
"public function testActivateActionCanBeAccessedAdmin()\n {\n $this->testUser->role = USER_ROLE_ADMINISTRATOR;\n $this->userDAO->save($this->testUser);\n\n $this->mockLogin($this->testUser);\n\n $this->dispatch('/user/activate/id/' . uniqid());\n $this->assertResponseStatusCode(403);\n $this->resetTestData();\n }",
"public function blockUser();",
"private function checkAdmin()\n\t{\t\n\t\t$adminOnly = property_exists($this, 'adminOnly') ? $this->adminOnly : false;\n\t\tif ($adminOnly) \n\t\t{\n\t\t\t$this->checkLogin(true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->checkPermission();\n\t\t}\n\t}",
"function approveDeclineUsers(){\n isLoggedInAndisAdmin();\n global $connection;\n // Decline Selected users\n if (isset($_GET['decline'])) {\n \n $user_id_decline = escapeString($_GET['decline']);\n\n $query = \"UPDATE users SET user_status = 'declined' WHERE user_id = {$user_id_decline}\";\n $decline_user = mysqli_query($connection, $query);\n // Check if the query is good\n querryCheck($decline_user);\n\n header(\"Location: users.php?userDeclinedResult=true\");\n }\n\n // Approve Selected users\n if (isset($_GET['approve'])) {\n global $connection;\n $user_id_approve = escapeString($_GET['approve']);\n\n $query = \"UPDATE users SET user_status = 'approved' WHERE user_id = {$user_id_approve}\";\n $approve_user = mysqli_query($connection, $query);\n // Check if the query is good\n querryCheck($approve_user);\n\n header(\"Location: users.php?userApprovedResult=true\");\n }\n\n }",
"private function allowModify()\n {\n if($this->controllerVar['loggedUserRole'] <= 40 )\n {\n return true;\n }\n else\n {\n return false;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls the ::lastInsertedId function on the connector. | private static function __callLastInsertedIdOnConnector()
{
return self::$connector->lastInsertedId();
} | [
"public static function getLastInsertedId();",
"public function getLastInsertedID()\r\n {\r\n }",
"public function getLastInsertId();",
"public static function getLastInsertedID()\n {\n }",
"public function lastInsertedId()\n {\n }",
"public function getLastInsertedId()\n {\n return $this->insert_id;\n }",
"public function lastInsertRowID(){}",
"public function getLastInsertId()\n {\n return $this->lastInsertId;\n }",
"public function insert_id()\r\n\t{\r\n\t\treturn $this->last_id;\r\n\t}",
"public function getInsertId();",
"public static function lastInsertId () {\n return self::$dbh->lastInsertId();\n }",
"public function fetchLastId();",
"public function getLastTransactionID()\r\n\t{\r\n\t\treturn $id = parent::getDbConnection()->insert_id ;\r\n\t}",
"public function testLastInsertId()\n {\n $data = array('name' => 'Zim');\n \n $result = $this->_adapter->insert($this->_table_name, $data);\n $this->assertEquals($result, 1);\n \n $actual = $this->_adapter->lastInsertId($this->_table_name, 'id');\n $expect = 1;\n $this->assertEquals($actual, $expect);\n }",
"public function getLastID() : int { return isset($this->db->insert_id) ? intval($this->db->insert_id) : -1; }",
"function DB_PDO_Insert_LastID()\n {\n $table=$this->SqlTableName();\n if (empty($table)) { return 0; }\n \n $table=$this->Sql_Table_Name_Qualify($table.'_ID_seq');\n return $this->DB_Link()->lastInsertId($table);\n }",
"public function getLastId()\r\n {\r\n return $this->adviceMapper->getLastId();\r\n }",
"public function insert_id() {\n\t\treturn DB::getConn($this->conn)->getGeneratedID(null);\n\t}",
"public function getLastId()\n {\n return $this->last_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
&47; A manual fee rate set in sat/byte that should be used when crafting the funding transaction. Generated from protobuf field int64 sat_per_byte = 7; | public function setSatPerByte($var)
{
GPBUtil::checkInt64($var);
$this->sat_per_byte = $var;
return $this;
} | [
"public function getFeerateSatPerByte()\n {\n return $this->feerate_sat_per_byte;\n }",
"public function setFeerateSatPerByte($var)\n {\n GPBUtil::checkInt64($var);\n $this->feerate_sat_per_byte = $var;\n\n return $this;\n }",
"public function getSatoshis() {\n return $this->satoshis_qty;\n }",
"public function getSat(){\n\t\t\treturn $this->sat;\n\t\t}",
"public function getFeePerKb()\n {\n return $this->fee_per_kb;\n }",
"public function getBonusFeeFixed()\n {\n $result = $this->scopeConfig->getValue('praxigento_downline/referral_bonus/fee_fixed', AScope::SCOPE_STORE);\n $result = filter_var($result, FILTER_VALIDATE_FLOAT);\n if ($result < 0) $result = 0;\n return $result;\n }",
"function mondayCoupleFee() {\r\n\t\tif ($this->mem_length == \"One Day\") {\r\n\t\t\t$this->prices['mem_fee'] = 0;\r\n\t\t\tif ($this->hr < 4) { //reflect sunday late night fee\r\n\t\t\t\t$this->prices['door_fee'] = 50;\r\n\t\t\t} else $this->prices['door_fee'] = 20;\r\n\t\t}\r\n\t\telseif ($this->mem_length == \"Three Months\") {\r\n\t\t\t$this->prices['door_fee'] = 50;\r\n\t\t\t$this->prices['mem_fee'] = 0;\t\t\t\r\n\t\t}\r\n\t\telseif ($this->mem_length == \"One Year\") {\r\n\t\t\t$this->prices['door_fee'] = 50;\r\n\t\t\t$this->prices['mem_fee'] = 0;\t\t\t\r\n\t\t}\r\n\t\telseif ($this->mem_length == \"One Year VIP\") {\r\n\t\t\t$this->prices['door_fee'] = 0;\r\n\t\t\t$this->prices['mem_fee'] = 0;\t\t\t\r\n\t\t}\r\n\t}",
"public function getMarketFeeRate(): float;",
"public function getTotalSatoshisReceived()\n {\n return $this->total_satoshis_received;\n }",
"function to_satoshi($bitcore)\n {\n return bcmul(to_fixed($bitcore, 8), 1e8);\n }",
"public function getSetupFee()\n {\n return $this->setupFee;\n }",
"function getBitRate(){\n\t\treturn round($this->bitRate,2);\n\t}",
"public function getFeeSettlementAmount()\n {\n return $this->feeSettlementAmount;\n }",
"public function getBitRate() {\n\t\treturn $this->getField( 'bit_rate' );\n\t}",
"public function computeSFixed64Size()\n {\n return 8;\n }",
"public function xrpbtcFee(): float\n {\n return (float) $this->data['xrpbtc_fee'];\n }",
"public function getMarketplaceFixedFee() \n {\n return $this->_fields['MarketplaceFixedFee']['FieldValue'];\n }",
"public function bitsPerDigit() { return $this->_m_bitsPerDigit; }",
"function to_bitcoin(int $satoshi): string\n {\n return bcdiv((string) $satoshi, (string) 1e8, 8);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dueInRange Return due on filter range | function getDueInRange() {
$from = $this->getAdditionalProperty('due_on_filter_from');
$to = $this->getAdditionalProperty('due_on_filter_to');
return $from && $to ? array(new DateValue($from), new DateValue($to)) : array(null, null);
} | [
"public function notInRange($attr, $from, $to);",
"public function whereBetween(){}",
"public function rangeFilter()\n {\n $this->assertSame($this->filterBuilder, $this->filterBuilder->inRange(1, 4));\n $rangeFilterDecorator = $this->filterBuilder->getDecoratedFilter();\n $this->assertInstanceOf('stubRangeFilterDecorator', $rangeFilterDecorator);\n $this->assertEquals(1, $rangeFilterDecorator->getMinValidator()->getValue());\n $this->assertEquals('VALUE_TOO_SMALL', $rangeFilterDecorator->getMinErrorId());\n $this->assertEquals(4, $rangeFilterDecorator->getMaxValidator()->getValue());\n $this->assertEquals('VALUE_TOO_GREAT', $rangeFilterDecorator->getMaxErrorId());\n $this->assertSame($this->mockFilter, $rangeFilterDecorator->getDecoratedFilter());\n }",
"public function getAbvRange();",
"function fn_filter_process_ranges($range_values, $filters, $selected_filters)\n{\n if (!empty($range_values)) {\n $fields = fn_get_product_filter_fields();\n\n foreach ($range_values as $filter_id => $values) {\n if (!empty($values)) {\n\n if (!empty($values['field_type'])) { // standard field\n $structure = $fields[$values['field_type']];\n if (!empty($structure['convert'])) {\n list($values['min'], $values['max']) = $structure['convert']($values['min'], $values['max']);\n }\n $values['extra'] = !empty($structure['extra']) ? $structure['extra'] : '';\n }\n\n // Counting min and max with more accuracy than required by round_to\n // Needs for check to disabling slider.\n $max = Math::floorToPrecision($values['max'], $filters[$filter_id]['round_to'] * 0.1);\n $min = Math::floorToPrecision($values['min'], $filters[$filter_id]['round_to'] * 0.1);\n\n $values['slider'] = true;\n $values['disable'] = round(abs($max - $min), 2) < $filters[$filter_id]['round_to'];\n $values['min'] = Math::floorToPrecision($values['min'], $filters[$filter_id]['round_to']);\n $values['max'] = Math::ceilToPrecision($values['max'], $filters[$filter_id]['round_to']);\n\n if (!empty($selected_filters[$filter_id])) {\n $slider_vals = $selected_filters[$filter_id];\n\n // convert to base values\n if (!empty($values['field_type']) && !empty($structure['convert'])) {\n list($slider_vals[0], $slider_vals[1]) = $structure['convert']($slider_vals[0], $slider_vals[1], $slider_vals[2]);\n }\n // zeke: TODO - do not convert twice\n // convert back to current values\n if (!empty($values['field_type']) && !empty($structure['convert'])) {\n list($slider_vals[0], $slider_vals[1]) = $structure['convert']($slider_vals[0], $slider_vals[1]);\n }\n\n $values['current_left'] = $values['left'] = $slider_vals[0];\n $values['current_right'] = $values['right'] = $slider_vals[1];\n\n if ($values['left'] < $values['min']) {\n $values['left'] = $values['min'];\n }\n if ($values['left'] > $values['max']) {\n $values['left'] = $values['max'];\n }\n if ($values['right'] > $values['max']) {\n $values['right'] = $values['max'];\n }\n if ($values['right'] < $values['min']) {\n $values['right'] = $values['min'];\n }\n if ($values['right'] < $values['left']) {\n $tmp = $values['right'];\n $values['right'] = $values['left'];\n $values['left'] = $tmp;\n }\n\n $values['left'] = Math::floorToPrecision($values['left'], $filters[$filter_id]['round_to']);\n $values['right'] = Math::ceilToPrecision($values['right'], $filters[$filter_id]['round_to']);\n }\n\n $range_values[$filter_id] = $values;\n }\n }\n }\n\n return $range_values;\n}",
"function data_range () {\n\t\t$range = array();\n\t\t\n\t\t$count = count($this->datapoints);\n\t\t\n\t\tfor ($i=1; $i < $count; $i++) {\n\t\t\t$x = $this->datapoints[$i] - $this->datapoints[$i-1];\n\n\t\t\t// Make range an unsigned number\n\t\t\tif ($x < 0) {\n\t\t\t\t$x = $x - ($x * 2);\n\t\t\t}\n\t\t\n\t\t\t$this->range[] = $x;\n\t\t}\n\t}",
"private function calculateRange()\n {\n $this->from = $this->pageNo * $this->perPageNo - $this->perPageNo;\n }",
"function convertRange($old_value,$old_min,$old_max,$new_min,$new_max,$round=2){\n\t$old_range = ($old_max - $old_min); \n\t$new_range = ($new_max - $new_min); \n\treturn round( (((($old_value - $old_min) * $new_range) / $old_range) + $new_min) ,2 );\n}",
"function ot_range( $start, $limit, $step = 1 ) {\n \n if ( $step < 0 )\n $step = 1;\n \n $range = range( $start, $limit, $step );\n \n foreach( $range as $k => $v ) {\n if ( strpos( $v, 'E' ) ) {\n $range[$k] = 0;\n }\n }\n \n return $range;\n}",
"public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}",
"function convertRange($old_value,$old_min,$old_max,$new_min,$new_max,$round=2){\n\t// print (\"$old_value,$old_min,$old_max,$new_min,$new_max,$round\");\n\t$old_range = ($old_max - $old_min);\n\t$new_range = ($new_max - $new_min);\n\t// print (\"$old_range,$new_range\");\n\tif ($old_range == 0 || $new_range == 0) return 0;\n\t$new_value = ((($old_value - $old_min) * $new_range) / $old_range) + $new_min;\n\treturn round( $new_value ,2 );\n}",
"function apply_filter_range2runs( $range, $logbook_in ) {\r\n\r\n\t/* Translate the range into a dictionary of runs. This is going to be\r\n\t * our filter. Run numbers will be the keys. And each key will have True\r\n\t * as the corresponding value.\r\n\t */ \r\n\t$runs2allow = array();\r\n\tforeach( explode( ',', $range ) as $subrange ) {\r\n\r\n\t\t/* Check if this is just a number or a subrange: <begin>-<end>\r\n\t\t */\r\n\t\t$pair = explode( '-', $subrange );\r\n\t\tswitch( count( $pair )) {\r\n\t\t\tcase 1:\r\n\t\t\t\t$runs2allow[$pair[0]] = True;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tif( $pair[0] >= $pair[1] )\r\n\t\t\t\t\tdie( \"illegal subrange: \".$pair[0].\"-\".$pair[1] );\r\n\t\t\t\tfor( $run = $pair[0]; $run <= $pair[1]; $run++ )\r\n\t\t\t\t\t$runs2allow[$run] = True;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tdie( 'illegal syntax of the runs range' );\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/* Apply the filter\r\n\t */\r\n\t$out = array();\r\n\tforeach( $logbook_in as $run ) {\r\n\t\t$runum = $run->num();\r\n\t\tif( array_key_exists( $runum, $runs2allow ))\r\n\t\t\tarray_push( $out, $run );\r\n\t}\r\n\r\n\treturn $out;\r\n}",
"function range() {\n $ranges = explode(',', $_GET[Q_RANGE]);\n $result = array();\n\n $nextYear = 1 + (int) date('Y');\n $nextYear2D = $nextYear % 100;\n $thisCentury = $nextYear - $nextYear2D;\n\n foreach ($ranges as $range) {\n $range = trim($range);\n preg_match('/([0-9]*)([^0-9]*)([0-9]*)/', $range, $matches);\n array_shift($matches);\n\n // If the number is empty, leave it empty - dont put it to 0\n // If the number is two-digit, assume it to be within the last century or next year\n if ($matches[0] === \"\") {\n $lower = \"\";\n } else if ($matches[0] < 100) {\n if ($matches[0] > $nextYear2D) {\n $lower = $thisCentury + $matches[0] - 100;\n\t} else {\n\t $lower = $thisCentury + $matches[0];\n\t}\n } else {\n $lower = $matches[0];\n }\n\n // If no separator to indicate a range of years was supplied,\n // the upper and lower boundaries are the same.\n //\n // Otherwise, again:\n // If the number is empty, leave it empty - dont put it to 0\n // If the number is two-digit, assume it to be within the last century or next year\n if ($matches[1] === \"\")\n $upper = $lower;\n else {\n if ($matches[2] === \"\") {\n $upper = \"\";\n } else if ($matches[2] < 100) {\n if ($matches[2] > $nextYear2D) {\n $upper = $thisCentury + $matches[2] - 100;\n\t } else {\n\t $upper = $thisCentury + $matches[2];\n }\n } else {\n $upper = $matches[2];\n }\n }\n\n $result[] = array($lower, $upper);\n }\n $this->query[Q_RANGE] = $result;\n }",
"public function testRangeFilterWithoutToField()\n {\n parent::testRangeFilterWithoutToField();\n }",
"private function _getRangeConditions($field_name, $min, $max, $max_value, $table_name='Rental')\n\t{\n\t\tif (intval($max) === $max_value)\n\t\t\t$max = 9999999;\n\n\t\t$conditions = array(\n\t\t\t$table_name . '.' . $field_name . ' >=' => $min,\n\t\t\t$table_name . '.' . $field_name . ' <=' => $max);\n\t\t\n\t\treturn $conditions;\n\t}",
"public function testRangeIntUnsigned() {\n $values = [4, 6, 10, 15, 18];\n $result = Stats::range($values);\n $expected = 14;\n ok($expected, $result);\n }",
"function apply_filter_range2runs ($range, $logbook_in) {\r\n\r\n $out = array() ;\r\n\r\n $min_runnum = null ;\r\n $max_runnum = null ;\r\n \r\n foreach ($logbook_in as $run) {\r\n $runum = $run->num() ;\r\n $min_runnum = $min_runnum ? min(array($min_runnum, $runum)) : $runum;\r\n $max_runnum = $max_runnum ? max(array($max_runnum, $runum)) : $runum;\r\n }\r\n \r\n /* Proceed to teh filter only if the input list of runs isn't empty */\r\n\r\n if ($min_runnum && $max_runnum) {\r\n\r\n /* Translate the range into a dictionary of runs. This is going to be\r\n * our filter. Run numbers will be the keys. And each key will have True\r\n * as the corresponding value. */ \r\n\r\n $runs2allow = array() ;\r\n foreach (explode(',', $range) as $subrange) {\r\n\r\n /* Check if this is just a number or a subrange: <begin>-<end>\r\n */\r\n $pair = explode('-', $subrange) ;\r\n switch (count($pair)) {\r\n case 1:\r\n $runs2allow[$pair[0]] = True;\r\n break;\r\n case 2:\r\n $begin_run = $min_runnum;\r\n if ($pair[0]) {\r\n $begin_run = intval($pair[0]) ;\r\n if (!$begin_run) throw new DataPortalexception(__METHOD__, \"illegal run '\".$pair[0].\"' subrange: '\".$subrange.\"'\") ;\r\n }\r\n $end_run = $max_runnum;\r\n if ($pair[1]) {\r\n $end_run = intval($pair[1]) ;\r\n if (!$end_run) throw new DataPortalexception(__METHOD__, \"illegal run '\".$pair[1].\"' subrange: '\".$subrange.\"'\") ;\r\n }\r\n if ($begin_run >= $end_run) throw new DataPortalexception(__METHOD__, \"illegal subrange: '\".$subrange.\"'\") ;\r\n if ($begin_run < $min_runnum) throw new DataPortalexception(__METHOD__, \"non-existing begin run in subrange: '\".$subrange.\"'\") ;\r\n if ($end_run > $max_runnum) throw new DataPortalexception(__METHOD__, \"non-existing end run in subrange: '\".$subrange.\"'\") ;\r\n\r\n for ($run = $begin_run; $run <= $end_run; $run++)\r\n $runs2allow[$run] = True;\r\n break;\r\n default:\r\n throw new DataPortalexception(\r\n __METHOD__, 'illegal syntax of the runs range') ;\r\n }\r\n }\r\n\r\n /* Apply the filter */\r\n\r\n foreach ($logbook_in as $run) {\r\n $runum = $run->num() ;\r\n if (array_key_exists($runum, $runs2allow))\r\n array_push($out, $run) ;\r\n }\r\n }\r\n return $out;\r\n }",
"protected function statusRange($int,$min,$max){\n return ($min<=$int && $int<=$max);\n }",
"public function getSearchRange() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns on (or off) automatic validation of updated data. | function autoValidUpdate($flag = true)
{
if ($flag) {
$this->_valid_update = true;
} else {
$this->_valid_update = false;
}
} | [
"private function disableValidation() {\n\t\t$this->globalConfiguration->setAsString('openImmoSchema', '');\n\t}",
"function validate_on_update() {}",
"public function setValid()\n {\n $this->valid = true;\n }",
"private function unvalidate() {\n\n\t\t$this->setAttr('validated', 0);\n\t}",
"public function validationReset()\n {\n if (($this->strValidationError) || ($this->strWarning)) {\n $this->blnModified = true;\n }\n $this->strValidationError = null;\n $this->strWarning = null;\n }",
"public function setAutoValidation($toggle)\n {\n switch ($toggle)\n {\n case TRUE:\n $this->autoValidation = TRUE;\n break;\n\n case FALSE:\n $this->autoValidation = FALSE;\n break;\n\n default:\n $this->autoValidation = FALSE;\n break;\n }\n }",
"function autoValidUpdate($flag = true)\n {\n foreach ($this->_table as $table_obj) {\n $table_obj->autoValidUpdate($flag);\n }\n }",
"public function beforeValidationOnUpdate()\n {\n }",
"public function deactivateValidation()\n {\n }",
"protected function beforeDataValidation(): void\n {\n }",
"public function setInvalid()\n {\n $this->valid = false;\n }",
"public function markAsValidated();",
"abstract protected function setUpdateValidationRules(): array;",
"protected function validate()\n {\n //Configuring validator\n $this->validator->setData($this->getFields());\n\n //Drop all validation errors set by user\n $this->validator->flushRegistered();\n }",
"public function validateOnUpdate()\n {\n \n }",
"public function __setupValidation() {\n\t}",
"protected function setValidity()\n {\n $this->isValid = $this->validator->passes();\n }",
"protected function checkValidationOnUpdate() {\n $this->_submittedValues = array_map('trim', $this->_val->getSubmitted());\n if (!empty($this->_required) && !empty($this->_submittedValues)) {\n $this->_sanitizedValues = array_map('trim', $this->_val->validateInput());\n $this->_errors = $this->_val->getErrors();\n }\n }",
"public static function setValidate() {\n self::setType('Validate');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A user can have many sequence | public function seq() {
return $this->hasMany('App\Models\Sequence');
} | [
"function setUserSequence($seq)\n{\n\t$arr_seq = array();\n\tif(isset($_SESSION['seq']))\n\t{\n\t\t$arr_seq = $_SESSION['seq'];\n\t}\n\t$arr_seq[] = $seq;\n\t$_SESSION['seq'] = $arr_seq;\n}",
"abstract public function sequence_list();",
"function createSequence($sequence) {\n\t\t$sql = \"CREATE SEQUENCE $sequence\";\n\t\treturn $this->execute($sql);\n\t}",
"private function generateSequenceNumber(){\n $invoices = $this->campaign->getInvoices();\n $count = 0;\n foreach ($invoices as $invoice){\n if ($invoice->user_validated){\n $count++;\n }\n }\n $this->sequence_number = $count+1;\n }",
"public function sequenceID();",
"public function requestSequenceId();",
"public function generatedSequencial()\n {\n if (is_null($this->sequencial)){\n $this->sequencial = 1;\n }\n $this->sequencial = $this->sequencial++;\n }",
"public function getSeqUsuario()\n {\n return $this->seq_usuario;\n }",
"function createSequence() {\n if (!isset($this->sequence) || ( empty($this->sequence) && !is_numeric($this->sequence)))\n return FALSE;\n if ((!isset($this->sequence['value']) || ( empty($this->sequence['value']) && !is_numeric($this->sequence['value']))) &&\n ( '0' != $this->sequence['value'] ))\n return ( $this->getConfig('allowEmpty')) ? $this->_createElement('SEQUENCE') : FALSE;\n $attributes = $this->_createParams($this->sequence['params']);\n return $this->_createElement('SEQUENCE', $attributes, $this->sequence['value']);\n }",
"function createSequence() {\r\n if( !isset( $this->sequence ) || ( empty( $this->sequence ) && !is_numeric( $this->sequence ))) return FALSE;\r\n if(( !isset($this->sequence['value'] ) || ( empty( $this->sequence['value'] ) && !is_numeric( $this->sequence['value'] ))) &&\r\n ( '0' != $this->sequence['value'] ))\r\n return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'SEQUENCE' ) : FALSE;\r\n $attributes = $this->_createParams( $this->sequence['params'] );\r\n return $this->_createElement( 'SEQUENCE', $attributes, $this->sequence['value'] );\r\n }",
"function createSequence( ) {\n $cnt = count( $this->sequence );\n if( 0 >= $cnt )\n return;\n $attributes = ( isset( $this->sequence['xparams'] )) ? $this->_createParams( $this->sequence['xparams'] ) : null;\n return $this->_createElement( 'SEQUENCE', $attributes, $this->sequence['value'] );\n }",
"public function createSequence($sequence)\n {\n $sql = \"CREATE SEQUENCE $sequence\";\n\n return $this->query($sql);\n }",
"public function setSequence($var)\n {\n GPBUtil::checkUint32($var);\n $this->sequence = $var;\n\n return $this;\n }",
"public function sequence_types()\n {\n return $this->hasMany('App\\SequenceType');\n }",
"function setSequence( $value=FALSE, $params=FALSE ) {\r\n if(( empty( $value ) && !is_numeric( $value )) && ( '0' != $value ))\r\n $value = ( isset( $this->sequence['value'] ) && ( -1 < $this->sequence['value'] )) ? $this->sequence['value'] + 1 : '0';\r\n $this->sequence = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));\r\n return TRUE;\r\n }",
"public function sequence_list()\n\t{\n\t\treturn <<<SQL\n\t\t\tSELECT \"RDB\\$GENERATOR_NAME\"\n\t\t\tFROM \"RDB\\$GENERATORS\"\n\t\t\tWHERE \"RDB\\$SYSTEM_FLAG\" = 0\nSQL;\n\t}",
"function setSeq($seq) {\n\t\t$this->_seq = $seq;\n\t}",
"public function lessonSequence() {\n return $this->hasMany('App\\LessonSequence');\n }",
"private function getSequence()\n {\n sys::import('modules.dynamicdata.class.objects.master');\n $this->seqObject = DataObjectMaster::getObjectList($this->seqInfo);\n $objectData = $this->seqObject->getItems(array(\n 'sort' => 'nextid',\n 'fieldlist' => array('id','nextid')\n ));\n // Make sure we have them in the right order (logically), i.e. sort on nextid\n $this->items = array_reverse($objectData);\n $this->seqObject = DataObjectMaster::getObject($this->seqInfo);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get possible conditions operators | public static function getConditionOperators()
{
include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
return array(
ilConditionHandler::OPERATOR_PASSED,
ilConditionHandler::OPERATOR_FAILED
);
} | [
"public static function getConditionOperators()\n\t{\n\t\tinclude_once './Services/AccessControl/classes/class.ilConditionHandler.php';\n\t\treturn array(\n\t\t\tilConditionHandler::OPERATOR_PASSED,\n\t\t\tilConditionHandler::OPERATOR_FAILED,\n\t\t\tilConditionHandler::OPERATOR_FINISHED,\n\t\t\tilConditionHandler::OPERATOR_NOT_FINISHED\n\t\t);\n\t}",
"public function getConditionOperator();",
"public function get_operators() {\n\t\t$wpc_condition = wpc_get_condition( $this->condition );\n\t\treturn apply_filters( 'wapl_operators', $wpc_condition->get_available_operators() );\n\t}",
"private function _get_logical_operator()\r\n\t{\r\n\t\t$lo = \"or\";\r\n\t\tif ( isset($_GET['lo']) AND !is_array($_GET['lo']) AND strtolower($_GET['lo']) == \"and\" )\r\n\t\t{\r\n\t\t\t$lo = \"and\";\r\n\t\t}\r\n\t\treturn $lo;\r\n\t}",
"function webform_conditional_operators() {\n static $operators;\n\n if (!isset($operators)) {\n $operators = module_invoke_all('webform_conditional_operator_info');\n drupal_alter('webform_conditional_operators', $operators);\n }\n\n return $operators;\n}",
"public function get_filter_operators() {\n\t\t$operators = $this->type == 'product' ? array( 'is' ) : array( 'is', 'isnot', '>', '<' );\n\n\t\treturn $operators;\n\t}",
"public function getOperators();",
"protected function allowedLogicalOperators(): array\n {\n return [\n FieldCriteria::AND,\n FieldCriteria::OR,\n ];\n }",
"private function getAllowedOperators()\n {\n return [\n EntityMap::TYPE_STRING => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n self::OPERATOR_IN,\n self::OPERATOR_NOT_IN,\n self::OPERATOR_LIKE,\n self::OPERATOR_NOT_LIKE,\n ],\n EntityMap::TYPE_INTEGER => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n self::OPERATOR_IN,\n self::OPERATOR_NOT_IN,\n self::OPERATOR_GT,\n self::OPERATOR_GTE,\n self::OPERATOR_LT,\n self::OPERATOR_LTE,\n self::OPERATOR_BTW,\n ],\n EntityMap::TYPE_DOUBLE => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n self::OPERATOR_IN,\n self::OPERATOR_NOT_IN,\n self::OPERATOR_GT,\n self::OPERATOR_GTE,\n self::OPERATOR_LT,\n self::OPERATOR_LTE,\n self::OPERATOR_BTW,\n ],\n EntityMap::TYPE_BOOLEAN => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_NULL,\n self::OPERATOR_IS_NOT_NULL,\n ],\n EntityMap::TYPE_ARRAY => [\n self::OPERATOR_EQ,\n self::OPERATOR_NEQ,\n self::OPERATOR_IS_EMPTY,\n self::OPERATOR_IS_NOT_EMPTY,\n self::OPERATOR_HAS,\n self::OPERATOR_NOT_HAS,\n ],\n ];\n }",
"Public Function getOperator();",
"public static function getChoiceOperators()\n {\n return array(\n self::CHOICE_AND,\n self::CHOICE_OR,\n self::CHOICE_NAND,\n );\n }",
"public function getOperators() {\n\t\treturn array_filter( parent::getOperators(), function ( $operator ) {\n\t\t\treturn in_array( $operator, [ '!=', '==' ] );\n\t\t}, ARRAY_FILTER_USE_KEY );\n\t}",
"public static function getConnectiveOperators()\n {\n return array(\n static::CONNECTIVE_AND,\n static::CONNECTIVE_AND_NOT,\n static::CONNECTIVE_OR,\n static::CONNECTIVE_OR_NOT\n );\n }",
"public function availableOperators()\n {\n return array('me', 'group', 'groups', 'in', 'ins');\n }",
"public function getOperator();",
"private function getQueryOperators()\n {\n return [\n '_not' => '!=',\n '_gt' => '>',\n '_lt' => '<',\n '_gte' => '>=',\n '_lte' => '<=',\n '_like' => 'LIKE',\n '_in' => true,\n '_notIn' => true,\n '_isNull' => true,\n '_isNotNull' => true\n ];\n }",
"protected function mapConditionOperator($operator) {\r\n // $specials does not use drupal_static as its value never changes.\r\n static $specials = array(\r\n 'BETWEEN' => array('delimiter' => ' AND '),\r\n 'IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'),\r\n 'NOT IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'),\r\n 'EXISTS' => array('prefix' => ' (', 'postfix' => ')'),\r\n 'NOT EXISTS' => array('prefix' => ' (', 'postfix' => ')'),\r\n 'IS NULL' => array('use_value' => FALSE),\r\n 'IS NOT NULL' => array('use_value' => FALSE),\r\n // Use backslash for escaping wildcard characters.\r\n 'LIKE' => array('postfix' => \" ESCAPE '\\\\\\\\'\"),\r\n 'NOT LIKE' => array('postfix' => \" ESCAPE '\\\\\\\\'\"),\r\n // These ones are here for performance reasons.\r\n '=' => array(),\r\n '<' => array(),\r\n '>' => array(),\r\n '>=' => array(),\r\n '<=' => array(),\r\n );\r\n if (isset($specials[$operator])) {\r\n $return = $specials[$operator];\r\n }\r\n else {\r\n // We need to upper case because PHP index matches are case sensitive but\r\n // do not need the more expensive drupal_strtoupper because SQL statements are ASCII.\r\n $operator = strtoupper($operator);\r\n $return = isset($specials[$operator]) ? $specials[$operator] : array();\r\n }\r\n \r\n $return += array('operator' => $operator);\r\n \r\n return $return;\r\n }",
"public function getLogicalOperator()\n {\n return $this->logicalOperator == \"or\" ? \"||\" : \"&&\";\n }",
"abstract protected function getOperator();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate REQUEST_URI in case we got a redirect from a server script. May needed with some servers | function validate_uri(&$seo_url) {
global $g_relpath;
$request_uri = explode('?', $_SERVER['REQUEST_URI']);
$self = basename($_SERVER['PHP_SELF']);
$self_count = strlen($self);
if( is_array($request_uri) && isset($request_uri[1]) && strlen($request_uri[0]) > $self_count && $self == substr($request_uri[0], -$self_count, $self_count) ) {
$this->params_array = explode('&', $request_uri[1]);
if( is_array($this->params_array) ) {
$seo_url = $_SERVER['REQUEST_URI'] = $this->params_array[0];
unset($this->params_array[0]);
$query_string = implode('&',$this->params_array);
if( $query_string != '' ) {
$seo_url .= '?' . $query_string;
$_SERVER['REQUEST_URI'] = $seo_url;
}
// Rectify seo url
$seo_url = $g_relpath . $_SERVER['REQUEST_URI'];
}
}
} | [
"private function checkURL() {\n\t\t$url = $_SERVER['PHP_SELF'];\n\t\t$url .= !empty($_SERVER['QUERY_STRING'])? \"?{$_SERVER['QUERY_STRING']}\" : '';\n\t\t$from = $_SERVER['REMOTE_ADDR'];\n\t\tif (preg_match('/^\\/(index\\.php)(\\?.*)?$/', $url) === 0) {\n\t\t\tlog_entry(\"REQUEST FILTERED: $url from $from\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tlog_entry(\"REQUEST: $url from $from\");\n\t\t\treturn true;\n\t\t}\n\t}",
"function check_redirect(){\n\t\t$this->need_redirect = false; \n\t\t$this->path_info = ltrim(getenv('PATH_INFO'), '/');\n\t\t$this->uri = ltrim( $_SERVER['REQUEST_URI'], '/' );\n\t\t$this->real_uri = ltrim( $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'], '/' );\n\t\t$this->uri_parsed = strlen($this->path_info) > 0\n\t\t\t\t\t\t\t\t?\tparse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($this->path_info) )\n\t\t\t\t\t\t\t\t:\tparse_url(basename($_SERVER['REQUEST_URI']));\t\t\t\n\t\t$this->need_redirect(); \n\t\t$this->check_seo_page(); \t\t\n\t\tif ( $this->need_redirect && $this->is_seopage && $this->attributes['USE_SEO_REDIRECT'] == 'true') $this->do_redirect();\t\t\t\n\t}",
"function wp_http_validate_url($url)\n{\n}",
"private function checkURL(){\n if(strpos(\"$_SERVER[REQUEST_URI]\", \"?register\")){\n return true;\n }\n else return false;\n }",
"public function validateRedirectUri($redirectUri);",
"function pn_checkReferrer() {\n global $fullServerURL;\n \n if( !isset($_SERVER['HTTP_REFERER']) ||\n strpos($_SERVER['HTTP_REFERER'], $fullServerURL) !== 0 ) {\n \n die( \"Bad referrer header\" );\n }\n }",
"public function checkReferer();",
"private static function checkRequest() {\n\t\t// Copyright (c) Drupal\n\t\tif (!isset($_SERVER['HTTP_REFERER'])) {\n \t\t$_SERVER['HTTP_REFERER'] = '';\n \t\t}\n \t\tif (!isset($_SERVER['SERVER_PROTOCOL']) || ($_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.0' && $_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.1')) {\n \t\t$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';\n \t\t}\n \t\tif (isset($_SERVER['HTTP_HOST'])) {\n \t\t// As HTTP_HOST is user input, ensure it only contains characters allowed\n \t\t// in hostnames. See RFC 952 (and RFC 2181).\n \t\t// $_SERVER['HTTP_HOST'] is lowercased here per specifications.\n \t\t\t$_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);\n \t\tif (!preg_match('/^\\[?(?:[a-zA-Z0-9-:\\]_]+\\.?)+$/', $_SERVER['HTTP_HOST'])) {\n \t\t\t// HTTP_HOST is invalid, e.g. if containing slashes it may be an attack.\n \t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');\n \t \t\texit;\n \t\t}\n \t\t} else {\n\t\t\t// Some pre-HTTP/1.1 clients will not send a Host header. Ensure the key is\n \t\t\t// defined for E_ALL compliance.\n \t\t$_SERVER['HTTP_HOST'] = '';\n \t\t}\n \t\t\n\t}",
"public static function cleanRequestURI()\n {\n// This will remove the parameter from the first position in the query string\n// and leave an URI like \"index.php&name=value\", which is invalid\n //$csrfUrlModifierPattern = '#(?:\\&(?:amp\\;)?|\\?)?'.self::$formkey.'\\=[a-zA-Z0-9_]+#';\n// Better cut the parameter plus trailing ampersand, if any.\n $csrfUrlModifierPattern = '/'.self::$formkey.'\\=[a-zA-Z0-9_]+\\&?/';\n// This will leave the URI valid, even if it's the last parameter;\n// a trailing question mark or ampersand does no harm.\n !empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] = preg_replace($csrfUrlModifierPattern, '', $_SERVER['QUERY_STRING']) : false;\n !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] = preg_replace($csrfUrlModifierPattern, '', $_SERVER['REQUEST_URI']) : false;\n !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] = preg_replace($csrfUrlModifierPattern, '', $_SERVER['HTTP_REFERER']) : false;\n !empty($_SERVER['argv']) ? $_SERVER['argv'] = preg_grep($csrfUrlModifierPattern, $_SERVER['argv'], PREG_GREP_INVERT) : false;\n }",
"function validateUrl()\n\t{\n\t\n\t\tif(isset($_REQUEST[\"includedir\"]))\n\t\t{\n\t\t\techo \"Wrong Url\";\n\t\t\texit;\n\t\t}\n\n\t\t$qeryString = $_SERVER['QUERY_STRING'];\n\t\tif(strstr(strip_tags($qeryString), \"includedir\"))\n\t\t{\n\t\t\techo \"Wrong Url\";\n\t\t\texit;\n\t\t}\n\n\t\tif( preg_match(\n\t\t'/^(http|https|ftp|script|SELECT|UNION|UPDATE|AND|exe|exec|INSERT|tmp):\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,6}'\n\t\t.'((:[0-9]{1,5})?\\/.*)?$/i' ,$qeryString))\n\t\t{\n\t\t\techo \"Wrong Url\";\n\t\t\texit;\n\t\t}\n\t\t\n\t\tforeach($_REQUEST as $key=>$value)\n\t\t{\n\t\t\tif(!is_array($value))\n\t\t\t{\n\t\t\t\t$_REQUEST[$key] = htmlentities(stripslashes(urldecode($value)), ENT_QUOTES);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($value as $k=>$v)\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($v))\n\t\t\t\t\t{\n\t\t\t\t\t$_REQUEST[$key][$k] = htmlentities(stripslashes(urldecode($v)), ENT_QUOTES);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}",
"abstract public function validateRedirectUri( $clientId, $redirectUri );",
"public function testBadUri()\n {\n $this->assertFalse($this->checker->isValid('/callback.php?valid=true&trans_id=001'));\n }",
"public function validateURL()\n {\n /* TODO: Implement */\n return true;\n }",
"function checkClientURI($redirect_uri, $client);",
"private function isValidUri(): bool\n {\n return true;\n }",
"protected static function _initCheckPath()\n\t{\n\t\t$req_uri = $_SERVER[\"REQUEST_URI\"];\n\t\t$host = $_SERVER['HTTP_HOST'];\t\n\t\n\t\tif(strpos($req_uri, \"index.php\") !== FALSE){\n\t\t\t$clean_str = str_replace('index.php','',$req_uri);\n\t\t\t$clean_str = str_replace('//','/',$clean_str);\n\t\t\t$new_location = 'http://'.$_SERVER['HTTP_HOST'].$clean_str;\n\t\t\t\t\n\t\t\tHeader(\"HTTP/1.1 301 Moved Permanently\");\n\t\t\tHeader(\"Location: $new_location\");\n\t\t\texit();\n\t\t}\n\t}",
"private function checkUrl() {\n if ($this->route !== strtolower($this->route)) {\n http_response_code(301);\n header('location: ' . strtolower($this->route));\n }\n }",
"function wp_validate_redirect($location, $fallback_url = '')\n {\n }",
"public function isAbsUri()\n {\n return isset($this->headers['REQUEST_URI']) ? preg_match('/^http/i', $this->headers['REQUEST_URI']) : false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Method name: get_user_profile_pic Desc: get user profile uploded photos Input: Request data Output: image if availabe array return param:ent_user_fbid; | protected function get_user_profile_pic($args) {
if ($args['ent_user_fbid'] == '')
return $this->_getStatusMessage(1, 200);
$entityId = $this->_getEntityId($args['ent_user_fbid']);
$getdetail = "select * from t_images where entity_id='".$entityId."'";
$getdetails = mysql_query($getdetail, $this->db->conn);
$likesArr = array();
if (mysql_num_rows($getdetails) > 0) {
$errMsgArr = $this->_getStatusMessage(65, 30);
while ($detail = mysql_fetch_assoc($getdetails)) {
$likesArr[] = array("image_id" => $detail['image_id'], "image_url" => $detail['image_url'], "index_id" => $detail['index_id']);
}
//$likesArr[] = array('id' => $qustionRow['que_id'], 'quetion' => $qustionRow['quetion'], 'option_a' => $qustionRow['option_a'], 'option_b' => $qustionRow['option_b'], 'option_c' => $qustionRow['option_c'], 'option_d' => $qustionRow['option_d'], 'your_ans' => $objtrueans, 'pref_a' => $prefa, 'pref_b' => $prefb, 'pref_c' => $prefc, 'pref_d' => $prefd); //, 'age' => $likeRow['age']
} else {
$errMsgArr = $this->_getStatusMessage(66, 31);
}
return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'Userphotos' => $likesArr);
} | [
"function _ses_cap_lite_get_profile_photo($capData = array(),$cap_field) {\n if (empty($cap_field) || !isset($capData[$cap_field]) || empty($capData['uid'])) return array();\n $sunet = $capData['uid'];\n $capDataItem = $capData[$cap_field];\n $file_array = array();\n if (!isset($capDataItem['bigger']['url'])) {\n $file_array = array();\n } else {\n $file_temp = @file_get_contents($capDataItem['bigger']['url']);\n if ($file_temp === false ) {\n watchdog('ses_cap_lite','Unable to retrieve photo for :'.$capDataItem['bigger']['url']);\n } else {\n $alt_str = 'Profile Image';\n if (!empty($capData['displayName'])) $alt_str .= ' for ' . $capData['displayName'];\n $file_temp = file_save_data($file_temp, 'public://profile_' . $sunet . '_bigger.jpg', FILE_EXISTS_REPLACE);\n $file_array = array(LANGUAGE_NONE => array(array('fid' => $file_temp->fid,\n 'filename' => $file_temp->filename,\n 'filemime' => $file_temp->filemime,\n 'uri' => $file_temp->uri, 'uid' => 1,\n 'status' => 1, 'display' => 1, 'alt' => $alt_str)));\n image_path_flush($file_temp->uri);\n }\n }\n return $file_array;\n}",
"public function getProfilePicture();",
"public function getUserProfilePicture(){\r\n $this->initDb();\r\n $un = \"\";\r\n $ui = $this->getUserId();\r\n require_once($_SERVER['DOCUMENT_ROOT'] . \"/biznavi/application/user/class/user.class.php\");\r\n $user = new user($ui);\r\n return $user->getProfilePicture();\r\n }",
"public function get_fb_my_images()\n {\n $token = User::where('id', Auth::user()->id)->first()->fb_user_token;\n $this->helper = $this->fb->getRedirectLoginHelper();\n if (isset($_GET['state'])) {\n $this->helper->getPersistentDataHandler()->set('state', $_GET['state']);\n }\n try {\n $profile_request = $this->fb->get('/me/photos/uploaded/?fields=link,picture&limit=500', $token);\n $profile = $profile_request->getGraphEdge()->asArray();\n return $profile;\n } catch (\\Facebook\\Exceptions\\FacebookResponseException $e) {\n // When Graph returns an error\n echo 'Graph returned an error: ' . $e->getMessage();\n session_destroy();\n // redirecting user back to app login page\n exit;\n } catch (\\Facebook\\Exceptions\\FacebookSDKException $e) {\n // When validation fails or other local issues\n echo 'Facebook SDK returned an error: ' . $e->getMessage();\n exit;\n }\n }",
"public function getProfilePhoto()\r\n\t{ \r\n\t\t$username = $this->user['username'];\r\n\t\t$get_prof_pic_query = mysqli_query($this->db, \"SELECT prof_pic FROM users WHERE username='$username';\");\r\n\t\t$row = mysqli_fetch_array($get_prof_pic_query);\r\n\t\treturn $row['prof_pic']; \r\n\t}",
"public function getProfilePic() {\r\n $username = $this->user['username'];\r\n $stmt = $this->con->prepare(\"SELECT profile_pic FROM users WHERE username= ?\"); //Gets profile pic of that username\r\n $stmt->bind_param(\"s\", $username);\r\n $stmt->execute();\r\n $query = $stmt->get_result();\r\n\r\n $row = mysqli_fetch_array($query); //Stores profilepic in variable row\r\n return $row['profile_pic']; //returns profile pic\r\n }",
"public function getProfileArray() {\n $array = [\n 'username' => $this->getUserName()\n ];\n\n $userData = $this->getUserData();\n if ($userData) {\n // Get image as data string\n $imageDataString = @file_get_contents($userData->profile_image_url_https);\n\n // Get image dimensions and mime type\n $imageData = getimagesizefromstring($imageDataString);\n\n // Build relevant array\n $array['picture'] = [\n 'width' => $imageData[0],\n 'height' => $imageData[0],\n 'src' => 'data:'. $imageData['mime'] .';base64,'. base64_encode($imageDataString)\n ];\n }\n\n return $array;\n }",
"function get_user_photo_details2($profileid_array2,$contact_status,$msg_type)\n{\n\tglobal $data;\n\t//$profileid_array2=array('100105','136580','100163','2','6','742','62','100105','100982');\n\t$profileid_array=array_unique($profileid_array2);\n\t$profileid_array=implode(\"','\",$profileid_array);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t$sql=\"select PROFILEID,HAVEPHOTO,PRIVACY,PHOTO_DISPLAY from JPROFILE WHERE activatedKey=1 and PROFILEID IN ('$profileid_array')\";\n\t$result=mysql_query_decide($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\twhile($myrow=mysql_fetch_array($result))\n\t{\n\t\t$profileid=$myrow[\"PROFILEID\"];\n\t\tunset($have_photo);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\tif($myrow[\"HAVEPHOTO\"]==\"U\")\n\t\t{\n\t\t\t$have_photo=\"1\";\n\t\t\t$havephoto='U';\n\t\t}\n\t\telseif($myrow[\"HAVEPHOTO\"]!=\"Y\")\n\t\t{\n\t\t\t$have_photo=\"1\";\n\t\t\t$havephoto='N';\n\t\t}\n\t\telse\n\t\t\t$havephoto='Y';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\tif($myrow[\"PHOTO_DISPLAY\"]==\"H\")\n\t\t{\n\t\t\t$have_photo=\"1\";\n\t\t\t//$havephoto='P';\n\t\t\t$havephoto='H';\n\t\t}\n\t\telseif(!$data && ($myrow[\"PRIVACY\"]==\"R\" || $myrow[\"PRIVACY\"]==\"F\" || $myrow[\"PHOTO_DISPLAY\"]==\"F\" || $myrow[\"PHOTO_DISPLAY\"]==\"C\"))\n\t\t{\n\t\t\t$have_photo=\"1\";\n\t\t\t$havephoto='L';\n\t\t}\n\t\telseif($myrow[\"PRIVACY\"]==\"F\")\n\t\t{\n\t\t\tif(check_privacy_filtered1($data[\"PROFILEID\"],$profileid))\n\t\t\t{\n\t\t\t\t$notfiltered=1;\n\t\t\t\t$have_photo=\"1\";\n\t\t\t\t//$havephoto='P';\n\t\t\t\t$havephoto='F';\n\t\t\t}\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\tif($have_photo=='')\n\t\t{\n\t\t\tif($myrow[\"PHOTO_DISPLAY\"]==\"C\")\n\t\t\t{\n\t\t\t\t$k=array_search($profileid,$profileid_array2);\n\t\t\t\t$my_contact=$contact_status[$k];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\tif($msg_type=='s')\n\t\t\t\t//sent items\n\t\t\t\t{\n\t\t\t\t\tif($my_contact=='I' || $my_contact=='D' || $my_contact=='RC')\n\t\t\t\t\t\t//$havephoto=\"P\";\n\t\t\t\t\t\t$havephoto=\"C\";\n\t\t\t\t}\n\t\t\t\t//inbox\n\t\t\t\telseif($msg_type=='i')\n\t\t\t\t{\n\t\t\t\t\tif($my_contact=='RD' || $my_contact=='C' || $my_contact=='RI')\n\t\t\t\t\t{\n\t\t\t\t\t\t//$havephoto=\"P\";\n\t\t\t\t\t\t$havephoto=\"C\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($myrow[\"PHOTO_DISPLAY\"]==\"F\")\n\t\t\t{\n\t\t\t\tif(!$notfiltered && check_privacy_filtered1($data[\"PROFILEID\"],$profileid))\n\t\t\t\t\t$havephoto='P';\n\t\t\t}\n\t\tunset($contacted1);\n\t\tunset($contacted2);\n\t\t}\n\t\t$havephoto_str1[$profileid]=$havephoto;\n\t}\n\t//lines for sorting in order it was given.\n\tfor($i=0;$i<count($profileid_array2);$i++)\n\t{\n\t\t$havephoto_str[]=$havephoto_str1[$profileid_array2[$i]];\n\t}\n\t//print_r($havephoto_str);\n\treturn $havephoto_str;\n}",
"public function getUserProfilePhotos(GetUserProfilePhotosRequest $request): UserProfilePhotos\n {\n return UserProfilePhotos::fromPayload($this->call($request)->getPayload());\n }",
"public function getProfileArray() {\n $array = [\n 'username' => $this->getPageName()\n ];\n\n // Get profile image data from API\n $pictureEndpointResult = @file_get_contents($this->getPagePictureApiEndpoint());\n if ($pictureEndpointResult) {\n // Get image dimensions and mime type\n $imageData = getimagesizefromstring($pictureEndpointResult);\n\n // Build relevant array\n $array['picture'] = [\n 'width' => $imageData[0],\n 'height' => $imageData[0],\n 'src' => 'data:'. $imageData['mime'] .';base64,'. base64_encode($pictureEndpointResult)\n ];\n }\n\n return $array;\n }",
"public function getProfilePictureFromSource()\n {\n\t\t$response = $this->curlRequest($this->platform->getApiUrl('get_profile_pic', ['username_val' => $this->username]), null, array('Authorization: OAuth '.$this->token));\n\t\t$decode_response = json_decode($response, true);\n\t\tif(isset($decode_response[\"user_logo\"]))\n\t\t{\n\t\t\t$this->profil_picture_url = 'https://edge.sf.hitbox.tv'.$decode_response[\"user_logo\"];\n\t\t}\t\n }",
"function fetch_profile_pic($iUserId, $sType, $sSize='small') {\n\n\t\t$aOutput['output'] = array('error'=>'', 'page'=>'', 'data'=>array());\n\t\t\n\t\tif (array_key_exists($sType, $this->aProfilePicUploadType)) {\n\t\t\t\n\t\t\tif($sPic = hasSetProfilePic($iUserId, $sType)) {\n\t\t\t\t$aOutput['output']['page'] = getImage('profile_pic', $sPic, $sSize);\n\t\t\t\t$aOutput['output']['data']['upload_type'] = 'url';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$aOutput['output'] = json_encode($aOutput['output']);\n\t\t$this->load->view('output', $aOutput);\n\t}",
"public function getProfilePicture() {\r\n\t\tif ($this->_profilePicture == null) {\r\n\t\t\tif (strlen($this->email)) {\r\n\t\t\t\t$this->_profilePicture = UsersDataService::getUserProfilePicture(WebSoccer::getInstance(), null, $this->email);\r\n\t\t\t} else {\r\n\t\t\t\t$this->_profilePicture = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $this->_profilePicture;\r\n\t}",
"public function getProfileImage($email){\n\t\t$getProfileImage = $this->conn->prepare(\"SELECT * from profilePictures WHERE userEmail = :email and isCurrent = :isCurrent\");\n\t\t$pictureID = -1;\n\t\ttry { \n\t \t$getProfileImage->execute(\n\t\t\tarray(\n\t\t\t\t\":email\" =>$email,\n\t\t\t\t\":isCurrent\" =>true\n\t\t\t));\n\t\t\t$result = $getProfileImage->fetch(PDO::FETCH_ASSOC);\n\t\t\t$pictureID = $result[\"pictureID\"];\n\n\t\t\t\t\n\t\t} catch (PDOException $e) {\n\t\t \techo ($e->getMessage() );\n\t\t} \n\n\t\t//now get the picture id --> get the actual picture data\n\t\tif($pictureID !=-1){\n\t\t\t$obj = $this->getPicture($pictureID);\n\n\t\t\tif (array_key_exists(\"pictureID\",$obj)) {\n\t\t\t\t//store values of profile image\n\t\t\t\t$_SESSION[\"pictureID\"] = $obj[\"pictureID\"];\n\t\t\t\t$_SESSION[\"name\"] = $obj[\"name\"];\n\t\t\t\t$_SESSION[\"caption\"] = $obj[\"caption\"];\n\t\t\t\t$_SESSION[\"likes\"] = $obj[\"likes\"];\n\t\t\t\techo \"Success: picture retrieved\";\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"Error: cannot get the picture\";\n\t\t}\n\n\t}",
"private function createProfilePicture(array $data)\n {\n $pictureUrl = $data[ self::PICTURE ];\n\n if (empty($pictureUrl))\n {\n $this->logger->debug(\"No profile picture set for the provider user\",\n array (\"provider\" => $this->getProviderName(), \"data\" => LogUtils::filterSensitiveData($data)));\n\n return null;\n }\n\n $this->logger->debug(\"Uploading the user profile picture\",\n array (\"provider\" => $this->getProviderName(), \"pictureUrl\" => $pictureUrl));\n\n // create a ProfilePicture with a file name\n $picture = new ProfilePicture();\n $name = sha1(uniqid($data[ self::EXTERNAL_ID ], true));\n $picture->setName(sprintf(\"%s.jpg\", $name));\n\n // uploading the picture in the users picture folder\n $fullPath = sprintf(\n \"%s/%s/%s\", realpath($this->uploadDirectoryPath), $picture->getUploadDir(), $picture->getName());\n $fileBytes = file_put_contents($fullPath, fopen($pictureUrl, \"r\"));\n\n if ($fileBytes)\n {\n $this->logger->debug(\"Uploaded $fileBytes bytes of the file '$fullPath'\");\n\n return $picture;\n }\n\n $this->logger->warning(\"Failed to upload the file '$fullPath'\");\n\n return null;\n }",
"public function getPhotosPerUser()\n\t{\n\t\t$dao = $this->dao->getDAO(\"Image\");\n\t\treturn $dao->findByUserId($_SESSION['oUserProfile']->getId());\n\t}",
"public function getUserPicture()\n {\n $userProfile = $this->getUserProfile();\n if (!empty($userProfile) && array_key_exists('picture', $userProfile)) {\n return $userProfile['picture'];\n }\n return null;\n }",
"public function getUserProfilePhotos( $userId , $offset = null , $limit = null ) {\n\n return DataTransformer::transform( $this->post( 'getUserProfilePhotos' , [\n 'user_id' => $userId,\n 'offset' => $offset,\n 'limit' => $limit\n ])->getResult() , UserProfilePhotos::class );\n\n }",
"function get_profile_pic( $id=null, $type=null ){\n\n if ( is_null( $type ) )\n $type = 'square';\n\n if ( is_null( $id ) ) {\n global $current_user;\n get_currentuserinfo();\n $id = $current_user->ID;\n $fb_id = get_user_meta( $id, 'fb_id', true );\n } else {\n $fb_id = $id;\n }\n return ( $fb_id ) ? '<img src=\"http://graph.facebook.com/'.$fb_id.'/picture?type='.$type.'\" />' : get_avatar( $id, 32 );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets view options from POST vars, if present | function get_from_post()
{
if (isset($_REQUEST['compperpage']))
$this->compperpage=$_REQUEST['compperpage'];
else if (isset($_SESSION['compperpage']))
$this->compperpage=$_SESSION['compperpage'];
else // set the default value
$this->compperpage=VIEWOPT_COMPPERPAGE_ALL;
if (isset($_REQUEST['browseby']))
$this->browseby=$_REQUEST['browseby'];
else if (isset($_SESSION['browseby']))
$this->browseby=$_SESSION['browseby'];
else // set the default value
$this->browseby=VIEWOPT_BROWSEBY_CATEGORY;
if (isset($_REQUEST['viewmode']))
$this->viewmode=$_REQUEST['viewmode'];
else if (isset($_SESSION['viewmode']))
$this->viewmode=$_SESSION['viewmode'];
else // set the default value
$this->viewmode=VIEWOPT_VIEWMODE_FULL;
assert($this->compperpage != "");
assert($this->viewmode != "");
assert($this->browseby != "");
/* FOR DEBUGGING ONLY !*/
echo "\n<!--\n";
var_dump($this->viewmode);
var_dump($this->browseby);
var_dump($this->compperpage);
echo "-->\n\n";
/**/
} | [
"public function getFormViewParams();",
"public function getViewOptions()\n {\n return $this->viewOptions;\n }",
"function tripal_views_views_pre_view(&$view, &$display_id, &$args) {\n $_GET = array_merge($_GET, $_POST);\n}",
"protected function _get_view_defaults() {\n\t\t$errors = get_transient( 'wds-settings-save-errors' );\n\t\t$errors = ! empty( $errors ) ? $errors : array();\n\t\t$service = Smartcrawl_Service::get( Smartcrawl_Service::SERVICE_SITE );\n\n\t\treturn array(\n\t\t\t'_view' => array(\n\t\t\t\t'slug' => $this->slug,\n\t\t\t\t'name' => $this->name,\n\t\t\t\t'option_name' => $this->option_name,\n\t\t\t\t'options' => $this->options,\n\t\t\t\t'action_url' => $this->action_url,\n\t\t\t\t'msg' => $this->msg,\n\t\t\t\t'errors' => $errors,\n\t\t\t\t'is_member' => $service->is_member(),\n\t\t\t),\n\t\t);\n\t}",
"private function set_view_props() {\n $this->view_form_name = ! empty($_POST) && array_key_exists('view_form_name', $_POST)\n ? $_POST['view_form_name']\n : '';\n\n $this->view_name = $this->view_form_name\n ? substr($this->view_form_name, 0, -5)\n : '';\n }",
"function readOptionsForm()\n{\n $options = setDefaultOptions(\"browser\", \"all\");\n foreach ($_POST as $key => $value) {\n $options[$key] = $value;\n }\n\n return $options;\n}",
"public function getViewParams()\r\n\t{\r\n\t\treturn $this->_viewParams;\r\n\t}",
"public function getParamsToView();",
"public function getOptions() \n\t{\n\t\t$options = $_REQUEST;\n\t\t\t\n\t\t// Remove proxy-specific parameters\n\t\tif (isset($options['classpath'])) {\n\t\t\tunset($options['classpath']);\n\t\t}\n\t\t\t\n\t\tif (isset($options['class'])) {\n\t\t\tunset($options['class']);\n\t\t}\n\t\t\t\n\t\tif (isset($options['method'])) {\n\t\t\tunset($options['method']);\n\t\t}\n\t\t\t\n\t\tif (isset($options['_redirectUrl'])) {\n\t\t\tunset($options['_redirectUrl']);\n\t\t}\n\t\t\t\n\t\tif (isset($options['isAuthenticated'])) {\n\t\t\tunset($options['isAuthenticated']);\n\t\t}\n\t\t\t\n\t\tif (isset($options['actionType'])) {\n\t\t\tunset($options['actionType']);\n\t\t}\n\t\n\t\tif (isset($options['endpointName'])) {\n\t\t\tunset($options['endpointName']);\n\t\t}\n\t\n\t\tif (isset($options['uid'])) {\n\t\t\tunset($options['uid']);\n\t\t}\n\t\n\t\tif (isset($options['slug'])) {\n\t\t\tunset($options['slug']);\n\t\t}\n\t\n\t\tif (isset($options['X-Endpoint-name'])) {\n\t\t\tunset($options['X-Endpoint-name']);\n\t\t}\n\t\t\n\t\treturn $options;\n\t}",
"protected function _get_view_parms()\n\t{\n\t\t$attributes = $this->_get_view_attributes();\n\t\t$id = trim(strval(Arr::get($attributes, 'id', '')));\n\t\t$name = trim(strval(Arr::get($attributes, 'name', '')));\n\t\tif ($name === '' AND $id !== '')\n\t\t{\n\t\t\t$attributes['name'] = $id;\n\t\t}\n\n\t\t$meta = $this->_meta;\n\t\treturn array\n\t\t(\n\t\t\t'after'\t\t\t=> Arr::get($meta, 'after', ''),\n\t\t\t'attributes'\t=> $attributes,\n\t\t\t'before'\t\t=> Arr::get($meta, 'before', ''),\n\t\t\t'html'\t\t\t=> Arr::get($meta, 'html', ''),\n\t\t);\n\t}",
"function ff_getViewParameters()\n{\n\treturn (isset($GLOBALS['ff_viewParameters'])\n\t\t? $GLOBALS['ff_viewParameters']\n\t\t: []\n\t);\n}",
"protected function _get_view_parms()\n\t{\n\t\t$attributes = $this->_get_view_attributes();\n\t\t$id = trim(strval(Arr::get($attributes, 'id', '')));\n\t\t$name = trim(strval(Arr::get($attributes, 'name', '')));\n\t\tif ($name === '' AND $id !== '')\n\t\t{\n\t\t\t$attributes['name'] = $id;\n\t\t}\n\n\t\t$meta = $this->_meta;\n\t\treturn array\n\t\t(\n\t\t\t'after'\t\t\t=> Arr::get($meta, 'after', ''),\n\t\t\t'attributes'\t=> $attributes,\n\t\t\t'before'\t\t=> Arr::get($meta, 'before', ''),\n\t\t);\n\t}",
"private function _selectView ()\n {\n $output = '<form action=\"\" method=\"post\" id=\"viewSelection\">\n\t\t\t\t\t<label for=\"view\">Select a view</label><select name=\"view\" id=\"view\">\n\t\t\t\t\t<option value=\"0\"';\n $output .= (isset($_POST['view']) && $_POST['view'] == \"0\") ? \"selected=\\\"selected\\\"\" : \"\";\n $output .= '>Horizontal</option>';\n $output .= '<option value=\"1\"';\n $output .= (isset($_POST['view']) && $_POST['view'] == \"1\") ? \"selected=\\\"selected\\\"\" : \"\";\n $output .= '>Vertical</option>';\n $output .= '</select> <input type=\"submit\" name=\"submit\" id=\"submit\" value=\"View Poll\" class=\"submit\" /></form>';\n return $output;\n }",
"private function get_view_variables()\n {\n }",
"public function getDefaultViewParams();",
"function dp_selected_view_types() {\n\t$selected_types = get_option('dp_view_types');\n\tif(empty($selected_types))\n\t\treturn array();\n\n\t$supported_types = dp_supported_view_types();\n\tforeach($selected_types as $key => $value)\n\t\t$selected_types[$key] = $supported_types[$key];\n\n\treturn apply_filters('dp_selected_view_types', $selected_types);\n}",
"protected function resolve_view_arguments() {\n\t\treturn array(\n\t\t\t'lang' => $this->get_lang(),\n\t\t\t'templates' => $this->get_templates(),\n\t\t\t'urls' => $this->get_urls(),\n\t\t);\n\t}",
"private static function _initViewData()\n {\n static::addViewData(\n [\n 'ajax_url' => UKMDesign::getAjaxUrl(),\n 'is_super_admin' => function_exists('is_super_admin') ? is_super_admin() : false,\n 'UKMDesign' => new UKMDesign(),\n 'singleMode' => ((isset($_POST['singleMode']) && 'true' == $_POST['singleMode']) || (isset($_GET['singleMode']) && 'true' == $_GET['singleMode'])),\n 'hideTopImage' => ((isset($_POST['hideTopImage']) && 'true' == $_POST['hideTopImage']) || (isset($_GET['hideTopImage']) && 'true' == $_GET['hideTopImage']))\n ]\n );\n }",
"protected function getOptions() {\n $this->params['options'] = empty($this->params['options']) ?\n array() : json_decode(htmlspecialchars_decode(\n $this->params['options']), TRUE);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an arbitrary client ID associated with the selected community | public function getCommunityClientId($communityId)
{
$result = $this->find('all')
->select(['id'])
->where(['Communities.id' => $communityId])
->contain([
'Clients' => function ($q) {
return $q
->autoFields(false)
->select(['id'])
->limit(1);
},
])
->enableHydration(false)
->first();
return $result ? $result['clients'][0]['id'] : null;
} | [
"public function getCommunityId();",
"public function getCommunityId()\n {\n return $this->community_id;\n }",
"public function get_client_id() {\n return $this->get_option( 'client-id', '' );\n }",
"public function getIdClient();",
"public function get_id_client()\n {\n return $this->_id_client;\n }",
"public function get_client_id()\n {\n return $this->client_id;\n }",
"public function getClientId()\n {\n return $this->prongEntity->client_id;\n }",
"public function getClient_id()\n {\n return $this->client_id;\n }",
"public function getIdClient()\n {\n return $this->idClient;\n }",
"public function getClientID()\n {\n return $this->clientid;\n }",
"public function getClientIdentifier()\n {\n return $this->clientIdentifier;\n }",
"private function getClientID()\n\t{\n\t\t$this->EE->db->select('ig_client_id');\n\t\t$this->EE->db->where('ig_site_id', $this->_currentSite);\n\t\t$this->EE->db->limit(1);\n\t\t$query = $this->EE->db->get('ig_picpuller_credentials');\n\n\t\tforeach ($query->result() as $row)\n\t\t{\n\t\t\t$ig_client_id = $row->ig_client_id;\n\t\t}\n\t\tif (isset($ig_client_id))\n\t\t{\n\t\t\treturn $ig_client_id;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function getIdClient() {\r\n return $this->idClient;\r\n }",
"function get_client_id() {\n\tif (isset($_COOKIE['gacid'])) {\n\t\t$cid = $_COOKIE['gacid'];\n\t} else {\n\t\t$cid = gen_client_id();\n\t}\n\n\treturn $cid;\n}",
"public static function getClientId()\r\n\t{\r\n\t\tif (!self::isAuthenticated())\r\n\t\t\treturn null;\r\n\t\treturn $_SESSION['rpc_client_id'];\r\n\t}",
"public function getClient_id()\n {\n return $this->client_id;\n }",
"public function getClientID()\n\t{\n\t\treturn strtr($this->getUniqueID(),self::ID_SEPARATOR,self::CLIENT_ID_SEPARATOR);\n\t}",
"public function getClientID()\n {\n return $this->clientID;\n }",
"private function getClientIdentifier()\n {\n $clientIdentifier = $this->storage->get('clientIdentifier', false);\n\n if (!$clientIdentifier) {\n $clientIdentifier = uniqid('PHPMyPlex_');\n $this->storage->set('clientIdentifier', $clientIdentifier);\n }\n\n return $clientIdentifier;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test submit link creation | function testSubmitLinkCreation() {
$SUT = new Grid_Link('submit');
$SUT->text('someText');
$link = $SUT->__tostring();
$expected = form::submit('submit', 'someText');
$this->assertEquals($expected, $link);
} | [
"public function testCreateAchBankLinkUsingPost()\n {\n }",
"public function testCreateBankLinkUsingPost()\n {\n }",
"public function testBuildUserSubmission() {\n $route_match = $this->getMockRouteMatch('entity.webform.user.submissions', [\n ['webform', $this->webform],\n ]);\n $links = [\n Link::createFromRoute($this->webform->label(), 'entity.webform.canonical', ['webform' => $this->webform->id()]),\n ];\n $this->assertLinks($route_match, $links);\n }",
"public function testNewAutheticatedSubmit() {\n $client = static::createClient();\n $crawler = $client->request('GET', '/blog/new', array(), array(), SecurityControllerTest::$auth);\n\n $buttonCrawlerNode = $crawler->selectButton('blog_entry_submit');\n $form = $buttonCrawlerNode->form(\n array(\n 'blog_entry[_token]' => $crawler->filter('form #blog_entry__token')->attr('value'),\n 'blog_entry[title]' => 'Title provided by test class',\n 'blog_entry[body]' => 'Body provided by test class',\n 'blog_entry[submit]' => ''\n )\n );\n $client->submit($form);\n\n $response = $client->getResponse();\n $this->assertTrue($response->isRedirect(), Messages::REDIRECT);\n $this->assertEquals(302, $response->getStatusCode(), Messages::STATUS_CODE);\n $client->followRedirect();\n $crawler = $client->getCrawler();\n $this->assertTrue($crawler->filter('html:contains(\"Ihr Blogeintrag wurde erfolgreich gespeichert\")')->count() > 0, Messages::FLASH_MESSAGE);\n }",
"function testButtonLinkCreation() {\r\n $SUT = new Grid_Link('button');\r\n $SUT->action('controller/method')->text('someText');\r\n $link = $SUT->render();\r\n $expected = html::anchor('controller/method', '<button type=\"button\">someText</button>');\r\n $this->assertEquals($expected, $link);\r\n }",
"public function testCreation()\n {\n // Do not expect creation\n list($publicURL) = $this->linkHelper->create(\n \"\",\n \"this a content\",\n [\"google_captcha\" => [true]],\n false\n );\n\n // Component google_captca is assumed to be still here\n $local = 'css=ul#link-components-chosen li[data-related-field=\"google_captcha\"]';\n $this->domChecker->assertElementPresent($local);\n \n list($publicURL) = $this->linkHelper->create(\n \"this is a title\",\n \"this a content\",\n [\"google_captcha\" => [false],\n \"death_time\" => ['7'] ],\n true\n );\n\n $this->url($publicURL);\n $this->waitForPageToLoad(10000);\n // Make sure google captcha script is loaded\n sleep(1);\n // ### Check a google captcha is displayed on the link view\n $this->domChecker->assertTextNotPresent(\"Google captcha\");\n $this->domChecker->clickOnElementMatching(\"css=button#load-link-captcha\");\n $this->domChecker->waitUntilElementPresent(\"css=div.alert-danger\");\n }",
"public function testSignupFormLinkMethod() {\n $document = $this->createDocument(TRUE, TRUE, [\n 'new_users' => [\n 'require_method' => 'form_link',\n ],\n ]);\n $this->createDocumentVersion($document, TRUE);\n\n $this->drupalGet('user/register');\n $this->assertFieldByName('legal_' . $document->id(), NULL, 'Agree checkbox found');\n\n /** @var \\Drupal\\Core\\Url $document_url */\n $document_url = $document->toUrl();\n $document_path = $document_url->toString();\n\n $this->assertLinkByHref($document_path, 0, 'Link to document found');\n\n // Ensure the field extra field is available for re-ordering.\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/config/people/accounts/form-display');\n $this->assertText('legal_' . $document->id());\n }",
"public function testSubmission()\n {\n }",
"public function testCreateWireBankLinkUsingPost()\n {\n }",
"public function testLinkIsCreated(): void\n {\n $data = ['location' => 'https://www.example.com/'];\n\n $this->post('/', $data)->assertRedirect();\n\n $this->assertDatabaseHas('links', [\n 'location' => 'https://www.example.com/',\n ]);\n }",
"public function testAttachCreateMethodSubmit(): void\n {\n // setup\n $_POST['title'] = 'new title';\n list ($applicationActions, $application) = $this->getObjects();\n\n // test body\n $applicationActions->attachCreateRecord($application, []);\n\n $application->test_entityCreateRecord('/create/');\n\n // assertions\n $this->assertTrue(Layer::$redirectWasPerformed);\n }",
"public function formAction(string $submit_url);",
"function testTextLinkCreation() {\r\n $SUT = new Grid_Link;\r\n $SUT->action('controller/method')->text('someText');\r\n $link = $SUT->render();\r\n $expected = html::anchor('controller/method', 'someText');\r\n $this->assertEquals($expected, $link);\r\n }",
"public function test_postPrototypeLinkLikes() {\n\n }",
"public function testSubmit()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function submitlinks($URI, $formvars = \"\", $formfiles = \"\")\n {\n }",
"public function testInsertUrlUsingPOST()\n {\n }",
"public function testGetPostActionUrl()\n {\n $value = '*/account/createPost';\n $this->urlBuilder->expects($this->any())->method('getUrl')->willReturn($value);\n $this->assertEquals($value, $this->create->getPostActionUrl());\n }",
"public function test_display_shortlink_if_link_exists()\n {\n $formData = [\n 'link' => 'http://testdomain.com',\n ];\n\n $this->post(route('shortlink.create'), $formData)->assertStatus(200);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Closes the current select field. Called by | private function SelectClose( $tag )
{
$this->appendHTML( " </select>" );
$this->appendBreak( $tag );
} | [
"abstract public function closeFieldset();",
"public function close()\n\t{\n\t\t$this->labels = [];\n\n\t\t$this->model = null;\n\n\t\treturn '</form>';\n\t}",
"public function selectEnd() {\r\n return '</select>';\r\n }",
"function form_for_close()\n {\n return Form::close();\n }",
"public function closeForm();",
"public function closeForm()\n {\n $this->isOpen = false;\n }",
"public static function renderOptionGroupClose(){\n\t\tself::out(\n\t\t\tself::closeTag('optgroup')\n\t\t);\n\t}",
"public function close() {\n $val = $this->val();\n foreach( $this->close_handlers as $handler ) {\n $handler( $val );\n }\n }",
"public function alert_Close()\n {\n $this->Form->removeControl($this->ControlId);\n }",
"static public function close()\n {\n return '</form>';\n }",
"public function close() {\n\t\t\n\t\t// Render close tag\n\t\t\n\t\t$this->_post_render();\n\t\t\n\t\techo true === $this->options['render_tag'] ? $this->_render_tag( true ) : '';\n\t\t\n\t\techo $this->options['after'];\n\t\t\n\t}",
"function close() {\n\t\t\t$this->obj->close();\n\t\t}",
"public static function closeFieldset()\r\n {\r\n return self::closeTag('fieldset');\r\n }",
"public function closeControl()\n\t{\n\t\tif (VersionListener::isJoomla25())\n\t\t{\n\t\t\t// 2.5\n\t\t\treturn '</td></tr>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// 3.x\n\t\t\treturn '</div></div>';\n\t\t}\n\t}",
"public function facetsClose()\n {\n return $this->close();\n }",
"public function closeForm() {\n\t\t$this->html .= \"<div><input type='submit' value='{$this->value}'/></div>\" . PHP_EOL;\n\t\t$this->html .= \"</form>\" . PHP_EOL;\n\t}",
"public function closeForm()\n {\n return '</form>';\n }",
"public function resetSelectField();",
"public function closeOptionsDeclaration(): void\n {\n $this->optionsState = 'closed';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4.11.6 showAccountOrderAutomations showAccountOrderAutomations retrieves the list of order automation steps. These properties indicate if an order shall be automatically accepted, started, navigated to etc. or if the driver shall be asked to actively confirm the steps. These settings apply to all newly created orders within the WEBFLEET account. The settings of the order workflow control correspond to the settings you can make in the WEBFLEET user interface. | public function showAccountOrderAutomations():WebfleetResponse; | [
"public function showAccountOrderAutomations();",
"public function showAccountOrderStates();",
"function wc_get_account_orders_actions($order)\n {\n }",
"public static function order_settings()\n {\n $settings = array(\n 'order_setting' => array(\n 'title' => __( 'Order Management settings', 'checkoutcom-cards-settings' ),\n 'type' => 'title',\n 'description' => '',\n ),\n 'ckocom_order_authorised' => array(\n 'id' => 'ckocom_order_authorised',\n 'title' => __('Authorised Order Status', 'checkoutcom-cards-settings'),\n 'type' => 'select',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses(),\n 'default' => 'wc-on-hold',\n 'desc' => __('Select the status that should be used for orders with successful payment authorisation', 'checkoutcom-cards-settings'),\n ),\n 'ckocom_order_captured' => array(\n 'id' => 'ckocom_order_captured',\n 'title' => __('Captured Order Status', 'checkoutcom-cards-settings'),\n 'type' => 'select',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses(),\n 'default' => 'wc-processing',\n 'desc' => __('Select the status that should be used for orders with successful payment capture', 'checkoutcom-cards-settings'),\n ),\n 'ckocom_order_void' => array(\n 'id' => 'ckocom_order_void',\n 'title' => __('Void Order Status', 'checkoutcom-cards-settings'),\n 'type' => 'select',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses(),\n 'default' => 'wc-cancelled',\n 'desc' => __('Select the status that should be used for orders that have been voided', 'checkoutcom-cards-settings'),\n ),\n 'ckocom_order_flagged' => array(\n 'id' => 'ckocom_order_flagged',\n 'title' => __('Flagged Order Status', 'checkoutcom-cards-settings'),\n 'type' => 'select',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses(),\n 'default' => 'wc-flagged',\n 'desc' => __('Select the status that should be used for flagged orders', 'checkoutcom-cards-settings'),\n ),\n 'ckocom_order_refunded' => array(\n 'id' => 'ckocom_order_refunded',\n 'title' => __('Refunded Order Status', 'checkoutcom-cards-settings'),\n 'type' => 'select',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses(),\n 'default' => 'wc-refunded',\n 'desc' => __('Select the status that should be used for new orders with successful payment refund', 'checkoutcom-cards-settings'),\n ),\n );\n\n return apply_filters( 'wc_checkout_com_cards', $settings );\n }",
"private function SetupOrderManagementForm($order=array())\n\t\t{\n\t\t\t$GLOBLS['CurrentTab'] = 0;\n\n\t\t\tif($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t$postData = $_POST;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$postData = $order;\n\t\t\t}\n\n\t\t\t$orderFields = array(\n\t\t\t\t'OrderBillFirstName'\t=> 'ordbillfirstname',\n\t\t\t\t'OrderBillLastName'\t\t=> 'ordbilllastname',\n\t\t\t\t'OrderBillCompany'\t\t=> 'ordbillcompany',\n\t\t\t\t'OrderBillPhone'\t\t=> 'ordbillphone',\n\t\t\t\t'OrderBillStreet1'\t\t=> 'ordbillstreet1',\n\t\t\t\t'OrderBillStreet2'\t\t=> 'ordbillstreet2',\n\t\t\t\t'OrderBillSuburb'\t\t=> 'ordbillsuburb',\n\t\t\t\t'OrderBillZip'\t\t\t=> 'ordbillzip',\n\t\t\t\t'OrderShipFirstName'\t=> 'ordshipfirstname',\n\t\t\t\t'OrderShipLastName'\t\t=> 'ordshiplastname',\n\t\t\t\t'OrderShipCompany'\t\t=> 'ordshipcompany',\n\t\t\t\t'OrderShipPhone'\t\t=> 'ordshipphone',\n\t\t\t\t'OrderShipStreet1'\t\t=> 'ordshipstreet1',\n\t\t\t\t'OrderShipStreet2'\t\t=> 'ordshipstreet2',\n\t\t\t\t'OrderShipSuburb'\t\t=> 'ordshipsuburb',\n\t\t\t\t'OrderShipZip'\t\t\t=> 'ordshipzip',\n\t\t\t\t'CustomerEmail'\t\t\t=> 'custconemail',\n\t\t\t\t'CustomerPassword'\t\t=> 'custpassword',\n\t\t\t\t'CustomerPassword2'\t\t=> 'custpassword2',\n\t\t\t\t'CustomerStoreCredit'\t=> 'custstorecredit',\n\t\t\t\t'CustomerGroup'\t\t\t=> 'custgroupid',\n\t\t\t\t'CustomerType'\t\t\t=> 'customerType',\n\t\t\t\t'OrderComments'\t\t\t=> 'ordcustmessage',\n\t\t\t\t'OrderNotes'\t\t\t=> 'ordnotes',\n\t\t\t\t'OrderId'\t\t\t\t=> 'orderid',\n\t\t\t\t'OrderTrackingNo'\t\t=> 'ordtrackingno',\n\t\t\t\t'AnonymousEmail'\t\t=> 'anonymousemail',\n\t\t\t);\n\n\t\t\t$GLOBALS['HideSelectedCustomer'] = 'display: none';\n\t\t\t$GLOBALS['HideCustomerSearch'] = '';\n\t\t\t$GLOBALS['HideAddressSelects'] = 'display: none';\n\n\t\t\tif(isset($postData['ordcustid']) && $postData['ordcustid'] > 0) {\n\t\t\t\t$GLOBALS['CurrentTab'] = 1;\n\t\t\t\t$GLOBALS['CustomerType'] = 'existing';\n\t\t\t\t$query = \"\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM [|PREFIX|]customers WHERE customerid='\".(int)$postData['ordcustid'].\"'\n\t\t\t\t\";\n\t\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\t\t$existingCustomer = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t\t\t\tif($existingCustomer['customerid']) {\n\t\t\t\t\t$GLOBALS['HideSelectedCustomer'] = '';\n\t\t\t\t\t$GLOBALS['HideCustomerSearch'] = 'display: none';\n\t\t\t\t\t$GLOBALS['HideHistoryLink'] = 'display: none';\n\n\t\t\t\t\t$GLOBALS['CustomerId'] = $existingCustomer['customerid'];\n\t\t\t\t\t$GLOBALS['CustomerFirstName'] = isc_html_escape($existingCustomer['custconfirstname']);\n\t\t\t\t\t$GLOBALS['CustomerLastName'] = isc_html_escape($existingCustomer['custconlastname']);\n\n\t\t\t\t\t$GLOBALS['CustomerPhone'] = '';\n\t\t\t\t\tif($existingCustomer['custconphone']) {\n\t\t\t\t\t\t$GLOBALS['CustomerPhone'] = isc_html_escape($existingCustomer['custconphone']) . '<br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['CustomerEmail'] = '';\n\t\t\t\t\tif($existingCustomer['custconemail']) {\n\t\t\t\t\t\t$GLOBALS['CustomerEmail'] = '<a href=\"mailto:'.isc_html_escape($existingCustomer['custconemail']).'\">'.isc_html_escape($existingCustomer['custconemail']).'</a><br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['CustomerCompany'] = '';\n\t\t\t\t\tif($existingCustomer['custconcompany']) {\n\t\t\t\t\t\t$GLOBALS['CustomerCompany'] = isc_html_escape($existingCustomer['custconcompany']).'<br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Grab the addresses\n\t\t\t\t\t$addresses = $this->LoadCustomerAddresses($existingCustomer['customerid']);\n\t\t\t\t\t$GLOBALS['AddressJson'] = 'OrderManager.LoadInAddresses('.isc_json_encode($addresses).');';\n\t\t\t\t\tif(!empty($addresses)) {\n\t\t\t\t\t\t$GLOBALS['HideAddressSelects'] = '';\n\t\t\t\t\t\t$GLOBALS['DisableAddressSelects'] = 'disabled=\"disabled\"';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['SelectedCustomer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersCustomerSearchResult');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(isset($postData['ordcustid']) && $postData['ordcustid'] == 0) {\n\t\t\t\tif(!isset($postData['customerType'])) {\n\t\t\t\t\t$GLOBALS['CurrentTab'] = 2;\n\t\t\t\t}\n\t\t\t\telse if($postData['customerType'] == 'anonymous') {\n\t\t\t\t\t$GLOBALS['CurrentTab'] = 2;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['CurrenTab'] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Customer and order custom fields\n\t\t\t */\n\t\t\t$GLOBALS['OrderCustomFormFieldsAccountFormId'] = FORMFIELDS_FORM_ACCOUNT;\n\t\t\t$GLOBALS['OrderCustomFormFieldsBillingFormId'] = FORMFIELDS_FORM_BILLING;\n\t\t\t$GLOBALS['OrderCustomFormFieldsShippingFormId'] = FORMFIELDS_FORM_SHIPPING;\n\t\t\t$GLOBALS['CustomFieldsAccountLeftColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsAccountRightColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsBillingColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsShippingColumn'] = '';\n\n\t\t\t$formIdx = array(FORMFIELDS_FORM_ACCOUNT, FORMFIELDS_FORM_BILLING, FORMFIELDS_FORM_SHIPPING);\n\n\t\t\t$fieldMap = array(\n\t\t\t\t'FirstName'\t\t=> 'firstname',\n\t\t\t\t'LastName'\t\t=> 'lastname',\n\t\t\t\t'Company'\t\t=> 'company',\n\t\t\t\t'Phone'\t\t\t=> 'phone',\n\t\t\t\t'AddressLine1'\t=> 'street1',\n\t\t\t\t'AddressLine2'\t=> 'street2',\n\t\t\t\t'City'\t\t\t=> 'suburb',\n\t\t\t\t'Zip'\t\t\t=> 'zip',\n\t\t\t\t'Country'\t\t=> 'country',\n\t\t\t\t'State'\t\t\t=> 'state'\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Now process the forms\n\t\t\t */\n\t\t\tforeach ($formIdx as $formId) {\n\t\t\t\t$formSessionId = 0;\n\t\t\t\tif ($formId == FORMFIELDS_FORM_ACCOUNT) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * We are only using the real custom fields for the account section, so check here\n\t\t\t\t\t */\n\t\t\t\t\tif (!gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($existingCustomer['custformsessionid'])) {\n\t\t\t\t\t\t$formSessionId = $existingCustomer['custformsessionid'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (isset($postData['ordformsessionid'])) {\n\t\t\t\t\t\t$formSessionId = $postData['ordformsessionid'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * This part here gets all the existing fields\n\t\t\t\t */\n\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId, true);\n\t\t\t\t} else if (isId($formSessionId)) {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId, false, $formSessionId);\n\t\t\t\t} else {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Get any selected country and state. This needs to be separate as we physically\n\t\t\t\t * print out each form field at a time so we need this information before hand\n\t\t\t\t */\n\t\t\t\tif ($formId !== FORMFIELDS_FORM_ACCOUNT) {\n\t\t\t\t\t$countryId = GetCountryIdByName(GetConfig('CompanyCountry'));\n\t\t\t\t\t$stateFieldId = 0;\n\t\t\t\t\tforeach (array_keys($fields) as $fieldId) {\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'state') {\n\t\t\t\t\t\t\t$stateFieldId = $fieldId;\n\t\t\t\t\t\t} else if (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'country') {\n\t\t\t\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t\t\t\t\t$country = $fields[$fieldId]->getValue();\n\t\t\t\t\t\t\t} if ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t\t$country = @$order['ordbillcountry'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$country = @$order['ordshipcountry'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (trim($country) !== '') {\n\t\t\t\t\t\t\t\t$countryId = GetCountryIdByName($country);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Now we construct and build each form field\n\t\t\t\t */\n\t\t\t\t$column = 0;\n\t\t\t\tforeach (array_keys($fields) as $fieldId) {\n\n\t\t\t\t\tif ($formId == FORMFIELDS_FORM_ACCOUNT) {\n\n\t\t\t\t\t\tif ($fields[$fieldId]->record['formfieldprivateid'] !== '' || !gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$fieldHTML = $fields[$fieldId]->loadForFrontend();\n\n\t\t\t\t\t\tif (($column%2) > 0) {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsAccountLeftColumn';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsAccountRightColumn';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are using all the custom fields for the billing/shipping are, so check here\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!gzte11(ISC_MEDIUMPRINT) && $fields[$fieldId]->record['formfieldprivateid'] == '') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsBillingColumn';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsShippingColumn';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Set the value for the private fields if this is NOT a post\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ($_SERVER['REQUEST_METHOD'] !== 'POST' && $fields[$fieldId]->record['formfieldprivateid'] !== '') {\n\n\t\t\t\t\t\t\t$key = @$fieldMap[$fields[$fieldId]->record['formfieldprivateid']];\n\t\t\t\t\t\t\tif (trim($key) !== '') {\n\t\t\t\t\t\t\t\tif ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t\t\t$key = 'ordbill' . $key;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$key = 'ordship' . $key;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (array_key_exists($key, $order)) {\n\t\t\t\t\t\t\t\t\t$fields[$fieldId]->setValue($order[$key]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add in any of the country/state lists if needed\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'country') {\n\t\t\t\t\t\t\t$fields[$fieldId]->setOptions(array_values(GetCountryListAsIdValuePairs()));\n\n\t\t\t\t\t\t\tif ($fields[$fieldId]->getValue() == '') {\n\t\t\t\t\t\t\t\t$fields[$fieldId]->setValue(GetConfig('CompanyCountry'));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$fields[$fieldId]->addEventHandler('change', 'FormFieldEvent.SingleSelectPopulateStates', array('countryId' => $fieldId, 'stateId' => $stateFieldId, 'inOrdersAdmin' => true));\n\n\t\t\t\t\t\t} else if (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'state' && isId($countryId)) {\n\t\t\t\t\t\t\t$stateOptions = GetStateListAsIdValuePairs($countryId);\n\t\t\t\t\t\t\tif (is_array($stateOptions) && !empty($stateOptions)) {\n\t\t\t\t\t\t\t\t$fields[$fieldId]->setOptions($stateOptions);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We also do not what these fields\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'savethisaddress' || isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'shiptoaddress') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS[$varname] .= $fields[$fieldId]->loadForFrontend() . \"\\n\";\n\t\t\t\t\t$column++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Add this to generate our JS event script\n\t\t\t */\n\t\t\t$GLOBALS['FormFieldEventData'] = $GLOBALS['ISC_CLASS_FORM']->buildRequiredJS();\n\n\t\t\t/**\n\t\t\t * Do we display the customer custom fields?\n\t\t\t */\n\t\t\tif (!gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t$GLOBALS['HideCustomFieldsAccountLeftColumn'] = 'none';\n\t\t\t\t$GLOBALS['HideCustomFieldsAccountRightColumn'] = 'none';\n\t\t\t} else {\n\t\t\t\tif ($GLOBALS['CustomFieldsAccountLeftColumn'] == '') {\n\t\t\t\t\t$GLOBALS['HideCustomFieldsAccountLeftColumn'] = 'none';\n\t\t\t\t}\n\n\t\t\t\tif ($GLOBALS['CustomFieldsAccountRightColumn'] == '') {\n\t\t\t\t\t$GLOBALS['HideCustomFieldsAccountRightColumn'] = 'none';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$defaultValues = array(\n\t\t\t\t'custgroupid' => 0,\n\t\t\t\t'ordstatus' => 7\n\t\t\t);\n\n\t\t\tforeach($defaultValues as $postField => $default) {\n\t\t\t\tif(!isset($postData[$postField])) {\n\t\t\t\t\t$postData[$postField] = $default;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($orderFields as $templateField => $orderField) {\n\t\t\t\tif(!isset($postData[$orderField])) {\n\t\t\t\t\t$GLOBALS[$templateField] = '';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS[$templateField] = isc_html_escape($postData[$orderField]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($postData['ordbillsaveAddress'])) {\n\t\t\t\t$GLOBALS['OrderBillSaveAddress'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['ordshipsaveAddress'])) {\n\t\t\t\t$GLOBALS['OrderShipSaveAddress'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['shippingUseBilling'])) {\n\t\t\t\t$GLOBALS['ShippingUseBillingChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['billingUseShipping'])) {\n\t\t\t\t$GLOBALS['BillingUseShippingChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\t$GLOBALS['OrderStatusOptions'] = $this->GetOrderStatusOptions($postData['ordstatus']);\n\n\t\t\t$customerClass = GetClass('ISC_ADMIN_CUSTOMERS');\n\t\t\t$GLOBALS['CustomerGroupOptions'] = $customerClass->GetCustomerGroupsAsOptions($postData['custgroupid']);\n\n\t\t\t$GLOBALS['PaymentMethodsList'] = $this->GetPaymentProviderList($postData);\n\n\t\t\tif(!empty($order)) {\n\t\t\t\t$GLOBALS['HideEmailInvoice'] = 'display: none';\n\t\t\t}\n\t\t\telse if(isset($postData['emailinvoice'])) {\n\t\t\t\t$GLOBALS['EmailInvoiceChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t}",
"function geneshop_my_orders_page($account) {\n drupal_set_title(t(\"@name's Order History\", array('@name' => format_username($account))), PASS_THROUGH);\n $build = array();\n $query = db_select('node', 'n')->extend('PagerDefault');\n $nids = $query->fields('n', array('nid', 'sticky', 'created'))->condition('type', geneshop_ORDER_NODETYPE)->condition('uid', $account->uid)->condition('status', 1)->orderBy('created', 'DESC')->limit(variable_get('default_nodes_main', 10))->addTag('node_access')->execute()->fetchCol();\n if (!empty($nids)) {\n $nodes = node_load_multiple($nids);\n $build += node_view_multiple($nodes);\n $build['pager'] = array(\n '#theme' => 'pager',\n '#weight' => 5,\n );\n }\n else {\n drupal_set_message(t('You have no orders for this account.'));\n }\n return $build;\n}",
"protected function getActiveOrderWorkflows() {\n $active_workflows = [];\n $order_types = $this->entityTypeManager\n ->getStorage('commerce_order_type')\n ->loadMultiple();\n\n foreach ($order_types as $order_type) {\n $workflow_label = $this->workflowManager->getDefinition($order_type->getWorkflowId())['label'];\n $active_workflows[$order_type->getWorkflowId()] = $workflow_label;\n }\n\n return $active_workflows;\n }",
"public function testShowListOrder()\n {\n $this->setUp();\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('/admin/order')\n ->assertPathIs('/admin/order')\n ->assertSee('Show list orders');\n $elements = $browser->elements('.table tbody tr');\n $this->assertCount(self::RECORD_LIMIT, $elements);\n });\n }",
"function payment_account_screen_setup($parameters){\r\n\t\t$identifier = $this->check_parameters($parameters,\"identifier\",-1);\r\n\t\t/**\r\n * get Account setup details\r\n */\r\n\t\t$sql = \"select * \";\r\n\t\t$sql .=\t\"from payment_account_details \";\r\n\t\t$sql .= \" where pad_client = $this->client_identifier\";\r\n\t\t\t\r\n\t\t$propertyValues = Array();\r\n\t\t$uri =\"\";\r\n $result = $this->call_command(\"DB_QUERY\",Array($sql));\r\n while($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\r\n\t\t\t$identifier \t\t= $r[\"pad_identifier\"];\r\n\t\t\t$uri\t\t \t\t= $r[\"pad_uri\"];\r\n }\r\n $this->call_command(\"DB_FREE\",Array($result));\r\n\t\t/**\r\n *\r\n */\r\n\t\t$sql = \"select * from payment_account_properties where pap_client = $this->client_identifier and pap_identifier = $identifier\";\r\n\t\t$propertyValues = Array();\r\n $result = $this->call_command(\"DB_QUERY\",Array($sql));\r\n while($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\r\n \t$propertyValues[count($propertyValues)] = Array(\r\n\t\t\t\t\"key\" => $r[\"pap_property\"], \r\n\t\t\t\t\"value\" => $r[\"pap_value\"]\r\n\t\t\t);\r\n }\r\n $this->call_command(\"DB_FREE\",Array($result));\r\n\t\t/**\r\n * display this form\r\n */\r\n\t\t$out =\"<module name=\\\"\".$this->module_name.\"\\\" display=\\\"form\\\">\";\r\n\t\t$out .=\"<form name=\\\"\".$this->module_name.\"_form\\\" label=\\\"\".LOCALE_PAYMENT_SETUP.\"\\\">\";\r\n\t\t$out .=\"\t<input type=\\\"hidden\\\" name=\\\"command\\\" value=\\\"\".$this->module_command.\"SETUP_SAVE\\\"/>\";\r\n\t\t$out .=\"\t<input type=\\\"hidden\\\" name=\\\"identifier\\\" value=\\\"$identifier\\\"/>\";\r\n\t\t$out .=\"\t\t<page_sections>\";\r\n\t\t$out .= \"\t\t<section label='Gateways' redirect='SHOP_CHOOSEPAY'>\";\r\n\t\t$out .= \"\t\t</section>\";\r\n\t\t$out .= \"\t\t<section label='Merchant Account' selected='true'>\";\r\n//\t\t$out .=\"\t\t\t\t<input type=\\\"text\\\" name=\\\"pad_uri\\\" label=\\\"\".LOCALE_PAYMENT_URI.\"\\\" required='YES'><![CDATA[$uri]]></input>\";\r\n\t\t$out .=\"\t\t\t\t<text><![CDATA[<p>Special properties for this Account</p>]]></text>\";\r\n\t\t$max_setup_values\t= count($this->setupProperties);\r\n\t\t$max_prop_values\t= count($propertyValues);\r\n\t\tfor($i=0; $i<$max_setup_values; $i++){\r\n\t\t\t$value=\"\";\r\n\t\t\t\r\n\t\t\tfor($v=0; $v<$max_prop_values; $v++){\r\n\t\t\t\tif ($propertyValues[$v][\"key\"]==$this->setupProperties[$i][0]){\r\n\t\t\t\t\t$value = $propertyValues[$v][\"value\"];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"text\"){\r\n\t\t\t\t$out .=\"\t<input type=\\\"text\\\" name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\"><![CDATA[$value]]></input>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"__CALLBACK__\"){\r\n\t\t\t\tif($value==\"\"){\r\n\t\t\t\t\t$value=\"http://\".$this->parent->domain.$this->parent->base.\"_process.php\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"\t<input type=\\\"text\\\" name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\"><![CDATA[$value]]></input>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"boolean\"){\r\n\t\t\t\t\r\n\t\t\t\t$out .=\"\t<radio name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\">\r\n\t\t\t\t\t<option value='No'\";\r\n\t\t\t\t\tif ($value=='No' || $value==''){\r\n\t\t\t\t\t\t$out .= \" selected='true'\";\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t$out.=\">No</option>\r\n\t\t\t\t\t<option value='Yes'\";\r\n\t\t\t\t\tif ($value=='Yes'){\r\n\t\t\t\t\t\t$out .= \" selected='true'\";\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t$out.=\">Yes</option>\r\n\t\t\t\t</radio>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"__CURRENCY__\"){\r\n\t\t\t\tif($value==\"\"){\r\n\t\t\t\t\t$value =\"GBP\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"<select name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\" >\";\r\n\t\t\t\tfor($curr = 0, $curr_max=count($this->currency); $curr<$curr_max; $curr++){\r\n\t\t\t\t\t$out .=\"\t<option value=\\\"\".$this->currency[$curr][0].\"\\\"\";\r\n\t\t\t\t\tif ($value==$this->currency[$curr][0]){\r\n\t\t\t\t\t\t$out.=\" selected='true'\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .=\"><![CDATA[\".$this->currency[$curr][1].\"]]></option>\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"</select>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"__TEST__\"){\r\n\t\t\t\t$out .=\"<select name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\" >\";\r\n\t\t\t\t$out .=\"\t<option value=\\\"\\\"><![CDATA[\".LOCALE_NO_TEST_MODE.\"]]></option>\";\t\t\t\t\t\r\n\t\t\t\t$mz= count($this->testModes);\r\n\t\t\t\tfor($z=0;$z<$mz;$z++){\r\n\t\t\t\t\t$out .=\"\t<option value=\\\"\".$this->testModes[$z][0].\"\\\"\";\r\n\t\t\t\t\tif ($value==$this->testModes[$z][0]){\r\n\t\t\t\t\t\t$out.=\" selected='true'\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .=\"><![CDATA[\".constant($this->testModes[$z][1]).\"]]></option>\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"</select>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out .=\"\t\t</section>\";\r\n\r\n\t\t$out .=\"\t</page_sections>\";\r\n\t\t$out .=\"\t\t\t<input type=\\\"submit\\\" iconify=\\\"SAVE\\\" value=\\\"\".SAVE_DATA.\"\\\"/>\";\r\n\t\t$out .=\"</form>\";\r\n\t\t$this->call_command(\"DB_FREE\",array($result));\r\n\t\t$out .=\"</module>\";\r\n\t\treturn $out;\r\n\t}",
"public function showOrders()\n\t{\n\t\t$orders = Auth::user()->orders()\n\t\t\t->orderby('created_at', 'desc')\n\t\t\t->paginate(10);\n\n\t\treturn view('profile.showOrder', [\n\t\t\t'orders' => $orders,\n\t\t]);\n\t}",
"public function UserAllOrders(){\n $customerOrder = 1;\n return view('user.pages.account.myaccount', compact('customerOrder'));\n }",
"public function orderDetails()\n {\n $params = $this->productService->getOrders($this->requestHelper);\n\n $this->renderView(['account', 'accountOrderDetails'], $params);\n }",
"function wc_display_custom_billing_fields_admin_order( $order ) {\r\n\twc_get_custom_fields_for_admin_order( $order, array( 'billing' ) );\r\n}",
"public function hookDisplayAdminOrderTabOrder($params)\n {\n if (Eticket::getEticketsFromIds(Eticket::getIdsFromOrder($params['order']->id))) {\n return $this->display(__FILE__, 'adminOrderTabOrder.tpl');\n }\n }",
"public function getOrderedSteps();",
"public static function register_get_orders() {\n\t\t$sf_accounts = ShoppingFeedHelper::get_sf_account_options();\n\t\tif ( empty( $sf_accounts ) ) {\n\t\t\tShoppingFeedHelper::get_logger()->error(\n\t\t\t\tsprintf(\n\t\t\t\t\t__( 'No Accounts founds', 'shopping-feed' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'source' => 'shopping-feed',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\t\tforeach ( $sf_accounts as $key => $sf_account ) {\n\t\t\tas_schedule_recurring_action(\n\t\t\t\ttime() + 60,\n\t\t\t\tShoppingFeedHelper::get_sf_orders_import_frequency(),\n\t\t\t\t'sf_get_orders_action_' . $key,\n\t\t\t\tarray(\n\t\t\t\t\t'sf_account' => $sf_account,\n\t\t\t\t),\n\t\t\t\tself::ORDERS_GROUP\n\t\t\t);\n\t\t}\n\t}",
"function my_account_menu_order() {\n\t$menuOrder = array(\n\t\t'dashboard' => __( 'Dashboard', 'woocommerce' ),\n\t\t'resume' => __( 'Resume', 'woocommerce' ),\n\t\t'orders' => __( 'Your Orders', 'woocommerce' ),\n\t\t'downloads' => __( 'Download', 'woocommerce' ),\n\t\t'edit-address' => __( 'Addresses', 'woocommerce' ),\n\t\t'edit-account' => __( 'Account Details', 'woocommerce' ),\n\t\t'customer-logout' => __( 'Logout', 'woocommerce' )\t\t\n\t);\n\treturn $menuOrder;\n}",
"public static function ToOrdersAdmin()\n {\n return self::ToAdmin('Page=Orders');\n }",
"public function getAutocreateOrders()\n {\n /* @var $config Dhl_Intraship_Model_Config */\n $config = Mage::getModel('intraship/config');\n $allowedStatusCodes = $config->getAutocreateAllowedStatusCodes();\n $allowedPaymentMethods = $config->getAutocreateAllowedPaymentMethods();\n $disabledShippingMethods = $config->getDisabledShippingMethods();\n $installDate = $config->getInstallDate();\n\n /* @var $orderCollection Mage_Sales_Model_Resource_Order_Collection */\n $orderCollection = Mage::getModel('sales/order')->getCollection();\n\n $coreVersion = Mage::getConfig()->getModuleConfig('Mage_Core')->version;\n if (version_compare($coreVersion, '1.6.0.0', '<')) {\n $orderCollection->getSelect()->join(\n array('payment_table' => $orderCollection->getTable('sales/order_payment')),\n \"`main_table`.`entity_id` = `payment_table`.`parent_id`\",\n array()\n );\n } else {\n $orderCollection->join(\n array('payment_table' => 'sales/order_payment'),\n \"`main_table`.`entity_id` = `payment_table`.`parent_id`\",\n array()\n );\n }\n\n $orderCollection\n ->addFieldToFilter('status', array('in' => explode(',', $allowedStatusCodes)))\n ->addFieldToFilter('method', array('in' => explode(',', $allowedPaymentMethods)))\n ->addFieldToFilter('shipping_method', array('nin' => explode(',', $disabledShippingMethods)))\n ->addFieldToFilter('created_at', array('gteq' => $installDate))\n ;\n\n return $orderCollection;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get cached analysis result for grammar. | public function get(GrammarInterface $grammar): AnalysisResultInterface; | [
"protected function cacheParserResults()\n {\n if (is_null($this->uaParserResult)) {\n $uaParser = Parser::create();\n $this->uaParserResult = $uaParser->parse($this->serverData['HTTP_USER_AGENT']);\n }\n }",
"public function getAnalysisResult()\n {\n return $this->result;\n }",
"public function getAnalysis()\n {\n return $this->analysis;\n }",
"public function getResultCache()\n {\n return $this->resultCache;\n }",
"public function getDocumentAnalysis(): DocumentAnalysis\n {\n return $this->documentAnalysis;\n }",
"public function getResultCache();",
"public function getCompilationResult()\n {\n return $this->compilation_result;\n }",
"private function get_results_from_storage() {\n\t\t$this->results = get_option( 'rank_math_seo_analysis_results' );\n\t\t$this->build_results();\n\t}",
"public function jobRunStaticAnalysis(): Result\n {\n $customCodePaths = $this->getCustomCodePaths();\n return $this->taskExecStack()\n ->stopOnFail()\n ->exec(\"vendor/bin/phpstan analyse --memory-limit=1G $customCodePaths\")\n ->run();\n }",
"public function analysis() {\n\t\t\tglobal $fwPROGRAMA;\n\t\t\t$this->getToken();\n\t\t\t$this->scope = 'global';\n\t\t\t$this->PROGRAMA($fwPROGRAMA);\n\t\t\tif ($this->semantic)\n\t\t\t\t$this->printST();\n\t\t\t//if after the analysis is done, we reached end of file, the source file is well formed\n\t\t\tif ($this->state == LEXICAL_EOF) {\n\t\t\t\t//if there were errors, returns SYNTAX_WAR\n\t\t\t\tif ($this->error->count())\n\t\t\t\t\treturn SYNTAX_WAR;\n\t\t\t\telse\n\t\t\t\t\treturn SYNTAX_OK;\n\t\t\t} else {\n\t\t\t\t//else, fatal error (program structure malformed)\n\t\t\t\t$this->error->show(ERT_FAT, ERR_SYN_PRG, -1, '', $this->chain, $this->token);\n\t\t\t\treturn SYNTAX_ERR;\n\t\t\t}\n\t\t}",
"public function getGrammarScore() {\n return $this->ptClient->getGrammarScore($this->data);\n }",
"public function getSpellcheckResult()\n {\n //expose origin result\n return $this->originalResult->getSpellcheckResult();\n }",
"public function result() {\n\t\treturn $this->validation_results;\n\t}",
"public function getGrammar();",
"public function getSentimentAnalysisResult()\n {\n return isset($this->sentiment_analysis_result) ? $this->sentiment_analysis_result : null;\n }",
"public static function getCachedParser()\n\t{\n\t\tif (!isset(static::$parser))\n\t\t{\n\t\t\tstatic::$parser = static::getParser();\n\t\t}\n\n\t\treturn static::$parser;\n\t}",
"public function grammar()\n {\n return $this->grammar;\n }",
"public function getAnalyser()\n {\n return new Analyser();\n }",
"public function get()\n\t{\n\t\treturn $this->_cache->get($this->_query);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is this a categories list page? | function em_is_categories_page(){
return em_get_page_type() == 'categories';
} | [
"protected function isCategoryPage()\n {\n return ($this->request->view == $this->viewCategory);\n }",
"protected function isCategoryPage()\n {\n return ($this->request->layout == 'category' || $this->request->task == 'category' || $this->request->view == 'latest');\n }",
"function em_is_categories_page(){\r\n\treturn em_get_page_type() == 'categories';\r\n}",
"function isCategoryPage($page_name) {\n // should this go up to the listmodule obj ?\n $sql = \"SELECT COUNT(*) FROM {$this->categoryTable} WHERE page_name='{$page_name}'\";\n $count = db_get_single_value($sql);\n if ($count > 0) {\n return true;\n } else {\n return false;\n }\n }",
"function isCategoryPage( $page_name ) {\n\t\t\t// should this go up to the listmodule obj ?\n\t\t\t$sql = \"SELECT COUNT(*) FROM {$this->categoryTable} WHERE page_name='{$page_name}'\";\n\t\t\t$count = db_get_single_value( $sql );\n\t\t\tif ( $count > 0 ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function hasCategoryList(){\n\t\treturn true;\n\t}",
"public function isCategoryPage()\n {\n $isCategoryPage = false;\n if (!is_null($this->getFrontControllerName())\n && !is_null($this->getCurrentCategory())\n ) {\n $isCategoryPage = true;\n }\n\n return $isCategoryPage;\n }",
"public function hasCategoryList(){\n\t\treturn false;\n\t}",
"protected function _isCategory() {\n return $this->_getRouteName() == 'catalog'\n && $this->_getControllerName() == 'category';\n }",
"public function hasCategories();",
"public function hasCategories():bool;",
"function is_category() {\n\t$pcat = CAT_ID;\n\treturn(!empty($pcat));\n}",
"public function isCategoryView($request) {\r\n $module = strtolower($request->getModuleName());\r\n $controller = strtolower($request->getControllerName());\r\n $action = strtolower($request->getActionName());\r\n\r\n if (($module == 'catalog') && ($controller == 'category') && ($action == 'view'))\r\n return true;\r\n else\r\n return false;\r\n }",
"public function getShowCategoryInList()\n {\n return (boolean) $this->getBlog()->ShowCategoryInList;\n }",
"function is_NewsCategory() {\n\treturn in_context(ZP_ZENPAGE_NEWS_CATEGORY);\n}",
"public function isCategory() {\n\t\treturn $this->libraryType == self::TYPE_CATEGORY;\n\t}",
"public function hasCategories()\n {\n return !empty($this->categories);\n }",
"function categorized_blog() {\n\t$category_count = get_transient( __NAMESPACE__ . '\\categories' );\n\n\tif ( false === $category_count ) {\n\t\t$category_count_query = get_categories( [ 'fields' => 'count' ] );\n\n\t\t$category_count = isset( $category_count_query[0] ) ? (int) $category_count_query[0] : 0;\n\n\t\tset_transient( __NAMESPACE__ . '\\categories', $category_count );\n\t}\n\n\treturn $category_count > 1;\n}",
"public function supportsCategories();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function returns the details of Employees Hierarchy | public function getEmployeeHierarchy()
{
$focus = CRMEntity::getInstance($this->getModuleName());
$hierarchy = $focus->getEmployeeHierarchy($this->getId());
$i = 0;
foreach ($hierarchy['entries'] as $employeeId => $employeeInfo) {
preg_match('/<a href="+/', $employeeInfo[0], $matches);
if ($matches != null) {
preg_match('/[.\s]+/', $employeeInfo[0], $dashes);
preg_match("/<a(.*)>(.*)<\/a>/i", $employeeInfo[0], $name);
$recordModel = Vtiger_Record_Model::getCleanInstance('OSSEmployees');
$recordModel->setId($employeeId);
$hierarchy['entries'][$employeeId][0] = $dashes[0] . "<a href=" . $recordModel->getDetailViewUrl() . ">" . $name[2] . "</a>";
}
}
return $hierarchy;
} | [
"function getEmployeeHierarchy() {\n\t\t$focus = CRMEntity::getInstance($this->getModuleName());\n\t\t$hierarchy = $focus->getEmployeeHierarchy($this->getId());\n\t\t$i=0;\n\t\tforeach($hierarchy['entries'] as $employeeId => $employeeInfo) {\n\t\t\tpreg_match('/<a href=\"+/', $employeeInfo[0], $matches);\n\t\t\tif($matches != null) {\n\t\t\t\tpreg_match('/[.\\s]+/', $employeeInfo[0], $dashes);\n\t\t\t\tpreg_match(\"/<a(.*)>(.*)<\\/a>/i\",$employeeInfo[0], $name);\n\n\t\t\t\t$recordModel = Vtiger_Record_Model::getCleanInstance('OSSEmployees');\n\t\t\t\t$recordModel->setId($employeeId);\n\t\t\t\t$hierarchy['entries'][$employeeId][0] = $dashes[0].\"<a href=\".$recordModel->getDetailViewUrl().\">\".$name[2].\"</a>\";\n\t\t\t}\n\t\t}\n\t\treturn $hierarchy;\n\t}",
"public function showHierarchyList()\n {\n $workers = DB::table('employees')->get();\n return view('employees', ['workers' => $workers]);\n }",
"public function getAllEmployees();",
"function show_employees(){\n\tglobal $db;\n\t$query = \"SELECT * FROM users JOIN names ON users.userID = names.userID JOIN employees ON names.nameID = employees.nameID WHERE users.userLevel = 'E' ORDER BY lName\";\n\t$employees = $db->query($query);\n\treturn $employees;\n}",
"public function get_employee_details(){\n\t\t$this->loadModel('User');\n\t\t$role_id = $this->request->data['Report']['role_id'];\n\t\t$branch_id = $this->request->data['Report']['branch_id'];\n\t\t$roleCond = !empty($role_id) ? array('roles_id' => $role_id) : '';\n\t\t$branchCond = !empty($branch_id) ? array('location_id' => $branch_id) : '';\n\t\treturn $this->User->find('list', array('fields' => array('id','first_name'), 'order' => array('first_name ASC'),'conditions' => array('status' => 0, $roleCond, $branchCond)));\n\t}",
"public function getEmployees(){\n $service = Yii::$app->params['ServiceName']['employees'];\n\n $employees = \\Yii::$app->navhelper->getData($service);\n $res = [];\n foreach($employees as $e){\n if(!empty($e->User_ID)){\n $res[] = [\n 'No' => $e->No,\n 'Full_Name' => $e->Full_Name\n ];\n }\n }\n return $res;\n }",
"public function getAllEmployees()\n {\n $employees = $this->userModel->whereHas('roles', function($q){\n $q->where('name','=','employee');\n })->get();\n\n if(!$employees || $employees->isEmpty())\n {\n throw new \\Exception(trans('reports.no_employee'));\n }\n\n return $employees;\n }",
"public function getHierarchies();",
"public function getHospitalEmployees()\n {\n return $this->hasMany(HospitalEmployee::className(), ['Hosp_id' => 'Hosp_id']);\n }",
"public function getEmployeeName();",
"public function getEmployeeDependencyTree(): array\n {\n $all_staff = Employee::with('asManager')\n ->get()\n ->map(function (Employee $one) {\n $employee_as_array = $one->attributesToArray();\n $employee_as_array['salary_earned'] = $one->countSalary();\n $employee_as_array['manager_id'] = $one->asManager->id ?? null;\n $employee_as_array['position_name'] = $one->getPositionName();\n\n $employee_as_array['created_at'] = date('d.m.Y H:i:s', strtotime($one->created_at));\n return $employee_as_array;\n })\n ->toArray();\n $independent_staff = array_filter($all_staff, function ($one) {\n return is_null($one['belongs_to_manager']);\n });\n $keys = array_keys($independent_staff);\n foreach ($keys as $key_to_unset) {\n unset($all_staff[$key_to_unset]);\n }\n $staff_graph = [];\n foreach ($independent_staff as $staff) {\n $staff['subordinates'] = [];\n if ($staff['manager_id']) {\n $staff['subordinates'] = self::getDependentEmployees($staff['manager_id'], $all_staff);\n }\n $staff_graph[] = $staff;\n }\n return $staff_graph;\n }",
"public function getEmployeeDetails()\n {\n return $this->hasMany(EmployeeDetails::className(), ['employee_id' => 'employee_id']);\n }",
"public static function getEmployeesListingDetails()\n\t{\n\t\t$config = UIFactory::getConfig();\n\n\t\treturn array( \n\t\t\t\"desclength\" \t\t=> $config->getInt('empdesclength'),\n\t\t\t\"linkhref\" \t\t\t=> $config->getInt('emplinkhref'),\n\t\t\t\"filtergroups\" \t\t=> $config->getInt('empgroupfilter'),\n\t\t\t\"filterordering\" \t=> $config->getInt('empordfilter'),\n\t\t\t\"ajaxsearch\" \t\t=> $config->getInt('empajaxsearch'),\n\t\t);\n\t}",
"function hierarchyList()\n\t\t{\n\t\t\t$data = $GLOBALS[\"operations\"]->getHierarchyList($this->columns, HIERARCHY_GET_ALL);\n\t\t\tarray_push($this->responseData[\"action\"], $data);\n\t\t\t$GLOBALS[\"bus\"]->addData($this->responseData);\n\t\t}",
"private function getAllEmployees(): array\n {\n $response = $this->neo->run(\"\n MATCH (e:Employee)-[:HAS_POSITION]->(p:Position)\n RETURN e, p.description\n \");\n\n $employees = [];\n foreach ($response->records() as $record) {\n $eNode = $record->get('e');\n if (!in_array($eNode->identity(), array_keys($employees))) {\n $id = $eNode->identity();\n\n $employees[$id] = $eNode->asArray();\n $employees[$id]['id'] = $eNode->identity();\n }\n\n $employees[$id]['positions'][] = $record->get('p.description');\n }\n\n return array_map(function ($employee) {\n $employee['fulltext'] = $this->render($employee);\n\n return $employee;\n }, array_values($employees));\n }",
"function get(){\n\n // query to fetch hierarchy\n $query = \"SELECT hierarchy\n FROM \" . $this->table_name . \"\n LIMIT 1\";\n\n // prepare the query\n $stmt = $this->conn->prepare( $query );\n\n // execute the query\n $stmt->execute();\n\n // get number of rows\n $num = $stmt->rowCount();\n\n if($num>0){\n\n // get record details / values\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // return the hierarchy\n return $row;\n }\n\n // return false if no hierarchy is present yet\n return false;\n }",
"public function getOrgTree ()\n {\n $params = fixer::input('request')->get();\n $pager = $this->warehouseService->getOrgTree($params);\n $this->view->pager = $pager;\n $this->display();\n }",
"public function listEmployee() {\n $this->User->recursive = -1;\n $employees = $this->User->find('all', array('fields' => array('id', 'fname', 'lname'), 'conditions' => array('status' => 1, 'NOT' => array('User.role_id' => array(1, 2)))));\n\n if (!empty($employees)) {\n $status = 1;\n } else {\n $status = 0;\n }\n\n $output = array(\n \"params\" => $this->request,\n \"method\" => $this->method,\n \"action\" => \"employeeList\",\n \"status\" => $status,\n \"error\" => array(\"validation\" => \"\")\n );\n $this->set('employees', $employees);\n $this->set('output', $output);\n\n $this->set(\n array(\n \"_serialize\" => array('employees', 'output'),\n \"_jsonp\"=>true\n )\n );\n }",
"private function listEmployee()\n\t{\n\t\t$employees = $this->employee->getEmployee();\n\t\t$cnt = 1;\n\t\tforeach($employees as $key => $val)\n\t\t{\n\t\t\t$arr = array('CNT' => $cnt,\n\t\t\t\t\t\t 'EMPLOYEE_NAME' => $val['name_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_ID' => $val['id_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_MAIL' => $val['mail_employee']);\n\t\t\t$cnt ++;\n\t\t\t$this->view->addToReplace($arr);\n\t\t\t$this->arrRender['LISTEMPLOYEES'] .= $this->view->\n\t\t\tsetTemplateFile('employeeslist')->renderFile();\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alters the entity view build for Layout Builder compatibility. When rendering fields outside of normal view modes, Quick Edit requires that modules identify themselves with a view mode ID in the format [module_name][information the module needs to rerender], as prescribed by hook_quickedit_render_field(). | public function entityViewAlter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
if (!$entity instanceof FieldableEntityInterface || !isset($build['_layout_builder'])) {
return;
}
$build['#cache']['contexts'][] = 'user.permissions';
if (!$this->currentUser->hasPermission('access in-place editing')) {
return;
}
$cacheable_metadata = CacheableMetadata::createFromRenderArray($build);
$section_list = $this->sectionStorageManager->findByContext(
[
'display' => EntityContext::fromEntity($display),
'entity' => EntityContext::fromEntity($entity),
'view_mode' => new Context(new ContextDefinition('string'), $display->getMode()),
],
$cacheable_metadata
);
$cacheable_metadata->applyTo($build);
if (empty($section_list)) {
return;
}
// Create a hash of the sections and use it in the unique Quick Edit view
// mode ID. Any changes to the sections will result in a different hash,
// forcing Quick Edit's JavaScript to recognize any changes and retrieve
// up-to-date metadata.
$sections_hash = hash('sha256', serialize($section_list->getSections()));
// Track each component by their plugin ID, delta, region, and UUID.
$plugin_ids_to_update = [];
foreach (Element::children($build['_layout_builder']) as $delta) {
$section = $build['_layout_builder'][$delta];
if (!Element::isEmpty($section)) {
/** @var \Drupal\Core\Layout\LayoutDefinition $layout */
$layout = $section['#layout'];
$regions = $layout->getRegionNames();
foreach ($regions as $region) {
if (isset($section[$region])) {
foreach ($section[$region] as $uuid => $component) {
if (isset($component['#plugin_id']) && $this->supportQuickEditOnComponent($component, $entity)) {
$plugin_ids_to_update[$component['#plugin_id']][$delta][$region][$uuid] = $uuid;
}
}
}
}
}
}
// @todo Remove when https://www.drupal.org/node/3041850 is resolved.
$plugin_ids_to_update = array_filter($plugin_ids_to_update, function ($info) {
// Delta, region, and UUID each count as one.
return count($info, COUNT_RECURSIVE) === 3;
});
$plugin_ids_to_update = NestedArray::mergeDeepArray($plugin_ids_to_update, TRUE);
foreach ($plugin_ids_to_update as $delta => $regions) {
foreach ($regions as $region => $uuids) {
foreach ($uuids as $uuid => $component) {
$build['_layout_builder'][$delta][$region][$uuid]['content']['#view_mode'] = static::getViewModeId($entity, $display, $delta, $uuid, $sections_hash);
}
}
}
// Alter the Quick Edit view mode ID of all fields outside of the Layout
// Builder sections to force Quick Edit to request to the field metadata.
// @todo Remove this logic in https://www.drupal.org/project/node/2966136.
foreach (Element::children($build) as $field_name) {
if ($field_name !== '_layout_builder') {
$field_build = &$build[$field_name];
if (isset($field_build['#view_mode'])) {
$field_build['#view_mode'] = "layout_builder-{$display->getMode()}-non_component-$sections_hash";
}
}
}
} | [
"protected function buildEntityViewsField() {\n }",
"function hook_bit_view_alter($build) {\n if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {\n // Change its weight.\n $build['an_additional_field']['#weight'] = -10;\n\n // Add a #post_render callback to act on the rendered HTML of the entity.\n $build['#post_render'][] = 'my_module_post_render';\n }\n}",
"function hook_ckeditor_comment_view_alter($build) {\n if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {\n // Change its weight.\n $build['an_additional_field']['#weight'] = -10;\n\n // Add a #post_render callback to act on the rendered HTML of the entity.\n $build['#post_render'][] = 'my_module_post_render';\n }\n}",
"function hook_call_center_view_alter($build) {\n if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {\n // Change its weight.\n $build['an_additional_field']['#weight'] = -10;\n\n // Add a #post_render callback to act on the rendered HTML of the entity.\n $build['#post_render'][] = 'my_module_post_render';\n }\n}",
"function create_er_field_instance($field_name, $field_id, $bundle) {\n $er_instance = array(\n 'field_name' => $field_name,\n 'field_id' => $field_id,\n 'entity_type' => 'node',\n 'bundle' => $bundle,\n 'label' => ucwords(str_replace('_', ' ', $field_name)),\n 'widget' => array(\n 'weight' => '42',\n 'type' => 'inline_entity_form',\n 'module' => 'inline_entity_form',\n 'active' => 1,\n 'settings' => array(\n 'fields' => array(\n ),\n 'type_settings' => array(\n 'allow_existing' => 0,\n 'match_operator' => 'CONTAINS',\n 'delete_references' => 0,\n 'override_labels' => 0,\n 'label_singular' => 'node',\n 'label_plural' => 'nodes',\n ),\n ),\n ),\n 'settings' => array(\n 'user_register_form' => false,\n ),\n 'display' => array(\n 'default' => array(\n 'label' => 'hidden',\n 'type' => 'entityreference_entity_view',\n 'settings' => array(\n 'view_mode' => 'default',\n 'link' => false,\n ),\n 'module' => 'entityreference',\n 'weight' => 3,\n ),\n 'full' => array(\n 'label' => 'hidden',\n 'type' => 'entityreference_entity_view',\n 'settings' => array(\n 'view_mode' => 'full',\n 'link' => false,\n ),\n 'module' => 'entityreference',\n 'weight' => 3,\n ),\n ),\n 'required' => 0,\n 'description' => '',\n );\n\n $instance = field_info_instance('node', $field_name, $bundle);\n if ( ! isset($instance) ) {\n return field_create_instance($er_instance);\n }\n return field_update_instance($er_instance);\n}",
"function govcms_ui_kit_field_attach_view_alter(&$output, $context) {\n if (!_govcms_ui_kit_render_empty_field($context)) {\n return;\n }\n\n $node = $context['entity'];\n\n // Load field instances.\n $instances = _field_invoke_get_instances('node', $node->type, [\n 'default' => TRUE,\n 'deleted' => FALSE,\n ]);\n\n foreach ($instances as $field_name => $instance) {\n // Set the content if the field is empty.\n if (empty($node->{$field_name})) {\n $display = field_get_display($instance, 'teaser', $node);\n // Do not add the field if hidden in the view mode settings.\n if ($display['type'] == 'hidden') {\n continue;\n }\n // Load field settings.\n $field = field_info_field($field_name);\n // Create the render array for the field.\n $output[$field_name] = [\n '#theme' => 'field',\n '#title' => $instance['label'],\n '#label_display' => $display['label'],\n '#field_type' => $field['type'],\n '#field_name' => $field_name,\n '#bundle' => $node->type,\n '#object' => $node,\n '#items' => [],\n '#entity_type' => 'node',\n '#weight' => $display['weight'],\n 0 => ['#markup' => ' '],\n ];\n }\n }\n}",
"function entity_view_mode_prepare($entity_type, $entities, $view_mode, $langcode = NULL) {\n if (!isset($langcode)) {\n $langcode = $GLOBALS['language_content']->language;\n }\n\n // To ensure hooks are never run after field_attach_prepare_view() only\n // process items without the entity_view_prepared flag.\n $entities_by_view_mode = array();\n foreach ($entities as $id => $entity) {\n $entity_view_mode = $view_mode;\n if (empty($entity->entity_view_prepared)) {\n\n // Allow modules to change the view mode.\n $context = array(\n 'entity_type' => $entity_type,\n 'entity' => $entity,\n 'langcode' => $langcode,\n );\n drupal_alter('entity_view_mode', $entity_view_mode, $context);\n }\n\n $entities_by_view_mode[$entity_view_mode][$id] = $entity;\n }\n\n return $entities_by_view_mode;\n}",
"function hook_comment_view_alter(&$build) {\n // Check for the existence of a field added by another module.\n if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {\n // Change its weight.\n $build['an_additional_field']['#weight'] = -10;\n }\n\n // Add a #post_render callback to act on the rendered HTML of the comment.\n $build['#post_render'][] = 'my_module_comment_post_render';\n}",
"function field_attach_view($entity_type, $entity, $view_mode, $langcode = NULL, $options = array()) {\n // Validate $options since this is a new parameter added after Drupal 7 was\n // released.\n $options = is_array($options) ? $options : array();\n\n // Determine the actual language to display for each field, given the\n // languages available in the field data.\n $display_language = field_language($entity_type, $entity, NULL, $langcode);\n $options['language'] = $display_language;\n\n // Invoke field_default_view().\n $null = NULL;\n $output = _field_invoke_default('view', $entity_type, $entity, $view_mode, $null, $options);\n\n // Add custom weight handling.\n list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);\n $output['#pre_render'][] = '_field_extra_fields_pre_render';\n $output['#entity_type'] = $entity_type;\n $output['#bundle'] = $bundle;\n\n // Let other modules alter the renderable array.\n $context = array(\n 'entity_type' => $entity_type,\n 'entity' => $entity,\n 'view_mode' => $view_mode,\n 'display' => $view_mode,\n 'language' => $langcode,\n );\n drupal_alter('field_attach_view', $output, $context);\n\n // Reset the _field_view_prepared flag set in field_attach_prepare_view(),\n // in case the same entity is displayed with different settings later in\n // the request.\n unset($entity->_field_view_prepared);\n\n return $output;\n}",
"public function testEntityView() {\n // The one-column layout is in use.\n $this->drupalGet('entity_test/structure/entity_test/display');\n $this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());\n\n // Switch the layout to two columns.\n $this->click('#edit-field-layouts');\n $this->getSession()->getPage()->selectFieldOption('field_layout', 'layout_twocol');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->submitForm([], 'Save');\n\n $this->assertSession()->pageTextContains('Your settings have been saved.');\n $this->assertEquals(['Top', 'First', 'Second', 'Bottom', 'Disabled'], $this->getRegionTitles());\n\n $this->drupalGet('entity_test/1');\n // No fields are visible, and the regions don't display when empty.\n $this->assertSession()->elementNotExists('css', '.layout--twocol');\n $this->assertSession()->elementNotExists('css', '.layout__region');\n $this->assertSession()->elementNotExists('css', '.field--name-field-test-text');\n\n // After a refresh the new regions are still there.\n $this->drupalGet('entity_test/structure/entity_test/display');\n $this->assertEquals(['Top', 'First', 'Second', 'Bottom', 'Disabled'], $this->getRegionTitles());\n $this->assertSession()->waitForElement('css', '.tabledrag-handle');\n $id = $this->getSession()->getPage()->find('css', '[name=\"form_build_id\"]')->getValue();\n\n // Drag the field to the first region.\n $this->assertTrue($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());\n $field_test_text_row = $this->getSession()->getPage()->find('css', '#field-test-text');\n $first_region_row = $this->getSession()->getPage()->find('css', '.region-first-message');\n $field_test_text_row->find('css', '.handle')->dragTo($first_region_row);\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->assertFalse($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());\n $this->assertSession()->waitForElement('css', \"[name='form_build_id']:not([value='$id'])\");\n $this->submitForm([], 'Save');\n $this->assertSession()->pageTextContains('Your settings have been saved.');\n\n // The new layout is used.\n $this->drupalGet('entity_test/1');\n $this->assertSession()->elementExists('css', '.layout--twocol');\n $this->assertSession()->elementExists('css', '.layout__region--first .field--name-field-test-text');\n\n // Move the field to the second region without tabledrag.\n $this->drupalGet('entity_test/structure/entity_test/display');\n $this->getSession()->getPage()->pressButton('Show row weights');\n $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'second');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->submitForm([], 'Save');\n $this->assertSession()->pageTextContains('Your settings have been saved.');\n\n // The updated region is used.\n $this->drupalGet('entity_test/1');\n $this->assertSession()->elementExists('css', '.layout__region--second .field--name-field-test-text');\n\n // The layout is still in use without Field UI.\n $this->container->get('module_installer')->uninstall(['field_ui']);\n $this->drupalGet('entity_test/1');\n $this->assertSession()->elementExists('css', '.layout--twocol');\n $this->assertSession()->elementExists('css', '.layout__region--second .field--name-field-test-text');\n }",
"public function _editField() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$field_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$field_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->get ( ( int ) $field_id );\n\t\t\n\t\t$this->loadPluginModel ( 'fields' );\n\t\t\n\t\t$this->setView ( 'edit_field' );\n\t\n\t}",
"protected function replaceFields($defs)\n {\n $module = key($defs);\n $rows = $defs[$module]['mobile']['view']['edit'];\n foreach ($rows['panels'] as $rowIndex => $panel) {\n if (isset($panel['fields']) && is_array($panel['fields'])) {\n foreach ($panel['fields'] as $fieldIndex => $field) {\n // Handle removing of the date_start and date_end fields first\n if ($field === 'date_start' || $field === 'date_end') {\n $this->log(\"$module Mobile Edit View Upgrade: Found the $field field... removing from the viewdef\");\n unset($rows['panels'][$rowIndex]['fields'][$fieldIndex]);\n }\n\n // This will first look for fieldsets holding date_start and \n // date_end and remove those, then add the new def\n if (is_array($field)) {\n if (isset($field['fields'])) {\n foreach ($field['fields'] as $fIndex => $f) {\n // String fields in a field set\n if ($f === 'date_start' || $f === 'date_end') {\n $this->log(\"$module Mobile Edit View Upgrade: Found the $field field in a fieldset [0]... removing from the viewdef\");\n unset($rows['panels'][$rowIndex]['fields'][$fieldIndex]['fields'][$fIndex]);\n }\n\n // Array fields in a fieldset\n if (is_array($f) && isset($f['name']) && ($f['name'] === 'date_start' || $f['name'] === 'date_end')) {\n $this->log(\"$module Mobile Edit View Upgrade: Found the $field field in a fieldset [1]... removing from the viewdef\");\n unset($rows['panels'][$rowIndex]['fields'][$fieldIndex]['fields'][$fIndex]);\n }\n }\n }\n\n // Handle what we came here for. This case will be the\n // only case in which a save occurs so none of the above\n // changes will take affect unless the follow change also\n // takes affect.\n if (!empty($field['name']) && $field['name'] === 'duration') {\n $this->log(\"$module Mobile Edit View Upgrade: Found the duration field... replacing it with the updated fieldset def\");\n $rows['panels'][$rowIndex]['fields'][$fieldIndex] = $this->getNewDurationDef();\n $this->save = true;\n }\n }\n }\n\n // Reorganize the keys so they make sense\n $rows['panels'][$rowIndex]['fields'] = array_values($rows['panels'][$rowIndex]['fields']);\n }\n }\n\n $defs[$module]['mobile']['view']['edit'] = $rows;\n $this->viewdefs = $defs;\n }",
"protected function updateModuleViewdefs()\n {\n $files = $this->getViewFileData($this->viewType);\n foreach ($files as $data) {\n if (!empty($data['defs']['panels'])) {\n // Used only for logging at this point\n $custom = !empty($data['custom']) ? 'custom' : '';\n\n // Get the updated panels, if there are any\n $panels = $this->getSanitizedDefs($data['defs']['panels']);\n\n // Only save if there are changes to save\n if ($this->hasChanges()) {\n // This puts the panels back to where they belong in the defs\n $defs = array('panels' => $panels);\n\n // This saves the changes to the file\n $this->saveChanges($defs, $data['file'], $data['module'], $this->viewType, $data['client']);\n $this->log(\"email1 to email {$this->viewType} view field conversion done for $custom $data[module] $data[client] viewdefs\");\n } else {\n $this->log(\"email1 to email {$this->viewType} view field conversion ***SKIPPED*** for $custom $data[module] $data[client] viewdefs - no changes made\");\n }\n }\n }\n }",
"public function buildViewEntity($configName, $entity);",
"function procurement_plan_views_data_alter(&$data) {\n // Expose the product type.\n $data['procurement_plan']['plan_type'] = array(\n 'title' => t('Type'),\n 'help' => t('The human-readable name of the type of the procurement plan.'),\n 'field' => array(\n 'handler' => 'procurement_plan_handler_field_plan_type',\n 'click sortable' => TRUE,\n ),\n 'filter' => array(\n 'handler' => 'procurement_plan_handler_filter_plan_type',\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument_string',\n ),\n );\n\n $data['procurement_plan']['created'] = array(\n 'title' => t('Post date'), // The item it appears as on the UI,\n 'help' => t('The date of plan was posted.'), // The help that appears on the UI,\n 'field' => array(\n 'handler' => 'views_handler_field_date',\n 'click sortable' => TRUE,\n ),\n );\n $data['procurement_plan']['changed'] = array(\n 'title' => t('Last update date'), // The item it appears as on the UI,\n 'help' => t('The date of plan last update.'), // The help that appears on the UI,\n 'field' => array(\n 'handler' => 'views_handler_field_date',\n 'click sortable' => TRUE,\n ),\n );\n\n $data['procurement_plan']['status']['field'] = array(\n 'handler' => 'procurement_plan_handler_field_plan_status',\n );\n\n $data['procurement_plan']['view_procurement_plan']['moved to'] = array('views_entity_procurement_plan', 'view_procurement_plan');\n $data['views_entity_procurement_plan']['view_procurement_plan'] = array(\n 'field' => array(\n 'title' => t('Link'),\n 'help' => t('Provide a simple link to the content.'),\n 'handler' => 'procurement_plan_handler_field_plan_link',\n ),\n );\n\n $data['procurement_plan']['edit_procurement_plan']['moved to'] = array('views_entity_procurement_plan', 'edit_procurement_plan');\n $data['views_entity_procurement_plan']['edit_procurement_plan'] = array(\n 'field' => array(\n 'title' => t('Edit link'),\n 'help' => t('Provide a simple link to edit the content.'),\n 'handler' => 'procurement_plan_handler_field_plan_link_edit',\n ),\n );\n\n $data['procurement_plan']['delete_procurement_plan']['moved to'] = array('views_entity_procurement_plan', 'delete_procurement_plan');\n $data['views_entity_procurement_plan']['delete_procurement_plan'] = array(\n 'field' => array(\n 'title' => t('Delete link'),\n 'help' => t('Provide a simple link to delete the content.'),\n 'handler' => 'procurement_plan_handler_field_plan_link_delete',\n ),\n );\n\n $data['procurement_plan']['uid'] = array(\n 'title' => t('Author uid'),\n 'help' => t('The user authoring the content. If you need more fields than the uid add the content: author relationship'),\n 'relationship' => array(\n 'title' => t('Author'),\n 'help' => t('Relate content to the user who created it.'),\n 'handler' => 'views_handler_relationship',\n 'base' => 'users',\n 'field' => 'uid',\n 'label' => t('author'),\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_user_name',\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument_numeric',\n ),\n 'field' => array(\n 'handler' => 'views_handler_field_user',\n ),\n );\n\n}",
"function custom_fields_views_data_alter(&$data) {\n /**\n * Defines a custom title field to be reused on views, node displays, and search results\n * For resources guides, it will link directly to the node\n * For presentations and case studies it will link to attached files (if any) and display\n * the file size.\n * For all nodes it will include the flag functionality to add/remove to Field Kits\n */\n $data['node']['custom_fields_title'] = array(\n 'group' => t('Custom Fields'),\n 'title' => t('Customized Title'),\n 'help' => t('Modified title field that includes customz link based on content type and the Field Kit toggle link.'),\n 'real field' => 'title',\n 'type' => 'string',\n 'field' => array(\n 'handler' => 'custom_fields_title_handler',\n 'type' => 'string',\n 'click sortable' => TRUE,\n ),\n );\n /**\n * See custom_fields_title definition above\n * This version of the field is for the search indexed views\n */ \n $data['search_api_index_content_index']['custom_fields_title'] = array(\n 'group' => t('Custom Fields'),\n 'title' => t('Customized Title'),\n 'help' => t('Modified title field that includes customz link based on content type and the Field Kit toggle link.'),\n 'real field' => 'title',\n 'type' => 'string',\n 'field' => array(\n 'handler' => 'custom_fields_title_handler',\n 'type' => 'string',\n 'click sortable' => TRUE,\n ),\n 'argument' => array(\n 'handler' => 'SearchApiViewsHandlerArgumentString',\n ),\n 'filter' => array(\n 'handler' => 'SearchApiViewsHandlerFilterText',\n ),\n 'sort' => array(\n 'handler' => 'SearchApiViewsHandlerSort',\n ),\n );\n}",
"function _civicrm_entity_render_fields($field) {\n $settings = isset($field['formatter_settings']) ? $field['formatter_settings'] : array();\n $settings += $field['properties']['default'];\n\n $wrapper = entity_metadata_wrapper($field['entity_type'], $field['entity']->id);\n\n\n //civicrm_contact civi_user field needs special handling\n switch($field['entity_type']) {\n case 'civicrm_contact':\n $formatted_value = _civicrm_entity_contact_get_formatted_values($field,$wrapper);\n break;\n case 'civicrm_participant':\n $formatted_value = _civicrm_entity_participant_get_formatted_values($field,$wrapper,$field['entity']);\n break;\n default: $formatted_value = $wrapper->{$field['field_name']}->value();\n break;\n }\n\n // primary_contact_id_contact and other fields are objects produced by the meta wrapper\n // Will be ease to generate links to the entities if it is consistent across entities\n if(is_object($formatted_value)){\n $formatted_value = $wrapper->{$field['field_name']}->id->value();\n }\n if($field['formatter'] == 'civicrm_link') {\n global $base_url;\n if($formatted_value){\n $formatted_value = '<a href=\"'. $base_url . '/'. str_replace('_','-',$field['properties']['link_entity']) . '/' . $formatted_value . '\">'. _civicrm_entity_get_entity_label($field['properties']['link_entity'],$formatted_value) . '</a>';\n }\n }\n\n if($field['formatter'] == 'civicrm_yes_no') {\n if($formatted_value) {\n $formatted_value = 'Yes';\n }\n else {\n $formatted_value = 'No';\n }\n }\n if($field['formatter'] == 'civicrm_true_false') {\n if($formatted_value) {\n $formatted_value = 'True';\n }\n else {\n $formatted_value = 'False';\n }\n }\n\n if($field['formatter'] == 'civicrm_option_value') {\n if($formatted_value){\n $formatted_value = _civicrm_entity_option_lookup($field,explode(',', $formatted_value));\n }\n }\n\n // Wrapper and class.\n if (!empty($settings['wrapper'])) {\n $wrapper = check_plain($settings['wrapper']);\n $class = (!empty($settings['class'])) ? ' class=\"' . check_plain($settings['class']) . '\"' : '';\n $output = '<' . $wrapper . $class . '>' . $formatted_value . '</' . $wrapper . '>';\n }\n\n return $output;\n}",
"function minim_preprocess_views_view_fields(&$variables) {\n $fields_rendered = '';\n if (!empty($variables['fields'])) {\n foreach ($variables['fields'] AS $id => $field) {\n if (!empty($field->separator)) {\n $fields_rendered .= $field->separator;\n }\n $fields_rendered .= $field->wrapper_prefix;\n $fields_rendered .= $field->label_html;\n $fields_rendered .= $field->content;\n $fields_rendered .= $field->wrapper_suffix;\n }\n }\n $variables['fields_rendered'] = $fields_rendered;\n\n // Allow for more granular preproces_functions\n $sub_functions = array();\n $sub_functions[] = __FUNCTION__ . '__' . $variables['view']->storage->id;\n $sub_functions[] = __FUNCTION__ . '__' . $variables['view']->storage->id . '__' . $variables['view']->current_display;\n foreach ($sub_functions AS $function) {\n if (function_exists($function)) {\n $function($variables);\n }\n }\n}",
"protected function buildFields(array $values) {\n $build = [];\n\n if ($values && ($field_ids = $this->getRenderableFieldIds())) {\n $entity_type_id = $this->getEntityTypeId();\n\n // Collect the entities for the relationship, fetch the right translation,\n // and group by bundle. For each result row, the corresponding entity can\n // be obtained from any of the fields handlers, so we arbitrarily use the\n // first one.\n $entities_by_bundles = [];\n $field = $this->view->field[current($field_ids)];\n foreach ($values as $result_row) {\n if ($entity = $field->getEntity($result_row)) {\n $entities_by_bundles[$entity->bundle()][$result_row->index] = $this->getEntityTranslation($entity, $result_row);\n }\n }\n\n // Determine unique sets of fields that can be processed by the same\n // display. Fields that appear several times in the View open additional\n // \"overflow\" displays.\n $display_sets = [];\n foreach ($field_ids as $field_id) {\n $field = $this->view->field[$field_id];\n $field_name = $field->definition['field_name'];\n $index = 0;\n while (isset($display_sets[$index]['field_names'][$field_name])) {\n $index++;\n }\n $display_sets[$index]['field_names'][$field_name] = $field;\n $display_sets[$index]['field_ids'][$field_id] = $field;\n }\n\n // For each set of fields, build the output by bundle.\n foreach ($display_sets as $display_fields) {\n foreach ($entities_by_bundles as $bundle => $bundle_entities) {\n // Create the display, and configure the field display options.\n $display = EntityViewDisplay::create([\n 'targetEntityType' => $entity_type_id,\n 'bundle' => $bundle,\n 'status' => TRUE,\n ]);\n foreach ($display_fields['field_ids'] as $field) {\n $display->setComponent($field->definition['field_name'], [\n 'type' => $field->options['type'],\n 'settings' => $field->options['settings'],\n ]);\n }\n // Let the display build the render array for the entities.\n $display_build = $display->buildMultiple($bundle_entities);\n // Collect the field render arrays and index them using our internal\n // row indexes and field IDs.\n foreach ($display_build as $row_index => $entity_build) {\n foreach ($display_fields['field_ids'] as $field_id => $field) {\n $build[$row_index][$field_id] = !empty($entity_build[$field->definition['field_name']]) ? $entity_build[$field->definition['field_name']] : [];\n }\n }\n }\n }\n }\n\n return $build;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==================================================================================== METHODS ==================================================================================== checkAccessLevel | public function checkAccessLevel() {
if ($this->core->call('ModuleClient', 'checkAccessLevel', $this->accessLevel))
$this->performAction();
} | [
"public function checkAccessLevel()\n {\n if ($_SESSION['RIGHTS'] === 'full') {\n $this->accessLevel = 'full';\n } else {\n $this->accessLevel = 'guest';\n }\n\n $this->arResult['arResult']['ACCESS_LEVEL'] = $this->accessLevel;\n }",
"protected function validateAccessLevel()\n\t{\n\t\t// Check if an access level is set.\n\t\tif (isset($this->access))\n\t\t{\n\t\t\t// Build a query to get the access level.\n\t\t\t$query = $this->db->getQuery(true);\n\t\t\t$query->select('id');\n\t\t\t$query->from('#__viewlevels');\n\t\t\t$query->where('id = ' . (int) $this->access);\n\n\t\t\t// Get the access level.\n\t\t\t$this->db->setQuery($query);\n\t\t\t$level = $this->db->loadResult();\n\n\t\t\t// Check if the access level exists.\n\t\t\tif ($this->access != $level)\n\t\t\t{\n\t\t\t\tthrow new UnexpectedValueException(JText::sprintf('JCONTENT_INVALID_ACCESS_LEVEL', $this->access));\n\t\t\t}\n\t\t}\n\t}",
"public function getAccessLevel(){\r\n\t\treturn $this->accessLvl;\r\n\t}",
"public function isAccessLevelToClient() {\n $accessLevels = ['client','salescenter','salesagent'];\n return in_array($this->access_level, $accessLevels);\n }",
"public function testAccessLevelAccessDenied() {\n\t\t$this->client->mc_enum_access_levels( 'administrator', '' );\n\t}",
"public function hasAccess() {\r\n\t\treturn true;\r\n\t}",
"public function accessListCheck($level)\n\t{\n\t\t$CM\t= controller::getCurrentController().\"/\".controller::getCurrentMethod();\n\t\t$acl\t= $this->accessList();\n\t\treturn true; ## no more access list checking, because each role has now assigned to each subcontroller.\n\t\t## not isset.\n\t\tif(!isset($acl[$CM]))\n\t\t{\n\t\t\tif(!request::isAjax())\n\t\t\t{\n\t\t\t\terror::set(\"Access\",\"Access list not found.\");\n\t\t\t}\n\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse if(!in_array($level,$acl[$CM]))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"static public function check_access($level = null)\n\t{\n\n\t\t$user = \\Model_Users::build()->where('user', Session::get('username'))->execute();\n\t\t$user = $user[0];\n\t\tif($level == null)\n\t\t{\n\t\t\treturn $user->access;\n\t\t}\n\t\tif(is_string($level))\n\t\t{\n\t\t\tswitch ($level) \n\t\t\t{\n\t\t\t\tcase 'banned':\n\t\t\t\t\t$level = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'customer':\n\t\t\t\t\t$level = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'privilege':\n\t\t\t\t\t$level = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'admin':\n\t\t\t\t\t$level = 3;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(isset($user->access))\n\t\t{\n\t\t\tif($user->access >= $level)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function getAccessLevel() {\n\t\t\t\n\t\t$accessLevel = 0;\n\t\t\n\t\t$sql = \"SELECT * FROM <<\".TABLE_ACCOUNT.\">> LIMIT 1\";\n\t\t$result = $this->core->call('ModuleDatabase', 'executeScalar', $sql);\n\t\t\t\n\t\tif (empty($result)) {\n\t\t\t$accessLevel = array_search(CONF_ACC_SUPERADMIN, CONST_ACCESSLEVEL);\n\t\t} else {\n\t\t\tif (CONST_ACCOUNT_CONFIRMATION != 0) {\n\t\t\t\t$accessLevel = array_search(CONF_ACC_NEWUSER, CONST_ACCESSLEVEL);\n\t\t\t\t$accountCode = MUtil::getRandomString(CONST_ACCOUNT_CODE_LENGTH);\n\t\t\t} else {\n\t\t\t\t$accessLevel = array_search(CONF_ACC_USER, CONST_ACCESSLEVEL);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $accessLevel;\n\t\t\n\t}",
"public function getAccessLevel()\n\t{\n\t\t$accessLevel = array();\n\t\t$accessLevel[] = $this->collection->access;\n\t\tif ($this->collection->object_type == 'group')\n\t\t{\n\t\t\t$group = \\Hubzero\\User\\Group::getInstance($this->collection->object_id);\n\t\t\tif ($group)\n\t\t\t{\n\t\t\t\t$groupAccess = \\Hubzero\\User\\Group\\Helper::getPluginAccess($group, 'collections');\n\t\t\t\tif ($groupAccess == 'anyone')\n\t\t\t\t{\n\t\t\t\t\t$accessLevel[] = 1;\n\t\t\t\t}\n\t\t\t\telseif ($groupAccess == 'registered')\n\t\t\t\t{\n\t\t\t\t\t$accessLevel[] = 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$accessLevel[] = 4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$accessLevel = max($accessLevel);\n\t\tswitch ($accessLevel)\n\t\t{\n\t\t\tcase 0:\n\t\t\tcase 1:\n\t\t\t\treturn 'public';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\treturn 'registered';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn 'private';\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function userHasAccess(){\n\t\tif( !$this->user->isAuth() && !$this->user->auth() ){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->user->hasAccessToLevel( $this->getLevelId() );\n\t}",
"public function hasAccess($accessEntityUuid, $accessLevel);",
"function checkAccessRight(){\r\n \t$res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*',$this->personTable,'feuser_id='.intval($GLOBALS['TSFE']->fe_user->user['uid']));\r\n \tif($res[0]['publadmin'] || $this->person['feuser_id']==intval($GLOBALS['TSFE']->fe_user->user['uid'])){\r\n \t\treturn true;\r\n \t}else{\r\n \t\treturn false;\r\n \t}\r\n }",
"public static function accessAllowed($levelOfSecurity)\n\t{ \n\t $flag=false;\n\t\tif ($levelOfSecurity=='all') {\n\t\t $flag=true;\n\t\t\treturn $flag;\n\t\t}else {\n\t\t $flag=self::ValidateLoginAdmin();\n\t\t\treturn $flag;\n\t\t}\n\t\t\n\t}",
"public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}",
"public function getAccessLevel() {\n\n\t\tif (!is_null($this->baseRoute)) {\n\t\t\t$module = ucfirst(substr($this->baseRoute, 1));\n\t\t} else {\n\t\t\t$module = ucfirst(get_class($this));\n\t\t}\n\n\t\tif (Yii::app()->user->checkAccess($module . 'Admin'))\n\t\t\treturn 3;\n\t\telseif (Yii::app()->user->checkAccess($module . 'View'))\n\t\t\treturn 2;\n\t\telseif (Yii::app()->user->checkAccess($module . 'PrivateReadOnlyAccess'))\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}",
"public function testHasAccess()\n {\n $mock = $this->getMockBuilder(LooEntityManager::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n /** @var LooEntityManager $mock */\n $management = new Roles(\n $mock,\n [\n 'admin' => 'user',\n 'user' => 'guest',\n 'guest' => 'guest',\n ]\n );\n\n $this->assertTrue($management->hasAccess('admin', 'guest'));\n $this->assertTrue($management->hasAccess('admin', 'user'));\n $this->assertTrue($management->hasAccess('admin', 'admin'));\n\n $this->assertTrue($management->hasAccess('user', 'guest'));\n $this->assertTrue($management->hasAccess('user', 'user'));\n $this->assertFalse($management->hasAccess('user', 'admin'));\n\n $this->assertTrue($management->hasAccess('guest', 'guest'));\n $this->assertFalse($management->hasAccess('guest', 'user'));\n $this->assertFalse($management->hasAccess('guest', 'admin'));\n\n $this->assertFalse($management->hasAccess(null, 'guest'));\n $this->assertFalse($management->hasAccess(null, 'user'));\n $this->assertFalse($management->hasAccess(null, 'admin'));\n }",
"protected function validate_access()\n {\n return true;\n }",
"public function setAccessLevel($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(1, $var);\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation auEssSelfManagedSuperFundPostAsync Create ESS Self Managed Super Fund | public function auEssSelfManagedSuperFundPostAsync($employee_id, $fund, string $contentType = self::contentTypes['auEssSelfManagedSuperFundPost'][0])
{
return $this->auEssSelfManagedSuperFundPostAsyncWithHttpInfo($employee_id, $fund, $contentType)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function auEssSelfManagedSuperFundPutRequest($id, $employee_id, $fund, string $contentType = self::contentTypes['auEssSelfManagedSuperFundPut'][0])\n {\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 auEssSelfManagedSuperFundPut'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling auEssSelfManagedSuperFundPut'\n );\n }\n\n // verify the required parameter 'fund' is set\n if ($fund === null || (is_array($fund) && count($fund) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fund when calling auEssSelfManagedSuperFundPut'\n );\n }\n\n\n $resourcePath = '/api/v2/ess/{employeeId}/selfmanagedsuperfund/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n [],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (isset($fund)) {\n if (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the body\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fund));\n } else {\n $httpBody = $fund;\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 (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PUT',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testSuperFundsSuperFundIDPost()\n {\n }",
"public function auEssSuperFundPost($employee_id, $model, string $contentType = self::contentTypes['auEssSuperFundPost'][0])\n {\n list($response) = $this->auEssSuperFundPostWithHttpInfo($employee_id, $model, $contentType);\n return $response;\n }",
"public function createSubAccount()\n {\n $data = [\n \"business_name\" => request()->business_name,\n \"settlement_bank\" => request()->settlement_bank,\n \"account_number\" => request()->account_number,\n \"percentage_charge\" => request()->percentage_charge,\n \"primary_contact_email\" => request()->primary_contact_email,\n \"primary_contact_name\" => request()->primary_contact_name,\n \"primary_contact_phone\" => request()->primary_contact_phone,\n \"metadata\" => request()->metadata,\n 'settlement_schedule' => request()->settlement_schedule\n ];\n\n $this->setRequestOptions();\n return $this->setHttpResponse('/subaccount', 'POST', array_filter($data))->getResponse();\n }",
"public function create(){\n $this->authenticate() ;\n $this->verifyRequiredParams(\"picture,fullname,birthday,state,profile,education,party,type,achievments\") ;\n $aspirant = new aspirantModel();\n $result = $aspirant->createNew($_POST);\n parent::sendResponse($result);\n }",
"public function apiPublicV1StelleCreatePost($body = null, $x_api_key = null)\n {\n $this->apiPublicV1StelleCreatePostWithHttpInfo($body, $x_api_key);\n }",
"public function createSuperfundWithHttpInfo($xeroTenantId, $superfunds)\n {\n $request = $this->createSuperfundRequest($xeroTenantId, $superfunds);\n\n $response = $this->getSyncClient()->sendRequest($request);\n\n $statusCode = (int)$response->getStatusCode();\n\n switch($statusCode) {\n case 200:\n return [\n 'model' => ObjectSerializer::deserialize($response, '\\Consilience\\Xero\\PayrollAuSdk\\Model\\Superfunds'),\n 'request' => $request,\n 'response' => $response\n ];\n }\n\n $returnType = '\\Consilience\\Xero\\PayrollAuSdk\\Model\\Superfunds';\n\n return [\n 'model' => ObjectSerializer::deserialize($response, $returnType),\n 'request' => $request,\n 'response' => $response\n ];\n }",
"public function store()\n\t{\n\t\t$input = Request::all();\n\t\t$validator = Validator::make($input, FinancialAccount::getCreateRules());\n\t\tif($validator->fails()) {\n\n\t\t\treturn ApiResponse::validation($validator);\n\t\t}\n\n\t\ttry {\n\t\t\t$financialAccount = $this->repo->createFinancialAccount($input['name'], $input['account_type'], $input['account_sub_type'], $input);\n\n\t\t\tEvent::fire('JobProgress.Events.FinancialAccountCreated', new FinancialAccountCreated($financialAccount));\n\n\t\t\treturn ApiResponse::success([\n\t\t\t\t'message' => trans('response.success.created', ['attribute' => 'Financial Account']),\n\t\t\t\t'data' => $this->response->item($financialAccount, new FinancialAccountTransformer)\n\t\t\t]);\n\t\t} catch(FinancialSubAccountMaxLimitExceedException $e){\n\n\t\t\treturn ApiResponse::errorGeneral($e->getMessage());\n\t\t} catch(ParentAccountTypeNotSameException $e){\n\n\t\t\treturn ApiResponse::errorGeneral($e->getMessage());\n\t\t} catch(ModelNotFoundException $e) {\n\n\t\t\treturn ApiResponse::errorNotFound('Financial Account Type Not Found.');\n\t\t} catch(Exception $e) {\n\n\t\t\treturn ApiResponse::errorInternal(trans('response.error.internal'), $e);\n\t\t}\n\t}",
"public function createSelf($attributes) {\n\n if($this->isValid($attributes)) {\n \n /**\n * mengambil client_id\n */\n\n $user_id = isset($attributes['user_id'])?$attributes['user_id']:Auth::user()->id; //$attributes['user_id'] untuk API\n DB::beginTransaction();\n\n /**\n * mengambil cfp_id\n */\n\n $cfp_id = isset($attributes['user_id'])?$attributes['user_id']:CfpClient::select('cfp_id')->where('client_id', $user_id)->pluck('cfp_id');\n if(is_null($cfp_id)){\n throw new ValidationException('Financial checkup cashflow analysis validation failed', [\n 'cfp' => 'You don\\'t have CFP assigned',\n ]);\n }\n\n /**\n | Mengmbil version terakhir ...\n | ------------------------------------\n | Version penomoran untuk client setiap kali melakukan financial checkup\n | Query di bawah berfungsi untuk mengecek version terakhir \n | yang nilainya sama dengan jumlah setiap kali client melakukan financial checkup\n | Jika client belum melakukan financila checkup maka nilainya 0\n |\n */\n\n $activeVersion = ActiveVersion::where('user_id', $user_id)->where('key', 'financialCheckup_cashflowAnalysis')->first();\n \n /**\n * Daftar category pendapatan & pengeluaran ...\n */\n\n $modules = [ \n \n // Pendapatan ...\n\n 'income' => [\n 'post_name' => 'incomes',\n 'model_name' => 'Income'\n ], \n \n // Pengeluaran ... \n \n 'expense' => [ \n 'post_name' => 'expenses',\n 'model_name' => 'Expense'\n ], \n 'debt_repayment' => [\n 'post_name' => 'debt_repayments',\n 'model_name' => 'DebtRepayment'\n ], \n 'asset_repayment' => [\n 'post_name' => 'asset_repayments',\n 'model_name' => 'AssetRepayment'\n ],\n 'insurance' => [\n 'post_name' => 'insurances',\n 'model_name' => 'Insurance'\n ]\n ];\n\n $all_expenses = 0;\n $all_expenses_map = [\n 'expense' => 'anggaran_perbulan',\n 'debt_repayment' => 'cicilan_perbulan',\n 'asset_repayment' => 'cicilan_perbulan',\n 'insurance' => 'premi_perbulan'\n ];\n\n\n /**\n * Version terakhir + 1 sebagai nilai version baru yang akan di masukan\n */\n\n $module_version = is_null($activeVersion)?0:$activeVersion->version+1;\n\n $attributes_res = [];\n\n /**\n | Dilakukan perulangan untuk setiap module pendapatan & pengeluaran\n | - income\n | - expense\n | - debt_repayment\n | - asset_repayment\n | - insurance\n |\n */\n\n $default_categories = \\DB::select(\"\n SELECT\n a.id,\n a.title,\n a.slug,\n '\".url().\"/' || a.image image,\n a.description,\n to_number(to_char(a.budged_percentage, 'FM99999.9999'), '9999.99') budged_percentage\n FROM taxonomies a \n WHERE \n a.post_type = 'wallet' \n AND a.budged_percentage is not null\n ORDER BY a.id\n \");\n $pendapatan_tidak_tetap_default = isset($attributes['incomes'][0]['pendapatan_tidak_tetap_bulan']) ? $attributes['incomes'][0]['pendapatan_tidak_tetap_bulan'] : 0;\n\n $income_default = $attributes['incomes'][0]['pendapatan_bulanan'] + $pendapatan_tidak_tetap_default;\n if(!isset($attributes['expenses'][0])){\n foreach($default_categories as $default){\n $nested['taxo_wallet_id'] = $default->id;\n $nested['anggaran_perbulan'] = $default->budged_percentage / 100 * $income_default;\n $nested['catatan'] = '';\n $attributes['expenses'][] = $nested;\n }\n }\n\n // if(!isset($attributes['debt_repayments'][0]) && !is_null($activeVersion)){\n // $data_debt_repayments = DebtRepayment::where('user_id', $user_id)->where('version',$activeVersion->version)->get();\n\n // foreach($data_debt_repayments as $data_debt){\n // $nested_debt['taxo_wallet_id'] = $data_debt->taxo_wallet_id;\n // $nested_debt['nama'] = $data_debt->nama;\n // $nested_debt['cicilan_perbulan'] = $data_debt->cicilan_perbulan;\n // $nested_debt['sisa_durasi'] = $data_debt->sisa_durasi;\n // $nested_debt['catatan'] = $data_debt->catatan;\n // $attributes['debt_repayments'][] = $nested_debt;\n // }\n // }\n\n // if(!isset($attributes['asset_repayments'][0]) && !is_null($activeVersion)){\n // $data_asset_repayments = AssetRepayment::where('user_id', $user_id)->where('version',$activeVersion->version)->get();\n // foreach($data_asset_repayments as $data_asset){\n // $nested_asset['taxo_wallet_id'] = $data_asset->taxo_wallet_id;\n // $nested_asset['nama'] = $data_asset->nama;\n // $nested_asset['cicilan_perbulan'] = $data_asset->cicilan_perbulan;\n // $nested_asset['sisa_durasi'] = $data_asset->sisa_durasi;\n // $nested_asset['catatan'] = $data_asset->catatan;\n // $attributes['asset_repayments'][] = $nested_asset;\n // }\n // }\n\n // if(!isset($attributes['insurances'][0]) && !is_null($activeVersion)){\n // $data_insurances = Insurance::where('user_id', $user_id)->where('version',$activeVersion->version)->get();\n // foreach($data_insurances as $data_insurance){\n // $nested_insurance['taxo_wallet_id'] = $data_insurance->taxo_wallet_id;\n // $nested_insurance['no_polis'] = $data_insurance->no_polis;\n // $nested_insurance['premi_perbulan'] = $data_insurance->premi_perbulan;\n // $nested_insurance['taxo_insurance_type_id'] = $data_insurance->taxo_insurance_type_id;\n // $nested_insurance['nilai_pertanggungan'] = $data_insurance->nilai_pertanggungan;\n // $nested_insurance['catatan'] = $data_insurance->catatan;\n // $attributes['insurances'][] = $nested_insurance;\n // }\n // }\n\n foreach ($modules as $module => $attributes_arr) { \n if(isset($attributes[$attributes_arr['post_name']])) { // incomes, expenses, debt_repayments, asset_repayments, insurances\n switch ($module) {\n default:\n $attributes_safe = [];\n foreach ($attributes[$attributes_arr['post_name']] as $idx => $attribute_arr) { \n $attributes_safe[$idx] = $attribute_arr;\n // mengecek request payload untuk pendapatan tidak tetap bulanan apabila tidak diisi\n if($attributes_arr['post_name'] == 'incomes'){\n $attributes_safe[$idx] = [\n 'pendapatan_bulanan' => isset($attributes_safe[0]['pendapatan_bulanan']) ? $attributes_safe[0]['pendapatan_bulanan'] : 0,\n 'pendapatan_tidak_tetap_bulan' => isset($attributes_safe[0]['pendapatan_tidak_tetap_bulan']) ? $attributes_safe[0]['pendapatan_tidak_tetap_bulan'] : 0,\n 'pendapatan_lain' => isset($attributes_safe[0]['pendapatan_lain']) ? $attributes_safe[0]['pendapatan_lain'] : 0, \n ];\n }\n $attributes_safe[$idx] += [\n 'user_id' => $user_id,\n 'version' => $module_version,\n 'created_by' => $cfp_id,\n 'created_at' => Carbon::now(),\n 'updated_by' => $cfp_id,\n 'updated_at' => Carbon::now()\n ];\n \n if(in_array($module, array_keys($all_expenses_map))){\n $all_expenses += $attribute_arr[$all_expenses_map[$module]];\n }\n }\n break;\n }\n \n $model_name = '\\\\App\\\\Models\\\\'.$attributes_arr['model_name']; \n $model = new $model_name;\n\n /**\n | Melakukan insert terhadap tabel Pendapatan dan pengeluaran\n | Tabel:\n | - incomes\n | - expenses\n | - debt_repayments\n | - asset_repayments\n | - insurances\n */\n\n $model::insert($attributes_safe);\n\n $attributes_res[$attributes_arr['post_name']] = $attributes_safe;\n }\n }\n\n\n /**\n * Perhitungan Rekapitulasi ...\n */\n\n $pendapatan_tidak_tetap = isset($attributes['incomes'][0]['pendapatan_tidak_tetap_bulan']) ? $attributes['incomes'][0]['pendapatan_tidak_tetap_bulan'] : 0;\n\n $income = $attributes['incomes'][0]['pendapatan_bulanan'] + $pendapatan_tidak_tetap;\n $pendapatan_lain = $attributes['incomes'][0]['pendapatan_lain'];\n\n $free_cash_flow_tahunan = $pendapatan_lain;\n \n /**\n * Free cash flow adalah pendapatan bulanan di kurangi pengeluaran\n * Sisa anggaran\n */\n\n $free_cash_flow = $income - $all_expenses;\n\n\n /**\n * Add wallet other ...\n */\n\n // Get wallet id where has slug 'other' & 'titipan-transfer'\n $taxo_wallet_other = $this->taxonomy->findBySlug('other', 'wallet');\n $taxo_wallet_titipan_transfer = $this->taxonomy->findBySlug('titipan-transfer', 'wallet');\n \n /**\n |\n | Pada proses ini\n | Memasukan \"Titipan Transfer\" dengan nilai 0 \n | dan memasukan \"Your free cashflow\" / Sisa anggaran\n | pada tabel \"expense\"\n |\n | \n */\n\n if($taxo_wallet_other && $taxo_wallet_titipan_transfer){\n $taxo_wallet_titipan_transfer_data = [\n 'taxo_wallet_id' => $taxo_wallet_titipan_transfer->id,\n 'anggaran_perbulan' => 0,\n 'catatan' => 'Titipan Transfer',\n 'user_id' => $user_id,\n 'version' => $module_version,\n 'created_by' => $cfp_id,\n 'created_at' => Carbon::now(),\n 'updated_by' => $cfp_id,\n 'updated_at' => Carbon::now()\n ];\n\n $taxo_wallet_other_data = [\n 'taxo_wallet_id' => $taxo_wallet_other->id,\n 'anggaran_perbulan' => $free_cash_flow,\n 'catatan' => 'Your free cashflow',\n 'user_id' => $user_id,\n 'version' => $module_version,\n 'created_by' => $cfp_id,\n 'created_at' => Carbon::now(),\n 'updated_by' => $cfp_id,\n 'updated_at' => Carbon::now()\n ];\n \n $taxo_wallet_titipan_transfer = Expense::insert($taxo_wallet_titipan_transfer_data);\n $taxo_wallet_other = Expense::insert($taxo_wallet_other_data); \n // perhitungannya terpisah dari expenses, karena ambilnya dari free cashflow\n \n $attributes_res['expenses'][] = $taxo_wallet_titipan_transfer_data;\n $attributes_res['expenses'][] = $taxo_wallet_other_data;\n }\n \n /**\n | --------------------------------------------------------\n | Masukan Sisa anggaran bulanan (free_cashflow)\n | dan pendapatan lain per tahunan (free_cashflow_annual)\n |--------------------------------------------------------\n */\n\n $balance_attributes_safe = [\n [\n 'name' => 'free_cashflow',\n 'balance' => $free_cash_flow,\n 'balance_datetime' => Carbon::now(),\n 'user_id' => $user_id,\n 'version' => $module_version,\n 'created_by' => $cfp_id,\n 'created_at' => Carbon::now(),\n 'updated_by' => $cfp_id,\n 'updated_at' => Carbon::now()\n ],\n [\n 'name' => 'free_cashflow_annual',\n 'balance' => $free_cash_flow_tahunan,\n 'balance_datetime' => Carbon::now(),\n 'user_id' => $user_id,\n 'version' => $module_version,\n 'created_by' => $cfp_id,\n 'created_at' => Carbon::now(),\n 'updated_by' => $cfp_id,\n 'updated_at' => Carbon::now()\n ]\n ];\n $attributes_res['plan_balances'] = $balance_attributes_safe;\n PlanBalance::insert($balance_attributes_safe);\n \n \n /**\n * Tambahkan (jika belum ada) / update (jika sudah ada) financialCheckup_cashflowAnalysis di tabel active_version\n * untuk menandakan version terakhir\n * (tabel active_version)\n */\n\n $this->updateActiveVersion($user_id, 'financialCheckup_cashflowAnalysis', $module_version);\n\n /**\n * Save active version details (tabel active_version_details) ...\n * di tabel ini lah yang jika statusnya masih \"draf\" perlu di approve menjadi \"approved\"\n */\n\n $insertActiveVersionDetail = activeVersionDetail::create([\n 'user_id' => $user_id, \n 'version' => $module_version,\n 'status' => 'draft',\n 'active_version_key' => 'financialCheckup_cashflowAnalysis',\n 'created_by' => $cfp_id,\n 'created_at' => Carbon::now(),\n 'updated_by' => $cfp_id,\n 'updated_at' => Carbon::now()\n ]);\n\n $activeVersionDetail_id = $insertActiveVersionDetail->id;\n\n /** \n * update asset repayment id lama dengan yg baru saja disimpan\n * tabel plan_analysis_activated\n */\n $this->updateAssetRepaymentUsage($user_id, $module_version);\n\n /** \n * copy wallet transactions old to new\n * tabel asset_repayments_paid\n */\n if($module_version > 0) {\n $this->updateWalletTransactions($user_id, $module_version);\n }\n \n DB::commit();\n\n\n\n\n\n\n\n\n\n\n\n\n\n /**\n | --------------------------------------------------\n | Proses approve \n | --------------------------------------------------\n | Script di bawah ini copy dari function \"approveFinance\"\n | Sebelumnya yang memasukan Financial Checkup adalah CFP\n | Sehingga setelah CFP mengisi FInalcial Checkup Clinet harus mengapprove\n | Di function ini yang memasukan Financial Checkup adalah client \n | jadi functioin approve otomatis di jalankan di function input Financial Checkup ini\n | \n | -------------------------------\n | Parametar yang di perlukan\n |\n | {\n | \"user_id\" : 196,\n | \"active_version_detail_id\" : 176,\n | \"status\" : \"approved\",\n | \"reason_reject\" : \"gue reject nih xxx\"\n | }\n |\n */\n\n DB::beginTransaction();\n $activeVersionDetail = ActiveVersionDetail::where('id', $activeVersionDetail_id)\n ->where('user_id', $user_id)\n ->where('status', 'draft')->first();\n if(is_null($activeVersionDetail)){\n throw new ValidationException('Approval failed', [\n 'finance' => 'Data not found or already approved or rejected',\n ]);\n }else{\n \n $data_update = [\n 'status' => 'approved',\n 'approved_by' => $user_id,\n 'approved_at' => Carbon::now(),\n 'updated_by' => $user_id,\n 'updated_at' => Carbon::now()\n ];\n\n $cycle_saved = $this->cycle->is_full_cycle($user_id);\n \n if($activeVersionDetail->active_version_key == 'financialCheckup_cashflowAnalysis') {\n $cycle_update['cashflow_analysis_version_approved'] = $activeVersionDetail->version;\n } elseif($activeVersionDetail->active_version_key == 'financialCheckup_portfolioAnalysis') {\n $cycle_update['portfolio_analysis_version_approved'] = $activeVersionDetail->version;\n } elseif($activeVersionDetail->active_version_key == 'planAnalysis') {\n $cycle_update['plan_analysis_version_approved'] = $activeVersionDetail->version;\n $cycle_update['completed_at'] = Carbon::now();\n }\n \n /**\n * Melakukan update di tabel cycles, untuk menentukan \n */\n\n Cycle::where('id', $cycle_saved['cycle_id'])->update($cycle_update);\n \n $activeVersionDetail->update($data_update);\n }\n\n DB::commit();\n\n\n\n\n\n /**\n | ----------------------------------------------------------------------------------------------------\n | Kembalikan data mutasi yang sudah di kategorikan ke uncategories, \n | ketika category tidak di pilih lagi saat financial checkup di periode yang sama.\n | ----------------------------------------------------------------------------------------------------\n | 10 September 2018\n | \n */\n $this->updateCategoryMutasiAfterFincheck($user_id, $module_version);\n\n //mutasi akan diunset apabila saat fincheck category tidak tersedia\n $this->updateCategoryMutasiSplitAfterFincheck($user_id, $attributes_res);\n\n\n\n\n\n\n return $attributes_res;\n }\n\n throw new ValidationException('Financial checkup cashflow analysis validation failed', $this->getErrors());\n }",
"function transferFundDynamicAccountCreateUser()\n {\n $token = refreshAuthToken();\n \n global $I_A_N;\n global $P_A_N;\n global $wallet_id;\n global $currency_code;\n global $first_name;\n global $last_name;\n global $endpoint;\n\n $amount = filter_input(INPUT_POST,'amount');\n $recipient_email = filter_input(INPUT_POST,'recipient_email');\n $description = filter_input(INPUT_POST,'description');\n \n $curl = curl_init();\n\n $request_fields = [\n \"TransferFundToDynamicAccountUser\"=>[\n \"Request\"=>[\n \"IssuerAccountNumber\"=>$I_A_N,\n \"FromAccountNumber\"=>$P_A_N,\n \"FromWalletID\"=>$wallet_id,\n \"RecipientFirstName\"=>$first_name, \n \"RecipientLastName\"=>$last_name,\n \"RecipientEmail\"=>$recipient_email,\n \"Currency\"=>$currency_code,\n \"Amount\"=>$amount,\n \"Description\"=>$description\n ]\n ]\n ];\n\n $json_typed = json_encode($request_fields);\n \n curl_setopt_array($curl, array(\n CURLOPT_URL => $endpoint.'/API/v4/Fund/TransferFundDynamicAccountCreateUser',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_POSTFIELDS => $json_typed,\n CURLOPT_HTTPHEADER => array(\n \"Content-Type: application/json\",\n \"Authorization: Bearer \".$token\n )\n ));\n \n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $resp = json_decode($response, true);\n\n //global $go_home;\n\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo \"<h1>User created after dynamic transfer</h1>\";\n //echo \"<p><a href='\".$go_home.\"'>Return to API calls test page</a></p>\";\n foreach($resp as $resps){\n foreach($resps as $resp){\n foreach($resp as $result){\n foreach($result as $transaction){\n foreach($transaction as $details=>$detail){\n echo $details.\" = \".$detail.\"<br>\";\n }\n }\n }\n }\n }\n }\n }",
"function create() {\n Debug::echo(\"POST /api/student/create\");\n\n $create = new Create($this->postAsObj());\n $create->main(); \n }",
"public function auEssSuperFundPostWithHttpInfo($employee_id, $model, string $contentType = self::contentTypes['auEssSuperFundPost'][0])\n {\n $request = $this->auEssSuperFundPostRequest($employee_id, $model, $contentType);\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 (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 switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\SaveSuperFundResponseModel' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\SaveSuperFundResponseModel' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\SaveSuperFundResponseModel', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\SaveSuperFundResponseModel';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 '\\OpenAPI\\Client\\Model\\SaveSuperFundResponseModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function Create()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\t\t\t\n\t\t\t$json = json_decode(RequestUtil::GetBody());\n\n\t\t\tif (!$json)\n\t\t\t{\n\t\t\t\tthrow new Exception('The request body does not contain valid JSON');\n\t\t\t}\n\n\t\t\t$safhuman = new SafHuman($this->Phreezer);\n\n\t\t\t// TODO: any fields that should not be inserted by the user should be commented out\n\n\t\t\t// this is an auto-increment. uncomment if updating is allowed\n\t\t\t// $safhuman->Id = $this->SafeGetVal($json, 'id');\n\n\t\t\t$safhuman->Ci = $this->SafeGetVal($json, 'ci');\n\t\t\t$safhuman->Name = $this->SafeGetVal($json, 'name');\n\t\t\t$safhuman->BloodType = $this->SafeGetVal($json, 'bloodType');\n\t\t\t$safhuman->PhoneNumber = $this->SafeGetVal($json, 'phoneNumber');\n\t\t\t$safhuman->Enabled = $this->SafeGetVal($json, 'enabled');\n\n\t\t\t$safhuman->Validate();\n\t\t\t$errors = $safhuman->GetValidationErrors();\n\n\t\t\tif (count($errors) > 0)\n\t\t\t{\n\t\t\t\t$this->RenderErrorJSON('Please check the form for errors',$errors);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$safhuman->Save();\n\t\t\t\t$this->RenderJSON($safhuman, $this->JSONPCallback(), true, $this->SimpleObjectParams());\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->RenderExceptionJSON($ex);\n\t\t}\n\t}",
"function create_investment()\n\t{\n\t\t$data['user_type'] = $this->tank_auth->get_usertype();\n\t\t$data['user_name'] = $this->tank_auth->get_username();\n\n\t\t$investment_id = $this->account_model->create_investment();\n\t\tif ($investment_id != '') {\n\t\t\t$data['status'] = 'success';\n\t\t\tredirect('account/investment_entry/success');\n\t\t} else {\n\t\t\t$data['status'] = 'failed';\n\t\t\tredirect('account/investment_entry/failed');\n\t\t}\n\t}",
"public function postCreate(TenantRequest $request)\n {\n $tenant = $this->tenantServices->registerTenant($request->all());\n\n do_action(BASE_ACTION_AFTER_CREATE_CONTENT, TENANT_MODULE_SCREEN_NAME, $request, $tenant);\n\n if ($request->input('submit') === 'save') {\n return redirect()->route('admin.tenant.list')->with('success_msg', trans('core-base::notices.create_success_message'));\n } else {\n return redirect()->route('admin.tenant.edit', $tenant->id)->with('success_msg', trans('core-base::notices.create_success_message'));\n }\n }",
"public function testItCreatesANewSubAccountWhenBankAccountCreated()\n {\n Paystack::shouldReceive(\"createSubAccount\")\n ->andReturn([\n \"data\" => [\n \"subaccount_code\" => \"abcdef\",\n ],\n ]);\n\n $response = $this->actingAs($this->user)\n ->postJson(\"api/v1/tenants/{$this->user->tenant->id}/bank_accounts\", [\n \"account_name\" => $this->user->full_name,\n \"account_number\" => \"0038445618\",\n \"bank_code\" => \"055\",\n \"bank_name\" => \"gt bank\",\n \"description\" => \"test\",\n ]);\n\n $response->assertStatus(200);\n\n $this->assertEquals(\"abcdef\", Tenant::first()->subaccount_code);\n }",
"public function create()\n{\n\n \n // $data = 'signed_body=1df4671b8226d552474999160d881214ca8144cbedb73518e1003fe5379b2718.%7B%22first_name%22%3A%22Hanna%20Belford%22%2C%22password%22%3A%22qweqwe123%22%2C%22waterfall_id%22%3A%2217988db1d11b4a1283ae288c339df454%22%2C%22device_id%22%3A%22F2CD7326-EA40-44F8-9FC3-71A0A5E1F55B%22%2C%22email%22%3A%22matveev.alexander.v.l.a.d.imit.ovi4%40gmail.com%22%2C%22username%22%3A%22belfordhanna%22%2C%22_csrftoken%22%3A%22h0rtCU9uwNd4CAojcO61cVEPUl4HbIGs%22%7D&ig_sig_key_version=5';\n\n\n $data = json_encode([\n\n \"first_name\" => $this->full_name, //\"Hanna Belford\",\n \"password\" => $this->password, //\"qweqwe123\",\n \"waterfall_id\" => $this->waterfall_id, //\"17988db1d11b4a1283ae288c339df454\",\n \"device_id\" => $this->uuid, //\"F2CD7326-EA40-44F8-9FC3-71A0A5E1F55B\",\n \"email\"=> $this->email, //\"matveev.a.lexander.v.l.a.d.imit.ovi4@gmail.com\",\n \"username\"=> $this->username, //\"belfordhanna\",\n \"_csrftoken\"=> $this->token, //\"h0rtCU9uwNd4CAojcO61cVEPUl4HbIGs\"\n\n ]);\n $outputs = $this->request('https://i.instagram.com/api/v1/accounts/create/', $this->generateSignature($data));\n\n $this->username_id = $outputs[1]['created_user']['pk'];\n // preg_match('#Set-Cookie: csrftoken=([^;]+)#', $outputs[0], $matcht);\n // $this->token = $matcht[1];\n // echo var_export($outputs); \n\n rename($this->IGDataPath.'cookies.dat', $this->IGDataPath.\"$this->username-cookies.dat\"); \n return $outputs;\n}",
"public function testCreateNewBudgetRequestWithANewUser()\n {\n $dataRequest = [\n 'title' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'email' => 'alejandro.suau@gmail.com',\n 'phone' => '665673769',\n 'address' => 'C/Cala Torta nº 1, 2º 2ª'\n ];\n\n $budgetRequestExpected = new BudgetRequest;\n $budgetRequestExpected->id = 1;\n $budgetRequestExpected->title = $dataRequest['title'];\n $budgetRequestExpected->description = $dataRequest['description'];\n $budgetRequestExpected->user_id = 1;\n $budgetRequestExpected->budget_request_status_id = BudgetRequestStatus::PENDING_ID;\n\n $this->assertCount(0, BudgetRequest::all());\n $this->assertCount(0, User::all());\n\n $this->post(route('budget_requests.store'), $dataRequest)\n ->assertStatus(HttpStatusCode::CREATED)\n ->assertJson($budgetRequestExpected->toArray());\n\n $this->assertCount(1, User::all());\n $this->assertCount(1, BudgetRequest::all());\n }",
"public function createAction()\n {\n $bearbeiterObj = new Bearbeiter();\n if (is_object($bearbeiterObj)) {\n if (!$this->request->hasArgument('bearbeiter')) {\n $this->throwStatus(400, 'Bearbeiter name not provided', null);\n }\n if ($this->request->hasArgument('role')) {\n $role = [$this->request->getArgument('role')];\n }\n if ($this->request->hasArgument('password')) {\n $password = $this->request->getArgument('password');\n }\n if ($this->request->hasArgument('username')) {\n $identifier = $this->request->getArgument('username');\n }\n if ((isset($role) && !empty($role)) && (isset($password) && !empty($password)) && (isset($identifier) && !empty($identifier))) {\n $account = $this->accountFactory->createAccountWithPassword($identifier, $password, $role);\n $this->accountRepository->add($account);\n $bearbeiterObj->setBearbeiter($this->request->getArgument('bearbeiter'));\n $bearbeiterObj->setAccount($account);\n $this->bearbeiterRepository->add($bearbeiterObj);\n $this->persistenceManager->persistAll();\n $this->throwStatus(201, null, null);\n } else {\n $this->throwStatus(400, 'Required data arguemnts not provided', null);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attendance Mark By This Method Post Request | public function mark_attendence(Request $request){
return $this->lecturer_service->mark_attendance($request);
} | [
"public function postEventsAttendance(){\n\t\t$user_id = Auth::id();\n\t\t$event_id = Input::get('event_id');\n\t\t$event_unique_name = \"\";\n\t\t$event_survey_status = \"\";\n\n\t\t// Save Basic Info Data in basic_infos using\n\t\t\t\t$eventsattendance = EventsAttendance::create(array(\n\t\t\t\t\t'user_id'\t\t\t\t=> $user_id,\n\t\t\t\t\t'event_id' \t\t\t\t=> $event_id,\n\t\t\t\t\t'event_unique_name'\t\t=> $event_unique_name,\n\t\t\t\t\t'event_survey_status'\t=> $event_survey_status\n\t\t\t\t));\n\n\t\treturn \"Your Attendance has been Confirmed\";\n\t}",
"public function mark_attendence(Request $request){\n return $this->student_service->mark_attendance($request);\n }",
"public function post_new_staff_attendance(){\n }",
"public function mark_attendance(){\n\t\t$this->layout = 'ajax';\n\t\t// make sure form submitted\t\t\t\n\t\tif($this->request->is('post')){\n\t\t\t$field = trim($this->request->data['type']) == 'in' ? 'in_time' : 'out_time';\n\t\t\t// save is permission for only mark intime\n\t\t\tif($this->request->data['type'] == 'in'){\n\t\t\t\t$perm_field = 'is_permission';\n\t\t\t\t$per_data = trim($this->request->data['pk']);\n\t\t\t}\n\t\t\tif(trim($this->request->data['value']) != '' && $this->request->data['type'] == 'in'){\n\t\t\t\t$reasonField = 'late_reason';\n\t\t\t\t$reason_data = trim($this->request->data['value']);\n\t\t\t}else{\n\t\t\t\t$reasonField = 'out_reason';\n\t\t\t\t$reason_data = trim($this->request->data['value']);\n\t\t\t\t$reason_out_Field = 'out_reason_type';\n\t\t\t\t$reason_out_data = trim($this->request->data['out_reason_type']);\n\t\t\t\t$out_permission = 'out_permission';\n\t\t\t\t$out_permission_data = trim($this->request->data['out_permission']);\n\t\t\t}\n\t\t\t$this->loadModel('HrAttendance');\n\t\t\t// if not marked\n\t\t\tif(!$this->check_already_marked($field)){\n\t\t\t\t$data = array($field => $this->Functions->get_current_date(), 'app_users_id' => $this->Session->read('USER.Login.id'), \n\t\t\t\t$reasonField => $reason_data, $perm_field => $per_data, $reason_out_Field => $reason_out_data, $out_permission => $out_permission_data);\t\t\t\t\n\t\t\t\t// get record for out time\n\t\t\t\tif($field == 'out_time'){\n\t\t\t\t\t$att_data = $this->HrAttendance->find('all', array('fields' => array('id','in_time'), 'conditions' => array('app_users_id' => $this->Session->read('USER.Login.id'), 'in_time like' => $this->Functions->format_cktime($data[$field]).'%'), 'limit' => 1)); \n\t\t\t\t\t// if intime not marked\n\t\t\t\t\tif(empty($att_data[0]['HrAttendance']['in_time'])){\n\t\t\t\t\t\techo 'no_mark';\n\t\t\t\t\t\tdie;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->HrAttendance->id = $att_data[0]['HrAttendance']['id'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// save the todo\n\t\t\t\tif($this->HrAttendance->save($data, true, $fieldList = array($field, $reasonField, $reason_out_Field, $out_permission, 'app_users_id', $perm_field))){\n\t\t\t\t\techo $this->Functions->format_attime($data[$field]);\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\techo 'marked';\n\t\t\t\tdie;\n\t\t\t}\n\t\t}\n\t\tdie;\n\t}",
"public function saveAttendanceAction($request, $response) {\n\t\t$u = $request->getUser();\n\t\t$points = $this->getConfig('incident.points');\n\n\t\t$empid = $request->cleanInt('empid2');\n\t\t$wpitype = $request->cleanString('att_type');\n\t\t$desc = $request->cleanMultiLine('note2');\n\t\t$ca = $request->cleanMultiLine('att_action');\n\t\t$vh = $request->cleanFloat('vac_hr');\n\t\tif ($vh == 0) { $vh = NULL; }\n\n\t\tif (isset($points[$wpitype])) {\n\t\t\t$points = $points[$wpitype];\n\t\t} else {\n\t\t\t$points = 0;\n\t\t}\n\n\t\tif ($wpitype == 'W') {\n\t\t\t$data = _makeNew('wpi_model');\n\t\t\t$ticket = _makeNew('ticket_model');\n\t\t} else {\n\t\t\t$data = _makeNew('attendance_model');\n\t\t\t$data->set('points', $points);\n\t\t\t$ticket = _makeNew('ticket_model');\n\t\t}\n\n\t\t$data->set('code', $wpitype);\n\t\t$data->set('created_on', time());\n\t\t$data->set('updated_on', time());\n\t\t$data->set('owner_id', $u->userId);\n\t\t$data->set('owner_initials', $this->_getUserInitials($u));\n\n\t\t$data->set('incident_date', date('Y-m-d', strtotime($request->cleanString('att_date'))));\n\t\t$data->set('emp_id', $empid);\n\t\t$data->set('description', $desc);\n\t\t$data->set('corr_act', $ca);\n\t\t$data->set('vac_hr', $vh);\n\n\t\t$values = $data->valuesAsArray();\n\t\t$values['att_type'] = $values['code'];\n\t\t$values['att_action'] = $values['corr_act'];\n\n\t\tif (!$this->_allowableDateRange($request->cleanString('att_date'), $u)) {\n\t\t\t$response->addUserMessage('Incident date too far in the past or unable to read date.', 'msg_warn');\n\t\t\t$this->presenter = 'redirect';\n\t\t\t$response->redir = m_appurl('emp/main/view', array('emp_id'=>$empid));\n\t\t\treturn;\n\t\t}\n\n\n\t\t$form = $this->_loadAttendanceForm();\n\t\tif (!$form->validate($values)) {\n\t\t\t//error\n\t\t\t$response->redir = m_appurl('emp/main/view', array('emp_id'=>$empid));\n\t\t\t$this->presenter = 'redirect';\n\t\t\t$u = $request->getUser();\n\t\t\t//$response->addUserMessage('Form is missing required fields.', 'msg_warn');\n\t\t\treturn;\n\t\t}\n\t\t$ticket->setStage($data);\n\n\n\t\t//load up employee account info.\n\t\t$emp = _make('employee_model');\n\t\t$emp->load($empid);\n\n\t\t$acct = _make('dataitem', 'user_account');\n\t\t$acct->load($emp->get('user_account_id'));\n\t\t$ticket->accountItem = $acct;\n\n\t\t$ticket->save();\n\n\t\t$response->redir = m_appurl('emp/main/view', array('emp_id'=>$empid));\n//\t\t$t['url'] = m_appurl('emp/main/view', array('emp_id'=>$empid));\n\t\t$this->presenter = 'redirect';\n\n\t\t$u = $request->getUser();\n\t\t//$response->addUserMessage('Incident saved.');\n\t}",
"public function markAttendee(Request $request)\n {\n $this->markAttendeeValidator(['event_id' => $request->event_id, 'attendee_id' => $request->attendee_id])->validate();\n $attendee = Ticket::where('event_id', $request->event_id)->where('user_id', $request->attendee_id)->first();\n $attendee->attended = $attendee->attended ? 0 : 1;\n $message = $attendee->attended ? \"mark\" : \"unmark\";\n\n if ($attendee->save())\n return response()->json(['message' => \"Successfully $message the attendee as attended\"]);\n return response()->json(['message' => 'Something went wrong in marking/unmarking attendee.'], 500);\n\n }",
"public function createAttendee(Request $request) {\n $attendee = new Attendee();\n $attendee ->user_id = $request->user_id;\n $attendee ->event_id= $request->event_id;\n $attendee ->payment_status = $request->payment_status;\n $attendee ->phone_number= $request->phone_number;\n $attendee ->time = $request->time ;\n $attendee ->attended_status= $request->attended_status;\n $attendee ->transaction_id = $request->transaction_id;\n $attendee ->save();\n \n return response()->json([\n \"message\" => \"Attendee record created\"\n ], 201);\n \n }",
"public function postCreate(){\n\n $timeEntry = new GrantTimeTrackingEntry();\n $timeEntry->user_id = Auth::user()->id;\n $input = Input::all();\n\n $this->postAddTime($timeEntry);\n try{\n $timeEntry->save();\n return Response::json(array('status' => 200, 'message' => 'time was saved '),200 );\n }catch (exception $e){\n return Response::json(array('status' => 401, 'message' => 'time was not saved', 'error' => $e), 401);\n }\n \n\n }",
"public function markAttendance()\n{ \n //the record being updated\n $attend['rowID']=!empty(html_escape($this->input->POST('rowID'))) ? html_escape($this->input->POST('rowID')) : 0; //check if exist \n //the learner being marked\n $attend['lID']=!empty(html_escape($this->input->POST('lID'))) ? html_escape($this->input->POST('lID')) : 0; //check if exist\n //class level subject ID for selected subject\n $attend['clsID']=!empty(html_escape($this->input->POST('clsID'))) ? html_escape($this->input->POST('clsID')) : 0;//check if exist\n //status being send (present/absent)\n $attend['status']=html_escape($this->input->POST('status')); //check if status is 0 or 1\n //call method to update attendance \n $updateStatus = $this->attendance->markAttendance($attend);\n //check if all went well\n if ($updateStatus) {\n echo \"Updated\";\n }\n\n}",
"public function startAttendance()\n\t{\n\t#START LOCATION(add the variables to the model function)///////\n\t\t// $data['status'] = false;\n\n\t\t// $latitude = $this->input->get('latitude');\n\t\t// $longitude = $this->input->get('longitude');\n\t#END/////\n\t\t$course_code = $this->session->userdata('course_code');\n\t\t$otp = rand(345678,765432);\n\t\t$ongoing = 1;\n\t\t$date = date(\"d.m.y\");\n\n\t\t$checkdate = $this->users_model->check_ongoing($course_code);\n\t\tif ($checkdate) {\n\t\t\tforeach ($checkdate as $check) {\n\t\t\t\t$datecheck = $check['date_lastheld'];\n\t\t\t}\n\t\t}\n\t\t\t// save otp in database\n\t\t$result = $this->attendance_model->takeAttendance($otp, $ongoing, $course_code, $datecheck, $date);\n\n\t\tif ($result) {\n\t\t$att = array(\n\t\t\t'otp_set' => TRUE\n\t\t);\n\t\t$this->session->set_userdata($att);\n\n\t\tredirect('users/timetable');\n\t\t//\t\t$data['status'] = true;\n\t\t\t}\n\t//\techo json_encode($data);\n\t}",
"function schedule_post()\n { \n $schedule = new Schedule();\n\n $schedule->date_created = date('Y-m-d H:i:s');\n $schedule->createdbypk = $this->get_user()->user_id;\n $schedule->date_modified = date('Y-m-d H:i:s');\n $schedule->modifiedbypk = $this->get_user()->user_id;\n $schedule->control_nos = $this->_generate_control();\n \n $this->response($this->_schedule_save($schedule, 'post'));\n }",
"public function appointmentWasSet(){\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData(true);\n\n\t\t$org = OrganizationBranch::find($data['org_branch_id']);\n\t\t$org->set_goal_reminder = 1;\n\t\t$org->appointment_set = 1;\n\t\t$org->save();\n\n\t\tSession::put('userinfo.session_reset', 1);\n\n\t\treturn 'success';\n\t}",
"public function insertInDatabase($data,$request){\n if ($request->attendance_type==1) { \n $data['punch_in_time']=$request->time; \n }else{\n $data['punch_out_time']=$request->time;\n }\n\n\n\n\n //first check if the user has punched in on that day\n // if yes then update the punch out time of that day\n // else create new instance with punch out time \n $existing_data=$this->checkExistingData($data); \n\n if ($existing_data->isEmpty()) { \n AttendanceLog::create($data);\n }else{ \n $existing_data[0]->update($data);\n }\n}",
"public function seat_allowcation_post() {\n $data = file_get_contents(\"php://input\");\n $data = json_decode(urldecode($data), TRUE);\n\n $checklicres = $this->licence->checklic($data['app_id'], $data['lic_id']);\n if ($checklicres) { //valid licence\n $checkuserexiestres = $this->licence->checkuserexiest($data['email']);\n if ($checkuserexiestres) {\n //already Logged in with another device\n $res['status'] = 'Failure';\n $res['data'] = 'Already Logged in with Other Device';\n $this->response(apiresponce(0, $res['data'], $res), REST_Controller::HTTP_OK);\n } else {\n // valid user for proceed the licence\n $insert = array(\n 's_identity' => $this->genrate_unique_seat_id(),\n 's_email' => $data['email'],\n 's_app' => $data['app_id'],\n 's_lic' => $data['lic_id'],\n 's_ip' => $data['ip_address'],\n 's_mac' => $data['mac'],\n 's_added_dt' => date('Y-m-d H:i:s', strtotime('now')),\n 's_end_dt' => date('Y-m-d H:i:s', strtotime('now +' . $data['intraval'] . 'Min')),\n );\n $insertres = $this->common_model->insert('seat_allowcation', $insert);\n $seatinfo = $this->common_model->select('seat_allowcation', 's_identity as seat_id,s_end_dt as expire_on', array('s_id' => $insertres));\n if ($seatinfo) {\n $res['status'] = 'Success';\n $res['data'] = 'License Added';\n $this->response(apiresponce(1, $res['data'], $seatinfo), REST_Controller::HTTP_OK);\n } else {\n $res['status'] = 'Failure';\n $res['data'] = 'Some thing went wrong';\n $this->response(apiresponce(1, $res['data'], $res), REST_Controller::HTTP_OK);\n }\n }\n } else {\n //invalid licence\n $res['status'] = 'Failure';\n $res['data'] = 'License Removed or Expired';\n $this->response(apiresponce(0, $res['data'], $res), REST_Controller::HTTP_OK);\n }\n }",
"public function attendance_add()\n {\n $attendance = new Attendance();\n $data = array();\n\n if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {\n if (!empty($_POST['title'])) {\n $check = Security::check_token();\n if ($check) {\n $attendance->set_name($_POST['title']);\n $attendance->set_description($_POST['description']);\n $attendance->set_attendance_qualify_title($_POST['attendance_qualify_title']);\n $attendance->set_attendance_weight($_POST['attendance_weight']);\n $link_to_gradebook = false;\n if ( isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1 ) {\n $link_to_gradebook = true;\n }\n $attendance->category_id = $_POST['category_id'];\n $last_id = $attendance->attendance_add($link_to_gradebook);\n Security::clear_token();\n }\n header('location:index.php?action=calendar_add&attendance_id='.$last_id.'&'.api_get_cidreq());\n exit;\n } else {\n $data['error'] = true;\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('attendance_add');\n $this->view->render();\n }\n } else {\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('attendance_add');\n $this->view->render();\n }\n }",
"public function assign(AttendanceEmp $request)\n {\n $request->validated();\n\n if ($employee = User::whereEmail(request('email'))->first()) {\n\n if (Hash::check($request->pin_code, $employee->pin_code)) {\n if (!Leave::whereLeave_date(date(\"Y-m-d\"))->whereUser_id($employee->id)->first()) {\n $leave = new Leave;\n $leave->user_id = $employee->id;\n $leave->leave_time = date(\"H:i:s\");\n $leave->leave_date = date(\"Y-m-d\");\n // ontime + overtime if true , else \"early go\" ....\n if ($leave->leave_time >= $employee->schedules->first()->time_out ) {\n leaveController::overTime($employee);\n }else{\n $leave->status = 0;\n }\n\n $leave->save();\n } else {\n return redirect()->route('leave.login')->with('error', 'you assigned your leave before');\n }\n } else {\n return redirect()->route('leave.login')->with('error', 'Failed to assign the leave');\n }\n }\n\n\n\n return redirect()->route('home')->with('success', 'Successful in assign the leave');\n }",
"public function appointment() {\n $this->layout = \"\";\n $clinic = $this->Api->submit_cURL(json_encode($_POST), Buzzy_Name . '/api/appointment.json');\n $likecl = json_decode($clinic);\n if ($likecl->appointment->success == 1) {\n $data = array(\n 'success' => 1,\n 'data' => $likecl->appointment->data\n );\n } else {\n $data = array(\n 'success' => 0,\n 'data' => 'Bad Request'\n );\n }\n echo json_encode($data);\n die();\n }",
"public function update_attendance(){ \n\t\t$this->loadModel('HrAttendance');\n\t\tforeach($this->request->data as $key => $data){\n\t\t\t$count = count($data['date']);\n\t\t\t// iterate all the values\n\t\t\tfor($i = 0; $i < $count; $i++){ \n\t\t\t\t// for waive off requests\n\t\t\t\tif($data['chk'][$i] == 'on'){\n\t\t\t\t\t$status = 'A';\n\t\t\t\t\t$waive = '1';\n\t\t\t\t}else{\n\t\t\t\t\t$status = 'R';\n\t\t\t\t\t$waive = NULL;\n\t\t\t\t}\n\t\t\t\t$month = $data['date'][$i];\n\t\t\t\t$user_att_data = $this->HrAttendance->find('all', array('fields' => array('HrAttendance.id'), \n\t\t\t\t'conditions' => array(\"in_time like\" => $data['date'][$i].'%', \n\t\t\t\t'app_users_id' => $this->request->data['HrAttWaive']['user_id']), 'limit' => '1'));\n\t\t\t\t// format array\n\t\t\t\t$ar_data = array('modified_date' => $this->Functions->get_current_date(), 'att_waive' => $waive, 'waive_msg' => $data['remark'][$i]);\n\t\t\t\t$fieldList = array('att_waive', 'modified_date', 'waive_msg');\n\t\t\t\t$this->HrAttendance->id = $user_att_data[0]['HrAttendance']['id'];\n\t\t\t\tif($this->HrAttendance->id != ''){\n\t\t\t\t\tif($this->HrAttendance->save($ar_data, true, $fieldList)){\n\t\t\t\t\t\t// save in the waive off request table\n\t\t\t\t\t\t$ar_data = array('id' => $data['id'][$i], 'status' => $status, 'approve_date' => $this->Functions->get_current_date(),\n\t\t\t\t\t\t'remark' => $data['remark'][$i], 'approve_by' => $this->Session->read('USER.Login.id'));\n\t\t\t\t\t\t$fieldList = array('approve_date', 'remark', 'approve_by', 'id','status');\n\t\t\t\t\t\t$this->HrAttWaive->save($ar_data, true, $fieldList);\n\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>Waive-off request approved successfully', 'default', array('class' => 'alert alert-success'));\t\n\t\t\t\t\t\t$req_status = 'success';\n\t\t\t\t\t}else{ \n\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>Problem in updating the attendance, pls contact admin..', 'default', array('class' => 'alert alert-error'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// send mail to user\n\t\tif($req_status == 'success'){\n\t\t\t$this->notify_user($this->request->data['HrAttWaive']['user_id'], date('M, Y', strtotime($month)));\n\t\t}else{\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>Problem in updating the attendance, pls contact admin..', 'default', array('class' => 'alert alert-error'));\n\t\t}\n\t\t$this->redirect('/hrattwaive/');\t\n\t\t\n\t}",
"public function ExpertOpinionReq_post()\n {\n if(isset($_POST))\n {\n extract($_POST);\n \n $appInfo = $this->Generic_model->getSingleRecord('appointments', array('appointment_id'=>$appointment_id));\n\n $data['case_type'] = $case_type;\n $data['parent_doctor_id'] = $user_id;\n $data['referred_doctor_id'] = $referred_doctor_id;\n $data['appointment_id'] = $appointment_id;\n $data['patient_id'] = $appInfo->patient_id;\n $data['department_id'] = $department_id;\n $data['created_by'] = $user_id;\n $data['created_date_time'] = date(\"Y-m-d H:i:s\");\n $expert_opinion_id = $this->Generic_model->insertDataReturnId(\"expert_opinion\",$data);\n if($expert_opinion_id)\n {\n $data2['expert_opinion_id'] = $expert_opinion_id;\n $data2['sent_by'] = $user_id;\n $data2['message'] = $comments;\n $data2['created_by'] = $user_id;\n $data2['created_date_time'] = date(\"Y-m-d H:i:s\");\n $this->Generic_model->insertData(\"expert_opinion_conversations\",$data2);\n\n $param = \"Request Sent Successfully\"; \n $this->Generic_model->pushNotifications('', $appointment_id, $referred_doctor_id, '', 'EO_Sent_Notification', '');\n $this->Generic_model->pushNotifications('', $appointment_id, $user_id, '', 'EO_Received_Notification', '');\n $this->response(array('code'=>'200','message'=>'Success','result'=>$param));\n }\n else\n {\n $param = \"UnAuthorized Access\"; \n $this->response(array('code'=>'201','message'=>'Error Occurred','result'=>$param)); \n }\n }\n else\n { \n $data = \"UnAuthorized Access\"; \n $this->response(array('code'=>'201','message'=>'Error Occurred','result'=>$data));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the datum_opname_in_gstandaard column Example usage: $query>filterByDatumOpnameInGstandaard(1234); // WHERE datum_opname_in_gstandaard = 1234 $query>filterByDatumOpnameInGstandaard(array(12, 34)); // WHERE datum_opname_in_gstandaard IN (12, 34) $query>filterByDatumOpnameInGstandaard(array('min' => 12)); // WHERE datum_opname_in_gstandaard >= 12 $query>filterByDatumOpnameInGstandaard(array('max' => 12)); // WHERE datum_opname_in_gstandaard | public function filterByDatumOpnameInGstandaard($datumOpnameInGstandaard = null, $comparison = null)
{
if (is_array($datumOpnameInGstandaard)) {
$useMinMax = false;
if (isset($datumOpnameInGstandaard['min'])) {
$this->addUsingAlias(GsInteractiesGegevensPeer::DATUM_OPNAME_IN_GSTANDAARD, $datumOpnameInGstandaard['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($datumOpnameInGstandaard['max'])) {
$this->addUsingAlias(GsInteractiesGegevensPeer::DATUM_OPNAME_IN_GSTANDAARD, $datumOpnameInGstandaard['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(GsInteractiesGegevensPeer::DATUM_OPNAME_IN_GSTANDAARD, $datumOpnameInGstandaard, $comparison);
} | [
"public function filterByStartDatum($startDatum = null, $comparison = null)\n {\n if (is_array($startDatum)) {\n $useMinMax = false;\n if (isset($startDatum['min'])) {\n $this->addUsingAlias(GsHistorischBestandAddOnPeer::START_DATUM, $startDatum['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($startDatum['max'])) {\n $this->addUsingAlias(GsHistorischBestandAddOnPeer::START_DATUM, $startDatum['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsHistorischBestandAddOnPeer::START_DATUM, $startDatum, $comparison);\n }",
"public function filterByUitgavedatum($uitgavedatum = null, $comparison = null)\n {\n if (is_array($uitgavedatum)) {\n $useMinMax = false;\n if (isset($uitgavedatum['min'])) {\n $this->addUsingAlias(GsBestandenPeer::UITGAVEDATUM, $uitgavedatum['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($uitgavedatum['max'])) {\n $this->addUsingAlias(GsBestandenPeer::UITGAVEDATUM, $uitgavedatum['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsBestandenPeer::UITGAVEDATUM, $uitgavedatum, $comparison);\n }",
"public function getFilterdata(){\n \t\t$where = '';\n\t\tif($this->input->post('dateRange')) {\n\t\t\t$date = explode(' - ', $this->input->post('dateRange'));\n\t\t\t$where = \" DATE_FORMAT(`atm_estate`.`\".$this->input->post('colName').\"`, '%Y/%m/%d') >= '\".date('Y/m/d', strtotime($date[0])).\"' AND DATE_FORMAT(`atm_estate`.`\".$this->input->post('colName').\"`, '%Y/%m/%d') <= '\".date('Y/m/d', strtotime($date[1])).\"' \";\n\t\t}\n\t\t$data[\"view_data\"]= $this->Atm_estate_model->get_data($where);\n\t\techo $this->load->view(\"tableData\",$data, true);\n\t\tdie;\n \t}",
"public function filterByDatumLaasteMutatieInGstandaard($datumLaasteMutatieInGstandaard = null, $comparison = null)\n {\n if (is_array($datumLaasteMutatieInGstandaard)) {\n $useMinMax = false;\n if (isset($datumLaasteMutatieInGstandaard['min'])) {\n $this->addUsingAlias(GsInteractiesGegevensPeer::DATUM_LAASTE_MUTATIE_IN_GSTANDAARD, $datumLaasteMutatieInGstandaard['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($datumLaasteMutatieInGstandaard['max'])) {\n $this->addUsingAlias(GsInteractiesGegevensPeer::DATUM_LAASTE_MUTATIE_IN_GSTANDAARD, $datumLaasteMutatieInGstandaard['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsInteractiesGegevensPeer::DATUM_LAASTE_MUTATIE_IN_GSTANDAARD, $datumLaasteMutatieInGstandaard, $comparison);\n }",
"function getDateFilter()\n {\n $qstartdate = makeStartDate($this->weekno_, $this->yearno_, $this->monthno_, $this->\n startweekno_, $this->startDate_);\n $qenddate = makeEndDate($this->weekno_, $this->yearno_, $this->monthno_, $this->\n endDate_);\n //var_dump($qstartdate);\n //var_dump($qenddate);\n if ($qstartdate)\n $sql .= \" kll.kll_timestamp >= '\" . gmdate('Y-m-d H:i', $qstartdate) . \"' \";\n if ($qstartdate && $qenddate)\n $sql .= \" AND \";\n if ($qenddate)\n $sql .= \" kll.kll_timestamp <= '\" . gmdate('Y-m-d H:i', $qenddate) . \"' \";\n return $sql;\n }",
"public function filterByDatumVastleggingWinap($datumVastleggingWinap = null, $comparison = null)\n {\n if (is_array($datumVastleggingWinap)) {\n $useMinMax = false;\n if (isset($datumVastleggingWinap['min'])) {\n $this->addUsingAlias(GsBewakingenKenmerkenPeer::DATUM_VASTLEGGING_WINAP, $datumVastleggingWinap['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($datumVastleggingWinap['max'])) {\n $this->addUsingAlias(GsBewakingenKenmerkenPeer::DATUM_VASTLEGGING_WINAP, $datumVastleggingWinap['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsBewakingenKenmerkenPeer::DATUM_VASTLEGGING_WINAP, $datumVastleggingWinap, $comparison);\n }",
"public function filterByGdsg($gdsg = null, $comparison = null)\n {\n if (is_array($gdsg)) {\n $useMinMax = false;\n if (isset($gdsg['min'])) {\n $this->addUsingAlias(Test tableTableMap::COL_GDSG, $gdsg['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($gdsg['max'])) {\n $this->addUsingAlias(Test tableTableMap::COL_GDSG, $gdsg['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(Test tableTableMap::COL_GDSG, $gdsg, $comparison);\n }",
"public function filterByMutatiekode($mutatiekode = null, $comparison = null)\n {\n if (is_array($mutatiekode)) {\n $useMinMax = false;\n if (isset($mutatiekode['min'])) {\n $this->addUsingAlias(GsBestandenPeer::MUTATIEKODE, $mutatiekode['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($mutatiekode['max'])) {\n $this->addUsingAlias(GsBestandenPeer::MUTATIEKODE, $mutatiekode['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsBestandenPeer::MUTATIEKODE, $mutatiekode, $comparison);\n }",
"public function filterByAgrementstartdate($agrementstartdate = null, $comparison = null)\n {\n if (is_array($agrementstartdate)) {\n $useMinMax = false;\n if (isset($agrementstartdate['min'])) {\n $this->addUsingAlias(SalesPeer::AGREMENTSTARTDATE, $agrementstartdate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($agrementstartdate['max'])) {\n $this->addUsingAlias(SalesPeer::AGREMENTSTARTDATE, $agrementstartdate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesPeer::AGREMENTSTARTDATE, $agrementstartdate, $comparison);\n }",
"public function filterByOpPrestCereel($opPrestCereel = null, $comparison = null)\n {\n if (is_array($opPrestCereel)) {\n $useMinMax = false;\n if (isset($opPrestCereel['min'])) {\n $this->addUsingAlias(OperationPrestationsPeer::OP_PREST_CEREEL, $opPrestCereel['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($opPrestCereel['max'])) {\n $this->addUsingAlias(OperationPrestationsPeer::OP_PREST_CEREEL, $opPrestCereel['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(OperationPrestationsPeer::OP_PREST_CEREEL, $opPrestCereel, $comparison);\n }",
"public function filterByDatum($datum = null, $comparison = null)\n {\n if (is_array($datum)) {\n $useMinMax = false;\n if (isset($datum['min'])) {\n $this->addUsingAlias(EintragTableMap::COL_DATUM, $datum['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($datum['max'])) {\n $this->addUsingAlias(EintragTableMap::COL_DATUM, $datum['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EintragTableMap::COL_DATUM, $datum, $comparison);\n }",
"public function getFilterdata(){\n \t\t$where = '';\n\t\tif($this->input->post('dateRange')) {\n\t\t\t$date = explode(' - ', $this->input->post('dateRange'));\n\t\t\t$where = \" DATE_FORMAT(`income`.`\".$this->input->post('colName').\"`, '%Y/%m/%d') >= '\".date('Y/m/d', strtotime($date[0])).\"' AND DATE_FORMAT(`income`.`\".$this->input->post('colName').\"`, '%Y/%m/%d') <= '\".date('Y/m/d', strtotime($date[1])).\"' \";\n\t\t}\n\t\t$data[\"view_data\"]= $this->Income_model->get_data($where);\n\t\techo $this->load->view(\"tableData\",$data, true);\n\t\tdie;\n \t}",
"public function filterBySadate($sadate = null, $comparison = null)\n {\n if (is_array($sadate)) {\n $useMinMax = false;\n if (isset($sadate['min'])) {\n $this->addUsingAlias(AliStockcardSTableMap::COL_SADATE, $sadate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sadate['max'])) {\n $this->addUsingAlias(AliStockcardSTableMap::COL_SADATE, $sadate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliStockcardSTableMap::COL_SADATE, $sadate, $comparison);\n }",
"public function filterByBedragInschrijving($bedragInschrijving = null, $comparison = null)\n\t{\n\t\tif (is_array($bedragInschrijving)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($bedragInschrijving['min'])) {\n\t\t\t\t$this->addUsingAlias(KansPeer::BEDRAG_INSCHRIJVING, $bedragInschrijving['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($bedragInschrijving['max'])) {\n\t\t\t\t$this->addUsingAlias(KansPeer::BEDRAG_INSCHRIJVING, $bedragInschrijving['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(KansPeer::BEDRAG_INSCHRIJVING, $bedragInschrijving, $comparison);\n\t}",
"public function filterByOperationDate($operationDate = null, $comparison = null)\n {\n if (is_array($operationDate)) {\n $useMinMax = false;\n if (isset($operationDate['min'])) {\n $this->addUsingAlias(DocPeer::OPERATION_DATE, $operationDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($operationDate['max'])) {\n $this->addUsingAlias(DocPeer::OPERATION_DATE, $operationDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(DocPeer::OPERATION_DATE, $operationDate, $comparison);\n }",
"public function filterByDataCadastro($dataCadastro = null, $comparison = null)\n\t{\n\t\tif (is_array($dataCadastro)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dataCadastro['min'])) {\n\t\t\t\t$this->addUsingAlias(IgrejaPeer::DATA_CADASTRO, $dataCadastro['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dataCadastro['max'])) {\n\t\t\t\t$this->addUsingAlias(IgrejaPeer::DATA_CADASTRO, $dataCadastro['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(IgrejaPeer::DATA_CADASTRO, $dataCadastro, $comparison);\n\t}",
"public function filterByGeboorteDatum($geboorteDatum = null, $comparison = null)\n {\n if (is_array($geboorteDatum)) {\n $useMinMax = false;\n if (isset($geboorteDatum['min'])) {\n $this->addUsingAlias(RemAanvraagTableMap::COL_GEBOORTE_DATUM, $geboorteDatum['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($geboorteDatum['max'])) {\n $this->addUsingAlias(RemAanvraagTableMap::COL_GEBOORTE_DATUM, $geboorteDatum['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(RemAanvraagTableMap::COL_GEBOORTE_DATUM, $geboorteDatum, $comparison);\n }",
"public function filterByBookkingDate($bookkingDate = null, $comparison = null)\n {\n if (is_array($bookkingDate)) {\n $useMinMax = false;\n if (isset($bookkingDate['min'])) {\n $this->addUsingAlias(DocPeer::BOOKKING_DATE, $bookkingDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($bookkingDate['max'])) {\n $this->addUsingAlias(DocPeer::BOOKKING_DATE, $bookkingDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(DocPeer::BOOKKING_DATE, $bookkingDate, $comparison);\n }",
"public function filterByGpk($gpk = null, $comparison = null)\n {\n if (is_array($gpk)) {\n $useMinMax = false;\n if (isset($gpk['min'])) {\n $this->addUsingAlias(GsArtikelEigenschappenPeer::GPK, $gpk['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($gpk['max'])) {\n $this->addUsingAlias(GsArtikelEigenschappenPeer::GPK, $gpk['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsArtikelEigenschappenPeer::GPK, $gpk, $comparison);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Log a message at the info level. | function info($message) {
$this->log($message, self::LEVEL_INFO);
} | [
"public static function info($message=\"\") {\n Logger::log(Logger::INFO, $message);\n }",
"public static function info()\n {\n if (self::isLoggableLevel('info')) {\n $messages = func_get_args();\n foreach ($messages as $message) {\n self::writeLog('info', $message);\n }\n }\n }",
"public static function logInfo($info)\n\t{\n\t\tself::logEvent(\"Info\", $info);\n\t}",
"public static function info($message)\n\t{\n\t\tself::write(self::LEVEL_INFO, $message);\n\t}",
"public function info($msg) {\n if ($this->level & E_NOTICE) $this->log_message('INFO', $msg);\n }",
"public function info( $message ) {\n\t\t$this->write( STDOUT, $message . \"\\n\" );\n\t}",
"function info($logEntry) {\n $this->writeLog($this->prefixEntry($logEntry, \"INFO\"), INFO);\n }",
"public static function info()\n\t{\n\t\t$log = RSLog::sharedInstance();\n\t\tcall_user_func_array(\n\t\t\tarray( $log, 'log' ),\n\t\t\tarray_merge( array( RSLog::INFO ), func_get_args() ) );\n\t}",
"public function info($msg) {\n $this->writeLine($msg, 'info');\n }",
"function log_info(string $message = '', $context = [], $name = null)\n {\n if (Logger::isName($context, $name)) {\n $name = $context;\n $context = [];\n }\n\n $logger = \\logger_instance($name);\n if ($logger instanceof LoggerInterface)\n return $logger->info($message, $context);\n }",
"static function information($message)\n {\n self::add($message, self::CLASS_INFO);\n }",
"public function info($message)\n\t{\n\t\t$this->flash('info', $message);\n\t}",
"public function info($message)\n {\n $flash = $this->flashtype['info'];\n $flash['message'] = $message;\n $this->add($flash);\n }",
"public function testLogInfoMessage()\n {\n $message = 'Test info message';\n\n Logger::logInfo($message);\n\n $this->assertEquals($message, $this->logger1->message);\n $this->assertEquals('Info', $this->logger1->level);\n }",
"public static function info($msg) {\n if (func_num_args() > 1) {\n $args = func_get_args();\n $msg = array_shift($args);\n $msg = vsprintf($msg, $args);\n }\n\n return self::log($msg, self::LEVEL_INFO);\n }",
"public function logInfo(): void\n {\n if ($this->getVerbosity()>=OutputInterface::VERBOSITY_NORMAL)\n {\n $args = func_get_args();\n $format = array_shift($args);\n\n $this->writeln(vsprintf('<info>'.$format.'</info>', $args));\n }\n }",
"public function setInfo($var)\n {\n GPBUtil::checkMessage($var, \\Chat\\proto\\Info::class);\n $this->info = $var;\n\n return $this;\n }",
"public function logInfo($line)\n {\n $this->log($line, self::INFO);\n }",
"public function info($message = null)\n {\n return $this->toast($message, 'info');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a frameset so our JavaScript Reference isn't lost Took some brains to figure this one out ;) If Peter wouldn't have been I would've gone insane... | public function frameSet()
{
$this->getDocumentTemplate()->JScode = $this->getDocumentTemplate()->wrapScriptTags('
if (!window.opener) {
alert("ERROR: Sorry, no link to main window... Closing");
close();
}
');
$this->getDocumentTemplate()->startPage($this->getLanguageService()->getLL('geoselector_title'));
// URL for the inner main frame:
$url = BackendUtility::getModuleUrl(
'wizard_GooglePicker',
[
'showPicker' => 1,
'currentValue' => $this->wizardParameters['currentValue'],
'fieldName' => $this->wizardParameters['itemName'],
'formName' => $this->wizardParameters['formName'],
'exampleImg' => $this->wizardParameters['exampleImg'],
'md5ID' => $this->wizardParameters['md5ID'],
'fieldChangeFunc' => serialize($this->wizardParameters['fieldChangeFunc']),
'fieldChangeFuncHash' => $this->wizardParameters['fieldChangeFuncHash'],
]
);
$this->content = $this->getPageRenderer()->render(PageRenderer::PART_HEADER) . '
<frameset rows="*,1" framespacing="0" frameborder="0" border="0">
<frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
</frameset>
';
} | [
"public static function frames(): Collection;",
"public function getFrames();",
"function iciq_frameset_func( ) {\n\tinclude( 'pubframeset.html' );\n}",
"function printFrameset()\n {\n if (t3lib_div::_GP('show')=='both') {\n return '\n <html>\n <head>\n <title>Preview and compare workspace version with live version</title>\n </head>\n <frameset cols=\"*\" framespacing=\"3\" frameborder=\"3\" border=\"3\">\n <frameset rows=\"22,60%,20,40%\" framespacing=\"3\" frameborder=\"3\" border=\"3\">\n <frame name=\"frame_drafth\" src=\"'.htmlspecialchars($this->URL['draftHeader']).'\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"1\" scrolling=\"no\">\n <frame name=\"frame_draft\" src=\"'.htmlspecialchars($this->URL['draft']).'\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"1\" scrolling=\"auto\">\n <frame name=\"frame_liveh\" src=\"'.htmlspecialchars($this->URL['liveHeader']).'\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"1\" scrolling=\"no\">\n <frame name=\"frame_live\" src=\"'.htmlspecialchars($this->URL['live']).'\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"1\" scrolling=\"auto\">\n </frameset>\n </frameset>\n </html>';\n } else {\n return '\n <html>\n <head>\n <title>Preview workspace version</title>\n </head>\n <frameset cols=\"*\" framespacing=\"3\" frameborder=\"3\" border=\"3\">\n <frameset rows=\"22,*\" framespacing=\"3\" frameborder=\"3\" border=\"3\">\n <frame name=\"frame_drafth\" src=\"'.htmlspecialchars($this->URL['draftHeader']).'\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"1\" scrolling=\"no\">\n <frame name=\"frame_draft\" src=\"'.htmlspecialchars($this->URL['draft']).'\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"1\" scrolling=\"auto\">\n </frameset>\n </frameset>\n </html>';\n }\n }",
"function frames() {\r\n extract($GLOBALS);\r\n $_SESSION[\"BodyWidth\"] = \"620\";\r\n\r\n ShowHTML('<html>');\r\n ShowHTML('<head>');\r\n ShowHTML(' <title>Controle Central</title>');\r\n ShowHTML('</head>');\r\n\r\n ShowHTML('<frameset cols=\"200,*\">');\r\n ShowHTML(' <frame name=\"menu\" src=\"controle.php?par=menu\" scrolling=\"auto\" marginheight=\"0\" marginwidth=\"0\">');\r\n ShowHTML(' <frame name=\"content\" src=\"controle.php?par=escolas\" scrolling=\"auto\" marginheight=\"0\" marginwidth=\"0\">');\r\n ShowHTML('</frameset>');\r\n ShowHTML('</html>');\r\n }",
"function dumpContents()\r\n {\r\n if (($this->ControlState & csDesigning)==csDesigning)\r\n {\r\n $msg=$this->Name;\r\n $msg=\"$this->Name<br>place Frames inside this Frameset\";\r\n\r\n $bstyle=\" style=\\\"border: 1px dotted #000000;font-size:10px; font-family:verdana,tahoma,arial\\\" \";\r\n echo \"<table border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" width=\\\"$this->width\\\" height=\\\"$this->height\\\"><tr><td $bstyle align=\\\"center\\\">$msg</td></tr></table>\";\r\n }\r\n else\r\n {\r\n reset($this->controls->items);\r\n $vframes=array();\r\n $hframes=array();\r\n while (list($k,$v)=each($this->controls->items))\r\n {\r\n if (($v->inheritsFrom('Frame')) || ($v->inheritsFrom('Frameset')))\r\n {\r\n if (($v->Align==alTop) || ($v->Align==alBottom))\r\n {\r\n $vframes[$v->Top]=$v;\r\n }\r\n if (($v->Align==alLeft) || ($v->Align==alRight))\r\n {\r\n $hframes[$v->Left]=$v;\r\n }\r\n }\r\n }\r\n\r\n ksort($vframes,SORT_NUMERIC);\r\n ksort($hframes,SORT_NUMERIC);\r\n\r\n //Dump rows\r\n if (count($vframes)!=0)\r\n {\r\n reset($vframes);\r\n $topheights=\"\";\r\n $bottomheights=\"\";\r\n while(list($key, $val)=each($vframes))\r\n {\r\n if ($val->Align==alTop) $topheights.=$val->Height.\",\";\r\n if ($val->Align==alBottom) $bottomheights.=\",\".$val->Height;\r\n }\r\n\r\n $events = $this->readFramesetJSEvents();\r\n\r\n echo \"<frameset rows=\\\"$topheights*$bottomheights\\\" cols=\\\"*\\\" frameborder=\\\"$this->FrameBorder\\\" border=\\\"$this->BorderWidth\\\" framespacing=\\\"$this->FrameSpacing\\\" $events>\\n\";\r\n reset($vframes);\r\n while(list($key, $val)=each($vframes))\r\n {\r\n if ($val->Align==alTop) $val->show();\r\n }\r\n //Dump here the horizontal frameset\r\n //**********************************\r\n $this->dumpHorizontalFrames($hframes, false);\r\n //**********************************\r\n reset($vframes);\r\n while(list($key, $val)=each($vframes))\r\n {\r\n if ($val->Align==alBottom) $val->show();\r\n }\r\n echo \"</frameset>\\n\";\r\n }\r\n else\r\n {\r\n $this->dumpHorizontalFrames($hframes, true);\r\n }\r\n }\r\n\r\n }",
"function GetFrame($i){}",
"function get_frames() { return new FrameParserTreeList($this->_root); }",
"public function getSourceFrames() {\n return $this->sourceFrames;\n }",
"function GetRelatedFrame(){}",
"function readFramesetJSEvents()\r\n {\r\n $result = \"\";\r\n\r\n if ($this->_jsonload!=null) { $event=$this->_jsonload; $result.=\" onload=\\\"return $event(event)\\\" \"; }\r\n if ($this->_jsonunload!=null) { $event=$this->_jsonunload; $result.=\" onunload=\\\"return $event(event)\\\" \"; }\r\n\r\n return $result;\r\n }",
"function readFramesetJSEvents()\n {\n $result = \"\";\n\n if ($this->_jsonload!=null) { $event=$this->_jsonload; $result.=\" onload=\\\"return $event(event)\\\" \"; }\n if ($this->_jsonunload!=null) { $event=$this->_jsonunload; $result.=\" onunload=\\\"return $event(event)\\\" \"; }\n\n return $result;\n }",
"public function supportBFrames();",
"function frameTypes()\n\t{\n\t\tlist ($ret, $imageframe) = GalleryCoreApi::newFactoryInstance('ImageFrameInterface_1_1');\n\t\tif ($ret) die($ret->getAsHtml());\n\t\tlist ($ret, $frames) = $imageframe->getImageFrameList();\n\t\tif ($ret) die($ret->getAsHtml());\n\n\t\t//list ($ret, $sample_url) = $imageframe->getSampleUrl();\n\t\t//if ($ret) die($ret->getAsHtml());\n\t\t// the url returned from G2 is wrong, duno ...\n\t\t$sample_url = $GLOBALS['egw']->link('/gallery/index.php',array('g2_view'=>'imageframe.Sample'));\n\n\t\treturn array($GLOBALS['egw']->translation->convert($frames,'utf-8'),$sample_url);\n\t}",
"abstract protected function getFrame(): Frame;",
"public function getFrames()\n {\n return $this->frames;\n }",
"abstract protected function getIframePattern();",
"public function getFrames()\n {\n if($this->frames === null) {\n $frames = $this->exception->getTrace();\n\n // If we're handling an ErrorException thrown by Whoops,\n // get rid of the last frame, which matches the handleError method,\n // and do not add the current exception to trace. We ensure that\n // the next frame does have a filename / linenumber, though.\n if(($this->exception instanceof ErrorException || $this->exception instanceof Object) && empty($frames[1]['line'])) {\n $frames = array($this->getFrameFromError($this->exception));\n } else {\n $firstFrame = $this->getFrameFromException($this->exception);\n array_unshift($frames, $firstFrame);\n }\n $collection = array();\n\n if (count($frames)) {\n foreach ($frames as $frame) {\n array_push($collection, new Frame($frame));\n }\n }\n\n $this->frames = new Database\\Collection($collection);\n }\n\n return $this->frames;\n }",
"function do_frameset_mobile_js($audio=null)\n{\n\n ?> \n <script type=\"text/javascript\" src=\"js/jquery.js\" charset=\"utf-8\"></script>\n \n <script type=\"text/javascript\">\n //<![CDATA[\n function rsizeIframes() {\n const h_height = <?php \n if (isset($audio)) {\n getSettingWithDefault('set-text-h-frameheight-with-audio');\n } else {\n getSettingWithDefault('set-text-h-frameheight-no-audio');\n } ?> + 10;\n const lr_perc = <?php echo getSettingWithDefault('set-text-l-framewidth-percent'); ?>;\n const r_perc = <?php echo getSettingWithDefault('set-text-r-frameheight-percent'); ?>;\n const w = $(window).width();\n const h = $(window).height();\n const l_width = w * lr_perc / 100;\n const r_width = w - l_width;\n const l_height = h - h_height;\n const ro_height = h * r_perc / 100;\n const ru_height = h - ro_height;\n $('#frame-h').width(l_width-5).height(h_height-5)\n .css('top',0).css('left',0);\n $('#frame-h-2').width('100%').height('100%')\n .css('top',0).css('left',0);\n $('#frame-l').width(l_width-5).height(l_height-5)\n .css('top',h_height).css('left',0);\n $('#frame-l-2').width('100%').height('100%')\n .css('top',0).css('left',0);\n $('#frame-ro').width(r_width-5).height(ro_height-5)\n .css('top',0).css('left',l_width);\n $('#frame-ro-2').width('100%').height('100%')\n .css('top',0).css('left',0);\n $('#frame-ru').width(r_width-5).height(ru_height-5)\n .css('top',ro_height).css('left',l_width);\n $('#frame-ru-2').width('100%').height('100%')\n .css('top',0).css('left',0);\n }\n \n function init() {\n rsizeIframes();\n $(window).resize(rsizeIframes);\n }\n \n $(document).ready(init);\n //]]>\n </script>\n \n <?php\n \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the page in the database and fill in the page variable. | protected function _findPage()
{
if (!empty($this->_page_id)) {
$where = array(array('page_id', $this->_page_id));
if (!$this->_is_preview) {
$where[] = array('published', 1);
}
$page = Page\Model_Page::find('first', array(
'where' => $where,
'related' => ('template_variation'),
));
} else {
foreach ($this->_contexts_possibles as $context => $domain) {
$url = mb_substr(\Uri::base(false).$this->_page_url, mb_strlen($domain));
if (!in_array($url, array('', '/'))) {
$url = mb_substr($url, 0, -1).'.html';
} else {
$url = '';
}
$where = array(array('page_context', $context));
if (!$this->_is_preview) {
$where[] = array('published', 1);
}
if (empty($url)) {
$where[] = array('page_entrance', 1);
} else {
$where[] = array('page_virtual_url', $url);
}
$page = \Nos\Page\Model_Page::find('first', array(
'where' => $where,
'related' => array('template_variation' => array('related' => 'linked_menus')),
));
if (!empty($page)) {
if ($page->page_entrance && !empty($url)) {
\Response::redirect($domain, 'location', 301);
exit();
}
$this->_page_url = $url;
break;
}
}
}
if (empty($page)) {
throw new NotFoundException('The requested page was not found.');
}
if ($page->page_type == \Nos\Page\Model_Page::TYPE_EXTERNAL_LINK) {
\Response::redirect($page->page_external_link, 'location', 301);
exit();
}
$this->setPage($page);
} | [
"private function fetchPage() {\n $params = array([\n \"place\" => \":id\", \"value\" => $this->id, \"type\" => PDO::PARAM_INT,\n ]);\n\n $sql = \"SELECT pages.title\n FROM pages, postpages\n WHERE pages.id = postpages.pageid\n AND postpages.postid = :id\";\n $postPage = self::execute( $sql, $params );\n $this->page = $postPage->fetch()['title'];\n }",
"public function load()\n {\n global $connexion;\n $connexion->setReq(\n \"SELECT * FROM page WHERE id_page = '$this->id_page';\"\n );\n if($connexion->query()->ins()===true)\n {\n $obj = $connexion->query()->first(\"Page\");\n $this->name = $obj->getName();\n $this->title = $obj->getTitle();\n $this->file = $obj->getFile();\n $this->path = $obj->getPath();\n }\n }",
"public function getPageInfo() {\n\t\t// supply page Title & Description\n\t\t$requestedPage = $_GET['page'];\n\n\t\t// Write the SQL query to be run\n\t\t$sql = \"SELECT Title, Description FROM pages WHERE Name = '$requestedPage'\";\n\n\t\t// Then actually run the SQL query\n\t\t$result = $this->dbc->query( $sql );\n\n\t\t// Make sure there is data in the result\n\t\t// if not then we need to get the 404 page data instead\n\t\tif ($result->num_rows == 0 ) {\n\t\t\t\n\t\t\t// Pepare the SQL to get the 404 data \n\t\t\t$sql = \"SELECT Title, Description FROM pages WHERE Name = '404'\";\n\n\t\t\t// Capture the result\n\t\t\t$result = $this->dbc->query( $sql );\n\t\t}\n\n\t\t// Convert \n\t\t$pageData = $result->fetch_assoc();\n\n\t\t$this->title \t\t= $pageData['Title'];\n\t\t$this->description \t= $pageData['Description'];\n\n\t}",
"function insertPage($page){}",
"function getPage () {\n\t\t$par = $this->getParent ();\n\t\t$page = $par->newTranslatedPage ();\n\t\t$page->initFromDatabaseID ($this->getPageID ());\n\t}",
"public static function getPageInformation() \n {\n // Article Page\n if (FormUtil::get('showarticle')) {\n Page::$exists = true;\n Page::$content = include ROOT.'pagetypes/news.php';\n return;\n }\n\n // Get either the page ID or text ID for use in the section below\n if (Page::$id > 0 && strlen(Page::$text_id) == 0) {\n Debug::get()->addMessage('Using numeric ID to get page information', false);\n $page_query_id = '`page`.`id` = '.Page::$id;\n } elseif (strlen(Page::$text_id) > 0) {\n Debug::get()->addMessage('Using text ID to get page information', false);\n $page_query_id = '`page`.`text_id` = \\''.Page::$text_id.'\\'';\n } else {\n return;\n }\n\n // Look up information (including page type) for the current page\n $page_query = 'SELECT `page`.*, `pt`.`filename`\n\t\t\tFROM `'.PAGE_TABLE.'` `page`, `'.PAGE_TYPE_TABLE.'` `pt`\n\t\t\tWHERE '.$page_query_id.'\n\t\t\tAND `page`.`type` = `pt`.`id`\n\t\t\tLIMIT 1';\n try {\n $page = DBConn::get()->query($page_query, [], DBConn::FETCH);\n } catch (Exceptions\\DBException $ex) {\n header(\"HTTP/1.0 404 Not Found\");\n Debug::get()->addMessage('Error looking up page information', true);\n return;\n }\n\n if (!$page) {\n header(\"HTTP/1.0 404 Not Found\");\n Debug::get()->addMessage('Page is not listed in database', true);\n return;\n }\n\n // Page was found; populate the class fields\n Page::$id = $page['id'];\n Page::$text_id = $page['text_id'];\n Page::$showtitle = ($page['show_title'] == 1) ? true : false;\n Page::$blocksleft = $page['blocks_left'];\n Page::$blocksright = $page['blocks_right'];\n Page::$exists = true;\n Page::$meta_description = $page['meta_desc'];\n Page::$type = $page['filename'];\n if (strlen(Page::$text_id) == 0) {\n Page::$url_reference = 'id='.Page::$id;\n } else {\n if(FormUtil::get('id')) {\n header(\"HTTP/1.1 301 Moved Permanently\");\n $matches = null;\n $old_page_address = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];\n preg_match('/id=[0-9]+/i', $old_page_address, $matches);\n $new_page_address = str_replace($matches, 'page='.Page::$text_id, $old_page_address);\n header('Location: '.$new_page_address);\n }\n Page::$url_reference = 'page='.Page::$text_id;\n }\n Page::$title = $page['title'];\n Page::$page_title = Page::$title;\n if(!isset(Page::$content)) {\n Page::$content = include ROOT.'pagetypes/'.Page::$type;\n if(!Page::$content) {\n // Including the pagetype file failed - either a file is missing,\n // or the included file returned 'false'\n header(\"HTTP/1.0 404 Not Found\");\n Page::$exists = false;\n Page::$notification = '<strong>Error: </strong>System file not found.<br />';\n Debug::get()->addMessage('Including '.Page::$type.' returned false', true);\n }\n }\n return;\n }",
"protected function populateParams() {\r\n /**\r\n * @var Dzit_RequestParser\r\n */\r\n $requestParser = Dzit_RequestParser::getInstance();\r\n $this->pageId = $requestParser->getPathInfoParam(1);\r\n /**\r\n * @var Vushop_Bo_Page_IPageDao\r\n */\r\n $pageDao = $this->getDao(DAO_PAGE);\r\n $this->page = $pageDao->getPageById($this->pageId);\r\n }",
"function createOrUpdatePage(PopulatedPage $page);",
"protected function _prepare_page($page)\n {\n }",
"function page()\r\n\t{\r\n\t\t//Load dynamic page content\r\n\t\t$content =& model::create('content');\r\n\t\tif(ctype_digit($this->params['url_params']))\r\n\t\t\t$content->find($this->params['url_params']);\r\n\t\telse\r\n\t\t\t$content->find_by_field('url_name',$this->params['url_params']);\r\n\t\t\r\n\t\tif($content->id == null)\r\n\t\t\t$content->find(ERROR_404_CONTENT_ID);\r\n\t\t\t\r\n\t\t$this->template_data['content'] = $content->fields_as_associative_array();\t\r\n\t\r\n\t\t$this->breadcrumb[] = array('page/'.$content->url_name => $content->title);\r\n\t}",
"public function getPage() {\n\t\t\n\t\tglobal $db;\n\t\t\n\t\tif ( $this->page == null ) {\n\n\t\t\t// first try and see if there has been a page\n\t\t\t// excplicitly set for this project\n\t\t\t$sql = \" select p.page_id\n\t\t\t\tfrom projects p\n\t\t\t\twhere p.id = '$this->id' \";\n\t\t\tif ( !$res = $db->query($sql) )\n\t\t\t\tError::fatal( $db->getError(), Error::SYS );\n\t\t\tif ( $row = $res->fetch() && $row->page_id )\n\t\t\t\t$this->page = Page::loadByID( $row->page_id );\n\t\t\telse {\n\n\t\t\t\t// otherwise check if there is a name match\n\t\t\t\tif ( $page = Page::loadByName($this->name,$this->group->id) )\n\t\t\t\t\t$this->page = $page;\n\t\t\t\telse\n\t\t\t\t\t$this->page = false;\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $this->page;\n\t\n\t}",
"private function setPageData()\n {\n // Load $this->data['article']\n if ($this->getTextId()) {\n $this->getArticle($this->getTextId());\n }\n\n $path_arr = explode('/', $_SERVER['REQUEST_URI']);\n $path = $path_arr[count($path_arr)-1];\n\n $seo = Seo::get($path, $this->getLang('input'));\n\n // SITE NAME\n $this->data['page']['site_name'] = cfg::get('name');\n\n\n // ROBOTS\n if ($this->data['article'][$this->getTextId()]['robots']) {\n // 1. get value from the custom field named robots\n $this->data['page']['robots'] = $this->data['article'][$this->getTextId()]['robots'];\n } elseif (cfg::get('robots')) {\n\n // 2. get value from main site configuration (robots)\n $this->data['page']['robots'] = cfg::get('robots');\n } else {\n\n // 3. default value: \"index, follow\"\n $this->data['page']['robots'] = 'index, follow';\n }\n\n // TITLE\n if ($this->data['article'][$this->getTextId()]['customtitle']) {\n\n // 1. get value from the custom field named customtitle\n $this->data['page']['custom_title'] = str_replace('\"', '"', $this->data['article'][$this->getTextId()]['customtitle']);\n }\n\n if ($seo && $seo['title']) {\n // 2. SEO table value\n $this->data['page']['title'] = $seo['title'];\n } elseif ($this->data['article'][$this->getTextId()]['title']) {\n // 3. use the value of the field named \"title\"\n $this->data['page']['title'] = $this->data['article'][$this->getTextId()]['title'];\n } elseif ($this->cfg['context'] === 'tags') {\n // 4. if context is tags the main site configuration (title) will be used followed by comma-separated-list of filtering tgs\n $this->data['page']['title'] = cfg::get('title') . ' / ' . implode(', ', $this->getFilterTags());\n } else {\n // 5. default value is main site configuration value (title)\n $this->data['page']['title'] = cfg::get('title');\n }\n\n // Replace double quotes with html character in Title\n $this->data['page']['title'] = str_replace('\"', '"', $this->data['page']['title']);\n\n // DESCRIPTION\n if ($seo && $seo['description']) {\n // 1. Use Seo table value\n $this->data['page']['description'] = $seo['description'];\n } elseif ($this->data['article'][$this->getTextId()]['customdescription']) {\n // 2. get value from the custom field named customdescription\n $this->data['page']['description'] = str_replace('\"', '"', $this->data['article'][$this->getTextId()]['customdescription']);\n } elseif ($this->data['article'][$this->getTextId()]['summary'] && trim(strip_tags($this->data['article'][$this->getTextId()]['summary'])) != '') {\n // 3. use the value of the field named \"summary\"\n $this->data['page']['description'] = str_replace('\"', '"', trim(strip_tags($this->data['article'][$this->getTextId()]['summary'])));\n } elseif ($this->cfg['context'] === 'tags') {\n // 4. if context is tags the main site configuration (description) will be used followed by comma-separated-list of filtering tgs\n $this->data['page']['description'] = str_replace('\"', '"', cfg::get('description') . ' / ' . implode(', ', $this->getFilterTags()));\n } else {\n // 5. default value is main site configuration value (description)\n $this->data['page']['description'] = str_replace('\"', '"', cfg::get('description'));\n }\n\n // truncate description up to 500 digits\n if (strlen($this->data['page']['description']) > 500) {\n $this->data['page']['description'] = str_replace('\"', '"', substr($this->data['page']['description'], 0, 497) . '...');\n }\n\n // Replace double quotes with html character in Description\n $this->data['page']['description'] = str_replace('\"', '"', $this->data['page']['description']);\n\n // KEYWORDS\n if ($seo && $seo['keywords']) {\n $this->data['page']['keywords'] = $seo['keywords'];\n } elseif ($this->data['article'][$this->getTextId()]['keywords']) {\n // 1. use the value of the field named \"keywords\"\n $this->data['page']['keywords'] = $this->data['article'][$this->getTextId()]['keywords'];\n } else {\n // 2. default value is main site configuration value (keywords)\n $this->data['page']['keywords'] = cfg::get('keywords');\n }\n // Replace double quotes with html character in Keywords\n $this->data['page']['keywords'] = str_replace('\"', '"', $this->data['page']['keywords']);\n\n // LANG\n $this->data['page']['lang'] = $this->getLang('current', true);\n\n // URL\n // http://stackoverflow.com/a/23717829/586449\n $this->data['page']['url'] = (isset($_SERVER['HTTPS']) ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n\n // MISSION\n $this->data['page']['mission'] = cfg::get('mission');\n\n // IMAGE\n $path2img = str_replace(utils::getBaseUrl(), null, $this->data['article'][$this->getTextId()]['art_img']['orig']);\n\n if (file_exists($path2img)) {\n // 1. check first for article image\n $this->data['page']['image'] = utils::getBaseUrl() . $path2img;\n } elseif ($this->data['article'][$this->getTextId()]['text']) {\n // 2. get first image available in the article body\n $xpath = new DOMXPath(@DOMDocument::loadHTML($this->data['article'][$this->getTextId()]['text']));\n $src = $xpath->evaluate(\"string(//img/@src)\");\n\n $this->data['page']['image'] = (!preg_match('/http/', $src) ? utils::getBaseUrl() . '/' : '') . $src;\n }\n\n // AUTHOR\n if (\n $this->data['article'][$this->getTextId()]['author']\n &&\n trim($this->data['article'][$this->getTextId()]['author']) != ''\n ) {\n $this->data['page']['author'] = $this->data['article'][$this->getTextId()]['author'];\n }\n\n // DATE\n if (\n $this->data['article'][$this->getTextId()]['publish'] &&\n $this->data['article'][$this->getTextId()]['publish'] !== '0000-00-00') {\n $this->data['page']['date'] = $this->data['article'][$this->getTextId()]['publish'];\n }\n }",
"private static function get_existing_page(): Page\n {\n $pages = Page::get_data_by( [], $offset = 0, $limit = 1);//get any page\n\n $Page = new Page($pages[0]['page_id']);\n return $Page;\n }",
"public function setPage() {\n }",
"public function find_all_pages(){\n\t\tglobal $db;\n\n\t\t$query = \"SELECT * from pages WHERE subject_id = ? order by position\";\n\t\t$stmt = $db->prepare($query);\n\t\t$stmt->execute(array($this->id));\n\t\t$this->contained_pages = $stmt->fetchAll(PDO::FETCH_CLASS, 'page');\n\n\t}",
"public static function LoadPage($page_title) {\n $sql = 'select * from pages where internal_name = \"'.$page_title.'\" limit 1';\n return db($sql);\n\n }",
"public function setFoundPage($value) { $this->_foundpage = $value; }",
"function addPageToDatabase (&$page) {\n\t\t$pageName = $page->getName ();\n\t\t$pageExists = $this->pageExists ($pageName);\n\t\tif ($pageExists) {\n\t\t\treturn new Error ('PAGE_EXISTS_ALREADY', $pageName);\n\t\t}\t\n\t\n\t\t$parentPageID = $page->getParentPageID ();\n\t\tif (! is_numeric ($parentPageID)) {\n\t\t\treturn new Error ('DATABASEOBJECT_SQL_INJECTION_ATTACK_FAILED', \n\t\t\t\t__FILE__, __LINE__);\n\t\t}\t\n\t\n\t\tif ($page->getPlaceInMenu () === MORGOS_MENU_INVISIBLE\n\t\t\tor $page->getPlaceInMenu () === MORGOS_MENU_FIRST\n\t\t\tor $page->getPlaceInMenu () === MORGOS_MENU_LAST) {\n\t\t\t// do nothing, everything should be OK\n\t\t} elseif ($page->getPlaceInMenu () === MORGOS_MENU_APPEND) {\n\t\t\tif (! $page->isRootPage ()) {\n\t\t\t\t$parentPage = $page->getParentPage ();\n\t\t\t\t$pInMen = $parentPage->getMaxPlaceInMenu ();\n\t\t\t\tif (! isError ($pInMen)) {\n\t\t\t\t\t$a = array ();\n\t\t\t\t\t$a['place_in_menu'] = $pInMen; \n\t\t\t\t\t$page->updateFromArray ($a);\n\t\t\t\t} else {\n\t\t\t\t\treturn $pInMen;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$place = $page->getPlaceInMenu ();\n\t\t\tif (! is_numeric ($place)) {\n\t\t\t\treturn new Error ('DATABASEOBJECT_SQL_INJECTION_ATTACK_FAILED', \n\t\t\t\t\t__FILE__, __LINE__);\n\t\t\t}\n\t\t\t$pagesTableName = $this->_db->getPrefix ().'pages';\n\t\t\t$sql = \"UPDATE $pagesTableName SET place_in_menu=(place_in_menu)+1 \n\t\t\t\tWHERE place_in_menu>=$place \n\t\t\t\tAND place_in_menu!=\".MORGOS_MENU_INVISIBLE \n\t\t\t\t.\" AND place_in_menu!=\".MORGOS_MENU_LAST \n\t\t\t\t.\" AND parent_page_id='$parentPageID'\";\n\t\t\t$q = $this->_db->query ($sql);\n\t\t\tif (isError ($q)) {\n\t\t\t\treturn $q;\n\t\t\t}\n\t\t}\n\t\t$r= $page->addToDatabase ();\n\t\tif (isError ($r)) {\n\t\t\treturn $r;\n\t\t}\n\t}",
"function socialwiki_get_page($pageid) {\n global $DB;\n return $DB->get_record('socialwiki_pages', array('id' => $pageid));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get customer info in GET parameter format | public function getCustomerParams()
{
$customerInfo = $this->getCustomerInfo();
$result = "&ui[user_email]=" . urlencode($customerInfo['email'])
. "&ui[customer_id]=" . $customerInfo['id']
. "&ui[new_customer]=" . $customerInfo['is_new'];
return $result;
} | [
"public function getCustomerAction()\n {\n /** @var CustomerRepository $repository */\n $repository = $this->get('swag_backend_order.customer_repository');\n\n if ($filter = $this->getListRequestParam()) {\n $result = $repository->getList($filter);\n\n $this->view->assign([\n 'data' => $result,\n 'total' => count($result),\n 'success' => true,\n ]);\n\n return;\n }\n\n $customerId = (int) $this->Request()->get('searchParam');\n $result = $repository->get($customerId);\n\n $this->view->assign([\n 'data' => $result,\n 'total' => count($result),\n 'success' => true,\n ]);\n }",
"public function customer_details_get()\n {\n if(!$this->get('id'))\n {\n\n $this->response(NULL, 400);\n }\n \n $user = $this->Users_model->fetchdata( $this->get('id') );\n \n if($user)\n {\n\n $this->response($user, 200); // 200 being the HTTP response code\n }\n \n else\n {\n\n\n $this->response(NULL, 404);\n }\n }",
"public function get_customer_byname()\n {\n if(isset($_GET['q']))\n {\n $search = $_GET['q'];\n $this->load->model('payment_model');\n $data = $this->payment_model->get_customer_byname($search);\n $this->output->set_output(json_encode($data));\n \n }\n }",
"function customer( $args, $assoc_args ) {\n\t\tlist( $id ) = $args; WP_CLI::line(var_export($this->api->get_customer($id)));\n\t}",
"function get_customers()\n\t{\n\t\t$this->path = \"/api/customers/get\";\n\t\treturn $this->_send_request();\n\t}",
"function getCustomer(){\n\t\t$key\t=\t$this->input->get('term');\n\t\t$suggest=\"\";\n\t\tif(!empty($key) && strlen($key) > 2){\n\t\t\t$key\t= str_replace(\"%20\",\" \",$key);\n\t\t\t$key\t= trim($key);\n\t\t}\n\t\t$suggest\t= customerList($key);\n\t\techo json_encode($suggest);\n\t}",
"public function getCustomerDetailByRef() {\n $result = $this->customer->getCustomerByRef($_POST['CurrentCustomerId']);\n echo json_encode($result);\n exit;\n }",
"public function getSeverNameOfCustomer() {\r\n $data = $this->apicaller->domain()->getSeverNameOfCustomer(array(\r\n 'customer-id' => '10704470',\r\n ));\r\n print_r($data);\r\n }",
"function get_customer( $resource ){\n\n $customer = get( 'customers', $resource );\n\n echo json_encode( $customer );\n exit;\n\n}",
"public function getCustomer($url, $customerUUID);",
"public function customer_detail()\n {\n\n $id = $this->request->getVar('id');\n\n $respon = $this->dataCustomers->getIDDataCustomer($id);\n echo json_encode($respon);\n }",
"public function customerAction(){\n\n\t\t\n\n\t\t$this->view->filteruser = (isset($this->Request['username'])) ? $this->Request['username'] :'' ;\n\n\t\t$this->view->filtercompany = (isset($this->Request['company'])) ? $this->Request['company'] :'' ;\n\n\t\t$this->view->filterpostcode = (isset($this->Request['postcode'])) ? $this->Request['postcode'] :'' ;\n\n\t\t$this->view->filterdepot = (isset($this->Request['filterdepot'])) ? $this->Request['filterdepot'] :'' ;\n\n\t\t\n\n\t\t$record = $this->AccountObj->customerList($this->Request);\n\n\t\t$this->view->records = \t$record;\n\n\t\t$this->view->depots = $this->AccountObj->getDepotList();\t// depot list\n\n\t\t$this->view->customerList = $this->AccountObj->getCustomerList();\n\n\t}",
"public function listCustomers()\n {\n return $this->request('GET', '/customers');\n }",
"public function show_konto_details()\n {\n if (isset($_GET['konto'])) {\n $kontoid = $_GET['konto'];\n }\n }",
"abstract public function getCustomer($user, $pass);",
"public function getCustomerAddressAction();",
"public function testGETCustomerIdReturns()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function GetCustomerDetails($inputdata){\n\t\tglobal $con;\n\t\t$response = array(\n\t\t\t\"status\" => 0,\n\t\t\t\"errors\" => '',\n\t\t\t\"msg\" => '',\n\t\t\t\"data\" => array()\n\t\t);\n\t\t$sql='select * from sl_user_login_info where user_login_id='.safe_str($inputdata['customer_id']).' and delete_flag=0';\n\t\t\n\t\t// $sql1='select * from sl_customer_addresses_info where customer_address_id='.safe_str($inputdata['customer_address_id']).' and delete_flag=0';\n\n\t\t$result=$con->query($sql);\n\t\t\n\t\tif($result->num_rows){\n\t\t\t$response['data'] = $result->fetch_assoc();\n\t\t\t$response['status']=1;\n\t\t}else{\n\t\t\t$response['errors'] = $con->error;\n\t\t}\n\t\treturn $response;\n\t}",
"function get_cust_profile($customerId){\n $db = herokuConnect();\n $sql = \"SELECT * FROM customer_info WHERE customerid = '$customerId'\";\n $stmt = $db->prepare($sql);\n $stmt->execute();\n $response = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $response;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation documentTicketsGetRevisionDocumentById This call retrieve the ticket for downloading an attachemnt file by its revision | public function documentTicketsGetRevisionDocumentById($attachment_id, $revision_id, $for_view = null)
{
list($response) = $this->documentTicketsGetRevisionDocumentByIdWithHttpInfo($attachment_id, $revision_id, $for_view);
return $response;
} | [
"public function findDocumentRevision($id, $rev)\n {\n $documentPath = '/' . $this->databaseName . '/' . urlencode($id) . \"?rev=\" . urlencode($rev);\n return $this->getHttpClient()->request( 'GET', $documentPath );\n }",
"protected function documentTicketsGetRevisionDocumentByIdRequest($attachment_id, $revision_id, $for_view = null)\n {\n // verify the required parameter 'attachment_id' is set\n if ($attachment_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $attachment_id when calling documentTicketsGetRevisionDocumentById'\n );\n }\n // verify the required parameter 'revision_id' is set\n if ($revision_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $revision_id when calling documentTicketsGetRevisionDocumentById'\n );\n }\n\n $resourcePath = '/api/DocumentTickets/ticketProfileAttachment/{attachmentId}/revisions/{revisionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($for_view !== null) {\n $queryParams['forView'] = ObjectSerializer::toQueryValue($for_view);\n }\n\n // path params\n if ($attachment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'attachmentId' . '}',\n ObjectSerializer::toPathValue($attachment_id),\n $resourcePath\n );\n }\n // path params\n if ($revision_id !== null) {\n $resourcePath = str_replace(\n '{' . 'revisionId' . '}',\n ObjectSerializer::toPathValue($revision_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\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 []\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 // 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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function documentsGetRevisionDocumentByIdRequest($attachment_id, $revision_id, $for_view = null)\n {\n // verify the required parameter 'attachment_id' is set\n if ($attachment_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $attachment_id when calling documentsGetRevisionDocumentById'\n );\n }\n // verify the required parameter 'revision_id' is set\n if ($revision_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $revision_id when calling documentsGetRevisionDocumentById'\n );\n }\n\n $resourcePath = '/api/Documents/profileAttachment/{attachmentId}/revisions/{revisionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($for_view !== null) {\n $queryParams['forView'] = ObjectSerializer::toQueryValue($for_view);\n }\n\n // path params\n if ($attachment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'attachmentId' . '}',\n ObjectSerializer::toPathValue($attachment_id),\n $resourcePath\n );\n }\n // path params\n if ($revision_id !== null) {\n $resourcePath = str_replace(\n '{' . 'revisionId' . '}',\n ObjectSerializer::toPathValue($revision_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/octet-stream']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/octet-stream'],\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 // \\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 // 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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function get_revision($revision_id);",
"protected function documentsGetExtractedDocumentByRevisionIdRequest($revision_id)\n {\n // verify the required parameter 'revision_id' is set\n if ($revision_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $revision_id when calling documentsGetExtractedDocumentByRevisionId'\n );\n }\n\n $resourcePath = '/api/Documents/extractByRevision/{revisionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($revision_id !== null) {\n $resourcePath = str_replace(\n '{' . 'revisionId' . '}',\n ObjectSerializer::toPathValue($revision_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/octet-stream']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/octet-stream'],\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 // \\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 // 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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function documentsGetRevisionDocumentByIdWithHttpInfo($attachment_id, $revision_id, $for_view = null)\n {\n $returnType = '\\SplFileObject';\n $request = $this->documentsGetRevisionDocumentByIdRequest($attachment_id, $revision_id, $for_view);\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 '\\SplFileObject',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function retrieveByDocument ( $doc_document_id )\n {\n $q = Doctrine_Query::create ()\n ->from ( 'DocVersion dc' )\n ->leftJoin ( 'dc.DocDocument dd' )\n\t\t->leftJoin ( 'dd.DocCategory ca' )\n ->leftJoin('dd.DocExtension de')\n ->innerJoin ( 'dc.User us' )\n ->where ( 'doc_document_id = ?' , $doc_document_id )\n ->orderBy ( 'doc_version_creation' );\n\n return $q->execute ();\n }",
"function getDocument($id) {\n \treturn $this->connection->get($id);\n }",
"public function getRevById($id){\n return $this->where('id_rev', $id)->find();\n }",
"public function document($id)\n {\n return $this->get(\"documents/{$id}/\");\n }",
"public function getRevisionId();",
"public function getDocumentDetail_get() {\n extract($_GET);\n $document_id = base64_decode($doc_id);\n $result = $this->document_model->getDocumentDetail($document_id);\n if ($result) {\n return $this->response($result, 200);\n } else {\n return $this->response(NULL, 404);\n }\n }",
"public function GETEntityRevisionsByRevisionID( $entity_id, $revision_id) {\n $params = array();\n $params['entity_id'] = $entity_id;\n $params['revision_id'] = $revision_id;\n return CentralIndex::doCurl(\"GET\",\"/entity/revisions/byRevisionID\",$params);\n }",
"public function getDocrevisionsRelatedByApproverId($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collDocrevisionsRelatedByApproverId === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collDocrevisionsRelatedByApproverId = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(DocrevisionPeer::APPROVER_ID, $this->id);\n\n\t\t\t\tDocrevisionPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collDocrevisionsRelatedByApproverId = DocrevisionPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(DocrevisionPeer::APPROVER_ID, $this->id);\n\n\t\t\t\tDocrevisionPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastDocrevisionRelatedByApproverIdCriteria) || !$this->lastDocrevisionRelatedByApproverIdCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collDocrevisionsRelatedByApproverId = DocrevisionPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastDocrevisionRelatedByApproverIdCriteria = $criteria;\n\t\treturn $this->collDocrevisionsRelatedByApproverId;\n\t}",
"public function getDocumentContentById($id) {\n\t\t$query = \"SELECT document_content_id, created_by_user_id, created_at, version, content_reference, content, document_id FROM document_contents where document_content_id = ?\";\n\t\t$stmt = $this->mysqli->prepare($query);\n\t\tif ($stmt === false) {\n\t\t\tthrow new RepositoryException($this->mysqli->error, $this->mysqli->errno);\n\t\t}\n\t\t$rc = $stmt->bind_param(\"i\", $id);\n\t\tif ($rc === false) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\tif (!$stmt->execute()) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\t$a = array();\n\t\t$rc = $stmt->bind_result($a[\"documentContentId\"], $a[\"createdByUserId\"], $a[\"createdAt\"], $a[\"version\"], $a[\"contentReference\"], $a[\"content\"], $a[\"documentId\"]);\n\t\tif ($rc === false) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\tif ($stmt->fetch()) {\n\t\t\treturn DocumentContent::CreateModelFromRepositoryArray($a);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public function documentsGetExtractedDocumentByRevisionIdWithHttpInfo($revision_id)\n {\n $returnType = '\\SplFileObject';\n $request = $this->documentsGetExtractedDocumentByRevisionIdRequest($revision_id);\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 '\\SplFileObject',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getDocument($id)\n {\n $sql = \"SELECT cd.*,c.*\n FROM \".$this->db->dbprefix('child_document').\" cd,\n \".$this->db->dbprefix('child').\" c\n WHERE cd.`id_domain` = \".(int)getUserDomain().\"\n AND c.`deleted` = 0\n AND cd.`id_child` = c.`id_child`\n AND cd.`id_child_document` = ?\n AND c.`id_domain` = \".(int)getUserDomain();\n $result = $this->db->query($sql, array($id))->row();\n return $result;\n }",
"public function documentsGetExtractedDocumentByRevisionIdAsync($revision_id)\n {\n return $this->documentsGetExtractedDocumentByRevisionIdAsyncWithHttpInfo($revision_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function getRevisionByObject($object) {\n\t\t$metadata = $this->collectMetadata($object);\n\t\tif (is_array($metadata) && isset($metadata['CouchDB_Revision'])) {\n\t\t\treturn $metadata['CouchDB_Revision'];\n\t\t}\n\t\ttry {\n\t\t\t$identifier = $this->persistenceSession->getIdentifierByObject($object);\n\t\t\t$rawResponse = $this->client->getDocumentInformation($identifier);\n\t\t\treturn $rawResponse->getRevision();\n\t\t} catch(Client\\NotFoundException $notFoundException) {\n\t\t\treturn NULL;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ think tank forums include_functions.php / message printing ~~~~~~~~~~~~~~~~ $label is printed in the header of the page $title is printed in the title bar of the content box $body is printed in the body of the content box | function message($ttf_label, $title, $body) {
global $ttf; // pull through the $ttf array for include_header.php (SMART!)
global $ttf_cfg; // pull through the $ttf_cfg array (even smarter!)
require_once "include_header.php";
echo "<div class=\"contenttitle\">$title</div>\n";
echo "<div class=\"contentbox\">\n";
if (is_array($body)) {
echo "<ul>\n";
foreach ($body as $message) {
echo "<li>$message</li>\n";
};
echo "</ul>\n";
} else {
echo "$body\n";
};
echo "</div>\n";
require_once "include_footer.php";
} | [
"function display_msg($msg_title, $msg_content)\n {\n\t\tglobal $app;\n\t\tinclude \"$app[path]/dsp_msg.php\";\n\t\texit;\n }",
"function formTitle($text){\n echo \"<div class=\\\"formtitle\\\">$text</div>\", PHP_EOL;\n }",
"function display_section_buffetpage_message(){}",
"function ShowTextMessages($text = NULL)\n {\n echo \"<H3 align=center class='msg'>$text</H3>\";\n }",
"function print_labels($parameters){\n\t\t$identifier \t= $this->check_parameters($parameters,\"identifier\");\n\t\t$download_file \t= $this->check_parameters($parameters,\"download_file\");\n\t\t$file_name \t= $this->check_parameters($parameters,\"file_name\");\n\t\t$send_email \t= $this->check_parameters($parameters,\"send_email\");\n\t\tif ($download_file == 1)\n\t\t\t$this->downloadFILE($file_name);\n\t\t\t/* Form Portion Starts */\n\t\t/**\n\t\t* generate the form for adding / editting the user details\n\t\t*/\n\t\t$out =\"\";\n//\t\t$label_type_label = 'Select Label';\n//\t\t$out =\"<module name=\\\"users\\\" display=\\\"form\\\">\";\n\t\t$out =\"<page_options>\";\n//\t\t$out .=\"\\t\".$this->call_command(\"XMLTAG_GENERATE_XML_BUTTON\",array(\"CANCEL\",\"USERS_LIST\",LOCALE_CANCEL));\n//\t\t$out .=\"\\t\".$this->call_command(\"XMLTAG_GENERATE_XML_BUTTON\",array(\"ACCESS\",\"USERS_SET_ADMIN_ACCESS\",\"SET_ACCESS\"));\n\t\t$out .= \"<header><![CDATA[Member Email]]></header>\";\n\t\t$out .=\"</page_options>\";\n//\t\t$out .=\"<form name=\\\"PRINT_LABELS\\\" method=\\\"post\\\" label=\\\"\".$this->get_constant($label).\"\\\">\";\n\t\t$form_label \t= \"Members\";\n\t\t$out .=\"\t<form name=\\\"user_form\\\" label=\\\"\".$form_label.\"\\\" width=\\\"100%\\\">\";\n\n\t\t$times_through++;\n\n//\t\t$out .=\"<input type=\\\"hidden\\\" name=\\\"user_identifier\\\" value=\\\"$user_identifier\\\"/>\";\n\t\t$out .=\"<input type=\\\"hidden\\\" name=\\\"prev_command\\\" value=\\\"$prev_command\\\"/>\";\n\t\t$out .=\"<input type=\\\"hidden\\\" name=\\\"command\\\" value=\\\"INFORMATIONADMIN_PRINT_LABELS_EXPORT_HANDBOOK\\\"/>\";\n//\t\t$out .=\"<input type=\\\"hidden\\\" name=\\\"command\\\" value=\\\"USERS_SAVE\\\"/>\";\n\t\t$out .=\"<input type=\\\"hidden\\\" name=\\\"identifier\\\" value=\\\"$identifier\\\"/>\";\n\t\t$out .=\"<textarea hidden='YES' required=\\\"YES\\\" label=\\\"hidden_label\\\" size=\\\"10\\\" height=\\\"10\\\" name=\\\"ody\\\" type=\\\"RICH-TEXT\\\" >sss</textarea>\";\n\n\t\t$out .=\"<page_sections>\";\n\t\t$out .=\"<section label='Members' name='detail'>\";\n\t\t$out .= \"\\t\\t\\t\\t\\t<select name=\\\"label_type\\\" label=\\\"\".$label_type_label.\"\\\" onchange='show_hidden_label_group(this)'>\\n\";\n\t\t$out .= \"<option value='1' selected='true'>All Members</option>\";\n\t\t$out .= \"<option value='2'>Print By Region</option>\";\n\t\t$out .= \"\\t\\t\\t\\t\\t</select>\\n\";\n\t\t$out .= \"\\t\\t\\t\\t\\t<radio type='vertical' label='\".LOCALE_LIST_OF_REGIONS_AVAILABLE_TO_PRINT.\"' id='region_type' name='region_type'\";\n\t\t$hide_sub = -1;\n\t\tif ($hide_sub==-1){\n\t\t\t$out .=\" hidden='YES'\";\n\t\t}\n\t\t$out .= \">\";\n\t\t$sql_region = \"select distinct iev_value from information_entry_values where iev_client=$this->client_identifier\n\t\t\t\t\t\tand iev_field='ie_oselect2' and iev_list = '$identifier' order by iev_value\";\n\t\t$result_region = $this->parent->db_pointer->database_query($sql_region);\n\n\t\t$i = 0;\n\t\twhile ($r = $this->parent->db_pointer->database_fetch_array($result_region)){\n\t\t\tif ($r[\"iev_value\"] != \"\"){\n\t\t\t\t$out .= \"<option value='\".$r[\"iev_value\"].\"'\";\n\t\t\t\tif ($i==0)\n\t\t\t\t\t$out .= \" selected='true'\";\n\t\t\t\t$out .= \">\".$r[\"iev_value\"].\"</option>\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t$out .= \"</radio>\\n\";\n\t\t$out .=\"</section>\";\n\t\t$out .=\"</page_sections>\";\n\t\t\n\t\tif ($send_email == 1){\n\t\t\t$out .= \"\t<input iconify=\\\"EMAIL\\\" type=\\\"submit\\\" command=\\\"INFORMATIONADMIN_MEMBER_EMAIL_BODY\\\" value=\\\"\".MEMBER_EMAIL_BODY.\"\\\"/>\";\n\t\t}else{\n\t\t\t$out .= \"\t<input iconify=\\\"PRINT_LABELS\\\" type=\\\"submit\\\" command=\\\"INFORMATIONADMIN_PRINT_LABELS_EXPORT\\\" value=\\\"\".PRINT_LABELS.\"\\\"/>\";\n\t\t\t$out .= \"\\t\\t\\t\\t\\t<input iconify=\\\"HANDBOOK\\\" type=\\\"submit\\\" name=\\\"\\\" command=\\\"INFORMATIONADMIN_PRINT_LABELS_EXPORT_HANDBOOK\\\" value=\\\"\".HANDBOOK_LABELS.\"\\\"/>\\n\";\n\t\t\t$out .= \"\\t\\t\\t\\t\\t<input iconify=\\\"YACHTS\\\" type=\\\"submit\\\" name=\\\"\\\" command=\\\"INFORMATIONADMIN_PRINT_LABELS_YACHTS\\\" value=\\\"\".YACHTS_LABELS.\"\\\"/>\\n\";\n\t\t\t$out .= \"\\t\\t\\t\\t\\t<input iconify=\\\"YEARBOOK\\\" type=\\\"submit\\\" name=\\\"\\\" command=\\\"INFORMATIONADMIN_PRINT_LABELS_YEARBOOK\\\" value=\\\"\".YEARBOOK_LABELS.\"\\\"/>\\n\";\n\t\t}\n\t\t$out .= \"\\t\\t\\t\\t</form>\\n\";\n\t/* Form Potion Ends*/\n\t$out = \"<module name=\\\"information_admin\\\" display=\\\"form\\\">$out</module>\";\n\n\treturn $out;;\n\n\n\t}",
"function print_panel() {\t\n\t\tif ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) {\n\t\t\t$this->print_saved_message();\n\t\t}\n\t\tif ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) {\n\t\t\t$this->print_reset_message();\n\t\t}\n\t\n\t\t$this->print_heading();\n\t\t$this->print_options();\n\t\t$this->print_footer();\n\t}",
"function myText(){\n\t\n\n\techo '<h1>before subForums</h1>';\n\t\n\n}",
"function COM_showMessageText($message, $title = '')\n{\n global $_CONF, $MESSAGE, $_IMAGE_TYPE;\n\n $retval = '';\n\n if (!empty($message)) {\n if (empty($title)) {\n $title = $MESSAGE[40];\n }\n $timestamp = strftime($_CONF['daytime']);\n $retval .= COM_startBlock($title . ' - ' . $timestamp, '',\n COM_getBlockTemplate('_msg_block', 'header'))\n . '<p class=\"sysmessage\"><img src=\"' . $_CONF['layout_url']\n . '/images/sysmessage.' . $_IMAGE_TYPE . '\" alt=\"\" ' . XHTML\n . '>' . $message . '</p>'\n . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));\n }\n\n return $retval;\n}",
"function show_message($message) {\r\necho \"\n<!-- Container for message -->\n<div class='left'>\n<br><br><br><br>\n<span style='color:yellow;font-weight:bold'>$message</span>\n</div>\n<!-- Empty -->\n<div class='right'>\n</div>\r\n</body>\r\n</html>\";\n}",
"function printLabel() {\n /**\n * <PAGE></PAGE>:\n * Pagination, used to support the printing of multiple different label pages (up to 10 sheets), not using this label means that all elements are only printed on one label page\n *\n * <SIZE>width,height</SIZE>:\n * Set label paper width and height, width label paper width (excluding backing paper), height label paper height (excluding backing paper), unit mm, such as<SIZE>40,30</SIZE>\n *\n * <TEXT x=\"10\" y=\"100\" w=\"1\" h=\"2\" r=\"0\">Text content</TEXT>:\n * Print the text, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the text width magnification ratio 1-10 (default is 1)\n * Attribute h is text height magnification 1-10 (default is 1)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC128 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC128>:\n * Print code128 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 1)\n * The attribute r is the text rotation angle (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC39 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC39>:\n * Print code39 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 2)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <QR x=\"20\" y=\"20\" w=\"160\" e=\"H\">QR code content</QR>:\n * Print the QR code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the width of the QR code (default is 160)\n * Attribute e is the error correction level: L 7% M 15% Q 25% H 30% (the default is H)\n * The label content is a QR code value, and the maximum cannot exceed 256 characters\n * Note: A single order can only print one QR code\n */\n\n //Set size of label paper\n$printContent= <<<EOF\n<SIZE>40,30</SIZE>\nEOF;\n\n \n //print the first label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"1/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Golden Fried Rice\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ;\n\n //print the second label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"2/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Cucumber salad\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print the third label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"3/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Boston Lobster\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print a barcode\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a barcode: \"\n .\"</TEXT>\"\n .\"<BC128 x=\\\"16\\\" y=\\\"32\\\" h=\\\"32\\\" s=\\\"1\\\" n=\\\"2\\\" w=\\\"2\\\" r=\\\"0\\\">\"\n .\"12345678\"\n .\"</BC128>\"\n .\"</PAGE>\"\n ; \n\n //print a QR code. The minimum width is 128, it will not be able to be scanned if lower than 128\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a QR code: \"\n .\"</TEXT>\"\n .\"<QR x=\\\"16\\\" y=\\\"32\\\" w=\\\"128\\\">\"\n .\"https://www.xpyun.net\"\n .\"</QR>\"\n .\"</PAGE>\"\n ; \n\n $request = new PrintRequest();\n $request->generateSign();\n\n //*Required*: The serial number of the printer\n $request->sn=OK_PRINTER_SN;\n\n //*Required*: The content to be printed can’t exceed 12288 bytes.\n $request->content=$printContent;\n\n //The number of printed copies is 1 by default.\n $request->copies=1;\n\n $result = xpYunPrintLabel($request);\n print $result->content->code.\"\\n\";\n print $result->content->msg.\"\\n\";\n\n //resp.data: Return to order No. correctly \n print $result->content->data.\"\\n\";\t\n}",
"function vf_printmessagepanel($user) {\n $buser = !$user ? \"everyone\" : vf_usertolink($user);\n $input = vf_makesearch(\"msgdatalistfilter\");\n $datalist = vf_makedatalist(\"msgdatalistfilter\");\n echo <<<END\n </div>\n <div class=\"panelframe-right\">\n <div class=\"panelframe\">\n <form method=\"GET\">\n <div class=\"panelframe-item\">\n <div class=\"panelframe-item-title\">\n Message of you and $buser\n </div>\n <div class=\"panelframe-item-body\">\n <input $input type=\"text\" name=\"user\" class=\"input\" value=\"$user\" />$datalist\n <input type=\"submit\" value=\"filter\" class=\"button\" />\n </div>\n </div>\n </form>\n </div>\n </div>\n <div id=\"nextSetOfContent\"></div>\n</div>\nEND;\n }",
"function global_message() {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div class='information-box'>\n <img src='{$this->ipsclass->skin_acp_url}/images/global-infoicon.gif' alt='information' />\n <h2>Invision Power Board Message</h2>\n <p>\n \t<br />\n \t{$this->ipsclass->main_msg}\n </p>\n</div>\n<br />\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}",
"public function showmsg()\n\t{\n\t\t$data['content'] \t= load_view('msg_view','',TRUE,$this->active_theme);\n\t\tload_template($data,$this->active_theme);\n\t}",
"function PageBox($strTitle,$strMessage='Access denied',$strSkin='admin',$intTime=0,$strWidth='300px',$strTitleId='msgboxtitle',$strBodyId='msgbox') { $this->PageMsg($strTitle,$strMessage,$intTime,$strWidth,$strTitleId,$strBodyId,'',$strSkin); }",
"function print_forum_post($author,$creation,$content){\n\techo \"<tr>\";\n\techo \"<td><i>Posted on: </i>$creation<br />\";\n\techo \"<i>By: </i>$author\";\n\techo \"</td>\";\n\techo \"<td>$content</td>\";\n\techo \"</tr>\";\n}",
"function keativa_dashboard_messages() {\n\t\techo \"<p>Administrasi website resmi Khalifah Umroh & Tour.</p>\";\n\t}",
"function displayBody()\n{\n\techo \"This is a sample UL student advising site that we created for our CMPS 460 semester project. It contains the ability to support students of all majors, but for this demonstration we will focus on those majoring in computer science. Go ahead and log in to try it out!\";\n}",
"public function display_message() {\n\t}",
"function display_message($message)\r\n {\r\n Display :: normal_message($message);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get flexform XML by flexform data array | public function getFlexformXmlByFlexformDataArray($flexformDataArray)
{
$flexformXml = null;
if (is_array($flexformDataArray) && !empty($flexformDataArray)) {
/** @var FlexFormTools $flexformTools */
$flexformTools = GeneralUtility::makeInstance(FlexFormTools::class);
$flexformXml = $flexformTools->flexArray2Xml($flexformDataArray, true);
}
return $flexformXml;
} | [
"function createFlexForm() {\n\t\t$file = trim ( $this->sPS ( '\n\t\t<T3DataStructure>\n\t\t\t<meta>\n\t\t\t\t<langDisable>1</langDisable>\n\t\t\t</meta>\n\t\t\t<ROOT>\n\t\t\t\t<type>array</type>\n\t\t\t\t<el>\n\t\t\t\t\t<xmlTitle>\n\t\t\t\t\t\t<TCEforms>\n\t\t\t\t\t\t\t<label>The Title:</label>\n\t\t\t\t\t\t\t<config>\n\t\t\t\t\t\t\t\t<type>input</type>\n\t\t\t\t\t\t\t\t<size>30</size>\n\t\t\t\t\t\t\t</config>\n\t\t\t\t\t\t</TCEforms>\n\t\t\t\t\t</xmlTitle>\n\t\t\t\t\t<xmlText>\n\t\t\t\t\t\t<TCEforms>\n\t\t\t\t\t\t\t<label>Bodytext:</label>\n\t\t\t\t\t\t\t<config>\n\t\t\t\t\t\t\t\t<type>text</type>\n\t\t\t\t\t\t\t\t<size>48</size>\n\t\t\t\t\t\t\t</config>\n\t\t\t\t\t\t</TCEforms>\n\t\t\t\t\t</xmlText>\n\t\t\t\t</el>\n\t\t\t</ROOT>\n\t\t</T3DataStructure>\n\t\t' ) );\n\t\t\n\t\treturn $file;\n\t}",
"public function createXml($array)\n {\n \t$log = new KZ_Api_Log();\n $log->log($this->requestParameters,$array);\n\n \t$dom = new KZ_Api_Extend_XmlDomConstruct('1.0','utf-8');\n \t$dom->fromMixed($array);\n \t$data = $dom->saveXML();\n \treturn $data;\n\n }",
"private function getFlexformValues() {\r\n\r\n if ($this->flexformArray !== null) {\r\n return $this->flexformArray;\r\n }\r\n\r\n require_once(PATH_tslib . 'class.tslib_pibase.php');\r\n $pi = new tslib_pibase(); // Get pibase object, needed for flexform functions\r\n\r\n // Read current data in $pi\r\n $pi->cObj->data = $pi->pi_getRecord('tx_newspaper_extra_flexform', $this->getUid());\r\n\r\n $pi->pi_initPIflexForm('flexform'); // Convert xml data stored in record into an array\r\n\r\n $this->flexformArray = $pi->cObj->data['flexform']; // Cache array\r\n\r\n return $this->flexformArray;\r\n\r\n }",
"public function getFormXml(array $form)\n\t{\n\t\t$document = new DOMDocument('1.0', 'utf-8');\n\t\t$document->formatOutput = true;\n\n\t\t$rootNode = $document->createElement('form');\n\t\t$rootNode->setAttribute('title', $form['title']);\n\t\t$rootNode->setAttribute('description', $form['description']);\n\t\t$rootNode->setAttribute('active', $form['active']);\n\t\t$rootNode->setAttribute('hide_from_list', $form['hide_from_list']);\n\t\t$rootNode->setAttribute('max_responses', $form['max_responses']);\n\t\t$rootNode->setAttribute('max_responses_per_user', $form['max_responses_per_user']);\n\t\t$rootNode->setAttribute('complete_message', $form['complete_message']);\n\t\t$rootNode->setAttribute('redirect_method', $form['redirect_method']);\n\t\t$rootNode->setAttribute('redirect_url', $form['redirect_url']);\n\t\t\n\t\t// if the redirect destination is set, we need to get the name of the destination\n\t\t// so when we import the form, we can correctly associate the active redirect destination\n\t\tif ($form['redirect_destination'] != '')\n\t\t{\n\t\t $form['redirect_destination'] = $this->_getDb()->fetchOne('SELECT `name` FROM `kmkform__form_destination` WHERE `form_destination_id` = ?', array($form['redirect_destination']));\n\t\t}\n\t\t$rootNode->setAttribute('redirect_destination', $form['redirect_destination']);\n\t\t\n\t\t$rootNode->setAttribute('start_date', $form['start_date']);\n\t\t$rootNode->setAttribute('end_date', $form['end_date']);\n\t\t$rootNode->setAttribute('css', $form['css']);\n\t\t$rootNode->setAttribute('require_attachment', $form['require_attachment']);\n\t\t$rootNode->setAttribute('header_html', $form['header_html']);\n\t\t$rootNode->setAttribute('footer_html', $form['footer_html']); \n\t\t$document->appendChild($rootNode);\n\n\t\t$formId = $form['form_id'];\n\n\t\t$dataNode = $rootNode->appendChild($document->createElement('field'));\n\t\t$this->getModelFromCache('KomuKu_SimpleForms_Model_Field')->appendFieldFormXml($dataNode, $formId);\n\n\t\t$dataNode = $rootNode->appendChild($document->createElement('destination'));\n\t\t$this->appendFormDestinationXml($dataNode, $formId);\n\t\t\n\t\treturn $document;\n\t}",
"function umkcdora_retrieve_xml_form_builder_forms() {\n $content_models = umkcdora_retrieve_content_model_mappings();\n $xml_forms = array();\n foreach ($content_models as $content_model) {\n $key = key($content_model['form']);\n $xml_forms[$key] = $content_model['form'][$key];\n }\n return $xml_forms;\n}",
"private function flexArray2Xml($array, $addPrologue = false)\n {\n $flexArray2Xml_options = array();\n $flexArray2Xml_options['useCDATA'] = 1;\n//\t\t$flexArray2Xml_options['disableTypeAttrib'] = 2;\n\n $options = $GLOBALS['TYPO3_CONF_VARS']['BE']['niceFlexFormXMLtags'] ? $flexArray2Xml_options : array();\n $spaceInd = $GLOBALS['TYPO3_CONF_VARS']['BE']['compactFlexFormXML'] ? -1 : 4;\n $output = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::array2xml($array, '', 0, 'T3FlexForms',\n $spaceInd, $options);\n if ($addPrologue) {\n $output = '<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>' . LF . $output;\n }\n return $output;\n }",
"protected function buildXML()\n {\n return ArrayToXml::convert($this->formArrayFormat(), [\n 'rootElementName' => 'message'\n ]);\n }",
"function getFlexFieldTCA(&$TCA,$xmlArray) {\n $fieldArray=xmlTransformation::getArrayFromXML($xmlArray); // create array of field from xml template\n $globalConf=unserialize($GLOBALS['TYPO3_CONF_VARS'][\"EXT\"][\"extConf\"]['xflextemplate']);\n $fieldArray = t3lib_div::xml2array($xmlArray);\n if(is_array($fieldArray)){ // if array is correct\n foreach($fieldArray as $object){ // each object is a content subitem\n $temp=array();\n $name=$tempConfig='';\n $tempRange = array();\n foreach($object as $key=>$item){ //create TCA array from fields\n switch ($key){\n case 'name':\n $name=$item; //name of column\n break;\n case 'xtype':\n break;\n case 'defaultExtras':\n $defaultExtras='<'.$key.'>'.$item.'</'.$key.'>'; //valid only for rte\n break;\n case 'items':\n $tempConfig.= $this->setSelectItemsXML($item); // items for select and radio buttons\n break;\n case 'palettes': //list of palettes\n $palettes=$item;\n break;\n case 'maxval':\n $tempRange['upper']='<upper>' . $item . '</upper>';\n break;\n case 'minval':\n $tempRange['lower']='<lower>' . $item . '</lower>';\n break;\n case 'internal_type':\n if($item == 'file')\n $tempConfig.='<uploadfolder>'.$globalConf['uploadFolder'].'</uploadfolder>'.\"\\n\";\n $tempConfig.='<'.$key.'>'.$item.'</'.$key.'>'.\"\\n\";\n break;\n default:\n $tempConfig.='<'.$key.'>'.$item.'</'.$key.'>'.\"\\n\";\n break;\n }\n }\n if(!$defaultExtras && $object['type'] == 'text'){ //defaultExtras is defined as follow\n $defaultExtras = '<defaultExtras>' . $globalConf['defaultExtra'] . '</defaultExtras>';\n }\n if (count($tempRange)>0) {\n $tempConfig.='<range>'.implode('',$tempRange).'</range>'.\"\\n\";\n }\n //flextstring contains the xml block for each TCA column\n $flexString.='<'.$name.'><TCEforms>'.$label.'<config>'.$tempConfig.'</config>'.$defaultExtras.'</TCEforms></'.$name.'>'.\"\\n\";\n }\n }\n $flexString='<T3DataStructure><meta><langDisable>1</langDisable></meta><ROOT><type>array</type><el>'.$flexString.'</el></ROOT></T3DataStructure>';\n $xflexTceForms[$this->_EXTKEY]=array(\n 'exclude' => 1,\n 'config'=>array(\n \"type\" => \"flex\",\n \"ds\" => array (\n \"default\" => $flexString\n )\n )\n );\n //update TCA\n $TCA['columns'][$this->_EXTKEY]=$xflexTceForms[$this->_EXTKEY];\n }",
"function xml_form_by_obj($xml){\n $this->xml_form_by_vals($xml->vals);\n }",
"private function loadXMLFormArray() {\n $this->formArray = array();\n $els = $this->xml_output->getElementsByTagName(\"element\");\n $this->elSaveCount = 0;\n foreach ($els as $el) {\n $arr = $this->elementToArray($el);\n if (isset($this->formArray[trim($arr['id'])])) {\n $this->xml_output = null;\n $this->formArray = null;\n throw new ItFunctionalException('itf/load','Error en formulario',\n 'Id duplicado en itform',\n\t\t\tarray('xml' => $this->xml_input_text,\n 'id' => $arr['id']));\n }\n $this->formArray[trim($arr['id'])] = $arr;\n if ($arr['notsave'] != 'true') {\n $this->elSaveCount++;\n }\n }\n $els = $this->xml_output->getElementsByTagName(\"filelnk\");\n if ($els->length) {\n $this->THfiles = $els->item(0)->getElementsByTagName('idth')->item(0)->nodeValue;\n }\n }",
"function xml_form_by_vals($vals){\n//\techo \"qui <br>\";\n $fn=0;\n $en=0;\n $newtag=true;\n $this_node=new xml_node();\n for ($i=0;$i<count($vals);$i++){\n $this_node->xml_node_by_array($vals[$i]);\n if ($this_node->type!='cdata'){\n if ($this_node->tag=='FORM') if ($this_node->type=='open' or $this_node->type=='complete') $this->form=$this_node->attributes;\n if ($this_node->tag=='FIELD') {\n if ($this_node->type=='open' or $this_node->type=='complete') {\n $this->fields[$fn]=$this_node->attributes;\n $this->vars[$this_node->attributes['VAR']]=$fn;\n }\n if ($this_node->type!='open') {\n $fn++;\n }\n }\n if ($this_node->tag=='SEND') $this->buttons['INVIA']=$this_node->value;\n if ($this_node->tag=='SUBMIT') $this->buttons['SUBMIT']=$this_node->value;\n if ($this_node->tag=='SAVE') $this->buttons['SALVA']=$this_node->value;\n if ($this_node->tag=='EQUERY_FORM') $this->buttons['EQUERY_FORM']=$this_node->value;\n if ($this_node->tag=='CANCEL') $this->buttons['ANNULLA']=$this_node->value;\n if ($this_node->tag=='EXAM') {$this->enable[$en]=$this_node->attributes;$en++; }\n if ($this_node->tag=='TXT_VALUE') $this->fields[$fn]['TESTO']=$this_node->value;\n if ($this_node->tag=='VALUE')\n {\n $this->fields[$fn]['VALUE'][$this_node->attributes['VAL']]=$this_node->value;\n $this->fields[$fn]['VALUE_TXT'][$this_node->attributes['VAL']]=$this_node->attributes['TXT'];\n }\n }\n }\n global $service;\n $this->form['TABLE']=strtoupper($service).\"_\". $this->form['TABLE'];\n }",
"public function getXML($array = null) {\n\t\t$this->array = $array;\n\t\t$this->arraytoxml = new ArraytoXML ( $this->array );\n\t\t$xml = $this->arraytoxml->getResult ();\n\t\t$this->flush ();\n\t\treturn $xml;\n\t}",
"function array_to_xml($array=array(),$root=\"client\"){\n\t\t$xml_data = new SimpleXMLElement(\"<?xml version=\\\"1.0\\\"?><\".$root.\"/>\");\n\t\t$this->create_to_xml($array,$xml_data);\n\t\t$xml\t=\t$xml_data->asXML();\n\t\treturn $xml;\n\t}",
"function array2xml($array,$xml = false){\r\n\r\n\t\t$level = error_reporting();\r\n\t\terror_reporting(E_ERROR | E_PARSE);\r\n\r\n\t\tif ($xml===false){\r\n\t\t\t// creating object of SimpleXMLElement\r\n\t\t\t$thexml = new SimpleXMLElement(\"<?xml version=\\\"1.0\\\"?><entry xmlns:sdata=\\\"http://schemas.sage.com/sdata/2008/1\\\" xmlns:slx=\\\"http://schemas.sage.com/dynamic/2007\\\"></entry>\");\r\n\t\t\t$xml = $thexml->addChild(\"payload\",\"\",\"http://schemas.sage.com/sdata/2008/1\");\r\n\t\t}\r\n\t\t\r\n\t\tforeach($array as $key => $value) {\r\n\t\t\tif(is_array($value)) {\r\n\t\t\t\tif( isset( $value['@attributes'] ) ){\r\n\t\t\t\t\t$subnode = $xml->addChild(\"$key\",\"\",\"http://schemas.sage.com/dynamic/2007\");\r\n\t\t\t\t\tforeach($value['@attributes'] as $akey => $aval) $subnode->addAttribute($akey,$aval,\"http://schemas.sage.com/sdata/2008/1\");\r\n\t\t\t\t\t$this->array2xml($value['value'], $subnode);\r\n\t\t\t\t}elseif(!is_numeric($key)){\r\n\t\t\t\t\t$subnode = $xml->addChild(\"$key\",\"\",\"http://schemas.sage.com/dynamic/2007\");\r\n\t\t\t\t\t$this->array2xml($value, $subnode);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$this->array2xml($value, $xml);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$xml->addChild(\"$key\",\"$value\",\"http://schemas.sage.com/dynamic/2007\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\terror_reporting($level);\r\n\t\t\r\n\t\t//saving generated xml file\r\n\t\tif (isset($thexml)) { \r\n\t\t\t//make sure the xml is formatted nicely or sage wont like it.\r\n\t\t\t$dom = new DOMDocument(\"1.0\");\r\n\t\t\t$dom->preserveWhiteSpace = false;\r\n\t\t\t$dom->formatOutput = true;\r\n\t\t\t$dom->loadXML($thexml->asXML());\r\n\t\t\treturn $dom->saveXML();\r\n\t\t\t//return $thexml->asXML(); \r\n\t\t}\r\n\r\n\t}",
"public static function createTemplateXMLFromForm()\n\t{\n\t\tglobal $wgRequest;\n\n\t\t$xmlPerTemplate = array();\n\t\t$templateNum = -1;\n\n\t\t$tagOpened = false;\n\n\t\tforeach ( $wgRequest->getValues() as $var => $val ) {\n\n\t\t\t$val = PageSchemas::xmlEscape( $val );\n\n\t\t\tif ( !$tagOpened && (substr( $var, 0, 11 ) == 'wikivoteps_') && (substr( $var, 0, 16 ) != 'wikivoteps_field') ) {\n\t\t\t\t$xml = '<wikivoteps_TemplateOptions>';\n\t\t\t\t$templateNum = substr( $var, 23 );\n\t\t\t\t$tagOpened = true;\n\t\t\t}\n\t\t\tif ( $tagOpened && ((substr( $var, 0, 11 ) != 'wikivoteps_') || (substr( $var, 0, 16 ) == 'wikivoteps_field')) ) {\n\t\t\t\t$xml .= '</wikivoteps_TemplateOptions>';\n\t\t\t\t$xmlPerTemplate[$templateNum] = $xml;\n\t\t\t\t$tagOpened = false;\n\t\t\t}\n\n\t\t\tif ( substr( $var, 0, 23 ) == 'wikivoteps_text_before_' ) {\n\t\t\t\t$templateNum = substr( $var, 23 );\n\t\t\t\t//$xml = '<wikivoteps_TemplateOptions>';\n\t\t\t\tif ( !empty($val) ) {\n\t\t\t\t\t$xml .= \"<TextBefore>$val</TextBefore>\";\n\t\t\t\t}\n\t\t\t} elseif ( substr( $var, 0, 22 ) == 'wikivoteps_text_after_' ) {\n\t\t\t\tif ( !empty($val) ) {\n\t\t\t\t\t$xml .= \"<TextAfter>$val</TextAfter>\";\n\t\t\t\t}\n\t\t\t} elseif ( substr( $var, 0, 16 ) == 'wikivoteps_hide_' ) {\n\t\t\t\tif ( !empty($val) ) {\n\t\t\t\t\t$xml .= \"<HideTemplate>$val</HideTemplate>\";\n\t\t\t\t}\n\t\t\t\t//$xml .= '</wikivoteps_TemplateOptions>';\n\t\t\t}\n\t\t}\n\t\treturn $xmlPerTemplate;\n\t}",
"function buildFormValueXML($valueData) {\n // Check the array\n if (empty($valueData)) {\n return FALSE;\n }\n // Does not check captions to allow default values without a caption\n // Array seems to be okay, build the XML tree\n $xml = '<options>';\n foreach ($valueData as $val => $captions) {\n $xml .= '<value>';\n $xml .= sprintf('<content>%s</content>', $val);\n if (!empty($captions)) {\n $xml .= '<captions>';\n foreach ($captions as $lang => $caption) {\n $xml .= sprintf('<%1$s>%2$s</%1$s>', $lang, $caption);\n }\n $xml .= '</captions>';\n }\n $xml .= '</value>';\n }\n $xml .= '</options>';\n return $xml;\n }",
"public function createFormElement() : array {\n $info = $this->info;\n $return = [\n '#title' => $info['name'],\n '#type' => $info['type'],\n '#required' => $info['required'],\n '#default_value' => '',\n '#title_display' => 'invisible',\n ];\n\n $extra_info = unserialize($info['extra']);\n\n if (isset($info['#states']['visible'])) {\n $return['#states']['visible'] = $info['#states']['visible'];\n }\n\n if (isset($extra_info['webform_conditional_field_value']) && !empty($extra_info['webform_conditional_field_value'])) {\n $conditional_value = $extra_info['webform_conditional_field_value'];\n }\n if (isset($extra_info['webform_conditional_operator']) && !empty($extra_info['webform_conditional_operator'])) {\n $conditional_operator = $extra_info['webform_conditional_operator'];\n }\n if (isset($extra_info['webform_conditional_cid']) && !empty($extra_info['webform_conditional_cid'])) {\n $conditional_cid = $extra_info['webform_conditional_cid'];\n }\n if (isset($extra_info['items']) && !empty($extra_info['items'])) {\n $options = explode(PHP_EOL, $extra_info['items']);\n $arrLength = count($options);\n $option_array = array();\n foreach ($options as $key => $option) {\n $key_value = explode('|', $option);\n $option_array[$key_value[0]] = $key_value[1];\n if ($arrLength == 1) {\n $checkbox_label = $key_value[1];\n }\n }\n }\n\n if (!empty($info['value']) && $info['type'] != 'processed_text') {\n $info['value'] = str_replace(\"%first_name\", \"[current-user:field_first_name]\", $info['value']);\n $info['value'] = str_replace(\"%last_name\", \"[current-user:field_last_name]\", $info['value']);\n $info['value'] = str_replace(\"%phone\", \"[current-user:field_user_phone]\", $info['value']);\n $info['value'] = str_replace(\"%country\", \"[current-user:field_user_country]\", $info['value']);\n $info['value'] = str_replace(\"%organization\", \"[current-user:field_user_organization]\", $info['value']);\n $info['value'] = str_replace(\"%designation\", \"[current-user:field_user_designation]\", $info['value']);\n $return['#default_value'] = $info['value'];\n }\n switch ($info['type']) {\n case 'email':\n $return['#default_value'] = '[current-user:mail]';\n $return['#placeholder'] = $info['name'] . '*';\n break;\n case 'textfield':\n if ($info['required'] == '1') {\n $return['#placeholder'] = $info['name'] . '*';\n }\n else {\n $return['#placeholder'] = $info['name'];\n }\n break;\n case 'select':\n $return['#empty_option'] = $info['name'];\n break;\n case 'processed_text':\n $return['#format'] = 'full_html';\n $return['#text'] = $info['value'];\n break;\n case 'checkboxes':\n $return['#options'] = $option_array;\n $return['#description'] = $info['name'];\n $return['#description_display'] = 'invisible';\n unset($return['#title_display']);\n break;\n case 'checkbox':\n $return['#description'] = $info['name'] = $checkbox_label;\n $return['#description_display'] = 'invisible';\n $return['#title_display'] = 'after';\n break;\n case 'radios':\n $return['#description'] = $info['name'];\n $return['#description_display'] = 'invisible';\n $return['#options'] = $option_array;\n $return['#title_display'] = 'before';\n break;\n }\n\n switch ($info['form_key']) {\n case 'utm_campaign':\n $return['#default_value'] = '[current-page:query:utm_campaign:clear]';\n break;\n case 'utm_content':\n $return['#default_value'] = '[current-page:query:utm_content:clear]';\n break;\n case 'utm_medium':\n $return['#default_value'] = '[current-page:query:utm_medium:clear]';\n break;\n case 'utm_source':\n $return['#default_value'] = '[current-page:query:utm_source:clear]';\n break;\n case 'utm_term':\n $return['#default_value'] = '7010B000000sC3p';\n break;\n case 'privacy_policy':\n $return['#required_error'] = 'Privacy policy field is required.';\n break;\n case 'actions':\n if (!empty($info['value'])) {\n $return['#submit__label'] = $info['value'];\n break;\n }\n case 'add_to_schedule':\n $return['#title_display'] = 'none';\n $return['#trim'] = true;\n $return['#sanitize'] = true;\n $return['#download'] = true;\n $return['#url'] = '[webform_submission:add-to-schedule]';\n break;\n }\n\n\n $this->extraInfo($return);\n\n if ($info['form_key'] == 'gdpr_country') {\n $return['#options'] = 'country_codes';\n }\n if ($info['form_key'] == 'designation' || $info['form_key'] == 'job_title') {\n $return['#options'] = 'designation';\n }\n\n return $return;\n }",
"function toXML($array) {\n $xml = new SimpleXMLElement(\"<?xml version=\\\"1.0\\\"?><root></root>\");\n foreach($array as $key => $value) {\n if(is_array($value)) {\n $key = is_numeric($key) ? \"item$key\" : $key;\n $subnode = $xml->addChild(\"$key\");\n array_to_xml($value, $subnode);\n }\n else {\n $key = is_numeric($key) ? \"item$key\" : $key;\n $xml->addChild(\"$key\",\"$value\");\n }\n }\n return $xml->asXML();\n }",
"function array_to_xml($array, $root_name, $basic_element_name) {\n $string = '<' . $root_name . '>';\n foreach ($array as $subarray) {\n //echo \" sub: \";\n //print_r($subarray);\n $string = $string . '<' . $basic_element_name . '>';\n foreach ($subarray as $key =>$value) {\n $string = $string . '<' . $key . '>' . $value . '</' . $key . '>';\n }\n $string = $string . '</' . $basic_element_name . '>';\n }\n $string = $string . '</' . $root_name . '>';\n\n return $string;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function read extantions from XML file. | function ReadExtFromXML($xmlFileName)
{
try
{
$xml = simplexml_load_file ( $xmlFileName );
if (! $xml)
throw new Exception ( "The file <b>$xmlFileName</b> does not exist or is not right file!" );
// get extantions
$extantions = $xml->xpath ( "extantion" );
if (! $extantions)
throw new Exception ( "The extantions in XML file must be decalred well!" );
foreach ($extantions as $extantion)
{
$filePath = (string)$extantion;
$className = (string)$extantion['className'];
// include files and add new extantions classes
Site::IncludeFile("classes/" . $filePath);
$this->AddModuleExtension(new $className);
}
}
catch ( Exception $e )
{
$message = $e->getMessage ();
print ( $message );
}
return true;
} | [
"function &getExtXML($extension)\n {\n static $xmls;\n\n if (! isset($xmls)) {\n $xmls = array();\n }\n\n if (! isset($xmls[$extension])) {\n $xmls[$extension] = null;\n\n $xmlFile = JPATH_ROOT . DS . 'components' . DS . 'com_sef' . DS . 'sef_ext' . DS . $extension . '.xml';\n if (JFile::exists($xmlFile)) {\n $xmls[$extension] = JFactory::getXMLParser('Simple');\n if (! $xmls[$extension]->loadFile($xmlFile)) {\n $xmls[$extension] = null;\n }\n }\n }\n\n return $xmls[$extension];\n }",
"private function getExtensionConfigXml() \n\t{\n\n\t\t// path to the extensions config.xml\n\t\t$extension_config_xml_path = parent::$extension_base_dir . '/etc/config.xml';\n\n\t\tif (!file_exists($extension_config_xml_path)) {\n\t\t\t$this->displayError('Cant find path to extension config xml.');\n\t\t}\n\n\t\t$extension_config_xml = simplexml_load_file($extension_config_xml_path);\n\n\t\tparent::$extension_config_xml = $extension_config_xml;\n\n\t}",
"protected function parseXmlFile() {}",
"public function get_xml_files() {\n\n $upload_dir = $this->uploads_dir;\n \n $xml_dirname = $upload_dir['basedir'] . '/xml_import';\n\n if ( ! file_exists( $xml_dirname ) ) {\n error_log('no xml directory');\n return;\n }\n\n $files = array();\n \n foreach (glob($xml_dirname . \"/*.xml\") as $file) {\n\n $name = basename($file); \n\n preg_match('/exp_wyk_/', $name, $date_match);\n if(isset($date_match[0])) {\n $date = strtotime($date_match[0]);\n } else {\n continue;\n }\n\n if (strpos($name, 'imported_') === FALSE) {\n $file_imported = 0;\n } else {\n $file_imported = 1;\n }\n\n $files[] = array(\n 'file_path' => $file,\n 'date' => $date,\n 'imported' => $file_imported,\n 'size' =>filesize($file),\n 'name' => $name,\n );\n\n }\n\n if (!empty($files)) {\n return $files;\n } else {\n return false;\n }\n\n }",
"public function get_xml_files() {\n\n $upload_dir = $this->uploads_dir;\n \n $xml_dirname = $upload_dir['basedir'] . '/xml_import';\n\n if ( ! file_exists( $xml_dirname ) ) {\n error_log('no xml directory');\n return;\n }\n\n $files = array();\n \n foreach (glob($xml_dirname . \"/*.xml\") as $file) {\n\n $name = basename($file); \n\n preg_match('/exp_dok_/', $name, $date_match);\n if(isset($date_match[0])) {\n $date = strtotime($date_match[0]);\n } else {\n continue;\n }\n\n if (strpos($name, 'imported_') === FALSE) {\n $file_imported = 0;\n } else {\n $file_imported = 1;\n }\n\n $files[] = array(\n 'file_path' => $file,\n 'date' => $date,\n 'imported' => $file_imported,\n 'size' =>filesize($file),\n 'name' => $name,\n );\n\n }\n\n if (!empty($files)) {\n return $files;\n } else {\n return false;\n }\n\n }",
"public function readXml();",
"function wpo_read($dir) {\n\t$xml = simplexml_load_file($dir); // load the xml file\n\t$list = array(); // create an empty array for SimpleXMLObjects\n\t$list = array_merge($list, $xml->xpath(\"/wpo/file\")); // add paths of files to $list array\n\treturn $list; //return the array\n}",
"public abstract function getExtensionInformation();",
"private function getExtensionSystemXml() \n\t{\n\n\t\t// path to the extensions config.xml\n\t\t$extension_system_xml_path = parent::$extension_base_dir . '/etc/system.xml';\n\n\t\tif (!file_exists($extension_system_xml_path)) {\n\t\t\t$this->displayError('Cant find path to extension system xml.');\n\t\t}\n\n\t\t$extension_system_xml = simplexml_load_file($extension_system_xml_path);\n\n\t\tparent::$extension_system_xml = $extension_system_xml;\n\n\t}",
"public function parseRequestedExtensions()\n {\n }",
"function getExtensionInfo($path, $extKey)\t{\n\t\t$file = $path.'/ext_emconf.php';\n\t\tif (@is_file($file))\t{\n\t\t\t$_EXTKEY = $extKey;\n\t\t\t$EM_CONF = array();\n\t\t\trequire($file);\n\t\n\t\t\t$eInfo = array();\n\t\t\t\t// Info from emconf:\n\t\t\t$eInfo['title'] = $EM_CONF[$extKey]['title'];\n\t\t\t$eInfo['version'] = $EM_CONF[$extKey]['version'];\n\t\t\t$eInfo['CGLcompliance'] = $EM_CONF[$extKey]['CGLcompliance'];\n\t\t\t$eInfo['CGLcompliance_note'] = $EM_CONF[$extKey]['CGLcompliance_note'];\n\t\t\tif (is_array($EM_CONF[$extKey]['constraints']) && is_array($EM_CONF[$extKey]['constraints']['depends']))\t{\n\t\t\t\t$eInfo['TYPO3_version'] = $EM_CONF[$extKey]['constraints']['depends']['typo3'];\n\t\t\t} else {\n\t\t\t\t$eInfo['TYPO3_version'] = $EM_CONF[$extKey]['TYPO3_version'];\n\t\t\t}\n\t\t\t$filesHash = unserialize($EM_CONF[$extKey]['_md5_values_when_last_written']);\n\t\t\t$eInfo['manual'] = @is_file($path.'/doc/manual.sxw');\n\t\n\t\t\treturn $eInfo;\n\t\t} else {\n\t\t\treturn 'ERROR: No emconf.php file: '.$file;\n\t\t}\n\t}",
"public function import_xml(){\n\n\t\t$this->load->language('extension/module/xml_module');\n\n\t\t$this->load->model('extension/module/xml_module');\n\n\t\t$this->load->model('catalog/attribute_group');\n\n\t\t$this->load->model('catalog/attribute');\n\n\t\t$this->load->model('catalog/manufacturer');\n\n\t\t$this->load->model('catalog/product');\n\n\t\t$json = array();\n\t\t$xml_url = \"\";\n\n\t\t// Check user has permission\n\t\tif (!$this->user->hasPermission('modify', 'extension/module/xml_module')) {\n\t\t\t$json['error'] = $this->language->get('error_permission');\n\t\t}\n\n\t\tif ($_POST[\"xml_url\"]){\n\t\t\t$xml_url = $_POST[\"xml_url\"];\n\t\t\t$xml = simplexml_load_file($xml_url) or die(\"feed not loading\");\n\t\t\t$this->parseCategories($xml);\n\t\t\t$this->parseProducts($xml);\n\t\t}\n\n\t\tif (!$json) {\n\t\t\t$json['success'] = $this->language->get('text_import_success');\n\t\t}\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\n\t\t$this->session->data['success'] = $this->language->get('text_success');\n\t}",
"function prepareImportExtList()\t{\n\t\t$list = array();\n\t\t$cat = $this->defaultCategories;\n\t\t$filepath = $this->getMirrorURL();\n\n\t\treset($this->xmlhandler->extensionsXML);\n\t\twhile (list($extKey, $data) = each($this->xmlhandler->extensionsXML)) {\n\t\t\t$GLOBALS['LANG']->csConvObj->convArray($data,'utf-8',$GLOBALS['LANG']->charSet); // is there a better place for conversion?\n\t\t\t$list[$extKey]['type'] = '_';\n\t\t\t$version = array_keys($data['versions']);\n\t\t\t$list[$extKey]['_ICON'] = '<img alt=\"\" src=\"'.$filepath.$extKey{0}.'/'.$extKey{1}.'/'.$extKey.'_'.end($version).'.gif\" />';\n\t\t\t$list[$extKey]['downloadcounter'] = $data['downloadcounter'];\n\n\t\t\tforeach(array_keys($data['versions']) as $version) {\n\t\t\t\t$list[$extKey]['versions'][$version]['downloadcounter'] = $data['versions'][$version]['downloadcounter'];\n\n\t\t\t\t$list[$extKey]['versions'][$version]['EM_CONF'] = array(\n\t\t\t\t'version' => $version,\n\t\t\t\t'title' => $data['versions'][$version]['title'],\n\t\t\t\t'description' => $data['versions'][$version]['description'],\n\t\t\t\t'category' => $data['versions'][$version]['category'],\n\t\t\t\t'constraints' => $data['versions'][$version]['dependencies'],\n\t\t\t\t'state' => $data['versions'][$version]['state'],\n\t\t\t\t'reviewstate' => $data['versions'][$version]['reviewstate'],\n\t\t\t\t'lastuploaddate' => $data['versions'][$version]['lastuploaddate'],\n\t\t\t\t'author' => $data['versions'][$version]['authorname'],\n\t\t\t\t'author_email' => $data['versions'][$version]['authoremail'],\n\t\t\t\t'author_company' => $data['versions'][$version]['authorcompany'],\n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->setCat($cat, $list[$extKey]['versions'][$version], $extKey);\n\t\t}\n\n\t\treturn array($list,$cat);\n\t}",
"abstract public function parseXml($file);",
"function getAvailableContentElements(){\r\n\r\n\t$ce_path = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_customproperties'.DS.\"samplece\";\r\n\t// Try to find the XML file\r\n\t$filesindir = str_ireplace('.xml', '', JFolder::files($ce_path ,\".xml\"));\r\n\r\n\treturn $filesindir;\r\n\r\n}",
"protected function getExtensionsToLoad() {}",
"private function _loadExtensionSettings(){\n\t\t$this->settings = new DOMDocument('1.0', 'UTF-8');\n\t\tif(!is_file($this->extension_settings_file)){\n\t\t\t$this->settings->appendChild($this->settings->createElement('settings'));\n\t\t} else {\n\t\t\t$this->settings->load($this->extension_settings_file);\n\t\t}\n\t}",
"function xml_form_by_file($xml_file) {\r\n\t\t$xml = new my_xml_parser ( $xml_file );\r\n\t\t$this->xml_form_by_obj ( $xml );\r\n\t\t\r\n//\t\tif($this->config_service['multilang']==\"1\"){\r\n//\t\t\t$xml_and = simplexml_load_file($xml_file) or die(\"feed not loading\");\r\n//\t\t\tforeach($xml_and->field as $key => $val){\r\n//\t\t\t\tforeach( $val->txt_value as $k => $v ){\r\n//\t\t\t\t\techo $k ;print_R($v); echo \"--<br>\";\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}",
"public function readFromXML($fpath) {\n \n // Check parameters\n if (is_string($fpath) !== true) {\n throw new Exception('zenlib_bootstrap-' . strval(__LINE__));\n }\n \n // Check whether path is to an uploaded file\n if (is_uploaded_file($fpath) !== true) {\n throw new Exception(\"Can't read uploaded file\");\n }\n \n // Read the XML file into memory\n $data = file_get_contents(\n $fpath, false, NULL, 0, self::MAX_XML_LENGTH + 16);\n if ($data === false) {\n throw new Exception(\"Can't read uploaded file\");\n }\n if (strlen($data) > self::MAX_XML_LENGTH) {\n throw new Exception(\"XML file is too large\");\n }\n \n // Create an XML callback receiver\n $recv = new ZenLibCfgXML();\n \n // Create a new XML parser\n $parser = xml_parser_create('UTF-8');\n if ($parser === false) {\n throw new Exception('zenlib_bootstrap-' . strval(__LINE__));\n }\n \n // Wrap in a try-finally so that XML parser is always freed\n try {\n \n // Register the XML callback receiver\n if (xml_set_element_handler(\n $parser,\n array($recv, 'start_element'),\n array($recv, 'end_element')) !== true) {\n throw new Exception('zenlib_bootstrap-' . strval(__LINE__));\n }\n \n // Parse the XML data\n if (xml_parse($parser, $data, true) === 0) {\n \n // Get the error message\n $msg = xml_get_error_code($parser);\n if ($msg !== false) {\n $msg = xml_error_string($msg);\n if ($msg === false) {\n $msg = \"Unknown error\";\n }\n } else {\n $msg = \"Unknown error\";\n }\n \n // Get the line number, or -1 if unknown\n $lnum = xml_get_current_line_number($parser);\n if ($lnum === false) {\n $lnum = -1;\n } else if ($lnum < 1) {\n $lnum = -1;\n }\n \n // Add line number information to error message if available\n if ($lnum !== -1) {\n $msg = \"XML line $lnum: $msg\";\n }\n \n // Throw exception\n throw new Exception($msg);\n }\n \n } finally {\n // Free the parser\n xml_parser_free($parser);\n unset($parser);\n }\n \n // Get result from callback receiver\n $vars = $recv->getResult();\n if ($vars === false) {\n throw new Exception('XML file had wrong kind of root element');\n }\n \n // Read available variables\n $this->m_isbndb_key = self::readXMLValue('isbndb_key', $vars);\n $this->m_db_path = self::readXMLValue('db_path', $vars);\n $this->m_db_covers = self::readXMLValue('db_covers', $vars);\n $this->m_base_url = self::readXMLValue('base_url', $vars);\n $this->m_base_lib = self::readXMLValue('base_lib', $vars);\n $this->m_map_list = self::readXMLValue('map_list', $vars);\n $this->m_map_entry = self::readXMLValue('map_entry', $vars);\n $this->m_map_detail = self::readXMLValue('map_detail', $vars);\n $this->m_map_add = self::readXMLValue('map_add', $vars);\n $this->m_custom_name = self::readXMLValue('custom_name', $vars);\n \n // If custom name is not valid Unicode string, then set to empty\n // string\n if (JCQTypes::checkUniString($this->m_custom_name) !== true) {\n $this->m_custom_name = '';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of moviesWriter | public function setmoviesWriter($moviesWriter)
{
$this->moviesWriter = $moviesWriter;
return $this;
} | [
"public function setMovie($movie) { $this->movie = $movie ; }",
"public function set_movie(Movie $movie){\n\t\t$this->movie = $movie;\n\t}",
"public function setWriters($value)\n {\n if (!array_key_exists('writers', $this->fieldsModified)) {\n $this->fieldsModified['writers'] = $this->data['fields']['writers'];\n } elseif ($value === $this->fieldsModified['writers']) {\n unset($this->fieldsModified['writers']);\n }\n\n $this->data['fields']['writers'] = $value;\n }",
"private function registerWriter() : void\n {\n $this->fixture->offsetSet('index', $this->writer->reveal());\n }",
"private function registerWriter() : void\n {\n $this->fixture->offsetSet('index', $this->writer);\n }",
"public function setMovie($movie)\n {\n $this->movie = $movie;\n\n return $this;\n }",
"public function setWriter($writer)\n {\n $this->orm['writer'] = $writer;\n }",
"public function setResponseWriter($responseWriter)\n {\n }",
"public function setMovieFilmCount($value) {\n return $this->set(self::MOVIE_FILM_COUNT, $value);\n }",
"private function setWriter(XMLWriter $writer)\n {\n $this->writer = $writer;\n }",
"public function setVideoMovie($attributes = []);",
"function setMovie(mofilmMovieBase $inMovie) {\n\t\tif ( $inMovie !== $this->_Movie ) {\n\t\t\t$this->_Movie = $inMovie;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setResponseWriter($responseWriter){}",
"function setMovieID($inMovieID) {\n\t\tif ( $inMovieID !== $this->_MovieID ) {\n\t\t\t$this->_MovieID = $inMovieID;\n\t\t}\n\t\treturn $this;\n\t}",
"public function setMovieRating($val)\n {\n $this->_propDict[\"movieRating\"] = $val;\n return $this;\n }",
"private function updateMovies(array $movies, array $actors, array $genres)\n {\n $transformers = file_get_contents(__DIR__ . '/Fixtures/transformers.jpg');\n $movies['Movie1']->setImage(base64_encode($transformers));\n $movies['Movie1']->addActor('Sam Witwicky', $actors['Actor3']);\n $movies['Movie1']->addActor('Mikaela Banes', $actors['Actor4']);\n $movies['Movie1']->addActor('Bumblebee', $actors['Actor5']);\n $movies['Movie1']->setGenre($genres['Genre1']);\n\n $austinPowers = file_get_contents(__DIR__ . '/Fixtures/austin_powers.jpg');\n $movies['Movie2']->setImage(base64_encode($austinPowers));\n $movies['Movie2']->addActor('Austin Powers', $actors['Actor1']);\n $movies['Movie2']->addActor('Felicity Shagwell', $actors['Actor2']);\n $movies['Movie2']->setGenre($genres['Genre2']);\n }",
"public function setMovie($movie)\n {\n $this->movie = $movie;\n\n return $this;\n }",
"public function setId_movie($id_movie)\n {\n $this->id_movie = $id_movie;\n\n return $this;\n }",
"function setMovieID($inMovieID) {\n\t\tif ( $this->_MovieID !== $inMovieID ) {\n\t\t\t$this->_MovieID = $inMovieID;\n\t\t\t$this->_Modified = true;\n\t\t}\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initiate hooks if user scopes are registered. | public function hooks() {
if ( $this->scopes ) {
// Restrict access to user role promotion.
add_filter( 'editable_roles', array( $this, 'editable_roles' ) );
// Scope roles with user capabilities appropriately.
if ( $this->scoped_capabilities ) {
add_filter( 'user_has_cap', array( $this, 'user_has_cap' ), 11, 4 );
}
// Scope roles by specific filters.
if ( $this->scoped_filters['roles'] ) {
// Get the current user object.
$user = wp_get_current_user();
// Reduce the list of the current user's roles to those which have a custom filter.
$roles = array_intersect( $user->roles, array_keys( $this->scoped_filters['roles'] ) );
// Compile a list of filter functions to initialize.
$filters = array();
foreach ( $roles as $role ) {
$filters = array_merge( $filters, $this->scoped_filters['roles'][ $role ] );
}
// Initialize custom filter hooks.
if ( ! empty( $filters ) ) {
foreach ( $filters as $filter => $arg_count ) {
add_filter( $filter, array( $this, $filter ), 11, $arg_count );
}
}
}
}
} | [
"private function register_scopes_hook() {\n\t\tadd_filter(\n\t\t\t'googlesitekit_auth_scopes',\n\t\t\tfunction( array $scopes ) {\n\t\t\t\treturn array_merge( $scopes, $this->get_scopes() );\n\t\t\t}\n\t\t);\n\t}",
"protected static function boot(): void\n {\n parent::boot();\n\n // apply scopes\n static::addGlobalScope(new UsersScope);\n }",
"public function initHooks() {\n\t\t\tif (AppLoader::includeHooks('CommonHooks')) {\n\t\t\t\t$objCommonHooks = new CommonHooks();\n\t\t\t\t$this->registerPreRunHook(array($objCommonHooks, 'verifyToken'));\n\t\t\t\t$this->registerPostRunHook(array($objCommonHooks, 'trackHistory'), array(5, array('css', 'js', 'xml', 'json', 'jsonp', 'html')));\n\t\t\t}\n\t\t\t\t\n\t\t\tif (AppLoader::includeHooks('CacheHooks')) {\n\t\t\t\t$objCacheHooks = new CacheHooks();\n\t\t\t\t$this->registerPreRunHook(array($objCacheHooks, 'serveCache'));\n\t\t\t\t$this->registerPostRunHook(array($objCacheHooks, 'saveCache'));\n\t\t\t}\n\t\t}",
"protected static function _initScopes() {\n\t\tstatic::$_scopes = Libraries::instance(null, 'configuration', [], static::$_classes);\n\t\tstatic::$_scopes->initConfig = function($name, $config) {\n\t\t\t$defaults = [\n\t\t\t\t'absolute' => false,\n\t\t\t\t'host' => null,\n\t\t\t\t'scheme' => null,\n\t\t\t\t'base' => null,\n\t\t\t\t'prefix' => '',\n\t\t\t\t'pattern' => '',\n\t\t\t\t'values' => [],\n\t\t\t\t'library' => $name\n\t\t\t];\n\n\t\t\t$config += $defaults;\n\n\t\t\tif (!$config['pattern']) {\n\t\t\t\t$config = static::_compileScope($config);\n\t\t\t}\n\t\t\t$config['base'] = $config['base'] ? trim($config['base'], '/') : $config['base'];\n\t\t\treturn $config;\n\t\t};\n\t}",
"function init_hooks() {\n\t\trequire_once um_mycred_path . 'includes/core/hooks/class-init.php';\n\t\tif ( empty( UM()->classes['um_mycred_hooks_init'] ) ) {\n\t\t\tUM()->classes['um_mycred_hooks_init'] = new um_ext\\um_mycred\\core\\hooks\\Init();\n\t\t}\n\t\treturn UM()->classes['um_mycred_hooks_init'];\n\t}",
"protected function constructScopes() {}",
"private function init_user_roles() {\n\n\t\tglobal $wp_roles;\n\n\t\tif ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) {\n\t\t\t$wp_roles = new WP_Roles();\n\t\t}\n\n\t\t// it's fine if this gets executed more than once\n\t\tif ( is_object( $wp_roles ) ) {\n\t\t\t$wp_roles->add_cap( 'shop_manager', 'manage_woocommerce_tab_manager' );\n\t\t\t$wp_roles->add_cap( 'administrator', 'manage_woocommerce_tab_manager' );\n\t\t}\n\t}",
"public function setup_hooks()\n {\n }",
"public function themeInitCallbacks() {\n $this->themeSupport();\n $this->registerMenus();\n }",
"protected function init()\n {\n $context = $this->context;\n $this->twig->addFunction(new TwigFunction('has_permission', function (string $permission) use($context) {\n $acl = $context->getAccessControlList();\n $auth = $context->getAuthentication();\n $user = $auth->getUser();\n\n if ($user instanceof UserInterface) {\n return $acl->hasAccess($user, $permission);\n }\n\n return false;\n }));\n }",
"private function initializePreValidation () {\n $this->checkUserAccess();\n }",
"public function setupHooks() { \n $this->loadTranslations();\n \n // if the builder is installed and activated load custom modules\n\t\tif ( ! class_exists( 'FLBuilder' ) ) {\n\t\t\treturn;\t\n\t\t}\t\t\t\t\n add_action( 'init', array($this, 'loadModules')); \n }",
"public function setup_hooks() {\n\n\t\t$this->setup_actions();\n\n\t\t$this->setup_filters();\n\n\t}",
"public function load_hooks() {\n\t\t\t/**\n\t\t\t * Initialize Localization\n\t\t\t */\n\t\t\tadd_action( 'init', array( $this, 'localization' ) );\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'load_classes' ), 1 );\n\t\t}",
"public function beforeFilter() {\n\t\tif ($this->requireOAuth['enabled']) {\n\t\t\t$this->_loadModels();\n\t\t\t$actions = $this->requireOAuth['actions'];\n\t\t\tif (is_array($actions) && (in_array($this->action, $actions) || in_array('*', $actions)) || $actions == '*') {\n\t\t\t\t$this->verifyOauthRequest();\n\t\t\t}\n\t\t\t$this->configureOAuth();\n\t\t\t$this->_afterOauthChecked();\n\t\t} else {\n\t\t\tparent::beforeFilter();\n\t\t}\n\t}",
"public function registerUserProfileHooks()\n\t{\n\t\t// show LDAP attributes in users's profile\n\t\t$this->dc()->getShowLdapAttributes()->register();\n\t\t// prevent change of email address\n\t\t$this->dc()->getPreventEmailChange()->register();\n\t\t// prevent change of password\n\t\t$this->dc()->getProfilePreventPasswordChange()->register();\n\t\t// after persisting the profile the Active Directory synchronization should be performed\n\t\t$this->dc()->getTriggerActiveDirectorySynchronization()->register();\n\t\t// disable user profile\n\t\t$this->dc()->getProvideDisableUserOption()->register();\n\t}",
"public function attach_hooks() {\n\t\t$this->define_hooks();\n\t}",
"public function load_hooks() {\n\t\t\tadd_filter( 'plugins_api_result', [ $this, 'plugins_api_result' ], 10, 3 );\n\t\t\tadd_filter( 'upgrader_post_install', [ $this, 'upgrader_post_install' ], 10, 3 );\n\t\t}",
"public function load_hooks() {\n\t\tadd_action( 'init', [ $this, 'updater' ] );\n\t\t$this->load_settings();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the externalObjectVersion Nullable. The external Item Version for the object specified by the externalObjectId. | public function setExternalObjectVersion($val)
{
$this->_propDict["externalObjectVersion"] = $val;
return $this;
} | [
"public function getExternalObjectVersion()\n {\n if (array_key_exists(\"externalObjectVersion\", $this->_propDict)) {\n return $this->_propDict[\"externalObjectVersion\"];\n } else {\n return null;\n }\n }",
"public function setExternalid($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->externalid !== $v) {\n\t\t\t$this->externalid = $v;\n\t\t\t$this->modifiedColumns[] = RpMissionItineraryPeer::EXTERNALID;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setExternalObjectId($val)\n {\n $this->_propDict[\"externalObjectId\"] = $val;\n return $this;\n }",
"public function setExternalId(?string $externalId): void\n {\n $this->externalId = $externalId;\n }",
"public function setExternalId($var)\n {\n GPBUtil::checkString($var, True);\n $this->external_id = $var;\n\n return $this;\n }",
"public function SetExternalReference( $externalReference )\n {\n $this->externalReference = $externalReference;\n }",
"public function set_external_reference($external_reference)\n {\n $this->external_reference = $external_reference;\n }",
"public function setExternalDocumentNumber(?string $value): void {\n $this->getBackingStore()->set('externalDocumentNumber', $value);\n }",
"function setExternalReference($inExternalReference) {\n\t\t$this->getParamSet()->setParam(self::PARAM_EXTERNAL_REF, $inExternalReference);\n\t\treturn $this;\n\t}",
"public function setExternalId($val)\n {\n $this->_propDict[\"externalId\"] = $val;\n return $this;\n }",
"public function setExternalProductReference(\\Recurly\\Resources\\ExternalProductReferenceMini $external_product_reference): void\n {\n $this->_external_product_reference = $external_product_reference;\n }",
"public function set_external_uid($external_uid)\n {\n $this->set_default_property(self::PROPERTY_EXTERNAL_UID, $external_uid);\n }",
"function setExternalPartnerTypeId($a_iExternalPartnerTypeId)\n {\n $this->_iExternalPartnerTypeId = (int) $a_iExternalPartnerTypeId;\n $this->setSearchParameter('external_partner_type_id', $this->_iExternalPartnerTypeId);\n }",
"public function setVersionReference($version)\n {\n assertion(! $this->isStockItem());\n $this->version = trim($version);\n }",
"public function setExternalSku(string $external_sku): void\n {\n $this->_external_sku = $external_sku;\n }",
"public function setExternalAttributes($externalAttributes)\n {\n $known = self::UNKNOWN != $externalAttributes;\n if ($known) {\n if (0x00000000 > $externalAttributes || $externalAttributes > 0xffffffff) {\n throw new ZipException(\"external file attributes out of range - \" . $this->name);\n }\n $this->externalAttributes = $externalAttributes;\n } else {\n $this->externalAttributes = 0;\n }\n $this->setInit(self::BIT_EXTERNAL_ATTR, $known);\n }",
"public function setExternalDetails(?ExternalPaymentDetails $externalDetails): void\n {\n $this->externalDetails = $externalDetails;\n }",
"public function setExternal_img ($external_img) {\n\t$this->external_img = $external_img;\n\treturn $this;\n}",
"public function setExternalRef($ref)\n {\n $this->externalRef = $ref;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Publishes the migrations from the translation package to be published into the localization migrations folder to be ran when the extension is installing | private function prepareMigrations()
{
/*
* If the extension is installing, we'll publish the localization
* migrations to our localization extension directory
*/
Extension::installing(function (Extension $extension) {
$extension->getSlug('stevebauman/localization');
if ($extension->getNamespace() === 'Stevebauman\Localization') {
Artisan::call('vendor:publish', array(
'--provider' => get_class($this),
));
}
});
} | [
"public function publishMigration()\n {\n $this->publishes([\n __DIR__ . '/../../migrations/' => base_path('/database/migrations'),\n ], 'migrations');\n }",
"private function publishMigrations(): void\n {\n static $migrations = [\n '0000_00_00_000000_create_scout_database_words_table.php' => '_create_scout_database_words_table.php',\n '0000_00_00_000001_create_scout_database_documents_table.php' => '_create_scout_database_documents_table.php',\n '0000_00_00_000002_create_scout_database_index_table.php' => '_create_scout_database_index_table.php',\n ];\n\n $index = 0;\n foreach ($migrations as $originalName => $targetSuffix) {\n // Migration files are only published if no migration files with similar names exist already.\n if (count(glob(database_path(\"migrations/*{$targetSuffix}\"))) === 0) {\n $this->publishes([\n __DIR__.\"/../migrations/{$originalName}\" => database_path('migrations/'.date('Y_m_d_His', time()+$index).$targetSuffix),\n ], 'migrations');\n\n $index++;\n }\n }\n }",
"protected function publishMigrations(): void\n {\n $files = [\n 'add_mobile_to_users_table.php',\n 'create_two_factor_auths_table.php',\n ];\n\n $paths = [];\n\n foreach ($files as $file) {\n $paths[__DIR__.'/database/migrations/'.$file] = database_path('migrations/'.date('Y_m_d_His').'_'.$file);\n }\n\n $this->publishes($paths, 'migrations');\n }",
"private function publishMigrations(): void\n {\n $this->publishes([\n __DIR__.'/../../database/migrations' => database_path('migrations'),\n ], 'migrations');\n }",
"private function migrationPublisher()\n {\n // When users execute Laravel's vendor:publish command, the migration file will be copied to the specified location\n $this->publishes([\n dirname(__DIR__) . '/Migrations/2020_08_18_133916_create_php_rbac_tables.php' => database_path('migrations/2020_08_18_133916_create_php_rbac_tables.php'),\n ]);\n }",
"protected function publishMigration() {\n $this->publishes([\n __DIR__ . '/migrations' => $this->app->databasePath() . '/migrations'\n ], 'migrations');\n }",
"protected function publishMigrations()\n {\n $stub = __DIR__ . '/Migrations/';\n $target = database_path('migrations') . '/';\n $this->publishes([\n $stub . 'create_csv_definitions_table.php' => $target . date('Y_m_d_His', time()).'_create_csv_definitions_table.php',\n ], 'migrations');\n }",
"protected function publishMigrations()\n {\n $this->publishes([\n __DIR__ . '/../migrations/' => database_path('migrations'),\n ], 'migrations');\n }",
"public function defineMigrationsPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../database/migrations' => base_path('database/migrations'),\n ], 'cogroupcms-migrations');\n }\n }",
"private function registerPublishableMigrations()\n {\n if (!Schema::hasTable('mercurius_messages')) {\n $_date = date('Y_m_d_His', time());\n $_path = __DIR__.'/../publishable/database/migrations/';\n\n $_migrations = [\n \"${_path}add_mercurius_user_fields.php\" => database_path(\"migrations/${_date}_add_mercurius_user_fields.php\"),\n \"${_path}create_mercurius_messages_table.php\" => database_path(\"migrations/${_date}_create_mercurius_messages_table.php\"),\n ];\n\n $this->publishes($_migrations, 'mercurius-migrations');\n }\n }",
"public function publishTranslations()\n {\n $path = __DIR__ . '/../resources/lang';\n\n $translations = [];\n\n foreach (array_keys(config('oxygen.locales')) as $locale) {\n if (file_exists(\"$path/$locale\")) {\n $translations[\"$path/$locale\"] = resource_path(\"lang/$locale\");\n }\n }\n\n $this->publishes($translations, 'translations');\n }",
"protected function setupMigrations()\n\t{\n\t\t$source = realpath(__DIR__ . '/../migrations/');\n\t\t$this->publishes([$source => base_path('/database/migrations')]);\n\t}",
"private function publishLang()\n {\n $this->publishes([\n __DIR__ . '/../resources/lang' => base_path('resources/lang/vendor/globe_labs_sms'),\n ], 'locales');\n }",
"protected function publishLang() {\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/laravel-translation'),\n ], 'lang');\n }",
"protected function registerMigrations()\n {\n $this->publishes([\n $this->packagePath('database/migrations') => database_path('/migrations')\n ], 'migrations');\n }",
"private function registerTranslations()\n {\n $langPath = $this->getBasePath() . '/resources/lang';\n\n $this->loadTranslationsFrom($langPath, $this->package);\n $this->publishes([\n $langPath => base_path('resources/lang/vendor/' . $this->package),\n ], 'translations');\n }",
"protected function bootMigrations()\n {\n if (isset($this->dir) and isset($this->migrationDirs) and is_array($this->migrationDirs)) {\n foreach ($this->migrationDirs as $dirPath) {\n $this->publishes([ $this->getDatabasePath($dirPath) => database_path($this->migrationDestinationPath) ], 'migrations');\n }\n }\n }",
"private function handleMigrations()\n {\n $this->publishes([\n __DIR__.'/../database/migrations/2019_08_18_153506_create_payment_records_table.php.stub' =>\n database_path('migrations/2019_08_18_153506_create_payment_records_table.php'),\n ], 'payment-migrations');\n }",
"private function publish()\n {\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/crm-launcher'),\n ]);\n\n $this->publishes([\n __DIR__ . '/../public' => base_path('public/crm-launcher/'),\n ]);\n\n $this->publishes([\n __DIR__ . '/../config/crm-launcher.php' => config_path('crm-launcher.php'),\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation servicesCancelAsyncWithHttpInfo Services: Cancel | public function servicesCancelAsyncWithHttpInfo($api_key, $v, $content_type, $body)
{
$returnType = '';
$request = $this->servicesCancelRequest($api_key, $v, $content_type, $body);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
return [null, $response->getStatusCode(), $response->getHeaders()];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"protected function servicesCancelRequest($api_key, $v, $content_type, $body)\n {\n // verify the required parameter 'api_key' is set\n if ($api_key === null || (is_array($api_key) && count($api_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $api_key when calling servicesCancel'\n );\n }\n // verify the required parameter 'v' is set\n if ($v === null || (is_array($v) && count($v) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $v when calling servicesCancel'\n );\n }\n // verify the required parameter 'content_type' is set\n if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $content_type when calling servicesCancel'\n );\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 servicesCancel'\n );\n }\n\n $resourcePath = '/accounts/me/cancelservices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($api_key !== null) {\n $queryParams['api_key'] = ObjectSerializer::toQueryValue($api_key);\n }\n // query params\n if ($v !== null) {\n $queryParams['v'] = ObjectSerializer::toQueryValue($v);\n }\n // header params\n if ($content_type !== null) {\n $headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);\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 $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\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 static function cancel(int $httpId);",
"public function cancel()\n {\n $response = $this->client->put(InvoiceService::INVOICE_PATH . \"/$this->id/cancel\");\n $this->updateFromArray($response['body_assoc']);\n }",
"protected function _cancelOperation(){ }",
"public function cancelRequest()\n {\n $this->assertFalse($this->request->isCancelled());\n $this->request->cancel();\n $this->assertTrue($this->request->isCancelled());\n }",
"public function cancel(string $id): SmsResponseInterface;",
"protected function cancelOperation()\n {\n }",
"public function cancelAllDunningPendingAsyncWithHttpInfo($handle)\n {\n $returnType = '\\Reepay\\Model\\Invoice[]';\n $request = $this->cancelAllDunningPendingRequest($handle);\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 cancel() {}",
"public function cancel(){}",
"public function privateCancelAllGetWithHttpInfo()\n {\n $request = $this->privateCancelAllGetRequest();\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 switch($statusCode) {\n case 200:\n if ('object' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function uncancelWithHttpInfo($handle)\n {\n // verify the required parameter 'handle' is set\n if ($handle === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $handle when calling uncancel');\n }\n // parse inputs\n $resourcePath = \"/v1/subscription/{handle}/uncancel\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());\n\n // path params\n if ($handle !== null) {\n $resourcePath = str_replace(\n \"{\" . \"handle\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($handle),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\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 // 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 '\\Swagger\\Client\\Model\\Subscription',\n '/v1/subscription/{handle}/uncancel'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Subscription', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Subscription', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function orderCancelAllAfterWithHttpInfo($timeout)\n {\n $returnType = 'object';\n $request = $this->orderCancelAllAfterRequest($timeout);\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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function cancelInvoiceAsyncWithHttpInfo($id)\n {\n $returnType = '\\Reepay\\Model\\Invoice';\n $request = $this->cancelInvoiceRequest($id);\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 }",
"function cancelRequest() {\n\t\t$user = User::current();\n\t\t$errors = array();\n\t\t$requestId = Input::get('requestId');\n\t\t$request = FriendRequest::find($requestId);\n\n\t\tif ($request) {\n\t\t\tif ($request->owner_id == $user->id && $request->status == User::STATUS_PENDING) {\n\t\t\t\t$request->delete();\n\t\t\t}\n\t\t} else {\n\t\t\t$errors[] = 'Request not found';\n\t\t}\n\n\t\treturn Response::json(array('errors' => $errors));\n\t}",
"function cancelAfterBegin($stub)\n{\n $call = $stub->StreamingInputCall();\n $call->cancel();\n list($result, $status) = $call->wait();\n hardAssert($status->code === Grpc\\STATUS_CANCELLED,\n 'Call status was not CANCELLED');\n}",
"public function cancelShipment($request): CancelShipmentResponse;",
"public function cancel()\n {\n $this->client->performHttpCallToFullUrl(\n MollieApiClient::HTTP_DELETE,\n $this->_links->self->href\n );\n\n return null;\n }",
"public function cancelOperationAsyncWithHttpInfo($storage_id)\n {\n $returnType = '';\n $request = $this->cancelOperationRequest($storage_id);\n\n return $this->client->sendAsync($request)->then(function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n }, function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getSellerStandardsProfile' | protected function getSellerStandardsProfileRequest($cycle, $program)
{
// verify the required parameter 'cycle' is set
if ($cycle === null || (is_array($cycle) && count($cycle) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cycle when calling getSellerStandardsProfile'
);
}
// verify the required parameter 'program' is set
if ($program === null || (is_array($program) && count($program) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $program when calling getSellerStandardsProfile'
);
}
$resourcePath = '/seller_standards_profile/{program}/{cycle}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cycle !== null) {
$resourcePath = str_replace(
'{' . 'cycle' . '}',
ObjectSerializer::toPathValue($cycle),
$resourcePath
);
}
// path params
if ($program !== null) {
$resourcePath = str_replace(
'{' . 'program' . '}',
ObjectSerializer::toPathValue($program),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires OAuth (access token)
if ($this->config->getAccessToken() !== null) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function getProSellerBadgeInfoRequest(): Request\n {\n $contentType = self::contentTypes['getProSellerBadgeInfo'];\n\n $resourcePath = '/v3/insights/prosellerbadge';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n $method = 'GET';\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n $contentType,\n $multipart\n );\n\n $defaultHeaders = parent::getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\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 } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n $query = ObjectSerializer::buildQuery($queryParams);\n $requestInfo = [\n 'path' => $resourcePath,\n 'method' => $method,\n 'timestamp' => $defaultHeaders['WM_SEC.TIMESTAMP'],\n 'query' => $query,\n ];\n\n // this endpoint requires Bearer authentication (access token)\n $token = $this->config->getAccessToken();\n if ($token) {\n $headers['WM_SEC.ACCESS_TOKEN'] = $token->accessToken;\n }\n\n $operationHost = $this->config->getHost();\n return new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function toRequestParams(Profile $profile);",
"public function fetchProfileSettings()\n\t{\n\t\t//create the request object\n\t\t$objApiRequest = $this->getApiRequestModel();\n\t\t\n\t\t//setup the object and specify the action\n\t\t$objApiRequest->setApiAction(\"profiles/admin\");\n\t\t\n\t\t//execute\n\t\t$objResult = $objApiRequest->performGETRequest(array())->getBody();\n\t\t\n\t\t//create entity\n\t\t$objProfile = $this->getServiceLocator()->get(\"FrontProfileSettings\\Entities\\FrontProfileSettingsProfileEntity\");\n\t\t$objProfile->set($objResult->data);\n\t\t\n\t\treturn $objProfile;\n\t}",
"protected function getSellerProfiles ($sProfileType, $blForceRefresh=false) {\n $sProfileType = strtolower($sProfileType);\n if ($this->aSellerProfiles === null) {\n $this->aSellerProfiles = array();\n try {\n if ($blForceRefresh) {\n \t$aProfiles = MagnaConnector::gi()->submitRequest(array(\n 'ACTION' => 'GetSellerProfiles',\n ));\n } else {\n \t$aProfiles = MagnaConnector::gi()->submitRequestCached(array(\n\t 'ACTION' => 'GetSellerProfiles',\n\t ), 30 * 60);\n }\n if ($aProfiles['STATUS'] == 'SUCCESS' && isset($aProfiles['DATA']['Profiles']) && is_array($aProfiles['DATA']['Profiles'])) {\n foreach ($aProfiles['DATA']['Profiles'] as $iProfile => $aProfile) {\n $aProfile['ProfileType'] = $aProfile['ProfileType'] == 'RETURN_POLICY' ? 'return' : $aProfile['ProfileType'];\n $this->aSellerProfiles[strtolower($aProfile['ProfileType'])][$iProfile] = array(\n 'name' => $aProfile['ProfileName'],\n 'default' => $aProfile['IsDefault'] && $aProfile['IsDefault'] != 'false'\n );\n }\n }\n try {\n if ($blForceRefresh) {\n \t$aProfilesContents = MagnaConnector::gi()->submitRequest(array(\n 'ACTION' => 'GetSellerProfileContents',\n ));\n } else {\n $aProfilesContents = MagnaConnector::gi()->submitRequestCached(array(\n 'ACTION' => 'GetSellerProfileContents',\n ), 30 * 60);\n }\n if ($aProfilesContents['STATUS'] == 'SUCCESS' && isset($aProfilesContents['DATA']) && is_array($aProfiles['DATA'])) {\n foreach ($aProfilesContents['DATA'] as $sProfileContent => $aProfileContent) {\n $sProfileContent = strtolower($sProfileContent);\n if (array_key_exists($sProfileContent, $this->aSellerProfiles)) {\n foreach ($aProfileContent as $iProfile => $aProfile) {\n if (array_key_exists($iProfile, $this->aSellerProfiles[$sProfileContent])) {\n switch ($sProfileContent) {\n case 'payment': {\n $this->aSellerProfiles['payment'][$iProfile]['contents'] = array(\n 'paymentmethods' => array_key_exists('paymentmethod', $aProfile) ? $aProfile['paymentmethod'] : array(),\n 'paypal.address' => array_key_exists('paypal.address', $aProfile) ? $aProfile['paypal.address'] : '',\n 'paymentinstructions' => array_key_exists('paymentinstructions', $aProfile) ? $aProfile['paymentinstructions'] : '',\n );\n break;\n }\n case 'shipping': {\n $this->aSellerProfiles['shipping'][$iProfile]['contents'] = array(\n 'dispatchtimemax' => (int)(array_key_exists('DispatchTimeMax', $aProfile) ? $aProfile['DispatchTimeMax'] : 0),\n 'shippinglocalprofile' => (int)(array_key_exists('shippingprofile.local', $aProfile) ? $aProfile['shippingprofile.local'] : 0),\n 'shippinginternationalprofile' => (int)(array_key_exists('shippingprofile.international', $aProfile) ? $aProfile['shippingprofile.international'] : 0),\n 'shippinglocaldiscount' => (bool)(array_key_exists('shippingdiscount.local', $aProfile) ? current(json_decode($aProfile['shippingdiscount.local'], true)) : 0),\n 'shippinginternationaldiscount' => (bool)(array_key_exists('shippingdiscount.international', $aProfile) ? current(json_decode($aProfile['shippingdiscount.international'], true)) : 0),\n );\n foreach (array('shipping.local' => 'shippinglocal', 'shipping.international' => 'shippinginternational') as $sShippingDirectionApi => $sShippingDirectionPlugin) {\n foreach (array_key_exists($sShippingDirectionApi, $aProfile) && !empty($aProfile[$sShippingDirectionApi]) ? $aProfile[$sShippingDirectionApi] : array(array()) as $aShipping) {\n $aShippment = array(\n 'ShippingService' => array_key_exists('service', $aShipping) ? $aShipping['service'] : '',\n 'ShippingServiceCost' => array_key_exists('service', $aShipping) ? $aShipping['cost'] : 0,\n );\n if ($sShippingDirectionPlugin == 'shippinginternational') {\n $aShippment['ShipToLocation'] = array_key_exists('location', $aShipping) ? $aShipping['location'] : array();\n }\n $this->aSellerProfiles['shipping'][$iProfile]['contents'][$sShippingDirectionPlugin][] = $aShippment;\n }\n }\n break;\n }\n case 'return': {\n $this->aSellerProfiles['return'][$iProfile]['contents'] = array(\n 'returnpolicy.returnsaccepted' => array_key_exists('returnsaccepted', $aProfile) ? $aProfile['returnsaccepted'] : '',\n 'returnpolicy.returnswithin' => array_key_exists('returnswithin', $aProfile) ? $aProfile['returnswithin'] : '',\n 'returnpolicy.shippingcostpaidby' => array_key_exists('shippingcostpaidby', $aProfile) ? $aProfile['shippingcostpaidby'] : '',\n 'returnpolicy.description' => array_key_exists('description', $aProfile) ? $aProfile['description'] : '',\n );\n break;\n }\n }\n }\n }\n }\n }\n } else {\n $this->aSellerProfiles = array();\n }\n foreach ($this->aSellerProfiles as $sProfile => $aProfile) {\n foreach (array_keys($aProfile) as $iProfile) {\n if (!array_key_exists('contents', $this->aSellerProfiles[$sProfile][$iProfile])) {\n unset($this->aSellerProfiles[$sProfile][$iProfile]);\n }\n }\n }\n } catch(MagnaException $e) {\n $this->aSellerProfiles = array();\n }\n } catch (MagnaException $e) {\n }\n }\n if (empty($this->aSellerProfiles)) {\n throw new Exception('No seller profiles.', 1470300945);\n } else {\n return array_key_exists($sProfileType, $this->aSellerProfiles) ? $this->aSellerProfiles[$sProfileType] : array();\n }\n }",
"public function get_seller_profiles($access_token){\n\t\t$data['na'] = $this->get_seller_profile($access_token, 'na');\n\t\t$data['eu'] = $this->get_seller_profile($access_token, 'eu');\n\t\treturn $data;\n\t}",
"protected function driversGetDriverProfileRequest()\n {\n\n $resourcePath = '/api/v1.0/drivers/profile';\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', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\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 buildProfile(OfficeSalesProfile $profile);",
"public function createProfileRequest($profile_create_query, $apiKey = null)\n {\n // verify the required parameter 'profile_create_query' is set\n if ($profile_create_query === null || (is_array($profile_create_query) && count($profile_create_query) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $profile_create_query when calling createProfile'\n );\n }\n\n $resourcePath = '/api/profiles/';\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($profile_create_query)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($profile_create_query));\n } else {\n $httpBody = $profile_create_query;\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 = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n if ($apiKey == null) {\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n } else {\n $apiKey = 'Klaviyo-API-Key '.$apiKey;\n }\n\n $headers['Authorization'] = $apiKey;\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $defaultHeaders['revision'] = ['2022-10-17'];\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getUserProfile(): array\n {\n $this->endpoint = 'https://api.amazon.com';\n return $this->operation(\"user/profile\");\n }",
"public function getSellerPaymentProfile()\n {\n return $this->sellerPaymentProfile;\n }",
"public function getSupplierProfile() {\n $s = $this->requireSupplier();\n return $this->get(\"v1/suppliers/$s\");\n }",
"protected function createProfile()\n\t{\n\t\t$ppRestService = MainFactory::create_object('PayPalRestService');\n\t\t$json_object = $this->json_object;\n\t\tif($json_object->presentation->logo_image == '')\n\t\t{\n\t\t\tunset($json_object->presentation->logo_image);\n\t\t}\n\t\t$ppRequestData = json_encode($json_object);\n\t\t$ppRestRequest = MainFactory::create_object('PayPalRestRequest', array('POST', '/v1/payment-experience/web-profiles', $ppRequestData));\n\t\t$response = $ppRestService->performRequest($ppRestRequest);\n\t\t$response_object = $response->getResponseObject();\n\t\tif($response_object === false)\n\t\t{\n\t\t\tthrow new Exception('Error decoding response '.print_r($response, true));\n\t\t}\n\t\tif($response->getResponseCode() != '201')\n\t\t{\n\t\t\t$error_message = $response_object->name.' '.$response_object->message;\n\n\t\t\tif(isset($response_object->details))\n\t\t\t{\n\t\t\t\t$error_message .= ', details: ';\n\t\t\t\tforeach($response_object->details as $detail)\n\t\t\t\t{\n\t\t\t\t\t$error_message .= $detail->field .': '.$detail->issue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new Exception('ERROR creating profile: '.$error_message);\n\t\t}\n\t\t$this->id = $response_object->id;\n\t\treturn $this->id;\n\t}",
"protected function getPartnerConfigurationsRequest(): Request\n {\n $contentType = self::contentTypes['getPartnerConfigurations'];\n\n $resourcePath = '/v3/settings/partnerprofile';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n $method = 'GET';\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n $contentType,\n $multipart\n );\n\n $defaultHeaders = parent::getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\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 } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n $query = ObjectSerializer::buildQuery($queryParams);\n $requestInfo = [\n 'path' => $resourcePath,\n 'method' => $method,\n 'timestamp' => $defaultHeaders['WM_SEC.TIMESTAMP'],\n 'query' => $query,\n ];\n\n // this endpoint requires Bearer authentication (access token)\n $token = $this->config->getAccessToken();\n if ($token) {\n $headers['WM_SEC.ACCESS_TOKEN'] = $token->accessToken;\n }\n\n $operationHost = $this->config->getHost();\n return new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function fetchProfileInfoRequest()\n {\n\n $resourcePath = '/v2/employee';\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 []\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 = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getShippingConfigurationsRequest(): Request\n {\n $contentType = self::contentTypes['getShippingConfigurations'];\n\n $resourcePath = '/v3/settings/shippingprofile';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n $method = 'GET';\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n $contentType,\n $multipart\n );\n\n $defaultHeaders = parent::getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\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 } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n $query = ObjectSerializer::buildQuery($queryParams);\n $requestInfo = [\n 'path' => $resourcePath,\n 'method' => $method,\n 'timestamp' => $defaultHeaders['WM_SEC.TIMESTAMP'],\n 'query' => $query,\n ];\n\n // this endpoint requires Bearer authentication (access token)\n $token = $this->config->getAccessToken();\n if ($token) {\n $headers['WM_SEC.ACCESS_TOKEN'] = $token->accessToken;\n }\n\n $operationHost = $this->config->getHost();\n return new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getProfile();",
"public function getShippingProfile();",
"public function getProfileStep1($sellerId);",
"protected function getSocialProfilePropertiesRequest($socialType)\n {\n // verify the required parameter 'socialType' is set\n if ($socialType === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $socialType when calling getSocialProfileProperties'\n );\n }\n\n $resourcePath = '/socials/profile';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($socialType !== null) {\n $queryParams['socialType'] = ObjectSerializer::toQueryValue($socialType);\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/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 // 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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
equalBins Compute histogram data using equal bin sizes. INPUT $dt Bin size (int). $start Start time (int). $end End time (int). $timezoneOffset Timezone offset in seconds (int). $dbResult MySQL result handle. OUTPUT Bins (array of ints). | function equalBins($dt, $start, $end, $timezoneOffset, $dbResult) {
$bins = array();
$start = $start - ($start + $timezoneOffset) % $dt;
$x = ($end+1) % $dt;
$end = $end - $x + ($x > 0 ? 1 : 0);
$nBins = nBins($dt, $start, $end);
checkNumberOfBins($nBins);
for($i = 0; $i < $nBins; $i++) {
$bins[$i] = 0;
}
$index = 0;
$binerr = 0;
while ($row = mysql_fetch_array($dbResult, MYSQL_NUM)) {
$index = dateToBin(strtotime($row[0]), $dt, $start, $timezoneOffset);
if($bins[$index] != 0) {
$binerr++;
}
$bins[$index] = $row[1];
}
if($binerr > 0) internalError("non-unique bin error $binerr bins");
return $bins;
} | [
"function DayHistogram($startDate,$endDate,$database){\r\n\t\t$datearray = $this-> DateRange($startDate,$endDate);\r\n\t\t$countarray = array();\r\n\t\tforeach ($datearray as $date){\r\n\t\t\t$rs = $this-> DayList(\"$date\",$database);\r\n\t\t\t$daycount = $this->CountRs($rs);\r\n\t\t\tarray_push($countarray, $daycount);\r\n\t\t}\r\n\t\treturn $countarray;\r\n\t}",
"public function getBins() {\n \tif (!isset(self::$getBins_stmt)) {\n \t\tself::$getBins_stmt = $this->manager->getDB()->prepare(\n\"SELECT\n\tcatalog_id,\n\tcatalog_title\nFROM\n\t course_catalog\n\");\n \t}\n \t\n \tself::$getBins_stmt->execute();\n \t\n \t$bins = array();\n// \t$bins[] = new banner_resource_Bin_Combined($this->manager->getCombinedBinId());\n \twhile ($result = self::$getBins_stmt->fetch(PDO::FETCH_ASSOC)) {\n \t\n \t\t$bins[] = new banner_resource_Bin_PerCatalog(\n\t\t\t\t\t\t\t\t$this->getOsidIdFromString($result['catalog_id']), \n\t\t\t\t\t\t\t\t$result['catalog_title']);\n\t\t}\n\t\t\n\t\tself::$getBins_stmt->closeCursor();\n\t\t\n\t\treturn new phpkit_resource_ArrayBinList($bins);\n }",
"function PMA_getValuesForInnodbTable($current_table, $is_show_stats, $sum_size)\n{\n $formatted_size = $unit = '';\n\n if (($current_table['ENGINE'] == 'InnoDB'\n && $current_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount'])\n || !isset($current_table['TABLE_ROWS'])\n ) {\n $current_table['COUNTED'] = true;\n $current_table['TABLE_ROWS'] = $GLOBALS['dbi']\n ->getTable($GLOBALS['db'], $current_table['TABLE_NAME'])\n ->countRecords(true);\n } else {\n $current_table['COUNTED'] = false;\n }\n\n // Drizzle doesn't provide data and index length, check for null\n if ($is_show_stats && $current_table['Data_length'] !== null) {\n $tblsize = $current_table['Data_length'] + $current_table['Index_length'];\n $sum_size += $tblsize;\n list($formatted_size, $unit) = PMA_Util::formatByteDown(\n $tblsize, 3, (($tblsize > 0) ? 1 : 0)\n );\n }\n\n return array($current_table, $formatted_size, $unit, $sum_size);\n}",
"public static function to_bins_keys($arr, $total_bins, $method = self::METHOD_SD, $include_limits = [])\r\n {\r\n $interval_limits = self::get_bins_limits($arr, $total_bins, $method, $include_limits);\r\n\r\n $total = self::total_numeric($arr);\r\n $arr = self::numeric($arr);\r\n\r\n if($total < $total_bins || $total_bins < 4)\r\n {\r\n return false;\r\n }\r\n\r\n asort($arr);\r\n\r\n $avg = self::average($arr);\r\n\r\n $bins = [];\r\n\r\n foreach($arr as $kk => $v)\r\n {\r\n foreach(range(1, count($interval_limits)-1) as $i)\r\n {\r\n $key = $i-1;\r\n $upper_bound = floatval($interval_limits[$i]);\r\n $v = floatval($v);\r\n\r\n if(!isset($bins[$key]))\r\n {\r\n $bins[$key] = [];\r\n }\r\n\r\n if($v < $upper_bound && $upper_bound < $avg)\r\n {\r\n $bins[$key][] = $kk;\r\n break;\r\n }\r\n else if($v <= $upper_bound && $upper_bound >= $avg)\r\n {\r\n $bins[$key][] = $kk;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n foreach(range(0, count($interval_limits)-2) as $i)\r\n {\r\n if(!isset($bins[$i]))\r\n {\r\n $bins[$i] = [];\r\n }\r\n\r\n $itv = $interval_limits[$i] . ':' . $interval_limits[$i+1];\r\n\r\n $itv = $interval_limits[$i] < $avg ? '[' . $itv : '(' . $itv;\r\n $itv = $interval_limits[$i+1] < $avg ? $itv . ')' : $itv . ']';\r\n\r\n $bins[$itv] = $bins[$i];\r\n }\r\n \r\n $bins = array_filter($bins, 'is_string', ARRAY_FILTER_USE_KEY);\r\n\r\n return $bins;\r\n }",
"function do_list_bins()\n{\n global $datasets; // from require_once \"../analysis/common/functions.php\"\n\n if (!isset($datasets)) {\n $datasets = []; // database tables not yet initialized\n }\n\n $response_mediatype = choose_mediatype(['application/json', 'text/html',\n 'text/plain']);\n\n switch ($response_mediatype) {\n case 'application/json':\n respond_with_json(array_keys($datasets));\n break;\n case 'text/html':\n html_begin(\"Query bins\", [[\"Query Bins\"]]);\n\n if (count($datasets) == 0) {\n echo \" <p>This TCAT instance has no query bins.</p>\\n\";\n } else {\n echo \" <p>Query bins:</p>\\n\";\n echo \" <ul>\\n\";\n\n $url = $_SERVER['SCRIPT_URI'];\n\n foreach (array_keys($datasets) as $name) {\n echo \" <li><a href=\\\"\";\n echo htmlspecialchars($url . '/' . $name);\n echo \"\\\">\";\n echo htmlspecialchars($name);\n echo \"</a></li>\\n\";\n }\n echo \" </ul>\\n\";\n }\n\n html_end();\n break;\n\n case 'text/plain':\n default:\n foreach (array_keys($datasets) as $name) {\n print($name . \"\\n\");\n }\n break;\n }\n}",
"function getGraphBins() {\n\t\twhile (list($k,$v) = each($this->BINS)) {\n\t\t\t$bin[] = sprintf(\"%5.2f\",$k); $val[] = $v;\n\t\t}\n\t\t$bingraph = array($bin,$val);\n\t\treturn $bingraph;\n\t}",
"function get_archive_data_hash_list($pdo, $app_id, $start_ts, $end_ts)\n{\n $sql = 'SELECT t2.hash FROM ' . ARCHIVE_DATA_CLASS . ' t1 ' .\n '\tLEFT JOIN ' . ARCHIVE_RAW_DATA_CLASS . ' t2 ' .\n ' LEFT JOIN ' . ARCHIVE_DATA_PROOF_CLASS . ' t3 ON ' .\n ' t2.data_id = t3.data_fk ' .\n '\tON t1.archive_data_id = t2.archive_data_fk ' .\n 'WHERE t1.app_id = :app_id AND ' .\n ' t3.ts >= :start_ts AND t3.ts < :end_ts ' .\n 'ORDER BY t3.ts';\n\n $stmt = $pdo->prepare($sql);\n $stmt->execute(array('app_id'=> $app_id,\n 'start_ts'=> $start_ts,\n 'end_ts'=> $end_ts));\n\n $hashes = [];\n $hash_row = $stmt->fetch();\n while ($hash_row) {\n $hashes[] = $hash_row['hash'];\n $hash_row = $stmt->fetch();\n }\n $stmt = null;\n\n return $hashes;\n}",
"public function getTablesInRange($scalarId, $start, $end)\n {\n $start = date_parse($start);\n if (!$start || $start['warning_count'] || $start['error_count']) {\n return false;\n }\n\n $end = date_parse($end);\n if (!$end || $end['warning_count'] || $end['error_count']) {\n return false;\n }\n\n foreach (array('month', 'day') as $field) {\n $start[$field] = $start[$field] < 10 ? '0' . $start[$field] : $start[$field];\n $end[$field] = $end[$field] < 10 ? '0' . $end[$field] : $end[$field];\n }\n\n // Reduce LIKE scope if possible.\n $approxDateId = '';\n foreach (array('year', 'month', 'day') as $field) {\n if ($start[$field] == $end[$field]) {\n $approxDateId .= $start[$field];\n } else {\n $approxDateId .= '%';\n break;\n }\n }\n \n $candidates = $this->getTablesLike(\"samples_{$scalarId}_{$approxDateId}\");\n if (!$candidates) {\n return false;\n }\n\n $startMonth = $start['year'] . $start['month'];\n $startDate = $startMonth . $start['day'];\n\n $endMonth = $end['year'] . $end['month'];\n $endDate = $endMonth . $end['day'];\n\n $tablesInRange = array();\n foreach ($candidates as $table) {\n // Break apart the table name so we can use monthy and daily tables\n // together, ex. if we changed partitioning over time.\n $yyyymmdd = str_replace(\"samples_{$scalarId}_\", '', $table);\n $yyyymm = substr($yyyymmdd, 0, 6);\n $isMonthlyTable = (substr($yyyymmdd, -2) == '00');\n\n if ($isMonthlyTable) {\n $candidateInRange = ($yyyymm >= $startMonth && $yyyymm <= $endMonth);\n } else {\n $candidateInRange = ($yyyymmdd >= $startDate && $yyyymmdd <= $endDate);\n }\n\n if ($candidateInRange) {\n $tablesInRange[] = $table;\n }\n }\n\n // First tables in merge union are also scanned first.\n rsort($tablesInRange);\n\n return $tablesInRange;\n }",
"private function buildHourlyDivisors($params)\n {\n $hash = array();\n\n for ($i = 0; $i <= 6; $i++)\n {\n $hash[$i] = 0;\n }\n\n $sdate = $params['sdate'];\n $edate = $params['edate'];\n\n // If $sdate and $edate are empty, say for a full query, set dummy values\n // using min/max values of data from server\n if (empty($sdate))\n {\n $keys = array_keys($this->countHash['periodSum']);\n $sdate = min($keys);\n $sdate = str_replace(\"-\", \"\", $sdate);\n }\n\n if (empty($edate))\n {\n $keys = array_keys($this->countHash['periodSum']);\n $edate = max($keys);\n $edate = str_replace(\"-\", \"\", $edate);\n }\n\n $diff = abs(strtotime($edate . 'Z') - strtotime($sdate . 'Z'));\n\n // Add 1 and convert to integer\n $daysInRange = round(($diff / (60 * 60 * 24))) + 1;\n\n // Detect remainder\n $extras = $daysInRange % 7;\n\n // Bulk of series\n $mainChunk = $daysInRange - $extras;\n\n // Get index of start date (same as first day of extras)\n $startDayIndex = date('w', strtotime($sdate));\n\n // Add bulk count to each day\n foreach($hash as $key => $day)\n {\n $hash[$key] += $mainChunk / 7;\n }\n\n // Add extras to appropriate days\n for ($i = 0; $i < $extras; $i++)\n {\n $dayIndex = $i + $startDayIndex;\n if ($dayIndex > 6)\n {\n $dayIndex = $dayIndex - 7;\n }\n\n $hash[$dayIndex]++;\n }\n\n return $hash;\n }",
"function createBandObjects(\n $MIN_DISTANCE,\n $resultBands,\n $bandsTimeSlots, \n $totalNumTimeSlots, \n $timeslotsPorchfests,\n $bandConflicts \n ){\n global $resultBands;\n global $bandsHashMap;\n\n DEBUG_ECHO(\"creating band objects\\n\");\n \n $tmp = getQueryArr($resultBands);\n $resultBands = $tmp;\n for ($i = 0; $i < sizeof($tmp); $i++){\n $bandId = $tmp[$i][0];\n $bandName = $tmp[$i][1];\n $bandLocation = $tmp[$i][2];\n $bandLatLng = array(\"lat\" => $tmp[$i][3], \"lng\" => $tmp[$i][4]);\n $availableTimeSlots = [];\n \n for ($j = 0; $j < $totalNumTimeSlots; $j++) {\n $slotID = $timeslotsPorchfests[$j];\n $availableTimeSlots[$slotID] = intVal(false);\n }\n if (!array_key_exists($bandId, $bandsTimeSlots) || sizeof($bandsTimeSlots[$bandId]) == 0) {\n echo \"***************************** no time slots for \" . $bandId . \" *****************************\\n\";\n } else {\n foreach ($bandsTimeSlots[$bandId] as $canDoSlotID) {\n $availableTimeSlots[$canDoSlotID] = intVal(true);\n }\n }\n\n if (array_key_exists($bandId, $bandConflicts)) {\n $conflicts = $bandConflicts[$bandId];\n }\n else {\n $conflicts = [];\n }\n\n $bandsHashMap[$bandId] = new Band($bandId, $bandName, $bandLatLng[\"lat\"], $bandLatLng[\"lng\"], $availableTimeSlots, $conflicts, -1, [], []);\n }\n\n // Treat violation of MIN_DISTANCE as distanceConflicts \n foreach ($bandsHashMap as $bandID => $bandObj) {\n foreach ($bandsHashMap as $otherBandID => $otherBandObj) {\n if ($bandID == $otherBandID) {\n continue;\n }\n if ($bandObj->getDistance($otherBandID) < $MIN_DISTANCE) {\n array_push($bandObj->distanceConflicts, $otherBandID);\n }\n }\n }\n\n DEBUG_ECHO(\"created all band objects\\n\");\n return $bandsHashMap;\n}",
"public function testBirthday()\n {\n // Number of buckets to make\n $num_buckets = 17;\n // How much tolerance should we allow? 0.01 = 1% 0.50 = 50%, etc.\n $tolerance = 0.03;\n $rand_min = 200000;\n $rand_max = 600000;\n $rand_step = 100000;\n\n $minT = (1.00 - $tolerance);\n $maxT = (1.00 + $tolerance);\n\n for ($nums_to_generate = $rand_min; $nums_to_generate < $rand_max; $nums_to_generate += $rand_step) {\n $buckets = array_fill(0, $num_buckets, 0);\n\n // The number of ints we expect per bucket +/- 2%;\n $min = (int) ceil($minT * $nums_to_generate / $num_buckets);\n $max = (int) floor($maxT * $nums_to_generate / $num_buckets);\n\n for ($i = 0; $i < $nums_to_generate; ++$i) {\n $random = random_int(0, 999);\n $bucket = $random % $num_buckets;\n $buckets[$bucket]++;\n }\n for ($i = 0; $i < $num_buckets; ++$i) {\n\n // Debugging code:\n\n if ($buckets[$i] <= $min ) {\n var_dump([\n 'bucket' => $i,\n 'value' => $buckets[$i],\n 'min' => $min,\n 'nums' => $nums_to_generate,\n 'reason' => 'below min'\n ]);\n }\n if ($buckets[$i] >= $max ) {\n var_dump([\n 'bucket' => $i,\n 'value' => $buckets[$i],\n 'maax' => $max,\n 'nums' => $nums_to_generate,\n 'reason' => 'above max'\n ]);\n }\n\n $this->assertTrue($buckets[$i] < $max && $buckets[$i] > $min);\n }\n }\n }",
"private function binInfoBuilder($farm_id, $bin_id, $bins)\n {\n $data = array();\n $budgeted_amount = 0;\n for ($i = 0; $i < count($bins); $i++) {\n\n $consumption = array();\n for ($j = 0; $j < count($bins[$i]->graph_data); $j++) {\n if ($bins[$i]->graph_data[$j]->budgeted_amount != 0) {\n $budgeted_amount = $bins[$i]->graph_data[$j]->budgeted_amount;\n }\n\n $consumption[date(\"Y-m-d\", strtotime($bins[$i]->graph_data[$j]->update_date))] = array(\n 'budgeted' => number_format((float) $budgeted_amount, 2, '.', ''), //$bins[$i]->graph_data[$j]->budgeted_amount,\n 'actual' => $bins[$i]->graph_data[$j]->actual\n );\n }\n\n if ($bin_id == $bins[$i]->bin_id) {\n\n $ring_amount = $this->getClosest($bins[$i]->default_amount, $bins[$i]->bin_s);\n $actual = $this->avgActual($bins[$i]->average_actual, $bins[$i]->num_of_update);\n $variance = $this->avgVariance($bins[$i]->average_actual, $bins[$i]->num_of_update, $bins[$i]->budgeted_amount);\n\n $data[] = array(\n 'farmID' => $farm_id,\n 'binID' => $bin_id,\n 'currentMedication' => $bins[$i]->medication,\n 'nextDelivery' => $bins[$i]->next_delivery,\n 'currentFeed' => $bins[$i]->feed_type_name,\n 'numberOfPigs' => $bins[$i]->total_number_of_pigs,\n 'ringAmount' => $ring_amount,\n 'variance' => $variance,\n 'actual' => $actual,\n 'budgeted' => $bins[$i]->budgeted_amount,\n 'consumptions' => $consumption //$this->binConsumption($bins[$i]->graph_data)\n );\n }\n }\n\n return $data;\n }",
"function get_bettingrecords($today_date, array $casino_accounts)\n{\n\n if (empty($casino_accounts)) {\n return [];\n }\n\n // 東部標準時(Eastern Standard Time;EST;UTC-5;R區), 時間為 -05 才是正確的時間,夏令時間 -06 不列入計算。以美東時間每日為計算單位。\n $receivetime_begin = gmdate('Y-m-d H:i:s.u', strtotime($today_date . ' 00:00:00 -04') + 8 * 3600) . '+08:00';\n $receivetime_end = gmdate('Y-m-d H:i:s.u', strtotime($today_date . ' 23:59:59 -04') + 8 * 3600) . '+08:00';\n\n $casino_account_values_string = \"('\" . implode($casino_accounts, \"'), ('\") . \"')\";\n\n // casino category summary\n $bettingrecords_casino_category_sql = <<<SQL\n SELECT\n COUNT(casino_account) as bettingrecord_count,\n casino_account,\n casinoid as casino,\n favorable_category as category,\n SUM(betvalid) as bets,\n SUM(betresult) as wins\n FROM betrecordsremix\n INNER JOIN (\n VALUES $casino_account_values_string\n ) vals(v)\n ON (casino_account = v)\n WHERE receivetime BETWEEN '$receivetime_begin' AND '$receivetime_end'\n AND status = 1\n GROUP BY casino_account, casinoid, favorable_category;\nSQL;\n\n $bettingrecords_result = runSQLall_betlog($bettingrecords_casino_category_sql);\n unset($bettingrecords_result[0]);\n\n $betting_records = [];\n\n foreach ($bettingrecords_result as $record) {\n\n $betting_records[$record->casino_account][$record->casino][$record->category] = [\n 'count' => $record->bettingrecord_count,\n 'bets' => $record->bets,\n 'wins' => ($record->bets + $record->wins),\n 'profitlost' => (-$record->wins),\n ];\n\n }\n\n return $betting_records;\n}",
"function getStatGraphDayData($start, $end, $affilid) {\n\t$startunix = datetimeToUnix($start . \" 00:00:00\");\n\t$endunix = datetimeToUnix($end . \" 23:59:59\");\n\n\t$data = array();\n\t$data[\"points\"] = array();\n\t$data[\"labels\"] = array();\n\t$reloadid = getUserlistID('vclreload@Local');\n\tfor($i = $startunix; $i < $endunix; $i += SECINDAY) {\n\t\tarray_push($data[\"labels\"], date('Y-m-d', $i));\n\t\t$startdt = unixToDatetime($i);\n\t\t$enddt = unixToDatetime($i + SECINDAY);\n\t\tif($affilid != 0) {\n\t\t\t$query = \"SELECT count(l.id) \"\n\t\t\t . \"FROM log l, \"\n\t\t\t . \"user u \"\n\t\t\t . \"WHERE l.start >= '$startdt' AND \"\n\t\t\t . \"l.start < '$enddt' AND \"\n\t\t\t . \"l.userid != $reloadid AND \"\n\t\t\t . \"l.wasavailable = 1 AND \"\n\t\t\t . \"l.userid = u.id AND \"\n\t\t\t . \"u.affiliationid = $affilid\";\n\t\t}\n\t\telse {\n\t\t\t$query = \"SELECT count(l.id) \"\n\t\t\t . \"FROM log l \"\n\t\t\t . \"WHERE l.start >= '$startdt' AND \"\n\t\t\t . \"l.start < '$enddt' AND \"\n\t\t\t . \"l.userid != $reloadid AND \"\n\t\t\t . \"l.wasavailable = 1\";\n\t\t}\n\t\t$qh = doQuery($query, 295);\n\t\tif($row = mysql_fetch_row($qh))\n\t\t\tarray_push($data[\"points\"], $row[0]);\n\t\telse\n\t\t\tarray_push($data[\"points\"], 0);\n\t}\n\treturn($data);\n}",
"public function getMergeTableWithRange($scalarId, $start, $end)\n {\n $start = date_parse($start);\n if (!$start || $start['warning_count'] || $start['error_count']) {\n return false;\n }\n\n $end = date_parse($end);\n if (!$end || $end['warning_count'] || $end['error_count']) {\n return false;\n }\n\n foreach (array('month', 'day') as $field) {\n $start[$field] = $start[$field] < 10 ? '0' . $start[$field] : $start[$field];\n $end[$field] = $end[$field] < 10 ? '0' . $end[$field] : $end[$field];\n }\n\n // Reduce LIKE scope if possible.\n $approxDateId = '';\n if ($start['year'] == $end['year']) {\n $approxDateId .= $start['year'];\n }\n \n $candidates = $this->getTablesLike(HASHMARK_PARTITION_MERGETABLE_PREFIX . \"{$scalarId}_{$approxDateId}%_{$approxDateId}%\");\n if (!$candidates) {\n return false;\n }\n\n $startDate = $start['year'] . $start['month'] . $start['day'];\n $endDate = $end['year'] . $end['month'] . $end['day'];\n\n // Keys = table names, values = table's date coverage magnitude (for sorting)\n $tables = array();\n\n foreach ($candidates as $table) {\n $matches = array();\n if (preg_match('/_(\\d{8})_(\\d{8})$/', $table, $matches) && count($matches) == 3) {\n list(, $start, $end) = $matches;\n if ($start <= $startDate && $end >= $endDate) {\n // Union's scope later used in final asort().\n $tables[$table] = $end - $start;\n }\n }\n }\n\n if (!$tables) {\n return false;\n }\n\n // Sort by coverage and return narrowest partition.\n asort($tables);\n $tables = array_keys($tables);\n return $tables[0];\n }",
"function getBins() {\n\t\treturn $this->BINS;\n\t}",
"protected function getAllPossibleDateResults(Chronos $startingDate, Chronos $endingDate, $unit, $timezone, $twelveHourTime)\n {\n $nextDate = $startingDate;\n\n if (! empty($timezone)) {\n $nextDate = $startingDate->setTimezone($timezone);\n $endingDate = $endingDate->setTimezone($timezone);\n }\n\n if($nextDate->gte($endingDate)) {\n return [];\n }\n\n $possibleDateResults = [$this->formatPossibleAggregateResultDate(\n $nextDate, $unit, $twelveHourTime\n )];\n\n while ($nextDate->lt($endingDate)) {\n if ($unit === self::BY_MONTHS) {\n $nextDate = $nextDate->addMonths(1);\n } elseif ($unit === self::BY_WEEKS) {\n $nextDate = $nextDate->addWeeks(1);\n } elseif ($unit === self::BY_DAYS) {\n $nextDate = $nextDate->addDays(1);\n } elseif ($unit === self::BY_HOURS) {\n $nextDate = $nextDate->addHours(1);\n } elseif ($unit === self::BY_MINUTES) {\n $nextDate = $nextDate->addMinutes(1);\n }\n\n if ($nextDate->lte($endingDate)) {\n $possibleDateResults[] = $this->formatPossibleAggregateResultDate(\n $nextDate, $unit, $twelveHourTime\n );\n }\n }\n\n return $possibleDateResults;\n }",
"function getBins() {\n return array_keys($this->bins);\n }",
"function getAverage($sqlHandler, $tableName, $start, $end){\n\t\n\t$sum = array();\n\t$count = 0;\n\t\n\t$foundStart = false;\n\t\n\tfor ($i=0; $i<getNumRows($sqlHandler, $tableName); $i++){\n\t\t\n\t\t$row = getRow($sqlHandler, $tableName, $i);\n\t\tif ($row[0] == $start || $foundStart || $row[0] == $end){\n\t\t\t\n\t\t\t$curr_buy = json_decode($row[1], true)[0];\n\t\t\t$curr_sell = json_decode($row[1], true)[1];\n\t\t\t\n\t\t\t$count++;\n\t\t}\n\t\t\n\t\t\n\t\tif ($row[0] == $start){\n\t\t\tarray_push($sum, $curr_buy, $curr_sell);\n\t\t\t$foundStart = true;\n\t\t}\n\t\t\n\t\telse if ($row[0] == $end){\n\t\t\t$sum[0] = sumArray($sum[0], $curr_buy);\n\t\t\t$sum[1] = sumArray($sum[1], $curr_sell);\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\telse if ($foundStart){\n\t\t\t$sum[0] = sumArray($sum[0], $curr_buy);\n\t\t\t$sum[1] = sumArray($sum[1], $curr_sell);\n\t\t}\n\t}\n\t\n\treturn [scaleArray($sum[0], 1/$count), scaleArray($sum[1], 1/$count)];\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create an Html element on the basis of element type | public function selectAndCreateElement($type=null)
{
$this->functionCallLog('selectAndCreateElement -> ' .$type);
$element=null;
if(strtoupper($type)=='TEXT')
$element=$this->elementText();
if(strtoupper($type)=='DROPDOWN')
$element=$this->elementDropdown();
if(strtoupper($type)=='ORDERED LIST')
$element=$this->elementList('ORDERED LIST');
if(strtoupper($type)=='DEFINATION LIST')
$element=$this->elementList('DEFINATION LIST');
if(strtoupper($type)=='UNORDERED LIST')
$element=$this->elementList();
if(strtoupper($type)=='RADIO')
$element=$this->elementRadio();
if(strtoupper($type)=='CHECKBOX')
$element=$this->elementCheckbox();
if(strtoupper($type)=='SUBMIT')
$element=$this->elementSubmit();
if(strtoupper($type)=='BLANK')
$element='';
return $element;
} | [
"function makeElement($id,$type,$value=\"\",$attr=array(),$options=array()) {\n # Init\n $el = \"\";\n \n # Type?\n switch($type) {\n\t # Tipe Label\n\t case 'label' :\n\t\t $el .= \"<label for='\".$id.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \">\".$value.\"</label>\";\n\t\t break;\n\t\t \n\t # Tipe Text Standard\n\t case 'txt' :\n\t case 'text' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtext' type='text'\";\n\t\t $el .= \" value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Text Uppercase\n\t case 'textupper' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtextuppercase' type='text' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t # Tipe Text Lowercase\n\t case 'textlower' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtextlowercase' type='text' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Text Number/Numeric\n\t case 'textnum' :\n\t case 'textnumber' :\n\t case 'textnumeric' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtextnumber' type='text' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t # Tipe Select\n\t case 'select' :\n\t case 'dropdown' :\n\t\t $el .= \"<select id='\".$id.\"' name='\".$id.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .=\">\";\n\t\t foreach($options as $val=>$name) {\n\t\t\t if($value==$val) {\n\t\t\t\t $el .= \"<option value='\".$val.\"' selected>\".$name.\"</option>\";\n\t\t\t } else {\n\t\t\t\t $el .= \"<option value='\".$val.\"'>\".$name.\"</option>\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"</select>\";\n\t\t break;\n\t\t \n\t # Tipe Checkbox\n\t case 'chk' :\n\t case 'check' :\n\t case 'checkbox' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='checkbox'\";\n\t\t $el .= \" value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t # Tipe Password\n\t case 'password' :\n\t case 'pwd' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='password' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Button\n\t case 'button' :\n\t case 'btn' :\n\t\t $el .= \"<button id='\".$id.\"' name='\".$id.\"' class='mybutton'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \">\".$value.\"</button>\";\n\t\t break;\n\t \n\t # Tipe Submit\n\t case 'submit' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='submit' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Submit\n\t case 'hidden' :\n\t case 'hid' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='hidden' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t default :\n\t\t break;\n }\n return $el;\n }",
"function create_element($name) {}",
"public function createHtmlElement($element_type = null)\n {\n $html_element = clone $this->html_element_definition;\n return $html_element;\n\n }",
"public static function CreateElement( $element_type ){\n\t\t$type = self::LoadElement( $element_type );\n\t\treturn new $type();\n\t}",
"private function generateElementHTML()\r\n\t{\r\n\t\t$html = null;\r\n\t\tif ($this->objField->hidden == 1)\r\n\t\t{\r\n\t\t\t$this->objField->input_type = \"hidden\";\r\n\t\t}//end if\r\n\r\n\t\tswitch ($this->objField->input_type)\r\n\t\t{\r\n\t\t\tcase \"text\":\r\n\t\t\tdefault: //catch any undefined types\r\n\t\t\t\t$html = \"<input type=\\\"text\\\" name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #required #style #maxlength #class #value/>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"hidden\":\r\n\t\t\t\t$html = \"<input type=\\\"hidden\\\" name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #value/>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tif (is_array($this->objRawFieldData->field_values) || is_object($this->objRawFieldData->field_values))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($this->objRawFieldData->field_values as $value)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$value = str_replace(\"\\r\", \"\", $value);\r\n\t\t\t\t\t\t$html .= \"<input type=\\\"radio\\\" name=\\\"\" . $this->objField->name . \"\\\" value=\\\"$value\\\"/ #class> $value \";\r\n\t\t\t\t\t}//end foreach\r\n\t\t\t\t}//end if\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"checkbox\":\r\n\t\t\t\t$html = \"<input type=\\\"checkbox\\\" name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" value=\\\"1\\\" #required #style #class/>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"select\":\r\n\t\t\t\t$html = \"<select name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #required #style #class>\";\r\n\t\t\t\t$html .= \t\"<option value=''>--select--</option>\";\r\n\r\n\t\t\t\tif (is_array($this->objRawFieldData->field_values) || is_object($this->objRawFieldData->field_values))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($this->objRawFieldData->field_values as $value => $text)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= \"<option value=\\\"$value\\\">$text</option>\";\r\n\t\t\t\t\t}//end foreach\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$arr_field_values = explode(\"\\n\", $this->objRawFieldData->field_values);\r\n\t\t\t\t\tif (is_array($arr_field_values))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach ($arr_field_values as $value)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$value = str_replace(\"\\r\", \"\", $value);\r\n\t\t\t\t\t\t\t$html .= \"<option value=\\\"$value\\\">$value</option>\";\r\n\t\t\t\t\t\t}//end foreach\r\n\t\t\t\t\t}//end if\r\n\t\t\t\t}//end if\r\n\r\n\t\t\t\t$html .= \"</select>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"textarea\":\r\n\t\t\t\t$html = \"<textarea name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #required #style #maxlength #class>#value</textarea>\";\r\n\t\t\t\tbreak;\r\n\t\t}//end switch\r\n\r\n\t\t//set label\r\n\t\tif (!isset($label))\r\n\t\t{\r\n\t\t\t$label = \"<label class=\\\"form-label\\\" for=\\\"\" . $this->objField->name . \"\\\">\" . $this->objField->label . \"</label>\";\r\n\t\t}//end if\r\n\r\n\t\t//deal with element metadata\r\n\t\tif ($this->objRawFieldData->css_class != \"\")\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#class\", \"class=\\\"\" . $this->objRawFieldData->css_class . \"\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->style != \"\")\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#style\", \"style=\\\"\" . $this->objField->style . \"\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->required == 1)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#required\", \"required=\\\"required\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->readonly == 1)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#readonly\", \"readonly=\\\"readonly\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->maxlength > 0)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#maxlength\", \"maxlength=\\\"\" . $this->objField->maxlength . \"\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\t//remove any unprocessed tags\r\n\t\t$html = str_replace(array(\"#class\", \"#style\", \"#required\", \"#readonly\", \"#maxlength\"), \"\", $html);\r\n\r\n\t\t//finally, does the element have a predefined value?\r\n\t\tif ($this->element_value != FALSE)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#value\", \"value=\\\"\" . $this->element_value . \"\\\"\", $html);\r\n\t\t} else {\r\n\t\t\t$html = str_replace(\"#value\", \"\", $html);\r\n\t\t}//end if\r\n\r\n\t\t$this->element_label = $label;\r\n\t\t$this->element_html = $html;\r\n\r\n\t\t//add error messages where set\r\n\t\tif ($this->objElementErrors !== FALSE && is_object($this->objElementErrors))\r\n\t\t{\r\n\t\t\tforeach ($this->objElementErrors as $error)\r\n\t\t\t{\r\n\t\t\t\t$this->element_html .= \"<div class=\\\"form-element-error\\\">$error</div>\";\r\n\t\t\t}//end foreach\r\n\t\t}//end if\r\n\t}",
"protected function makeTag($type, $attributes, $innerHTML, $extraInnerTag = '') {\r\n\t\t$html = $innerHTML;\r\n\r\n\t\tif ($type!='') {\r\n\t\t\t$tag = '';\r\n\t\t\tforeach ($attributes as $name => $val) {\r\n\t\t\t\t$tag.= ' '.$name.'=\"'.str_replace('->', '->', htmlentities($val, ENT_COMPAT, 'UTF-8').'\"');\r\n\t\t\t}\r\n\t\t\t$tag.= $extraInnerTag;\r\n\t\t\tif ($innerHTML == '')\r\n\t\t\t\t$tag.= ' />';\r\n\t\t\telse\r\n\t\t\t\t$tag.= '>';\r\n\t\t\t$tag = '<'.$type.$tag;\r\n\t\t\t$html = $tag.$html;\r\n\t\t\tif ($innerHTML != '')\r\n\t\t\t\t$html.= '</'.$type.'>';\r\n\t\t}\r\n\t\treturn $html;\r\n\t}",
"abstract protected function buildCreativeElement(string $type, \\DOMElement $creativeDomElement): AbstractCreative;",
"function generateElement($element){\n global $dropdown;\n global $elements;\n\n //Generate html element with two input fields for xml attribute and value\n if( $element->columns == 'doubleColumn'){\n echo '\n <div class=\"form-group row no-gutters\" > <!--Standard form group with two inputs-->\n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\" >'\n .((is_array($element->attribute) == false)?'<input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\"' .(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') . 'id=\"'. $element->name .'_attribute_input\" ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled=\"disabled\"':'') . ' ' . (($element->hidden==true)?'hidden=\"true\"':'') . '>':generateDropdown($element)) .\n '<input type=\"'.(($element->value=='date')?'date':'text').'\" ' .(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' class=\"form-control form-control-sm inputField\" id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n </div>';\n //Generate html element with a single input field for either xml attribute or value\n }else if($element->columns == 'singleColumn'){\n echo ' \n <div class=\"form-group row no-gutters\"> <!--type--> \n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">' . $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\"> \n <input type=\"'.(($element->value=='date')?//If value field is == date, create add a datepicker\n 'date'\n :'text').//Else mark as text element\n '\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .'id=\"'. $element->name .'_attribute_input\"' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled':'').'>\n </div>\n </div>';\n }else if($element->columns == 'typeColumn'){ //Special case for the type fields\n echo ' \n <div class=\"form-group row no-gutters\"> <!--type--> \n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">' . $element->prefix . $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\"> \n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" id=\"'. $element->name .'_attribute_input\" value=\"'.((is_array($element->attribute))?''.((sizeof($elements) > 10))?(string)$element->attribute[0]:(string)$element->attribute[1].'':(string)$element->attribute).'\" ' . (($element->readOnly==true)?'disabled':'').'>\n </div>\n </div>';\n //Generate html element with two input fields for xml attribute and value and a button to dynamically add additional copies of this element\n }else if($element->columns == 'singleDropdown'){\n echo ' \n <div class=\"form-group row no-gutters\"> <!--type--> \n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">' . $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\">'\n .generateDropdown($element).\n '</div>\n </div>';\n }else if($element->columns == 'buttonDouble'){\n echo '\n <div class=\"form-group row no-gutters justify-content-end\"> <!--Form group with dynamic adding and removal of inputs-->\n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group entry col-sm-10 attribute_input\">'\n .((is_array($element->attribute) == false)? '<input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\"' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' >':generateDropdown($element)) .\n '<input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" ' . ((is_array($element->attribute) && sizeOf($element->attribute)==1)?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'') . '>\n <button class=\"btn btn-success btn-add\" type=\"button\" tabindex=\"-1\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </div>\n </div>';\n //Generate html element with a single input field for xml attribute or value and a button to dynamically add additional copies of this element\n }else if($element->columns == 'buttonSingle'){\n echo '\n <div class=\"form-group row no-gutters justify-content-end\">\n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group entry col-sm-10\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\" form-control form-control-sm inputField attribute_input\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_input\" >\n <button class=\"btn btn-success btn-add\" type=\"button\" tabindex=\"-1\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </div>\n </div>';\n }else if( $element->columns == 'doubleRow'){\n echo '\n <div>\n <div class=\"form-group row no-gutters justify-content-end\" > <!--Standard form group with two inputs-->\n <div class=\"col\"> \n <div class=\"form-group row no-gutters justify-content-end\"> \n <label class=\"col-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label> \n <span class=\"col\">\n <div class=\"input-group col-12 no-padding\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\" ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n \n <div class=\"w-100\"></div>\n\n <span class=\"col-2\"></span>\n <div class=\"col-12 input-group no-padding\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .'id=\"'. $element->name .'_attribute_input\" ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[1] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .'id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n </span>\n </div>\n </div> \n </div>\n </div>';\n }\n else if( $element->columns == 'buttonDoubleRow'){\n echo '\n <div>\n <div class=\"form-group row no-gutters justify-content-end entry\"> <!--Form group with dynamic adding and removal of inputs-->\n <div class=\"col\">\n <div class=\"form-group row no-gutters justify-content-end\">\n <label class=\"col-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <span class=\"col\">\n <div class=\"input-group col-12\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField attribute_input\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\" ' . ' ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n\n <div class=\"w-100\"></div>\n\n <span class=\"col-2\"></span>\n <div class=\"input-group col-12\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField attribute_input\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\" ' . ' ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[1] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n </span>\n </div>\n </div>\n <div style=\"padding-top: 5px;\">\n <button class=\"btn btn-success btn-double-add\" style=\"height: 100%;\" type=\"button\" tabindex=\"-1\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </div>\n </div>\n </div>';\n }\n }",
"function elementBuilder($propName, $elementType, $text){\n $str = \"<{$elementType} class = \" . $propName . \">\" . $text . \"</{$elementType}>\";\n return $str;\n}",
"public function createElement($spec)\n {\n if (isset($spec['type']) && !class_exists($spec['type'])) {\n $type = __NAMESPACE__ . '\\\\Element\\\\' . ucfirst($spec['type']);\n if (!class_exists($type)) {\n $type = 'Zend\\\\Form\\\\Element\\\\' . ucfirst($spec['type']);\n if (class_exists($type)) {\n $spec['type'] = $type;\n }\n } else {\n $spec['type'] = $type;\n }\n }\n return parent::createElement($spec);\n }",
"private static final function htmlInputType ($type, $value) {\n \n $_html = '';\n \n switch(strtolower($type)) {\n \n case \"text\" : $_html = \"<input type='text' value='{$value}'/>\"; break;\n \n case \"submit\" : $_html = \"<input type='submit' value='{$value}'/>\"; break;\n \n case \"reset\" : $_html = \"<input type='reset' value='{$value}'/>\"; break;\n \n case \"password\" : $_html = \"<input type='password' value='{$value}'/>\"; break;\n \n case \"image\" : $_html = \"<input type='image' value='{$value}'/>\"; break;\n \n case \"hidden\" : $_html = \"<input type='hidden' value='{$value}'/>\"; break;\n \n case \"file\" : $_html = \"<input type='file' />\"; break;\n \n case \"button\" : $_html = \"<input type='button' value='{$value}'/>\"; break;\n \n case \"control:button\" : $_html = \"<button>{$value}</button>\"; break;\n \n /**\n * The radio case flow as follows:\n * \n * 1. It first initializes $ctr to 0. This is used to create ID per radio instance.\n * 2. $_html is then concatenated with an HTML markup.\n * 3. Then we walk thru the list of radio instances -- bind values and labels.\n * Each radios and label can be modified via CSS.\n * 4. It then concatenates $_html again with a closing HTML markup.\n * 5. It then unsets $ctr;\n * \n */\n case \"radio\" : \n \n $ctr = 0;\n\n $_html .= \"<div class='\".self::$formPrefix.\"_radioContainer'>\";\n \n foreach($value[1] as $k => $v) {\n\n $_html .= \"<span class='\".self::$formPrefix.\"_radio'>\n <input type='radio' value='{$v[1]}' id='\".self::$formPrefix.\"_radio_{$ctr}' name='{$value[0]}'/></span>\n <span class='\".self::$formPrefix.\"_radioLabel'>\n <label for='\".self::$formPrefix.\"_radio_{$ctr}'>{$v[0]}</label></span>\";\n\n $ctr++;\n\n }\n \n $_html .= \"</div>\";\n \n unset($ctr);\n \n break;\n \n /**\n * The checkbox case flow as follows:\n * \n * 1. It first initializes $ctr to 0. This is used to create ID per checkbox instance.\n * 2. $_html is then concatenated with an HTML markup.\n * 3. Then we walk thru the list of checkbox instances -- bind values and labels.\n * Each checkbox and label can be modified via CSS.\n * 4. It then concatenates $_html again with a closing HTML markup.\n * 5. It then unsets $ctr;\n * \n */\n case \"checkbox\" : \n \n $ctr = 0;\n\n $_html .= \"<div class='\".self::$formPrefix.\"_checkboxContainer'>\";\n \n foreach($value[1] as $k => $v) {\n\n $_html .= \"<span class='\".self::$formPrefix.\"_checkbox'>\n <input type='checkbox' value='{$v[1]}' id='\".self::$formPrefix.\"_checkbox_{$ctr}' name='{$value[0]}'/></span>\n <span class='\".self::$formPrefix.\"_checkboxLabel'>\n <label for='\".self::$formPrefix.\"_checkbox_{$ctr}'>{$v[0]}</label></span>\";\n\n $ctr++;\n\n }\n \n $_html .= \"</div>\";\n \n unset($ctr);\n \n break;\n \n /**\n * The select case flow as follows:\n * \n * 1. Special to select control is the grouping parameter. And so, the block\n * first checks if optgroup is true or false. If it is true, then it goes to the\n * else block.\n * 2. The ELSE Block as follows:\n * 2.1. $_html is concatenated with SELECT markup.\n * 2.2. It then walks thru the optgroups values. It first bind the optgroup markup\n * followed by the list of options.\n * 2.3 This block is then ended by concatenating $_html with the SELECT closing \n * markup.\n * 3. The IF block is similar to the ELSE block, the only difference is that in the IF block\n * there is no optgroup markup.\n * \n */\n case \"select\" : \n\n if(!$value[\"optgroup\"]) {\n \n $_html .= \"<select class='\".self::$formPrefix.\"_select' name='{$value[0]}'>\";\n\n foreach($value[1] as $k => $v) {\n\n $_html .= \"<option class='\".self::$formPrefix.\"_options' value='{$v[1]}'>{$v[0]}</option>\";\n\n }\n\n $_html .= \"</select>\";\n \n }\n else {\n \n $_html .= \"<select class='\".self::$formPrefix.\"_select' name='{$value[0]}'>\";\n\n foreach($value[1] as $k => $v) {\n\n $_html .= \"<optgroup label='{$v[0]}' class='\".self::$formPrefix.\"_optgroup'>\";\n \n foreach($v[1] as $kx => $vx) {\n \n $_html .= \"<option class='\".self::$formPrefix.\"_options' value='{$vx[1]}'>{$vx[0]}</option>\";\n \n }\n \n $_html .= \"</optgroup>\";\n\n }\n\n $_html .= \"</select>\";\n \n }\n \n break; \n \n case \"textarea\" : $_html = \"<textarea>{$value}</textarea>\"; break;\n \n \n default: $_html = \"<input type='text' value='{$value}' />\";\n \n }\n \n return $_html;\n \n }",
"public function test_create__unknown_type()\n {\n\n (new ElementFactory())->create(['attributes' => ['type' => 'i am an unknown type', 'name' => '']]);\n }",
"public function getHTMLType();",
"public function makeElement()\r\n\t{\r\n\t\t$id = (isset($this->attributes['id'])) ? $this->attributes['id'] : $this->name;\r\n\t\t$class = (isset($this->attributes['class'])) ? $this->attributes['class'] : 'textbox';\r\n\t\t$value = h($this->getValue());\r\n\t\t$out = \"<input type='text' name='{$this->name}' id='{$id}' class='{$class}' value='{$value}'\";\r\n\t\t$out .= $this->renderAttributes() . \" />\\n\";\r\n\r\n\t\treturn $out;\r\n\t}",
"function element_type() {\r\n if (isset($this->definition['element type'])) {\r\n return $this->definition['element type'];\r\n }\r\n // TODO Figure out exactly when to return a div or a <span>. Any field\r\n // that ever needs to be shown inline in Views UI. It needs to return\r\n // a div for textareas to prevent wrapping a <span> around a <p>.\r\n // Earl says we need to be sure that other fields we don't know\r\n // about won't end up wrapping a span around a block-level element.\r\n if ($this->content_field['widget']['type'] == 'text_textarea') {\r\n return 'div';\r\n }\r\n else {\r\n return 'span';\r\n }\r\n }",
"function buildTag ($type, $name, $attr=\"\")\n\t{\n\t\t$tag = \"<\";\n\n\t\tif ($type == \"end\")\n\t\t\t$tag.= \"/\";\n\n\t\t$tag.= $name;\n\n\t\tif (is_array($attr))\n\t\t{\n\t\t\twhile (list($k,$v) = each($attr))\n\t\t\t\t$tag.= \" \".$k.\"=\\\"$v\\\"\";\n\t\t}\n\n\t\t$tag.= \">\";\n\n\t\treturn $tag;\n\t}",
"public function buildSimpleTypeElement(): void;",
"abstract protected function getNewElementFromEntity(DSigTypeInterface $entity): \\DOMElement;",
"function create_html_element($tag, $attr=array(), $content=null, $self_close=True){\n\t$attr_str = create_attribute_string($attr);\n\tif ($content){\n\t\t$element = \"<{$tag}{$attr_str}>{$content}</{$tag}>\";\n\t}else{\n\t\tif ($self_close){\n\t\t\t$element = \"<{$tag}{$attr_str}/>\";\n\t\t}else{\n\t\t\t$element = \"<{$tag}{$attr_str}></{$tag}>\";\n\t\t}\n\t}\n\n\treturn $element;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a JOIN clause to the query using the sfGuardUserRelatedByCreatedBy relation | public function joinsfGuardUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('sfGuardUserRelatedByCreatedBy');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'sfGuardUserRelatedByCreatedBy');
}
return $this;
} | [
"public function joinUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('UserRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'UserRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function joinafNotificationRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('afNotificationRelatedByCreatedBy');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'afNotificationRelatedByCreatedBy');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function joinUserRelatedByCreatedByUserId($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('UserRelatedByCreatedByUserId');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'UserRelatedByCreatedByUserId');\n }\n\n return $this;\n }",
"public function useCollaboratorRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinCollaboratorRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'CollaboratorRelatedByCreatedBy', 'CollaboratorQuery');\n }",
"public function joinCollaboratorRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('CollaboratorRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'CollaboratorRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function joinMaillingListRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MaillingListRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MaillingListRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function useMaillingListRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinMaillingListRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MaillingListRelatedByCreatedBy', 'MaillingListQuery');\n }",
"public function useContactRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinContactRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'ContactRelatedByCreatedBy', 'ContactQuery');\n }",
"public function joinContactRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('ContactRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'ContactRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function useHistoryRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinHistoryRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'HistoryRelatedByCreatedBy', 'HistoryQuery');\n }",
"public function joinsfGuardUserRelatedByUpdatedBy($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('sfGuardUserRelatedByUpdatedBy');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'sfGuardUserRelatedByUpdatedBy');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function joinHistoryRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('HistoryRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'HistoryRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function useNotificationRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinNotificationRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'NotificationRelatedByCreatedBy', '\\Zerebral\\BusinessBundle\\Model\\Notification\\NotificationQuery');\n }",
"public function joinEsUsersRelatedByIdUserCreated($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsUsersRelatedByIdUserCreated');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsUsersRelatedByIdUserCreated');\n }\n\n return $this;\n }",
"public function joinCartItemRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('CartItemRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'CartItemRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function useafNotificationRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinafNotificationRelatedByCreatedBy($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'afNotificationRelatedByCreatedBy', 'afNotificationQuery');\n\t}",
"public function joinAmistadRelatedById_usuario($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('AmistadRelatedById_usuario');\n\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'AmistadRelatedById_usuario');\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function joinCartRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('CartRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'CartRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function joinAlertRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('AlertRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'AlertRelatedByCreatedBy');\n }\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the vitamin D in international units. | public function setVitaminD(int $vitaminD)
{
$this->vitaminD = $vitaminD;
return $this;
} | [
"public function konvert_datum_vreme_sr_u_usa_forma($datum)\n {\n $datum = explode(\" \", $datum);\n $vreme = $datum[1];\n $datum = $datum = explode(\".\", $datum[0]);\n return $datum[2] . \"-\" . $datum[1] . \"-\" . $datum[0] . \" \" . $vreme;\n }",
"public function testSetVirSeuil() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setVirSeuil(10.092018);\n $this->assertEquals(10.092018, $obj->getVirSeuil());\n }",
"function setDPI($d)\n {\n $this->DPI = $d;\n }",
"public function getDin() : float;",
"public function testSetDin() {\n\n $obj = new LocationsFi();\n\n $obj->setDin(true);\n $this->assertEquals(true, $obj->getDin());\n }",
"function setMaDeThi($ma_de_thi){\r\n\t\t$this->ma_de_thi = $ma_de_thi;\r\n\t}",
"public function setVat($value);",
"public function setPrix_prov_matin_enfant($iv_prix_prov_matin_enfant) {\n\t\t\t/* Database attributes control */\n\t\t\t$lv_datatype = 'decimal(10,2)';\n\t\t\ttry {\n\t\t\t\t$this->prix_prov_matin_enfant = Securite::checkDataFormat($iv_prix_prov_matin_enfant, $lv_datatype);\n\t\t\t} catch (Message $lo_message) {\n\t\t\t\t$this->addMessage($lo_message);\n\t\t\t\t$this->v_has_error = true;\n\t\t\t}\n\t\t}",
"public function testSetIndCp() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setIndCp(10.092018);\n $this->assertEquals(10.092018, $obj->getIndCp());\n }",
"function setNoiDung($noi_dung){\r\n\t\t$this->noi_dung = $noi_dung;\r\n\t}",
"function setDia_num($idia_num = '')\n {\n $this->idia_num = $idia_num;\n }",
"function hacerDenuncia(){\n $this->view->formularioDenuncia();\n }",
"public function setPrix_prov_midi_enfant($iv_prix_prov_midi_enfant) {\n\t\t\t/* Database attributes control */\n\t\t\t$lv_datatype = 'decimal(10,2)';\n\t\t\ttry {\n\t\t\t\t$this->prix_prov_midi_enfant = Securite::checkDataFormat($iv_prix_prov_midi_enfant, $lv_datatype);\n\t\t\t} catch (Message $lo_message) {\n\t\t\t\t$this->addMessage($lo_message);\n\t\t\t\t$this->v_has_error = true;\n\t\t\t}\n\t\t}",
"public function testSetQuantiteCde() {\n\n $obj = new CdeFournisseurMensu();\n\n $obj->setQuantiteCde(10.092018);\n $this->assertEquals(10.092018, $obj->getQuantiteCde());\n }",
"public function setDiasVenc($value,$options=array('required'=>true)){ \n $this->_data['dias_venc'] = new ZendT_Type_Number($value,array('numDecimal'=>0));\n if ($options['db'])\n $this->_data['dias_venc']->setValueFromDb($value);\n \n if (!$options['db']){\n \n }\n return $this;\n }",
"public function toKelvin() {\n\t\t$this->unit = self::KELVIN;\n\t}",
"public function testSetValeurHt() {\n\n $obj = new LocationsFi();\n\n $obj->setValeurHt(10.092018);\n $this->assertEquals(10.092018, $obj->getValeurHt());\n }",
"private function _setDexterity($val) {\n\t\t$this->dexterity = $val;\n\t}",
"public function testSetDadsuNbOptions() {\n\n $obj = new EmpDadsuParam();\n\n $obj->setDadsuNbOptions(10.092018);\n $this->assertEquals(10.092018, $obj->getDadsuNbOptions());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrap $html content into a CHECKS mode form with submit button | function form_checks($html)
{
$form = Html::hidden('poll-ID', $this->ID) . $html;
$form .= Xml::submitButton(wfMsg('wikipoll-submit'), array('name' => 'vote'));
return self::xelement('form', array('action' => '#poll-'.$this->ID, 'method' => 'POST'), $form);
} | [
"protected function get_save_payment_method_checkbox_html() {\n\n\t\t$html = '';\n\n\t\tif ( $this->tokenization_allowed() || $this->tokenization_forced() ) {\n\n\t\t\tif ( $this->tokenization_forced() ) {\n\n\t\t\t\t$html .= sprintf( '<input name=\"wc-%1$s-tokenize-payment-method\" id=\"wc-%1$s-tokenize-payment-method\" type=\"hidden\" value=\"true\" />', $this->get_gateway()->get_id_dasherized() );\n\n\t\t\t} else {\n\n\t\t\t\t$html .= '<p class=\"form-row\">';\n\n\t\t\t\t/**\n\t\t\t\t * Payment Form Default Tokenize Payment Method Checkbox to Checked Filter.\n\t\t\t\t *\n\t\t\t\t * Allow actors to default the tokenize payment method checkbox state to\n\t\t\t\t * checked.\n\t\t\t\t *\n\t\t\t\t * @since 4.2.0\n\t\t\t\t * @param bool $checked default false, set to true to change the checkbox state to checked\n\t\t\t\t * @param \\SV_WC_Payment_Gateway_Payment_Form $this payment form instance\n\t\t\t\t */\n\t\t\t\t$checked = apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_default_tokenize_payment_method_checkbox_to_checked', false, $this );\n\n\t\t\t\t$html .= sprintf( '<input name=\"wc-%1$s-tokenize-payment-method\" id=\"wc-%1$s-tokenize-payment-method\" class=\"js-sv-wc-tokenize-payment method js-wc-%1$s-tokenize-payment-method\" type=\"checkbox\" value=\"true\" style=\"width:auto;\" %2$s/>', $this->get_gateway()->get_id_dasherized(), $checked ? 'checked=\"checked\" ' : '' );\n\n\t\t\t\t/**\n\t\t\t\t * Payment Form Tokenize Payment Method Checkbox Text Filter.\n\t\t\t\t *\n\t\t\t\t * Allow actors to modify the \"securely save to account\" checkbox\n\t\t\t\t * text rendered on the payment form on the checkout page.\n\t\t\t\t *\n\t\t\t\t * @since 4.0.0\n\t\t\t\t * @param string $checkbox_text checkbox text\n\t\t\t\t */\n\t\t\t\t/* translators: account as in customer's account on the eCommerce site */\n\t\t\t\t$html .= sprintf( '<label for=\"wc-%s-tokenize-payment-method\" style=\"display:inline;\">%s</label>', $this->get_gateway()->get_id_dasherized(), apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_tokenize_payment_method_text', esc_html__( 'Securely Save to Account', 'woocommerce-gateway-paypal-powered-by-braintree' ) ) );\n\t\t\t\t$html .= '</p><div class=\"clear\"></div>';\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Payment Gateway Payment Form Save Payment Method Checkbox HTML.\n\t\t *\n\t\t * Filters the HTML rendered for the \"save payment method\" checkbox.\n\t\t *\n\t\t * @since 4.0.0\n\t\t * @param string $html\n\t\t * @param \\SV_WC_Payment_Gateway_Payment_Form $this payment form instance\n\t\t */\n\t\treturn apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_payment_form_save_payment_method_checkbox_html', $html, $this );\n\t}",
"protected function htmlChecked()\n {\n $this->setLabel();\n $this->setChecked();\n return $this->void('input', $this->attribs);\n }",
"public function present_body(){\n $present = <<<HTML\n<div class=\"index\">\n <form method=\"post\" action=\"options-post.php\">\nHTML;\n if($this->lights->isLighted()){\n $present .= \"<p><input type=\\\"checkbox\\\" name=\\\"lighted\\\" id=\\\"lighted\\\" checked='checked'><label for=\\\"lighted\\\">Show lighted squares</label></p>\";\n }\n else{\n $present .= \"<p><input type=\\\"checkbox\\\" name=\\\"lighted\\\" id=\\\"lighted\\\"><label for=\\\"lighted\\\">Show lighted squares</label></p>\";\n }\n if($this->lights->isClues()){\n $present .= \"<p><input type=\\\"checkbox\\\" name=\\\"hints\\\" id=\\\"hints\\\" checked='checked'><label for=\\\"hints\\\">Show completed clues</label></p>\";\n }\n else{\n $present .= \"<p><input type=\\\"checkbox\\\" name=\\\"hints\\\" id=\\\"hints\\\"><label for=\\\"hints\\\">Show completed clues</label></p>\";\n }\n $present .= <<<HTML\n <p><input type=\"submit\" name=\"submit\" value=\"Submit\"></p>\n </form>\n</div>\nHTML;\n return $present;\n }",
"function renderHtmlBoolean($name, $form = 'frmEdit', $value = 0, $locked = false)\r\n{\r\n $result = '';\r\n ?>\r\n <script type=\"text/javascript\">\r\n function changeHtmlBoolean(form, field)\r\n {\r\n if (eval(\"document.forms['\" + form + \"'].box_\" + field + \".checked\"))\r\n eval(\"document.forms['\" + form + \"'].\" + field + \".value=1\")\r\n else\r\n eval(\"document.forms['\" + form + \"'].\" + field + \".value=0\")\r\n }\r\n </script>\r\n <?php\r\n $result .= '<input type=\"checkbox\" value=\"' . textH8($value) . '\" name=\"box_' . $name . '\"';\r\n if ($value)\r\n $result .= ' checked=\"checked\"';\r\n if ($locked)\r\n $result .= ' disabled=\"disabled\"';\r\n $result .= '\" onclick=\"changeHtmlBoolean(\\'' . $form . '\\', \\'' . $name . '\\');\" />';\r\n\r\n $result .= '<input type=\"hidden\" name=\"' . $name . '\" id=\"' . $name . '\" value=\"' . (($value) ? '1' : '0') . '\" />';\r\n\r\n return $result;\r\n}",
"public function wrapForm( $html ) {\n\t\t# Include a <fieldset> wrapper for style, if requested.\n\t\tif ( $this->mWrapperLegend !== false ) {\n\t\t\t$html = Xml::fieldset( $this->mWrapperLegend, $html );\n\t\t}\n\t\t# Use multipart/form-data\n\t\t$encType = $this->mUseMultipart\n\t\t\t? 'multipart/form-data'\n\t\t\t: 'application/x-www-form-urlencoded';\n\t\t# Attributes\n\t\t$attribs = [\n\t\t\t'action' => $this->getTitle()->getFullURL(),\n\t\t\t'method' => 'post',\n\t\t\t'class' => 'visualClear',\n\t\t\t'enctype' => $encType,\n\t\t\t'onsubmit' => 'submitForm()', // added\n\t\t\t'id' => 'upload', // added\n\t\t\t'name' => 'upload' // added\n\t\t];\n\n\t\t// fucking newlines...\n\t\treturn \"<script type=\\\"text/javascript\\\">\n\tfunction submitForm() {\n\t\tvar valueToCheck = document.getElementById( 'wpUploadFile' ).value;\n\t\tif ( valueToCheck != '' ) {\n\t\t\t// This value is set only when we're editing a pre-existing quiz\n\t\t\tif ( window.parent.document.getElementById( 'old_correct' ) ) {\n\t\t\t\twindow.parent.QuizGame.completeImageUpload();\n\t\t\t} else {\n\t\t\t\t// This is what we want to call when we're creating a brand\n\t\t\t\t// new quiz\n\t\t\t\twindow.parent.QuizGame.welcomePage_completeImageUpload();\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tif ( !( document.getElementById( 'wpSourceTypeurl' ) && document.getElementById( 'wpSourceTypeurl' ).checked ) ) {\n\t\t\t\t// textError method is gone and I can't find it anywhere...\n\t\t\t\talert( '\" . str_replace( \"\\n\", ' ', wfMessage( 'emptyfile' )->plain() ) . \"' );\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// wpSourceTypeurl *is* set, so we must be trying to use the upload-by-URL feature\n\t\t\t\tif ( window.parent.document.getElementById( 'old_correct' ) ) {\n\t\t\t\t\twindow.parent.QuizGame.completeImageUpload();\n\t\t\t\t} else {\n\t\t\t\t\t// This is what we want to call when we're creating a brand\n\t\t\t\t\t// new quiz\n\t\t\t\t\twindow.parent.QuizGame.welcomePage_completeImageUpload();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n</script>\\n\" . Html::rawElement( 'form', $attribs, $html );\n\t}",
"function MakeCheckbox($str_name, \r\n $bl_checked,\r\n $bl_enabled = TRUE,\r\n $text=FALSE,\r\n $formname='',\r\n $auto_submit=FALSE) {\r\n $str_return = \"<input type=\\\"checkbox\\\" name=\\\"$str_name\\\"\";\r\n if ($bl_checked) $str_return .=\" checked \";\r\n if (!$bl_enabled) $str_return .=\" DISABLED \";\r\n if ($text) $str_return .= ShowOnMouseOverText($text);\r\n if ($formname && $auto_submit) $str_return .= \"onclick=\\\"document.$formname.submit();\\\"\";\r\n $str_return .=\">\";\r\n\r\n return $str_return;\r\n}",
"function check() {\n $param = func_get_args();\n $input = \"<input type=\\\"checkbox\\\"\";\n $this->_ordre = array(0, 1, 12, 2, 3, 4, 5, 10);\n \n $i = 0;\n $j = 0;\n $label = \"\";\n $valeur = \"\";\n $name = \"\";\n $taille = count($param);\n \n foreach ($param as $value) {\n $value = preg_replace(\"/\\n/\", \"\", $value);\n \n if (preg_match(\"/(\\w+)\".$this->_separateur.\"(.)/\",$value,$res)) {\n switch ($res[1]) {\n case \"other\" :\n $input .= \" \".$res[2];\n $j++;\n break;\n case \"label\" :\n $label = \" \".$res[2];\n $j++;\n break;\n case \"value\" :\n $valeur = $res[2];\n $input .= \" \".$res[1].\"=\\\"\".$res[2].\"\\\"\";\n $j++;\n break;\n case \"name\" :\n $name = $res[2];\n default :\n $input .= \" \".$res[1].\"=\\\"\".$res[2].\"\\\"\";\n $j++;\n }\n } else {\n if ($value) {\n if ($this->_Tattributs[$this->_ordre[$i]] == \"other\") $input .= \" \".$value;\n elseif ($this->_Tattributs[$this->_ordre[$i]] == \"label\") $label = $value;\n elseif ($this->_Tattributs[$this->_ordre[$i]] == \"value\") {\n $valeur = $value;\n $input .= \" \".$this->_Tattributs[$this->_ordre[$i]].\"=\\\"\".$value.\"\\\"\";\n } elseif ($this->_Tattributs[$this->_ordre[$i]] == \"name\") {\n $name = $value;\n $input .= \" \".$this->_Tattributs[$this->_ordre[$i]].\"=\\\"\".$value.\"\\\"\";\n } else $input .= \" \".$this->_Tattributs[$this->_ordre[$i]].\"=\\\"\".$value.\"\\\"\";\n }\n $i++;\n }\n }\n if ((isset($_REQUEST[\"$name\"]) && ($_REQUEST[\"$name\"] == $valeur || strtolower($_REQUEST[\"$name\"]) == \"on\")) || strtolower($valeur) == \"on\") $input .= \" checked\";\n $input .= \" />\".$label.\"\\n\";\n $this->_ordre = array();\n \n return (($j == $taille && $i == 0) || ($i == $taille && $j == 0)) ? $input : 0;\n }",
"private function get_checkbox() {\n\t\t$html = '';\n\t\t$input[] = 'type=\"' . $this->type . '\"';\n\t\t$input[] = 'name=\"' . $this->name . '\"';\n\t\tif($this->id)\n\t\t\t$input[] = 'id=\"' . $this->id . '\"';\n\t\tif(count($this->class) > 0)\n\t\t\t$input[] = 'class=\"' . implode(' ', $this->class) . '\"';\n\t\tif($this->value)\n\t\t\t$input[] = 'value=\"' . $this->value . '\"';\n\t\tif($this->title)\n\t\t\t$input[] = 'title=\"' . $this->title . '\"';\n\t\tif($this->checked)\n\t\t\t$input[] = 'checked=\"checked\"';\n\t\t$input = array_merge($input, $this->get_html_multiple_attr());\n\t\t$html .= '<input ' . implode(' ', $input) . ' />' . (self::BREAK_LINE ? \"\\n\" : '');\n\t\t$html .= $this->get_html_label();\n\t\treturn $html;\n\t}",
"function HtmlGetCheckBox($inputName,$isChecked,$labelText,$isDisabled=false,$outerHTML='',$helpText='',$innerHTML='') {\n\t\t\treturn '<li><label for=\"' . $inputName . '\"><input type=\"checkbox\" id=\"' . $inputName . '\" name=\"' . $inputName . '\" ' . ($isChecked?'checked=\"checked\"':'') . ' ' . ($isDisabled?'disabled=\"disabled\"':'') . ' ' . $innerHTML . ' /> ' . $labelText . (!empty($helpText)?' <abbr onclick=\"alert(this.title);\" title=\"' . $helpText . '\">[?]</abbr>':'') . '</label>' . $outerHTML . '</li>';\t\t\t\n\t\t}",
"private function _renderCheckboxOrRadio(): string {\n\n $attrs = $this->_buildAttrs([\"class\" => \"form-check-input\", \"type\" => $this->_type, \"value\" => $this->_meta['value']]);\n $inline = $this->_checkInline ? ' form-check-inline' : '';\n $inlineClass = $this->_FinlineForm ? ' my-sm-1 mx-sm-1' : '';\n $wrapperClass = $this->_wrapperClass ? ' ' . $this->_wrapperClass : '';\n $labelClass = $this->_labelClass ? ' ' . $this->_labelClass : '';\n $label = $this->_e($this->_label);\n $id = $this->_getId();\n\n $this->_resetFlags();\n\n return '<div class=\"form-check' . $inline . $inlineClass . $wrapperClass . '\"><input ' . $attrs . '><label class=\"form-check-label' . $labelClass . '\" for=\"' . $id . '\">' . $label . '</label></div>';\n }",
"function HTML_submit($htmlName,$label,$extra=\"\")\n{\n\tdefine($htmlName,'\n\t\t<INPUT type=\"submit\" name=\"'.$htmlName.'\" value=\"'.$label.'\"'.$extra.'>\n\t');\n\n\treturn(isset($_POST[$htmlName]) && ($label === stripslashes($_POST[$htmlName])));\n}",
"function _display_checkbox_field($name, $value) {\n?>\n<input type=\"checkbox\" name=\"<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]\" id=\"http_authentication_<?php echo htmlspecialchars($name); ?>\"<?php if ($value) echo ' checked=\"checked\"' ?> value=\"1\" /><br />\n<?php\n }",
"function toFormHTML() {\n $this->basket->toStaticHTML();\n $this->userInfo->toStaticHTML();\n $this->paymentInfo->toStaticHTML();\n\n echo <<<FORM\n <br/>\n <div id=\"finalOrder\">\n <form name=\"submitOrder\" method=\"POST\" action=\"finalOrder.php\">\n <input type=\"hidden\" name=\"ordersubmitted\" value=\"true\"/>\n <input type=\"submit\" name=\"submitbtn\" id=\"submitbtn\" value=\"Submit Order\"/>\n </form>\n </div>\nFORM;\n }",
"function getformElementsChecbox($arrElement) {\n\n $html = '';\n if (empty($arrElement))\n return $html;\n\n $html .= '<div class=\"form-group\">';\n $html .= '<label class=\"col-sm-2 control-label\"> '.$arrElement['placeholder'] .' </label>';\n $html .= '<div class=\"col-sm-6\">';\n $html .= form_checkbox($arrElement);\n $html .= \"</div>\";\n $html .= form_error($arrElement['name']);\n $html .= \"</div>\";\n return $html;\n }",
"function form_checkbox($tooltip_id, $labelText, $value, $checked, $tooltips)\n{\n $parts = explode('-', $tooltip_id);\n $input_id = $parts[1];\n\n $html = \"<div class='checkbox checkbox_wrapper'>\n <label>\";\n if ($checked) {\n $html .= \"<input type='checkbox' name='$input_id' value='$value' checked=''> $labelText\";\n } else {\n $html .= \"<input type='checkbox' name='$input_id' value='$value'> $labelText\";\n }\n\n $html .= \"</label>\n </div>\";\n\n return $html;\n}",
"function theme_form_checkbox ($field) {\n $output = '<fieldset class=\"form-row form-row-checkbox\">';\n $output .= '<input type=\"checkbox\" name=\"' . $field['name'] . '\" value=\"1\"';\n if ($field['checked']) {\n $output .= ' checked=\"checked\"';\n }\n $output .= '/>';\n if (!empty($field['label'])) {\n $output .= '<label>' . $field['label'] . '</label>';\n }\n $output .= '</fieldset>';\n return $output;\n}",
"function displayCheckinSubmitButton() {\r\n echo '\r\n <button id=\"checkin\" name=\"checkin\" type=\"submit\" onClick=\"validationRequired=true\">Check-In</button>';\r\n}",
"function create_check_feld()\n\t\t{\n\t\t\t\t$cfeld = \"\";\n\t\t\t\t$cfeld .= '<input type=\"checkbox\" name=\"' . $this->name . '\" value=\"1\" {$checked' . $this->name .$value. '} class=\"' . $this->name . '\" id=\"' . $this->name .\n\t\t\t\t\t\t'\"/>';\n\t\t\t\t$cfeld .= '<label for=\"' . $this->name . '\">{$plugin_' . $this->praefix . \"_\" .\n\t\t\t\t\t\t$this->name_org . '}{$plugin_error.'.$this->name.'} </label>';\n\t\t\t\t$cfeld .= \"\\n\";\n\t\t\t\t$cfeld .= '<br />';\n\t\t\t\t#echo $cfeld;\n\t\t\t\t$this->cfeld = $cfeld;\n\t\t}",
"function form_wrap($content, $submit_button = true) {\n\t\tif ( true === $submit_button ) {\n\t\t\t$content .= $this->submit_button();\n\t\t} elseif ( false !== strpos($submit_button, '<input') ) {\n\t\t\t$content .= $submit_button;\n\t\t} elseif ( false !== $submit_button ) {\n\t\t\t$button_args = array_slice(func_get_args(), 1);\n\t\t\t$content .= call_user_func_array(array($this, 'submit_button'), $button_args);\n\t\t}\n\n\t\treturn scbForms::form_wrap($content, $this->nonce);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Word wrap, wraps 'da word innit | function my_wordwrap($t = "", $chrs = 0, $replace = "<br />") {
if ($t == "")
return $t;
if ($chrs < 1)
return $t;
$t = preg_replace ( "#([^\s<>'\"/\.\\-\?&\n\r\%]{" . $chrs . "})#i", " \\1" . $replace, $t );
return $t;
} | [
"public function wrapWords()\n {\n $WordArray = $this->matchWordsWithoutTags($this->TextString);\n $WordPatternArray = array_map(function ($Word) {\n // Word cannot be preceded and followed by <w></w>-Tags\n return '/(\\b' . $Word . '\\b)+(?![^<w>]*<\\/w\\>)/';\n }, $WordArray);\n $WrappedWordArray = $this->wrap($WordArray, '<w>', '</w>');\n $ReplacementCounter = 0;\n $this->TextString = preg_replace($WordPatternArray, $WrappedWordArray, $this->TextString, -1, $ReplacementCounter);\n\n }",
"public function setWordWrap() {}",
"function my_wordwrap($t=\"\", $chrs=0, $replace=\"<br />\")\n\t{\n\t\tif ( $t == \"\" )\n\t\treturn $t;\n\n\t\tif ( $chrs < 1 )\n\t\treturn $t;\n\n\t\t$t = preg_replace(\"#([^\\s<>'\\\"/\\.\\\\-\\?&\\n\\r\\%]{\".$chrs.\"})#i\", \" \\\\1\".$replace ,$t);\n\t\treturn $t;\n\t}",
"#[Pure]\nfunction wordwrap(string $string, int $width = 75, string $break = \"\\n\", bool $cut_long_words = false): string {}",
"public function setWordWrap()\n {\n }",
"public function setWordWrap()\n {\n }",
"function wordwrap($str, $width = 75, $break = '\\\\n', $cut = false)\n{\n}",
"public function wordWrap($string, $width = 75, $break = \"\\n\", $cut = false);",
"function wrap($string,$length){\n\t$newstr = \"\"; //to put the formatted strings\n\t$word = \"\"; //the current word\n\n\t$ws_pos_left = -1; //the whitespace location at the left of the current word\n\t$ws_pos_right = -1; //the whitespace location at the right of the current word\n\n\t$word_left = 0; //the starting location of the word\n\t$word_right = 0; //the ending location of the word\n\t\n\t$newline = 0; //the location on the string where the new line starts\n\n\t//word loop start\n\twhile($ws_pos_right < strlen($string)){\n\n\t\t$ws_pos_left = $ws_pos_right;\n\t\t$ws_pos_right = strpos($string,\" \",$ws_pos_left+1);\n\t\t\n\t\t//Every words are seperated by blank spaces. If there are\n\t\t//none left, the total length of $string is used instead.\n\t\tif($ws_pos_right === FALSE){\n\t\t\t$ws_pos_right = strlen($string);\n\t\t}\n\t\n\t\t//Sets the beginning and ending points of the word.\n\t\t$word_left = $ws_pos_left+1;\n\t\t$word_right = $ws_pos_right-1;\n\t\t\n\t\t//Adds the whitespace to the beginning of the word.\n\t\t//(Except for the first word of $string)\n\t\tif($ws_pos_left >= 0){\n\n\t\t\t//If the current word does not fit in the current line,\n\t\t\t//the word is added on a new line.\n\t\t\tif($ws_pos_right-$newline > $length){\n\t\t\t\t$newstr .= \"\\n\";\n\t\t\t\t$newline = $word_left;\n\t\t\t}else{\n\t\t\t\t$newstr .= \" \";\n\t\t\t}\n\t\t}\n\n\n\t\t//Gets the string from $string\n\t\t$word = substr($string,$word_left,$word_right-$word_left+1);\n\t\n\n\t\t$word_index = 0;\n\n\t\t//word split start\n\t\twhile($word_index*$length < strlen($word)){\n\t\t\t$word_pos = $word_index*$length;\n\n\t\t\t//gets the lowest length of string possible\n\t\t\tif(strlen($word)-$word_pos < $length)\n\t\t\t\t$sublen = strlen($word);\n\t\t\telse\n\t\t\t\t$sublen = $length;\n\n\n\t\t\t//adds the word (or portion of the word) to the returning string\n\t\t\t$newstr .= substr($word,$word_pos,$sublen);\n\n\t\t\t//Check if there are still more letters left in this word.\n\t\t\t//If so, the word will break up and a new line is created.\n\t\t\tif(($word_index+1)*$length < strlen($word)){\n\t\t\t\t$newstr .= \"\\n\";\n\t\t\t\t$newline = ($word_index+1)*$length+$word_left;\n\t\t\t}\n\n\t\t\t$word_index ++;\n\t\t}\n\t\t//word split end\n\n\t}\n\t//word loop end\n\n\treturn $newstr;\n}",
"public function testWrapThreeWords()\n {\n $this->assertEquals(\"word\\nword\\nword\", WordWrap::wrap(\"word word word\", 6));\n }",
"function wrap($content,$wrap,$char='|')\t{\n\t\tif ($wrap)\t{\n\t\t\t$wrapArr = explode($char, $wrap);\n\t\t\treturn trim($wrapArr[0]).$content.trim($wrapArr[1]);\n\t\t} else return $content;\n\t}",
"public static function wordWrap($string, $characters = 75, $break = \"\\n\", $cutLongWords = false)\n {\n }",
"function wrap($text=NULL, $chars=20, $tag=\"<br>\") {\n\t\treturn wordwrap($text, $chars, $tag);\n\t}",
"function wrapLongWords($text,$maxLength) {\r\n\t$wordWrap = \"­\"; //this character will be used for breaking long words.\r\n\t\r\n if (strtolower(_CHARSET) == 'utf-8') {\r\n $bUsingUtf = true; //test, if utf-8 is used. \r\n } else {\r\n $bUsingUtf = false; \r\n }\r\n \r\n $wordStart = 0; // character position, where current word started\r\n $wordLength = 0; // length of word (we need this value separated, becouse text can be in utf-8)\r\n $lastCopy = 0; //points to the first character, which isn't copied to result yet\r\n\r\n\t//go through whole text\r\n for ($i = 0; $i < strlen($text);$i++) {\r\n\t\t \r\n\t\t//handles utf-8 coded string\r\n if ($bUsingUtf && (($value = ord($text{$i})) > 127)){\r\n if($value >= 192 && $value <= 223)\r\n $i++;\r\n elseif($value >= 224 && $value <= 239)\r\n $i = $i + 2;\r\n elseif($value >= 240 && $value <= 247)\r\n $i = $i + 3;\r\n }\r\n\t\t\r\n\t\t//don't wrap link!\r\n\t\tif (($text{$i} == '<') && ($text{$i+1} == 'a')) { \r\n\t\t\t$endLink = strpos($text,'>',$i);\r\n\t\t\t$i = $endLink;\r\n\t\t\t$wordStart = $i+1;\r\n\t\t\t$wordLength = 0;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\r\n\t\t//end of link\r\n\t\tif (($text{$i} == '<') && ($text{$i+1} == '/') && ($text{$i+2} == 'a') ) {//end of link\r\n\t\t\t$i = $i + 3;\r\n\t\t\t$wordStart = $i+1;\r\n\t\t\t$wordlLength = 0;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\r\n\t\t//here starts new word\r\n if (($text{$i} == ' ') || ($text{$i} == '-') || ($text{$i} == \"\\n\")) {\r\n $wordStart = $i + 1;\r\n $wordLength = 0;\r\n }\r\n \r\n\t\t//word is too long -> insert wordwrap character\r\n\t\tif ($wordLength >= $maxLength - 1) { \r\n $newText .= substr($text,$lastCopy ,$i - $lastCopy + 1).$wordWrap;\r\n $wordStart = $i + 1;\r\n $lastCopy = $i + 1;\r\n $wordLength = 0;\r\n }\r\n $wordLength++;\r\n }\r\n\t\r\n $newText .= substr($text,$lastCopy);\r\n \r\n\treturn $newText;\r\n }",
"function test_wrap_short()\n {\n\n $text = \"This is a\\nshort paragraph.\";\n\n $this->check_wrap($text, 20, [\n \"This is a short\",\n \"paragraph.\"\n ]);\n $this->check_wrap($text, 40, [\"This is a short paragraph.\"]);\n }",
"function test_nobreak_long()\n {\n $this->wrapper->break_long_words = 0;\n $this->wrapper->width = 30;\n $expect = [\n 'Did you say',\n '\"supercalifragilisticexpialidocious?\"',\n 'How *do* you spell that odd',\n 'word, anyways?'\n ];\n $result = $this->wrapper->wrap($this->text);\n $this->check($result, $expect);\n\n # Same thing with kwargs passed to standalone wrap() function.\n $result = StaticTextWrapper::wrap($this->text, $width = 30, array('break_long_words' => false));\n $this->check($result, $expect);\n }",
"function wrap($wrapping_element);",
"public function test_wordwrap_long_break() {\n $line = \\InfoPotato\\core\\UTF8::wordwrap(\"Ä very<br>long wöö<br>öööööööö<br>öörd.\", 8, '<br>', FALSE);\n $this->assertEquals(\"Ä very<br>long wöö<br>öööööööö<br>öörd.\", $line);\n }",
"function customWordwrap($string, $width = 75, $break = ' ')\r\n{\r\n\t$pattern = '/(^|\\s)(?!(?:http:\\/\\/(?:www\\.)?|www\\.))([\\w??????!?.,-]{'. $width .',})(\\s|$)/e';\r\n\treturn preg_replace( $pattern, '\"$1\".wordwrap( \"$2\", $width, $break, true ).\"$3\"', $string );\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Number value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0) | public function getNumber()
{
return isset($this->Number) ? $this->Number : null;
} | [
"public function getNumber()\n {\n $value = $this->get(self::NUMBER);\n return $value === null ? (string)$value : $value;\n }",
"public function getNValue() {}",
"public function getNVal()\n {\n return $this->get(self::N_VAL);\n }",
"public function getNVal()\n {\n return isset($this->n_val) ? $this->n_val : 0;\n }",
"public function getNumberValue()\n {\n return $this->readOneof(2);\n }",
"public function getNumericValue()\n {\n return (int)$this->number;\n }",
"public function getNumericValue()\n {\n return $this->_numericValue;\n }",
"public function propertyVal()\n {\n return $this->propertyVal;\n }",
"public function getNumber()\n {\n return intval($this->number);\n }",
"public function getPropertyValue();",
"public function getNumer()\n {\n return isset($this->numer) ? $this->numer : null;\n }",
"public function testErrorNumberReturnsNumber(): void\n {\n $this->set_reflection_property_value('error_number', 0);\n\n $value = $this->class->error_number();\n $this->assertIsInt($value);\n $this->assertEquals(0, $value);\n }",
"public function getValue(): mixed\n {\n return $this->isEmpty() && $this->nullable ? null : $this->value;\n }",
"public function value ()\n {\n if ($this->is_empty () || ($this->_value === false) || ($this->_value === '0') || ($this->_value === 0))\n {\n return 0;\n }\n\n return 1;\n }",
"function acf_get_numeric($value = '') {}",
"public function getNumeric()\n {\n return $this->fields['numeric'];\n }",
"public function get_value() {\n\t\tif ( $this->get_value_set()->get() === null ) {\n\t\t\t$this->set_value( $this->get_default_value() );\n\t\t}\n\t\treturn $this->get_value_set()->get();\n\t}",
"public function getValue()\n\t{\n\t\tif ($this->getAttribute(self::ATTR_NULL)) {\n\t\t\treturn NULL;\n\t\t}\n\t\t$bool = $this->getAttribute(self::ATTR_BOOL);\n\t\tif ($bool) {\n\t\t\tswitch (strtolower($bool)) {\n\t\t\t\tcase 'yes':\n\t\t\t\t// break intentionally omitted\n\t\t\t\tcase 'true':\n\t\t\t\t// break intentionally omitted\n\t\t\t\tcase 'on':\n\t\t\t\t// break intentionally omitted\n\t\t\t\tcase '1':\n\t\t\t\t\treturn TRUE;\n\t\t\t\tdefault:\n\t\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t$number = $this->getAttribute(self::ATTR_NUMBER);\n\t\tif (!is_null($number)) {\n\t\t\treturn $number + 0;\n\t\t}\n\t\treturn (string) $this;\n\t}",
"public function multiply(int|float|NumericalProperty $value): NumericalProperty;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get instance of Business_Addon_Polldata | public static function getInstance()
{
if(self::$_instance == null)
{
self::$_instance = new Business_Addon_Polldata();
}
return self::$_instance;
} | [
"public function getPollData() //cRud\n {\n //$pollData->poll_question =\"just testing...\"; // om te testen zonder database\n //$pollData->yes =0; // om te testen zonder database\n //$pollData->no=0; // om te testen zonder database\n\n $sql = \"SELECT poll_question, yes, no FROM poll WHERE poll_id =1\";\n $statement = $this->db->prepare($sql);\n $statement-> execute();\n $pollData = $statement->fetchObject();\n\n\n\n return $pollData;\n }",
"static function get( $poll_id ) {\n\n\t\t//if instance hasn't already been created for this poll_id\n\t\tif ( empty( self::$poll_instances[$poll_id] ) ) {\n\n\t\t\t//try to instantiate class object\n\t\t\ttry {\n\t\t\t\tself::$poll_instances[$poll_id] = new WPPP_Poll( $poll_id );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t//On failure, return false\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//Return the class object\n\t\treturn self::$poll_instances[$poll_id];\n\t}",
"public static function getPoll($id)\n {\n $em = Registry::getEntityManager();\n\n return $em->find(\"Module:Survey\\Entities\\Poll\", $id);\n }",
"public function poll()\n {\n return $this->hasOne('App\\Poll');\n }",
"public function getPsPoll()\n {\n return $this->hasOne(PsPoll::className(), ['id' => 'ps_poll_id']);\n }",
"public function fetchPoll($id) {\n\t\t$query = \"SELECT * FROM polls WHERE poll_id='$id'\";\n\n\t\t$result = mysql_query($query, $this->connection);\n\n\t\tif ($result === false) {\n\t\t\tthrow new ModelFetchException(\"Error fetching poll information. \");\n\t\t}\n\n\t\t$data = mysql_fetch_object($result);\n\n\t\tif ($data === false) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $data; /*new Poll($data->poll_id, $data->title, $data->author,\n\t\t\t\t\t\t$data->admin_email, $data->desciption,\n\t\t\t\t\t\t$data->options, $data->mailing_list,\n\t\t\t\t\t\t$data->end_date); */\n\t}",
"public function getPollChoice()\n {\n return $this->hasOne(PollChoice::className(), ['id' => 'pollchoice_id']);\n }",
"function & GetCurrentPollingData()\n { \n $where = \"(contest_vote_online > 0) AND (contest_deadline < NOW()) AND (contest_vote_deadline > NOW())\";\n $this->SetSort('contest_vote_deadline','DESC');\n $records = $this->GetRecords($where,false,0,1);\n \n if( empty($records) )\n return(null);\n\n $record = $records[0];\n $polls =& CCPolls::GetTable();\n $data = $polls->GetPollingData($record['contest_short_name'],'poll_numvotes');\n $data['contest_friendly_name'] = $record['contest_friendly_name'];\n if( $this->OKToVote($record) )\n {\n $data['contest_vote_url'] = ccl('contest', $record['contest_short_name'], 'vote' );\n $data['contest_vote_text'] = 'Vote';\n }\n\n return($data);\n }",
"public function getIdPoll0()\n {\n return $this->hasOne(Poll::className(), ['id' => 'idPoll']);\n }",
"public function getPsPollItem()\n {\n return $this->hasOne(PsPollItem::className(), ['id' => 'ps_poll_item_id']);\n }",
"function bl_getCurrentPoll()\n {\n $polls = dal_selectPollCurrent();\n if(count($polls) == 0) {\n $poll = null;\n }\n else {\n $poll = array_pop($polls);\n }\n\n $json = json_encode($poll);\n return $json;\n }",
"private function getStaticPollHandler()\n {\n $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . \"::\" . __METHOD__ . \" is deprecated since Xoopspoll 1.40, please use XoopspollPoll and XoopspollPollHandler classes instead.\");\n static $pH;\n\n if (!isset($pH)) {\n $pH =& xoops_getmodulehandler('poll', 'xoopspoll');\n }\n\n return $pH;\n }",
"public function fakePollData($pollFields = [])\n {\n return factory(App\\Models\\Poll::class)->make()['attributes'];\n\n }",
"public function getQuestionService(Poll $poll) {\n return $this->objectFactory->createQuestionService($poll);\n\t}",
"static function getInstance($id=0, $r=false, $vals=false, $enabled=true) {\n\t\tif (!is_numeric($id)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!array_key_exists($id, self::$instances)) {\n\t\t\tnew Poll($id, $r, $vals, $enabled);\n\t\t}\n\t\treturn self::$instances[$id];\n\t}",
"public function getPoller ()\r\n\t\t{\r\n\t\t\t\treturn $this -> pollerInstance;\r\n\t\t}",
"protected function getDataServePoll()\n {\n $questionID = -1;\n $surveyID = $this->data['attrs']['survey_id'];\n\n if ($this->data['attrs']['test'])\n $data = $this->CI->model('Polling')->getPreviewQuestion($surveyID, $questionID, false)->result;\n else\n $data = $this->CI->model('Polling')->getPollQuestion($surveyID, $questionID, false)->result;\n\n if (!$data['flow_id'])\n {\n if (!$this->data['attrs']['modal'])\n echo $this->reportError(\\RightNow\\Utils\\Config::getMessage(FLOW_FND_SURVEY_ID_PLS_SURVEY_ID_MSG));\n $this->data['js']['disabled_expired'] = true;\n return false;\n }\n\n if ($data['survey_disabled'] === 1)\n {\n if (!$this->data['attrs']['modal'])\n echo \\RightNow\\Utils\\Config::getMessage(POLL_DISABLED_LBL);\n $this->data['js']['disabled_expired'] = true;\n return false;\n }\n\n if ($data['max_responses_met'] || (intval($data['expiration_date']) > 0 && intval($data['expiration_date']) < time()))\n {\n if (!$this->data['attrs']['modal'])\n {\n if (strlen($data['expire_msg']) > 0)\n echo $data['expire_msg'];\n else\n echo \\RightNow\\Utils\\Config::getMessage(POLL_EXPIRED_LBL);\n }\n $this->data['js']['disabled_expired'] = true;\n return false;\n }\n\n $this->data['question'] = $data['question'];\n $this->data['answer_area'] = $data['answer_area'];\n $this->data['total_votes_label'] = $data['total_votes_label'];\n $this->data['view_results_label'] = $data['view_results_label'];\n $this->data['show_results_link'] = $data['show_results_link'];\n\n $this->data['js']['flow_id'] = $data['flow_id'];\n $this->data['js']['doc_id'] = $data['doc_id'];\n $this->data['js']['question_id'] = $data['question_id'];\n $this->data['js']['validation_script'] = $data['validation_script'];\n $this->data['js']['turn_text'] = $data['turn_text'];\n $this->data['js']['show_total_votes'] = $data['show_total_votes'];\n $this->data['js']['show_chart'] = $data['show_chart'];\n $this->data['js']['question_type'] = $data['question_type'];\n $this->data['js']['element_type'] = $data['element_type'];\n $this->data['js']['dialog_description'] = $data['title'] . ' ' . \\RightNow\\Utils\\Config::getMessage(DIALOG_LBL);\n\n if ($this->data['attrs']['modal'] === true)\n {\n $this->data['js']['title'] = $data['title'];\n $this->data['js']['submit_button_label'] = $data['submit_button_label'];\n $this->data['js']['ok_button_label'] = $data['ok_button_label'];\n }\n else\n {\n $this->data['title'] = $data['title'];\n $this->data['submit_button_label'] = $data['submit_button_label'];\n }\n }",
"public function getLongPollSettings(): GetLongPollSettings\n {\n return new GetLongPollSettings($this->_provider);\n }",
"function getAll()\n {\n $this->dbInit();\n\n $return_array = array();\n $poll_array = array();\n\n $this->Database->array_query( $poll_array, \"SELECT ID FROM eZPoll_Poll ORDER BY Name\" );\n\n for ( $i=0; $i<count( $poll_array ); $i++ )\n {\n $return_array[$i] = new eZPoll( $poll_array[$i][ \"ID\" ], 0 );\n }\n\n return $return_array;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ End of public function edit($language_slug, $skill_id) To publish a skill | public function publish($skill_id, $published)
{
$content = $this->skill_model->get($skill_id);
if( ($content != FALSE) && ($published==1 || $published==0))
{
if($this->skill_model->update(array('published'=>$published),$skill_id))
{
$this->postal->add('The published status was set.','success');
}
else
{
$this->postal->add('Couldn\'t set the published status.','error');
}
}
else
{
$this->postal->add('Can\'t find the content or the published status isn\'t correctly set.','error');
}
redirect('admin/skills/index/','refresh');
} | [
"public function update_skill($id){\r\n\t\t$data['skill']=$this->portfolio_model->get_skill_byID($id);\r\n\r\n\t\tif(!empty($data['skill'])){\r\n\t\t\t$this->load->view('admin/update_skills',$data);\r\n\t\t}else{\r\n\t\t\t$this->skill();\r\n\t\t}\r\n\t}",
"public function update_skill($skill_id) {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'category_id' => 'required|int|min:1'\n ]);\n\n $skill = Skill::find($skill_id);\n $skill->title = $this->request['title'];\n $skill->category_id = $this->request['category_id'];\n $skill->updated_by = $this->user_id;\n $skill->save();\n return response()->json('Skill updated successfully', 200);\n }",
"public static function updateSkill($skill)\n\t\t{\n\t\t\tglobal $db;\n\t\t\t$eSkillId = $db->real_escape_string($skill->getSkillId());\n\t\t\t$eCategory = $db->real_escape_string($skill->getCategory());\n\t\t\t$eDescription = $db->real_escape_string($skill->getDescription());\n\t\t\n\t\t\t$sql = \"UPDATE skill \";\n\t\t\t$sql .= \"SET category = ?, description = ? \";\n\t\t\t$sql .= \"WHERE skill_id = ?\";\n\t\t\n\t\t\t$stmt = $db->stmt_init();\n\t\t\tif(!$stmt->prepare($sql))\n\t\t\t{\n\t\t\t\techo \"Failed to prepare statement\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$stmt->bind_param(\"sss\", $eCategory, $eDescription, $eSkillId);\n\t\t\t\t\t\n\t\t\t\tif($stmt->execute())\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function add_skill(){\r\n\t\t$this->load->view('admin/add_skills');\r\n\t}",
"function editSkill($skill){\n \n Log::info(\"Entering SkillBusinessService.updateSkill()\");\n \n $database = new Database();\n $db = $database->getConnection();\n \n // Create a Skill Data Service with this connection and calls updateSkill method/\n $dbService = new SkillDataService($db);\n $flag = $dbService->updateSkill($skill);\n \n // close the connection\n $db = null;\n \n // return the finder result\n Log::info(\"Exit SkillBusinessService.editSkill() \");\n return $flag;\n }",
"public function editTranslation()\n\t{\n\t\t// Get Hash of the translation\n\t\t$string = $this->get('PARAMS.hash');\n $lang = $this->get('PARAMS.lang');\n\n\t\t// Load it from database\n\t\t$translation = new \\model\\translations;\n\t\t$translation->load( array('string = :string AND language = :lang', \n array(':string' => $string, ':lang' => $lang)));\n\n\t\t// Change the attributes\n $translation->hash = $translation->hash ? $translation->hash : \\controller\\helper::randStr();\n $translation->string = $string;\n\t\t$translation->translation = trim($this->get('POST.translation'));\n\t\t$translation->language = $lang;\n\n\t\t// Save it!\n\t\t$translation->save();\n\t}",
"public function actionUpdateskill()\n {\n $skills = new Skills();\n\n if ($skills->load(\\Yii::$app->getRequest()->getBodyParams(), '')) {\n $result = \\Yii::$app->getRequest()->getBodyParams();\n\n $skills->skill_name = $result['skill_name'];\n\n if ($skills->save()) {\n $skill_id = $skills->skill_id;\n $user_id = $result['user_id'];\n\n $userSkill = new UserSkills();\n\n $userSkill->skill_id = $skill_id;\n $userSkill->user_id = $user_id;\n\n if ($userSkill->save()) {\n return $userSkill;\n } else {\n return $userSkill;\n }\n }\n }\n }",
"public function updateSkill(Request $request){\n \n try {\n $securityservice = new SecurityService();\n \n $updateMe = new SkillModel(request()->get('editSkillID'), request()->get('editSkill'));\n \n $didSubmitJob = $securityservice->updateSkill($updateMe);\n \n if ($didSubmitJob) {\n \n }\n else {\n \n }\n \n $jobResults = $securityservice->getAllJobs();\n $skillResults = $securityservice->getAllSkills();\n $educationResults = $securityservice->getAllEducations();\n return view('portfolio')->with('jobs', $jobResults)->with('skills', $skillResults)->with('educations', $educationResults);\n } catch (Exception $e) {\n $this->logger->error(\"Update Skill Failed: \" . $e);\n }\n }",
"public static function updateSkill() {\t}",
"function admin_skills($id = null) {\n\t\tif(\n\t\t\t(empty($this->data) && $id == null ) || //GET\n\t\t\t(!empty($this->data) && !isset($this->data['Project']['id'])) //POST\n\t\t){\n\t\t\t$this->Session->setFlash(__('Invalid Request', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t\n\t\tif(!empty($this->data)){\n\t\t\t//AT POST\n\t\t\t$status = $this->Project->saveAll($this->data);\n\t\t\t\n\t\t\tif($status){\n\t\t\t\t$this->Session->setFlash(\"Project Saved.\");\n\t\t\t\t$this->redirect(array('action' => 'dashboard', $this->data['Project']['id']));\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash(\"Couldn't save data. Please try again.\");\n\t\t\t}\n\t\t}else{\n\t\t\t//AT GET\n\t\t\t$this->data = $this->Project->find('first', array(\n\t\t\t\t'fields' => array('Project.id', 'Project.name'),\n\t\t\t\t'conditions' => array('Project.id' => $id),\n\t\t\t\t'contain' => array('Skill')\n\t\t\t));\n\t\t}\n\t\t\n\t}",
"public function saveEdit() {\n\t\t\t\n\t\t\t$this->load->helper('form');\n\t\t\t\n\t\t\t$id = $this->uri->segment(3); \n\t\t\t\n\t\t\t$save=array(\n\t\t\t\t\t\t\t'userstory' => $this->input->post('userstoryarea'),\n\t\t\t\t\t\t\t'datetocomplete' => $this-> input->post('datecomplete'),\n\t\t\t\t\t\t 'name'=> $this->input->post('developer')\n\t\t\t);\n \n\t\t\t$this->load_userStory->saveEdited($id,$save);\n\t\t\t$this->viewUStory();\n\n\n\t\t}",
"function editQuestion()\n\t{\n\t\tglobal $ilDB, $tpl;\t\t\t\t\t\n\t\t\t\n\t\t$plugin = $this->object->getPlugin();\t\t\n\t\t\n\t\t$this->getQuestionTemplate();\n\t\tinclude_once(\"./Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($this->ctrl->getFormAction($this));\n\t\t$form->setTitle($this->outQuestionType());\n\t\t$form->setMultipart(FALSE);\n\t\t$form->setTableWidth(\"100%\");\n\t\t$form->setId(\"assJSMEQuestion\");\n\t\t// Basiseingabefelder: title, author, description, question, working time (assessment mode)\t\t\n\t\t$this->addBasicQuestionFormProperties($form);\n\t\t// points\n\t\t$points = new ilNumberInputGUI($plugin->txt(\"points\"), \"points\");\n\t\t$points->setValue($this->object->getPoints());\n\t\t$points->setRequired(TRUE);\n\t\t$points->setSize(10);\n\t\t$points->setMinValue(0.0);\n\t\t$form->addItem($points);\t\n\t\t\n\t\t// optionString for the JSME-Applet\n\t\tinclude_once(\"./Services/Form/classes/class.ilTextInputGUI.php\");\n\t\t$optionString = new ilTextInputGUI($plugin->txt(\"optionString\"), \"optionString\");\t\t\n\t\t$optionString->setValue($this->object->getOptionString());\t\t\t\t\n\t\t$form->addItem($optionString);\n\t\t\n\t\t// JSME-Applet for sampleSolution\n\t\tinclude_once(\"./Services/Form/classes/class.ilCustomInputGUI.php\");\n\t\t$sampleSolution = new ilCustomInputGUI($plugin->txt(\"sampleSolution\"), \"sampleSolution\");\n\t\t$template = $this->getJsmeOutputTemplate(\"\", $this->object->getOptionString(), $this->object->getSampleSolution() );\n\t\t$sampleSolution->setHtml($template->get());\n\t\t$form->addItem($sampleSolution);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t$form->addCommandButton('save', $plugin->txt(\"save\"));\n\t\t\n\t\t$this->tpl->setVariable(\"QUESTION_DATA\", $form->getHTML());\t\t\n\t}",
"public function update_it_skills($data,$id){\n \t$skills \t= $data['skills'];\n \t$version\t= $data['version'];\n\t\t$last_used \t= $data['last_used'];\n\t\t$year \t\t= $data['year'];\n\t\t$month \t\t= $data['month'];\n\t\t$experience = $year.'|'.$month;\n\n\t \t$query = \"UPDATE `it_skills` SET `skills`='$skills', `version`='$version', `last_used`='$last_used', `experience`='$experience',`uid`='$id'\";\n\t\t$result = mysql_query($query); \t \t\n\t\tif($result){\n\t\t\theader('location:update_it_skills.php');\n\t\t}else{\n\t\t\tdie('can not update'.mysql_error());\n\t\t}\n\t}",
"public function actionTopicEdit(){\n\t\t$form = $_POST;\n\t\t$container = $this->getContext();\n\t\t$actionModel = new \\Models\\ActionModel($container);\n\t\t$actionModel->editTopic($form);\n\t\t$this->redirect('actionPages:topics', array('id' => $this->getParam('id')));\n\t}",
"public function fb_addEditUserSkillsAction() {\n //check for logrdin user\n if (FALSE === $this->get('security.context')->isGranted('ROLE_USER')) {\n $this->getRequest()->getSession()->set('redirectUrl', $this->getRequest()->getRequestUri());\n return $this->redirect($this->generateUrl('login'));\n }\n $em = $this->getDoctrine()->getEntityManager();\n $skillRepo = $em->getRepository('ObjectsInternJumpBundle:Skill');\n\n //get logedin user objects\n $user = $this->get('security.context')->getToken()->getUser();\n\n //get all user skills\n $userSkills = $user->getSkills();\n\n return $this->render('ObjectsInternJumpBundle:Skill:fb_addEditUserSkills.html.twig', array(\n 'userSkills' => $userSkills,\n 'formName' => $this->container->getParameter('studentEditSkill_FormName'),\n 'formDesc' => $this->container->getParameter('studentEditSkill_FormDesc'),\n ));\n }",
"function GetProcessLanguageExperienceAddEditAction()\n {\n return \"ProcessLanguageExperiencesAddEdit\";\n }",
"public function readSkillEdit($id)\n {\n $this->logger->info(\"Entering ProfileController.readSkillEdit()\");\n try\n {\n // create new instance of profileBusinessService\n $profileBS = new SkillBusinessService();\n \n // attempt to read Skill\n $skills = $profileBS->retrieveSkill($id);\n \n // store skill information into variable\n \n $data = [\n 'skill' => $skills\n ];\n \n return view(\"skills.skillUpdate\")->with($data);\n }\n catch (Exception $e2) {\n // display our Global Exception Handler page\n return view(\"error\");\n }\n }",
"function skill_add_quicksave($column_name, $post_type) {\n if ($column_name != 'skill_meta') return;\n ?>\n <fieldset class=\"inline-edit-col-left\">\n <div class=\"inline-edit-col\">\n <span class=\"title\">Skill level</span>\n <input type=\"number\" name=\"new_meta_skill\" id=\"new_meta_skill\" value=\"\" />\n </div>\n </fieldset>\n <?php\n}",
"private function edit()\n {\n //Load and store parameters\n $article_id = (int)$this->Request->get('article_id');\n $type = (int)$this->Request->get('type');\n $title = $this->Request->get('title');\n $text = $this->Request->get('text');\n $source = (int)$this->Request->get('source');\n $keywords = implode(', ', json_decode($this->Request->get('keywords')));\n $pics = array_map('intval', json_decode($this->Request->get('pics')));\n $captions = json_decode($this->Request->get('captions'));\n\n //Save article in database\n $ArticlesLib = new ArticlesLib($this->DB, $this->User);\n if($article_id)\n {\n $ArticlesLib->edit($article_id, $type, $source, $title, $text, $keywords, $pics, $captions);\n $this->responseSetParam('article_id', $article_id);\n }\n else\n {\n $article_id = $ArticlesLib->insert($type, $source, $title, $text, $keywords, $pics, $captions, $lang);\n $this->responseSetParam('article_id', $article_id);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the meta language, if lang is null with default lang | public static function metaLanguage($lang=null){
if($lang===null) $lang=CLang::get();
return '<meta name="language" content="'.$lang.'"/><meta http-equiv="content-language" content="'.$lang.'"/>';
} | [
"private function getMetaLanguage() {\n\t\t$lang = '';\n\n\t\t$el = $this->article()->getDoc()->find( 'html[lang]' );\n\n\t\tif ( $el->count() ) {\n\t\t\t$lang = $el->first()->attr( 'lang' );\n\t\t}\n\n\t\tif ( empty( $lang ) ) {\n\t\t\t$selectors = [\n\t\t\t\t'html > head > meta[http-equiv=content-language]',\n\t\t\t\t'html > head > meta[name=lang]',\n\t\t\t];\n\n\t\t\tforeach ( $selectors as $selector ) {\n\t\t\t\t$el = $this->article()->getDoc()->find( $selector );\n\n\t\t\t\tif ( $el->count() ) {\n\t\t\t\t\t$lang = $el->first()->attr( 'content' );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( preg_match( '@^[A-Za-z]{2}$@', $lang ) ) {\n\t\t\treturn strtolower( $lang );\n\t\t}\n\n\t\treturn '';\n\t}",
"private function getMetaLanguage(): string {\n $lang = '';\n\n $el = $this->article()->getDoc()->find('html[lang]');\n\n if ($el->count()) {\n $lang = $el->first()->attr('lang');\n }\n\n if (empty($lang)) {\n $selectors = [\n 'html > head > meta[http-equiv=content-language]',\n 'html > head > meta[name=lang]',\n ];\n\n foreach ($selectors as $selector) {\n $el = $this->article()->getDoc()->find($selector);\n\n if ($el->count()) {\n $lang = $el->first()->attr('content');\n break;\n }\n }\n }\n\n if (preg_match('@^[A-Za-z]{2}$@', $lang)) {\n return strtolower($lang);\n }\n\n return '';\n }",
"public function getLangDefault(): string;",
"public function getDefaultLanguage();",
"function default_lang()\n\t{\n\t\tglobal $CFG;\n\t\t$lang = array_search($CFG->config['language'], $this->languages);\n\t\treturn $lang;\n\t}",
"protected function get_language_from_content() {\n\t\t// No language set for 404\n\t\tif ( is_404() || ( is_attachment() && ! $this->options['media_support'] ) ) {\n\t\t\treturn $this->get_preferred_language();\n\t\t}\n\n\t\tif ( $var = get_query_var( 'lang' ) ) {\n\t\t\t$lang = explode( ',', $var );\n\t\t\t$lang = $this->model->get_language( reset( $lang ) ); // Choose the first queried language\n\t\t}\n\n\t\telseif ( ( is_single() || is_page() || ( is_attachment() && $this->options['media_support'] ) ) && ( ( $var = get_queried_object_id() ) || ( $var = get_query_var( 'p' ) ) || ( $var = get_query_var( 'page_id' ) ) || ( $var = get_query_var( 'attachment_id' ) ) ) ) {\n\t\t\t$lang = $this->model->post->get_language( $var );\n\t\t}\n\n\t\telse {\n\t\t\tforeach ( $this->model->get_translated_taxonomies() as $taxonomy ) {\n\t\t\t\tif ( $var = get_query_var( get_taxonomy( $taxonomy )->query_var ) ) {\n\t\t\t\t\t$lang = $this->model->term->get_language( $var, $taxonomy );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter the language before it is set from the content\n\t\t *\n\t\t * @since 0.9\n\t\t *\n\t\t * @param bool|object $lang language object or false if none was found\n\t\t */\n\t\treturn apply_filters( 'pll_get_current_language', isset( $lang ) ? $lang : false );\n\t}",
"private function get_language()\n {\n // For user implementation\n }",
"protected function getCurrentSiteLanguage() : ?SiteLanguage {}",
"function language()\n\t{\n\t\tif(!empty($this->get['lang'])\n\t\t&& isset($this->translations[$this->get['lang']])) return $this->get['lang'];\n\n\t\tif(!empty($_SESSION['lang'])\n\t\t&& isset($this->translations[$_SESSION['lang']])) return $_SESSION['lang'];\n\n\t\tif(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])\n\t\t&& ($browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2))\n\t\t&& isset($this->translations[$browser_lang])) return $browser_lang;\n\n\t\tif($setting_lang = $this->setting('language')\n\t\t&& isset($this->translations[$setting_lang])) return $setting_lang;\n\n\t\treturn 'en';\n\t}",
"public function getLanguage();",
"function get_default_language() {\n $default = $this->options[DEFAULT_LANG];\n if (!isset(transposh_consts::$languages[$default])) {\n if (defined('WPLANG') && isset(transposh_consts::$languages[WPLANG])) {\n $default = WPLANG;\n } else {\n $default = \"en\";\n }\n }\n return $default;\n }",
"public function default_language() {\n\t\treturn $this->_config->get('default');\n\t}",
"protected function getLang() {\n\t\t$locale = $this->getField()->getLocale();\n\t\tif($this->getField()->getConfig('jslocale')) {\n\t\t\t// Undocumented config property for now, might move to the jQuery view helper\n\t\t\t$lang = $this->getField()->getConfig('jslocale');\n\t\t} else if(array_key_exists($locale, self::$locale_map)) {\n\t\t\t// Specialized mapping for combined lang properties\n\t\t\t$lang = self::$locale_map[$locale];\n\t\t} else {\n\t\t\t// Fall back to default lang (meaning \"en_US\" turns into \"en\")\n\t\t\t$lang = i18n::get_lang_from_locale($locale);\n\t\t}\n\t\t\n\t\treturn $lang;\n\t}",
"public function getLanguageMeta($lang)\n {\n return $this->langMeta[$lang];\n }",
"function app_get_lang() {\n return ($GLOBALS['language'] != 'fr' && !file_exists('lang/' . $GLOBALS['language'] . '.php')) ? $GLOBALS['language'] : 'fr';\n}",
"function hypha_getDefaultLanguage() {\n\t\tglobal $hyphaXml;\n\t\treturn $hyphaXml->documentElement->getAttribute('defaultLanguage');\n\t}",
"protected function lang() {\n // language attribute is only allowed when lang support is activated\n return (!empty($this->data['lang']) && c::get('lang.support')) ? $this->data['lang'] : false;\n }",
"function getDefaultLanguage() {\n global $gallery, $settings;\n\n\t// Gallery Language = ExiteCMS language\n\t$defaultLanguage = explode(\"|\",$settings['locales']);\n\t$defaultLanguage = $defaultLanguage[0];\n\t$gallery->app->default_language = $defaultLanguage;\n if(empty($gallery->app->default_language)) {\n $defaultLanguage = getBrowserLanguage();\n }\n return $defaultLanguage;\n}",
"public function getLang(): ?string\n {\n $langAttr = $this->getAttr('lang');\n\n if (null === $langAttr && $this->isCode()) {\n $langAttr = $this->getAttr('@value');\n }\n\n return $langAttr;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of message type permissions. | public function messageTypePermissions() {
$perms = [];
// Generate message permissions for all message types.
foreach (MessageType::loadMultiple() as $type) {
$perms += $this->buildPermissions($type);
}
return $perms;
} | [
"public function permissions() {\n $permissions = [];\n // Permission of all node types.\n $permissions += [\n 'generate docx using node to docx' => [\n 'title' => t('Generate docx for <strong>all content types</strong>'),\n ],\n ];\n // Permissions of every node type.\n $types = NodeType::loadMultiple();\n foreach ($types as $key => $type) {\n $permissions += [\n 'generate docx using node to docx: ' . $type->get('type') => [\n 'title' => t('Generate docx for content type <strong>%type_name</strong>', ['%type_name' => $type->get('name')]),\n ],\n ];\n }\n\n return $permissions;\n }",
"public function getPermissions(): array;",
"public function permissions() {\n $permissions = [];\n // Generate a permissions for every node type.\n $types = \\Drupal::entityTypeManager()\n ->getStorage('node_type')\n ->loadMultiple();\n foreach ($types as $type) {\n $permissions += $this->buildPermissions($type);\n }\n\n return $permissions;\n }",
"public function logTypePermissions() {\n $perms = array();\n // Generate log permissions for all log types.\n foreach (LogType::loadMultiple() as $type) {\n $perms += $this->buildPermissions($type);\n }\n\n return $perms;\n }",
"public abstract function getPermissionsArray();",
"public function missionTypePermissions() {\n $perms = [];\n foreach (MissionTypeEntity::loadMultiple() as $entity_type) {\n $perms += $this->buildPermissions($entity_type);\n }\n return $perms;\n }",
"public function semillaTypePermissions() {\n $perms = [];\n // Generate node permissions for all node types.\n foreach (SemillaType::loadMultiple() as $type) {\n $perms += $this->buildPermissions($type);\n }\n return $perms;\n }",
"public static function getAllPermissions() {\n return Database::getInstance()->fetch_all('SELECT typeid AS value, descr AS text FROM public.l_action\n ORDER BY descr ASC');\n }",
"public function rdfTypePermissions(): array {\n $perms = [];\n // Generate node permissions for all node types.\n foreach (RdfEntityType::loadMultiple() as $type) {\n $perms += $this->buildPermissions($type);\n }\n\n return $perms;\n }",
"public function eventPermissions() {\n $perms = [];\n\n foreach (LivingSpaceEventType::loadMultiple() as $type) {\n $perms += $this->buildPermissions($type);\n }\n\n return $perms;\n }",
"public static function getPermissions() {\n \t$table = Control::getTable('permissions');\n $perms = array();\n $rows = $table->getRows();\n foreach($rows as $row) {\n \t$perms[$row->name] = self::hasPermission($row->name);\n }\n $perms['is_user'] = self::isUser();\n return $perms;\n }",
"public function permissions() {\n $perms = array();\n // Generate view unpublished permissions for all node types.\n foreach (NodeType::loadMultiple() as $type) {\n $perms += $this->buildPermissions($type);\n }\n\n return $perms;\n }",
"public function getPermissions()\n\t{\n\t\tif(!$this->id)\n\t\t\treturn array();\n $role= UserRole::model()->getUserRole($this);\n if(!$role->role_id){\n return array();\n }\n\t\t$permissions = array();\n\t\t$sql = \"SELECT pa.ACTION_ID AS id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_ROLE.\"' and pm.principal_id = {$role->role_id}\";\n\t\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t\t$permissions[$permission['id']] = $permission['key'];\n\t\t\n\n\n\t\t// Direct user permission assignments\n\t\t$sql = \"select pa.ACTION_ID as id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_USER.\"' and pm.principal_id = {$this->id}\";\n\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t$permissions[$permission['id']] = $permission['key'];\n\n\n\t\treturn $permissions;\n\t}",
"public function getPermissions(string $role): array;",
"public function getPermissions()\n {\n $pattern = self::ALL_OFF;\n $length = strlen($pattern);\n $bitmask = str_pad(decbin($this->mask), $length, '0', STR_PAD_LEFT);\n\n $permissions = array();\n for ($i=$length-1; $i>=0; $i--) {\n if ('1' === $bitmask[$i]) {\n $permissions[] = 1 << ($length - $i - 1);\n }\n }\n\n return $permissions;\n }",
"public function permissions() {\n $permissions = [];\n\n foreach ($this->handlerManager->getDefinitions() as $id => $info) {\n $params = [\n '%type' => $info['label'],\n ];\n\n $permissions += [\n \"create $id places\" => [\n 'title' => $this->t('Create new %type places', $params),\n ],\n \"edit own $id places\" => [\n 'title' => $this->t('Edit own %type places', $params),\n ],\n \"edit any $id places\" => [\n 'title' => $this->t('Edit any %type places', $params),\n ],\n \"delete own $id places\" => [\n 'title' => $this->t('Delete own %type places', $params),\n ],\n \"delete any $id places\" => [\n 'title' => $this->t('Delete any %type places', $params),\n ],\n ];\n }\n\n return $permissions;\n }",
"public function nodeTypePermissions() {\n $perms = [];\n // Generate node permissions for all node types.\n foreach (NodeType::loadMultiple() as $type) {\n $perms += $this->buildPermissions($type);\n }\n\n return $perms;\n }",
"public function getRequiredPermissions() : array;",
"public function getPermissionArray() : array\n\t{\n\t\treturn $this->_permissionArray;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the UPC after testing validity. | public function setUPC(string $upc) : void
{
$this->upc = trim($upc);
try {
$this->validateUPC($upc);
} catch (\Exception $ex) {
echo $ex->getMessage();
return;
} catch (\Error $er) {
echo $er->getMessage();
return;
}
$this->upc = $upc;
} | [
"public function setUPC($value)\n {\n return $this->set('UPC', $value);\n }",
"public function getUPC()\n {\n return $this->uPC;\n }",
"public function testSetCodeUser() {\n\n $obj = new iEspaceClientDroits();\n\n $obj->setCodeUser(\"codeUser\");\n $this->assertEquals(\"codeUser\", $obj->getCodeUser());\n }",
"public function testSetCodeUser() {\n\n $obj = new iPaieDroits();\n\n $obj->setCodeUser(\"codeUser\");\n $this->assertEquals(\"codeUser\", $obj->getCodeUser());\n }",
"public function testSetCtrlAutoCp() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setCtrlAutoCp(true);\n $this->assertEquals(true, $obj->getCtrlAutoCp());\n }",
"public static function validate($upc) {\n\t\t$upc = trim($upc);\n\n\t\tif (!is_numeric($upc)) {\n\t\t\tthrow new UpcException\\UpcException('UPC Value can only contain numbers. UPC: ' .\n\t\t\t\t$upc, UpcException\\UpcException::CODE_CONTAINS_CHARACTERS);\n\t\t}\n\n\t\t// Expand UPC\n\t\t$upc = UpcEExpander::expand($upc);\n\t\t$length = strlen($upc);\n\n\t\tif (!$upc) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$checkDigit = UpcEValidator::getCheckDigit($upc);\n\t\treturn intval($upc[$length-1]) === intval($checkDigit);\n\t}",
"public function process($upc)\n\t{\n\t\t$this->upc = $upc;\n\n\t\t$this->prep_upc();\n\t\t$this->verify();\n\t\t$this->parse_upc();\n\t}",
"public function testUSERR3()\n {\n $this->fdxf->SetUSERR3('test');\n $test = $this->fdxf->GetUSERR3();\n $this->assertEquals('test', $test);\n }",
"public function testSetCodeAffilSecu() {\n\n $obj = new EmpDadsuPrevoyanceAyantDroit();\n\n $obj->setCodeAffilSecu(\"codeAffilSecu\");\n $this->assertEquals(\"codeAffilSecu\", $obj->getCodeAffilSecu());\n }",
"public function testSetMotifPreavisNonPaye() {\n\n $obj = new AttestationCacm();\n\n $obj->setMotifPreavisNonPaye(\"motifPreavisNonPaye\");\n $this->assertEquals(\"motifPreavisNonPaye\", $obj->getMotifPreavisNonPaye());\n }",
"public function sysLanguageUidCanBeSet()\n {\n $value = 3;\n $this->instance->setSysLanguageUid($value);\n $this->assertEquals($value, $this->instance->getSysLanguageUid());\n }",
"public function setCC()\n {\n }",
"public Function SetPCStatus() {\n\t\t\n\t\t$PlugID = $this->ReadPropertyInteger(\"FSM\"); \n\t\t$StatID = @IPS_GetObjectIDByName(\"STATE\", $PlugID);\n\t\t$plugState = GetValue($StatID);\n\t\t$user = $this->ReadPropertyString(\"user\"); \n\t\t$state = $this->GetValue(\"PC_State\");\n\t\t$PID = $this->ReadPropertyInteger(\"I_ID\");\n\t\t$I = Getvalue($PID);\n\t\t$Mode = $this->getvalue(\"Mode\");\n\t\t$I_high = $this->ReadPropertyInteger(\"limitUp\");\n\t\t$I_low = $this->ReadPropertyInteger(\"limitDown\");\n\t\t$this->SendDebug(\"SetPCStatus \".$user,\"Zykl. PC Statusabfrage.\");\n\t\t//IPS_LogMessage(\"MyPC\".$user, \"- Stromänderung erkannt \".$I);\n\t\t//Steckdose ist aus dann ist auch Rechner aus\n\t\tif(!$plugState){\n\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\" Rechner ist aus und Steckdose ist aus.\");\n\t\t\t$this->setValue(\"PC_State\", 0); //Rechner und Power aus\n\t\t\t$this->SetValue(\"PC_Switch\", false);\n\t\t}\n\t\telse{\n\t\t\t$this->SendDebug(\"SetPCStatus \".$user, \"Strom: \".$I. \"- Status: \".$state);\n\t\t\tif(($I>$I_high) & ($state != 4) & ($state != 1)) {\n\t\t\t\t//IPS_LogMessage(\"MyPC\".$user, \"- Stromänderung >600 erkannt- Rechner ist ON \");\n\t\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\"Strom>\".$I_high.\" und NOT Shutting down\");\n\t\t\t\t$this->setValue(\"PC_State\", 3); //Rechner ist hochgefahren\n\t\t\t\t$this->SetValue(\"PC_Switch\", true);\n\t\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\"setzte Rechner auf ON\");\n\t\t\t}\n\t\t\telseif(($I>$I_low) & ($state != 4) & ($state != 1) & ($state != 0)){\n\t\t\t\t\n\t\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\"Strom>\".$I_low.\" und Rechner fährt hoch\");\n\t\t\t\t$this->setValue(\"PC_State\", 2); //Rechner wird hochgefahren\n\t\t\t}\n\t\t\t//Strom is low and PC ist aus und im Auto mode\n\t\t\tif(($I<$I_low) & ($state == 1) & ($Mode)) {\n\t\t\t\tIPS_Sleep(1000);\n\t\t\t\t\n\t\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\"Strom<\".$I_low.\" erkannt- Rechner aus Power off.\");\n\t\t\t\t//Steckdose ausschalten\n\t\t\t\t$SwitchOnArray = IPS_GetVariable($this->ReadPropertyInteger(\"FSMState\"));\n\t\t\t\t$SwitchOnTime = $SwitchOnArray[\"VariableChanged\"];\n\t\t\t\t//falls Steckdose > 3min = 180sec an ist dann erst ausschalten\n\t\t\t\tif(time()> ($SwitchOnTime) + 180){\n\t\t\t\t\tHM_WriteValueBoolean($PlugID, \"STATE\", false);\n\t\t\t\t\t$this->setValue(\"PC_State\", 0); //Rechner und Power aus\n\t\t\t\t\t$this->SetValue(\"PC_Switch\", false);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif(($I<$I_low) & ($state == 4)){\n\t\t\t\tIPS_Sleep(3000);\n\t\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\"Strom<\".$I_low.\" und ist runtergefahren und ist aus.\");\n\t\t\t\t$this->setValue(\"PC_State\", 1); //Rechner ist aus und Power bleibt an\n\t\t\t\t$this->SetValue(\"PC_Switch\", false);\n\t\t\t}\n\n\n\t\t\t//Strom is low and PC steht länger als x sec in starting \n\t\t\tif(($I<$I_low) & ($state == 2)) {\n\t\t\t\t//waiting for 30 sec\n\t\t\t\tIPS_Sleep(30000);\n\t\t\t\tIf($I<$I_low) {\n\t\t\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\"Strom<\".$I_low.\" Rechner bleibt im starting Modus stecken.\");\n\t\t\t\t\t$this->setValue(\"PC_State\", 1); //Rechner ist aus und Power ist noch an\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t//Strom ist high und Status immer noch OFF \n\t\t\tif(($I>$I_high) & ($state == 1)) {\n\t\t\t\t//prüfen ob Rechner erreichbar\n\t\t\t\t$PCip = $this->ReadPropertyString(\"IP\");\n\t\t\t\t$net = $this->checkHost($PCip);\n\t\t\t\tif ($net){\n\t\t\t\t\t//Rechner-Netzwerkkarte ist erreichbar\n\t\t\t\t\t$this->setValue(\"PC_State\", 3); //Rechner und Power ist ein.\n\t\t\t\t\t$this->SetValue(\"PC_Switch\", true);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif($I < $I_low){\n\t\t\t\t$this->SendDebug(\"SetPCStatus\".$user,\"Strom ist <\".$I_low.\" -PC ist OFF.\");\n\t\t\t\t$this->setValue(\"PC_State\", 1); //Rechner ist aus.\n\t\t\t}\n\t\t}\n\t\treturn $I;\n\t}",
"public function testSetCodeAutreCouverture() {\n\n $obj = new EmpDadsuPrevoyanceAyantDroit();\n\n $obj->setCodeAutreCouverture(\"codeAutreCouverture\");\n $this->assertEquals(\"codeAutreCouverture\", $obj->getCodeAutreCouverture());\n }",
"public function SetPMTA() \n {\n $this->PMTA = $this->DB->GET('MUP.hardware.servers', ['id' => hostID], '*', 1);\n if (!$this->PMTA)\n trigger_error('Invalid PMTA!');\n }",
"public function testUcpPaymentMethodUpdate()\n {\n\n }",
"public function testUcpSecurityServiceResetPin()\n {\n\n }",
"public function testSetCtrlAutoCpAnticip() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setCtrlAutoCpAnticip(true);\n $this->assertEquals(true, $obj->getCtrlAutoCpAnticip());\n }",
"public function testSetCdeAutoManu() {\n\n $obj = new Clients();\n\n $obj->setCdeAutoManu(\"cdeAutoManu\");\n $this->assertEquals(\"cdeAutoManu\", $obj->getCdeAutoManu());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ check to see if followers row exists at all if it doesnt grab and save to db if it does check the date if its been less than 24 hours since last pull do nothing if its been 24 or more hours, pull and save | public function saveNewFollowers($twid,$pk_user,$oauthtoken,$oauthsecret) {
$twitFollowers = $this->dbcontroller->returnTwitterFollowers($twid,$pk_user);
if($twitFollowers) {
// followers row exists, check date
if($twitFollowers['lastupdate'] > strtotime("-1 day")) {
// been less than 24 hours since last check
// do nothing
} else {
// been 24 hours or more since last check, update
$ids = serialize($this->getTwitterFollowers($oauthtoken,$oauthsecret)); // retrieve
$this->dbcontroller->updateFollowers($twid,$pk_user,$ids,time()); // update
}
} else {
// no row for followers related to this twitter account exists, insert
$ids = serialize($this->getTwitterFollowers($oauthtoken,$oauthsecret)); // retrieve
if($ids) {
$this->dbcontroller->insertNewFollowers($twid,$pk_user,$ids,time()); // insert
}
}
} | [
"public function updateYoutubeFollowers()\n {\n $needUpdate = YoutubeFollowers::whereDate('updated_at', '<', Carbon::today()->subDays(3)->toDateString())\n ->orWhere('updated_at', null)\n ->limit(env('UPDATE_LIMIT'))\n ->get();\n if ($needUpdate) {\n foreach ($needUpdate as $item) {\n /** @var YoutubeFollowers $item */\n $item->checkUsername()->getYoutubeInformation()->touch();\n }\n }\n }",
"function twounter_followers($username) {\n\t global $wpdb;\n\t \n\t $sql = 'SELECT *\n\t FROM ' . $wpdb->prefix . 'twounter\n\t WHERE twounter_twitter_id = \"' . $username . '\"';\n\t $followers = $wpdb->get_results($sql);\n\t $now = strtotime(date('Y-m-d H:i:s'));\n\t $api_call = strtotime($followers[0]->twounter_time);\n\t $difference = $now - $api_call;\n\t $api_time_seconds = 18000;\n\t \n\t if(!$followers || $difference >= $api_time_seconds) {\n\t $api_page = 'http://twitter.com/users/show/' . $username;\n\t $xml = file_get_contents($api_page);\n\t \n\t $profile = new SimpleXMLElement($xml);\n\t \n\t $sql = 'INSERT into ' . $wpdb->prefix . 'twounter\n\t (twounter_twitter_id, twounter_followers, twounter_time)\n\t VALUES(\"' . $username . '\", ' . $profile->followers_count . ', \"' . date('Y-m-d H:i:s') . '\")';\n\t @$query = $wpdb->query($sql);\n\t \n\t if(!$query) {\n\t $sql = 'UPDATE ' . $wpdb->prefix . 'twounter \n\t SET twounter_followers = ' . $profile->followers_count . ',\n\t twounter_time = \"' . date('Y-m-d H:i:s') . '\" \n\t WHERE twounter_twitter_id = \"' . $username . '\"';\n\t $query = $wpdb->query($sql);\n\t }\n\t } else {\n\t $profile->followers_count = $followers[0]->twounter_followers;\n\t }\n\t \n\t return number_format($profile->followers_count);\n}",
"public function new_followers_update() {\n\t\t$retval = FALSE;\n\n\t\t$new_followers = $this->counts['followers_count']-$this->opt['new_followers_last_update_count'];\n\n\t\tif($new_followers>=$this->opt['new_followers_update_interval']) {\n\t\t\t$retval = $this->t->statuses_update($this->opt['new_followers_update_tweet']);\n\n\t\t\tif(!isset($retval['error'])) {\n\t\t\t\t$this->log($this->opt['twitter_screenname'].': Posted new followers update ('.$retval['id'].')');\n\t\t\t} else {\n\t\t\t\t$this->log($this->opt['twitter_screenname'].': Failed to post new followers update, '.$retval['error']);\n\t\t\t}\n\n\t\t\t$query = <<<EOQ\nUPDATE\n\t`groups`\nSET\n\t`new_followers_last_update_count`={$this->counts['followers_count']},\n\t`new_followers_last_update_ts=NOW()\nEOQ;\n\t\t\t$this->db->q($query);\n\t\t} else {\n\t\t\t$this->log($this->opt['twitter_screenname'].': Not enough new followers, Have: '.$this->counts['followers_count'].', Need: '.($this->counts['followers_count']+$this->opt['new_followers_update_interval']));\n\t\t}\n\n\t\treturn $retval;\n\t}",
"public function check_if_already_followed( $follower , $followed ) {\n\t\t\t\t// $followed = selectV1('*', 'fs_follow' , array('mno'=> intval($follwer),'operand1'=>'and','mno1'=> intval($follwed) ) ); \n\t\t\t\t$follower = intval($follower); \n\t\t\t\t$followed = intval($followed); \n\t\t\t\t// $followed = select_v3( 'fs_follow' , '*' , \" mno = $follower and mno1 = $followed \" ); \n\t\t\t\t$followed = select_v3( 'fs_follow' , '*' , \"mno = $follower and mno1 = $followed\" ); \n\t\t\t\t// print_r($followed);\n\t\t\treturn $followed;\n\n\t\t}",
"public function updateFollowers($args) {\n $user_id = (int)$args['user_id'];\n $user = new User($user_id);\n $access_token_id = $args['id'];\n \n $twitter = $this->inicializeTwitterSocializer($user_id, $args);\n\n $user->twitter_follower\n ->where('still_follow', true)\n ->where('access_token_id', $access_token_id)\n ->update([\n 'still_follow' => false\n ]);\n\n $answer = $twitter->get_followers();\n if ($answer->errors) {\n foreach($answer->errors as $err) {\n log_message('TASK_ERROR', __FUNCTION__ . 'Twitter error: code: '.$err->code.'. Message: ' . $err->message);\n }\n } else {\n $followersIds = $answer->ids;\n Twitter_follower::create()\n ->where_in('follower_id', $followersIds)\n ->where('user_id', $user_id)\n ->where('access_token_id', $access_token_id)\n ->update([\n 'unfollow_time' => null,\n 'still_follow' => true\n ]);\n $exists_followers_ids = Twitter_follower::create()\n ->where_in('follower_id', $followersIds)\n ->where('user_id', $user_id)\n ->where('access_token_id', $access_token_id)\n ->get()->all_to_array('follower_id');\n $new_followers_ids = [];\n foreach($exists_followers_ids as $exists_followers_id) {\n if(!in_array($exists_followers_id['follower_id'], $followersIds)) {\n $new_followers_ids[] = $exists_followers_id['follower_id'];\n }\n }\n foreach ($new_followers_ids as $new_followers_id) {\n $twitterFollower = new Twitter_follower();\n $twitterFollower->setFollowerId($new_followers_id);\n $twitterFollower->setUserId($user_id);\n if ($user->ifUserHasConfigValue('auto_send_welcome_message', $access_token_id)) {\n $twitterFollower->setNeedMessage(true);\n }\n if ($user->ifUserHasConfigValue('auto_follow', $access_token_id)) {\n $twitterFollower->setNeedFollow(true);\n }\n $twitterFollower->setStillFollow(true);\n $twitterFollower->setAccessTokenId($access_token_id);\n $twitterFollower->save();\n }\n\n $unfollowers_query = [\n 'still_follow' => false,\n 'unfollow_time' => null,\n 'start_follow_time' => null,\n 'end_follow_time' => null,\n 'access_token_id' => $access_token_id\n ];\n\n $new_unfollowers_count = $user->twitter_follower\n ->where($unfollowers_query)\n ->count();\n\n $user->twitter_follower\n ->where($unfollowers_query)\n ->update([\n 'unfollow_time' => time()\n ]);\n Social_analytics::updateAnalytics(\n $access_token_id,\n Social_analytics::NEW_UNFOLLOWERS_ANALYTICS_TYPE,\n $new_unfollowers_count\n );\n }\n }",
"function get_followed_notifications($uid) {\n $db = Db::dbc();\n try{\n $notifications = [];\n $sql = 'SELECT * FROM follows WHERE id_user_followed = :uid';\n $sth = $db->prepare($sql);\n $sth->execute(array(':uid'=>$uid));\n while ($row = $sth->fetch()) { \n $date = \\DateTime::createFromFormat('Y-m-j H:i:s', $row['DATE_CREATED']);\n $date_readed = ($row['DATE_READED']) ? \\DateTime::createFromFormat('Y-m-j H:i:s', $row['DATE_READED']) : null;\n array_push($notifications, (object) array(\n \"type\" => \"followed\", \n \"user\" => \\Model\\User\\get($row['ID_USER_FOLLOWER']),\n \"date\" => $date,\n \"reading_date\" => $date_readed\n ));\n } \n return $notifications;\n }catch(\\PDOException $e){\n print $e->getMessage();\n return null;\n }\n}",
"public function updateIssuesFollowed()\n\t{\n //Dont create new issue follow records for old follows\n\t\t\t//Make sure to delete issues un-checked that were previously followed\n\n\t\t\t$issues_already_followed = Auth::user()->issues;\t\t\t\n\t\t\t$issues_already_followed_array[] = array();\n\t\t\t\t\n\t\t\t$i = 0;\n\t\t\tforeach($issues_already_followed as $issue_followed)\n\t\t\t{\n\t\t\t\t$issues_already_followed_array[$i++] = $issue_followed->id;\n\n\t\t\t}\n\t\n\t\t\t$issues = Issue::all();\n\t\t\tforeach($issues as $issue)\n\t\t\t{\n\t\t\t\t$issue_checkbox = Input::get($issue->id);\n\t\t\t\tif(in_array($issue->id,$issues_already_followed_array))//if issue is already being followed\n\t\t\t\t{\n\t\t\t\t\tif (!(isset($issue_checkbox)))//issue was being followed previously. Now its unchecked/unfollowed\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*delete issue follow*/\n\t\t\t\t\t\t\t$issue_follow =IssueFollow::where('issue_id','=',$issue->id)\n\t\t\t\t\t\t\t\t\t->where('user_id','=',Auth::user()->id);\n\t\t\t\t\t\t\t$issue_follow->delete();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(isset($issue_checkbox))\n\t\t\t\t\t{\n\t\t\t\t\t\t$issue_follow = IssueFollow::create(array(\n\t\t\t\t\t\t'issue_id'=> $issue_checkbox,\n\t\t\t\t\t\t'user_id' => Auth::user()->id));\n\t\t\t\t\t\t$issue_follow->save();\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t//Redirect to login page - added to redirect to home upon successful account \n\t\t\treturn Redirect::route('edit-myprofile','#issues');//issues\n\n\n\n\t}",
"function follow() {\n\t\t\t$response = $this->API->call(\"users/follow.json\",array(\"target\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"user\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"function follow_user($me, $them){\n\t$count = check_count($me, $them);\t// use check_count to see if relationship exists\n\n\tif($count == 0){\t// relationship does not exist, add the relationship, else do nothing\n\t\t$sql = \"insert into following (user_id, follower_id) values ($them, $me)\";\n\t\t$result = mysql_query($sql);\n\t}\n}",
"public function insertFollowUp( ) {\n\n\n \t$timestamp= date(\"y/m/d H:i:s\", time()) ;\n\n\t$this->log->showLog(3,\"Inserting new followup $this->followup_name\");\n \t$sql=\"INSERT INTO $this->tablefollowup\n\t\t(\n\t\tfollowup_name,\n\t\tissuedate,\n\t\tcontactperson,\n\t\tnextfollowupdate,\n\t\tcontactnumber,\n\t\tfollowuptype_id,\n\t\tbpartner_id,\n\t\tdescription,\n\t\tcreated,\n\t\tcreatedby,\n\t\tupdated,\n\t\tupdatedby,\n\t\tisactive,\n employee_id\n )\n\n\tvalues(\n\t\t'$this->followup_name',\n\t\t'$this->issuedate',\n\t\t'$this->contactperson',\n\t\t'$this->nextfollowupdate',\n\t\t'$this->contactnumber',\n\t\t$this->followuptype_id,\n\t\t$this->bpartner_id,\n\t\t'$this->description',\n\t\t'$this->created',\n\t\t$this->createdby,\n\t\t'$this->updated',\n\t\t$this->updatedby,\n\t\t$this->isactive,\n $this->employee_id\n)\";\n $this->updatesql=$sql;\n\t\n $this->log->showLog(4,\"Before insert followup SQL:$sql\");\n\n\t$rs=$this->xoopsDB->query($sql);\n\n\tif (!$rs){\n\t\t$this->log->showLog(1,\"Failed to insert followup code $followup_name:\" . mysql_error() . \":$sql\");\n\t\treturn false;\n\t}\n\telse{\n\t\t$this->log->showLog(3,\"Inserting new followup $followup_name successfully\");\n\t\treturn true;\n\t}\n }",
"function twii_followerFeed($userid) {\n\t$posts = array();\n\n\t//GET the latest feed first\n\t/**\n\t\tmysql> SELECT DISTINCT twii_post.user_id, twii_post.body, twii_post.timestamp \n\t\t\tFROM twii_post \n\t\t\t\tINNER JOIN twii_follower \n\t\t\t\t\tON twii_post.user_id = twii_follower.follower_id \n\t\t\tWHERE twii_follower.user_id=1 \n\t\t\tORDER BY timestamp DESC;\n\t\t+---------+------------------------------------------------------+---------------------+\n\t\t| user_id | body | timestamp |\n\t\t+---------+------------------------------------------------------+---------------------+\n\t\t| 2 | Looking forward to thursday night football | 2013-09-03 23:47:30 |\n\t\t| 5 | Awesome weather in seattle today | 2013-09-03 23:47:05 |\n\t\t| 5 | Fedrer loses USOPEN chance | 2013-09-03 23:46:51 |\n\t\t| 4 | Fedrer loses USOPEN chance | 2013-09-03 23:46:46 |\n\t\t| 3 | Fedrer loses USOPEN chance | 2013-09-03 23:46:40 |\n\t\t| 3 | tiring trip to berkley adn return back. Took 3 hours | 2013-09-03 23:46:15 |\n\t\t| 2 | Saw rainbow today | 2013-09-03 23:45:47 |\n\t\t+---------+------------------------------------------------------+---------------------+\n\t\t7 rows in set (0.01 sec)\n\t*/\n\t$sql = \"SELECT DISTINCT twii_post.user_id, twii_post.body, twii_post.timestamp \n\t\t\tFROM twii_post\n\t\t\t\tINNER JOIN twii_follower \n\t\t\t\t\tON twii_post.user_id = twii_follower.follower_id\n\t\t\tWHERE twii_follower.user_id = $userid\n\t\t\tORDER BY timestamp DESC\";\n\t$result = mysql_query($sql);\n\t\n\t\n\twhile($data = mysql_fetch_object($result)){\n\t\t$posts[] = array( \t'timestamp' => $data->timestamp, \n\t\t\t\t\t\t\t'userid' => $userid, \n\t\t\t\t\t\t\t'body' => $data->body\n\t\t\t\t\t);\n\t}\n\treturn $posts;\n}",
"public function follow_user()\r\n {\r\n global $json_api;\r\n global $wpdb;\r\n \r\n $table_name = $wpdb->prefix.'users_follow';\r\n $follow_to = (int)$json_api->query->follow_to;\r\n $follow_by = (int)$json_api->query->follow_by;\r\n $cookie = $json_api->query->cookie;\t\r\n \r\n if(!$follow_to)\r\n {\r\n\t $json_api->error($this->_ErrorCode[230],230);\t\t\r\n }\r\n if(!$follow_by)\r\n {\r\n\t $json_api->error($this->_ErrorCode[223],223);\t\t\t\r\n }\r\n elseif($follow_to == $follow_by)\r\n {\r\n\t $json_api->error($this->_ErrorCode[232],232);\r\n }\r\n elseif( get_userdata( $follow_to ) === false)\r\n {\r\n\t$json_api->error($this->_ErrorCode[208],208); \r\n }\r\n elseif( get_userdata( $follow_by ) === false)\r\n {\r\n\t$json_api->error($this->_ErrorCode[208],208); \r\n }\r\n elseif(!$cookie)\r\n {\r\n\t $json_api->error($this->_ErrorCode[221],221);\r\n }\r\n elseif( wp_validate_auth_cookie($cookie, 'logged_in') != $follow_by)\r\n {\r\n\t$json_api->error($this->_ErrorCode[222],222); \r\n }\t\r\n else\r\n {\r\n\t $followTableData = array(\"id\"=>'',\"follow_to\"=>$json_api->query->follow_to,\"follow_by\"=>$json_api->query->follow_by);\r\n\t $wpdb->insert($table_name,$followTableData);\r\n\t if($wpdb->insert_id)\r\n\t {\r\n\t $response['msg'] = \"User has been added\";\r\n\t $response[\"code\"] = 200;\r\n\t }\r\n\t else\r\n\t {\r\n\t $json_api->error($this->_ErrorCode[236],236);\r\n\t }\r\n }\t\t\r\n return $response;\r\n }",
"function insertUnfollow()\n {\n $user = JFactory::getUser();\n $id_user = $user->id;\n $id_user_guest = $_POST['id_user_guest'];\n $db = JFactory::getDbo();\n $checklik = $this->checkFoolow();\n if (isset($checklik) AND !empty($checklik)) {\n $sql = \"update #__tz_pinboard_follow set folowing ='0' where id_user =$id_user AND id_guest =$id_user_guest\";\n\n } else if (empty($checklik)) {\n $sql = \"INSERT INTO #__tz_pinboard_follow VALUES(NULL,'0','\" . $id_user_guest . \"','\" . $id_user . \"') \";\n }\n $db->setQuery($sql);\n $db->query();\n }",
"public function followFollowers()\r\n {\r\n $this->debug('Checking for followers');\r\n \r\n $nbFollowers = 0;\r\n \r\n $limit = self::MAX_FOLLOWING;\r\n \r\n foreach ($this->client->getFollowers() as $follower)\r\n {\r\n if ($this->getBotAccountInfo('friends_count') >= $limit - $nbFollowers)\r\n {\r\n $this->debug('Max followers number reached, skipped mass following process');\r\n \r\n return 0;\r\n }\r\n \r\n if ($this->client->existsFriendship($this->getUsername(), $follower['screen_name']))\r\n {\r\n continue;\r\n }\r\n\r\n try\r\n {\r\n $this->client->createFriendship($follower['screen_name'], true);\r\n \r\n $this->debug(sprintf('Following new follower: \"%s\"', $follower['screen_name']));\r\n \r\n $nbFollowers++;\r\n }\r\n catch (Exception $e)\r\n {\r\n $this->debug(sprintf('Skipping following \"%s\": \"%s\"', $follower['screen_name'], $e->getMessage()));\r\n }\r\n }\r\n \r\n $this->debug(sprintf('%s follower%s added', 0 === $nbFollowers ? 'No' : (string) $nbFollowers, $nbFollowers > 1 ? 's' : ''));\r\n \r\n return $nbFollowers;\r\n }",
"private function check_in()\n\t{\n\t\t$q = $this->db->query('UPDATE grader SET last_activity=NOW() WHERE hostname=\"' . php_uname('n') . '\"');\n\t}",
"public function followup_reply_save()\n{\n $enquiry_id = $_POST['enquiry_id'];\n $followup_reply = $_POST['followup_reply'];\n $followup_date = $_POST['followup_date'];\n $followup_type = $_POST['followup_type'];\n $followup_status = $_POST['followup_status'];\n $followup_stage = $_POST['followup_stage'];\n\n $followup_stage = ($followup_status == 'Converted' && $followup_stage == '') ? 'Strong' : $followup_stage;\n $followup_stage = ($followup_status == 'Dropped' && $followup_stage == '') ? 'Cold' : $followup_stage;\n\n \n $followup_reply = addslashes($followup_reply);\n $sq_max = mysql_fetch_assoc(mysql_query(\"select max(entry_id) as max from enquiry_master_entries\"));\n $entry_id = $sq_max['max'];\n\n $created_at = date('Y-m-d H:i:s');\n $followup_date = date('Y-m-d H:i:s', strtotime($followup_date));\n\n $sq_entery_count = mysql_fetch_assoc(mysql_query(\"select * from enquiry_master_entries where enquiry_id='$enquiry_id'\"));\n $name = $sq_entery_count['name'];\n\n if($sq_entery_count['followup_reply']!=\"\"){\n $sq_followup = mysql_query(\"update enquiry_master_entries set status='False' where enquiry_id='$enquiry_id'\");\n }\n\n if($sq_entery_count['followup_reply']==\"\"){\n $sq_followup = mysql_query(\"update enquiry_master_entries set followup_reply='$followup_reply',followup_date='$followup_date',followup_type='$followup_type',followup_status='$followup_status', created_at='$created_at', followup_stage='$followup_stage' where enquiry_id='$enquiry_id'\");\n }\n else\n {\n $entry_id1 = $sq_max['max'] + 1;\n $sq_followup_add = mysql_query(\"insert into enquiry_master_entries(entry_id, enquiry_id, followup_reply, followup_status, followup_type, followup_date, followup_stage, created_at) values('$entry_id1', '$enquiry_id', '$followup_reply', '$followup_status','$followup_type', '$followup_date', '$followup_stage', '$created_at')\");\n \n \n $sq_entryids = mysql_query(\"update enquiry_master set entry_id='$entry_id1' where enquiry_id='$enquiry_id'\");\n }\n if($sq_followup_add or $sq_followup){\n\n if($followup_status==\"Converted\"){\n $this->send_enquiry_coverted_mail($enquiry_id);\n $sq_enq = mysql_fetch_assoc(mysql_query(\"select * from enquiry_master where enquiry_id='$enquiry_id'\"));\n $name = $sq_enq['name'];\n $this->enquiry_converted_sms_send($enquiry_id,$name);\n }\n\n echo \"Followup has been successfully saved\";\n exit;\n\n }\n else{\n echo \"error--Followup not saved successfully!\";\n exit;\n }\n\n}",
"function get_followed_notifications($uid) {\n try\n { \n $db = \\Db::dbc();\n $sql =\"SELECT IDU_USER2,FLOOKORNOT,FDATE FROM FOLLOW WHERE IDU_USER1='$uid'\";\n $sth=$db->prepare($sql);\n $sth->execute();\n $l=$sth->rowcount();\n if($l)\n {\n foreach($sth->fetchAll() as $row){\n $o=new \\DateTime($row['FDATE']);\n $List[]=(object) array(\n \"type\" => \"followed\",\n \"user\" =>\\Model\\User\\get($row['IDU_USER2']),\n \"date\" => $o,\n \"reading_date\" => $row['FLOOKORNOT']);\n }\n return $List;\n \n }\n else\n {\n return NULL;\n }\n }\ncatch(\\PDOException $e)\n{\necho $e->getMessage();\n} \n}",
"public function save() {\n\t\tglobal $wpdb, $bp;\n\n\t\t// do not use these filters\n\t\t// use the 'bp_follow_before_save' hook instead\n\t\t$this->leader_id = apply_filters( 'bp_follow_leader_id_before_save', $this->leader_id, $this->id );\n\t\t$this->follower_id = apply_filters( 'bp_follow_follower_id_before_save', $this->follower_id, $this->id );\n\n\t\tdo_action_ref_array( 'bp_follow_before_save', array( &$this ) );\n\n\t\t// update existing entry\n\t\tif ( $this->id ) {\n\t\t\t$result = $wpdb->query( $wpdb->prepare( \"UPDATE {$bp->follow->table_name} SET leader_id = %d, follower_id = %d WHERE id = %d\", $this->leader_id, $this->follower_id, $this->id ) );\n\n\t\t// add new entry\n\t\t} else {\n\t\t\t$result = $wpdb->query( $wpdb->prepare( \"INSERT INTO {$bp->follow->table_name} ( leader_id, follower_id ) VALUES ( %d, %d )\", $this->leader_id, $this->follower_id ) );\n\t\t\t$this->id = $wpdb->insert_id;\n\t\t}\n\n\t\tdo_action_ref_array( 'bp_follow_after_save', array( &$this ) );\n\n\t\treturn $result;\n\t}",
"public function update_on_date_less()\n {\n \n //check if the incomming entry time is less than the next entry time\n $time_is_less_checker = $this->entry_time_less_next();\n\n if (! $time_is_less_checker->success) {\n return $time_is_less_checker;\n }\n \n //update the current entry time\n $this->entry->entry_time = $this->request->entry_time;\n $this->entry->save();\n\n //update the duration of the next entry\n $next_entry = $this->nextEntry;\n $next_entry->entry_duration = diffSecond($this->entry->entry_time,$next_entry->entry_time);\n $next_entry->save();\n\n return to_object(['success' => true]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that pagination is rendering fine | public function testPagination()
{
// Pagination is currently set at 5
$articles = factory(Article::class, 6)->create();
$response = $this->get('admin/articles');
// Check for errors
$response->assertStatus(200);
// Check that there are 2 pages of results
$paginator = $response->original->content->getItems();
$this->assertEquals(2, $paginator->lastPage());
} | [
"public function testPagination()\n {\n // First page\n $data = $this->makeRequestCheckStatusAndReturnData('/api/urls/page/1/3');\n $this->assertEquals(3, count($data), 'Wrong page size for first page');\n\n // Second page (5 urls in fixtures, 2 items in second page)\n $data = $this->makeRequestCheckStatusAndReturnData('/api/urls/page/2/3');\n $this->assertEquals(2, count($data), 'Wrong page size for second page');\n\n // Third page (5 urls in fixtures, 0 items in third page)\n $data = $this->makeRequestCheckStatusAndReturnData('/api/urls/page/3/3');\n $this->assertEquals(0, count($data), 'Wrong page size for third page');\n\n // A different page size\n $data = $this->makeRequestCheckStatusAndReturnData('/api/urls/page/1/5');\n $this->assertEquals(5, count($data), 'The page should contain 5 items');\n\n // Big pagesize, no errors\n $data = $this->makeRequestCheckStatusAndReturnData('/api/urls/page/1/100');\n $this->assertEquals(5, count($data), 'The page should contain 5 items');\n }",
"public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/posts')\n ->assertSee('Posts Gestion')\n ->clickLink('2')\n ->assertSee('Post 1');\n });\n }",
"public function testRenderTableForPagination()\n {\n $settings = array(\n 'paginate' => 'foo'\n );\n\n $table = $this->getMockTableBuilder(array('setType', 'renderLayout'));\n\n $table->expects($this->once())\n ->method('setType')\n ->with(TableBuilder::TYPE_PAGINATE);\n\n $table->expects($this->once())\n ->method('renderLayout')\n ->with('default');\n\n $table->setSettings($settings);\n\n $table->renderTable();\n }",
"public function testGetPaginationList(): void\n {\n $this->getPaginationListTrait($this->datasets[0]['data'][0]);\n }",
"public function testListPostsPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/posts')\n ->assertSee('List Post');\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element) - 2;\n $this->assertTrue($number_page == ceil((self::NUMBER_RECORD_CREATE) / (self::RECORD_LIMIT)));\n });\n }",
"public function testV1ListPages()\n {\n\n }",
"public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }",
"public function testPagination()\n {\n $numberUser = 12;\n $this->makeUserLogin();\n $this->makeData($numberUser);\n $this->browse(function (Browser $browser) use ($numberUser) {\n $browser->loginAs(User::find(1))\n ->visit('/admin/users')\n ->assertSee('List Users');\n $elements = $browser->elements('.pagination li');\n $numberPage = count($elements) - 2;\n $this->assertTrue($numberPage == ceil($numberUser / (config('define.page_length'))));\n });\n }",
"public function testGetElementsForPage() {\n $this->assertCount($this->getExpectedElementsCountForPage(), $this->paginatorInstance->getElementsForPage(0));\n // Check we have 0 elements returned for a non existing page\n $this->assertCount(0, $this->paginatorInstance->getElementsForPage($this->getNonExistingPageIndex()));\n }",
"public function testGetPaginatedCallList()\n {\n }",
"public function testGetAllPagination()\n {\n $api = new Management(self::$env['API_TOKEN'], self::$env['DOMAIN']);\n $paged_results = $api->rules()->getAll(null, null, null, 0, 2);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertCount(2, $paged_results);\n\n // Second page of 1 result.\n $paged_results_2 = $api->rules()->getAll(null, null, null, 1, 1);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertCount(1, $paged_results_2);\n $this->assertEquals($paged_results[1]['id'], $paged_results_2[0]['id']);\n }",
"public function testGetWithPagination()\n {\n $expected_count = 2;\n\n $results_1 = self::$api->getAll([], 0, $expected_count);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertCount($expected_count, $results_1);\n\n $expected_page = 1;\n $results_2 = self::$api->getAll([], $expected_page, 1);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertCount(1, $results_2);\n $this->assertEquals($results_1[$expected_page]['client_id'], $results_2[0]['client_id']);\n $this->assertEquals($results_1[$expected_page]['audience'], $results_2[0]['audience']);\n }",
"public function testShowRecordPaginate()\n {\n factory(Category::class, 21)->create();\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/category')\n ->resize(1920, 2000)\n ->assertSee('List Categories');\n //Count row number in one page \n $elements = $browser->elements('#table-contain tbody tr');\n $this->assertCount(10, $elements);\n $this->assertNotNull($browser->element('.pagination'));\n\n //Count page number of pagination\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element)- 2;\n\n $this->assertTrue($number_page == 3);\n });\n }",
"public function testHasPages() {\n $this->assertEquals(7, $this->lists->pages());\n }",
"public function testListBooksPagination()\n {\n $this->makeData(self::NUMBER_RECORD_CREATE);\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/borrows');\n $elements = $browser->elements('#list-borrows tbody tr');\n $this->assertCount(config('define.borrows.limit_rows'), $elements);\n $this->assertNotNull($browser->element('.pagination'));\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element) - 2;\n $this->assertTrue($number_page == ceil((self::NUMBER_RECORD_CREATE + 1) / (config('define.borrows.limit_rows'))));\n });\n }",
"public function testHasPage() {\n $this->assertEquals(1, $this->lists->page());\n }",
"public function testCompoundLimitPage()\n {\n $this->todo('stub');\n }",
"public function testListCategoriesHavePagination()\n {\n $this->makeDataOfListCategories(15);\n $user = $this->makeAdminToLogin();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user)\n ->visit('/admin/categories')\n ->resize(900, 1600)\n ->assertSee('List Categories')\n ->click('.pagination li:nth-child(3) a');\n $elements = $browser->elements('#table-categories tbody tr');\n $this->assertCount(5, $elements);\n $browser->assertQueryStringHas('page', 2);\n $this->assertNotNull($browser->element('.pagination'));\n });\n }",
"public function testListPages()\n {\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/pagetest/list');\n // i should see why_songbird text\n $this->assertContains(\n 'why_songbird',\n $client->getResponse()->getContent()\n );\n // there should be 3 parent menus\n $nodes = $crawler->filterXPath('//div[@id=\"nestable\"]/ol');\n $this->assertEquals(count($nodes->children()), 3);\n\n // there should be 2 entries under the about menu\n $nodes = $crawler->filterXPath('//li[@data-id=\"2\"]/ol');\n $this->assertEquals(count($nodes->children()), 2);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the localized default questions and add them to an array. | protected function populateDefaultQuestions()
{
$defaultQuestions = [
'en' => array_values(Lang::get('manager/job_create', [], 'en')['questions']),
'fr' => array_values(Lang::get('manager/job_create', [], 'fr')['questions']),
];
if (count($defaultQuestions['en']) !== count($defaultQuestions['fr'])) {
Log::warning('There must be the same number of French and English default questions for a Job Poster.');
return;
}
$jobQuestions = [];
for ($i = 0; $i < count($defaultQuestions['en']); $i++) {
$jobQuestion = new JobPosterQuestion();
$jobQuestion->fill(
[
'en' => [
'question' => $defaultQuestions['en'][$i],
],
'fr' => [
'question' => $defaultQuestions['fr'][$i],
]
]
);
// Workaround for Default Questions with empty descriptions
// throwing an error during save.
// The id isn't actually used during the fillAndSaveJobPosterQuestions
// method call.
$jobQuestion->id = $i + 1;
$jobQuestions[] = $jobQuestion;
}
return $jobQuestions;
} | [
"public function get_default_question()\n {\n $question = array();\n $question[1]= get_lang('ObjectivesQuestions');\n $question[2]= get_lang('SkillToAcquireQuestions');\n $question[3]= get_lang('MethodologyQuestions');\n $question[4]= get_lang('InfrastructureQuestions');\n $question[5]= get_lang('AssessmentQuestions');\n\n return $question;\n }",
"protected function populateDefaultQuestions()\n {\n $defaultQuestions = [\n 'en' => array_values(Lang::get('manager/job_create', [], 'en')['questions']),\n 'fr' => array_values(Lang::get('manager/job_create', [], 'fr')['questions']),\n ];\n\n if (count($defaultQuestions['en']) !== count($defaultQuestions['fr'])) {\n Log::warning('There must be the same number of French and English default questions for a Job Poster.');\n return;\n }\n\n $jobQuestions = [];\n\n for ($i = 0; $i < count($defaultQuestions['en']); $i++) {\n $jobQuestion = new JobPosterQuestion();\n $jobQuestion->fill(\n [\n 'question' => [\n 'en' => $defaultQuestions['en'][$i],\n 'fr' => $defaultQuestions['fr'][$i],\n ]\n ]\n );\n $jobQuestions[] = $jobQuestion;\n }\n\n return $jobQuestions;\n }",
"public function getDefaultQuestion() {\n\t\t$question = array(\n\t\t\t'question_sequence' => 0,\n\t\t\t'question_value' => __d('quizzes', 'New Question') . '1',\n\t\t\t'question_type' => QuizzesComponent::TYPE_SELECTION,\n\t\t\t'is_choice_random' => QuizzesComponent::USES_NOT_USE,\n\t\t\t'is_choice_horizon' => QuizzesComponent::USES_NOT_USE,\n\t\t\t'is_order_fixed' => QuizzesComponent::USES_NOT_USE,\n\t\t\t'allotment' => self::QUIZ_QUESTION_DEFAULT_ALLOTMENT,\n\t\t\t'commentary' => '',\n\t\t);\n\t\t$question['QuizChoice'] = $this->QuizChoice->getDefaultChoice();\n\t\t$question['QuizCorrect'] = $this->QuizCorrect->getDefaultCorrect();\n\t\treturn $question;\n\t}",
"public function getDefaultQuestion() {\n\t\t$question = array(\n\t\t\t'question_sequence' => 0,\n\t\t\t'question_value' => __d('questionnaires', 'New Question') . '1',\n\t\t\t'question_type' => QuestionnairesComponent::TYPE_SELECTION,\n\t\t\t'is_require' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t'is_skip' => QuestionnairesComponent::SKIP_FLAGS_NO_SKIP,\n\t\t\t'is_choice_random' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t'is_range' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t'is_result_display' => QuestionnairesComponent::EXPRESSION_SHOW,\n\t\t\t'result_display_type' => QuestionnairesComponent::RESULT_DISPLAY_TYPE_BAR_CHART\n\t\t);\n\t\t$question['QuestionnaireChoice'][0] = $this->QuestionnaireChoice->getDefaultChoice();\n\t\treturn $question;\n\t}",
"public function getDefaultQuestion() {\n\t\t$this->QuestionnaireChoice = ClassRegistry::init('Questionnaires.QuestionnaireChoice', true);\n\t\t$question = array(\n\t\t\t'question_sequence' => 0,\n\t\t\t'question_value' => __d('questionnaires', 'New Question') . '1',\n\t\t\t'question_type' => QuestionnairesComponent::TYPE_SELECTION,\n\t\t\t'is_require' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t'is_skip' => QuestionnairesComponent::SKIP_FLAGS_NO_SKIP,\n\t\t\t'is_choice_random' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t'is_range' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t'is_result_display' => QuestionnairesComponent::EXPRESSION_SHOW,\n\t\t\t'result_display_type' => QuestionnairesComponent::RESULT_DISPLAY_TYPE_BAR_CHART\n\t\t);\n\t\t$question['QuestionnaireChoice'][0] = $this->QuestionnaireChoice->getDefaultChoice();\n\t\treturn $question;\n\t}",
"private function setQuestionsWithChoices()\n {\n return [\n [\n 'description' => 'What is the name of your company?',\n 'type' => 'short_text',\n 'form_label' => 'company_name',\n 'page' => 1,\n 'display_sequence' => 1,\n 'required' => 1,\n 'choices' => [],\n ],\n [\n 'description' => 'How soon are you thinking about getting started?',\n 'type' => 'single_response',\n 'form_label' => 'project_start',\n 'page' => 1,\n 'display_sequence' => 2,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => \"I'm ready to start now\",\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'In less than 30 days',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'More than 30 days from now',\n 'display_sequence' => 3,\n ],\n ],\n ],\n [\n 'description' => 'What is your zip code?',\n 'type' => 'short_text',\n 'form_label' => 'zip_code',\n 'page' => 1,\n 'display_sequence' => 3,\n 'required' => 1,\n 'choices' => [],\n ],\n [\n 'description' => 'What time is your business open?',\n 'type' => 'multiple_response',\n 'form_label' => 'business_hour',\n 'page' => 1,\n 'display_sequence' => 4,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Normal daytime hours',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'Morning and Late',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'We never close',\n 'display_sequence' => 3,\n ],\n ],\n ],\n [\n 'description' => 'What time of day would you like your team to work?',\n 'type' => 'multiple_response',\n 'form_label' => 'work_hour',\n 'page' => 1,\n 'display_sequence' => 5,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Overlap some with our morning hours',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'Overlap some with our evening hours',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'During the same hours we are open',\n 'display_sequence' => 3,\n ],\n [\n 'description' => 'Overnight so we can rest too',\n 'display_sequence' => 4,\n ],\n [\n 'description' => 'No Preference',\n 'display_sequence' => 5,\n ],\n ],\n ],\n [\n 'description' => 'What will your new team members do for you?',\n 'type' => 'multiple_response',\n 'form_label' => 'service_need',\n 'page' => 1,\n 'display_sequence' => 6,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Programming',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'Maintenance',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'QA Testing',\n 'display_sequence' => 3,\n ],\n [\n 'description' => 'Automation',\n 'display_sequence' => 4,\n ],\n [\n 'description' => 'Creative Stuff',\n 'display_sequence' => 5,\n ],\n [\n 'description' => 'Mobile App Development',\n 'display_sequence' => 6,\n ],\n [\n 'description' => 'Other',\n 'display_sequence' => 7,\n ],\n ],\n ],\n [\n 'description' => 'Do you see your needs as?',\n 'type' => 'multiple_response',\n 'form_label' => 'project_term',\n 'page' => 1,\n 'display_sequence' => 7,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Short-term, maybe more later.',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'Long term, I need to build a team!',\n 'display_sequence' => 2,\n ],\n ],\n ],\n [\n 'description' => 'What technology does/will your product or concept use?',\n 'type' => 'multiple_response',\n 'form_label' => 'tech_require',\n 'page' => 1,\n 'display_sequence' => 8,\n 'required' => 1,\n 'choices' => $this->skillChoices(),\n ],\n [\n 'description' => 'What stage is your company or product at?',\n 'type' => 'multiple_response',\n 'form_label' => 'product_status',\n 'page' => 1,\n 'display_sequence' => 9,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'We’ve been around for a while',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'Still gaining traction',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'Pre-revenue but we have something',\n 'display_sequence' => 3,\n ],\n [\n 'description' => 'Pre-everything',\n 'display_sequence' => 4,\n ],\n [\n 'description' => 'Other',\n 'display_sequence' => 5,\n ],\n ],\n ],\n [\n 'description' => 'Do you currently have a:',\n 'type' => 'multiple_response',\n 'form_label' => 'current_resource',\n 'page' => 1,\n 'display_sequence' => 10,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Product Manager',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'Product Owner',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'Lead Developer',\n 'display_sequence' => 3,\n ],\n [\n 'description' => 'None',\n 'display_sequence' => 4,\n ],\n ],\n ],\n [\n 'description' => 'Have you worked with remote teams before?',\n 'type' => 'single_response',\n 'form_label' => 'remote_team_exp',\n 'page' => 1,\n 'display_sequence' => 11,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Yes',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'No',\n 'display_sequence' => 2,\n ],\n ],\n ],\n [\n 'description' => 'What types? (If yes)',\n 'type' => 'multiple_response',\n 'form_label' => 'remote_team_exp_type',\n 'page' => 1,\n 'display_sequence' => 12,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Developers',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'Virtual Assistant',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'Designer',\n 'display_sequence' => 3,\n ],\n [\n 'description' => 'Call Center',\n 'display_sequence' => 4,\n ],\n [\n 'description' => 'Others',\n 'display_sequence' => 5,\n ],\n ],\n ],\n [\n 'description' => 'What country was your remote team in?',\n 'type' => 'multiple_response',\n 'form_label' => 'remote_team_exp_country',\n 'page' => 1,\n 'display_sequence' => 13,\n 'required' => 1,\n 'choices' => [\n [\n 'description' => 'Philippines',\n 'display_sequence' => 1,\n ],\n [\n 'description' => 'India',\n 'display_sequence' => 2,\n ],\n [\n 'description' => 'Eastern Europe',\n 'display_sequence' => 3,\n ],\n [\n 'description' => 'South America/Mexico',\n 'display_sequence' => 4,\n ],\n [\n 'description' => 'Others',\n 'display_sequence' => 5,\n ],\n ],\n ],\n ];\n }",
"public function provideGenericQuestions(): array\n {\n $questions = [\n new FeedbackQuestion(\n 'Essen',\n 'Essen (Qualität)',\n 'Das Essen hat meistens gut geschmeckt.',\n 'Das Essen war nicht gut.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'ce7990d4-c4be-3532-925a-ec8e9d5ade0e'\n ),\n new FeedbackQuestion(\n 'Essen',\n 'Essen (Menge)',\n 'Es gab meistens genug zu essen.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'ce7990d4-c4be-3532-925a-ec8e9d5ade0f'\n ),\n new FeedbackQuestion(\n '',\n 'Wiederholen',\n 'Wenn ich könnte, würde ich beim nächstes Mal wieder dabei sein wollen.',\n 'Auch wenn noch mal mit dürfte, möchte beim nächsten Mal ich nicht kommen.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '9f28a002-4d72-306d-86be-165b476bdc7e'\n ),\n new FeedbackQuestion(\n '',\n 'Mitbestimmung',\n 'Ich konnte selbst mitbestimmen und meine Meinung wurde gehört.',\n 'Ich durfte (z.B. beim Programm) nicht mitreden und mitentscheiden.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '75e81f95-3bff-3741-9c96-11eb9db6f73a'\n ),\n new FeedbackQuestion(\n '',\n 'Langeweile',\n 'Ich habe mich oft gelangweilt.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '71d043fa-33fc-3e7c-af4e-01cd72bbe2f3'\n ),\n new FeedbackQuestion(\n 'Mitarbeitende',\n 'Mitarbeitende (Nett)',\n 'Die meisten Mitarbeitenden waren überwiegend freundlich und nett.',\n 'Die Mitarbeitenden waren unfreundlich.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '2e2d8d02-ca9d-38dc-bcba-dd911702c5c4'\n ),\n new FeedbackQuestion(\n 'Mitarbeitende',\n 'Mitarbeitende (Hilfe)',\n 'Ich habe Mitarbeitende gefunden, denen ich vertrauen konnte und die mir bei Problemen halfen.',\n 'Ich konnte keinem der Mitarbeitenden richtig vertrauen.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'c6fee88d-31e8-3cfb-90f6-bcdd8667ac55'\n ),\n new FeedbackQuestion(\n '',\n 'Einsamkeit',\n 'Ich habe mich manchmal einsam gefühlt.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '8cc30a44-5d9b-3847-a9f4-3b29245dc6c6'\n ),\n new FeedbackQuestion(\n '',\n 'Heimweh',\n 'Ich hatte manchmal Heimweh.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n 'f3195a8b-ec76-338d-b5ff-1481161c95fe'\n ),\n new FeedbackQuestion(\n 'Ärger',\n 'Ärger (Gruppe)',\n 'Es gab oft Ärger und Streit in unserer Gruppe.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '1228109e-ca0d-39db-a374-4db811e91101'\n ),\n new FeedbackQuestion(\n 'Ärger',\n 'Ärger (selbst)',\n 'Ich wurde viel geärgert.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '57262d4e-efd6-33cf-bce4-1e626deb3ecd'\n ),\n new FeedbackQuestion(\n '',\n 'Strenge',\n 'Die Regeln waren zu streng.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEGATIVE,\n '7568094e-7440-33c4-bbeb-8e9d5626568d'\n ),\n new FeedbackQuestion(\n '',\n 'Freunde',\n 'Ich habe neue Freundinnen & Freunde kennengelernt.',\n 'Ich habe niemanden gefunden, mit dem ich mich gut verstanden habe.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '55bd8739-296c-3eee-8a52-acc9c71f8ea2'\n ),\n new FeedbackQuestion(\n '',\n 'Zufriedenheit',\n 'Ich habe viele schöne Erlebnisse gehabt.',\n 'Die meiste Zeit hat mir nicht gefallen.',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n 'af77b5e1-7b6f-361e-9915-ad535d716c47'\n ),\n new FeedbackQuestion(\n '',\n 'Gruppe',\n 'Ich habe mich in der Gruppe wohlgefühlt.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '075186ac-2dcf-31da-8fbc-efda67cff4f9'\n ),\n new FeedbackQuestion(\n '',\n 'Selbstreflexion',\n 'Ich habe oft über mich selbst nachgedacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '3201b6ce-c64f-3035-8986-f33c7b6517e3'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Angebot',\n 'Ich habe gerne beim Programm (die Aktionen, die Spiele) mitgemacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '1a0313ab-57a5-33ad-9c77-6bf4cfbc1943'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Bewegung',\n 'Ich habe mich viel bewegt & Sport gemacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_POSITIVE,\n '97a56947-c11e-3ac8-b69e-10f316e0e0fd'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Mehr Ausflüge',\n 'Ich hätte mir mehr Ausflüge oder Unternehmungen gewünscht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '58fe375c-893e-3153-bde2-d9326b0d9b54'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Mehr Sport',\n 'Ich hätte mir mehr Sportangebote gewünscht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '8c93f812-ca5f-39a8-b190-93e2ee737fd2'\n ),\n new FeedbackQuestion(\n 'Programm',\n 'Mehr Musik',\n 'Ich hätte gern mehr gesungen und Musik gemacht.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '7681e805-6212-3892-89e9-191f1603aaad'\n ),\n new FeedbackQuestion(\n '',\n 'Erstes Mal',\n 'Ich war zum ersten Mal mit euch auf Freizeit.',\n '',\n FeedbackQuestion::TYPE_AGREEMENT,\n FeedbackQuestion::INTERPRETATION_NEUTRAL,\n '9e1d87f9-b9dc-3ac8-bded-638b97a67e07'\n ),\n ];\n\n $result = [];\n /** @var FeedbackQuestion $question */\n foreach ($questions as $question) {\n $result[$question->getUuid()] = $question;\n }\n return $result;\n }",
"public function getCustomQuestions()\n {\n if (array_key_exists(\"customQuestions\", $this->_propDict)) {\n return $this->_propDict[\"customQuestions\"];\n } else {\n return null;\n }\n }",
"protected function _getDefaultQuestionnaire($addData) {\n\t\t$questionnaire = array();\n\t\t$questionnaire['Questionnaire'] = array_merge(\n\t\t\tarray(\n\t\t\t\t'block_id' => Current::read('Block.id'),\n\t\t\t\t'title' => '',\n\t\t\t\t'key' => '',\n\t\t\t\t'status' => WorkflowComponent::STATUS_IN_DRAFT,\n\t\t\t\t'is_total_show' => QuestionnairesComponent::EXPRESSION_SHOW,\n\t\t\t\t'answer_timing' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t\t'is_key_pass_use' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t\t'total_show_timing' => QuestionnairesComponent::USES_NOT_USE,\n\t\t\t),\n\t\t\t$addData);\n\n\t\t$questionnaire['QuestionnairePage'][0] = $this->QuestionnairePage->getDefaultPage($questionnaire);\n\t\treturn $questionnaire;\n\t}",
"public function getQuestions();",
"public function getAllQuestions() : array;",
"protected function dummyQuestion(): array {\n return [\n 'dependencies' => [\n 'starter_kits' => 'acquia_cms_enterprise_low_code',\n ],\n 'question' => \"Please provide the Site Studio Organization Key\",\n 'warning' => \"The Site Studio Organization key is not set. The Site Studio packages won't get imported.\\nYou can set the key later from: /admin/cohesion/configuration/account-settings to import Site Studio packages.\",\n ];\n }",
"function getAnswers() {\n\t\t// Declare array and ensure it is empty\n\t\t$questions = array(NULL, NULL, NULL);\n\n\t\t$questions[0] = $_POST[\"Political-Party\"];\n\t\t$questions[1] = $_POST[\"Direction\"];\n\t\t$questions[2] = $_POST[\"Candidate\"];\n\t\t$questions[3] = $_POST[\"Watch-Debate\"];\n\t\t$questions[4] = $_POST[\"Changed-Vote\"];\n\t\t$questions[5] = $_POST[\"Age\"];\n\t\t$questions[6] = $_POST[\"Race\"];\n\t\t$questions[7] = $_Post[\"Gender\"];\n\n\t\t// Make like a leaf\n\t\treturn $questions;\n\t}",
"public function getListDefaultTranslate(): array;",
"public static function emptyAnswers () {\n return [\n ['text' => '', 'correct' => false],\n ];\n }",
"function loadQuestions()\n {\n $Template = new Template($this->template_id);\n $this->template_name = $Template->name;\n $questionsObj = $Template->questions;\n\n foreach($questionsObj as $Question)\n {\t\t\n $Question->loadPositions();\n $this->questions[$Question->id] = array('text'=>$Question->text,\n\t\t\t\t\t 'type'=>$Question->type,\n\t\t\t\t\t 'qualitative_type'=>$Question->qualitative_type,\n\t\t\t\t\t\t 'opt_out'=>$Question->opt_out,\n\t\t\t\t\t 'position'=>$Question->positions[$this->template_id]);\n if($Question->answers_exist)\n {\n\tforeach($Question->answers as $Answer)\n\t{\n\t $answers[$Answer->id] = $Answer->text;\n\t}\n\t$this->questions[$Question->id]['answers'] = $answers;\n\tunset($answers);\n }\n }\n return TRUE;\n }",
"function security_questions_array_1(){\r\n\t\t$questions = array(\r\n\t\t\t'sq-1'\t=>\t__( \"What was the house number and street name you lived in as a child?\", 'user-registration-aide' ),\r\n\t\t\t'sq-2'\t=>\t__( \"What were the last four digits of your childhood telephone number?\", 'user-registration-aide' ),\r\n\t\t\t'sq-3'\t=>\t__( \"What primary school did you attend?\", 'user-registration-aide' ),\r\n\t\t\t'sq-4'\t=>\t__( \"In what town or city was your first full time job?\", 'user-registration-aide' ),\r\n\t\t\t'sq-5'\t=>\t__( \"In what town or city did you meet your spouse/partner?\", 'user-registration-aide' ),\r\n\t\t\t'sq-6'\t=>\t__( \"What is the middle name of your oldest child?\", 'user-registration-aide' ),\r\n\t\t\t'sq-7'\t=>\t__( \"What are the last five digits of your driver's licence number?\", 'user-registration-aide' ),\r\n\t\t\t'sq-8'\t=>\t__( \"What is your grandmother's (on your mother's side) maiden name?\", 'user-registration-aide' ),\r\n\t\t\t'sq-9'\t=>\t__( \"What is your spouse or partner's mother's maiden name?\", 'user-registration-aide' ),\r\n\t\t\t'sq-10'\t=>\t__( \"In what town or city did your mother and father meet?\", 'user-registration-aide' ),\r\n\t\t\t'sq-11'\t=>\t__( \"What is the name of your first school?\", 'user-registration-aide' )\r\n\t\t);\r\n\t\treturn $questions;\r\n\t}",
"function get_questions()\n{\n $quiz_questions = array();\n $fact_questions = get_2_facts_questions();\n for ($i = 0; $i < sizeof($fact_questions); $i++)\n array_push($quiz_questions, $fact_questions[$i]);\n array_push($quiz_questions, get_world_wonder_questions());\n array_push($quiz_questions, get_flag_question());\n array_push($quiz_questions, get_coastline_question());\n \n return ($quiz_questions);\n}",
"public static function getAllQuestionsAndAnswers(){\n $returnArray = array(\n 'Result' => 1,\n 'Reason' => \"\",\n 'QuestionResponses' => array()\n );\n\n $questionObjects = question::getAllQuestions();\n\n if(count($questionObjects) > 0){\n $responsesArray = self::buildQuestionsAndAnswersArray_Admin($questionObjects);\n $returnArray['QuestionResponses'] = $responsesArray;\n }\n else{\n $returnArray['Result'] = 0;\n $returnArray['Reason'] = \"No questions were found\";\n }\n\n return $returnArray;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SSO data is set, we may have a valid postback | public function HandlePostback(){
$SSO_Data = base64_decode($_POST[self::POST_KEY]);
$SSO_Data = Crypto::decryptPublic($SSO_Data, $this->public_key);
$SSO_Data = json_decode($SSO_Data);
if($SSO_Data == NULL) throw new SSONoTokenError("No valid data sent");
$this->saveData($SSO_Data);
return $SSO_Data;
} | [
"function processPageData() {\n\n $this->cookieOk = $this->utility->checkAuthCookie($this->cookieArray);\n\n if ($this->cookieOk == 1) {\n\n $this->weeks = $this->utility->getWeeks();\n $this->years = $this->utility->getYears();\n\n $this->processPostData();\n\n $this->payrollData = $this->dataLayer->getPayrollData($this->weekSelected, $this->yearSelected);\n\n }\n else {\n $this->cookieNotOkText = $this->utility->getCookieNotOkText();\n }\n\n }",
"private function checkPostValues()\n {\n if (isset($_SESSION['POST'])) {\n $this->postValues = $_SESSION['POST'];\n unset($_SESSION['POST']);\n } else {\n $this->postValues = \"\";\n }\n\n }",
"public function onLoadFromSession()\n {\n \n $data = TSession::getValue('form_data_observacao');\n $this->form->setData($data);\n }",
"public function onLoadFromSession()\n {\n $data = TSession::getValue('form_data_acidente');\n \n $this->form->setData($data);\n }",
"public function setFormSessionData(): void;",
"public function submitted_form_data() {\n\t\tif ( isset( $_COOKIE['bp-docs-submit-data'] ) ) {\n\t\t\t$this->submitted_data = json_decode( stripslashes( $_COOKIE['bp-docs-submit-data'] ) );\n\t\t\tsetcookie( 'bp-docs-submit-data', '', time() - 24*60*60, '/' );\n\t\t}\n\t}",
"public function setOnLoginRequest()\n {\n if($this->request->get('email') && $this->request->get('password')) {\n $email = $this->request->get('email');\n $password = $this->request->get('password');\n\n $query = \\Database::$pdo->prepare(\"SELECT * FROM users WHERE email = ?\");\n $query->execute(array($email));\n $user = $query->fetch();\n if($user && \\ModuleSSO::verifyPasswordHash($password, $user['password'])) {\n $this->setOrUpdateSSOCookie($user['id']);\n $this->generateTokenAndRedirect($user);\n } else {\n Messages::insert('Login failed, please try again', 'warn');\n $this->showLoginForm();\n }\n } else if($this->request->get(\\ModuleSSO::LOGIN_KEY)) {\n if($user = $this->getUserFromCookie()) {\n $this->generateTokenAndRedirect($user);\n } else {\n Messages::insert('Login failed, please try again', 'warn');\n $this->showLoginForm();\n }\n }\n else if ($this->request->get(\\ModuleSSO::RELOG_KEY)){\n $this->showLoginForm();\n }\n else {\n $this->showHTML();\n }\n }",
"private function doLoginWithPostData()\n {\n if ($this->checkLoginFormDataNotEmpty())\n $this->checkPasswordCorrectnessAndLogin();\n }",
"public function InitIsValidPost() \r\n\t{\t\t\r\n\t\t$sVar = (isset($_POST['__SVar']) ? $_POST['__SVar'] : ( isset($_GET['__SVar']) ? $_GET['__SVar'] : \"\" ));\r\n\r\n\t\t$this->isValidPost = ($sVar == $_SESSION['myHiddenVar']);\r\n\r\n\t\tSession::SessionInit($mySessionVar);\r\n\r\n\t\treturn $this->isValidPost;\r\n\t}",
"public function setAuthData($data){\n\t\t\tsession_start();\n\t\t\t$_SESSION['auth']=$data['auth'];\n\t\t\t$_SESSION['role']=$data['role'];\n\t\t\t$_SESSION['user']=$data['user'];\n\t\t}",
"private function _setNeedValidateData()\n {\n if (!empty($this->_config['data'])) {\n $this->_data = $this->_config['data'];\n\n return;\n }\n\n $method = strtoupper($this->_config['method']);\n if (in_array($method, $this->_allowMethod)) {\n $data = [];\n switch ($method) {\n case 'GET' :\n $data = $_GET;\n break;\n\n case 'POST' :\n $data = $_POST;\n break;\n\n case 'GET_POST' :\n $data = array_merge($_GET, $_POST);\n break;\n }\n unset($data['r']);\n $this->_data = $data;\n }\n }",
"public function _beforeSave()\n\t{\n\t\tif ('apikey' != $this->getData('field')) {\n\t\t\treturn;\n\t\t}\n\t\tif (!$this->isValueChanged()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$devkey = $this->getValue();\n\t\t\n\t\ttry {\n\t\t\t$sdk = Mage::helper('sso/sdk')->get(); \n\t\t\t$response = $sdk->getClient()->callRest(\n\t\t\t\t'rest/svcIntegration',\n\t\t\t\tarray(\n\t\t\t\t\t'action' => 'getInfo',\n\t\t\t\t\t'devkey' => $devkey,\n\t\t\t\t\t'output' => 'json',\n\t\t\t\t)\n\t\t\t);\n\t\t} catch (Exception $e) {\n\t\t\tMage::throwException('Error fetching devkey information. Please try again.');\n\t\t}\n\t\t\n\t\tMage::register('onesite_sso_integration', $response);\t\n\t}",
"private function setData()\n\t{\n\t\t$this->data = [\n\t\t\t'nonce' => sanitize_text_field($_POST['wpduel-nonce']),\n\t\t\t'duel_id' => sanitize_text_field($_POST['duel_id']),\n\t\t\t'vote' => sanitize_text_field($_POST['vote'])\n\t\t];\n\t}",
"function loadFormValues()\n\t{\n\t\tif($this->hasFormValues())\n\t\t{\n\t\t\t$p = $_SESSION['mgrFormValues'];\n\t\t\tforeach($p as $k=>$v)\n\t\t\t{\n\t\t\t\t$_POST[$k]=$v;\n\t\t\t}\n\t\t\t$this->clearSavedFormValues();\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}",
"protected function setValidData($data)\n {\n $validatorName = get_class($this);\n\n $_SESSION['__ZF']['VALID'][$validatorName] = $data;\n }",
"public function setFormData($data)\n {\n $_SESSION['formData'] = $data;\n }",
"private function doLoginWithPostData()\n {\n if ($this->checkLoginFormDataNotEmpty()) {\n if ($this->createDatabaseConnection()) {\n $this->checkPasswordCorrectnessAndLogin();\n }\n }\n }",
"private function doLoginWithPostData() {\n if ($this->checkLoginFormDataNotEmpty()) {\n if ($this->createDatabaseConnection()) {\n $this->checkPasswordCorrectnessAndLogin();\n }\n }\n }",
"private static function _initViewData()\n {\n static::addViewData(\n [\n 'ajax_url' => UKMDesign::getAjaxUrl(),\n 'is_super_admin' => function_exists('is_super_admin') ? is_super_admin() : false,\n 'UKMDesign' => new UKMDesign(),\n 'singleMode' => ((isset($_POST['singleMode']) && 'true' == $_POST['singleMode']) || (isset($_GET['singleMode']) && 'true' == $_GET['singleMode'])),\n 'hideTopImage' => ((isset($_POST['hideTopImage']) && 'true' == $_POST['hideTopImage']) || (isset($_GET['hideTopImage']) && 'true' == $_GET['hideTopImage']))\n ]\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for patchNamespacedDaemonSet . | public function testPatchNamespacedDaemonSet()
{
} | [
"public function testPatchExtensionsV1beta1NamespacedDaemonSet()\n {\n\n }",
"public function testPatchNamespacedDeployment()\n {\n }",
"public function testPatchNamespacedConfigMap()\n {\n }",
"public function testPatchNamespacedReplicaSetScale()\n {\n }",
"public function testDeleteCollectionNamespacedDaemonSet()\n {\n }",
"public function testPatchNamespacedDeploymentScale()\n {\n }",
"public function testPatchNamespacedPolicy()\n {\n\n }",
"public function testPatchNamespacedPodStatus()\n {\n }",
"public function testPatchCoreV1NamespacedPod()\n {\n\n }",
"public function testProxyCoreV1PATCHNamespacedPod()\n {\n\n }",
"public function testConnectPatchNamespacedPodProxy()\n {\n }",
"public function testProxyPATCHNamespacedPod()\n {\n }",
"public function testPatchNamespacedReplicationController()\n {\n }",
"public function testPatchCoreV1NamespacedEvent()\n {\n\n }",
"public function testPatchNamespacedBuild()\n {\n\n }",
"public function testReplaceNamespacedReplicaSet()\n {\n }",
"public function testPatchNamespacedEndpoints()\n {\n }",
"public function testReplaceNamespacedReplicaSetStatus()\n {\n }",
"public function testReplaceNamespacedServiceStatus()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Do the work of the example 1. Call the envelope documents list method | private function worker(array $args): EnvelopeDocumentsResult
{
# 1. call API method
# Exceptions will be caught by the calling function
$envelope_api = $this->clientService->getEnvelopeApi();
try {
$results = $envelope_api->listDocuments($args['account_id'], $args['envelope_id']);
} catch (ApiException $e) {
$this->clientService->showErrorTemplate($e);
exit;
}
return $results;
} | [
"public function listAction()\n {\n $this->view->pageTitle = \"Document List\";\n \n $service = new App_Service_DocumentService();\n $this->view->docs = $service->getDocuments();\n \n $this->setPartial();\n }",
"public function getDocuments()\n {\n # GET /accounts/{accountId}/envelopes/{envelopeId}/documents\n }",
"public function get_document_list() {\n $returnArr['status'] = '0';\n $returnArr['response'] = '';\n try {\n\t\t\t$documentsArr = array();\n\t\t\t$getDocuments = $this->app_model->get_all_details(DOCUMENTS,array('status' =>\"Active\"));\n\t\t\tif($getDocuments->num_rows()>0){\n\t\t\t\tforeach($getDocuments->result() as $doc){\n\t\t\t\t\t$documentsArr[] = array(\"id\"=>(string)$doc->_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"=>(string)$doc->name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"category\"=>(string)$doc->category,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_req\"=>(string)$doc->hasReq,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_exp\"=>(string)$doc->hasExp\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$returnArr['status'] = '1';\n\t\t\t$returnArr['response'] = array(\"documents\"=>$documentsArr);\n } catch (MongoException $ex) {\n $returnArr['response'] = $this->format_string(\"Error in connection\", \"error_in_connection\");\n }\n $json_encode = json_encode($returnArr, JSON_PRETTY_PRINT);\n echo $this->cleanString($json_encode);\n }",
"public function getDocuments();",
"function requestDocumentPDFsExSample() {\n global $api;\n global $AccountID;\n\n // Create and send an envelope\n $env = createBasicEnvelope($AccountID, \"request documents pdfs ex sample\");\n $env = createEnvelopeWithDocumentAndTabs($env);\n $createAndSendEnvelopeparams = new CreateAndSendEnvelope();\n $createAndSendEnvelopeparams->Envelope = $env;\n $createResult = $api->CreateAndSendEnvelope($createAndSendEnvelopeparams)->CreateAndSendEnvelopeResult;\n\n\n // Send\n $requestDocumentPDFsExparams = new RequestDocumentPDFsEx();\n $requestDocumentPDFsExparams->EnvelopeID = $createResult->EnvelopeID;\n $response = $api->RequestDocumentPDFsEx($requestDocumentPDFsExparams);\n\n return $response;\n}",
"public function tutorDocumentList(){// stateless\n $this->_model=new DisplayDocumentModel();\n $this->_model->getAll();\n $formArray = $this->getValuesFromModelToForm();\n $this->buildBodyView($formArray);\n $this->sendModelView('DisplayDocument');\n }",
"public function action_documents()\n\t{\n\t\tif (HTTP_Request::GET == $this->request->method()) { \n $objToArr = function($obj) {\n return $obj->as_array();\n };\n\n\t\t\t$docs = array_map(\n $objToArr,\n\t\t\t\tORM::factory('File')->get_files_by_type('application/pdf')->as_array()\t\t\n\t\t\t);\n\n\t\t\tfor ($i = 0; $i < count($docs); $i++)\n\t\t\t{\n\t\t\t\t$docs[$i]['link'] = UPLOADDIR.'/'.UPLOADPDFDIR.'/'.$docs[$i]['filename'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->template->result = $docs;\n\t\t}\n\t}",
"public function testClientVerificationDocumentList()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testListDocuments()\n {\n }",
"protected function listAction()\n {\n $this->dispatch(EasyAdminMongoOdmEvents::PRE_LIST);\n\n $fields = $this->document['list']['fields'];\n $paginator = $this->mongoOdmFindAll($this->document['class'], $this->request->query->get('page', 1), $this->document['list']['max_results'], $this->request->query->get('sortField'), $this->request->query->get('sortDirection'));\n\n $this->dispatch(EasyAdminMongoOdmEvents::POST_LIST, ['paginator' => $paginator]);\n\n $parameters = [\n 'paginator' => $paginator,\n 'fields' => $fields,\n // RESTRICTED_ACTIONS 'delete_form_template' => $this->createDeleteForm($this->document['name'], '__id__')->createView(),\n ];\n\n return $this->executeDynamicMethod('render<DocumentName>Template', ['list', $this->document['templates']['list'], $parameters]);\n }",
"public function documentlist()\n {\n if (!$this->getRequest()->getVar('pageID')) {\n return $this->httpError(400);\n }\n\n $page = SiteTree::get()->byId($this->getRequest()->getVar('pageID'));\n\n if ($page && $page->getAllDocuments()->count() > 0) {\n $list = '<ul>';\n\n foreach ($page->getAllDocuments() as $document) {\n $list .= sprintf(\n '<li><a class=\"add-document\" data-document-id=\"%s\">%s</a></li>',\n $document->ID,\n $document->ID . ' - '. Convert::raw2xml($document->Title)\n );\n }\n\n $list .= '</ul>';\n\n return $list;\n }\n\n return sprintf(\n '<p>%s</p>',\n _t('DMSDocumentAddController.NODOCUMENTS', 'There are no documents attached to the selected page.')\n );\n }",
"public function testListAllDocuments()\n {\n }",
"public function getDocuments() {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\t$documents = Documents::where('id_user', $user->id)->where('status', '1')->get(['id', 'folio', 'location', 'type', 'alias', 'notes', 'subtype', 'picture_path', 'expedition', 'expiration', 'created_at']);\n\n\t\t\tif($documents->count()) {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\"message\" => \"Listado de documentos\",\n\t\t\t\t\t\"response\" => array(\"documents\" => $documents)\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 202,\n\t\t\t\t\t\"message\" => \"No se encontraron documentos\",\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}",
"private function worker($args)\n {\n $envelope_args = $args[\"envelope_args\"];\n # 1. Create the envelope JSON request object\n $envelope_JSON = $this->make_envelope_JSON($envelope_args);\n\n # 2. Gather documents and their headers\n # Read files 2 and 3 from a local directory\n # The reads could raise an exception if the file is not available!\n # Note: the files are not binary encoded!\n $demo_docs_path = __DIR__ . '/../public/demo_documents/';\n $doc2_docx_bytes = file_get_contents($demo_docs_path . $GLOBALS['DS_CONFIG']['doc_docx']);\n $doc3_pdf_bytes = file_get_contents($demo_docs_path . $GLOBALS['DS_CONFIG']['doc_pdf']);\n\n $documents = [\n ['mime' => \"text/html\", 'filename' => $envelope_JSON['documents'][0]['name'],\n 'document_id' => $envelope_JSON['documents'][0]['documentId'],\n 'bytes' => $this->create_document1($envelope_args)],\n ['mime' => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n 'filename' => $envelope_JSON['documents'][1]['name'],\n 'document_id' => $envelope_JSON['documents'][1]['documentId'],\n 'bytes' => $doc2_docx_bytes],\n ['mime' => \"application/pdf\", 'filename' => $envelope_JSON['documents'][2]['name'],\n 'document_id' => $envelope_JSON['documents'][2]['documentId'],\n 'bytes' => $doc3_pdf_bytes]\n ];\n\n # Step 3. Create the multipart body\n $CRLF = \"\\r\\n\";\n $boundary = \"multipartboundary_multipartboundary\";\n $hyphens = \"--\";\n\n $req_body = \"\"\n . $hyphens . $boundary\n . $CRLF . \"Content-Type: application/json\"\n . $CRLF . \"Content-Disposition: form-data\"\n . $CRLF\n . $CRLF . json_encode($envelope_JSON, JSON_PRETTY_PRINT);\n\n # Loop to add the documents.\n # See section Multipart Form Requests on page\n # https://developers.docusign.com/esign-rest-api/guides/requests-and-responses\n foreach ($documents as $d) {\n $content_disposition = \"Content-Disposition: file; filename=\\\"{$d['filename']}\\\";\" .\n \"documentid={$d['document_id']}\";\n $req_body .= $CRLF . $hyphens . $boundary\n . $CRLF . \"Content-Type: {$d['mime']}\"\n . $CRLF . $content_disposition\n . $CRLF\n . $CRLF . $d['bytes'];\n }\n # Add closing $boundary\n $req_body .= $CRLF . $hyphens . $boundary . $hyphens . $CRLF;\n\n # Step 2. call Envelopes::create API method\n # using Guzzle https://guzzle.readthedocs.io/en/latest/index.html\n $client = new \\GuzzleHttp\\Client();\n $uri = \"{$args['base_path']}/v2/accounts/{$args['account_id']}/envelopes\";\n $results = $client->request('POST', $uri, [\n 'headers' => [\n 'Authorization' => \"bearer {$args['ds_access_token']}\",\n 'Accept' => 'application/json',\n 'Content-Type' => \"multipart/form-data; boundary={$boundary}\"\n ],\n 'body' => $req_body\n ]);\n $json_results = json_decode((string)$results->getBody());\n\n return ['envelope_id' => $json_results->envelopeId];\n }",
"public function documentAction() {\r\n $id = $this->getParam(\"id\");\r\n $success = false;\r\n\r\n try {\r\n if ($this->isGet()) {\r\n $doc = Document::getById($id);\r\n if (!$doc) {\r\n $this->encoder->encode(array( \"success\" => false,\r\n \"msg\" => \"Document does not exist\",\r\n \"code\" => self::ELEMENT_DOES_NOT_EXIST));\r\n return;\r\n }\r\n\r\n $this->checkPermission($doc, \"get\");\r\n\r\n if ($doc) {\r\n $type = $doc->getType();\r\n $getter = \"getDocument\" . ucfirst($type) . \"ById\";\r\n\r\n if (method_exists($this->service, $getter)) {\r\n $object = $this->service->$getter($id);\r\n } else {\r\n // check if the getter is implemented by a plugin\r\n $class = \"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Document\\\\\" . ucfirst($type) . \"\\\\Out\";\r\n if (class_exists($class)) {\r\n Document\\Service::loadAllDocumentFields($doc);\r\n $object = Webservice\\Data\\Mapper::map($doc, $class, \"out\");\r\n } else {\r\n throw new \\Exception(\"unknown type\");\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n if (!$object) {\r\n throw new \\Exception(\"could not find document\");\r\n }\r\n @$this->encoder->encode(array(\"success\" => true, \"data\" => $object));\r\n return;\r\n } else if ($this->isDelete()) {\r\n $doc = Document::getById($id);\r\n if ($doc) {\r\n $this->checkPermission($doc, \"delete\");\r\n }\r\n $success = $this->service->deleteDocument($id);\r\n $this->encoder->encode(array(\"success\" => $success));\r\n return;\r\n } else if ($this->isPost() || $this->isPut()) {\r\n $data = file_get_contents(\"php://input\");\r\n $data = \\Zend_Json::decode($data);\r\n\r\n $type = $data[\"type\"];\r\n $id = null;\r\n $typeUpper = ucfirst($type);\r\n $className = \"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Document\\\\\" . $typeUpper . \"\\\\In\";\r\n\r\n if ($data[\"id\"]) {\r\n $doc = Document::getById($data[\"id\"]);\r\n if ($doc) {\r\n $this->checkPermission($doc, \"update\");\r\n }\r\n\r\n $isUpdate = true;\r\n $setter = \"updateDocument\" . $typeUpper;\r\n if (!method_exists($this->service, $setter)) {\r\n throw new \\Exception(\"method does not exist \" . $setter);\r\n }\r\n $wsData = self::fillWebserviceData($className, $data);\r\n $success = $this->service->$setter($wsData);\r\n\r\n } else {\r\n $setter = \"createDocument\" . $typeUpper;\r\n if (!method_exists($this->service, $setter)) {\r\n throw new \\Exception(\"method does not exist \" . $setter);\r\n }\r\n $wsData = self::fillWebserviceData($className, $data);\r\n $doc = new Document();\r\n $doc->setId($wsData->parentId);\r\n $this->checkPermission($doc, \"create\");\r\n\r\n $id = $this->service->$setter($wsData);\r\n\r\n }\r\n\r\n if (!$isUpdate) {\r\n $success = $id != null;\r\n }\r\n\r\n if ($success && !$isUpdate) {\r\n $this->encoder->encode(array(\"success\" => $success, \"id\" => $id));\r\n } else {\r\n $this->encoder->encode(array(\"success\" => $success));\r\n }\r\n return;\r\n\r\n }\r\n\r\n } catch (\\Exception $e) {\r\n $this->encoder->encode(array(\"success\" => false, \"msg\" => (string) $e));\r\n }\r\n $this->encoder->encode(array(\"success\" => false));\r\n }",
"function loadDocList() {\n\t\treturn $this->content->loadDocList();\n\t}",
"public function listdocumentAction()\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 $document = new Application_Model_EuDocumentMapper();\n $this->view->entries = $document->fetchAll50($sessionutilisateur->code_source_create, $sessionutilisateur->code_monde_create, $sessionutilisateur->code_zone_create, $sessionutilisateur->id_pays, $sessionutilisateur->id_region, $sessionutilisateur->code_secteur_create, $sessionutilisateur->code_agence_create);\n\n $this->view->tabletri = 1;\n\n }",
"public function allDocs()\n {\n $docs = Doc::where(['owner_id' => Auth::id()])->orderBy('updated_at', 'desc')->get();\n return (new SuccessResponse($docs))->send();\n }",
"public function listdocumentAction()\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('layoutpublicesmcadmin');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n $document = new Application_Model_EuDocumentMapper();\n $this->view->entries = $document->fetchAll50($sessionutilisateur->code_source_create, $sessionutilisateur->code_monde_create, $sessionutilisateur->code_zone_create, $sessionutilisateur->id_pays, $sessionutilisateur->id_region, $sessionutilisateur->code_secteur_create, $sessionutilisateur->code_agence_create);\n\n $this->view->tabletri = 1;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether the transaction id is valid. | public function check_txn_id(Detail\IPNTransaction $transaction): bool
{
return true;
} | [
"protected function _validateTransactionID()\n {\n return ($this->request->getModuleCode() !== NULL AND $this->request->getTransactionID() !== NULL );\n }",
"function isTransactionIDValid($txn_idFromPaypal) {\n\t$conn = Doctrine_Manager::connection(); \n\t$query = \"SELECT txn_id from payment WHERE txn_id = '\".$txn_idFromPaypal.\"'\";\n\t$result = $conn->fetchOne($query); \n\t\n\tif(!isEmptyString($result)){ \n\t\t// an error occured while processing the query\n\t\tsendTestMessage(\"Paypal Transaction ID \".$txn_idFromPaypal.\" already exists!!\", \"Query: \".$query.\", <br>Error: \");\n\t\treturn false;\n\t} else {\n\t\t// if there are no rows returned then txn_id has not been used before and is therefore valid.\t\n\t\treturn true;\n\t}\n}",
"public function ValidId()\r\n\t{\r\n\t\t$id = (int)$this->GetId();\r\n\t\tif ($id > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function checkTransId()\n {\n if (!$this->getResponse()->getXTransId()) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('Please enter a transaction ID to authorize this payment.')\n );\n }\n return true;\n }",
"public function isValidId($id)\n {\n return false;\n }",
"public function validateId(){\n \n return preg_match(Config::$id_format, $this->id);\n }",
"public function isValidId ($id) {\r\n return $id != null && $id > 0;\r\n }",
"protected function hasID($transaction)\n {\n return (int)$transaction->id > 0;\n }",
"protected function checkID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_ID) && $this->_ID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_ID} is not a valid value for ID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}",
"function isValid() {\n return( BitBase::verifyId( $this->mContentId ) );\n }",
"public static function checkId(string $id): bool\n {\n // If strlen is incorrect, then return error\n $len = \\strlen($id);\n return ($len !== 24 || $len !== 12);\n }",
"public function test_validate_row_id_invalid()\n {\n\t\t// Genders is a small table so it's fast to test.\n \t$actual = $this->obj->validate_row_id(\"genders\", $this->invalid_id_int);\n\t\t$expected = FALSE;\n $this->assertEquals($expected, $actual);\n }",
"protected static function _isValidId($id)\n {\n $validator = new P4_Validate_ChangeNumber;\n return $validator->isValid($id);\n }",
"public function isValidId($id) {\n\t\treturn is_numeric($id) && $id >= 0 && $id <= 199;\n\t}",
"function verify_id()\n\t{\n\t\tlog_debug(\"inc_taxes\", \"Executing verify_id()\");\n\n\t\tif ($this->id)\n\t\t{\n\t\t\t$sql_obj\t\t= New sql_query;\n\t\t\t$sql_obj->string\t= \"SELECT id FROM `account_taxes` WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t\t$sql_obj->execute();\n\n\t\t\tif ($sql_obj->num_rows())\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\n\t}",
"private function checkTransID($transaction_id, $client_id) {\n\t\tLoader::loadModels($this, array(\"Transactions\"));\n\n\t\t$transaction = $this->Transactions->getByTransactionId($transaction_id, $client_id);\n\n\t\tif ($transaction) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function validate_id(string $id): bool {\n //check if not a name is given instate of an id\n if( !($this->nameisfree($id)) ) {\n if( !(ctype_xdigit($id)) or strlen($id)!==12 ) {\n return false;\n }\n return false;\n\t\t}\n return true;\n\t}",
"protected function validateTransactionId(array $response)\n {\n return !empty($response[self::TRANSACTION_ID]);\n }",
"function validateVatId() {\n\t\t\n\t\t// Obtain the checker class\n\t\trequire_once(t3lib_extMgm::siteRelPath($this->extKey) . \"classes/euvatchecker_class.php\");\n\n\t\t// Creating object of checker class\n\t\t$vat = new EUVATChecker(t3lib_extMgm::siteRelPath($this->extKey) . \"res/data_vat.xml\", t3lib_extMgm::siteRelPath($this->extKey) . \"res/error_vat.xml\", t3lib_extMgm::siteRelPath($this->extKey) . \"res/ok_vat.xml\", \"en\");\n\t\t// Initializing variables\n\t\t$vatIdSubmitted = $_SESSION['tx_netzrezepteaddress_ust_id_no'];\n\n\t\tif($vatIdSubmitted != '') {\n\t\t\t$response = \nfile_get_contents('http://www.apilayer.net/api/validate?access_key='.$this->vatlayerAPIKEY.'&vat_number='.$vatIdSubmitted.'&format=1'); \n\t\t\t$vatlayer = json_decode($response);\n\t\t\tif($vatlayer->valid == 1){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif($vat->check($vatIdSubmitted)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif($vat->getLastError() == 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the lines | public function getLines(); | [
"public function getAllLines()\n\t{\n\n\t\t$lines = array();\n\t\t$lines[1] = $this->line1 ? $this->line1 : \"\";\n\t\t$lines[2] = $this->line2 ? $this->line2 : \"\";\n\t\t$lines[3] = $this->line3 ? $this->line3 : \"\";\n\t\t$lines[4] = $this->line4 ? $this->line4 : \"\";\n\t\t$lines[5] = $this->line5 ? $this->line5 : \"\";\n\t\treturn $lines;\n\t}",
"public function getLines() : array;",
"public function readerGetLines();",
"function getLines() {\n\n\t\t$retval = array(\n\t\t\t\"metadata\" => array(\n\t\t\t\t\"_comment\" => \"All train lines\",\n\t\t\t\t),\n\t\t\t\"data\" => $this->lines,\n\t\t\t);\n\n\t\treturn($retval);\n\n\t}",
"public function readLines()\n {\n }",
"public function readAllLines(): iterable;",
"private function get_lines() {\r\n $data = \"\";\r\n while(!feof($this->smtp_conn)) {\r\n $str = @fgets($this->smtp_conn, 515);\r\n if($this->do_debug >= 4) {\r\n echo \"SMTP -> get_lines(): \\$data was \\\"$data\\\"\" . $this->CRLF . '<br />';\r\n echo \"SMTP -> get_lines(): \\$str is \\\"$str\\\"\" . $this->CRLF . '<br />';\r\n }\r\n $data .= $str;\r\n if($this->do_debug >= 4) {\r\n echo \"SMTP -> get_lines(): \\$data is \\\"$data\\\"\" . $this->CRLF . '<br />';\r\n }\r\n // if 4th character is a space, we are done reading, break the loop\r\n if(substr($str, 3, 1) == \" \") { break; }\r\n }\r\n return $data;\r\n }",
"public function getTextLines()\n\t{\n\t\treturn Container::filterValues($this->lines,\n\t\t\tfunction ($line) {\n\t\t\t\treturn (\\strpos($line, '@') !== 0);\n\t\t\t});\n\t}",
"private function read_lines()\n {\n return $array = file($this->filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n }",
"private function get_lines() {\n $data = \"\";\n while($str = @fgets($this->smtp_conn,515)) {\n if($this->do_debug >= 4) {\n echo \"SMTP -> get_lines(): \\$data was \\\"$data\\\"\" . $this->CRLF . '<br />';\n echo \"SMTP -> get_lines(): \\$str is \\\"$str\\\"\" . $this->CRLF . '<br />';\n }\n $data .= $str;\n if($this->do_debug >= 4) {\n echo \"SMTP -> get_lines(): \\$data is \\\"$data\\\"\" . $this->CRLF . '<br />';\n }\n // if 4th character is a space, we are done reading, break the loop\n if(substr($str,3,1) == \" \") { break; }\n }\n return $data;\n }",
"private function get_lines() {\n\t $data = \"\";\n\t while($str = @fgets($this->smtp_conn,515)) {\n\t if($this->do_debug >= 4) {\n\t echo \"SMTP -> get_lines(): \\$data was \\\"$data\\\"\" . $this->CRLF . '<br />';\n\t echo \"SMTP -> get_lines(): \\$str is \\\"$str\\\"\" . $this->CRLF . '<br />';\n\t }\n\t $data .= $str;\n\t if($this->do_debug >= 4) {\n\t echo \"SMTP -> get_lines(): \\$data is \\\"$data\\\"\" . $this->CRLF . '<br />';\n\t }\n\t // if 4th character is a space, we are done reading, break the loop\n\t if(substr($str,3,1) == \" \") { break; }\n\t }\n\t return $data;\n\t}",
"public function getTransactionLines()\n {\n return array_slice($this->getLines(), 0, -1);\n }",
"public function getLines()\n {\n $lines = explode(PHP_EOL, $this->comment);\n\n $wrapper = function($line)\n {\n return new Line($line);\n };\n\n return array_map($wrapper, $lines);\n }",
"public function getLinesAndClear(): array\r\n {\r\n $lines = $this->getLines();\r\n $this->clearLines();\r\n\r\n return $lines;\r\n }",
"private function read_lines()\n {\n if (!empty($this->filename))\n {\n $handle = fopen ($this->filename, 'r');\n $contents = fread($handle, filesize($this->filename));\n fclose($handle);\n $array_contents = explode(PHP_EOL, $contents);\n return $array_contents; \n }\n else\n {\n return array();\n } \n \n }",
"private function readLines() {\n\n $todo_array = [];\n\n if (filesize($this->filename) == 0) {\n return $todo_array;\n } else {\n $handle = fopen($this->filename, 'r');\n $contents = trim(fread($handle, filesize($this->filename)));\n $contentsarray = explode(\"\\n\", $contents);\n fclose($handle);\n\n return $contentsarray;\n }\n }",
"protected static function getLines($buffer) { \r\n $lines = preg_split(\"/\\r?\\n|\\r/\", $buffer);\r\n return $lines;\r\n }",
"public function readLines()\n {\n if ($this->getFileObject()->isFile()) {\n if ($this->skipEmptyLines) {\n // skip empty lines\n $lines = file($this->getFileObject()->getPathname(), FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);\n } else {\n $lines = file($this->getFileObject()->getPathname(), FILE_IGNORE_NEW_LINES);\n }\n\n if (is_array($lines)) {\n return $lines;\n }\n }\n return array();\n }",
"public function readAllWithoutDuplicatedLines(){\t\t\r\n\t\t$content = $this->readAllAsArray();\r\n\t\t$result = array();\r\n\t\tforeach ($content as $key => $line) {\r\n\t\t\tif(!in_array($line, $result)){\r\n\t\t\t\t$result[] = $line;\t\r\n\t\t\t}\t\r\n\t\t}\r\n\t\treturn $result;\t\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'crmTasksIdGet' | protected function crmTasksIdGetRequest($id)
{
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling crmTasksIdGet'
);
}
$resourcePath = '/crm/tasks/{id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($id !== null) {
$resourcePath = str_replace(
'{' . 'id' . '}',
ObjectSerializer::toPathValue($id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
if($headers['Content-Type'] === 'application/json') {
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass) {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
// array has no __toString(), so we should encode it manually
if(is_array($httpBody)) {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
}
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('api-key');
if ($apiKey !== null) {
$headers['api-key'] = $apiKey;
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('partner-key');
if ($apiKey !== null) {
$headers['partner-key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function activityTaskTaskIdGetRequest($task_id)\n {\n // verify the required parameter 'task_id' is set\n if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_id when calling activityTaskTaskIdGet'\n );\n }\n\n $resourcePath = '/activity/task/{task_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'task_id' . '}',\n ObjectSerializer::toPathValue($task_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 []\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 // 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 }",
"public function getTask($task_id);",
"public function gettask($id);",
"public function createTask($id){\n $post_data = [\n \"data\" => [\n [\n \"Description\" => $id['description'],\n \"Who_Id\" => [\n \"name\" => \"Kris Marrier (Sample)\",\n \"id\" => \"4789250000000317209\"\n ],\n \"Status\" => \"Not Started\",\n \"Due_Date\" => \"2021-05-15\",\n \"Priority\" => \"Low\",\n '$editable' => \"1\",\n \"Subject\" => $id['subject'],\n '$se_module' => \"Deals\",\n \"What_Id\" => [\n \"id\" => $id['id']\n ]\n ]\n ],\n 'trigger' => [\n \"approval\",\n \"workflow\",\n \"blueprint\"\n ]\n ];\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, \"https://www.zohoapis.com/crm/v2/Tasks\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Authorization:Zoho-oauthtoken ' . $this->generate_access_token(),\n 'Content-Type: application/x-www-form-urlencoded'));\n\n $response = curl_exec($ch);\n $response = json_decode($response);\n return $response;\n }",
"function get_tasks()\n{\n\t$url = SD_HOST . '/api/task?filterid=2814&fields=Id,StatusId,Changed';\n\treturn curl_auth_send($url, SD_USER);\n}",
"public function getExternalTaskRequest($id)\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 getExternalTask'\n );\n }\n\n $resourcePath = '/external-task/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\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 []\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 = \\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function taskCreate(){\r\n\t\t$method='task.create';\r\n\t\t$tags=$this->task;\r\n\t\t$response=$this->prepare_xml($method,$tags);\r\n\t\t$obj=$this->xml_obj($response, 'task_id');\r\n\t\t$this->task=new stdClass();\r\n\t\treturn $obj;\r\n\t}",
"public function getTask($id);",
"protected function showTaskRequest($task_id)\n {\n // verify the required parameter 'task_id' is set\n if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_id when calling showTask'\n );\n }\n\n $resourcePath = '/tasks/{task_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'task_id' . '}',\n ObjectSerializer::toPathValue($task_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 []\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 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 // 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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testMaintainancetasksTaskidGet($id)\n {\n \n \n $maintenanceTaskApi_instance = new \\Swagger\\Client\\Api\\MaintainanceTaskApi();\n \n try {\n \n list($result,$statuscode,$c) = $maintenanceTaskApi_instance->maintainancetasksTaskidGetWithHttpInfo($id);\n \n $this->AssertTrue($result['description']==\"blbla\");\n $this->AssertTrue($result['level']==1);\n //$this->AssertTrue($result['date']==$date);\n $this->AssertTrue($result['state']==1);\n //beaconobject\n $this->AssertTrue($result['type']==\\Swagger\\Client\\Model\\Task::TYPE_MAINTAINANCE_TASK);\n $this->AssertTrue($result['role']['name']==\"Verwalter\");\n $this->AssertTrue($result['name']==\"ganz toll\");\n //picture\n //subtasks\n $this->assertTrue($result['repeatTasksInDays']==0);\n return $result['id'];\n \n \n } catch (ApiException $ex) {\n $this->asserTrue(false);\n }\n //$this->\n }",
"protected function getApiTaskRequest($id)\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 getApiTask'\n );\n }\n\n $resourcePath = '/task/{id}.json';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($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 // \\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 // 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 getTasksInfoRequest($ids)\n {\n // verify the required parameter 'ids' is set\n if ($ids === null || (is_array($ids) && count($ids) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ids when calling getTasksInfo'\n );\n }\n\n $resourcePath = '/tasks';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($ids)) {\n $queryParams['ids'] = $ids;\n } else\n if ($ids !== null) {\n $queryParams['ids'] = ObjectSerializer::toQueryValue($ids);\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 []\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 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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function taskWorkV2GetTasksRequest($request)\n {\n // verify the required parameter 'request' is set\n if ($request === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling taskWorkV2GetTasks'\n );\n }\n\n $resourcePath = '/api/v2/TaskWork';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\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 // 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 }",
"function projecttimesheettaskid() {\n $newdata = array();\n if (empty($_REQUEST)) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 404, 'message' => 'No Data Found'));\n $this->response($newdata);\n }\n\n if ($this->user_id == 0) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 404, 'message' => 'No Data Found'));\n $this->response($newdata);\n }\n\n $project_id = trim(htmlspecialchars($_REQUEST['project_id'])) ? trim(htmlspecialchars($_REQUEST['project_id'])) : '';\n $task_id = trim(htmlspecialchars($_REQUEST['task_id'])) ? trim(htmlspecialchars($_REQUEST['task_id'])) : '';\n if (empty($project_id) || empty($task_id)) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 404, 'message' => 'No Data Found'));\n $this->response($newdata);\n }\n\n if (is_numeric($project_id) && is_numeric($task_id)) {\n $get_data = $this->db->query('SELECT r . * , u.email, u.firstname, u.lastname, u.email FROM user_roles r LEFT JOIN users u ON r.user_id = u.id WHERE r.user_id = \"' . $this->user_id . '\"')->row_array();\n if (empty($get_data)) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 404, 'message' => 'User data not found'));\n $this->response($newdata);\n }\n $role_id = $get_data['role_id'];\n $company_id = $get_data['company_id'];\n if ($role_id == 2) {\n $check_project_assign = $this->db->query('SELECT count(*) as count from projects where id=\"' . $project_id . '\" and company_id=\"' . $company_id . '\"')->row_array();\n if ($check_project_assign['count'] != 1) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 400, 'message' => 'Project Not Assign To You'));\n $this->response($newdata);\n }\n $alltimesheets = ProjectHasTimesheet::find(\"all\", array(\"conditions\" => array(\"task_id = ?\", $task_id)));\n if (empty($alltimesheets)) {\n $newdata = array('result' => 'success', 'response' => array('code' => 200, 'message' => 'No timesheets for this project and task'));\n $this->response($newdata);\n }\n\n $newArr = array();\n $i = 0;\n foreach ($alltimesheets as $key => $value) {\n $tracking = floor($value->time / 60);\n $tracking_hours = floor($tracking / 60);\n $tracking_minutes = $tracking - ($tracking_hours * 60);\n $time_spent = $tracking_hours . \" Hours \" . $tracking_minutes . \" Minutes\";\n $newArr[$i]['id'] = $value->id;\n $newArr[$i]['project_id'] = $project_id;\n $newArr[$i]['task_id'] = $task_id;\n $newArr[$i]['time_spent'] = $time_spent;\n $newArr[$i]['start_date'] = date('Y-m-d', strtotime($value->start));\n $newArr[$i]['end_date'] = date('Y-m-d', strtotime($value->end));\n if ($value->description != '') {\n $newArr[$i]['description'] = strip_tags($value->description);\n } else {\n $newArr[$i]['description'] = \"\";\n }\n $i++;\n }\n if (empty($newArr)) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 404, 'message' => 'No Data Found'));\n $this->response($newdata);\n }\n\n $newdata = array('result' => 'success', 'response' => $newArr, 'code' => 200);\n $this->response($newdata);\n }\n $check_project_assign_user = $this->db->query('SELECT count( * ) AS count FROM project_assign_clients WHERE project_id =\"' . $project_id . '\" AND assign_user_id =\"' . $this->user_id . '\" and company_id=\"' . $get_data['company_id'] . '\"')->row_array();\n if ($check_project_assign_user['count'] != 1) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 400, 'message' => 'Project Not Assign To You'));\n $this->response($newdata);\n }\n\n $check_project_task_assign_user = $this->db->query('SELECT count( * ) AS count FROM project_assign_tasks WHERE project_id =\"' . $project_id . '\" AND assign_user_id =\"' . $this->user_id . '\" and task_id=\"' . $task_id . '\"')->row_array();\n if ($check_project_task_assign_user['count'] != 1) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 400, 'message' => 'This Task Not Assign to You'));\n $this->response($newdata);\n }\n $alltimesheets = ProjectHasTimesheet::find(\"all\", array(\"conditions\" => array(\"task_id = ?\", $task_id)));\n if (empty($alltimesheets)) {\n $newdata = array('result' => 'success', 'response' => array('code' => 200, 'message' => 'No timesheets for this project and task'));\n $this->response($newdata);\n }\n\n $newArr = array();\n $i = 0;\n foreach ($alltimesheets as $key => $value) {\n $tracking = floor($value->time / 60);\n $tracking_hours = floor($tracking / 60);\n $tracking_minutes = $tracking - ($tracking_hours * 60);\n $time_spent = $tracking_hours . \" Hours \" . $tracking_minutes . \" Minutes\";\n $newArr[$i]['id'] = $value->id;\n $newArr[$i]['project_id'] = $project_id;\n $newArr[$i]['task_id'] = $task_id;\n $newArr[$i]['time_spent'] = $time_spent;\n $newArr[$i]['start_date'] = date('Y-m-d', strtotime($value->start));\n $newArr[$i]['end_date'] = date('Y-m-d', strtotime($value->end));\n if ($value->description != '') {\n $newArr[$i]['description'] = strip_tags($value->description);\n } else {\n $newArr[$i]['description'] = \"\";\n }\n $i++;\n }\n if (empty($newArr)) {\n $newdata = array('result' => 'fail', 'response' => array('code' => 404, 'message' => 'No Data Found'));\n $this->response($newdata);\n }\n\n $newdata = array('result' => 'success', 'response' => $newArr, 'code' => 400);\n $this->response($newdata);\n }\n $newdata = array('result' => 'fail', 'response' => array('code' => 400, 'message' => 'Project id or task id is not numeric'));\n $this->response($newdata);\n }",
"protected function activityTaskTaskIdFilesGetRequest($task_id)\n {\n // verify the required parameter 'task_id' is set\n if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $task_id when calling activityTaskTaskIdFilesGet'\n );\n }\n\n $resourcePath = '/activity/task/{task_id}/files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'task_id' . '}',\n ObjectSerializer::toPathValue($task_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 []\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 // 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 queryTaskRequest($query_task_id, $fields = null)\n {\n // verify the required parameter 'query_task_id' is set\n if ($query_task_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $query_task_id when calling queryTask'\n );\n }\n\n $resourcePath = '/query_tasks/{query_task_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n // path params\n if ($query_task_id !== null) {\n $resourcePath = str_replace(\n '{' . 'query_task_id' . '}',\n ObjectSerializer::toPathValue($query_task_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 // \\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addtaskAction() {\n\t\t// Check if it is an ajax request\n\t\tif ($this->_request->isXmlHttpRequest ()) {\n\t\t\t\n\t\t\t// Get the parameters\n\t\t\t$domain_id = $this->getRequest ()->getParam ( 'id' );\n\t\t\t$method = $this->getRequest ()->getParam ( 'method' );\n\t\t\t\n\t\t\t// Check the parameters\n\t\t\tif (is_numeric ( $domain_id ) && ! empty ( $method )) {\n\t\t\t\t\n\t\t\t\t$record = $this->domains->find ( $domain_id, \"d.domain as domain, ws.tld as tld, d.authinfocode, d.customer_id as customer_id, cdr.value as nichandle\", true );\n\t\t\t\tif (is_array ( $record [0] )) {\n\t\t\t\t\t$domain = $record [0] ['domain'] . \".\" . $record [0] ['tld'];\n\t\t\t\t\t$domain_id = $record [0] ['domain_id'];\n\t\t\t\t\t$retval = DomainsTasks::AddTask ( $domain, $method, $domain_id );\n\t\t\t\t\tif ($retval) {\n\t\t\t\t\t\tdie ( json_encode ( array ('result' => 1 ) ) );\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdie ( json_encode ( array ('result' => 0 ) ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdie ( json_encode ( array ('result' => 0 ) ) );\n\t}",
"public function getTasksListAction()\n\t{\n\t\t$post = $this->request->getPostList()->toArray();\n\n\t\t$groupId = (is_numeric($post['groupId']) ? (int) $post['groupId'] : 0);\n\t\t$epicId = (is_numeric($post['epicId']) ? (int) $post['epicId'] : 0);\n\n\t\t$userId = Util\\User::getId();\n\n\t\t$gridId = (is_string($post['gridId'] ) ? $post['gridId'] : '');\n\t\t$completed = ($post['completed'] === 'Y');\n\n\t\t$isGridRequest = ($this->request->get('grid_id') != null);\n\n\t\t$nav = new PageNavigation('tasks-lists-navigation');\n\t\t$nav->setPageSize(10)->initFromUri();\n\n\t\t$gridOptions = new Grid\\Options($gridId);\n\n\t\t$gridVisibleColumns = $gridOptions->getVisibleColumns();\n\t\tif (empty($gridVisibleColumns))\n\t\t{\n\t\t\t$gridVisibleColumns = ['NAME', 'STORY_POINTS', 'RESPONSIBLE'];\n\t\t}\n\n\t\t$epicService = new EpicService($userId);\n\t\t$taskService = new TaskService($userId);\n\t\t$itemService = new ItemService();\n\t\t$userService = new UserService();\n\n\t\t$epic = $epicService->getEpic($epicId);\n\t\tif (!$epic->getId())\n\t\t{\n\t\t\t$this->errorCollection->add(\n\t\t\t\t[\n\t\t\t\t\tnew Error(Loc::getMessage('TASKS_EC_ERROR_COULD_NOT_READ_EPIC'))\n\t\t\t\t]\n\t\t\t);\n\n\t\t\treturn null;\n\t\t}\n\n\t\t$filter = [\n\t\t\t'GROUP_ID' => $groupId,\n\t\t\t'::SUBFILTER-EPIC' => ['EPIC' => $epic->getId()],\n\t\t\t'CHECK_PERMISSIONS' => 'Y',\n\t\t\t'ONLY_ROOT_TASKS' => 'N',\n\t\t\t'SCRUM_TASKS' => 'Y',\n\t\t];\n\t\tif ($completed)\n\t\t{\n\t\t\t$filter['=STATUS'] = \\CTasks::STATE_COMPLETED;\n\t\t}\n\n\t\t$taskIds = $taskService->getTaskIdsByFilter($filter, $nav);\n\n\t\t(new \\Bitrix\\Tasks\\Access\\AccessCacheLoader())->preload($userId, $taskIds);\n\n\t\t$itemsStoryPoints = $itemService->getItemsStoryPointsBySourceId($taskIds);\n\n\t\t$randomGenerator = new RandomSequence(rand());\n\n\t\t$rows = [];\n\n\t\tforeach ($taskIds as $taskId)\n\t\t{\n\t\t\t$task = TaskRegistry::getInstance()->get($taskId);\n\t\t\tif (!$task)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$columns = [];\n\t\t\tif (in_array('NAME', $gridVisibleColumns))\n\t\t\t{\n\t\t\t\t$columns['NAME'] = $this->getTaskNameColumn($taskId, $task['TITLE']);\n\t\t\t}\n\t\t\tif (in_array('STORY_POINTS', $gridVisibleColumns))\n\t\t\t{\n\t\t\t\t$columns['STORY_POINTS'] = $itemsStoryPoints[$taskId] ?? '';\n\t\t\t}\n\t\t\tif (in_array('RESPONSIBLE', $gridVisibleColumns))\n\t\t\t{\n\t\t\t\t$usersInfo = $userService->getInfoAboutUsers([$task['RESPONSIBLE_ID']]);\n\t\t\t\t$columns['RESPONSIBLE'] = $this->getUserColumn($usersInfo);\n\t\t\t}\n\n\t\t\t$rows[] = [\n\t\t\t\t'id' => $taskId . $randomGenerator->randString(2),\n\t\t\t\t'columns' => $columns,\n\t\t\t];\n\t\t}\n\n\t\tif (empty($rows))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$component = new Component('bitrix:main.ui.grid', '', [\n\t\t\t'GRID_ID' => $gridId,\n\t\t\t'COLUMNS' => $this->getUiTasksGridColumns(),\n\t\t\t'ROWS' => $rows,\n\t\t\t'NAV_OBJECT' => $nav,\n\t\t\t'NAV_PARAMS' => ['SHOW_ALWAYS' => false],\n\t\t\t'SHOW_PAGINATION' => true,\n\t\t\t'SHOW_TOTAL_COUNTER' => false,\n\t\t\t'SHOW_CHECK_ALL_CHECKBOXES' => false,\n\t\t\t'SHOW_ROW_CHECKBOXES' => false,\n\t\t\t'SHOW_SELECTED_COUNTER' => false,\n\t\t\t'ALLOW_COLUMNS_SORT' => true,\n\t\t\t'ALLOW_COLUMNS_RESIZE' => false,\n\t\t\t'ALLOW_INLINE_EDIT' => false,\n\t\t\t'AJAX_MODE' => 'N',\n\t\t\t'AJAX_OPTION_JUMP' => 'N',\n\t\t\t'AJAX_OPTION_STYLE' => 'N',\n\t\t\t'AJAX_OPTION_HISTORY' => 'N'\n\t\t]);\n\n\t\tif ($isGridRequest)\n\t\t{\n\t\t\t$response = new HttpResponse();\n\t\t\t$content = Json::decode($component->getContent());\n\t\t\t$response->setContent($content['data']['html']);\n\n\t\t\treturn $response;\n\t\t}\n\n\t\treturn $component;\n\t}",
"protected function taskWorkV2SetTaskReadRequest($taskid)\n {\n // verify the required parameter 'taskid' is set\n if ($taskid === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $taskid when calling taskWorkV2SetTaskRead'\n );\n }\n\n $resourcePath = '/api/v2/TaskWork/read';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($taskid)) {\n $_tempBody = $taskid;\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 // 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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the model that the request relates to, if the URL has a resource id. | public function model(): ?object
{
$route = $this->jsonApi()->route();
if ($route->hasResourceId()) {
return $route->model();
}
return null;
} | [
"private function getModelAccordingToParent(Request $request, $id){\n $model = call_user_func_array([$this->getModelType(),'where'],['id','=',$id]);\n\n\n foreach ($this->fromSettings('parentRel') as $key => $value){\n //If request has the parent relationship get it from there\n if ($request->has($key)){\n //TODO: check on dynamic calling of request attribute\n $model->where($key,'=',$request->{$key});\n }else{\n $model->where($key,'=',$value);\n }\n }\n\n $model = $model->get()->first();\n\n if(!$model){\n $this->errors['Not Authorized'] = $id;\n return false;\n }\n\n return $model;\n }",
"public function getModel() {\n\t\t$model = null;\n\t\tif ( $this->ModelID && $this->ModelClass && ClassInfo::exists( $this->ModelClass ) ) {\n\t\t\t$modelClass = $this->ModelClass;\n\t\t\t$model = $modelClass::get()->byID( $this->ModelID );\n\t\t}\n\n\t\treturn $model;\n\t}",
"public function getResourceModel()\n {\n return $this->resourceModel;\n }",
"public function model()\n {\n return $this->resource;\n }",
"protected abstract function get_model($id);",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Residencebaseinfo::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel()\r\n\t{\r\n\t\t$model=null;\r\n\r\n\t\tif(isset($_GET['id']))\r\n\t\t\t$model=$this->getModel()->findbyPk($_GET['id']);\r\n\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\telse\r\n\t\t\treturn $model;\r\n\t}",
"public function loadModel() {\n if ($this->_model === null) {\n if (isset($_GET['id']))\n $this->_model = Entry::model()->findbyPk($_GET['id']);\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }",
"protected\nfunction findModel($id)\n{\n if (($model = Url::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n}",
"protected function model()\n {\n return $this->route('post') ?: null;\n }",
"protected function get_model()\n\t{\n\t\tif (!$this->model)\n\t\t{\n\t\t\t$this->model = ActiveRecord\\get_model($this->model_id);\n\t\t}\n\n\t\treturn $this->model;\n\t}",
"protected function findModel($id)\n {\n if (($model = CherckUrl::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel()\n\t{\t\t\n\t\tif ($this->_model === null)\n\t\t{\n\t\t\tif (isset($_REQUEST['id']))\n\t\t\t{\n\t\t\t\t$this->_model = Cases::model()->findByPk((int)Yii::app()->request->getParam('id', 0));\n\t\t\t}\n\n\t\t\tif ($this->_model === null)\n\t\t\t{\n\t\t\t\tthrow new CHttpException(404, Yii::t('site', '404_Error'));\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_model;\n\t}",
"public function findModel(): ?Model\n {\n return $this->getModelQuery()->find($this->route('id'));\n }",
"protected function findModel($id , $q='')\n {\n if (($model = Shortlink::find()->andWhere(['custom_url'=> $q])->one()) !== null) {\n return $model;\n } elseif (($model = Shortlink::find()->andWhere(['id'=>$id])->one()) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::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}",
"public function getModelSlugForCurrentRoute();",
"public function getResourceForModel(Model $model): ?ResourceInterface;",
"protected function findModel($id)\n {\n\t\t$model = Campaign::findOne($id);\n\t\t\tif($model == null)\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\tif ($model->clientID == Yii::$app->user->identity->clientID) {\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that magic find is unavaiable on other datasources | public function testMagicFindUnavailable() {
ConnectionManager::create('dummy', array('datasource' => 'DataSource'));
$this->Article->useDbConfig = 'dummy';
$this->StackableFinder->findById(1);
} | [
"public function testGettingNonExistantDataSource() \n {\n DataSourcesRegistry::getDataSource('test');\n }",
"public function testAfterFindNotPrimary() {\n\t\t\n\t\t$data = array($this->TestModel->alias => array('field' => 'value'));\n\t\t\n\t\t$results = $this->DataTypeJuggling->afterFind($this->TestModel, $data, false);\n\t\t\n\t\t$this->assertEquals($data, $results);\n\t\t\n\t}",
"public function testIsSkipTableByRegistryAlias(): void\n {\n $config = TableRegistry::exists('GroupsUsers') ? [] : ['className' => '\\Cake\\ORM\\Table'];\n $table = TableRegistry::get('GroupsUsers', $config);\n\n $filter = new FilterQuery($table->find(), $table, []);\n $is_skipTable = Utility::callPrivateMethod($filter, 'isSkipTable');\n $this->assertEquals(true, $is_skipTable);\n }",
"public function testMagicFindError(): void\n {\n $this->expectException(BadMethodCallException::class);\n $this->expectExceptionMessage('Not enough arguments for magic finder. Got 0 required 1');\n $table = $this->getTableLocator()->get('Users');\n\n $table->findByUsername();\n }",
"public function testFindByNotFound(): void\n {\n $result = $this->stubRepository->findBy('name', 'Operating Systems');\n\n $this->assertEquals(null, $result);\n }",
"public function testFindBeforeExists()\n {\n $identifier = ResourceIdentifier::create('users', '99');\n $expected = new StandardObject();\n\n $mock = $this->adapter();\n $mock->expects($this->never())->method('exists');\n $mock->method('find')->with('99')->willReturn($expected);\n\n $store = $this->store(['users' => $mock]);\n $this->assertSame($expected, $store->find($identifier));\n $this->assertTrue($store->exists($identifier));\n }",
"public function testClearNonExistantDataSource()\n {\n DataSourcesRegistry::clearDataSource('test'); \n }",
"public function testCustomFindChanged() {\n\t\t$this->Crud->mapFindMethod('index', 'custom_find');\n\t\t$this->assertEquals('custom_find', $this->Crud->testGetFindMethod('index'));\n\n\t\t$this->Crud->mapFindMethod('index', 'all');\n\t\t$this->assertEquals('all', $this->Crud->testGetFindMethod('index'));\n\t}",
"public function testDataSourcePostgreSqlsFindOneGet()\n {\n\n }",
"public function testExistsExistingDataFinder()\n {\n $result = Factory::dataFinderExists(\"MyOtherTest\");\n $this->assertTrue($result);\n }",
"public function testDataSourceMsSqlsFindOneGet()\n {\n\n }",
"public function testFind()\n {\n // Start of user code EntityRepositoryTest.testfind\n $pdo = MysqlDataSourceTestSetupTearDown::getPdoConnection($GLOBALS['db_name']);\n \n // Insert some records into table\n $pdo->exec(\n 'INSERT INTO some_entity_data_table (idTable, a, b, c) VALUES (1, \\'foo\\', \\'foo\\', \\'foo\\')'\n );\n\n $pdo->exec(\n 'INSERT INTO some_entity_data_table (idTable, a, b, c) VALUES (2, \\'bar\\', \\'bar\\', \\'bar\\')'\n );\n\n $expectedEntity1 = new SomeEntity();\n $expectedEntity1->setId(1);\n $expectedEntity1->setAttributeA('foo');\n $expectedEntity1->setAttributeB('foo');\n $expectedEntity1->setAttributeC('foo');\n\n $expectedEntity2 = new SomeEntity();\n $expectedEntity2->setId(2);\n $expectedEntity2->setAttributeA('bar');\n $expectedEntity2->setAttributeB('bar');\n $expectedEntity2->setAttributeC('bar');\n \n $repository = EntityRepository::instantiateFromEntityClassName(\n 'TiBeN\\\\Framework\\\\Tests\\\\Fixtures\\\\Entity\\\\SomeEntity'\n );\n\n $criterias = CriteriaSet::createAnd();\n\n $entityCollection = $repository->find($criterias);\n $this->assertEquals(2, $entityCollection->count()); \n $this->assertEquals($expectedEntity1, $entityCollection->get(0));\n $this->assertEquals($expectedEntity2, $entityCollection->get(1));\n // End of user code\n }",
"public function testFindNoneBeforeExists()\n {\n $identifier = ResourceIdentifier::create('users', '99');\n\n $mock = $this->adapter();\n $mock->expects($this->never())->method('exists');\n\n $store = $this->store(['users' => $mock]);\n $this->assertNull($store->find($identifier));\n $this->assertFalse($store->exists($identifier));\n }",
"public function testFinder()\n {\n $queryString = [\n 'foo' => 'a',\n 'public' => 'false',\n ];\n $this->assertFalse($this->Articles->isSearch());\n\n $query = $this->Articles->find('search', ['search' => $queryString]);\n $this->assertSame([\n 'foo' => 'a',\n 'public' => false,\n ], $query->where());\n $this->assertTrue($this->Articles->isSearch());\n }",
"public function testQueryBuilderFindNoParams()\n {\n $db = InQuery::init([\n 'engine' => Engine::MOCK,\n 'name' => 'db1',\n 'host' => 'localhost',\n 'port' => '3306',\n 'db' => 'mock',\n 'username' => 'username',\n 'password' => 'password'\n ])->getConnection();\n $findQuery = $db->query()->table('testTable');\n $this->assertTrue($findQuery instanceof Query);\n }",
"public function testDataSourcePostgreSqlsIdExistsGet()\n {\n\n }",
"function findForLegacyDataList() {\n\n $queryBuilder = $this->getEntityManager()->createQueryBuilder()\n ->select('personMissingInDs, ds, p')\n ->from('AppBundle:PersonMissingInDataSource', 'personMissingInDs')\n ->leftJoin(\"personMissingInDs.dataSource\", \"ds\")\n ->leftJoin(\"personMissingInDs.person\", \"p\")\n ->where('personMissingInDs.hiddenByUser is null')\n ->orderBy('personMissingInDs.created', \"ASC\");\n\n return $queryBuilder->getQuery()->getResult();\n }",
"public function testFindPksNotFound()\n {\n try {\n $test = UnitTest::find(array(1, 123));\n $this->fail();\n } catch (Mad_Model_Exception_RecordNotFound $e) {}\n\n $msg = \"A record id IN (1, 123) was not found\";\n $this->assertEquals($msg, $e->getMessage());\n }",
"public function testDataSourcePostgreSqlsIdDynamicDatasFkGet()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.