query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
/ THE FOLLOWING FUNCTIONS ARE USED JUST BY THE VARIATION MANAGEMENT PAGE / variation_types() gets the vtypes for this user and saves them in data for the view this function is used by the variation type management page, not the node specific variations page loads a view
public function variation_types() { $this->data['var_types']=$this->variation_model->get_var_types(); for ($x=0;$x<count($this->data['var_types']);$x++) { $this->data['var_types'][$x]['html']=$this->variation_model->get_var_values_html($this->data['var_types'][$x]); } $this->display_node('variation-types-definition'); }
[ "function product_vtype_form($variations)\n {\n // if any variations set then all disabled\n $vcount=mysql_num_rows($variations);\n // this users and this products vtypes\n $variation_types=get_variation_types();\n $pvtypes=get_product_variation_types(\"variationTypeID\");\n // build vtype selector output\n $vtf=\"\";\n $vtf.=\"<span class='vinstock_main right'>&nbsp;\"; \n $vtf.=\"</span>\";\n while ($vtype=mysql_fetch_array($variation_types))\n {\n $vvalues=get_variation_values($vtype[\"variationTypeID\"]);\n $vtype_name=$vtype[\"variationTypeName\"];\n if (mysql_num_rows($vvalues)>0||is_perm($vtype_name))\n {\n // floats the price and postage ones right, others left\n if (is_perm($vtype_name)) $float=\" right permcheck\"; else $float=\" left \";\n if (in_array($vtype[\"variationTypeID\"],$pvtypes)) $checked=\" checked \"; else $checked=\"\";\n if (is_perm($vtype_name)||$vcount>0) $disabled=\" disabled='disabled' \"; else $disabled=\"\"; \n $vtf.=\"<span class='vtype_selector \".$float.\"'>\";\n $vtf.=\"<input id='\".$vtype[\"variationTypeID\"].\"_vtype' type='checkbox' \".$checked.\" \".$disabled.\" onclick='set_vtype_output(\\\"\".$vtype[\"variationTypeID\"].\"\\\")'/>\".$vtype[\"variationTypeName\"];\n $vtf.=\"</span>\";\n }\n }\n return $vtf;\n }", "function FetchVariationsList () {\n\n\t\t$this->FP_VARIATIONS_LIST = array();\n\t\tforeach ($this->FP_Themes as $myTheme) {\n\t\t\tif (isset($myTheme['is_variation']) && $myTheme['is_variation']) {\n\t\t\t\t$myTheme['userfile'] ? $asterisk = \"*\" : $asterisk = \"\";\n\t\t\t\t$this->FP_VARIATIONS_LIST[$myTheme['id']] = $asterisk . $myTheme['name'];\n\t\t\t}\n\t\t}\n\t}", "function field_data_type_view(){\r\n\t\tglobal $current_user;\r\n\t\t$current_user = wp_get_current_user();\r\n\t\tif( !current_user_can( 'manage_options', $current_user->ID ) ){\r\n\t\t\twp_die( __( 'You do not have permissions to activate this plugin, sorry, check with site administrator to resolve this issue please!', 'user-registration-aide' ) );\r\n\t\t}else{\r\n\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t?>\r\n\t\t\t<table class=\"style\">\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th colspan=\"3\"><?php _e( 'Change Field Type: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th colspan=\"2\"><?php _e( 'Field Title: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t\t<th><?php _e( 'Field Type: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<?php\r\n\t\t\t\t$nfc = new INPUT_NEW_FIELDS_MODEL();\r\n\t\t\t\t$input = $nfc->input_options_array();\r\n\t\t\t\t$ura_fields = $field->get_all_fields();\r\n\t\t\t\tif( !empty( $ura_fields ) ){\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach( $ura_fields as $objects ){\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"fieldName\" colspan=\"2\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\techo '<label for=\"'.$objects->meta_key.'\">'. _e( $objects->field_name, 'user-registration-aide').'</label>';\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<select class=\"fieldOrder\" name=\"<?php echo $objects->meta_key.'_data_type'; ?>\" title=\"<?php _e( 'Select the field type to change to', 'user-registration-aide' );?>\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\tforeach( $input as $key => $title ){\r\n\t\t\t\t\t\t\t\t\tif( $objects->data_type == $key ){\r\n\t\t\t\t\t\t\t\t\t\t$selected = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$selected = null;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\techo \"<option value=\\\"$key\\\" $selected >$title</option>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"fieldName\" colspan=\"3\">\r\n\t\t\t\t\t\t<p class=\"deleteFields\">\r\n\t\t\t\t\t\t<?php _e( 'No new fields currently exist, you have to add new fields on the main page before you can change the order!', 'user-registration-aide' ); ?>\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t}?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\"3\">\r\n\t\t\t\t\t<div class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"change_field_type\" value=\"<?php _e( 'Change Field Type', 'user-registration-aide' );?>\" /></div>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}", "public function testUpdateVariationType()\n {\n }", "function load_variation_settings_fields( $variations ) {\n\n $variations['_custom_product_upc_'] = get_post_meta( $variations[ 'variation_id' ], '_custom_product_upc_', true );\n\n return $variations;\n}", "public function userTypes() {}", "function add_veg_type()\n\t{\n\t\t$data['inner_view']='add_vegies_type';\n\t\t$this->load->view('includes/main_layout',$data);\n\t}", "function cpvg_fieldtypes_form($post_types, $view_type = 'post')\n{\n require_once CPVG_ADMIN_TEMPLATE_DIR . \"/cpvg_fieldtypes_form.html\";\n require_once WP_PLUGIN_DIR . \"/../../wp-includes/link-template.php\";\n\n ?>\n <script type='text/javascript'>\n <?php\n //List of Template Files\n $template_files = cpvg_capitalize_array_values(cpvg_get_extensions_files(\"php\",CPVG_POST_TEMPLATE_DIR));\n\n $object_types = array_diff_assoc(get_post_types(array('_builtin'=>false)),array('content-type'=>'content-type','rw_content_type'=>'rw_content_type','rw_taxonomy'=>'rw_taxonomy'));\n $objects_data = array();\n //POST VIEWS\n foreach ($object_types as $post_type) {\n $custom_fields_data = cpvg_get_customfields($post_type);\n if(!empty($custom_fields_data)){\n $object_data = array();\n foreach($custom_fields_data as $field_id=>$field_name){\n if(!empty($field_name)){\n $object_data[] = $field_name;\n }\n }\n }\n if(post_type_supports($post_type,'editor')){\n $object_data[] = 'Content Editor';\n }\n $objects_data[$post_type] = $object_data;\n }\n //List of Custom Post Types\n $object_types = cpvg_capitalize_array_values($object_types);\n ?>\n\n //MANDATORY\n <?php\n if($view_type == \"post\"){\n echo \"viewModel.setData('view_type','\".$view_type.\"');\\n\";\n echo \"viewModel.setData('siteurl','\".home_url(\"\").\"');\\n\";\n echo \"viewModel.setData('available_template_files',\".json_encode($template_files).\",'assocArray');\\n\";\n }\n if(in_array(\"acf\",array_keys($object_types))){\n echo \"viewModel.setData('acf_enabled','true');\\n\";\n }else{\n echo \"viewModel.setData('acf_enabled','false');\\n\";\n }\n\n $js_posttypes = array_merge($object_types,array('post'=>'Post','page'=>'Page'));\n $js_posttypes = array_diff_assoc($js_posttypes, array('acf'=>'Acf'));\n\n echo \"viewModel.setData('available_post_types',\".json_encode($js_posttypes).\",'assocArray');\\n\";\n echo \"viewModel.setData('available_custom_fields',\".json_encode(array_merge($objects_data,array('field_sections'=>array_keys($objects_data)))).\",'json');\\n\";\n echo \"viewModel.setAvailableFieldTypes(\".cpvg_load_fieldtypes(true).\");\\n\";\n\n //DATAFIELDS\n $datafields_files = cpvg_get_extensions_files(\"php\",CPVG_DATAFIELDS_DIR);\n $objects_data = array();\n\n foreach($datafields_files as $datafield_file => $datafield_name){\n require_once CPVG_DATAFIELDS_DIR.\"/\".$datafield_file.\".php\";\n $datafield_object = new $datafield_file();\n\n $objects_data = array_merge_recursive($objects_data,$datafield_object->adminProperties());\n $object_types[str_replace(\"cpvg_\",\"\",$datafield_file)] = ucwords(str_replace(\"cpvg_\",\"\",$datafield_file));\n }\n\n if($view_type == \"list\"){\n $parameters_files = cpvg_get_extensions_files(\"php\",CPVG_PARAMETER_DIR);\n\n foreach(array('filter','order','pagination','usersorting') as $param_name){\n $filter_data = array();\n foreach($parameters_files as $parameters_file => $parameters_name){\n require_once CPVG_PARAMETER_DIR.\"/\".$parameters_file.\".php\";\n $parameter_object = new $parameters_file();\n $filter_data = array_merge_recursive($filter_data,$parameter_object->getParameterData($param_name));\n }\n echo \"viewModel.parseParamConfig('\".$param_name.\"',\".json_encode($filter_data).\");\\n\";\n }\n }\n\n $cvpg_datafield_settings = $objects_data['cvpg_datafield_extra_data'][0];\n echo \"viewModel.setData('available_extra_data',\".json_encode($cvpg_datafield_settings).\",'');\\n\";\n\n $objects_data = array_diff_assoc($objects_data, array('cvpg_datafield_extra_data'=>$cvpg_datafield_settings));\n echo \"viewModel.setData('available_fields',\".json_encode(array_merge($objects_data,array('field_sections'=>array_keys($objects_data)))).\",'json');\\n\";\n ?>\n </script>\n<?php\n\n}", "function vegies_type_list(){\n\t\t\n\t\t$rs= $this->Veg_Model->gettypes();\n\t\t//print_r($rs);\n\t\t$data['inner_view']='type_list';\n\t\t$data['result']=$rs;\n\t\t$this->load->view('includes/main_layout',$data);\n\t}", "function ovacrs_add_custom_product_type( $types ){\n $types[ 'ovacrs_car_rental' ] = esc_html__( 'Car Rental', 'ova-crs' );\n return $types;\n}", "function cptui_register_my_taxes_voyages_types() {\n\n\t/**\n\t * Taxonomy: Types.\n\t */\n\n\t$labels = [\n\t\t\"name\" => __( \"Types\", \"custom-post-type-ui\" ),\n\t\t\"singular_name\" => __( \"Type\", \"custom-post-type-ui\" ),\n\t];\n\n\t\n\t$args = [\n\t\t\"label\" => __( \"Types\", \"custom-post-type-ui\" ),\n\t\t\"labels\" => $labels,\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"show_ui\" => true,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"query_var\" => true,\n\t\t\"rewrite\" => [ 'slug' => 'voyages_types', 'with_front' => true, ],\n\t\t\"show_admin_column\" => false,\n\t\t\"show_in_rest\" => true,\n\t\t\"rest_base\" => \"voyages_types\",\n\t\t\"rest_controller_class\" => \"WP_REST_Terms_Controller\",\n\t\t\"show_in_quick_edit\" => false,\n\t\t\"show_in_graphql\" => false,\n\t];\n\tregister_taxonomy( \"voyages_types\", [ \"voyages\" ], $args );\n}", "function mygigastore_process_product_variations_view($node) {\n $title = t('Variations for product %title', array('%title' => $node->title));\n $output = views_embed_view('birou_administare_variante_preparate', 'default', $node->nid);\n\n return views_megarow_display($title, $output, $node->nid);\n}", "function hook_search_api_item_type_info() {\n // Copied from search_api_search_api_item_type_info().\n $types = array();\n\n foreach (entity_get_property_info() as $type => $property_info) {\n if ($info = entity_get_info($type)) {\n $types[$type] = array(\n 'name' => $info['label'],\n 'datasource controller' => 'SearchApiEntityDataSourceController',\n 'entity_type' => $type,\n );\n }\n }\n\n return $types;\n}", "private\n function renderPlanProductVariationTypesElement(&$form) {\n // Vertical tabs do not display as they should, unfortunately,\n // so we're dropping them all in a single group to at least\n // give them a styled details container.\n $form['plan_product_variation_types__vertical_tabs'] = [\n '#type' => 'vertical_tabs',\n '#required' => TRUE,\n '#attributes' => [\n 'id' => 'plan-product-variation-types',\n ],\n ];\n\n $form['plan_product_variation_types_container'] = [\n '#type' => 'details',\n '#title' => $this->t('Product Variation Types Treated as Plans'),\n '#description' => $this->t('Variations provided by Commerce Recurly -- Recurly Plan Variation and Recurly Nonplan Variation -- are not included here. Their behaviors follow their names.'),\n ];\n\n $product_variation_types = $this->entityTypeBundleInfo\n ->getBundleInfo('commerce_product_variation');\n\n $product_variation_types_as_options = [];\n\n // Variation types provided by commerce_recurly.\n $default_variations = [\n 'recurly_nonplan_variation',\n 'recurly_plan_variation',\n ];\n\n foreach ($product_variation_types as $type_machine_name => $type_info) {\n // We don't want users to be able to override behvior for\n // commerce_recurly's default variations\n if (in_array($type_machine_name, $default_variations)) {\n continue;\n }\n $product_variation_types_as_options[$type_machine_name] = $this->t($type_info['label']);\n }\n\n // Remove our default variations from our default values\n // as they shouldn't be present in the options anyway.\n $default_values = $this->getPlanProductVariations();\n foreach ($default_variations as $default_variation) {\n if (in_array($default_variation, $default_values)) {\n unset($default_values[$default_variation]);\n }\n }\n\n $form['plan_product_variation_types_container']['plan_product_variation_types'] = [\n '#type' => 'checkboxes',\n '#title' => $this->t('Recurly Plan Product Variation Types'),\n '#description' => $this->t('\n <ul>\n <li>Product variation types selected above will be treated as Recurly Plans and will use the associated Account ID Pattern defined below.</li>\n <li>Product variation types that are <i>not</i> selected above will be considered as nonplans and will use the associated Account ID Pattern defined below.</li>\n </ul>\n '),\n '#options' => $product_variation_types_as_options,\n '#default_value' => $default_values,\n '#group' => 'plan_product_variation_types__vertical_tabs',\n ];\n }", "function type_init() {\n\tregister_taxonomy( 'type', array( 'spot' ), array(\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => false,\n\t\t'query_var' => true,\n\t\t'rewrite' => true,\n\t\t'capabilities' => array(\n\t\t\t'manage_terms' => 'edit_posts',\n\t\t\t'edit_terms' => 'edit_posts',\n\t\t\t'delete_terms' => 'edit_posts',\n\t\t\t'assign_terms' => 'edit_posts'\n\t\t),\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Types', 'gspots_spot_type' ),\n\t\t\t'singular_name' => _x( 'Type', 'taxonomy general name', 'gspots_spot_type' ),\n\t\t\t'search_items' => __( 'Search Types', 'gspots_spot_type' ),\n\t\t\t'popular_items' => __( 'Popular Types', 'gspots_spot_type' ),\n\t\t\t'all_items' => __( 'All Types', 'gspots_spot_type' ),\n\t\t\t'parent_item' => __( 'Parent Type', 'gspots_spot_type' ),\n\t\t\t'parent_item_colon' => __( 'Parent Type:', 'gspots_spot_type' ),\n\t\t\t'edit_item' => __( 'Edit Type', 'gspots_spot_type' ),\n\t\t\t'update_item' => __( 'Update Type', 'gspots_spot_type' ),\n\t\t\t'add_new_item' => __( 'New Type', 'gspots_spot_type' ),\n\t\t\t'new_item_name' => __( 'New Type', 'gspots_spot_type' ),\n\t\t\t'separate_items_with_commas' => __( 'Types separated by comma', 'gspots_spot_type' ),\n\t\t\t'add_or_remove_items' => __( 'Add or remove Types', 'gspots_spot_type' ),\n\t\t\t'choose_from_most_used' => __( 'Choose from the most used Types', 'gspots_spot_type' ),\n\t\t\t'menu_name' => __( 'Types', 'gspots_spot_type' ),\n\t\t),\n\t) );\n\n}", "function pvariation_form($variations)\n {\n $pvf=\"\";\n \n // we need to get all the variation types for each row, so they can be switched on and off\n $v_types=get_variation_types();\n $vtypes=array();\n while ($vtype=mysql_fetch_array($v_types))\n {\n $vtypes[$vtype[\"variationTypeName\"]][\"values\"]=get_variation_values($vtype[\"variationTypeID\"]);\n $vtypes[$vtype[\"variationTypeName\"]][\"details\"]=$vtype;\n }\n $product_variation_types=get_product_variation_types(\"variationTypeName\");\n $pvtypes=get_product_variation_types(\"variationTypeName\"); \n \n // output the variation rows, no need if none set yet\n if (mysql_num_rows($variations)>0)\n {\n $counter==0;\n variation_header_row($vtypes,$pvtypes);\n $pvf.=\"<form id='variation_editor'>\";\n while ($variation=mysql_fetch_array($variations)) //loops out the variations\n {\n $counter++;\n $pvf.=variation_row(array(\"vtypes\"=>$vtypes,\"pvtypes\"=>$pvtypes,\"variation\"=>$variation,\"counter\"=>$counter));\n }\n $pvf.=\"</form>\";\n $pvf.=\"<span id='save_variations_button' class='button right' onclick='save_variations()'>save edited variations</span>\";\n $pvf.=\"<span id='changes_made' class='highlight red right'>! changes made ! click save - &gt;</span>\";\n }\n \n // output the variation adder row \n variation_header_row($vtypes,$pvtypes);\n $pvf.=variation_row(array(\"vtypes\"=>$vtypes,\"pvtypes\"=>$pvtypes,\"variation\"=>null));\n $pvf.=\"<span id='add_variations_button' class='button right' onclick='add_variations(\\\"\".$_SESSION[\"user\"][\"pvTypePrice\"].\"\\\",\\\"\".$_SESSION[\"user\"][\"pvTypePost\"].\"\\\")'>add variations</span>\";\n \n // initial variation preview panel - this will be updated via ajax\n $pvf.=\"<div id='variation_preview' class='left'>\";\n $pvf.=variation_preview(array(\"selections\"=>array()));\n $pvf.=\"</div>\";\n \n // return HTML\n return $pvf;\n }", "public static function load_variations()\n {\n }", "public function remove_vtype()\n {\n\t\t// get array\n\t\t\t$get=$this->get_input_vals();\n\n\t\t// remove\n\t\t\t$this->variation_model->remove_nvar_type($get);\n }", "function ogp_dropdown_types ( $selected = '', $name = 'object_type', $id = 'object_type', $exclude = array () )\n {\n $types_by_category = array (\n 'Websites' => array ( 'name' => __( 'Websites', 'ogp' ), 'types' => array (\n 'blog' => __( 'Blog', 'ogp' ),\n 'website' => __( 'Website', 'ogp' ),\n 'article' => __( 'Article', 'ogp' ),\n ), ),\n 'Activities' => array ( 'name' => __( 'Activities', 'ogp' ), 'types' => array (\n 'activity' => __( 'Activity', 'ogp' ),\n 'sport' => __( 'Sport', 'ogp' ),\n ), ),\n 'Businesses' => array ( 'name' => __( 'Businesses', 'ogp' ), 'types' => array (\n 'bar' => __( 'Bar', 'ogp' ),\n 'company' => __( 'Company', 'ogp' ),\n 'cafe' => __( 'Cafe', 'ogp' ),\n 'hotel' => __( 'Hotel', 'ogp' ),\n 'restaurant' => __( 'Restaurant', 'ogp' ),\n ), ),\n 'Groups' => array ( 'name' => __( 'Groups', 'ogp' ), 'types' => array (\n 'cause' => __( 'Cause', 'ogp' ),\n 'sports_league' => __( 'Sports League', 'ogp' ),\n 'sports_team' => __( 'Sports Team', 'ogp' ),\n ), ),\n 'Organizations' => array ( 'name' => __( 'Organizations', 'ogp' ), 'types' => array (\n 'band' => __( 'Band', 'ogp' ),\n 'government' => __( 'Government', 'ogp' ),\n 'non_profit' => __( 'Non-Profit', 'ogp' ),\n 'school' => __( 'School', 'ogp' ),\n 'university' => __( 'University', 'ogp' ),\n ), ),\n 'People' => array ( 'name' => __( 'People', 'ogp' ), 'types' => array (\n 'actor' => __( 'Actor', 'ogp' ),\n 'athlete' => __( 'Athlete', 'ogp' ),\n 'author' => __( 'Author', 'ogp' ),\n 'director' => __( 'Director', 'ogp' ),\n 'musician' => __( 'Musician', 'ogp' ),\n 'politician' => __( 'Politician', 'ogp' ),\n 'public_figure' => __( 'Public Figure', 'ogp' ),\n ), ),\n 'Places' => array ( 'name' => __( 'Places', 'ogp' ), 'types' => array (\n 'city' => __( 'City', 'ogp' ),\n 'country' => __( 'Country', 'ogp' ),\n 'landmark' => __( 'Landmark', 'ogp' ),\n 'state_province' => __( 'State or Province', 'ogp' ),\n ), ),\n 'Products and Entertainment' => array ( 'name' => __( 'Products and Entertainment', 'ogp' ), 'types' => array (\n 'album' => __( 'Album', 'ogp' ),\n 'book' => __( 'Book', 'ogp' ),\n 'drink' => __( 'Drink', 'ogp' ),\n 'food' => __( 'Food', 'ogp' ),\n 'game' => __( 'Game', 'ogp' ),\n 'product' => __( 'Product', 'ogp' ),\n 'song' => __( 'Song', 'ogp' ),\n 'movie' => __( 'Movie', 'ogp' ),\n 'tv_show' => __( 'TV Show', 'ogp' ),\n ), ),\n );\n if ( !empty ( $exclude ) )\n {\n foreach ( $exclude as $i )\n {\n if ( isset ( $types_by_category[$i[0]]['types'][$i[1]] ) )\n unset ( $types_by_category[$i[0]]['types'][$i[1]] );\n }\n }\n ?>\n <select name=\"<?php echo $name; ?>\" id=\"<?php echo $id; ?>\">\n <?php foreach ( apply_filters ( 'ogp_types_by_category', $types_by_category ) as $category ) if ( !empty ( $category['types'] ) ) : ?>\n <optgroup label=\"<?php echo $category['name']; ?>\">\n <?php foreach ( $category['types'] as $option_value => $option_name ) : ?>\n <option value=\"<?php echo $option_value; ?>\"<?php if ( $selected == $option_value ) echo ' selected=\"selected\"'; ?>><?php echo $option_name; ?></option>\n <?php endforeach; ?>\n </optgroup>\n <?php endif; ?>\n </select>\n <?php\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation gETStockLocationIdStockTransfersWithHttpInfo Retrieve the stock transfers associated to the stock location
public function gETStockLocationIdStockTransfersWithHttpInfo($stock_location_id) { $request = $this->gETStockLocationIdStockTransfersRequest($stock_location_id); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { } throw $e; } }
[ "public function gETStockLocationIdStockTransfers($stock_location_id)\n {\n $this->gETStockLocationIdStockTransfersWithHttpInfo($stock_location_id);\n }", "public function testGETStockLocationIdStockTransfers()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function listTransfers($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_DataTransfer_DataTransfersListResponse\");\n }", "public function gETStockTransferIdShipmentWithHttpInfo($stock_transfer_id)\n {\n $request = $this->gETStockTransferIdShipmentRequest($stock_transfer_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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function gETStockTransferIdSkuWithHttpInfo($stock_transfer_id)\n {\n $request = $this->gETStockTransferIdSkuRequest($stock_transfer_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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function testGETStockTransfersStockTransferId()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function gETStockTransferIdOriginStockLocationAsyncWithHttpInfo($stock_transfer_id)\n {\n $returnType = '';\n $request = $this->gETStockTransferIdOriginStockLocationRequest($stock_transfer_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 (string) $response->getBody()\n );\n }\n );\n }", "public function gETLineItemIdStockTransfersAsyncWithHttpInfo($line_item_id)\n {\n $returnType = '';\n $request = $this->gETLineItemIdStockTransfersRequest($line_item_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 (string) $response->getBody()\n );\n }\n );\n }", "public function sendTransferWithHttpInfo($request)\n {\n $returnType = '\\Swagger\\Client\\Model\\SendTransferResponse';\n $request = $this->sendTransferRequest($request);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\SendTransferResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\SendTransferResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\IApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\SendTransferResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\SendTransferResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function offerGetStockWithHttpInfo($stockLocationIds, $skus = null, $pageIndex = null, $pageSize = null, string $contentType = self::contentTypes['offerGetStock'][0])\n {\n $request = $this->offerGetStockRequest($stockLocationIds, $skus, $pageIndex, $pageSize, $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 ('\\FriendsOfCE\\Channel\\ApiClient\\Model\\CollectionOfMerchantOfferGetStockResponse' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\FriendsOfCE\\Channel\\ApiClient\\Model\\CollectionOfMerchantOfferGetStockResponse' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\FriendsOfCE\\Channel\\ApiClient\\Model\\CollectionOfMerchantOfferGetStockResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\FriendsOfCE\\Channel\\ApiClient\\Model\\CollectionOfMerchantOfferGetStockResponse';\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 '\\FriendsOfCE\\Channel\\ApiClient\\Model\\CollectionOfMerchantOfferGetStockResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function listSubAccountTransfersWithHttpInfo($associative_array)\n {\n $request = $this->listSubAccountTransfersRequest($associative_array);\n\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null;\n if ($responseBody !== null) {\n $gateError = json_decode($responseBody, true);\n if ($gateError !== null && isset($gateError['label'])) {\n throw new GateApiException(\n $gateError,\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $responseBody\n );\n }\n }\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $responseBody\n );\n }\n\n $returnType = '\\GateApi\\Model\\SubAccountTransfer[]';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }", "public function calculateTransactionsWithHttpInfo($transaction_request)\n {\n $returnType = '\\TransferZero\\Model\\TransactionResponse';\n $request = $this->calculateTransactionsRequest($transaction_request);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode == 422) {\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 true\n );\n } elseif ($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()->getContents(),\n '\\TransferZero\\Model\\TransactionResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody()->getContents(),\n '\\TransferZero\\Model\\TransactionResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function findAllWalletTransactionsWithHttpInfo($id, $status = null, $transaction_type = null, string $contentType = self::contentTypes['findAllWalletTransactions'][0])\n {\n $request = $this->findAllWalletTransactionsRequest($id, $status, $transaction_type, $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 ('\\LagoClient\\Model\\WalletTransactionsPaginated' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\LagoClient\\Model\\WalletTransactionsPaginated' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\LagoClient\\Model\\WalletTransactionsPaginated', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\LagoClient\\Model\\WalletTransactionsPaginated';\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 '\\LagoClient\\Model\\WalletTransactionsPaginated',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getTransactionWithHttpInfo($hash)\n {\n $returnType = '\\Semux\\Client\\Model\\GetTransactionResponse';\n $request = $this->getTransactionRequest($hash);\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 '\\Semux\\Client\\Model\\GetTransactionResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function gETStockLocationIdInventoryReturnLocationsWithHttpInfo($stock_location_id)\n {\n $request = $this->gETStockLocationIdInventoryReturnLocationsRequest($stock_location_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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function restStockmanagementWarehousesWarehouseIdManagementRacksRackIdShelvesShelfIdStorageLocationsStorageLocationIdGetAsyncWithHttpInfo($warehouse_id, $rack_id, $shelf_id, $storage_location_id, $columns = null, $with = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\StorageLocation';\n $request = $this->restStockmanagementWarehousesWarehouseIdManagementRacksRackIdShelvesShelfIdStorageLocationsStorageLocationIdGetRequest($warehouse_id, $rack_id, $shelf_id, $storage_location_id, $columns, $with);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function transferAsyncWithHttpInfo($transfer)\n {\n $returnType = '\\GateApi\\Model\\TransactionID';\n $request = $this->transferRequest($transfer);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function gETInventoryStockLocationIdStockLocationWithHttpInfo($inventory_stock_location_id)\n {\n $request = $this->gETInventoryStockLocationIdStockLocationRequest($inventory_stock_location_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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function privateResourcesGetFileStorageInfoWithHttpInfo($tenant_id = null, $owner_id = null)\n {\n $request = $this->privateResourcesGetFileStorageInfoRequest($tenant_id, $owner_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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\Aurigma\\AssetStorage\\Model\\FileStorageInfoDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Aurigma\\AssetStorage\\Model\\FileStorageInfoDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Aurigma\\AssetStorage\\Model\\FileStorageInfoDto';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 '\\Aurigma\\AssetStorage\\Model\\FileStorageInfoDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function: check if the Test status is NOT_RECEIVED
public function isNotReceived() { if($this->test_status_id == Test::NOT_RECEIVED) return true; else return false; }
[ "public function testNotShouldReturnANotification()\n {\n $response = $this->call('GET', 'api/notifications/99999999');\n $this->assertEquals(400, $response->original['status']);\n }", "public function hasUnknownStatus()\n {\n return $this->unknown_status !== null;\n }", "public function isStatusFailed(){\n return $this->status == 'failed';\n }", "public function has_failed() {\n\n\t\treturn self::STATUS_UNSENT === $this->get_status();\n\t}", "public function testItemRecordResponseStatusFail()\n {\n $xmlDoc = file_get_contents(__DIR__ . '/../data/items/itemsnotfound.xml');\n $response = new ItemsRecordResponse($xmlDoc);\n\n $status = $response->getStatus();\n\n $this->assertNotEmpty($status);\n $this->assertArrayHasKey('status-code', $status);\n $this->assertNotEquals(0, $status['status-code']);\n }", "public function isUnavailable(): bool {\n return $this->result === FALSE;\n }", "public function isMissed(): bool\n {\n return $this->status == 'missed';\n }", "public function testGetByStatusFalse()\n {\n $status = 0;\n\n $this->getByStatus($status);\n\n }", "public function hasFailed()\n {\n return $this->getPushStatus() === self::STATUS_FAILED;\n }", "public function testNotShouldReturnATransaction()\n {\n $response = $this->call('GET', 'api/transactions/99999999');\n $this->assertEquals(400, $response->original['status']);\n }", "public function hasFailureHttpStatusCode(): bool\n {\n return !empty($this->failureHttpStatusCode);\n }", "public function isFailed()\n {\n return $this->status === SettlementStatus::STATUS_FAILED;\n }", "public function testReceiveTest(){\n $testIDs = Test::where('test_status_id','==', Test::NOT_RECEIVED);\n if(count($testIDs) == 0){\n $this->assertTrue(false);//Seed data lacking\n }\n\n // Set the current user to admin\n $this->be(User::first());\n\n foreach ($testIDs as $id) {\n\n $url = URL::route('test.receive', array($id));\n\n $crawler = $this->client->request('GET', $url);\n\n $this->assertTrue(Test::find($id)->test_status_id == Test::PENDING);\n\n $this->flushSession();\n }\n }", "function isStatusNo(){\n return ($this->status == 'no');\n }", "public function hasFailed()\n {\n return $this->status == 'failed';\n }", "public function hasFailed()\n {\n return $this->status === 'failed';\n }", "public function isPending()\n\t{\n\t\tif($this->test_status_id == Test::PENDING)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "public function isFailed()\n {\n return $this->status === self::FAILED;\n }", "function hasMessageStatus(){\n\t\treturn ( (isset($this->returnData['message_status']) && $this->returnData['message_status'] == 1) || !isset($this->returnData['message_status']) ) ? 1 : 0;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getHistStatsServiceField Get historical stats for a single service/field combination Note: the input parameter is an associative array with the keys listed as the parameter name below This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. URL:
public function getHistStatsServiceField($options) { list($response) = $this->getHistStatsServiceFieldWithHttpInfo($options); return $response; }
[ "public function getHistStatsFieldAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\HistoricalFieldResponse';\n $request = $this->getHistStatsFieldRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 (string) $response->getBody()\n );\n }\n );\n }", "public function getHistStatsServiceWithHttpInfo($options)\n {\n $request = $this->getHistStatsServiceRequest($options);\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 if ('GET' != 'GET' && 'GET' != 'HEAD') {\n $header = $response->getHeader('Fastly-RateLimit-Remaining');\n if (count($header) > 0) {\n $this->config->setRateLimitRemaining($header[0]);\n }\n\n $header = $response->getHeader('Fastly-RateLimit-Reset');\n if (count($header) > 0) {\n $this->config->setRateLimitReset($header[0]);\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 ('\\Fastly\\Model\\HistoricalAggregateResponse' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Fastly\\Model\\HistoricalAggregateResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Fastly\\Model\\HistoricalAggregateResponse';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 '\\Fastly\\Model\\HistoricalAggregateResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function history() {\n\n //parse inputs\n $resourcePath = \"/stats/history\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n // Generate form params\n if (! isset($body)) {\n $body = array();\n }\n if (empty($body)) {\n $body = null;\n }\n\n // Make the API Call\n $response = $this->apiClient->callAPI($resourcePath, $method,\n $queryParams, $body,\n $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n $responseObject = $this->apiClient->deserialize($response,\n 'Array[StatsHistory]');\n return $responseObject;\n\n }", "public function getHistogram(ContextInterface $ctx, GetHistogramRequest $request): GetHistogramResponse;", "public function getHistograms(GetHistogramsRequest $request)\n {\n $headers = array();\n $params = array();\n if ($request->getTopic() !== null) {\n $params ['topic'] = $request->getTopic();\n }\n if ($request->getFrom() !== null) {\n $params ['from'] = $request->getFrom();\n }\n if ($request->getTo() !== null) {\n $params ['to'] = $request->getTo();\n }\n if ($request->getQuery() !== null) {\n $params ['query'] = $request->getQuery();\n }\n $params ['type'] = 'histogram';\n\n $project = $request->getProject() ?: '';\n $logStore = $request->getLogStore() ?: '';\n\n $resource = \"/logstores/$logStore\";\n list ( $resp, $header ) = $this->send(\"GET\", $project, null, $resource, $params, $headers);\n\n $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';\n $resp = $this->parseToJson($resp, $requestId);\n\n return new GetHistogramsResponse ($resp, $header);\n }", "public function getHistograms(Aliyun_Log_Models_GetHistogramsRequest $request) {\n $headers = array ();\n $params = array ();\n if ($request->getTopic () !== null)\n $params ['topic'] = $request->getTopic ();\n if ($request->getFrom () !== null)\n $params ['from'] = $request->getFrom ();\n if ($request->getTo () !== null)\n $params ['to'] = $request->getTo ();\n if ($request->getQuery () !== null)\n $params ['query'] = $request->getQuery ();\n $params ['type'] = 'histogram';\n $logstore = $request->getLogstore () !== null ? $request->getLogstore () : '';\n $project = $request->getProject () !== null ? $request->getProject () : '';\n $resource = \"/logstores/$logstore\";\n list ( $resp, $header ) = $this->send ( \"GET\", $project, NULL, $resource, $params, $headers );\n $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';\n $resp = $this->parseToJson ( $resp, $requestId );\n return new Aliyun_Log_Models_GetHistogramsResponse ( $resp, $header );\n }", "public function getHostServiceStatistics($hostName) {\n\t\tif ($hostName == null || sizeof($hostName)==0) {\n\t\t\treturn null;\n\t\t}\n try {\n \tif (!isset($this->client))\n $this->getSoapConnection();\n\t\t\t$statistics = @$this->client->getStatistics(\"TOTALS_FOR_SERVICES_BY_HOSTNAME\", $hostName, \"\");\n\t\t\t// should put the following:\n\t\t\t// if (is_soap_fault($statistics))\n\t\t\t// throw new Exception(\"SOAP Fault: (faultcode: {$statistics->faultcode}, faultstring: {$statistics->faultstring})\"); \n\t \t$stats = $statistics->StateStatistics;\n\t \t$serviceStats = null;\n\t\t if (isset($stats)) {\n\t \t\t$serviceStats = array();\n\t\t \t$serviceStats['Name'] = $stats->Name;\n\t\t \t$serviceStats['TotalServices'] = $stats->TotalServices;\n\t\t \t$serviceStats['TotalHosts'] = $stats->TotalHosts;\n\t\t \tforeach($stats->Statistic as $statistic) {\n\t\t \t\t$serviceStats[$statistic->name] = $statistic->count;\n\t\t \t}\n\t \t}\n \t\n \t\treturn $serviceStats;\n\t \t}\n\t \tcatch(SoapFault $exception) {\n\t \t\t// TODO: Logging?\n\t \t\tthrow $exception;\n\t \t}\n\t \tcatch (Exception $e) {\n\t \t\t//print(\"DEBUG: AN UNEXPECTED EXCEPTION OCCURRED! \".$e->getMessage());\n\t \t\tthrow $exception;\n\t \t}\n\t\t\t\t\n\t}", "public function getHistogram()\n {\n return $this->readOneof(9);\n }", "public function getStatsFields(): array {}", "function GetStatHourly()\n {\n $date_clause = $this->MakeSqlForDate();\n if (strlen($date_clause) > 0)\n {\n $date_clause = \" WHERE $date_clause\";;\n }\n\t\t$SQL = sprintf(\"\n SELECT\n COUNT(DISTINCT(remote_host)) AS c_hosts,\n COUNT(DISTINCT(referer_domain)) AS c_refs,\n COUNT(HOUR(visit_date)) AS c_hits,\n HOUR (visit_date) AS hour_val\n FROM %s %s\n GROUP BY HOUR (visit_date)\n ORDER BY hour_val\n\t\t\t\",\n \t\t$this->getTable(\"StatTable\"),\n \t\t$date_clause\n\t\t);\n $reader =& $this->Connection->ExecuteReader($SQL);\n return $reader;\n }", "public function getHistStatsServiceAsync($options)\n {\n return $this->getHistStatsServiceAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getHistogramEntry()\n {\n return $this->histogramEntry;\n }", "public function getHistogramsJson(GetHistogramsRequest $request)\r\n {\r\n $headers = array();\r\n $params = array();\r\n if ($request->getTopic() !== null) {\r\n $params ['topic'] = $request->getTopic();\r\n }\r\n if ($request->getFrom() !== null) {\r\n $params ['from'] = $request->getFrom();\r\n }\r\n if ($request->getTo() !== null) {\r\n $params ['to'] = $request->getTo();\r\n }\r\n if ($request->getQuery() !== null) {\r\n $params ['query'] = $request->getQuery();\r\n }\r\n $params ['type'] = 'histogram';\r\n $logstore = $request->getLogstore() !== null ? $request->getLogstore() : '';\r\n $project = $request->getProject() !== null ? $request->getProject() : '';\r\n $resource = \"/logstores/$logstore\";\r\n list ($resp, $header) = $this->send(\"GET\", $project, null, $resource, $params, $headers);\r\n $requestId = isset ($header ['x-log-requestid']) ? $header ['x-log-requestid'] : '';\r\n $resp = $this->parseToJson($resp, $requestId);\r\n return array($resp, $header);\r\n }", "public function getHistogram()\n {\n return $this->readOneof(4);\n }", "function getHostGroupStatistics() {\n try {\n \tif (!isset($this->client))\n $this->getSoapConnection();\n\t\t\t$statistics = @$this->client->getStatistics(\"ALL_HOSTS\", \"\", \"\");\n\t\t\t// should put the following:\n\t\t\t// if (is_soap_fault($statistics))\n\t\t\t// throw new Exception(\"SOAP Fault: (f aultcode: {$statistics->faultcode}, faultstring: {$statistics->faultstring})\"); \n\t\t $stats = $statistics->StateStatistics;\n\t\t $hostStats = array();\n\t\t if (isset($stats)) {\n\t\t \tforeach($stats as $stat) {\n\t\t\t \t$hostStats[$stat->Name]['TotalServices'] = $stat->TotalServices;\n\t\t\t \t$hostStats[$stat->Name]['TotalHosts'] = $stat->TotalHosts;\n\t\t\t \tforeach($stat->Statistic as $statistic) {\n\t\t\t \t\t$hostStats[$stat->Name][$statistic->name] = $statistic->count;\n\t\t\t \t}\n\t\t \t}\n\t \t}\n\t \treturn $hostStats;\n\t \t}\n\t \tcatch(SoapFault $exception) {\n\t \t\t// TODO: Logging?\n\t\t\tthrow $exception;\n\t \t}\n\t \tcatch (Exception $e) {\n\t \t\tthrow $e;\n\t \t}\n\t}", "public function getValorHistorico(){\n return $this->valorHistorico;\n }", "public function getHistogramsJson(\\Aliyun\\Log\\Models\\Request\\GetHistogramsRequest $request) {\r\n $headers = array ();\r\n $params = array ();\r\n if ($request->getTopic () !== null)\r\n $params ['topic'] = $request->getTopic ();\r\n if ($request->getFrom () !== null)\r\n $params ['from'] = $request->getFrom ();\r\n if ($request->getTo () !== null)\r\n $params ['to'] = $request->getTo ();\r\n if ($request->getQuery () !== null)\r\n $params ['query'] = $request->getQuery ();\r\n $params ['type'] = 'histogram';\r\n $logstore = $request->getLogstore () !== null ? $request->getLogstore () : '';\r\n $project = $request->getProject () !== null ? $request->getProject () : '';\r\n $resource = \"/logstores/$logstore\";\r\n list ( $resp, $header ) = $this->send ( \"GET\", $project, NULL, $resource, $params, $headers );\r\n $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';\r\n $resp = $this->parseToJson ( $resp, $requestId );\r\n return array($resp, $header);\r\n }", "public function getHistograms(GetHistogramsRequest $request)\n {\n $ret = $this->getHistogramsJson($request);\n $resp = $ret[0];\n $header = $ret[1];\n return new GetHistogramsResponse($resp, $header);\n }", "public function getGrupoHist($idGrupo)\n {\n $sqlGrupoHist=\"SELECT g.id_cliente,\n g.id_persona,\n g.estado,\n g.estado_collections col,\n g.cod_ciudad,\n g.facturable f,\n g.id_cta_corriente,\n to_char(g.fecha_transaccion,'dd-mm-yyyy hh24:mi:ss') fecha_transaccion,\n to_char(g.fecha_inicio,'dd-mm-yyyy hh24:mi:ss') fecha_inicio,\n to_char(g.fecha_fin,'dd-mm-yyyy hh24:mi:ss') fecha_fin,\n g.ultimo,\n g.cod_usuario\n from billing.cl_grupo_hist g\n where g.id_grupo = $idGrupo\n order by g.fecha_inicio desc\";\n return $this->app['db']->fetchAll($sqlGrupoHist);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all scopes from cache.
public static function getFromCache() { return Cache::get('scopes'); }
[ "public function getScopes();", "public function getAll()\n {\n return $this->cache;\n }", "public function allCache() {\n return $this->_cache;\n }", "protected function getAllScopes()\r\n {\r\n return config( 'shopify.scopes' );\r\n }", "public function scopes()\n {\n return $this->get('v2/scopes');\n }", "public static function getAllByCache()\n {\n $configs = app('cache')->rememberForever('configs', function () {\n return self::getAll();\n });\n\n return $configs;\n }", "public function getAvailScopes()\n {\n return $this->listPublicMethods('#scope([a-zA-Z]+)#');\n }", "public function listCache() {\n return $this->cacheAdapter->listCache();\n }", "protected function getCachedPermissions()\n {\n return $this->cacheResults('permissions.all', function() {\n return Permission::all();\n });\n }", "public function getGlobalScopes()\n {\n\n }", "public function getAvailableScopes()\n {\n return $this->_scopes;\n }", "public static function allCached()\n {\n return Cache::tags(['settings'])->rememberForever('settings.all:' . App::currentLocale(), function () {\n return self::all()->mapWithKeys(function ($setting) {\n return [$setting->key => $setting->value];\n });\n });\n }", "protected function getCaches(): array\n {\n return $this->documentManager->getRepository('MBHPriceBundle:RoomCache')\n ->findForDashboard(static::PERIOD);\n }", "protected static function getSettingsScopes() : Collection\n {\n return collect(app(SettingsManager::class)::getDefaultScope());\n }", "public function getScopes($sessionId);", "protected function getCachedResults()\n {\n return Cache::get($this->getCacheKey(), []);\n }", "private function getCachedPermissionGroups()\n {\n return $this->cacheResults('permissions-groups.filters', function () {\n return PermissionsGroup::has('permissions')->get();\n });\n }", "public function get_scopes() {\n\t\treturn array(\n\t\t\t'https://www.googleapis.com/auth/analytics',\n\t\t\t'https://www.googleapis.com/auth/analytics.readonly',\n\t\t\t'https://www.googleapis.com/auth/analytics.manage.users',\n\t\t\t'https://www.googleapis.com/auth/analytics.edit',\n\t\t);\n\t}", "public function getGlobalScopes() : array\n {\n return \\Illuminate\\Support\\Arr::get(static::$globalScopes, static::class, []);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a cassandra_SliceRange with $start, $finish, $reversed and $count set from the parameters.
public static function slice_range($start = '', $finish = '', $reversed = false, $count = 100) { $sliceRange = new cassandra_SliceRange(); $sliceRange->start = $start; $sliceRange->finish = $finish; $sliceRange->reversed = $reversed; $sliceRange->count = $count; return $sliceRange; }
[ "public function slice($start, $end);", "function slice($start)\n{\n $args = func_get_args();\n if (count($args) === 1) {\n $slice = new slice();\n $slice->stop = $start;\n\n return $slice;\n }\n\n $slice = new slice();\n $slice->start = $start;\n $slice->stop = $args[1];\n $slice->step = isset($args[2]) ? $args[2] : 1;\n\n return $slice;\n}", "public function createSlicePredicate(\n\t\t$columns,\n\t\t$startColumn,\n\t\t$endColumn,\n\t\t$columnsReversed,\n\t\t$columnCount\n\t) {\n\t\t$predicate = new cassandra_SlicePredicate();\n\t\t$schema = $this->getSchema();\n\n\t\tif (is_array($columns)) {\n\t\t\tif ($this->autopack) {\n\t\t\t\t$packedColumns = array();\n\n\t\t\t\tforeach ($columns as $columnName) {\n\t\t\t\t\t$columnType = $this->getColumnNameType();\n\n\t\t\t\t\t$packedColumns[] = CassandraUtil::pack(\n\t\t\t\t\t\t$columnName,\n\t\t\t\t\t\t$columnType\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$predicate->column_names = $packedColumns;\n\t\t\t} else {\n\t\t\t\t$predicate->column_names = $columns;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($this->autopack) {\n\t\t\t\tif ($startColumn === null) {\n\t\t\t\t\t$startColumn = '';\n\t\t\t\t}\n\n\t\t\t\tif ($endColumn === null) {\n\t\t\t\t\t$endColumn = '';\n\t\t\t\t}\n\n\t\t\t\tif (!empty($startColumn)) {\n\t\t\t\t\t$columnType = $this->getColumnNameType();\n\n\t\t\t\t\t$startColumn = CassandraUtil::pack(\n\t\t\t\t\t\t$startColumn,\n\t\t\t\t\t\t$columnType\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($endColumn)) {\n\t\t\t\t\t$columnType = $this->getColumnNameType();\n\n\t\t\t\t\t$endColumn = CassandraUtil::pack(\n\t\t\t\t\t\t$endColumn,\n\t\t\t\t\t\t$columnType\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sliceRange = new cassandra_SliceRange();\n\t\t\t$sliceRange->count = $columnCount;\n\t\t\t$sliceRange->reversed = $columnsReversed;\n\t\t\t$sliceRange->start = $startColumn;\n\t\t\t$sliceRange->finish = $endColumn;\n\n\t\t\t$predicate->slice_range = $sliceRange;\n\t\t}\n\n\t\treturn $predicate;\n\t}", "public function range($offset = NULL, $limit = NULL);", "public function getRange($start,$end){\n if(!is_integer($start) || $start < 0){\n throw new InvalidArgumentException(\"Start must be a non-negative integer\");\n }\n\n if(!is_integer($end) || $end < 1){\n throw new InvalidArgumentException(\"End must be a positive integer\");\n }\n\n if($start >= $end){\n throw new InvalidArgumentException(\"End must be greater than start\");\n }\n\n if($start >= $this->count()){\n throw new InvalidArgumentException(\"Start must be less than the count of the items in the Collection\");\n }\n\n if($end >= $this->count()){\n throw new InvalidArgumentException(\"End must be less than the count of the items in the Collection\");\n }\n\n\n $subsetItems = array_slice($this->items,$start,$end - 1);\n $subset = new Collection($this->objectName);\n $subset->addRange($subsetItems);\n return $subset;\n\n }", "public function slice($start, $end)\n {\n return new Collection(array_slice($this->data, $start, $end));\n }", "public function getPageRange();", "public function slice($start, $end=null, $step=1) {\n $iterator = $this->getIterator();\n\n if ($start < 0) {\n if (!($this instanceof \\Countable)) {\n throw new \\InvalidArgumentException(\n 'Cannot use a negative start point on a non-countable iterable.'\n );\n }\n\n $start = count($this) + $start;\n }\n\n if ($end < 0) {\n if (!($this instanceof \\Countable)) {\n throw new \\InvalidArgumentException(\n 'Cannot use a negative end point on a non-countable iterable.'\n );\n }\n\n $end = count($this) + $end;\n } else if ($end === null && $this instanceof \\Countable) {\n $end = count($this);\n }\n\n $indexes = $end === null\n ? new SequenceIterator($start, $step)\n : new BoundedSequenceIterator($start, $end, $step);\n\n $slice_iterator = new SliceIterator($indexes, $iterator);\n\n return $indexes instanceof \\Countable\n ? new CountableIteratorIterable(count($indexes), $slice_iterator)\n : new IteratorIterable($slice_iterator);\n }", "protected abstract function fetchSlice($queryBuilder, $limit, $offset);", "public function slice(int $start, int $end = null): self\n {\n if ($start === $end) {\n return new static();\n }\n\n $length = $this->count() - 1;\n\n if ($end >= $length) {\n $end = $end === $length ? -1 : null;\n }\n\n return new static(array_slice($this->items, $start, $end, true));\n }", "public function lGetRange($key, $start, $end) {}", "function rawWikiSlices($range,$id,$rev=''){\n list($from,$to) = split('-',$range,2);\n $text = io_readFile(wikiFN($id,$rev));\n if(!$from) $from = 0;\n if(!$to) $to = strlen($text)+1;\n\n $slices[0] = substr($text,0,$from-1);\n $slices[1] = substr($text,$from-1,$to-$from);\n $slices[2] = substr($text,$to);\n\n return $slices;\n}", "public function lGetRange($key, $start, $end) { }", "abstract protected function slice($rows, $offset, $length = null);", "public function createRange();", "public function slice($count) {\n $slice = array();\n if ($this->getDataset()) {\n $stack = $this->getStack();\n while (is_array($stack) && count($stack) < $count) {\n $stack = array_merge($stack, $this->getSortedDataset());\n }\n $slice = array_slice($stack, 0, $count, TRUE);\n $stack = array_slice($stack, $count, NULL, TRUE);\n $this->setContainerData($stack);\n }\n\n return $slice;\n }", "function slice($offset, $length = 0);", "public function get_range_slices(\\cassandra\\ColumnParent $column_parent, \\cassandra\\SlicePredicate $predicate, \\cassandra\\KeyRange $range, $consistency_level);", "public function get_offset_range($offset,$count,$total){\n\t\t$to = 0;\n\t\tif($offset == 0){\n\t\t\t$to = $count;\n\t\t\tif($count > $total){\n\t\t\t\t$to = $total;\n\t\t\t}\n\t\t} else {\n\t\t\tif(($count+$offset) > $total){\n\t\t\t\t$to = $total;\n\t\t\t} else {\n\t\t\t\t$to = $count+$offset;\n\t\t\t}\n\t\t}\n\t\tif($offset > 0){ $from = $offset; } else { $from = 1; }\n\t\treturn array('from' => $from, 'to' => $to);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'getShipment'
protected function getShipmentRequest($shipment_id) { // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $shipment_id when calling getShipment' ); } $resourcePath = '/shipping/v1/shipments/{shipmentId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($shipment_id !== null) { $resourcePath = str_replace( '{' . 'shipmentId' . '}', ObjectSerializer::toPathValue($shipment_id), $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 $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($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\build_query($formParams); } } $query = \GuzzleHttp\Psr7\build_query($queryParams); $sign = new SignatureSellingPartner(); $headersX = $sign->calculateSignature($this->config->getApiKey("accessKey"), $this->config->getApiKey("secretKey"), $this->config->getApiKey("region"), $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace("https://", "", $this->config->getHost()), 'GET', $resourcePath, $query); $headers = array_merge( $headerParams, $headers, $headersX ); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "private function _convertGetShipment($request)\n {\n $parameters = array();\n $parameters['Action'] = 'GetShipment';\n if ($request->isSetSellerId()) {\n $parameters['SellerId'] = $request->getSellerId();\n }\n if ($request->isSetMWSAuthToken()) {\n $parameters['MWSAuthToken'] = $request->getMWSAuthToken();\n }\n if ($request->isSetShipmentId()) {\n $parameters['ShipmentId'] = $request->getShipmentId();\n }\n\n return $parameters;\n }", "protected function getShipmentRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling getShipment'\n );\n }\n\n $resourcePath = '/shipment/{shipmentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_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 }", "public function createShipment($request)\n {\n require_once(dirname(__FILE__) . '/Model/CreateShipmentResponse.php');\n return CreateShipmentResponse::fromXML($this->_invoke('CreateShipment'));\n }", "public function gETShipmentIdShippingMethodRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling gETShipmentIdShippingMethod'\n );\n }\n\n $resourcePath = '/shipments/{shipmentId}/shipping_method';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\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 (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 }", "public function getShipmentByOrderNo(Request $request)\n {\n $order_no = $request->order_no;\n //$order_no = 3;\n\n //$shipments = Shipment::where('order_no',$order_no)->with('order')->with('details.item')->get();\n $shipments = $this->shipment->getShipmentByOrderNo($order_no, 'PL');\n\n return response()->json(['state'=>true, 'shipments'=>$shipments]);\n }", "function CreateInboundShipment(Request\\CreateInboundShipmentRequest $request);", "protected function buildRequest_Shipment(&$shipment) {\n\t\t\n\t\t/** build the shipment node **/\n\t\t$service = $shipment->appendChild(new DOMElement('Service'));\n\t\t$service->appendChild(new DOMElement('Code',\n\t\t\t$this->shipment['service']));\n\t\t\n\t\t// iterate over the pacakges to create the package element\n\t\tforeach ($this->shipment['packages'] as $package) {\n\t\t\t$this->buildRequest_Package($shipment, $package);\n\t\t} // end for each package\n\t\t\n\t\t$this->buildRequest_ServiceOptions($shipment);\n\t\t\n\t\treturn $shipment;\n\t}", "public function getShipmentDetails();", "public function getTransportDetailsRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling getTransportDetails'\n );\n }\n\n $resourcePath = '/fba/inbound/v0/shipments/{shipmentId}/transport';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\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 $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 getShipmentDetailsRequest($shipmentId)\n {\n // verify the required parameter 'shipmentId' is set\n if ($shipmentId === null || (is_array($shipmentId) && count($shipmentId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipmentId when calling getShipmentDetails'\n );\n }\n\n $resourcePath = '/fba/outbound/brazil/v0/shipments/{shipmentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($shipmentId !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipmentId),\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\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 getShipmentRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {\n throw new InvalidArgumentException('Missing the required parameter $shipment_id when calling getShipment');\n }\n\n $resourcePath = '/mfn/v0/shipments/{shipmentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if (null !== $shipment_id) {\n $resourcePath = str_replace(\n '{'.'shipmentId'.'}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\n return $this->generateRequest($multipart, $formParams, $queryParams, $resourcePath, $headerParams, 'GET', $httpBody);\n }", "private function createShipmentObject()\n {\n switch ($this->getServiceMethod()) {\n case 'addShip':\n return new AddShip();\n case 'addShipment':\n return new AddShipment();\n }\n }", "protected function getShipmentItemRequest($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 getShipmentItem'\n );\n }\n\n $resourcePath = '/shipments/{id}';\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/ld+json', 'application/json', 'text/csv', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html'],\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 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 getTransportDetailsRequest($shipmentId)\n {\n // verify the required parameter 'shipmentId' is set\n if ($shipmentId === null || (is_array($shipmentId) && count($shipmentId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipmentId when calling getTransportDetails'\n );\n }\n\n $resourcePath = '/fba/inbound/v0/shipments/{shipmentId}/transport';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($shipmentId !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipmentId),\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\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 getShipmentDetailsRequest($limit = null, $sort_order = null, $next_token = null, $created_after = null, $created_before = null, $shipment_confirmed_before = null, $shipment_confirmed_after = null, $package_label_created_before = null, $package_label_created_after = null, $shipped_before = null, $shipped_after = null, $estimated_delivery_before = null, $estimated_delivery_after = null, $shipment_delivery_before = null, $shipment_delivery_after = null, $requested_pick_up_before = null, $requested_pick_up_after = null, $scheduled_pick_up_before = null, $scheduled_pick_up_after = null, $current_shipment_status = null, $vendor_shipment_identifier = null, $buyer_reference_number = null, $buyer_warehouse_code = null, $seller_warehouse_code = null)\n {\n if ($limit !== null && $limit > 50) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling VendorShippingV1Api.getShipmentDetails, must be smaller than or equal to 50.');\n }\n if ($limit !== null && $limit < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling VendorShippingV1Api.getShipmentDetails, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/vendor/shipping/v1/shipments';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n\n // query params\n if (is_array($sort_order)) {\n $sort_order = ObjectSerializer::serializeCollection($sort_order, '', true);\n }\n if ($sort_order !== null) {\n $queryParams['sortOrder'] = $sort_order;\n }\n\n // query params\n if (is_array($next_token)) {\n $next_token = ObjectSerializer::serializeCollection($next_token, '', true);\n }\n if ($next_token !== null) {\n $queryParams['nextToken'] = $next_token;\n }\n\n // query params\n if (is_array($created_after)) {\n $created_after = ObjectSerializer::serializeCollection($created_after, '', true);\n }\n if ($created_after !== null) {\n $queryParams['createdAfter'] = $created_after;\n }\n\n // query params\n if (is_array($created_before)) {\n $created_before = ObjectSerializer::serializeCollection($created_before, '', true);\n }\n if ($created_before !== null) {\n $queryParams['createdBefore'] = $created_before;\n }\n\n // query params\n if (is_array($shipment_confirmed_before)) {\n $shipment_confirmed_before = ObjectSerializer::serializeCollection($shipment_confirmed_before, '', true);\n }\n if ($shipment_confirmed_before !== null) {\n $queryParams['shipmentConfirmedBefore'] = $shipment_confirmed_before;\n }\n\n // query params\n if (is_array($shipment_confirmed_after)) {\n $shipment_confirmed_after = ObjectSerializer::serializeCollection($shipment_confirmed_after, '', true);\n }\n if ($shipment_confirmed_after !== null) {\n $queryParams['shipmentConfirmedAfter'] = $shipment_confirmed_after;\n }\n\n // query params\n if (is_array($package_label_created_before)) {\n $package_label_created_before = ObjectSerializer::serializeCollection($package_label_created_before, '', true);\n }\n if ($package_label_created_before !== null) {\n $queryParams['packageLabelCreatedBefore'] = $package_label_created_before;\n }\n\n // query params\n if (is_array($package_label_created_after)) {\n $package_label_created_after = ObjectSerializer::serializeCollection($package_label_created_after, '', true);\n }\n if ($package_label_created_after !== null) {\n $queryParams['packageLabelCreatedAfter'] = $package_label_created_after;\n }\n\n // query params\n if (is_array($shipped_before)) {\n $shipped_before = ObjectSerializer::serializeCollection($shipped_before, '', true);\n }\n if ($shipped_before !== null) {\n $queryParams['shippedBefore'] = $shipped_before;\n }\n\n // query params\n if (is_array($shipped_after)) {\n $shipped_after = ObjectSerializer::serializeCollection($shipped_after, '', true);\n }\n if ($shipped_after !== null) {\n $queryParams['shippedAfter'] = $shipped_after;\n }\n\n // query params\n if (is_array($estimated_delivery_before)) {\n $estimated_delivery_before = ObjectSerializer::serializeCollection($estimated_delivery_before, '', true);\n }\n if ($estimated_delivery_before !== null) {\n $queryParams['estimatedDeliveryBefore'] = $estimated_delivery_before;\n }\n\n // query params\n if (is_array($estimated_delivery_after)) {\n $estimated_delivery_after = ObjectSerializer::serializeCollection($estimated_delivery_after, '', true);\n }\n if ($estimated_delivery_after !== null) {\n $queryParams['estimatedDeliveryAfter'] = $estimated_delivery_after;\n }\n\n // query params\n if (is_array($shipment_delivery_before)) {\n $shipment_delivery_before = ObjectSerializer::serializeCollection($shipment_delivery_before, '', true);\n }\n if ($shipment_delivery_before !== null) {\n $queryParams['shipmentDeliveryBefore'] = $shipment_delivery_before;\n }\n\n // query params\n if (is_array($shipment_delivery_after)) {\n $shipment_delivery_after = ObjectSerializer::serializeCollection($shipment_delivery_after, '', true);\n }\n if ($shipment_delivery_after !== null) {\n $queryParams['shipmentDeliveryAfter'] = $shipment_delivery_after;\n }\n\n // query params\n if (is_array($requested_pick_up_before)) {\n $requested_pick_up_before = ObjectSerializer::serializeCollection($requested_pick_up_before, '', true);\n }\n if ($requested_pick_up_before !== null) {\n $queryParams['requestedPickUpBefore'] = $requested_pick_up_before;\n }\n\n // query params\n if (is_array($requested_pick_up_after)) {\n $requested_pick_up_after = ObjectSerializer::serializeCollection($requested_pick_up_after, '', true);\n }\n if ($requested_pick_up_after !== null) {\n $queryParams['requestedPickUpAfter'] = $requested_pick_up_after;\n }\n\n // query params\n if (is_array($scheduled_pick_up_before)) {\n $scheduled_pick_up_before = ObjectSerializer::serializeCollection($scheduled_pick_up_before, '', true);\n }\n if ($scheduled_pick_up_before !== null) {\n $queryParams['scheduledPickUpBefore'] = $scheduled_pick_up_before;\n }\n\n // query params\n if (is_array($scheduled_pick_up_after)) {\n $scheduled_pick_up_after = ObjectSerializer::serializeCollection($scheduled_pick_up_after, '', true);\n }\n if ($scheduled_pick_up_after !== null) {\n $queryParams['scheduledPickUpAfter'] = $scheduled_pick_up_after;\n }\n\n // query params\n if (is_array($current_shipment_status)) {\n $current_shipment_status = ObjectSerializer::serializeCollection($current_shipment_status, '', true);\n }\n if ($current_shipment_status !== null) {\n $queryParams['currentShipmentStatus'] = $current_shipment_status;\n }\n\n // query params\n if (is_array($vendor_shipment_identifier)) {\n $vendor_shipment_identifier = ObjectSerializer::serializeCollection($vendor_shipment_identifier, '', true);\n }\n if ($vendor_shipment_identifier !== null) {\n $queryParams['vendorShipmentIdentifier'] = $vendor_shipment_identifier;\n }\n\n // query params\n if (is_array($buyer_reference_number)) {\n $buyer_reference_number = ObjectSerializer::serializeCollection($buyer_reference_number, '', true);\n }\n if ($buyer_reference_number !== null) {\n $queryParams['buyerReferenceNumber'] = $buyer_reference_number;\n }\n\n // query params\n if (is_array($buyer_warehouse_code)) {\n $buyer_warehouse_code = ObjectSerializer::serializeCollection($buyer_warehouse_code, '', true);\n }\n if ($buyer_warehouse_code !== null) {\n $queryParams['buyerWarehouseCode'] = $buyer_warehouse_code;\n }\n\n // query params\n if (is_array($seller_warehouse_code)) {\n $seller_warehouse_code = ObjectSerializer::serializeCollection($seller_warehouse_code, '', true);\n }\n if ($seller_warehouse_code !== null) {\n $queryParams['sellerWarehouseCode'] = $seller_warehouse_code;\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 $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testLandedCostShipmentGETRequestShipmentIDGet()\n {\n }", "public function testPOSTShipmentCreate (ApiTester $I) {\n $I->haveHttpHeader('TOKEN', 'test-token');\n $I->sendPOST(\"com/cus/req_ship\", json_encode([\"orders\"=>[1, 10]]));\n $I->seeResponseCodeIs(\\Codeception\\Util\\HttpCode::OK);\n }", "public function gETShipmentIdStockLocationRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling gETShipmentIdStockLocation'\n );\n }\n\n $resourcePath = '/shipments/{shipmentId}/stock_location';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\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 (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 }", "public function gETStockTransferIdShipmentRequest($stock_transfer_id)\n {\n // verify the required parameter 'stock_transfer_id' is set\n if ($stock_transfer_id === null || (is_array($stock_transfer_id) && count($stock_transfer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $stock_transfer_id when calling gETStockTransferIdShipment'\n );\n }\n\n $resourcePath = '/stock_transfers/{stockTransferId}/shipment';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($stock_transfer_id !== null) {\n $resourcePath = str_replace(\n '{' . 'stockTransferId' . '}',\n ObjectSerializer::toPathValue($stock_transfer_id),\n $resourcePath\n );\n }\n\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 (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 }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the code filtre.
public function setCodeFiltre($codeFiltre) { $this->codeFiltre = $codeFiltre; return $this; }
[ "abstract public static function getCodeFilter();", "public function setCode( $code );", "public function setFilter($filter){}", "public function addFormCodeFilter($code)\n {\n return $this->addFieldToFilter('main_table.form_code', $code);\n }", "public function setFilterToolbarEvent($event, $code)\n\t{\n\t\tforeach ($this->filterToolbarValidators as $validator)\n\t\t{\n\t\t\t$validator->validate(array_add(array(), $event, $code));\n\t\t}\n\n\t\t$this->filterToolbarOptions = array_merge($this->filterToolbarOptions, array_add(array(), $event, '###' . $code . '###'));\n\n\t\treturn $this;\n\t}", "function setFilter($filter)\n\t{\n\t\t$this->filter = $filter;\n\t}", "public function set_code($value)\r\n\t{\r\n\t\treturn $this->set_attr('code', $value);\r\n\t}", "public function setFunctionCode($code);", "function set_attr_filter( $attr_filter ){\t\n\t\t$this->attr_filter = $attr_filter;\n\t}", "private function setFilter()\n\t{\n\t\t$this->filter['month'] = $this->URL->getParameter('month');\n\t\t$this->filter['year'] = $this->URL->getParameter('year');\n\t}", "public function testSetCode() {\n\n $obj = new ClientsSelAvance();\n\n $obj->setCode(\"code\");\n $this->assertEquals(\"code\", $obj->getCode());\n }", "public function setCode($str)\n {\n $str = strtolower($str);\n\n if ($str == 'soundex' || $str == 'phonix') {\n $this->_code = $str;\n if ($str == 'phonix') {\n $this->_map = $this->_aphonixCode;\n } else {\n $this->_map = $this->_asoundexCode;\n }\n }\n\n return $this;\n }", "public function setFilter(?CustomerCustomAttributeFilterValue $filter): void\n {\n $this->filter = $filter;\n }", "public function setProtectCode($code);", "private function setFilter(): void\n {\n $this->filter['language'] = $this->getRequest()->query->get('language', []);\n if (empty($this->filter['language'])) {\n $this->filter['language'] = BL::getWorkingLanguage();\n }\n $this->filter['application'] = $this->getRequest()->query->get('application');\n $this->filter['module'] = $this->getRequest()->query->get('module');\n $this->filter['type'] = $this->getRequest()->query->get('type', '');\n if ($this->filter['type'] === '') {\n $this->filter['type'] = null;\n }\n $this->filter['name'] = $this->getRequest()->query->get('name');\n $this->filter['value'] = $this->getRequest()->query->get('value');\n\n $ids = $this->getRequest()->query->get('ids', '');\n if ($ids === '') {\n $ids = [];\n } else {\n $ids = explode('|', $ids);\n }\n $this->filter['ids'] = $ids;\n\n foreach ($this->filter['ids'] as $id) {\n // someone is messing with the url, clear ids\n if (!is_numeric($id)) {\n $this->filter['ids'] = [];\n break;\n }\n }\n }", "public function SetFilters($filters) {$this->filters = $filters;}", "public function setFilter($filter) {\n\t\t$this->filter = $filter;\n\t}", "public function setDataFilterCallback($function)\n {\n $this->_dataFilterCallback = $function;\n }", "public function addAttributeCodeFilter($attributeCode)\n\t{\n\t\treturn $this->addFieldToFilter('attribute_code', $attributeCode);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get link for all asset
public function getAllAssetUrl() { if (\TSInit::$app->trader->isGuest) { return Link::getTraderRegistrationLink(); } return Platform::getURL(Platform::URL_CFD_ID); }
[ "public function getLink(){\n $link =$this->webresource->searchLinkInContext();\n foreach ($link as $l){\n echo $l->ResourceURL . \"\\n\";\n }\n }", "public function getAbsoluteLink();", "public function getAssetsUrl()\n {\n return Yii::app()->getAssetManager()->publish($this->getAssetsPath());\n }", "function get_assets_url() {\n\treturn URL . 'assets/';\n}", "public function getAssetsUrl()\n {\n if ($this->_assetsUrl === null) {\n \n $this->_assetsUrl = Yii::app()->getAssetManager()->publish(\n Yii::getPathOfAlias('album.assets')\n );\n }\n return $this->_assetsUrl;\n }", "public function getLinks();", "public function getHref() { }", "public function getExternalLinks()\n {\n return [\n 'https://client.besteron.com/inline/css/widget.css'\n ];\n }", "function remote_asset_url()\n\t{\n\t\t$remote_url = $this->_remote_url('assets');\n\t\treturn $remote_url;\n\t}", "public function getAssetUrl(): string\n {\n return $this->getPathAssetUrl($this->file);\n }", "public function getAssetsUrl() {\r\n \r\n \tif (isset($this->_assetsUrl)) {\r\n \t\treturn $this->_assetsUrl;\r\n \t} else {\r\n \t\treturn $this->_assetsUrl = Yii::app()->getAssetManager()->publish(realpath(dirname(__FILE__) . '/../assets'), false, -1, $this->forceCopyAssets);\r\n \t}\r\n }", "protected function links()\n {\n $links = [\n fusion_path('public') => public_path('vendor/fusion'),\n ];\n\n $links = array_merge(\n $links,\n app('addons.manifest')->getResourceLinks()\n );\n\n return $links;\n }", "public static function assets()\n {\n return self::dirURL() . 'assets/';\n }", "abstract protected function getApiAssetsUrlTemplate();", "public function getAssets();", "public function getAllURLs()\n {\n return $this->LinkCache->getAllURLs();\n }", "public function getDownloadLink();", "public function getUrls();", "public function getProductLinks();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch coaches from database
public function get_coaches() { $this->db->select('id, username, email'); $this->db->from('users'); $this->db->where('group_id', '100'); $this->db->order_by('username asc'); $query = $this->db->get(); $query->result_array(); // Store in array $statuser = array(); foreach ($query->result_array() as $v) { $statuser[] = array( 'id' => $v['id'], 'username' => $v['username'], 'email' => $v['email'] ); } // Returns coaches return $statuser; }
[ "public function coaches()\n {\n return $this->hasMany('App\\Coach');\n }", "function gr_get_coaches()\n{\n $role_id = gr_get_role_id('coach');\n $franchise_id = Auth::getPayload()->get('franchise_id');\n $club_id = Auth::getPayload()->get('club_id');\n\n $coaches = DB::table('user')\n ->select('user_id AS key', 'display_name AS value')\n ->where('franchise_id', '=', $franchise_id)\n ->where('club_id', '=', $club_id)\n ->where('user_role', $role_id)\n ->get();\n return $coaches;\n}", "public function coaches()\n\t{\n\t\treturn $this->belongsToMany('App\\Coach')->withPivot('number', 'role')->orderBy('last');\n\t}", "public function getCourseCoaches(){\n \t$course_coaches = Courses_coach::all();\n \tif (count($course_coaches)==0) {\n \t\treturn response()->json(['data' => '' , 'message' => 'No Course Coaches'], 400);\n \t}\n \treturn response()->json(['data' => $course_coaches , 'message' => 'ok'], 200);\n }", "public function coaches()\n\t{\n\t\t$title = t('All Coaches');\n\n\t\t$requestStatus = NULL;\n\t\tif (Auth::check()) {\n\t $user = Auth::user();\n\t $foundRequest = AppliedCoach::where('user_id', $user->id)->orderBy('id', 'DESC')->first();\n\t if ($foundRequest) {\n\t \tif ($foundRequest->status == 'approve') {\n\t\t\t\t\t$requestStatus = NULL;\n\t \t} else {\n\t\t \t$requestStatus = $foundRequest->status;\n\t \t}\n\t }\n\t\t}\n\n\t\t$allUsers = AppliedCoach::with('users')->whereHas('users', function ($query) {\n \t\t$query->where('role_id', '2')->where('status', 'active');\n \t})->where('status', 'approve')->get();\n\n\t\t\n\t\treturn view('frontend.coaches', compact('title', 'allUsers', 'requestStatus'));\n\t}", "function wp_wodify_get_api_coaches ( ) {\n $result = wp_wodify_api_request('coaches');\n $option = '_wp_wodify_api_cache_coaches';\n update_option( $option , $result , false );\n}", "abstract public function getMoreGeocaches(array $params);", "public function fetchAllComedies()\n\t{\n\t\t$genreid = 7;\n\t\t$query = \"SELECT {$this->table}.*,\n\t\t\t\t\t\t\tgenre.*,\n\t\t\t\t\t\t\tvid_collection.*\n\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t{$this->table}\n\t\t\t\t\t\t\tJOIN vid_collection \n\t\t\t\t\t\t\tON ({$this->table}.video_id = vid_collection.video_id) \n\t\t\t\t\t\t\tJOIN genre \n\t\t\t\t\t\t\tON({$this->table}.genre_id = genre.genre_id)\n\t\t\t\t\t\t\tWHERE {$this->table}.genre_id = :genreid\";\n\n\t\t$params = array(':genreid' => $genreid);\n\t\t$stmt = static::$dbh->prepare($query);\n\t\t$stmt->execute($params);\n\t\treturn $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t}", "function ListCompetitionCoachesManagers( $competition )\n {\n global $db_hostname,$db_username,$db_password, $db_database, $mysqli;\n\n $mysqli = new mysqli($db_hostname,$db_username,$db_password, $db_database);\n\n $sqlinner = \"\n SELECT \n COACHES.fkcompetitionmanualid\n ,COACHES.emailaddress \n ,COACHES.lastname\n ,COACHES.firstname\n ,COACHES.mobile\n ,COACHES.teamname\n ,COACHES.role\n ,COACHES.gender\n ,COACHES.agegroup\n ,COACHES.kitnumber\n ,COACHES.hiredatekit\n ,COACHES.comments\n ,COACHES.keycolour\n ,COACHES.keynumber\n FROM \n belnorth_players.coachmanagerdetails COACHES\n WHERE \n COACHES.FKcompetitionmanualid = '\".$competition.\"' \n ORDER BY lastname\n \";\n \n\n // echo $sqlinner;\n\n $r_queryinner = $mysqli->query($sqlinner);\n\n // $soccerteam = new SoccerTeam();\n\n $coachmanagerlist = array();\n\n if ( $r_queryinner )\n {\n while ($rowinner = mysqli_fetch_assoc($r_queryinner))\n {\n \n $coachmanagerdetails = new CoachesManagers();\n $coachmanagerdetails->fkcompetitionmanualid = $rowinner['fkcompetitionmanualid'];\n $coachmanagerdetails->emailaddress = $rowinner['emailaddress'];\n $coachmanagerdetails->lastname = $rowinner['lastname'];\n $coachmanagerdetails->firstname = $rowinner['firstname'];\n $coachmanagerdetails->mobile = $rowinner['mobile'];\n $coachmanagerdetails->teamname = $rowinner['teamname'];\n $coachmanagerdetails->role = $rowinner['role'];\n $coachmanagerdetails->gender = $rowinner['gender'];\n $coachmanagerdetails->agegroup = $rowinner['agegroup'];\n $coachmanagerdetails->kitnumber = $rowinner['kitnumber'];\n $coachmanagerdetails->hiredatekit = $rowinner['hiredatekit'];\n $coachmanagerdetails->comments = $rowinner['comments'];\n $coachmanagerdetails->keycolour = $rowinner['keycolour'];\n $coachmanagerdetails->keynumber = $rowinner['keynumber'];\n\n $coachmanagerlist[] = $coachmanagerdetails;\n }\n }\n\n echo (json_encode( $coachmanagerlist ));\n }", "private function fetchCampaigns() {\n $hash = $this->uri->segment(2);\n\n if( !$hash ) {\n show_error('Unknown campaign id');\n return;\n }\n\n $campaign = $this->Campaign_model\n ->where('campaigns.campaign_token', $hash)\n ->find();\n\n $opportunity = false;\n\n if( !count($campaign) || $campaign[0]->campaign_id ) {\n $opportunity = $this->Opportunity_model\n ->where('campaigns.campaign_token', $hash)\n ->find();\n }\n\n if( $opportunity && count($opportunity) ) {\n $opportunity = $opportunity[0];\n $campaign = $opportunity->campaign;\n } else {\n $campaign = $campaign[0];\n $opportunity = false;\n }\n\n return array(\n 'campaign' => $campaign,\n 'opportunity' => $opportunity\n );\n }", "public function getMyHouses()\n\t{\n\t\t$cacheID = self::getHousesURLCacheID(); // get the cache id \n\t\t$myhouses=Yii::app()->cache->get($cacheID);\n\t\tif($myhouses===false)\n\t\t{\n\t\t\t$criteria=new CDbCriteria;\n\t\t\t$criteria->select='url'; // only select the 'title' column\n\t\t\t$criteria->condition='user_id=:userID';\n\t\t\t$criteria->params=array(':userID'=>Yii::app()->user->id);\n\t\t\t$houses=House::model()->findAll($criteria);\n\t\t\t\n\t\t\t$myhouses = array(); // declaring $myhouses will prevent the case when there is no houses\n\t\t\tforeach ($houses as $house) $myhouses[]=$house->url;\n\t\t\tYii::app()->cache->set($cacheID, $myhouses);\n\t\t}\n\t\treturn $myhouses;\n\t}", "public function fetchAllShipsData();", "function getApartments()\n {\n $sql = \"SELECT * FROM property INNER JOIN apartment ON property.prop_id = apartment.prop_id ORDER BY property.prop_id\";\n $statement = $this->_db->prepare($sql);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetch_data()\n\t{\n\t\tglobal $Mysql;\n\t\t\n\t\t$colony_qry = $Mysql->query(\"SELECT * FROM `colonies` \n\t\t\tWHERE `id`=\". $this->id);\n\t\t$colony_qry->data_seek(0);\n\t\t$colony_row = $colony_qry->fetch_assoc();\n\n\t\t// This loop is going through all DB fields instead of object fields.\n\t\t// The resource fields are being pulled from their raw fields.\n\t\tforeach ( $this as $field => $value )\n\t\t{\n\t\t\tif ( $field == 'resources' )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t$this->$field = $colony_row[$field];\n\t\t}\n\t\t//print_arr($this);\n\t\t$this->resources = new Colony_Resources($colony_row);\n\t}", "public function fetchEntries();", "public function fetch()\n {\n $routes = Route::select('route.Route_Id', 'Route_Name')\n ->join('travelschedule', 'route.Route_Id', '=', 'travelschedule.Route_Id')\n ->join('traveldispatch', 'traveldispatch.TravelSchedule_Id', '=', 'travelschedule.TravelSchedule_Id')\n ->join('bus', 'bus.Bus_Id', '=', 'traveldispatch.Bus_Id')\n ->join('triptype', 'bus.TripType_Id', '=', 'triptype.TripType_Id')\n ->where('TripType_Name', '=', 'Provincial')\n ->where('route.Record_Status', '=', 'Active')\n ->orderBy('Route_Name', 'asc')\n ->distinct()\n ->get();\n return $routes;\n }", "public function _listAllCoachesForTable(){\n $coachData = new Coach();\n $arrayCoachData = $this->coachDAO->listAllCoaches();\n for ($i = 0; $i < count($arrayCoachData); $i++){\n $coachData = $arrayCoachData[$i];\n $tr[] = \" \n\t\t\t<tr>\n <td><input type=\\\"checkbox\\\" value=\\\"1\\\" name=\\\"marcar[]\\\" /></td>\n\t\t\t\t<td>\" . $coachData->__getIdCoach() . \"</td>\n \t\t\t<td>\" . $coachData->__getCoachName() . \"</td>\n \t\t\t<td>\" . $coachData->__getCoachPhone() . \"</td>\n \t\t\t<td>\" . $coachData->__getCoachCpf() . \"</td>\n \t\t\t<td>\n \t\t\t<a href=\\\"?pag=tecnico&action=edit&id=\" . \n $coachData->__getIdCoach() .\n \"\\\"><img src=\\\"./views/images/edit.png\\\" width=\\\"16\\\" height=\\\"16\\\" /></a>\n \t\t\t<a href=\\\"?pag=tecnico&action=exclude&id=\" . \n $coachData->__getIdCoach() . \n \"\\\"><img src=\\\"./views/images/delete.png\\\" width=\\\"16\\\" height=\\\"16\\\" /></a>\n \t\t\t</td>\n </tr>\";\n }\n return $tr;\n }", "public function fetchImages() {\n $db = new Connection();\n $db->open();\n $images = $db->runQuery(\"SELECT * FROM clubs,clubimages WHERE clubs.club_id = clubimages.club_id AND clubs.club_id = \". $this->getId() .\"\");\n $db->close();\n\n // Add images to a club object\n while ($row = $images->fetch_assoc()) {\n\n $iId = $row[\"image_id\"];\n $iClubId = $row[\"club_id\"];\n $iImagePath = $row[\"imagePath\"];\n $iAltName = $row[\"altName\"];\n\n $this->addImage(new Image($iId, $iClubId, $iImagePath, $iAltName));\n }\n\n }", "function GetCompetitionCoach( $competition, $emailaddress )\n {\n global $db_hostname,$db_username,$db_password, $db_database, $mysqli;\n\n $mysqli = new mysqli($db_hostname,$db_username,$db_password, $db_database);\n\n $sqlinner = \"\n SELECT \n COACHES.fkcompetitionmanualid\n ,COACHES.emailaddress \n ,COACHES.lastname\n ,COACHES.firstname\n ,COACHES.mobile\n ,COACHES.teamname\n ,COACHES.role\n ,COACHES.gender\n ,COACHES.agegroup\n ,COACHES.kitnumber\n ,COACHES.hiredatekit\n ,COACHES.comments\n ,COACHES.keycolour\n ,COACHES.keynumber\n FROM \n belnorth_players.coachmanagerdetails COACHES\n WHERE \n COACHES.FKcompetitionmanualid = '\".$competition.\"' AND\n COACHES.emailaddress = '\".$emailaddress.\"'\n \";\n \n\n // echo $sqlinner;\n\n $r_queryinner = $mysqli->query($sqlinner);\n\n // $soccerteam = new SoccerTeam();\n\n $coachmanagerout = new CoachesManagers();\n\n if ( $r_queryinner )\n {\n while ($rowinner = mysqli_fetch_assoc($r_queryinner))\n {\n \n $coachmanagerdetails = new CoachesManagers();\n $coachmanagerdetails->fkcompetitionmanualid = $rowinner['fkcompetitionmanualid'];\n $coachmanagerdetails->emailaddress = $rowinner['emailaddress'];\n $coachmanagerdetails->lastname = $rowinner['lastname'];\n $coachmanagerdetails->firstname = $rowinner['firstname'];\n $coachmanagerdetails->mobile = $rowinner['mobile'];\n $coachmanagerdetails->teamname = $rowinner['teamname'];\n $coachmanagerdetails->role = $rowinner['role'];\n $coachmanagerdetails->gender = $rowinner['gender'];\n $coachmanagerdetails->agegroup = $rowinner['agegroup'];\n $coachmanagerdetails->kitnumber = $rowinner['kitnumber'];\n $coachmanagerdetails->comments = $rowinner['comments'];\n $coachmanagerdetails->keycolour = $rowinner['keycolour'];\n $coachmanagerdetails->keynumber = $rowinner['keynumber'];\n\n // Single coach returned\n $coachmanagerout = $coachmanagerdetails;\n break;\n }\n }\n\n echo (json_encode( $coachmanagerout ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns available configurations for this definition.
public function getConfigurations() { return $this->configurations; }
[ "public function getConfigs() : array\n {\n return $this->configs;\n }", "protected function all()\n {\n return static::$config;\n }", "public static function getall_config() { return self::$config; }", "protected function getConfigs()\n {\n $cacheKey = $this->getCacheKey();\n $configs = $this->cache->fetch($cacheKey);\n if (false === $configs) {\n $configs = $this->collectConfigs();\n $this->cache->save($cacheKey, $configs);\n }\n\n return $configs;\n }", "public function getList()\n {\n\n $this->finder = new ConfigFinder;\n $locator = $this->grav['locator'];\n $this->configLookup = $locator->findResources('config://');\n $this->blueprintLookup = $locator->findResources('blueprints://config');\n $this->pluginLookup = $locator->findResources('plugins://');\n\n $config = $this->finder->locateConfigFiles($this->configLookup, $this->pluginLookup);\n return $config;\n }", "public function getConfigList ()\n {\n return $this->getBasicIdSelectList('cms_config_data');\n }", "public function get_export_configurations()\n {\n $mapping = [\n 'isys_monitoring_export_config__id AS id',\n 'isys_monitoring_export_config__title AS title',\n 'isys_monitoring_export_config__path AS path',\n 'isys_monitoring_export_config__address AS address',\n 'isys_monitoring_export_config__type AS type',\n 'isys_monitoring_export_config__options AS options'\n ];\n\n return $this->retrieve('SELECT ' . implode(',', $mapping) . ' FROM isys_monitoring_export_config WHERE isys_monitoring_export_config__type = \"check_mk\";');\n }", "public function getAccessConfigs()\n {\n return $this->access_configs;\n }", "public function getConfigurations() {\n\t\t$fields = '*';\n\t\t$table = 'tx_kesearch_indexerconfig';\n\t\t$where = '1=1 ';\n\t\tif (TYPO3_VERSION_INTEGER >= 7000000) {\n\t\t\t$where .= \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::BEenableFields($table);\n\t\t\t$where .= \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::deleteClause($table);\n\t\t} else {\n\t\t\t$where .= t3lib_befunc::BEenableFields($table);\n\t\t\t$where .= t3lib_befunc::deleteClause($table);\n\t\t}\n\t\treturn $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $table, $where);\n\t}", "public function getAll(){\n\t\treturn $this->configValues;\n\t}", "public function getAllConfigValues() {\n return $this->config->getAll();\n }", "static public function getAll()\n {\n return self::getSuperConfig();\n }", "public function getConfigurationList()\n {\n return Functions::apiClient(API_CONFIG_DOMAIN . \"/ciam/appInfo\", '', array('authentication' => 'key'));\n }", "public function getConfigArray()\n {\n return $this->aConfig;\n }", "public static function getConfigurations(){\n\t\t\t$configurations_array = parse_ini_file(\"s_configs.ini.php\", true);\n\t\t\treturn $configurations_array;\n\t\t}", "public function getConfigArray()\n {\n return $this->config;\n }", "public function getConfigurationValues() {}", "public static function configured(): array\n {\n $configurations = array_keys(static::$_config);\n\n return array_map(function ($key) {\n return (string)$key;\n }, $configurations);\n }", "public function getAll()\n {\n return $this->config->all()->pluck('value', 'name')->all();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
job Applicant Detail Business Side
function jobApplicantDetail_post(){ $this->check_service_auth(); $this->form_validation->set_rules('job_id', 'Job id', 'trim|required'); $this->form_validation->set_rules('user_id', 'User id', 'trim|required'); if($this->form_validation->run() == FALSE){ $response = array('status' => FAIL, 'message' => preg_replace("/[\\n\\r]+/", " ",strip_tags(validation_errors()))); $this->response($response);die(); }else{ $job_id = $this->post('job_id'); $user_id = $this->post('user_id'); $userId = $this->authData->userId; $where = array('jobId'=>$job_id,'posted_by_user_id'=>$userId); $jobs = $this->common_model->getsingle(JOBS,$where,$fld =NULL,$order_by = '',$order = ''); if(empty($jobs)){ $response = array('status' => FAIL, 'message' =>'You are not authorised for this action.'); $this->response($response);die(); } $where = array('job_id'=>$job_id,'applied_by_user_id'=>$user_id); $jobexits = $this->common_model->getsingle(JOB_APPLICANTS,$where,$fld =NULL,$order_by = '',$order = ''); if(empty($jobexits)){ $response = array('status' => FAIL, 'message' =>'No data found.'); $this->response($response);die(); }else if(!empty($jobexits) AND $this->authData->userType!='business'){ $response = array('status' => FAIL, 'message' =>'You are not authorised for this action.'); $this->response($response);die(); }else{ $detail= $this->Jobs_model->get_job_applicant_detail($job_id,$user_id,$jobs->job_type); $response = array('status' => SUCCESS, 'message' =>200,'data'=>$detail); $this->response($response);die(); } } }
[ "public function getJobDetails();", "public function getJobApplicants($job_id = null)\n\t{\t\n\t\t$this->db->select ('apl.* , exp.first_name'); \n\t\t$this->db->from ( 'job_apply apl' );\n\t\t$this->db->join ( 'lang_expert exp','exp.id = apl.expert_id' , 'left' );\t\t\n\t\tif($job_id)\n\t\t{\n\t\t\t$aWhere = array('apl.job_id' => $job_id);\n\t\t\t\n\t\t\tif(!empty($this->session->userdata('emp_id'))) // if a employer \n\t\t\t\t$aWhere['apl.company_id'] = $this->session->userdata('emp_id');\n\t\t\t\n\t\t\t$this->db->where($aWhere);\n\t\t}\n\t\t$query = $this->db->get ();\n\t\t\n\t\t$aResults = $query->result ();\n\t\t//echo \"<pre />\"; print_r($aResults); die('PLLL');\n\t\treturn $aResults;\n\t}", "public function getApplicant()\n {\n return $this->hasMany('App\\Model\\Applicant', 'job_id');\n }", "public function view( $jobId = '' ) {\n\n $this->data['meta_title'] = lang( 'job_name' );\n $this->data['page_title'] = lang( 'job_view_title' );\n $this->data['breadcrumb_items'] = array('<a href=\"' . ROOT_RELATIVE_PATH . 'job\">' . lang('system_menu_jobs') . \"</a>\", lang('job_view_title'));\n \n\n $this->data['pageCustomJS'] = $this->load->view( 'job/_job-custom-js', '', true );\n $this->data['pageVendorCss'] = $this->load->view( 'job/_job-vendor-css', '', true );\n $this->data['pageVendorJS'] = $this->load->view( 'job/_job-vendor-js', '', true );\n $this->data['pageCustomCss'] = $this->load->view( 'job/_job-custom-css', '', true);\n // Get the job details\n $this->data['jobDetails'] = $this->job_model->get_job_details( $jobId );\n\n if( $this->data['settings']->hasCadastral == 0 ) {\n\n $this->data['cadastralPanelHidden'] = 'hidden';\n $this->data['cadastralButtonHidden'] = 'hidden';\n\n } else {\n // Check if cadastral details are attached to this job\n if ( $this->data['jobDetails']->cadastralId == NULL ) {\n // Hide cadastral panel and display button to add them\n $this->data['cadastralPanelHidden'] = 'hidden';\n $this->data['cadastralButtonHidden'] = '';\n } else {\n // Show the cadastral details\n $this->data['cadastralPanelHidden'] = '';\n $this->data['cadastralButtonHidden'] = 'hidden';\n }\n \n }\n\n \n\n // Get query array of object with customer details list\n $this->data['customer'] = $this->customer_model->get();\n \n // Get query array of object with job type list\n $this->data['jobType'] = $this->job_type_model->get();\n\n // Get query object with department items\n $this->data['department'] = $this->department_model->get();\n\n // Get query object with user items\n $this->data['user'] = $this->user_model->get_user_list();\n // Create html select option structure starts here\n $this->data['option'] = \"[\";\n $last = $this->data['user']->num_rows();\n $counter = 1;\n\n // Loop user result data\n foreach ( $this->data['user']->result() as $row ) {\n // check if last row\n if( $counter == $last ) {\n $this->data['option'] .= '{\"'.$row->userId.'\":\"'.$row->name.'\"}';\n } else {\n $this->data['option'] .= '{\"'.$row->userId.'\":\"'.$row->name.'\"},';\n }\n $counter++;\n }\n $this->data['option'] .=\"]\";\n // Create html select option structure ends here\n\n // Valid id then pass to string jobId\n $this->data['jobId'] = $jobId;\n\n // Get query array of object with council details list\n $this->data['council'] = $this->council_model->get();\n\n // Get query array of object with checklist list\n $this->data['checklist'] = $this->checklist_model->get();\n \n // Get query object with job checklist items\n $this->data['job_checklist'] = $this->job_checklist_model->get_job_checklist_details( $jobId );\n\n // Get query object with job checklist items\n $this->data['job_checklist'] = $this->job_checklist_model->get_job_checklist_details( $jobId );\n\n // hide checklist panel on the job view page if there are no checklist\n $this->data['countList'] = $this->data['job_checklist']->num_rows();\n\n if ( count( $this->data['checklist'] ) == 0 ) {\n $this->data['checklistButtonHidden'] = 'hidden';\n $this->data['checklistPanelHidden'] = 'hidden';\n } else {\n if ( $this->data['countList'] == 0 ) {\n $this->data['checklistPanelHidden'] = 'hidden';\n $this->data['checklistButtonHidden'] = '';\n } else {\n $this->data['checklistPanelHidden'] = '';\n $this->data['checklistButtonHidden'] = 'hidden';\n }\n }\n\n \n\n $this->load->view( '_template/header', $this->data );\n $this->load->view( '_template/page-header' );\n $this->load->view( 'job/view', $this->data);\n $this->load->view( 'job/_job-add-checklist-modal' );\n $this->load->view( 'job/_job-add-cadastral-modal' );\n $this->load->view( 'job/_job-add-modal' );\n $this->load->view( '_template/sidebar-right' );\n $this->load->view( '_template/footer' );\n }", "public function index(){\n\t\t$model = D('job');\n\t\t$output['list_job'] = $model->select();\n\t\t$this->output = $output;\n\t\t$this->display();\n\t\t// add job by verification\n\t\t\n }", "public function detailAction() \n {\n $objTranslate = Zend_Registry::get ( PS_App_Zend_Translate ); \n $objError = new Zend_Session_Namespace ( PS_App_Error );\n $objSess = new Zend_Session_Namespace ( PS_App_Auth );\n $objRequest = $this->getRequest ();\n $this->view->siteTitle = $objTranslate->translate ( 'contractor - contract detail' );\n \n $objModel = new Models_Contract();\n $arrData = $objModel->fetchEntry($objRequest->id);\n //_pr($arrData ,1);\n \n $jobStatus = array('1'=>'active','2'=>'paused','3'=>'closed');\n $jobStatusAlert = array('1'=>'success','2'=>'warning','3'=>'danger');\n \n $jobType = array('1'=>'fixed cost job' ,'2'=>'hourly job');\n \n\t\t$this->view->message = $objError->message;\n $this->view->messageType = $objError->messageType;\n\t\t$objError->message = \"\";\n $objError->messageType = '';\n $this->view->arrData = $arrData;\n $this->view->jobStatus = $jobStatus;\n $this->view->jobStatusAlert = $jobStatusAlert;\n $this->view->jobType = $jobType;\n }", "function get_job_details_by_user_id($id){\n\t $ci=& get_instance();\n\t $ci->load->model('jobs_model');\n\t return $ci->jobs_model->get_job_details_by_user_id($id);\n\t}", "function jobApplication(){\n\t\t\t$this->load->model('User_model');\n\t\t\t$out = \"\";\n\t\t\t$appName = $_POST[\"applicantName\"];\n\t\t\t$appEmail = $_POST[\"applicantEmail\"];\n\t\t\t$appPhone = $_POST[\"applicantPhone\"];\n\t\t\t$appWebsite = $_POST[\"applicantWebsite\"];\n\t\t\t$appCountry = $_POST[\"country\"];\n\t\t\t$jobID = $_POST[\"jobID\"];\n\t\t\t$today = date('Y-m-d H:i:s');\n\t\t\t$maxsize = 1024 * 1024;\n\t\t\t$fileSize = $_FILES['applicantCV']['size'];\n\t\t\tif($fileSize <= $maxsize){\n\t\t\t\tif($this->uploadApplicantDoc($_FILES[\"applicantCV\"][\"name\"], $appName)){\n\t\t\t\t\t$uploadLink = $this->upload->data();\n\t\t\t\t\t$link = base_url().'uploads/'.$uploadLink[\"file_name\"];\n\t\t\t\t\t\n\t\t\t\t\t$data = array('vID'=>$jobID,'name'=>$appName,'email'=>$appEmail,'contact'=>$appPhone,'country'=>$appCountry,'CV'=>$link,'websiteLink'=>$appWebsite,'dateApplied'=>$today);\n\t\t\t\t\t$query1 = $this->User_model->jobApplicationModel($data);\n\t\t\t\t\t//$out .= $jobID.' => '.$appName.' => '.$appEmail.' => '.$appPhone.' => '.$appCountry.' => '.$appWebsite.' => '.$today.' => '.$link;\n\t\t\t\t\t$last_Insert_ID = $query1;\n\t\t\t\t\t\n\t\t\t\t\t$appRefName = isset($_POST[\"applicantRefName\"]) ? $_POST[\"applicantRefName\"] : array();\n\t\t\t\t\t$appRefPosition = isset($_POST[\"applicantRefPosition\"]) ? $_POST[\"applicantRefPosition\"] : array();\n\t\t\t\t\t$appRefContact = isset($_POST[\"applicantRefContact\"]) ? $_POST[\"applicantRefContact\"] : array();\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($appRefName)){\n\t\t\t\t\t\tfor($i = 0; $i < count($appRefName); $i++){\n\t\t\t\t\t\t\t$dataReference = array('vAppID'=>$last_Insert_ID,'name'=>$appRefName[$i], 'position'=>$appRefPosition[$i], 'contact'=>$appRefContact[$i]);\n\t\t\t\t\t\t\t$query2 = $this->User_model->jobReferences($dataReference);\n\t\t\t\t\t\t\t//$out .= ' => '.$appRefName[$i].' => '.$appRefPosition[$i].' => '.$appRefContact[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($query2){\n\t\t\t\t\t\techo 'Job application Successful';\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo 'Job Application Not Successful';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\techo \"File Not Uploaded, This could be because the file type is not allowed.\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\techo \"File size must be less or equal to 1MB\";\n\t\t\t}\n\t\t\t\n\t\t\t//echo $out;\n\t\t}", "public function detailsAction()\n {\n $request = $this->getRequest();\n if ($request->getParam('jid') === null) {\n // show error message?\n $this->forward('index');\n return;\n }\n\n $bj = new Bigace_Jobs();\n $job = $bj->get($request->getParam('jid'));\n\n if ($job === null) {\n // show error message?\n $this->forward('index');\n return;\n }\n\n $bjt = new Bigace_Jobs_Type();\n $type = $bjt->get($job['job_type']);\n\n $this->view->JOB = $this->getPreparedJob($job);\n $this->view->TYPE = array(\n 'id' => $type['id'],\n 'title' => $type['title'],\n 'url' => LinkHelper::url('jobs/list/jid/'.$type['id'].'/'.urlencode($type['title']))\n );\n $this->view->BACK_URL = LinkHelper::url(\n 'jobs/list/jid/'.$type['id'].'/'.urlencode($type['title'])\n );\n $this->applyContent();\n }", "public function print_child_job_details( ) {\n\n $parentJobId = $this->input->post( 'parentJobId' );\n $haveParent = $this->input->post( 'haveParent' );\n\n\n // Set details if child or parent\n if ( ($haveParent == null && $haveParent == '' && isset( $haveParent )) || $haveParent == 'undefined' ) {\n // Get the details for this child job as an array\n $childDetails = $this->job_model->get_child_job_details( $parentJobId );\n // Output the child job details in html \n if ( !empty( $childDetails ) ) {\n echo print_child_job_details( $childDetails );\n }\n } else {\n // Get the details of parent job \n $parentDetails = $this->job_model->get_job_details( $parentJobId );\n // Output the child job details in html \n if ( !empty( $parentDetails ) ) {\n echo print_parent_job_details( $parentDetails );\n }\n }\n \n \n }", "public function save_job()\n\t{\n\t\t$job_id=$_POST['job_id'];\n\t\t$contractor_id=$_POST['contr_id'];\n\t\t$action=$_POST['action_performed'];\n\t\tif($action == 'save_job')\n\t\t{\n\t\t\t$data=array('contractor_id'=>$contractor_id,'job_id'=>$job_id,'saved_for'=>'contractor');\n\t\t\t$result=$this->Model->Insert_data($data,PREFIX.'saved_jobs');\n\t\t\techo $result;\n\t\t}\n\t\tif($action == 'flex_alert')\n\t\t{\n\t\t\t$data=array('alert_type'=>'flex_alert','contractor_id'=>$contractor_id,'job_id'=>$job_id,'alert'=>'1');\n\t\t\t$result=$this->Model->Insert_data($data,PREFIX.'alerts');\n\t\t\techo $result;\n\t\t}\n\t\texit();\n\t}", "private function _dashboard_jobs(){\n\t\timport('wddsocial.model.WDDSocial\\JobVO');\n\t\t\n\t\t# query\n\t\t$query = $this->db->query($this->sql->getRecentJobs);\n\t\t$query->setFetchMode(\\PDO::FETCH_CLASS,'WDDSocial\\JobVO');\n\t\t\n\t\t$html = render(':section', \n\t\t\tarray('section' => 'begin_content_section', 'id' => 'jobs', \n\t\t\t\t'classes' => array('small', 'no-margin', 'side-sticky'), \n\t\t\t\t'header' => $this->lang->text('jobs-header')));\n\t\t\n\t\tif ($query->rowCount() > 0) {\n\t\t\t# Create section items\n\t\t\twhile ($row = $query->fetch()){\n\t\t\t\t$html .= render('wddsocial.view.content.WDDSocial\\SmallDisplayView', \n\t\t\t\t\tarray('type' => $row->type,'content' => $row));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$html .= render('wddsocial.view.content.WDDSocial\\SmallDisplayEmptyView',array('type' => 'jobs'));\n\t\t}\n\t\t\n\t\t# Create section footer\n\t\t$html .= render(':section', \n\t\t\tarray('section' => 'end_content_section', 'id' => 'jobs'));\n\t\t\n\t\treturn $html;\n\t}", "function jobapplicantform($atts){\n\t\tob_start();\n\t\t$jobidwith_Number = FALSE;\n\t\textract(shortcode_atts(array('name'=> ''), $atts));\n\t\t$formname=trim($name);\n\t\t$content=\"\";\n\t\t$successmsg=\"\";\n\t\t$hrjobsform=$this->get_jobapplicantform_fields($formname);\t\t\n\t\t$status = array('0' => 'Approved', '1' => 'New');\n\t\t$allJobs = getAllHrjobs(999,0,'false',$status)->jobDetails;\n\t\t$allJobs = awp_convertObjToArray($allJobs);\n\t\t$jobId = $_POST['jobId'];\n\t\t$jobNo = $_POST['jobNo'];\n\t\tif(!empty($hrjobsform[fields])) {\n\t\t\tforeach($hrjobsform[fields] as $field){\n\t\t\t\tif($field[fieldid]==\"country\"){\n\t\t\t\t\t$countrylist = $this->getAllCountryList();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$submitformname = $_POST['awp_jobsformname'];\n\t\tif(isset($_POST['awp_jobsformname']) && $submitformname==$formname)\n\t\t{\n\t\t\tif(trim($jobId) == '' && isset($_POST['jobidwithnumber']))\n\t\t\t{\n\t\t\t\t$jobid_Number = $_POST['jobidwithnumber'];\n\t\t\t\t$jobid_No = explode('::',$jobid_Number);\n\t\t\t\t$jobId = $jobid_No[0];\n\t\t\t\t$jobNo = $jobid_No[1];\n\t\t\t\t$jobidwith_Number = TRUE;\n\t\t\t}\n\t\t\t$successmsg=$this->save_applicantjobs($submitformname,$jobId,$jobNo);\n\t\t}\n\t\t\n\t\tif(strlen(trim($successmsg)) != 0 && $hrjobsform['confmsg_pagemode'] == 'other' ) :\n\t\t\t$location = get_permalink($hrjobsform['confmsg_pageid']);\n\t\t\twp_safe_redirect($location);\n\t\tendif;\n\t\t\n\t\tif($jobidwith_Number)\n\t\t{\n\t\t\t$jobId = '';\n\t\t}\n\n\t\tif(!empty($hrjobsform)){\n\t\t\tinclude $hrjobsform['templatefile'];\n\t\t} else { echo awp_messagelist('jobapplicant-form-display-page'); }\n\t\t$content = ob_get_clean();\n\t\treturn $content;\n\t}", "public function print_cadastral_details( ) {\n\n $jobId = $this->input->post( 'jobId' );\n\n // Get the cadastral for this job as an array\n $cadastralDetails = $this->job_model->get_job_details( $jobId );\n\n // Output the cadastral in html\n if ( !empty( $cadastralDetails ) ) {\n echo print_job_cadastral_details( $cadastralDetails );\n }\n }", "public function show_job_list_by_user(){\r\n $u_name = Session::show_value(\"u_name\");\r\n \r\n $sql = \"SELECT * FROM tbl_apply WHERE a_to = '$u_name' AND (a_status = 'Selected' OR a_status = 'Rejected') \";\r\n $result = $this->db->select($sql);\r\n return $result;\r\n }", "public function publicJobCirculer(){\n\n //job circuler view page\n return view('frontend.pages.employment-circulars');\n }", "function ciniki_services_jobGet($ciniki) {\n // \n // Find all the required and optional arguments\n // \n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'business_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Business'), \n 'job_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Job'), \n\t\t'children'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Children'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this business\n // \n\tciniki_core_loadMethod($ciniki, 'ciniki', 'services', 'private', 'checkAccess');\n $rc = ciniki_services_checkAccess($ciniki, $args['business_id'], 'ciniki.services.jobGet', 0, 0); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n\t$modules = $rc['modules'];\n\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'timezoneOffset');\n\t$utc_offset = ciniki_users_timezoneOffset($ciniki);\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'datetimeFormat');\n\t$datetime_format = ciniki_users_datetimeFormat($ciniki);\n\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n\t$date_format = ciniki_users_dateFormat($ciniki);\n\n\t//\n\t// Get the job information\n\t//\n\t$strsql = \"SELECT ciniki_service_jobs.id, ciniki_service_jobs.tracking_id, ciniki_service_jobs.name, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.pstart_date, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS pstart_date, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.pend_date, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS pend_date, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.service_date, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS service_date, \"\n\t\t. \"ciniki_service_jobs.status, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.date_scheduled, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_scheduled, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.date_started, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_started, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.date_due, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_due, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.date_completed, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_completed, \"\n\t\t. \"DATE_FORMAT(ciniki_service_jobs.date_signedoff, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_signedoff, \"\n\t\t. \"ciniki_service_jobs.efile_number, \"\n\t\t. \"ciniki_service_jobs.invoice_amount, \"\n\t\t. \"ciniki_service_jobs.tax1_name, \"\n\t\t. \"ciniki_service_jobs.tax1_amount, \"\n\t\t. \"ciniki_service_jobs.tax2_name, \"\n\t\t. \"ciniki_service_jobs.tax2_amount, \"\n\t\t. \"ciniki_services.name AS service_name, \"\n\t\t. \"DATE_FORMAT(CONVERT_TZ(ciniki_service_jobs.date_added, '+00:00', '\" . ciniki_core_dbQuote($ciniki, $utc_offset) . \"'), '\" . ciniki_core_dbQuote($ciniki, $datetime_format) . \"') AS date_added, \"\n\t\t. \"DATE_FORMAT(CONVERT_TZ(ciniki_service_jobs.last_updated, '+00:00', '\" . ciniki_core_dbQuote($ciniki, $utc_offset) . \"'), '\" . ciniki_core_dbQuote($ciniki, $datetime_format) . \"') AS last_updated \"\n\t\t. \"FROM ciniki_service_jobs \"\n\t\t. \"LEFT JOIN ciniki_service_job_notes ON (ciniki_service_jobs.id = ciniki_service_job_notes.job_id) \"\n\t\t. \"LEFT JOIN ciniki_services ON (ciniki_service_jobs.service_id = ciniki_services.id) \"\n\t\t. \"WHERE ciniki_service_jobs.id = '\" . ciniki_core_dbQuote($ciniki, $args['job_id']) . \"' \"\n\t\t. \"AND ciniki_service_jobs.business_id = '\" . ciniki_core_dbQuote($ciniki, $args['business_id']) . \"' \"\n\t\t. \"\";\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n\t$rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.services', array(\n\t\tarray('container'=>'jobs', 'fname'=>'id', 'name'=>'job',\n\t\t\t'fields'=>array('id', 'tracking_id', 'name', 'service_date', 'status', 'service_name',\n\t\t\t\t'pstart_date', 'pend_date', \n\t\t\t\t'date_scheduled', 'date_started', 'date_due', 'date_completed', \n\t\t\t\t'efile_number', 'invoice_amount', 'tax1_name', 'tax1_amount', 'tax2_name', 'tax2_amount',\n\t\t\t\t'date_added', 'last_updated')),\n\t\t));\n\tif( $rc['stat'] != 'ok' ) {\n\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'857', 'msg'=>'No job found', 'err'=>$rc['err']));\n\t}\n\tif( !isset($rc['jobs']) || !isset($rc['jobs'][0]) ) {\n\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'858', 'msg'=>'No job found'));\n\t}\n\t$job = $rc['jobs'][0]['job'];\n\n\tif( isset($args['children']) && $args['children'] == 'yes' ) {\n\t\t//\n\t\t// Get the tasks associated with a job\n\t\t//\n\t\t$strsql = \"SELECT id, task_id, step, name, duration, status, \"\n\t\t\t. \"status AS status_text, \"\n\t\t\t. \"DATE_FORMAT(ciniki_service_job_tasks.date_scheduled, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_scheduled, \"\n\t\t\t. \"DATE_FORMAT(ciniki_service_job_tasks.date_started, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_started, \"\n\t\t\t. \"DATE_FORMAT(ciniki_service_job_tasks.date_due, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_due, \"\n\t\t\t. \"DATE_FORMAT(ciniki_service_job_tasks.date_completed, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"') AS date_completed, \"\n\t\t\t. \"DATE_FORMAT(CONVERT_TZ(date_added, '+00:00', '\" . ciniki_core_dbQuote($ciniki, $utc_offset) . \"'), '\" . ciniki_core_dbQuote($ciniki, $datetime_format) . \"') AS date_added, \"\n\t\t\t. \"DATE_FORMAT(CONVERT_TZ(last_updated, '+00:00', '\" . ciniki_core_dbQuote($ciniki, $utc_offset) . \"'), '\" . ciniki_core_dbQuote($ciniki, $datetime_format) . \"') AS last_updated \"\n\t\t\t. \"FROM ciniki_service_job_tasks \"\n\t\t\t. \"WHERE ciniki_service_job_tasks.job_id = '\" . ciniki_core_dbQuote($ciniki, $args['job_id']) . \"' \"\n\t\t\t. \"ORDER BY step, name \"\n\t\t\t. \"\";\n\t\t$rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.services', array(\n\t\t\tarray('container'=>'tasks', 'fname'=>'id', 'name'=>'task',\n\t\t\t\t'fields'=>array('id', 'task_id', 'step', 'name', 'duration', 'status', 'status_text',\n\t\t\t\t\t'date_scheduled', 'date_started', 'date_due', 'date_completed', \n\t\t\t\t\t'date_added', 'last_updated'),\n\t\t\t\t'maps'=>array('status_text'=>array('10'=>'entered', '20'=>'started', '50'=>'completed', '60'=>'signed off', '61'=>'skipped')),\n\t\t\t\t),\n\t\t\t));\n\t\tif( $rc['stat'] != 'ok' ) {\n\t\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'859', 'msg'=>'No job found', 'err'=>$rc['err']));\n\t\t}\n\t\tif( !isset($rc['tasks']) ) {\n\t\t\t$job['tasks'] = array();\n\t\t} else {\n\t\t\t$job['tasks'] = $rc['tasks'];\n\t\t}\n\n\t\t//\n\t\t// Get the notes associated with a job\n\t\t//\n\t\t$strsql = \"SELECT id, job_id, user_id, \"\n\t\t\t. \"DATE_FORMAT(CONVERT_TZ(date_added, '+00:00', '\" . ciniki_core_dbQuote($ciniki, $utc_offset) . \"'), '\" . ciniki_core_dbQuote($ciniki, $datetime_format) . \"') AS date_added, \"\n\t\t\t. \"CAST(UNIX_TIMESTAMP(UTC_TIMESTAMP())-UNIX_TIMESTAMP(date_added) as DECIMAL(12,0)) as age, \"\n\t\t\t. \"content \"\n\t\t\t. \"FROM ciniki_service_job_notes \"\n\t\t\t. \"WHERE ciniki_service_job_notes.job_id = '\" . ciniki_core_dbQuote($ciniki, $args['job_id']) . \"' \"\n\t\t\t. \"ORDER BY ciniki_service_job_notes.date_added ASC \"\n\t\t\t. \"\";\n\t\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbRspQueryPlusDisplayNames');\n\t\t$rc = ciniki_core_dbRspQueryPlusDisplayNames($ciniki, $strsql, 'ciniki.services', 'notes', 'note', array('stat'=>'ok', 'notes'=>array()));\n\t\tif( $rc['stat'] != 'ok' ) {\n\t\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'856', 'msg'=>'Unable to get job', 'err'=>$rc['err']));\n\t\t}\n\t\tif( !isset($rc['notes']) ) {\n\t\t\t$job['notes'] = array();\n\t\t} else {\n\t\t\t$job['notes'] = $rc['notes'];\n\t\t}\n\t}\n\n\t//\n\t// Get the list of users attached to the job\n\t//\n\t$user_ids = array();\n\t$strsql = \"SELECT job_id, user_id, perms \"\n\t\t. \"FROM ciniki_service_job_users \"\n\t\t. \"WHERE job_id = '\" . ciniki_core_dbQuote($ciniki, $args['job_id']) . \"' \";\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbRspQueryPlusUserIDs');\n\t$rc = ciniki_core_dbRspQueryPlusUserIDs($ciniki, $strsql, 'ciniki.services', 'users', 'user', array('stat'=>'ok', 'users'=>array(), 'user_ids'=>array()));\n\tif( $rc['stat'] != 'ok' ) {\n\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'949', 'msg'=>'Unable to load item information', 'err'=>$rc['err']));\n\t}\n\t$job_users = $rc['users'];\n\t$user_ids = array_merge($user_ids, $rc['user_ids']);\n\n\t//\n\t// Build the list of followers and users assigned to the job\n\t//\n\t$job['assigned'] = array();\n\tforeach($job_users as $unum => $user) {\n\t\t$display_name = 'unknown';\n\t\tif( isset($users[$user['user']['user_id']]) ) {\n\t\t\t$display_name = $users[$user['user']['user_id']]['display_name'];\n\t\t}\n\t\t// Followers\n\t\tif( ($user['user']['perms'] & 0x01) > 0 ) {\n\t\t\tarray_push($job['followers'], array('user'=>array('id'=>$user['user']['user_id'], 'display_name'=>$display_name)));\n\t\t}\n\t\t// Assigned to\n\t\tif( ($user['user']['perms'] & 0x04) > 0 ) {\n\t\t\tif( $job['assigned'] != '' ) {\n\t\t\t\t$job['assigned'] .= ',';\n\t\t\t}\n\t\t\t$job['assigned'] .= $user['user']['user_id'];\n\t\t}\n\t}\n\n\treturn array('stat'=>'ok', 'job'=>$job);\n}", "public function get_job_details( $jobId ) {\n\n $sql = \" SELECT *,\n j.jobId AS jobId,\n c.name AS customerName,\n c.address1 AS customerAddress,\n c.city AS customerCity,\n c.region AS customerRegion,\n c.postCode AS customerPostCode,\n c.phone AS customerPhone,\n c.email AS customerEmail,\n concat(u.firstName, ' ', u.surname) AS `manager`,\n d.name AS departmentName,\n jc.jobCustomFieldsId AS jobCustomFieldsId,\n jc.budget AS jcbudget,\n jc.purchaseOrderNo AS jcpurchaseOrderNo,\n jc.crownAllotment AS jccrownAllotment,\n jc.section AS jcsection,\n jc.parish AS jcparish,\n jc.area AS jcarea,\n j.jobType AS jobType,\n j.streetNo AS street,\n j.streetName AS streetName,\n j.suburb AS suburb,\n j.easting AS easting,\n j.northing AS northing,\n j.zone AS zone,\n j.tender AS tender,\n j.received AS received,\n j.start AS start,\n j.finish AS finish,\n j.postCode AS jobPostCode,\n j.archived AS archived,\n cc.name AS councilName,\n j.parentJobId AS parentJobId,\n j.jobReferenceNo AS jobReferenceNo,\n j.jobName AS jobName,\n j.archived AS archived,\n child.jobReferenceNo AS childRef,\n child.jobName AS childName\n FROM time_job AS j\n LEFT JOIN time_job AS child ON j.parentJobId = child.jobId\n INNER JOIN time_customer AS c ON j.customerId = c.customerId\n LEFT JOIN time_user AS u ON j.userId = u.userId\n LEFT JOIN time_department AS d ON j.departmentId = d.departmentId\n LEFT JOIN time_job_customfields AS jc ON j.jobCustomFieldsId = jc.jobCustomFieldsId\n LEFT JOIN time_cadastral AS tc ON j.cadastralId = tc.cadastralId\n LEFT JOIN time_council AS cc ON tc.councilId = cc.councilId\n WHERE j.jobId = '\" . $jobId . \"' \";\n return $this->db->query( $sql )->row();\n }", "public function listApplicants() {\n $jobs = $this->jobsTable->retrieveRecord('id', $this->get['id']);\n\n // Check if any jobs have been returned. If so, display the applicants.\n if (!empty($jobs)) {\n $job = $jobs[0];\n\n // Check if the current user can view the associated job listing. If so, display the applicants. \n if (isset($_SESSION['isOwner']) || isset($_SESSION['isAdmin']) || isset($_SESSION['isEmployee']) || $job->userId == $_SESSION['id']) {\n $variables = [\n 'title' => $job->title,\n 'applicants' => $job->listApplicants() \n ];\n }\n else\n header('Location: /admin/jobs');\n }\n else\n header('Location: /admin/jobs');\n\n return [\n 'layout' => 'sidebarlayout.html.php',\n 'template' => 'admin/applicants.html.php',\n 'variables' => $variables,\n 'title' => 'Admin Panel - Applicants'\n ];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to validate feeds on several conditions
public function validateFeeds($feeds) : string { if (!class_exists('DOMDocument')) { $this->errorDetails = 'Schema is Missing, Please add schema to feedSchema property'; } if (!file_exists($this->feedSchema)) { $this->errorDetails = 'Schema is Missing, Please add schema to feedSchema property'; } libxml_use_internal_errors(true); $this->handler->loadXML($feeds, LIBXML_NOBLANKS); $this->handler->saveXML(); //Condition to check if schema is validated if (!$this->handler->schemaValidate($this->feedSchema)) { $this->errorDetails = $this->libXMLDisplayErrors(); return false; } else { return true; } }
[ "protected function validate($feed){\n\t}", "function isValidFeed($value, $empty, &$params, &$formvars) {\n\n if (empty($formvars['url'])) return false;\n $feed = $this->rss->fetchRSS($formvars['url']);\n if (!isset($feed['items_count']) || $feed['items_count'] < 1) return false;\n return true;\n\n }", "function is_valid_feed($feed_url)\r\n{\r\n\t// Load in the document as a simplepie object\r\n\t$feed_xml = load_feed_xml($feed_url);\r\n\t\r\n\t// If the feed has any errors, return false\r\n\tif ($feed_xml->error())\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// Get the number of feed items in the feed\r\n\t$episode_count = $feed_xml->get_item_quantity();\r\n\t\r\n\t// Get the first feed item\r\n\t$episode = $feed_xml->get_item();\r\n\r\n\t// See if the first feed item has any media to download\r\n\t$enclosure = $episode->get_enclosure();\r\n\t$download_url = $enclosure->get_link();\r\n\t$total_time = $enclosure->get_duration();\r\n\t\r\n\t// Set the validity flags\r\n\t$valid_episode_count = $episode_count > 0;\r\n\t$valid_download_url = strlen($download_url) > 0;\r\n\t$valid_total_time = $total_time > 0;\r\n\t\r\n\t// All flags must be true to be a valid podcast feed\r\n\tif ($valid_episode_count && $valid_download_url && $valid_total_time)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n}", "public function theGoogleNewsFeedShouldBeValid() {\n $this->theXmlFeedShouldBeValidAccordingToTheXsd(__DIR__ . '/../../schemas/xsd/googlenews.xsd');\n }", "public function validateData();", "public function validateData() {\n\t\tif ( '' == $this->fromEmail || 0 == $this->recommendedExpenses ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function valid_feed($guess) {\n\t\tif($debug) $temp = $guess;\n\t\t$guess = $this->make_full_path($guess);\n\n\t\tif($debug) echo \"Checking for validity of $temp, fullpath $guess<br />\\n\";\n\n\t\t// Grab feed content\n\t\t$feed = @file_get_contents($guess);\n\n\t\t// Find any indication that it's valid\n\t\tif(stristr($feed,\"<rss\") || stristr($feed,\"<rdf\") || stristr($feed,\"<feed\"))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function validate() {\n for($i = 0; $i < count(json_decode($this->dataset)->id); $i++) {\n // implement validation\n $response_privacy = $this->validate_privacy( json_decode($this->dataset)->privacy[$i] );\n $response_total_likes = $this->validate_total_likes( json_decode($this->dataset)->total_likes[$i] );\n $response_total_plays = $this->validate_total_plays( json_decode($this->dataset)->total_plays[$i] );\n $response_title = $this->validate_title( json_decode($this->dataset)->title[$i] );\n\n // build return\n if ( $response_privacy && $response_total_likes && $response_total_plays && $response_title ) array_push( $this->validation_success, $i );\n else array_push( $this->validation_failure, $i );\n }\n\n // return result\n return array('success' => $this->validation_success, 'failure' => $this->validation_failure);\n }", "function validateData() {}", "public function testRuleIsAccepted(): void {\r\n\r\n //Should pass\r\n foreach(['yes', 'on', '1', 'true'] as $data) {\r\n\r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isAccepted();\r\n $this -> assertTrue($validator -> passes());\r\n $this -> assertFalse($validator -> fails());\r\n }\r\n\r\n //Should fail\r\n foreach(['', null, [], (object) [], 2552, true] as $data) {\r\n\r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isAccepted();\r\n $this -> assertFalse($validator -> passes());\r\n }\r\n\r\n //Should fail\r\n $validator = new Validator();\r\n $validator -> field('field') -> isAccepted();\r\n $this -> assertFalse($validator -> passes());\r\n }", "public function createEventValidations()\n {\n $property_array = [\n 'event_name',\n 'event_description',\n ];\n $this->expectValueAll($property_array);\n $this->expectInt('user_id');\n\n $dateProperty_array = [\n 'event_start_date',\n 'event_end_date'\n ];\n $this->expectDateAll($dateProperty_array);\n\n $st_date = $this->request->input('event_start_date');\n $en_date2 = $this->request->input('event_end_date');\n $this->dateCompare($st_date, $en_date2);\n\n return true;\n }", "public function validate()\r\n {\r\n $pattern = '/^(?!219-09-9999|078-05-1120|219099999|078051120)(?!666|000|9\\d{2})\\d{3}-?(?!00)\\d{2}-?(?!0{4})\\d{4}$/';\r\n \r\n if (!preg_match($pattern, $this->_data)) $this->addError('Invalid social security entered.');\r\n\r\n return !sizeof($this->_errors);\r\n }", "public function validate()\n {\n static $required = array(\n 'category', 'subcategory', 'title', 'description'\n );\n\n foreach ($required as $field) {\n if (!isset($this->data[$field]) || !strlen($this->data[$field])) {\n throw new Services_Facebook_Exception(\n 'Marketplace listing requires ' . $field . ' be set'\n );\n }\n }\n\n foreach ($this->data as $field => $val) {\n $func = 'validate' . ucfirst($field);\n if (method_exists($this, $func)) {\n $this->$func($val);\n }\n }\n }", "public function validateRssFeedUrl(string $feedUrl):object {\n return Validator::make(['feed_url' => $feedUrl],\n [\n 'feed_url' => 'required|string|url',\n ]);\n }", "public function getEventValidations()\n {\n $this->expectInt('event_id');\n $this->expectInt('user_id');\n return true;\n }", "function checkInvalidInputs(){\n\tglobal $nric,$faApplicationID,$dateDisbursed,$type,$amount,$paymentSchdNo,$issueIncharge,$issueApprover,$description;\n\t\n\tif(!matchRegex($nric,\"/^[a-zA-Z0-9]*$/\")) { return true; }\n\tif(!matchRegex($faApplicationID,\"/^[0-9]*$/\")) { return true; }\n\tif(!matchRegex($dateDisbursed,\"/^[0-9-]*$/\")) { return true; }\n\tif(!matchRegex($type,\"/^[a-zA-Z]{1}$/\")) { return true; }\n\tif(!matchRegex($amount,\"/^[0-9.]*$/\")) { return true; }\n\tif(!matchRegex($paymentSchdNo,\"/^[0-9]*$/\")) { return true; }\n\tif(!matchRegex($issueIncharge,\"/^[a-zA-Z0-9 ]*$/\")) { return true; }\n\tif(!matchRegex($issueApprover,\"/^[a-zA-Z0-9 ]*$/\")) { return true; }\n\tif(!matchRegex($description,\"/^[a-zA-Z0-9 -_.,#]*$/\")) { return true; }\n\t\n\treturn false;\n}", "abstract public function validate($data);", "public function isValid()\n {\n $docType = get_class($this->source);\n if (isset($this->options['required'][$docType])) {\n $this->validateTags($docType);\n } else if (isset($this->options['required']['__ALL__'])) {\n $this->validateTags('__ALL__');\n }\n }", "function everythingValid() {\n foreach($this->validation_log as $v) {\n if($v['status'] == self::VALIDATION_ERROR) {\n return false;\n } // if\n } // foreach\n \n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The test_delete_item() method does not exist for sidebar.
public function test_delete_item() { }
[ "public function testDeleteMenuSectionItem()\n {\n }", "public function test_delete_item() {}", "public function testDeleteWidget()\n {\n }", "public function testDeleteItemUsingDELETE()\n {\n }", "public function testDeleteHomepageItem()\n {\n }", "public function testMenusDelete()\n {\n }", "public function testDossierItemsDelete()\n {\n }", "public function testItemsDelete()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testAdminRemoveItem()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/login')\n ->type('email', 'admin@admin.com')\n ->type('password', 'password')\n ->press('Login')\n ->visit('/viewAllItems')\n ->press('Delete')\n ->acceptDialog()\n ->assertSee('Item removed!');\n });\n }", "public function testDeleteBoardItem()\n {\n }", "public function testWebinarPanelistDelete()\n {\n }", "public function testDeleteObjectItem()\n {\n }", "public function testSavedDeleteItem()\n {\n \n }", "public function testDeleteTeachingClassStudentItem()\n {\n }", "public function testDeleteStoreItem()\n {\n }", "public function delete($item) { }", "public function testDeleteDashboardElement()\n {\n }", "public function testDeleteContentFavorite()\n {\n }", "public function testBadDelete()\n {\n P4Cms_Widget::remove(5);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the name of the codeblock tag
public function getTag() { return 'codeblock'; }
[ "public function getTagName ()\n\t{\n\t\treturn 'ruby';\n\t}", "public function getName()\n {\n return $this->getBlockPrefix();\n }", "public function getTagName ()\n\t{\n\t\treturn 'main';\n\t}", "public function getName()\n \t{\n \t\treturn $this->blockName;\n \t}", "public function getName(): string\n {\n return $this->block->getName();\n }", "public function getTagName() {\n\t\t$tagName = $this->tsValue('tagName');\n\t\tif ($tagName === NULL) {\n\t\t\t$tagName = 'div';\n\t\t}\n\t\treturn $tagName;\n\t}", "function name($code) {\n\t\t\treturn $code;\t\n\t\t}", "public function getName()\n {\n return $this->tag;\n }", "public function getTagname() {\n return $this->tagname;\n }", "abstract function get_block_name();", "protected function getBlockFunctionName($name)\n {\n return 'block_' . $name;\n }", "public function getTag()\n {\n return $this->name;\n }", "public function getTagName ()\n\t{\n\t\treturn 'strong';\n\t}", "public function getCurrentBlockName()\n {\n if (empty(static::$_blocksStack)) {\n return '';\n } else {\n return static::$_blocksStack[count(static::$_blocksStack) - 1];\n }\n }", "public function getTagName ()\n\t{\n\t\treturn 'iframe';\n\t}", "public function tagname()\n {\n return $this->_node->nodeName;\n }", "public function getTagName()\n {\n return $this->tag_name;\n }", "protected function getBlockTemplate() : string\n {\n return static::TEMPLATE_BLOCK_TEMPLATE_SOURCE;\n }", "public function shortcode_name();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that publicProperties() returns public property names.
public function testPublicProperties() { $props = ['publicProp', 'staticPublicProp']; $this->assertArraysEqual($props, $this->object->publicProperties); $this->assertArraysEqual($props, $this->object->publicProperties()); }
[ "protected function getPublicProperties() {\n $reflect = new \\ReflectionClass($this);\n $result = array();\n foreach($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $property) {\n $result[] = $property->getName();\n }\n return $result;\n }", "private function get_public_properties()\n\t\t{\n\t\t\t$reflection = new ReflectionObject($this);\n\t\t\t$properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC);\n\n\t\t\t$public_properties = array();\n\n\t\t\tforeach ($properties as $property) {\n\t\t\t\t$public_properties[] = $property->getName();\n\t\t\t}\n\t\n\t\t\treturn $public_properties;\n\t\t}", "public function getPublicProperties(): array\n {\n $reflection = $this->getReflection();\n\n $properties = collect($reflection->getProperties(ReflectionProperty::IS_PUBLIC));\n\n return $properties->map(fn ($property) => $property->name)->toArray();\n }", "private function getPublicProperties(): array\n {\n $reflectionClass = new ReflectionObject($this);\n\n return $reflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\n }", "protected function parsePublicProperties()\n {\n $result = array();\n $class = $this->getClass();\n foreach ($class->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {\n $result[] = AmPropertyFactory::create($class, $property);\n }\n return $result;\n }", "private function getPublicProperties()\n {\n // the anonymous function / closure is needed to make sure that get_object_vars\n // only returns public properties.\n // FIXME: check if private/protected properties are really skipped with $getLocalProperties\n return ( is_object( $this->prototype )\n ? array_merge( $this->prototype->properties, $this->getLocalProperties( $this ) )\n : $this->getLocalProperties( $this ) );\n }", "protected function findPublicProperties()\n {\n $resource = $this->getResource();\n $reflect = new \\ReflectionObject($resource);\n $this->publicProperties = array();\n foreach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop) {\n $this->publicProperties[$prop->getName()] = true;\n }\n }", "public function testGetProperties()\n {\n $properties = $this->Class->getProperties();\n $this->assertContainsOnlyInstancesOf(PropertyEntity::class, $properties);\n $this->assertSame(['Puppy', 'description', 'isCat'], $properties->map(function (PropertyEntity $property) {\n return $property->getName();\n })->toList());\n }", "public function testGetClassProperties() {\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($this)\n\t\t);\n\t\t$expected = ['test', 'test2'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($this, ['public' => false])\n\t\t);\n\t\t$expected = ['test', 'test2', '_test'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::properties($this);\n\t\t$expected = [\n\t\t\t[\n\t\t\t\t'modifiers' => ['public'],\n\t\t\t\t'value' => 'foo',\n\t\t\t\t'docComment' => false,\n\t\t\t\t'name' => 'test'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'modifiers' => ['public', 'static'],\n\t\t\t\t'value' => 'bar',\n\t\t\t\t'docComment' => false,\n\t\t\t\t'name' => 'test2'\n\t\t\t]\n\t\t];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$controller = new Controller(['init' => false]);\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($controller)\n\t\t);\n\t\t$this->assertTrue(in_array('request', $result));\n\t\t$this->assertTrue(in_array('response', $result));\n\t\t$this->assertFalse(in_array('_render', $result));\n\t\t$this->assertFalse(in_array('_classes', $result));\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($controller, ['public' => false])\n\t\t);\n\t\t$this->assertTrue(in_array('request', $result));\n\t\t$this->assertTrue(in_array('response', $result));\n\t\t$this->assertTrue(in_array('_render', $result));\n\t\t$this->assertTrue(in_array('_classes', $result));\n\n\t\t$this->assertNull(Inspector::properties('\\lithium\\core\\Foo'));\n\t}", "public function test_property_names() {\n //set our expected properties name(s)\n $expected_names = array(\n 'heading',\n 'fields',\n 'sort_by',\n 'sort_reverse',\n 'sort_type',\n 'delimiter',\n 'enclosure',\n 'enclose_all',\n 'conditions',\n 'offset',\n 'limit',\n 'auto_depth',\n 'auto_non_chars',\n 'auto_preferred',\n 'convert_encoding',\n 'input_encoding',\n 'output_encoding',\n 'use_mb_convert_encoding',\n 'linefeed',\n 'output_delimiter',\n 'output_filename',\n 'keep_file_data',\n 'file',\n 'file_data',\n 'error',\n 'error_info',\n 'titles',\n 'data',\n 'data_types',\n );\n\n // Find our real properties\n $real_properties = array_map(function (\\ReflectionProperty $property) {\n return $property->getName();\n }, $this->properties);\n\n // Lets make sure our expected matches the number of real properties\n $this->assertEquals($expected_names, $real_properties);\n }", "public function publicProperties()\n {\n if (!self::$publicProperties) {\n $publicProperties = (isset($this->metadata()->public_properties)) ? $this->metadata()->public_properties : $this->metadata()->properties();\n self::$publicProperties = $publicProperties;\n }\n return self::$publicProperties;\n }", "public function getPropertyNames()\n {\n }", "function getPublicProperties($obj) {\n\n\treturn is_object($obj) ? array_keys(get_object_vars($obj)) : [];\n}", "public function testGetPublicVarsFromObject()\n {\n $object = PersistentObject::findOne([], [], $this->fixture, ['read_mode' => 'outdated']);\n\n $this->assertInstanceOf('Tacit\\Test\\Model\\RethinkDB\\PersistentObject', $object);\n $this->assertEquals(\n [\n 'id', 'name', 'text', 'date', 'integer', 'float', 'boolean', 'password', 'arrayOfStrings'\n ],\n array_keys(Collection::getPublicVars($object))\n );\n }", "public function testPropertiesGet()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getProperties();", "public function visibleProperties()\n {\n return array_keys($this->_properties);\n }", "public function testGetProperties()\n {\n $properties = ['abc' => 'def'];\n\n $object = new Engine($properties);\n\n self::assertSame($properties, $object->getProperties());\n }", "public function testCanGetProperties() {\n\t\t$person = $this->getPerson();\n\n\t\t$this->assertEquals('Vince Noir', $person->getName());\n\t\t$this->assertEquals('19880211', $person->getDob(false));\n\t\t$this->assertEquals('dev@null.com', $person->getEmail());\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify that all keys in a row are specified
public function validateKeys( array $keys ){ if( $this->Row ) return !array_diff( $this->Row->keys(), $keys ); else return true; }
[ "public function validate_rows( Array $rows ) {\n\n\t\t$counts = [];\n\t\t$keys = [];\n\t\t$keys_serialised = [];\n\t\t$primary = [];\n\n\t\t$primary_key = array_flip( (array) $this->primary_key() );\n\t\t$n_primary_key = count( $primary_key );\n\n\t\tforeach ( $rows as $row ) {\n\t\t\t$prim_key_values = array_intersect_key( $row, $primary_key );\n\t\t\t// 1. bail if row doesn't have primary keys\n\t\t\tif ( count( $prim_key_values ) !== $n_primary_key ) {\n\t\t\t\treturn $this->handle_error( '', 'Primary key/s not in data set' );\n\t\t\t}\n\t\t\t$counts[ count( $row ) ] = 1;\n\t\t\t$primary[] = serialize( array_merge( $primary_key, array_intersect_key( $row, $primary_key ) ) );\n\t\t\t$_keys = array_keys( $row );\n\t\t\t$keys[] = $_keys;\n\t\t\t$keys_serialised[] = serialize( $_keys );\n\t\t}\n\n\t\t// 2. check consistent number of items in rows\n\t\tif ( count( $counts ) > 1 ) {\n\t\t\treturn $this->handle_error( '', 'Rows do not contain consistent number of fields' );\n\t\t}\n\n\t\t// 3. check key structure is the same\n\t\tif ( count( array_unique( $keys_serialised ) ) > 1 ) {\n\t\t\treturn $this->handle_error( '', 'Key structure is not consistent between rows' );\n\t\t}\n\n\t\t// 4. check for primary key duplicates\n\t\tif ( count( $primary ) !== count( array_unique( $primary ) ) ) {\n\t\t\treturn $this->handle_error( '', 'Primary key/s were duplicated across set of rows' );\n\t\t}\n\n\t\treturn true;\n\t}", "protected function isValidRow() {\n\t\treturn true;\n\t}", "public function testRowValid()\n {\n $expected = [\n 0 => null,\n 1 => null,\n 2 => 'T',\n ];\n\n $this->assertEquals(\n $expected,\n $this->Board->row(0),\n 'Requesting a valid ::row() should produce the expected subset array.'\n );\n }", "private function _hasAllPrimaryKeys()\n {\n\n foreach ($this->_primaryKeyValues as $key => $value) {\n if (!$this->hasField($key) || !$this->getField($key)->check($this->getValue($key))) {\n return false;\n }\n }\n return true;\n }", "private function verify_meta_columns($row, $failed_ids)\n {\n }", "private function checkKeys() {\n\t\tforeach ($this->fields as $name => $field) {\n\t\t\tif (isset($field['key']) && !isset($this->data[$this->current_row][$name])) {\n\t\t\t\t$this->addError($name, (!empty($field['key']) ? $field['key'] : 'The validator \\'key\\' failed on the \\''.$name.'\\' field'), 'key', ModelFieldError::TYPE_KEY_MISSING);\n\t\t\t}\n\t\t}\n\t}", "private function areAllExpectedFieldsPresentInRow( $headerRow )\n {\n foreach ( $this->fields as $field ) {\n if ( ! in_array( $field, $headerRow ) ) {\n return false;\n }\n }\n\n return true;\n }", "function are_all_keys_valid($array, $valid_keys)\n{\n\treturn invalid_key($array, $valid_keys) == null;\n}", "private function validateBatchArray($data) : bool\n {\n if(gettype($data)!='array')\n {\n throw new Exception(\"column is not valid : columns should be array\");\n }\n foreach($data as $column)\n {\n foreach(array_keys($column) as $key)\n {\n if(!in_array($key,['name','source']))\n {\n throw new Exception(\"column is not valid : this key is unusable '$key'\");\n }\n }\n }\n }", "public function verifyProductColumns($data);", "public function checkColumns($row): bool\n {\n return \\count($row) === \\count($this->getColumns());\n }", "public function hasColumnKeys(array $data)\n {\n return count($data) === count(array_intersect(array_keys($data), $this->columns));\n }", "function _validate_insert_keys($required_keys = array(), $values = array())\n {\n foreach($required_keys as $required_key)\n if(!isset($values[$required_key])){\n return false;\n }\n\n return true;\n }", "function _check_valid_insert_keys($insert_values = array(), $valid_insert_keys = array())\n {\n foreach($insert_values as $key=>$value)\n {\n if(!in_array($key, $valid_insert_keys)) return false;\n }\n return true;\n }", "function IsComplexPrimaryKey($array)\r\n{\r\n\t$primaryKeyCountPart = 0;\r\n\tforeach($array as $xmlColumn)\r\n\t{\r\n\t\t$attributes=$xmlColumn->GetXmlNodeAttributes();\r\n\t\tforeach($attributes as $key => $value)\r\n\t\t{\r\n\t\t\tif ( $key == \"PRIMARYKEY\" )\r\n\t\t\t{\r\n\t\t\t\t$primaryKeyCountPart++;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn ( $primaryKeyCountPart > 1 );\r\n}", "function common_validate_row($header, $row) {\n\n\t$row_errors = array();\n\t// safe to assume each row has same num of fields as header row according to wiki\n\tfor ($i = 0; $i < count($header); $i++) {\n\t\tif ($row[$i] === '') {\n\t\t\t$field = $header[$i];\n\t\t\t$row_errors[] = \"blank $field\";\n\t\t}\n\t}\n\treturn $row_errors;\n}", "function array_keys_exist(array $data, ...$requiredKeys): bool\n{\n $commonKeys = array_intersect( array_keys($data), $requiredKeys);\n\n return array_diff($commonKeys, $requiredKeys) === [];\n}", "function check_keys()\n {\n $tables['groups_users_link'] = array('uid');\n\n foreach (\n $tables as $table => $keys\n ) {\n $sql = \"SHOW KEYS FROM `\" . $GLOBALS['xoopsDB']->prefix($table) . \"`\";\n if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {\n continue;\n }\n $existing_keys = array();\n while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) {\n $existing_keys[] = $row['Key_name'];\n }\n foreach (\n $keys as $key\n ) {\n if (!in_array($key, $existing_keys)) {\n return false;\n }\n }\n }\n return true;\n }", "function array_has_exact_keys_set(array $arr, array $expected_keys) {\n foreach ($expected_keys as $key) {\n if (!isset($arr[$key])) {\n return false;\n }\n }\n return count($arr) === count($expected_keys);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation indexVariationTypeOptionWithHttpInfo Index variation type option
public function indexVariationTypeOptionWithHttpInfo($number, $number2) { $returnType = '\RackbeatApp\Client\Model\VariationTypeOptionList'; $request = $this->indexVariationTypeOptionRequest($number, $number2); 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()->getBody()->getContents() ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { 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); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\RackbeatApp\Client\Model\VariationTypeOptionList', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
[ "public function indexVariationTypeOption($number, $number2)\n {\n list($response) = $this->indexVariationTypeOptionWithHttpInfo($number, $number2);\n return $response;\n }", "public function testUpdateVariationTypeOption()\n {\n }", "public function putVariation()\n {\n return \"/V1/configurable-products/variation\";\n }", "protected function indexVariationTypeOptionRequest($number, $number2)\n {\n // verify the required parameter 'number' is set\n if ($number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling indexVariationTypeOption'\n );\n }\n // verify the required parameter 'number2' is set\n if ($number2 === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number2 when calling indexVariationTypeOption'\n );\n }\n\n $resourcePath = '/variations/{number}/types/{number}/options';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\n $resourcePath\n );\n }\n // path params\n if ($number2 !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number2),\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\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 testUpdateVariationType()\n {\n }", "protected function indexProductsVariationTypeRequest($number)\n {\n // verify the required parameter 'number' is set\n if ($number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling indexProductsVariationType'\n );\n }\n\n $resourcePath = '/products/{number}/variation-types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\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\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 indexVariation($search = null)\n {\n list($response) = $this->indexVariationWithHttpInfo($search);\n return $response;\n }", "public function setType(string $type): ISearchOption;", "public function testIndexProductsVariationType()\n {\n }", "public function testStoreVariationTypeOption()\n {\n }", "public function testReindexTypeOption()\n {\n $oldIndex = $this->_createIndex('', true, 2);\n $type1 = $oldIndex->getType('crossIndexTest_1');\n $type2 = $oldIndex->getType('crossIndexTest_2');\n\n $docs1 = $this->_addDocs($type1, 10);\n $docs2 = $this->_addDocs($type2, 10);\n\n $newIndex = $this->_createIndex(null, true, 2);\n\n // \\Elastica\\Type\n CrossIndex::reindex($oldIndex, $newIndex, array(\n CrossIndex::OPTION_TYPE => $type1,\n ));\n $this->assertEquals(10, $newIndex->count());\n $newIndex->deleteDocuments($docs1);\n\n // string\n CrossIndex::reindex($oldIndex, $newIndex, array(\n CrossIndex::OPTION_TYPE => 'crossIndexTest_2',\n ));\n $this->assertEquals(10, $newIndex->count());\n $newIndex->deleteDocuments($docs2);\n\n // array\n CrossIndex::reindex($oldIndex, $newIndex, array(\n CrossIndex::OPTION_TYPE => array(\n 'crossIndexTest_1',\n $type2,\n ),\n ));\n $this->assertEquals(20, $newIndex->count());\n }", "protected function updateVariationTypeOptionRequest($number, $type, $option_number, $body)\n {\n // verify the required parameter 'number' is set\n if ($number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling updateVariationTypeOption'\n );\n }\n // verify the required parameter 'type' is set\n if ($type === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $type when calling updateVariationTypeOption'\n );\n }\n // verify the required parameter 'option_number' is set\n if ($option_number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $option_number when calling updateVariationTypeOption'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateVariationTypeOption'\n );\n }\n\n $resourcePath = '/variations/{number}/types/{type}/options/{optionNumber}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\n $resourcePath\n );\n }\n // path params\n if ($type !== null) {\n $resourcePath = str_replace(\n '{' . 'type' . '}',\n ObjectSerializer::toPathValue($type),\n $resourcePath\n );\n }\n // path params\n if ($option_number !== null) {\n $resourcePath = str_replace(\n '{' . 'optionNumber' . '}',\n ObjectSerializer::toPathValue($option_number),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['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\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 }", "protected function showProductsVariationTypeRequest($number, $variation_type_number)\n {\n // verify the required parameter 'number' is set\n if ($number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling showProductsVariationType'\n );\n }\n // verify the required parameter 'variation_type_number' is set\n if ($variation_type_number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variation_type_number when calling showProductsVariationType'\n );\n }\n\n $resourcePath = '/products/{number}/variation-types/{variationTypeNumber}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\n $resourcePath\n );\n }\n // path params\n if ($variation_type_number !== null) {\n $resourcePath = str_replace(\n '{' . 'variationTypeNumber' . '}',\n ObjectSerializer::toPathValue($variation_type_number),\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\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 getVariationIndex()\n {\n return $this->_variationIndex;\n }", "function acf_add_action_variations( $action = '', $variations = array(), $index = 0 ) {\n}", "public function showVariationWithHttpInfo($number)\n {\n $returnType = '\\RackbeatApp\\Client\\Model\\Variation';\n $request = $this->showVariationRequest($number);\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 $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 '\\RackbeatApp\\Client\\Model\\Variation',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function showVariationTypeRequest($number, $type_number)\n {\n // verify the required parameter 'number' is set\n if ($number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling showVariationType'\n );\n }\n // verify the required parameter 'type_number' is set\n if ($type_number === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $type_number when calling showVariationType'\n );\n }\n\n $resourcePath = '/variations/{number}/types/{typeNumber}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\n $resourcePath\n );\n }\n // path params\n if ($type_number !== null) {\n $resourcePath = str_replace(\n '{' . 'typeNumber' . '}',\n ObjectSerializer::toPathValue($type_number),\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\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 acf_add_action_variations($action = '', $variations = array(), $index = 0)\n{\n}", "public function indexProductsVariationType($number)\n {\n list($response) = $this->indexProductsVariationTypeWithHttpInfo($number);\n return $response;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate relation between columns names and entities attributes
protected function getDescriptionColumnEntity() { return array( 'name' => array('key' => 'name') ); }
[ "public function dotAttributeNames()\n {\n return array_merge(\n array_values(parent::fields()),\n array_keys(static::dotKeyValues(static::dynamicColumn(), $this->_dynamicAttributes))\n );\n }", "private function generateLangTableAttributes()\r {\r $this->_langTableAttributes['id'] = $this->primaryKey();\r $this->_langTableAttributes['owner_id'] = $this->integer();\r $this->_langTableAttributes['language'] = $this->string(6);\r\r foreach ($this->multilingiualAttributes as $attribute) {\r $type = ArrayHelper::remove($this->_attributes, $attribute);\r if ($attribute != null) {\r $this->_langTableAttributes[$attribute] = $type;\r }\r }\r\r $this->foreignKeys[] = [\r 'name' => $this->baseLangTableName . '_owner_id',\r 'table' => $this->langTableName,\r 'columns' => 'owner_id',\r 'refTable' => $this->tableName,\r 'delete' => 'CASCADE',\r 'update' => 'CASCADE',\r ];\r\r }", "public function set_attributes_from_columns() {\n $cols = static::columns();\n array_walk($cols, function($column){\n $this->add_attribute($column);\n });\n }", "public function dotAttributeNames() : array\n {\n return array_merge(\n array_values(parent::fields()),\n array_keys(static::dotKeyValues(static::dynamicColumn(), $this->_dynamicAttributes))\n );\n }", "protected function getDescriptionColumnEntity()\n {\n\n return array(\n 'name' => array('key' => 'name', 'field' => 'name', 'type' => 'string')\n );\n }", "abstract protected function _getFormAttributeTable();", "function get_fields(){\n //\n //Start with an empty array that stores the resolved column attributes \n $fields=[];\n // \n //Get the indexed column names\n $index_names = $this->entity->indices;\n //\n //Test if the entity is properly constructed with idices for identification\n $x = \\count($index_names);\n //\n //If the entity does not have an index through an exception since we cannot \n //create an identifier\n if( $x === 0){\n throw new \\Exception(\"Table: {$this->entity->name} does not have indexes check its construction\");\n }\n //\n //Get the first index since I are only using the first index to retrieve \n //the indexed column names\n $index = array_values($index_names)[0];\n //\n //loop through the indexes and push to the fields if it is an attribute \n //else resolve it to its constituent column attributes \n foreach ($index as $cname){\n //\n //Get the root column that if by the indexed name \n $col= $this->entity->columns[$cname];\n //\n //Test if the column is an attribute \n //The column is an attribute it does not need to be resolved \n if($col instanceof \\column_attribute){\n //\n //Push the column it is already resolved \n array_push($fields, new column($col));\n }\n //\n //The column is a foreign it needs to resolved by first principle\n //steps\n //1. get the referenced table name \n //2. get the referenced entity\n //3. get resolved indexes of the referenced entity\n else{\n //\n //1. Get the referenced table name \n $ref= $col->ref_table_name;\n //\n //Test if this entity exists in the join entities list\n //1 if it does not exist push \n $en= array_search($ref, $this->join_entities);\n if ($en === false){\n //\n array_push($this->join_entities, $ref);\n }\n //\n //2. Get the referenced entity \n $entity1= $this->entity->dbase->entities[$ref];\n //\n //Repeat this process for the referenced entity \n $cols2= $this->resolve_ref($entity1);\n //\n //loop through the fields of the new identify pushing them to the \n //fields \n foreach ( $cols2 as $coll) {\n //\n //push the column attribute\n array_push($fields, $coll);\n }\n }\n \n }\n //\n //Update and include any name, title, description , or id fields\n $fields1=$this->update_fields($fields);\n //\n //return the collection of the resolved columns \n return $fields1;\n }", "public static function entity_fields()\n {\n return array(\n 'AlcAutomobile' => 'Automobiles',\n 'AlcAnniversary' => 'Anniversaries',\n 'AlcCity' => 'Cities',\n 'AlcCompany' => 'Companies',\n 'AlcContinent' => 'Continents',\n 'AlcCountry' => 'Countries',\n 'AlcDrug' => 'Drugs',\n 'AlcEntertainmentAward' => 'Entertainment awards',\n 'AlcFacility' => 'Facilities',\n 'AlcFieldTerminology' => 'Field terminologies',\n 'AlcFinancialMarketIndex' => 'Financial market indexes',\n 'AlcGeographicFeature' => 'Geographic features',\n 'AlcHealthCondition' => 'Health conditions',\n 'AlcHoliday' => 'Holidays',\n 'AlcMovie' => 'Movies',\n 'AlcMusicGroup' => 'Music groups',\n 'AlcNaturalDisaster' => 'Natural disasters',\n 'OperatingSystem' => 'Operating systems',\n 'AlcOrganization' => 'Organizations',\n 'AlcPerson' => 'People',\n 'AlcPrintMedia' => 'Print media',\n 'AlcRadioProgram' => 'Radio programs',\n 'AlcRadioStation' => 'Radio stations',\n 'AlcRegion' => 'Regions',\n 'AlcSport' => 'Sports',\n 'AlcStateOrCounty' => 'States or countries',\n 'AlcTechnology' => 'Technology',\n 'AlcTelevisionShow' => 'Television shows',\n 'AlcTelevisionStation' => 'Television stations'\n );\n }", "public function getFlatColumnsDdlDefinition()\n {\n $columns = [];\n $columns['entity_id'] = [\n 'type' => \\Magento\\Framework\\DB\\Ddl\\Table::TYPE_INTEGER,\n 'length' => null,\n 'unsigned' => true,\n 'nullable' => false,\n 'default' => false,\n 'primary' => true,\n 'comment' => 'Entity Id',\n ];\n if ($this->isAddChildData()) {\n $columns['child_id'] = [\n 'type' => \\Magento\\Framework\\DB\\Ddl\\Table::TYPE_INTEGER,\n 'length' => null,\n 'unsigned' => true,\n 'nullable' => true,\n 'default' => null,\n 'primary' => true,\n 'comment' => 'Child Id',\n ];\n $columns['is_child'] = [\n 'type' => \\Magento\\Framework\\DB\\Ddl\\Table::TYPE_SMALLINT,\n 'length' => 1,\n 'unsigned' => true,\n 'nullable' => false,\n 'default' => '0',\n 'comment' => 'Checks If Entity Is Child',\n ];\n }\n $columns['attribute_set_id'] = [\n 'type' => \\Magento\\Framework\\DB\\Ddl\\Table::TYPE_SMALLINT,\n 'length' => 5,\n 'unsigned' => true,\n 'nullable' => false,\n 'default' => '0',\n 'comment' => 'Attribute Set ID',\n ];\n $columns['type_id'] = [\n 'type' => \\Magento\\Framework\\DB\\Ddl\\Table::TYPE_TEXT,\n 'length' => 32,\n 'unsigned' => false,\n 'nullable' => false,\n 'default' => \\Magento\\Catalog\\Model\\Product\\Type::DEFAULT_TYPE,\n 'comment' => 'Type Id',\n ];\n return $columns;\n }", "protected function generateColumns()\n\t{\n\t\tforeach ($this->dataSource->getColumns() as $name) {\n\t\t\t$this->addColumn($name);\n\t\t}\n\t}", "public function __toString() {\n\t\treturn \"{$this->tableName}.{$this->columnName}\";\n\t}", "function generate_layer_attributes($schema, $table, $table_attributes) {\n\t\tforeach ($table_attributes AS $table_attribute) {\n\t\t\t$sql .= $this->generate_layer_attribute($schema, $table, $table_attribute);\n\n\t\t\tif ($table_attribute['type_type'] == 'c') {\n\t\t\t\t$sql .= $this->generate_datatype($schema, $table_attribute);\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "public function renderCreateColumns()\n {\n $columns = $this->getTableColumns();\n\n if (!$columns) {\n return '';\n }\n\n $source = '';\n\n foreach ($columns as $column) {\n $attributes = [$this->serializeArrayToAttributes($column->getName())];\n $type = $column->getType()->getName();\n\n switch ($type) {\n case Type::INTEGER:\n $method = 'integer';\n break;\n case Type::SMALLINT:\n $method = 'smallInteger';\n break;\n case Type::BIGINT:\n $method = 'bigInteger';\n break;\n case Type::STRING:\n $attributes[] = $column->getLength();\n $method = 'string';\n break;\n case Type::GUID:\n case Type::TEXT:\n $method = 'text';\n break;\n case Type::FLOAT:\n $method = 'float';\n break;\n case Type::DECIMAL:\n $attributes[] = $column->getPrecision();\n $attributes[] = $column->getScale();\n $method = 'decimal';\n break;\n case Type::BOOLEAN:\n $method = 'boolean';\n break;\n case Type::DATETIME:\n case Type::DATETIMETZ:\n $method = 'dateTime';\n break;\n case Type::DATE:\n $method = 'date';\n break;\n case Type::TIME:\n $method = 'time';\n break;\n case Type::BINARY:\n case Type::BLOB:\n $method = 'binary';\n break;\n case Type::JSON_ARRAY:\n $method = 'json';\n break;\n default:\n throw new DbExporterException('Not supported database column type' . $type);\n break;\n }\n\n $source .= '$table->' . $method . '(' . implode(', ', $attributes) . ')';\n if ($column->getUnsigned()) {\n $source .= \"\\n\" . ' ->unsigned()';\n }\n if (!$column->getNotnull()) {\n $source .= \"\\n\" . ' ->nullable()';\n }\n if ($column->getDefault() || $column->getDefault() === null && !$column->getNotnull()) {\n $source .= \"\\n\" . ' ->default(' . var_export($column->getDefault(), true) . ')';\n }\n $source .= ';' . \"\\n\";\n }\n\n return trim($source);\n }", "public function entity_fields() {\n\t\treturn array(\n\t\t\t'AlcAutomobile' => 'Automobiles',\n\t\t\t'AlcAnniversary' => 'Anniversaries',\n\t\t\t'AlcCity' => 'Cities',\n\t\t\t'AlcCompany' => 'Companies',\n\t\t\t'AlcContinent' => 'Continents',\n\t\t\t'AlcCountry' => 'Countries',\n\t\t\t'AlcDrug' => 'Drugs',\n\t\t\t'AlcEntertainmentAward' => 'Entertainment awards',\n\t\t\t'AlcFacility' => 'Facilities',\n\t\t\t'AlcFieldTerminology' => 'Field terminologies',\n\t\t\t'AlcFinancialMarketIndex' => 'Financial market indexes',\n\t\t\t'AlcGeographicFeature' => 'Geographic features',\n\t\t\t'AlcHealthCondition' => 'Health conditions',\n\t\t\t'AlcHoliday' => 'Holidays',\n\t\t\t'AlcMovie' => 'Movies',\n\t\t\t'AlcMusicGroup' => 'Music groups',\n\t\t\t'AlcNaturalDisaster' => 'Natural disasters',\n\t\t\t'OperatingSystem' => 'Operating systems',\n\t\t\t'AlcOrganization' => 'Organizations',\n\t\t\t'AlcPerson' => 'People',\n\t\t\t'AlcPrintMedia' => 'Print media',\n\t\t\t'AlcRadioProgram' => 'Radio programs',\n\t\t\t'AlcRadioStation' => 'Radio stations',\n\t\t\t'AlcRegion' => 'Regions',\n\t\t\t'AlcSport' => 'Sports',\n\t\t\t'AlcStateOrCounty' => 'States or countries',\n\t\t\t'AlcTechnology' => 'Technology',\n\t\t\t'AlcTelevisionShow' => 'Television shows',\n\t\t\t'AlcTelevisionStation' => 'Television stations'\n\t\t);\n\t}", "public function getAttributesDdlSql(){\n $padding = $this->getPadding();\n $eol = $this->getEol();\n $content = '';\n $content .= $this->getParentEntitiesFkAttributes($padding, true);\n if ($this->getIsFlat()){\n foreach ($this->getAttributes() as $attribute){\n $content .= $padding.$attribute->getDdlSqlColumn().$eol;\n }\n }\n if ($this->getIsFlat()) {\n $simulated = $this->getSimulatedAttributes(null, false);\n }\n elseif ($this->getIsTree()) {\n $simulated = $this->getSimulatedAttributes('tree', false);\n }\n else {\n $simulated = array();\n }\n foreach ($simulated as $attr){\n $content .= $padding.$attr->getDdlSqlColumn().$eol;\n }\n return substr($content,0, strlen($content) - strlen($eol));\n }", "public function _getFlatColumnsDdlDefinition()\n {\n $helper = Mage::getResourceHelper('eav');\n $columns = array();\n switch ($this->getBackendType()) {\n case 'static':\n $describe = $this->_getResource()->describeTable($this->getBackend()->getTable());\n if (!isset($describe[$this->getAttributeCode()])) {\n break;\n }\n $prop = $describe[$this->getAttributeCode()];\n $type = $prop['DATA_TYPE'];\n $size = ($prop['LENGTH'] ? $prop['LENGTH'] : null);\n\n $columns[$this->getAttributeCode()] = array(\n 'type' => $helper->getDdlTypeByColumnType($type),\n 'length' => $size,\n 'unsigned' => $prop['UNSIGNED'] ? true: false,\n 'nullable' => $prop['NULLABLE'],\n 'default' => $prop['DEFAULT'],\n 'extra' => null\n );\n break;\n case 'datetime':\n $columns[$this->getAttributeCode()] = array(\n 'type' => Varien_Db_Ddl_Table::TYPE_DATETIME,\n 'unsigned' => false,\n 'nullable' => true,\n 'default' => null,\n 'extra' => null\n );\n break;\n case 'decimal':\n $columns[$this->getAttributeCode()] = array(\n 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,\n 'length' => '12,4',\n 'unsigned' => false,\n 'nullable' => true,\n 'default' => null,\n 'extra' => null\n );\n break;\n case 'int':\n $columns[$this->getAttributeCode()] = array(\n 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,\n 'unsigned' => false,\n 'nullable' => true,\n 'default' => null,\n 'extra' => null\n );\n break;\n case 'text':\n $columns[$this->getAttributeCode()] = array(\n 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,\n 'unsigned' => false,\n 'nullable' => true,\n 'default' => null,\n 'extra' => null,\n 'length' => Varien_Db_Ddl_Table::MAX_TEXT_SIZE\n );\n break;\n case 'varchar':\n $columns[$this->getAttributeCode()] = array(\n 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,\n 'length' => '255',\n 'unsigned' => false,\n 'nullable' => true,\n 'default' => null,\n 'extra' => null\n );\n break;\n }\n\n return $columns;\n }", "public function attributeLabels(){\n\t\tif(!isset($this->_attributeLabels)){\n\t\t\t$this->_attributeLabels = array();\n\n//\t\t\t$classParts = explode('\\\\',$this->className());\n//\t\t\t$prefix = strtolower(array_pop($classParts));\n\n\t\t\tforeach($this->columns as $columnName=>$columnData){\n\t\t\t\t\n\t\t\t\t$str = ucfirst(str_replace(\"_\", \" \", $columnName));\n\t\t\t\t\n\t\t\t\t$label = GO::t($str, $this->getModule());\n\t\t\t\tif($label == $str) {\n\t\t\t\t\t$label = GO::t($str);\n\t\t\t\t}\n\t\t\t\t$this->_attributeLabels[$columnName] = $label;\n\t\t\t\tif(!$str == $label) {\n\t\t\t\t\t\tswitch($columnName){\n\t\t\t\t\t\t\tcase 'user_id':\n\t\t\t\t\t\t\t\t$this->_attributeLabels[$columnName] = GO::t(\"Created by\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muser_id':\n\t\t\t\t\t\t\t\t$this->_attributeLabels[$columnName] = GO::t(\"Modified by\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'ctime':\n\t\t\t\t\t\t\t\t$this->_attributeLabels[$columnName] = GO::t(\"Created at\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'mtime':\n\t\t\t\t\t\t\t\t$this->_attributeLabels[$columnName] = GO::t(\"Modified at\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t\t\t$this->_attributeLabels[$columnName] = GO::t(\"Name\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\treturn $this->_attributeLabels;\n\t}", "function get_fk_exp() {\n //Get the foreign key table of this column\n $fktable = $this->get_foreign_table();\n //\n //Debug\n //echo \"<pre>\".print_r($this, true).\"</pre>\"; die(\"\");\n //\n //Get the identification fields of the first index of the foreign \n //table\n //\n //Get the columns of the default index of the foreign table\n $cols = $fktable->first_index_cols();\n //\n //Map them to their string expressions\n $exps = array_map(function($col) {\n return (string) $col;\n }, $cols);\n //\n //Concatenate the expressions with a ,'/', separator so that the \n //values come out slash separated\n $str = implode(\", '/',\", $exps);\n //\n return \"concat($str) AS \" . $this->name . \"_\" . $this->name . \"_ext\";\n }", "public function columnMap()\n {\n $reflector = new \\ReflectionClass(get_class($this));\n $properties = $reflector->getProperties(\\ReflectionProperty::IS_PUBLIC);\n $map = array();\n // Keys are the real names in the table and\n // the values their names in the application\n foreach ($properties as $property) {\n $map[self::snakeCase($property->getName())] = $property->getName();\n }\n return $map;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Seta o combo de Tutor de acordo com o usuario logado no sistema e municipio selecionado.
private function setTutorFilter($form, $perfisUsuarioLogado, $arUsuario) { try { $businessUsuario = new Fnde_Sice_Business_Usuario(); $arDados = $this->_getAllParams(); $arDados = array_merge($arDados, $this->getSearchParamTurma()); $options = array(null => 'Selecione'); if (in_array(Fnde_Sice_Business_Componentes::COORDENADOR_ESTADUAL, $perfisUsuarioLogado) || in_array(Fnde_Sice_Business_Componentes::COORDENADOR_EXECUTIVO_ESTADUAL, $perfisUsuarioLogado) ) { $result = $businessUsuario->search( array("NU_SEQ_TIPO_PERFIL" => "6", "SG_UF_ATUACAO_PERFIL" => $arUsuario['SG_UF_ATUACAO_PERFIL'])); } else if (in_array(Fnde_Sice_Business_Componentes::ARTICULADOR, $perfisUsuarioLogado)) { $result = $businessUsuario->getTutorPorArticulador($arUsuario['NU_SEQ_USUARIO']); } else if (in_array(Fnde_Sice_Business_Componentes::TUTOR, $perfisUsuarioLogado)) { $result = $businessUsuario->search(array("NU_SEQ_USUARIO" => $arUsuario['NU_SEQ_USUARIO'])); } else if ($arDados["CO_MUNICIPIO"]) { $result = $businessUsuario->search( array("NU_SEQ_TIPO_PERFIL" => "6", "CO_MUNICIPIO_PERFIL" => $arDados["CO_MUNICIPIO"])); } foreach ($result as $res) { $options[$res['NU_SEQ_USUARIO']] = $res['NO_USUARIO']; } $form->setTutor($options); } catch (Exception $e) { $this->addInstantMessage(Fnde_Message::MSG_ERROR, $e); } }
[ "private function setTutor($form, $perfilUsuario, $arDados, $arUsuario)\n {\n $businessUsuario = new Fnde_Sice_Business_Usuario();\n\n $options = array(null => 'Selecione');\n\n //Verificando se o usuário logado é articulador ou administrador\n //Pois eles não podem cadastrar turmas porém podem visualizar, mudando a forma de preencher os combos de tutor e articulador.\n //Articulador =\tPesquisa e visualiza as turmas na qual está vinculado.\n //Coordenador Nacional Gestor e Coordenador Nacional Equipe = Poderá visualizar todas as turmas de todas as UF’s\n if (in_array(Fnde_Sice_Business_Componentes::ARTICULADOR, $perfilUsuario)\n || in_array(Fnde_Sice_Business_Componentes::COORDENADOR_NACIONAL_EQUIPE, $perfilUsuario)\n || in_array(Fnde_Sice_Business_Componentes::COORDENADOR_NACIONAL_GESTOR, $perfilUsuario)\n ) {\n $result = $businessUsuario->search(array(\"NU_SEQ_USUARIO\" => $arDados['NU_SEQ_USUARIO_TUTOR']));\n //Coordenador Nacional Administrador = Poderá visualizar e editar todas as turmas de todas as UF’s\n } else if (in_array(Fnde_Sice_Business_Componentes::COORDENADOR_NACIONAL_ADMINISTRADOR, $perfilUsuario)) {\n if ($arDados['UF_TURMA']) { //caso a turma já esteja definida lista apenas os tutores daquela mesorregião\n $result = $businessUsuario->search(array(\"CO_MESORREGIAO\" => $arDados['CO_MESORREGIAO'], \"NU_SEQ_TIPO_PERFIL\" => \"6\"));\n } else {\n $result = $businessUsuario->getTutores();\n }\n //Coordenador Estadual = Poderá visualizar e editar apenas as turmas da sua UF de atuação.\n } else if (in_array(Fnde_Sice_Business_Componentes::COORDENADOR_ESTADUAL, $perfilUsuario)\n || in_array(Fnde_Sice_Business_Componentes::COORDENADOR_EXECUTIVO_ESTADUAL, $perfilUsuario)\n ) {\n $result = $businessUsuario->search(array(\"SG_UF_ATUACAO_PERFIL\" => $arUsuario['SG_UF_ATUACAO_PERFIL'], \"NU_SEQ_TIPO_PERFIL\" => \"6\"));\n //Tutor\tCadastra, pesquisa, exclui e visualiza turmas na qual está vinculado.\n } else {\n $result = $businessUsuario->search(array(\"NU_SEQ_USUARIO\" => $arUsuario['NU_SEQ_USUARIO']));\n }\n\n foreach ($result as $usuario) {\n $options[$usuario['NU_SEQ_USUARIO']] = $usuario['NO_USUARIO'];\n }\n\n $form->setTutor($options);\n }", "public function select_tutor_() {\n\t\teval(ADMIN);\n\t\ttry{\n\t\t\t$cond['id'] = safepost('team_id');\n\t\t\t$data['tutor_id'] = safepost('id');\n\t\t\tDBModel::updateDB('cernet_team', $cond, $data);\n\t\t\tgoback();\n\t\t}catch(Exception $e){\n\t\t\tgoback();\n\t\t}\n\t}", "public function setTbAutorNome($tbAutorNome){\n\t$this->tbAutorNome = $tbAutorNome;\n}", "function getTutors()\n {\n $tutorList = $this->find('all', array(\n 'conditions' => array('Role.id' => $this->USER_TYPE_TA)));\n return Set::combine($tutorList, '{n}.User.id', '{n}.User.'.$this->displayField);\n }", "function getComboUsuariosIntegracao(){\n\t\t\t$usuario = new Usuario;\n\t\t\t$permissao = new Permissao;\n\t\t\t$cliente = new Cliente;\n\t\t\t$usuario\n\t\t\t\t->alias('u')\n\t\t\t\t->join($permissao,'inner','p','id_usuario','id_usuario')\n\t\t\t\t->join($cliente,'left','c','id_cliente','id_cliente')\n\t\t\t\t->where('p.id_projeto='.$_SESSION['id_projeto_logado'].' and p.integra=true')\n\t\t\t\t->order('u.nome')\n\t\t\t\t->find();\n\t\t\t$usuarios = $usuario->allToArray();\n\t\t\t\n\t\t\tforeach($usuarios as $item) {\n\t\t\t\t$result .= '<option value=\"'.$item['id_usuario'].'\"';\n\t\t\t\t$result .= '>'.$item['nome'].' ('.$item['nome_curto'].')</option>';\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public static function getTutorDropdown() {\n\n $tutors = User::orderBy('name', 'ASC')->get();\n\n $tutors_for_dropdown = [];\n foreach($tutors as $tutor) {\n $tutors_for_dropdown[$tutor->id] = $tutor->name;\n }\n\n return $tutors_for_dropdown;\n }", "public function selectCliente() {\n $this->consulta2= $this->con->query(\"SELECT * FROM usuarios WHERE privilegio = 4 ORDER BY apellido,nombre ASC\");\n while ($this->datos2= $this->consulta2->fetch_array()) {\n ?>\n <option value=\"<?php echo $this->datos2['idUsuario']; ?>\"><?php echo $this->datos2['apellido'].\", \".$this->datos2['nombre']; ?></option>\n <?php\n }\n $this->con->close();\n }", "function getComboResponsaveis(){\n\t\t\t$usuario = new Usuario;\n\t\t\t$permissao = new Permissao;\n\t\t\t$usuario\n\t\t\t\t->alias('u')\n\t\t\t\t->join($permissao,'inner','up','id_usuario','id_usuario')\n\t\t\t\t->where('id_projeto='.$_SESSION['id_projeto_logado'].' and tipo <> 3')\n\t\t\t\t->order('u.nome')\n\t\t\t\t->find();\n\t\t\t$usuarios = $usuario->allToArray();\n\t\t\t\n\t\t\tforeach($usuarios as $item) {\n\t\t\t\t$result .= '<option value=\"'.$item['id_usuario'].'\"';\n\t\t\t\tif (!empty($_SESSION['upd_requisicao'])) {\n\t\t\t\t\tif($item['id_usuario']==$_SESSION['obj_requisicao']['id_usuario_responsavel']) $result .= ' selected';\n\t\t\t\t}\n\t\t\t\tif($_SESSION['responsavel_log'] == $item['id_usuario']) $result .= ' selected';\n\t\t\t\t$result .= '>'.$item['nome'].'</option>';\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function setIdTutor($idTutor)\r\n {\r\n $this->idTutor = $idTutor;\r\n }", "public function setNombre_tutor($nombre_tutor){\n $this->nombre_tutor = $nombre_tutor;\n }", "public function getTbAutorSobrenome(){\n\treturn $this->tbAutorSobrenome;\n}", "function criarAutorFormMenuLateral($tab){\n \t\t\t\tdivClass($tab,\"<input type=\\\"checkbox\\\" name=\\\"chboxautor\\\" checked id=\\\"chboxautor\\\" onClick=\\\"mostra(this,'autor')\\\" /><label for=\\\"chboxautor\\\">Autor:</label>\\n\",\"itemMenuBusca\");\n \t\t\t\tdivClass($tab,\"<input type=\\\"text\\\" name=\\\"autor\\\" class=\\\"texto\\\" value=\\\"Nome do Autor\\\" onClick=\\\"limpa(this)\\\" />\\n\",\"itemMenuBusca\");\n\t\t }", "public function rolUsuarioSeleccionado($rolSeleccionado)\n\t{\n\t\t\n\t}", "public function getSelectForUsuarios($tipo, $firstID){\n\t\t$informacion = Crud::vistaXTablaModel(\"usuarios\"); //se obtienen todos los usuarios de la bd mediante la conexion al modelo\n\t\tif(!empty($informacion)){\n\t\t\tif($firstID==\"\"){\n\t\t\t\tforeach ($informacion as $row => $item) {\n\t\t\t\t\tif($item[\"tipo\"]==$tipo){\n\t\t\t\t\t\techo \"<option value='\".$item['id'].\"'>\".$item['nombre']. \" \" .$item[\"apellidos\"] .\"</option>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$reg = Crud::getRegModel($firstID, \"usuarios\");\n\t\t\t\t//se coloca primero la opcion del select del usuario\n\t\t\t\techo \"<option value='\".$reg['id'].\"'>\".$reg['nombre'].\" \".$reg[\"apellidos\"].\"</option>\";\n\t\t\t\tforeach ($informacion as $row => $item) { //se imprimen los usuarios restantes\n\t\t\t\t\tif($item['id']!=$firstID && $item[\"tipo\"]==$tipo)\n\t\t\t\t\t\techo \"<option value='\".$item['id'].\"'>\".$item['nombre']. \" \" .$item[\"apellidos\"] .\"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "public function vistaTecnicoSelectController(){\n\t\t\t$respuesta = Datos::vistaTecnicoModel(\"usuario\");\n\t\t\t$a=\"\";\n\n\t\t\n\t\t\tforeach($respuesta as $row => $item){\n\t\t\t\t$id=$item[\"id_usuario\"];\n\t\t\t\t$e=$item[\"nombre\"];\n\n\t\t\t\n\t\t\techo'<option value='.$id.'>'.$e.'</option>';\n\t\t\n\n\t\t\t}\n\t\t}", "public function selectUniversity() {\n\t\tif ($this->mysql) {\n\t\t\t$this->lookForUniInDatabase();\n\t\t}\n\t\t$redo = true;\n\t\tif ($this->university->university_title) {\n\t\t\techo \"\\nCurrent \" . $this->university;\n\t\t\t$redo = UserInterface::questionYN(\"Change university properties?\");\n\t\t}\n\t\tif ($redo) {\n\t\t\t$this->manualUniversityInput();\n\t\t\techo \"\\n\\nCurrent \" . $this->university;\n\t\t}\n\t}", "function comboTutores($idRol, $cuales = \"todos\", $idCursoAbierto = NULL, $idRelCursoGrupo = NULL) {\n $tutores = getTutores($idRol, $cuales, $idCursoAbierto, $idRelCursoGrupo);\n if (!empty($tutores)) {\n foreach ($tutores as $tutor) {\n echo <<<COMBO\n <option value=\"$tutor->id_tutor\">$tutor->nombre_pila $tutor->primer_apellido $tutor->segundo_apellido</option> \nCOMBO;\n }\n }\n}", "public function setCreator()\n\t{\n $this->Creator = new Socnet_User('id',$this->creatorId);\n\t}", "public function getTbAutorId(){\n\treturn $this->tbAutorId;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the comment belongs to the current user (making him a moderator for this comment)
public static function isCommentModerator($userId = 0) { $user = JFactory::getUser(); if (!$userId || $user->guest) { return false; } if ($user->id == $userId) { return true; } else { return false; } }
[ "function user_can_edit_comment() {\n\n\t/* Check to see who can edit */\n\tglobal $comment;\n\t$user_id \t= get_current_user_id();\n\t$author_id \t= $comment->user_id;\n\n\t/* Comment authors and moderators are allowed */\n\tif ( $user_id == $author_id || current_user_can( 'moderate_comments' ) || current_user_can( 'moderate' ) ) \n\t\treturn true;\n}", "public function isOwnedBy($comment, $user) {\n return $this->field('id', array('id' => $comment, 'user_id' => $user)) !== false;\n }", "function is_my_comment($comment_ID)\n{\n if ( !$comment_ID ) return false;\n $c = get_comment($comment_ID);\n if ($c) {\n return $c->user_id == wp_get_current_user()->ID;\n }\n return false;\n}", "public function currentAdminCanEditThisComment() {\n return auth()->check()\n and auth()->user()->contributor_id == $this->contributor_id;\n }", "function can_modify_comment($comment_id)\n{\n global $db;\n $result = $db->query(\"SELECT user_id FROM request_comments WHERE id=$comment_id\");\n if (!$result || $result->num_rows == 0)\n {\n return FALSE;\n }\n\n $uid = $_SESSION['id'];\n $cuid = $result->fetch_row()[0];\n if ($cuid != $uid)\n {\n return FALSE;\n }\n\n return TRUE;\n}", "public function isModeratorOnly();", "function isModerator($forum_id = 0, $action = '', $user_id = 0)\n\t{\n\t\t// If we aren't logged in, we cannot possibly a moderator\n\t\tif ($this->isLoggedIn())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// If given user_id is 0 we tak the user_id of the current user --> Check if own user is mod\n\t\treturn is_moderator($forum_id, $action, ($user_id == 0) ? $this->mybb->user['uid'] : $user_id);\n\t}", "function validate_currentUser_owns_comment( $comment_id ) {\n\t\t$current_user_id = Auth::User()->id;\n\t\t$validate_currentUser_owns_comment = Comment::whereid( $comment_id )->whereuser_id( $current_user_id )->first();\n\n\t\treturn $validate_currentUser_owns_comment;\n\t}", "function isUserAdmin($idComment, $userId) {\n\t\tif (!$userId) {\n\t\t\t// Not logged in\n\t\t\treturn false;\n\t\t}\n\t\t// TODO: Replace with role check\n\t\tif ($userId == 1) {\n\t\t\treturn true;\n\t\t}\n\t\t$idOwner = $this->db->fetch_atom(\"SELECT FK_USER_OWNER FROM `comment` WHERE ID_COMMENT=\".(int)$idComment);\n\t\treturn ($idOwner == $userId);\n\t}", "function buckys_is_community_moderator(){\n global $TNB_GLOBALS;\n\n if(!buckys_check_user_acl(USER_ACL_MODERATOR))\n return false;\n\n if(!BuckysModerator::isModerator($TNB_GLOBALS['user']['userID']))\n return false;\n\n return true;\n}", "public function current_user_can_edit_campaign() {\n\t\t\t$campaign = $this->get_campaign();\n\n\t\t\tif ( ! $campaign ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn $this->get_campaign()->post_author == get_current_user_id();\n\t\t}", "private function commentOwnedByUser(User $user, Comment $comment) {\n if ($comment->user_id === $user->id) {\n return true;\n }\n return false;\n }", "function user_allowed_comments(): bool\n\t{\n\t\treturn $this->db->enable_comments && ($this->db->enable_comments != 2 || $this->get_user());\n\t}", "protected function CanModifyComment($comment, $user) {\n if (!$comment)\n return false;\n\n if (!$user)\n return false;\n\n // Anonymous users can never modify a comment\n if (!$this->get('security.context')->isGranted('IS_AUTHENTICATED_REMEMBERED', $user))\n return false;\n\n // Admin can modify any comment\n if ($this->get('security.context')->isGranted('ROLE_ADMIN', $user))\n return true;\n\n // Comment without author.. should not happen\n if (!$comment || (!($comment->getAuthor())))\n return false;\n\n // The owner of a post can modify any comment of this post\n if ($comment->getPublication()->getAuthor()->getId() == $user->getId())\n return true;\n\n // Owner of a comment can delete its own comment\n if ($comment->getAuthor()->getId() == $user->getId())\n return true;\n\n\n return false;\n }", "public static function is_moderator(){\n\n // get the logged in user\n if(isset($_SESSION['User']['id'])){\n $iUserId = (int)$_SESSION['User']['id'];\n } else{\n $iUserId = 0;\n }\n\n // get their role\n $user = new Users();\n $userRoleId = $user->select_user_role_by_id($iUserId);\n $roleId = $userRoleId['user_role_id'];\n\n // compare the tole to the user passed\n if ($roleId != 5) {\n return false;\n die();\n }\n return true;\n\n }", "public function isModerator() {\n return $this->xpdo->discuss->user->isModerator($this->get('board'));\n }", "public function is_editable_by_current_user() {\n if ( current_user_can( 'edit_post', $this->get_id() ) ) {\n return true;\n }\n return false;\n }", "private function isCommentCreator(User $user, Comment $comment){\n return $comment->user_id === $user->id;\n }", "function checkPermissionToCommentTweet() {\n $tweetid = getIdFromURL();\n $tweet = \\Repository\\TweetRepository::getTweetById($tweetid);\n $fromID = $tweet['fromid'];\n $toid = $tweet['toid'];\n $currentID = \\Repository\\UserRepository::getIdByUsername($_SESSION['username']);\n\n checkIntValueOfId($tweetid);\n\n if($toid != $currentID) {\n if(\\Repository\\FriendRepository::isFriend($currentID, $toid) == null ||\n \\Repository\\ResctrictionRepository::isBlocked($toid, $currentID) != null) {\n return false;\n }\n }\n\n return true;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear the child elements. All child elements are removed.
public function clearChildElements(): void { $this->m_children = []; }
[ "public function clearChildren()\n {\n $this->children = null;\n $this->children = array();\n }", "public function clearChildren()\n {\n $this->children = array();\n }", "function clear_childs() {\n $this->childs = NULL;\n }", "public function clear_elements()\n {\n $this->set_elements(array());\n }", "public function clear()\n {\n $this->removeAllElements();\n }", "public function clear()\n {\n $this->elements = [];\n }", "public function removeAll() {\r\n $size = $this->childNodes()->count();\r\n for($i = 0; $i < $size; $i++):\r\n $node = $this->childNodes()->item(0);\r\n $this->removeChild($node);\r\n endfor;\r\n }", "public function clear()\n {\n $mem = memory_get_usage();\n XmlElement::$memory = ($mem > XmlElement::$memory) ? $mem : XmlElement::$memory;\n\n foreach($this->elements as $element){\n $element->clear();\n }\n\n array_splice($this->elements, 0);\n array_splice($this->attributes, 0);\n }", "public function clearChildren(): void\n {\n if ($this->children instanceof Collection) {\n $this->children = new Collection;\n return;\n }\n\n $this->children = [];\n }", "public function clear() {\n $this->elements = array();\n }", "function clear()\r\n\t\t{\r\n\t\t\t$this->elements = array();\r\n\t\t}", "public function clear(){\r\n\t\t\t$this->dom->clear();\r\n\t\t}", "public function detachChildren(): void\n {\n foreach ($this->children() as $children) {\n $children->setParent(null);\n }\n\n $this->firstChild = $this->lastChild = null;\n }", "public function removeChildren();", "public function reset()\n\t{\n\t\t$this->elements = null;\n\t}", "function DeleteChildren()\n {\n //Loop through all child tags\n for($x = 0; $x < count($this->tagChildren); $x ++)\n {\n //Do this recursively\n $this->tagChildren[$x]->DeleteChildren();\n \n //Delete the name and value\n $this->tagChildren[$x] = null;\n unset($this->tagChildren[$x]);\n }\n }", "public function clearAll() {\n unset($this->__xmlRoot->row);\n\n $this->__xmlRoot->asXml($this->__path);\n }", "public function clearAll()\n\t{\n\t\t$this->clearAuthAssignments();\n\t\t$this->_children=array();\n\t\t$this->_items=array();\n\t}", "protected function _ClearTree() {\n \n // TODO: do this recursevely by implementing node deletion\n \n $this->m_root = null;\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get product replace data.
public function get_replace_data( $data ) { $data['permalink'] = array( $this, 'get_product_permalink' ); $data['price'] = array( $this, 'get_product_price' ); return $data; }
[ "public function getProductData(){\r\n\t\treturn $this->product_data;\r\n\t}", "public function getProductData()\n {\n $p = $this->coreRegistry->registry('current_product');\n \n $data = [];\n \n $data['content_name'] = $this->helper\n ->escapeSingleQuotes($p->getName());\n $data['content_ids'] = $this->helper\n ->escapeSingleQuotes($p->getId());\n $data['content_type'] = 'product';\n $data['value'] = number_format(\n $this->getCalculatedPrice(),\n 2,\n '.',\n ''\n );\n $data['currency'] = $this->getCurrencyCode();\n \n return $data;\n }", "public function getProductData() {\n return $this->productData;\n }", "protected function getPostProductData()\n {\n return [\n 'sync_product' => [\n 'name' => 'SDK Test name',\n 'thumbnail' => 'https://picsum.photos/200/300',\n ],\n 'sync_variants' => [\n [\n 'retail_price' => 21.00,\n 'variant_id' => 4011,\n 'files' => [\n [\n 'url' => 'https://picsum.photos/200/300',\n ],\n [\n 'type' => 'back',\n 'url' => 'https://picsum.photos/200/300',\n ],\n ],\n 'options' => [\n [\n 'id' => 'embroidery_type',\n 'value' => 'flat',\n ],\n [\n 'id' => 'thread_colors',\n 'value' => '',\n ],\n ],\n ],\n [\n 'retail_price' => 21,\n 'variant_id' => 4012,\n 'files' => [\n [\n 'url' => 'https://picsum.photos/200/300',\n ],\n [\n 'type' => 'back',\n 'url' => 'https://picsum.photos/200/300',\n ],\n ],\n 'options' => [\n [\n 'id' => 'embroidery_type',\n 'value' => 'flat',\n ],\n [\n 'id' => 'thread_colors',\n 'value' => '',\n ],\n ],\n ],\n ],\n ];\n }", "public function getProductContent(): string {\n return $this->productContent;\n }", "protected function _getProductVariables() {\n $productVariables = \"\";\n if($this->_helper()->isEnabled() == 1) {\n $product = $this->_getProduct();\n if($product) {\n $productSku = $this->_editString($product->getSku());\n $productName = $this->_editString($product->getName());\n $productType = $this->_editString($product->getTypeId());\n $attributeSetModel = Mage::getModel(\"eav/entity_attribute_set\");\n $attributeSetModel->load($product->getAttributeSetId());\n $attributeSetName = $this->_editString($attributeSetModel->getAttributeSetName());\n\n if($product->_data[\"special_price\"]) {\n $productPrice = round($product->_data[\"special_price\"],2);\n } else {\n $productPrice = round($product->_data[\"price\"],2);\n }\n \n if($productType == \"grouped\") {\n $aProductIds = $product->getTypeInstance()->getChildrenIds($product->getId());\n $prices = array();\n foreach ($aProductIds as $ids) {\n foreach ($ids as $id) {\n $aProduct = Mage::getSingleton('catalog/product')->load($id);\n array_push($prices, $aProduct->getData('minimal_price'));\n }\n }\n sort($prices, SORT_NUMERIC);\n $productPrice = round($prices[0],2);\n }\n elseif($productType == \"bundle\") {\n $priceModel = $product->getPriceModel();\n $productPrice = $priceModel->getTotalPrices($product, null, null, false);\n $productPrice = $productPrice[0];\n }\n $this->_editString($productPrice);\n\n $productVariables = self::TABBED_SPACE . 'var REED_page_type = \"Product' . ';' . $productType . ';' . $attributeSetName . '\";' . self::NEW_LINE;\n $productVariables .= self::TABBED_SPACE . 'var REED_product_sku = \"' . $productSku . '\";' . self::NEW_LINE;\n $productVariables .= self::TABBED_SPACE . 'var REED_product_name = \"' . $productName . ';' . $productType . ';' . $attributeSetName . '\";' . self::NEW_LINE;\n $productVariables .= self::TABBED_SPACE . 'var REED_product_price = \"' . $productPrice . '\";' . self::NEW_LINE;\n //Get the value from the custom attributes defined if they exist for current\n //product\n $customAttrOne = $this->_helper()->getCustomAttrOne();\n $customAttrTwo = $this->_helper()->getCustomAttrTwo();\n $numberAttrOne = $this->_helper()->getNumberAttrOne();\n $numberAttrTwo = $this->_helper()->getNumberAttrTwo();\n $attrOneOptionId = $product->getData($customAttrOne);\n $attrTwoOptionId = $product->getData($customAttrTwo);\n\n if($attrOneOptionId) {\n $productVariables .= self::TABBED_SPACE . 'var REED_custom_v1 = \"' . $this->_editString($this->_getCustomAttributeValue($customAttrOne)) . ';' . $this->_customAttrName($customAttrOne) . '\";' . self::NEW_LINE;\n }\n if($attrTwoOptionId) {\n $productVariables .= self::TABBED_SPACE . 'var REED_custom_v2 = \"' . $this->_editString($this->_getCustomAttributeValue($customAttrTwo)) . ';' . $this->_customAttrName($customAttrTwo) . '\";' . self::NEW_LINE;\n }\n $calcNumAttrOne = $this->_calcNumberAttr($numberAttrOne);\n $calcNumAttrTwo = $this->_calcNumberAttr($numberAttrTwo);\n if($calcNumAttrOne != 0) {\n $productVariables .= self::TABBED_SPACE . 'var REED_custom_v3 = \"' . $this->_calcNumberAttr($numberAttrOne) . self::NEW_LINE;\n }\n if($calcNumAttrTwo != 0) {\n $productVariables .= self::TABBED_SPACE . 'var REED_custom_v4 = \"' . $this->_calcNumberAttr($numberAttrTwo) . self::NEW_LINE;\n }\n }\n }\n return $productVariables;\n }", "public function getProductInfo()\n {\n return $this->product_info;\n }", "public function loadVariableProduct()\n {\n //====================================================================//\n // Load From DataBase\n $posts = get_posts(array(\n 'post_type' => \"product\",\n 'post_status' => array_keys(get_post_statuses()),\n 'title' => self::VARIABLE_PRODUCT,\n ));\n if (empty($posts)) {\n return null;\n }\n $post = array_shift($posts);\n\n return wc_get_product(($post instanceof WP_Post) ? $post->ID : $post);\n }", "public function getCustomizeDataByProductId($productId);", "private function get_content_product_ouput($product){\n\t\tif(!is_object($product)) return \"[Invalid object provided]\";\n\n\t\tob_start();\n\t\t$GLOBALS['product'] = $product;\n\t\t$GLOBALS['post'] = $product->post;\n\t\twc_get_template_part( 'content', 'product' );\n\t\t$output = trim(preg_replace( \"|[\\r\\n\\t]|\", \"\", ob_get_clean()));\n\n\t\treturn $output;\n\t}", "public function getProductInfo()\n {\n return $this->productInfo;\n }", "public function product()\n {\n return $this->m_product;\n }", "public function getProduct();", "protected function _prepareProductForResponse(Herfox_SalesForce_Model_Product $product) {\n $productData = $product->getData();\n }", "public function GenerateData()\n\t{\n\t\t$data_state = $this->_Generate($this->_Prepare($this->_pattern));\n\t\t\n\t\t// Perform subpattern substitutions\n\t\tif ($count = count($data_state->subpattern_products))\n\t\t{\n\t\t\t$data_state->subpattern_products = array_merge(array(' '), $data_state->subpattern_products);\n\n\t\t\t++$count;\n\t\t\tfor ($i=$count-1; $i > 0; --$i) // last references processed first\n\t\t\t{\n\t\t\t\t$data_state->product = str_replace('${'.$i.'}', $data_state->subpattern_products[$i], $data_state->product);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data_state->product = str_replace('${0}', str_replace('${0}', '', $data_state->product), $data_state->product);\n\t\t\n\t\treturn $data_state->product;\n\t}", "public function getProduct() {\n\t\treturn $this->product;\n\t}", "public function getProduct()\n {\n return Mage::registry('current_product');\n }", "function get_product_details(){\n \t$product_details = $this->bug_reporter->get_product_details();\n \treturn $product_details;\n }", "public function getProductInformation()\n {\n $this->queryDatabase();\n return $this->products;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
storing dates and venues and timetable through dance model
public function __construct() { $this->danceModel = $this->model('DanceModel'); $this->venues = $this->danceModel->venues; $this->dates = $this->danceModel->dates; $this->timetable = $this->danceModel->getTimetable(); }
[ "public function post_ds_venues()\n {\n\t\t$pk = (int)$this->input->post('dateset_pk');\n\t\t//$facility_id = (int)$this->input->post('facility_id');\n\t\t$v_array = json_decode($this->input->post('venue_array'));\n\t\t\n\t\t$this->schedule_model->s_insert_dateset_venues($pk,$v_array);//array of ids\n }", "public function saveBookingHourlyDays() {\n\n $dayForms = $this->dayForms;\n\n foreach ($dayForms as $dayForm) {\n\n if ($dayForm->selected) {\n\n $bookingHourlyDay = new BookingHourlyDay();\n $bookingHourlyDay->day_week = $dayForm->dayWeek;\n $bookingHourlyDay->start_time = $dayForm->getStartTime();\n $bookingHourlyDay->end_time = $dayForm->getEndTime();\n $bookingHourlyDay->id_booking = $this->id;\n\n $bookingHourlyDay->save();\n }\n }\n }", "function spent_on() {\n if(array_key_exists('spent_on', $this->data[$this->name])) {\n $this->data[$this->name]['tyear'] = date('Y', strtotime($this->data[$this->name]['spent_on']));\n $this->data[$this->name]['tmonth'] = date('m', strtotime($this->data[$this->name]['spent_on']));\n $this->data[$this->name]['tweek'] = date('W', strtotime($this->data[$this->name]['spent_on']));\n }\n }", "public static function scheduleSeedData(){\n $startTime = 9.00;\n $endTime = 16.00;\n for ($startTime; $startTime<=$endTime; $startTime++){\n $schedule = new Schedule();\n $scheduleTime = $startTime;\n $schedule->time = number_format($scheduleTime, 2);\n $schedule->save();\n }\n }", "public\r\n function setTimeTable(){\r\n $start = $_POST ['start'];\r\n $hours = $_POST ['hours'];\r\n $trainerId = $_POST ['trainerId'];\r\n $dates = $_POST ['date'];\r\n $results = mysqli_query ( $this->con, \"INSERT INTO trainerSchedule (trainerId,date,startTime,noOfHours)\r\n VALUES ('$trainerId','$dates','$start','$hours')\" );\r\n }", "public function store()\n\t{\n $response=null;\n $data = Input::all();\n $data['clinic_id'] = Auth::user()->clinic_id;\n $day = $data['day'];\n $dayFinal = isset(GlobalsConst::$DP_DAYS[$day]) ? GlobalsConst::$DP_DAYS[$day] : null;\n $data['day'] = $dayFinal;\n\n Dutyday::$rules['day'] = 'required|unique:dutydays,day,NULL,id,employee_id,'.$data['employee_id'];\n\t\t$validator = Validator::make($data, Dutyday::$rules);\n\n\t\tif($validator->fails()) {\n $response = ['success'=>false,'error'=>true,'message' => $validator->errors()];\n\t\t}elseif($dayFinal == null){\n $response = ['success'=>false,'error'=>true,'message' => 'Wrong Day provided!'];\n }else{\n $dutyDay = Dutyday::create($data);\n Dutyday::makeSlots($data['start'], $data['end'], $dutyDay->id, $data['employee_id']);\n $response = ['success'=>true,'error'=>false,'message' => 'Day Time has been saved successfully'];\n }\n\n return Response::json($response);\n /*$data['clinic_id'] = Auth::user()->clinic_id;\n\t\tif(Input::get('Sunday') != null){\n $data['day'] = (Input::get('Sunday'));\n $data['start'] = str_replace(' ', '', (Input::get('sun_start_time')));\n $data['end'] = str_replace(' ', '', (Input::get('sun_end_time')));\n $day_id = Dutyday::create($data)->id;\n Dutyday::makeSlots($data['start'], $data['end'], $day_id, $data['employee_id']);\n }else{\n $data['day'] = null;\n $data['start'] = null;\n $data['end'] = null;\n Dutyday::create($data);\n }\n\n if(Input::get('Monday') != null){\n \t$data['day'] = (Input::get('Monday'));\n $data['start'] = str_replace(' ', '', (Input::get('mon_start_time')));\n $data['end'] = str_replace(' ', '', (Input::get('mon_end_time')));\n $day_id = Dutyday::create($data)->id;\n Dutyday::makeSlots($data['start'], $data['end'], $day_id, $data['employee_id']);\n }else{\n $data['day'] = null;\n $data['start'] = null;\n $data['end'] = null;\n Dutyday::create($data);\n }\n\n if(Input::get('Tuesday') != null){\n \t$data['day'] = (Input::get('Tuesday'));\n $data['start'] = str_replace(' ', '', (Input::get('tue_start_time')));\n $data['end'] = str_replace(' ', '', (Input::get('tue_end_time')));\n $day_id = Dutyday::create($data)->id;\n Dutyday::makeSlots($data['start'], $data['end'], $day_id, $data['employee_id']);\n }else{\n $data['day'] = null;\n $data['start'] = null;\n $data['end'] = null;\n Dutyday::create($data);\n }\n\n if(Input::get('Wednesday') != null){\n \t$data['day'] = (Input::get('Wednesday'));\n $data['start'] = str_replace(' ', '', (Input::get('wed_start_time')));\n $data['end'] = str_replace(' ', '', (Input::get('wed_end_time')));\n $day_id = Dutyday::create($data)->id;\n Dutyday::makeSlots($data['start'], $data['end'], $day_id, $data['employee_id']);\n }else{\n $data['day'] = null;\n $data['start'] = null;\n $data['end'] = null;\n Dutyday::create($data);\n }\n\n if(Input::get('Thursday') != null){\n \t$data['day'] = (Input::get('Thursday'));\n $data['start'] = str_replace(' ', '', (Input::get('thu_start_time')));\n $data['end'] = str_replace(' ', '', (Input::get('thu_end_time')));\n $day_id = Dutyday::create($data)->id;\n Dutyday::makeSlots($data['start'], $data['end'], $day_id, $data['employee_id']);\n }else{\n $data['day'] = null;\n $data['start'] = null;\n $data['end'] = null;\n Dutyday::create($data);\n }\n\n if(Input::get('Friday') != null){\n $data['day'] = (Input::get('Friday'));\n $data['start'] = str_replace(' ', '', (Input::get('fri_start_time')));\n $data['end'] = str_replace(' ', '', (Input::get('fri_end_time')));\n $day_id = Dutyday::create($data)->id;\n Dutyday::makeSlots($data['start'], $data['end'], $day_id, $data['employee_id']);\n }else{\n $data['day'] = null;\n $data['start'] = null;\n $data['end'] = null;\n Dutyday::create($data);\n }\n\n if(Input::get('Saturday') != null){\n $data['day'] = (Input::get('Saturday'));\n $data['start'] = str_replace(' ', '', (Input::get('sat_start_time')));\n $data['end'] = str_replace(' ', '', (Input::get('sat_end_time')));\n $day_id = Dutyday::create($data)->id;\n Dutyday::makeSlots($data['start'], $data['end'], $day_id, $data['employee_id']);\n }else{\n $data['day'] = null;\n $data['start'] = null;\n $data['end'] = null;\n Dutyday::create($data);\n }*/\n\n\t\treturn Redirect::route('dutydays.index');\n\t}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n $start_date = strtotime($start_date);\n $this->setData(\"start_date\", date(\"Y-m-d\", $start_date));\n\n // We only need to do end dates if they are provided.\n if ($end_date = $this->getData(\"end_date\"))\n {\n $end_date = strtotime($end_date);\n $this->setData(\"end_date\", date(\"Y-m-d\", $end_date));\n }\n else\n {\n $this->setData(\"end_date\", NULL);\n }\n\n parent::save();\n }", "function insertAvailabilityDatesIntoDB($_id, $_date, $_time_of_day){\n\t\t $this->db->insertNewAvailability($_id, $_date, $_time_of_day);\n\t}", "public function seedDaily() {\n $conn = new DB();\n $priceData = new PriceData($this->api);\n $allPrices = $priceData->getAllPrices();\n foreach ($allPrices as $symbol => $price) {\n if (!ctype_digit($symbol)) {\n $dailyCandles = $priceData->candles($symbol, '1d');\n foreach ($dailyCandles as $date => $data) {\n $unix_to_date = date(\"Y-m-d\", $date / 1000);\n $open = $data['open'];\n $high = $data['high'];\n $low = $data['low'];\n $close = $data['close'];\n $volume = $data['volume'];\n $stmt = $conn->db->query(\"INSERT INTO daily (symbol, date, open, high, low, close, volume) VALUES ('$symbol', '$unix_to_date', '$open', '$high', '$low', '$close', '$volume')\");\n if ($stmt) {\n echo \"Successful INSERT of $symbol => $date, $open, $high, $close, $volume\" . PHP_EOL;\n }\n }\n }\n }\n }", "public function save() : void {\n\t\t$insert = \"INSERT INTO recurrent_appointment SET %s\";\n\t\t$update = \"UPDATE recurrent_appointment SET %s WHERE id = :id\";\n\t\t$values = \"id=:id,mode=:mode,day_end=:day_end,time_end=:time_end,owner_id=:owner_id,\n\t\t\troom_id=:room_id,day_start=:day_start,time_start=:time_start,description=:description\";\n\n\t\t$mode = empty($this->id) ? $insert : $update;\n\t\t$query = sprintf($mode, $values);\n\n\t\t$statm = $this->db->prepare($query);\n\t\t$statm->setFetchMode(PDO::FETCH_ASSOC);\n\n\t\t$binds = $this->to_array();\n\t\tunset($binds[\"created\"]);\n\t\tunset($binds[\"updated\"]);\n\n\t\t$statm->execute($binds);\n\t}", "public function recieveTimetable($date)\n { \n $model = new DanceModel(); \n $row = $model->getTimetable($date); \n return $row;\n }", "public function store()\n {\n $inputs \t= Input::except( '_token' );\n $inputs[ 'date' ] \t= date( 'Y-m-d', strtotime( $inputs[ 'date' ] ) );\n // Refactored in BeeTools Model\n $response \t= BeeTools::entityStore( $inputs, 'characteristics' );\n $view \t\t= BeeTools::isError( $response );\n if( $view ){\n return $view;\n }\n // WORK IN PROGRESS\n // return response\n return Redirect::to( 'characteristics' );\n }", "private function create_temp_table() {\n\t\t\t// This table is used to test and update the main tour_dates table later on\n\t\t\t\n\t\t\t// Create temp table\n\t\t\t$query = 'CREATE TEMPORARY TABLE temp_gigs ( ' .\n\t\t\t\t'id int(11) NOT NULL,' .\n\t\t\t\t'date datetime NOT NULL,' .\n\t\t\t\t'city varchar(50) NOT NULL,' .\n\t\t\t\t'country varchar(50) NOT NULL,' .\n\t\t\t\t'venue varchar(75) NOT NULL,' .\n\t\t\t\t'tickets varchar(100) DEFAULT NULL,' .\n\t\t\t\t'facebook varchar(100) DEFAULT NULL, ' .\n\t\t\t\t'PRIMARY KEY (id), ' .\n\t\t\t\t'KEY (date) ' .\n\t\t\t\t')';\n\t\t\n\t\t\ttry {\n\t\t\t\t$result = $this->PDO_conn->query( $query );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\n\t\t\t// Populate temp table with Bands In Town data\n\t\t\tforeach( $this->BIT_tour_dates as $row ) {\n\t\t\t\n\t\t\t\t//Convert BIT datetime format (yyyy-mm-ddThh:mm:ss) to MySQL datetime formate (yyyy-mm-dd hh:mm:ss)\n\t\t\t\t$gig_date = str_replace( 'T', ' ', $row[\"datetime\"] );\n\t\t\t\n\t\t\t\t$query = 'INSERT INTO temp_gigs (id, date, city, country, venue, tickets, facebook) VALUES (' .\n\t\t\t\t\t$row[\"id\"] . ',\"' . \n\t\t\t\t\t$gig_date . '\",\"' .\n\t\t\t\t\t$row[\"venue\"][\"city\"] . '\",\"' .\n\t\t\t\t\t$row[\"venue\"][\"country\"] . '\",\"' .\n\t\t\t\t\t$row[\"venue\"][\"name\"] . '\",\"' .\n\t\t\t\t\t$row[\"ticket_url\"] . '\",\"' .\n\t\t\t\t\t$row[\"facebook_rsvp_url\"] . '\")';\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t$result = $this->PDO_conn->query( $query );\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn TRUE;\n\t\t}", "public function store()\n\t{\n\t\t$validation = Validator::make(Input::all(), Date::$validationRules);\n\t\tif($validation->fails()) {\n\t\t\tSession::flash('message', 'Errore di validazione');\n\t\t\treturn Redirect::to('dates/create')\n\t\t\t ->withInput()\n\t\t\t\t ->withErrors($validation);\n\t\t} else {\n\t\t\t$datanuova = new Date;\n\t\t\t$datanuova->course_id = Input::get('course_id');\n\t\t\t$datanuova->data = Input::get('data');\n\t\t\t$datanuova->save();\n\t\t\tSession::flash('message', 'Nuova data creata');\n\t\t\treturn Redirect::to('dates');\n\t\t}\n\t}", "public function store(Request $request){\n\n #get the room name and the institution name\n $institution = $request->session()->get('institution_name');\n $room = $request->session()->get('selected_room');\n\n #gets details about room\n $selected_room = Rooms::where('institution_name',$institution)->where('room_name',$room)->get();\n\n #used to ensure the times are correct\n $roomOpen = $selected_room[0]->open_time;\n $roomClose = $selected_room[0]->close_time;\n $openTimeMessage = Carbon::createFromFormat('H:i:s',$roomOpen)->format('h:i A');\n $closeTimeMessage = Carbon::createFromFormat('H:i:s',$roomClose)->format('h:i A');\n\n #validation rules\n $rules = [\n 'seat' => 'required',\n 'start_date' => 'required|after_or_equal:yesterday',\n 'start_time' => \"required|after_or_equal:$roomOpen\",\n 'end_time' => \"required|after_or_equal:start_time|before_or_equal:$roomClose\",\n ];\n\n\n $customMessages = [\n 'start_date.after_or_equal' => \"Invalid date selected. Date must be today or in the future \",\n 'end_time.after_or_equal' => \"Start time must be before end time.\",\n 'end_time.before_or_equal' => \"This facility closes at $closeTimeMessage.\",\n 'start_time.after_or_equal' => \"This facility opens at $openTimeMessage.\",\n\n ];\n\n $this->validate($request,$rules,$customMessages);\n\n #createe new instance of bookings, assign the data from the user and then save to table.\n $booking = new Bookings();\n $booking->room_name = $room;\n $booking->institution_name = $institution;\n $booking->seat_name = request('seat');\n $booking->start_date = request('start_date');\n $booking->start_time = request('start_time');\n $booking->end_time = request('end_time');\n\n $booking->save();\n\n #create new instance of User_Bookings, assign the data from the user and then save to table.\n $UserBooking = new UserBooking();\n\n $bookingID= Bookings::latest('created_at')->first()->id;\n $userId = Auth::id();\n $UserBooking->id = $bookingID;\n $UserBooking->user_id = $userId;\n\n $UserBooking->save();\n\n return redirect('/dashboard')->with('mssg',\"Booking Successful\");\n\n }", "public function InstantiateTimesPrep()\n {\n\n $model = new Office();\n $model_office_timetable = new Officetimetable();\n \n $office_id = Yii::$app->db->getLastInsertID();\n $user_id = Yii::$app->user->identity->id;\n\n foreach ($model->times as $key => $value) {\n // the array values below should be arranged as folllows:\n // ['day_and_time', 'user_id', 'status', 'office_id']\n $data[] = [$value,$user_id,'0',$office_id];\n }\n \n // Insert the prepared data array into the table\n // by passing it to the batchInsertTimes() method\n $model_office_timetable->batchInsertTimes($data);\n }", "function timetracking_create($values = array()) {\n return entity_get_controller('timetracking')->create($values);\n}", "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}", "abstract public function store(DateTime $date): DateData;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders an atom view (with the correct contenttype)
public function renderAtom($name) { header('Content-Type:application/atom+xml'); return $this->render($name); }
[ "public function render() {\n\t\t\n\t\tHeader('Content-type: application/atom+xml');\n\t\t# The code produced is not valid due to the xml tag \n\t\t# which should have a ? before each <>. This breaks the\n\t\t# php.\n\t\t\n\t\t$r ='<xml version=\"1.0\">';\n\t\t$r .= '<rss version = \"2.0\">\\n';\n\t\t$r .= \"<channel>\";\n\t\t$r .= \"<title>\" . $this->title . \"</title>\";\n\t\t$r .= \"<link>\" . $this->feedUrl. \"</link>\";\n\t\t$r .= \"<description>\" . $this->description . \"</description>\";\n\t\techo $r;\n\t\tforeach ($this->items as $item){\n\t\t\t$item->render_rss();\n\t\t}\n\t\t\n\t\techo \"</channel>\";\n\t\techo \"</rss>\";\t\t\n\t\t\n\t}", "public function actionAtom()\n {\n $response = Yii::$app->response;\n\n $atomFeed = XmlGeneratorModule::getInstance()->atomInstance;\n\n $response->format = Response::FORMAT_RAW;\n $response->headers->add('Content-Type', 'text/xml');\n $response->data = $this->renderPartial('atomXml', [\n 'feed' => $atomFeed\n ]);\n }", "public function atomAction() {\n header(\"Content-Type: application/xml;\");\n $out = $this->feed->export('atom');\n\n echo $out;\n exit;\n }", "public function atomAction() {\n\t\t$documents = $this->getPages($this->path, $this->limit, $this->offset);\n\n\t\t$feed = new Zend_Feed_Writer_Feed;\n\t\t$feed->setTitle($this->defaultTitle);\n\t\t$feed->setLink($this->baseUrl.'/');\n\t\t$feed->setFeedLink($this->baseUrl . $_SERVER['REQUEST_URI'], 'atom');\n\t\t$feed->setId($this->baseUrl);\n\t\t$feed->addAuthor(array('name' => $this->author));\n\n\t\t$modDate = 0;\n\n\t\tforeach($documents as $document) {\n\n\t\t\tif($document->hasProperty('showInFeed') && !$document->getProperty('showInFeed')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif($document->getModificationDate() > $modDate) {\n\t\t\t\t$modDate = $document->getModificationDate();\n\t\t\t}\n\n\t\t\t$content = trim(str_replace('&nbsp;', ' ', $document->getDescription()));\n\t\t\t$descr = $document->getDescription();\n\t\t\t$title = $document->title;\n\t\t\tif(empty($title)) {\n\t\t\t\t$title = $this->defaultTitle;\n\t\t\t}\n\n\t\t\t$entry = $feed->createEntry();\n\t\t\t$entry->setTitle($title);\n\t\t\t$entry->setLink($this->baseUrl.$document->getFullPath());\n\t\t\t$entry->setDateModified($document->getModificationDate());\n\t\t\t$entry->setDateCreated($document->getCreationDate());\n\t\t\tif(!empty($descr)) {\n\t\t\t\t$entry->setDescription($descr);\n\t\t\t}\n\t\t\tif(!empty($content)) {\n\t\t\t\t$entry->setContent($content);\n\t\t\t}\n\t\t\t$feed->addEntry($entry);\n\t\t}\n\n\t\t$feed->setDateModified($modDate);\n\n\t\t$this->getResponse()->setHeader('Content-Type', 'application/atom+xml; charset=utf-8');\n\t\techo $feed->export('atom');\n\t\texit();\n\t}", "function output_atom($feed)\n{\n\tglobal $lang_common, $forum_config;\n\n\t// Send XML/no cache headers\n\theader('Content-Type: text/xml; charset=utf-8');\n\theader('Expires: '.gmdate('D, d M Y H:i:s').' GMT');\n\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\theader('Pragma: public');\n\n\techo '<?xml version=\"1.0\" encoding=\"utf-8\"?>'.\"\\r\\n\";\n\techo '<feed xmlns=\"http://www.w3.org/2005/Atom\">'.\"\\r\\n\";\n\n\techo \"\\t\".'<title type=\"html\">'.forum_htmlencode($feed['title']).'</title>'.\"\\r\\n\";\n\techo \"\\t\".'<link rel=\"self\" href=\"'.forum_htmlencode($_SERVER['SCRIPT_NAME'].($_SERVER['QUERY_STRING'] != '' ? '?'.$_SERVER['QUERY_STRING'] :'')).'\"/>'.\"\\r\\n\";\n\techo \"\\t\".'<updated>'.gmdate('Y-m-d\\TH:i:s\\Z', count($feed['items']) ? $feed['items'][0]['pubdate'] : time()).'</updated>'.\"\\r\\n\";\n\n\tif ($forum_config['o_show_version'] == '1')\n\t\techo \"\\t\".'<generator version=\"'.$forum_config['o_cur_version'].'\">FluxBB</generator>'.\"\\r\\n\";\n\telse\n\t\techo \"\\t\".'<generator>FluxBB</generator>'.\"\\r\\n\";\n\n\techo \"\\t\".'<id>'.$feed['link'].'</id>'.\"\\r\\n\";\n\n\t$content_tag = ($feed['type'] == 'posts') ? 'content' : 'summary';\n\n\t$num_items = count($feed['items']);\n\tfor ($i = 0; $i < $num_items; ++$i)\n\t{\n\t\techo \"\\t\\t\".'<entry>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\".'<title type=\"html\">'.forum_htmlencode($feed['items'][$i]['title']).'</title>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\".'<link rel=\"alternate\" href=\"'.$feed['items'][$i]['link'].'\"/>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\".'<'.$content_tag.' type=\"html\">'.forum_htmlencode($feed['items'][$i]['description']).'</'.$content_tag.'>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\".'<author>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\\t\".'<name>'.forum_htmlencode($feed['items'][$i]['author']).'</name>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\".'</author>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\".'<updated>'.gmdate('Y-m-d\\TH:i:s\\Z', $feed['items'][$i]['pubdate']).'</updated>'.\"\\r\\n\";\n\t\techo \"\\t\\t\\t\".'<id>'.$feed['items'][$i]['link'].'</id>'.\"\\r\\n\";\n\t\techo \"\\t\\t\".'</entry>'.\"\\r\\n\";\n\t}\n\n\techo '</feed>'.\"\\r\\n\";\n}", "function output_feed()\n\t{\n\t\tglobal $lang;\n\t\t// Send an appropriate header to the browser.\n\t\tswitch($this->feed_format)\n\t\t{\n\t\t\tcase \"atom1.0\":\n\t\t\t\theader(\"Content-Type: application/atom+xml; charset=\\\"{$lang->settings['charset']}\\\"\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\theader(\"Content-Type: text/xml; charset=\\\"{$lang->settings['charset']}\\\"\");\n\t\t}\n\n\t\t// Output the feed XML. If the feed hasn't been generated, do so.\n\t\tif($this->xml)\n\t\t{\n\t\t\techo $this->xml;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->generate_feed();\n\t\t\techo $this->xml;\n\t\t}\n\t}", "public function renderEntry(){\n\t\tglobal $donut;\n\t\t// Setting the page title\n\t\t$donut['page']['title'] = $this->_entry['idiom'].\" - \".CONFIG_SITE_TITLE;\n\n\t\t// If there is someplace to return to, we better do that.\n\t\tif(isset(pRegister::arg()['return'])){\n\t\t\t$returnTo = explode(':', pRegister::arg()['return']);\n\t\t\t$backHref = p::Url('?entry/'.($returnTo[0] == '' ? '' : $returnTo[0].'/').$returnTo[1]);\n\t\t}\n\n\t\tp::Out($this->_view->title());\n\n\t\t// Let's render all the lemma's\n\t\t$this->bindLemma();\n\t\t$this->_view->renderLemmas($this->_lemmas->get());\n\t\tp::Out($this->_view->renderInfo());\n\t\t\n\t}", "public function render()\n\t{\n\t\t\n\t\t$this -> requestView($this -> viewName);\t\t\n\t\t\n\t}", "function showATOM()\n{\n header('Content-Type: application/atom+xml; charset=utf-8');\n\n // Cache system\n $query = $_SERVER[\"QUERY_STRING\"];\n $cache = new pageCache(pageUrl(),startsWith($query,'do=atom') && !isLoggedIn());\n $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; }\n // If cached was not found (or not usable), then read the database and build the response:\n\n $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in).\n\n\n // Optionnaly filter the results:\n $linksToDisplay=array();\n if (!empty($_GET['searchterm'])) $linksToDisplay = $LINKSDB->filterFulltext($_GET['searchterm']);\n elseif (!empty($_GET['searchtags'])) $linksToDisplay = $LINKSDB->filterTags(trim($_GET['searchtags']));\n else $linksToDisplay = $LINKSDB;\n\n $pageaddr=htmlspecialchars(indexUrl());\n $latestDate = '';\n $entries='';\n $i=0;\n $keys=array(); foreach($linksToDisplay as $key=>$value) { $keys[]=$key; } // No, I can't use array_keys().\n while ($i<50 && $i<count($keys))\n {\n $link = $linksToDisplay[$keys[$i]];\n $guid = $pageaddr.'?'.smallHash($link['linkdate']);\n $iso8601date = linkdate2iso8601($link['linkdate']);\n $latestDate = max($latestDate,$iso8601date);\n $absurl = htmlspecialchars($link['url']);\n if (startsWith($absurl,'?')) $absurl=$pageaddr.$absurl; // make permalink URL absolute\n $entries.='<entry><title>'.htmlspecialchars($link['title']).'</title><link href=\"'.$absurl.'\" /><id>'.$guid.'</id>';\n if (!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()) $entries.='<updated>'.htmlspecialchars($iso8601date).'</updated>';\n $entries.='<content type=\"html\">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).\"</content>\\n\";\n if ($link['tags']!='') // Adding tags to each ATOM entry (as mentioned in ATOM specification)\n {\n foreach(explode(' ',$link['tags']) as $tag)\n { $entries.='<category scheme=\"'.htmlspecialchars($pageaddr,ENT_QUOTES).'\" term=\"'.htmlspecialchars($tag,ENT_QUOTES).'\" />'.\"\\n\"; }\n }\n $entries.=\"</entry>\\n\";\n $i++;\n }\n $feed='<?xml version=\"1.0\" encoding=\"UTF-8\"?><feed xmlns=\"http://www.w3.org/2005/Atom\">';\n $feed.='<title>'.htmlspecialchars($GLOBALS['title']).'</title>';\n if (!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()) $feed.='<updated>'.htmlspecialchars($latestDate).'</updated>';\n $feed.='<link rel=\"self\" href=\"'.htmlspecialchars(serverUrl().$_SERVER[\"REQUEST_URI\"]).'\" />';\n if (!empty($GLOBALS['config']['PUBSUBHUB_URL']))\n {\n $feed.='<!-- PubSubHubbub Discovery -->';\n $feed.='<link rel=\"hub\" href=\"'.htmlspecialchars($GLOBALS['config']['PUBSUBHUB_URL']).'\" />';\n $feed.='<!-- End Of PubSubHubbub Discovery -->';\n }\n $feed.='<author><name>'.htmlspecialchars($pageaddr).'</name><uri>'.htmlspecialchars($pageaddr).'</uri></author>';\n $feed.='<id>'.htmlspecialchars($pageaddr).'</id>'.\"\\n\\n\"; // Yes, I know I should use a real IRI (RFC3987), but the site URL will do.\n $feed.=$entries;\n $feed.='</feed>';\n echo $feed;\n \n $cache->cache(ob_get_contents());\n ob_end_flush();\n exit;\n}", "public function renderView()\r\n\t{\r\n\t\t$item \t= $this->app->request->get('item_id', 'string', '');\r\n\t\t$layout = $this->app->request->get('item_layout', 'string', 'full');\r\n\t\t\r\n\t\techo $this->app->zlfw->renderView($item, $layout);\r\n\t\treturn;\r\n\t}", "abstract protected function RenderContent();", "public function render()\n {\n if (!$this->__info['template']) {\n $this->__info['template'] = 'index';\n }\n \n $this->__info['folder'] = strtolower(basename($this->__info['folder']));\n $this->__info['file'] = strtolower(basename($this->__info['file']));\n $this->__info['template'] = strtolower(basename($this->__info['template']));\n\n switch ($this->__info['formatter']) {\n case 'json':\n header('Content-type: application/json');\n echo $this->render_view('json');\n break;\n\n default:\n $view_output = $this->render_view();\n $template_file = sprintf('../templates/%s.php', $this->__info['template']);\n if ($this->__info['ajax'] || !file_exists($template_file)) {\n echo $view_output;\n } else {\n ob_start();\n include $template_file;\n echo ob_get_clean();\n }\n break;\n }\n }", "public function index()\n {\n if( $this->request->ajax() )\n {\n $result = $this->dispatch(new QueryContentTypeCommand(\n $this->request->get('type', null),\n false\n ));\n\n return $this->response->json(array(\n 'data' => $result->getData()->toArray(),\n 'message' => $result->getMessage()\n ), $result->getStatusCode());\n }\n else\n {\n return view('contentBuilder::contentTypes');\n }\n }", "private function getContent()\n {\n\n $type = !empty($this->option('type')) ? $this->option('type') : 'basic';\n\n try {\n return view(\"larabit::{$type}\")->render();\n } catch (Exception $e) {\n $this->newLine();\n $this->error(\"Error! {$e->getMessage()}\");\n $this->newLine();\n exit();\n }\n }", "public function render() {\n //Extract defined vars in scope\n extract($this->_vars);\n \n ob_start();\n include($this->_view);\n $content = ob_get_contents();\n ob_end_clean();\n echo $this->_renderInLayout($content);\n }", "public function renderView()\n\t{\n\t}", "abstract public function display_view();", "public function render()\n {\n $result = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\";\n if ($this->xsltransform_uri) {\n $result .= \"<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"$this->xsltransform_uri\\\"?>\";\n }\n\n $result .= \"<feed xmlns=\\\"http://www.w3.org/2005/Atom\\\">\\n\";\n $result .= \"<title type=\\\"html\\\">$this->title</title>\\n\";\n $result .= \"<link rel=\\\"alternate\\\" href=\\\"$this->id_uri\\\" />\\n\";\n $result .= \"<link rel=\\\"self\\\" href=\\\"$this->feed_uri\\\" />\\n\";\n $result .= \"<updated>\" . date(DATE_RFC3339) . \"</updated>\\n\";\n $result .= \"<generator uri=\\\"\" . $this::generator_uri . \"\\\" version=\\\"\" . $this::generator_version . \"\\\">\" . $this::generator_name . \"</generator>\\n\";\n $result .= $this->renderpeople($this->authors);\n $result .= $this->renderpeople($this->contributors);\n $result .= \"<id>$this->id_uri</id>\\n\";\n if ($this->sq_icon_uri !== false) {\n $result .= \"<icon>$this->sq_icon_uri</icon>\\n\";\n }\n\n if ($this->logo_uri !== false) {\n $result .= \"<logo>$this->logo_uri</logo>\\n\";\n }\n\n $result .= $this->renderentries($this->entries);\n $result .= \"</feed>\";\n\n $result = $this->tweakxml($result);\n\n $dom = new DOMDocument;\n $dom->preserveWhiteSpace = false;\n $dom->loadXML($result);\n $dom->formatOutput = true;\n return $dom->saveXml();\n //return $result;\n }", "function index($params, $renderLayout = true){\n \n //set twitter rss path and load xml \n $path = \"https://twitter.com/statuses/user_timeline/17672775.rss\";\n $twitter_feed = simplexml_load_file($path);\n \n //Loop through xml and pass data array to view\n $count = 0;\n $display = array();\n foreach($twitter_feed->channel->item as $tweet){\n if($count > 7){\n break;\n }\n $display[$count]['title'] = (string)$tweet->title;\n $display[$count]['date'] = date('M d,Y', strtotime((string)$tweet->pubDate));\n $display[$count]['link'] = (string)$tweet->link;\n $count++;\n }\n \n $pass = array('feed' => $display);\n \n $path = $this->controller . DS . 'index';\n \n return parent::loadView($path, $pass, $renderLayout);\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Changelog 4.0 to 4.1 ap_forms: added column 'esl_replyto_email_address','esr_replyto_email_address' ap_email_logic: added column 'custom_replyto_email' 1) Loop through each form ..copy value from 'esl_from_email_address' to 'esl_replyto_email_address' ..check into 'esl_from_email_address' field ....if the field doesn't contain email address, replace it with the Default From Email ..copy value from 'esr_from_email_address' to 'esr_replyto_email_address' ..check into 'esr_from_email_address' field ....if the field doesn't contain email address, replace it with the Default From Email 2) Loop through each record within ap_email_logic table ..copy value from 'custom_from_email' to 'custom_replyto_email' ..check into 'custom_from_email' field ....if the field doesn't contain email address, replace it with the Default From Email this function or any other do_delta_update_xxx functions should never call the create_xxx_tables functions because those create_xxx_tables are intended for new installations and the structure might be changed over time
function do_delta_update_4_0_to_4_1($dbh,$options=array()){ $post_install_error = ''; $mf_settings = mf_get_settings($dbh); //1. Alter ap_forms table. Add new columns $query = "ALTER TABLE `".MF_TABLE_PREFIX."forms` ADD COLUMN `esl_replyto_email_address` varchar(255) DEFAULT NULL, ADD COLUMN `esr_replyto_email_address` varchar(255) DEFAULT NULL;"; $params = array(); $sth = $dbh->prepare($query); try{ $sth->execute($params); }catch(PDOException $e) { $post_install_error .= $e->getMessage().'<br/><br/>'; } //2. Alter ap_email_logic table. Add new columns $query = "ALTER TABLE `".MF_TABLE_PREFIX."email_logic` ADD COLUMN `custom_replyto_email` varchar(255) NOT NULL DEFAULT '';"; $params = array(); $sth = $dbh->prepare($query); try{ $sth->execute($params); }catch(PDOException $e) { $post_install_error .= $e->getMessage().'<br/><br/>'; } //3. Update ap_forms table // Copy value from 'esl_from_email_address' to 'esl_replyto_email_address' // Copy value from 'esr_from_email_address' to 'esr_replyto_email_address' $query = "UPDATE ".MF_TABLE_PREFIX."forms set esl_replyto_email_address=esl_from_email_address,esr_replyto_email_address=esr_from_email_address"; $params = array(); $sth = $dbh->prepare($query); try{ $sth->execute($params); }catch(PDOException $e) { $post_install_error .= $e->getMessage().'<br/><br/>'; } //4. Update ap_email_logic table // Copy value from 'custom_from_email' to 'custom_replyto_email' $query = "update ".MF_TABLE_PREFIX."email_logic set custom_replyto_email=custom_from_email"; $params = array(); $sth = $dbh->prepare($query); try{ $sth->execute($params); }catch(PDOException $e) { $post_install_error .= $e->getMessage().'<br/><br/>'; } //5. Loop through each record within ap_forms table $query = "select `form_id`,`esl_from_email_address`,`esr_from_email_address` from ".MF_TABLE_PREFIX."forms"; $params = array(); $sth = mf_do_query($query,$params,$dbh); $form_email_data = array(); $i=0; while($row = mf_do_fetch_result($sth)){ $form_email_data[$i]['form_id'] = $row['form_id']; $form_email_data[$i]['esl_from_email_address'] = $row['esl_from_email_address']; $form_email_data[$i]['esr_from_email_address'] = $row['esr_from_email_address']; $i++; } if(!empty($form_email_data)){ $default_from_email = $mf_settings['default_from_email']; foreach ($form_email_data as $value) { $form_id = $value['form_id']; $query = ''; if((strpos($value['esl_from_email_address'], '@') === false) && (strpos($value['esr_from_email_address'], '@') === false)){ $query = "UPDATE ".MF_TABLE_PREFIX."forms set esl_from_email_address = ?,esr_from_email_address = ? where form_id = ?"; $params = array($default_from_email,$default_from_email,$form_id); }else if(strpos($value['esl_from_email_address'], '@') === false){ $query = "UPDATE ".MF_TABLE_PREFIX."forms set esl_from_email_address = ? where form_id = ?"; $params = array($default_from_email,$form_id); }else if(strpos($value['esr_from_email_address'], '@') === false){ $query = "UPDATE ".MF_TABLE_PREFIX."forms set esr_from_email_address = ? where form_id = ?"; $params = array($default_from_email,$form_id); } if(!empty($query)){ $sth = $dbh->prepare($query); try{ $sth->execute($params); }catch(PDOException $e) { $post_install_error .= $e->getMessage().'<br/><br/>'; } } } } //6. Loop through each record within ap_email_logic table //check into custom_from_email_address field //if the field doesn't contain email address, replace it with the Default From Email $query = "select `form_id`,`rule_id`,`custom_from_email` from ".MF_TABLE_PREFIX."email_logic"; $params = array(); $sth = mf_do_query($query,$params,$dbh); $form_email_logic_data = array(); $i=0; while($row = mf_do_fetch_result($sth)){ $form_email_logic_data[$i]['form_id'] = $row['form_id']; $form_email_logic_data[$i]['rule_id'] = $row['rule_id']; $form_email_logic_data[$i]['custom_from_email'] = $row['custom_from_email']; $i++; } if(!empty($form_email_logic_data)){ $default_from_email = $mf_settings['default_from_email']; foreach ($form_email_logic_data as $value) { $form_id = $value['form_id']; $rule_id = $value['rule_id']; if(strpos($value['custom_from_email'], '@') === false){ $query = "UPDATE ".MF_TABLE_PREFIX."email_logic set custom_from_email = ? where form_id = ? and rule_id = ?"; $params = array($default_from_email,$form_id,$rule_id); $sth = $dbh->prepare($query); try{ $sth->execute($params); }catch(PDOException $e) { $post_install_error .= $e->getMessage().'<br/><br/>'; } } } } return $post_install_error; }
[ "function do_delta_update_4_1_to_4_2($dbh,$options=array()){\n\n\t\t$post_install_error = '';\n\n\t\t$mf_settings = mf_get_settings($dbh);\n\n\t\t//1. Create table ap_webhook_logic_conditions\n\t\t$query = \"CREATE TABLE `\".MF_TABLE_PREFIX.\"webhook_logic_conditions` (\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t `wlc_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t `form_id` int(11) NOT NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t `target_rule_id` int(11) NOT NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t `element_name` varchar(50) NOT NULL DEFAULT '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t `rule_condition` varchar(15) NOT NULL DEFAULT 'is',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t `rule_keyword` varchar(255) DEFAULT NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t PRIMARY KEY (`wlc_id`),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t KEY `form_id` (`form_id`,`target_rule_id`)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) DEFAULT CHARACTER SET utf8;\";\n\t\t$params = array();\n\t\t$sth = $dbh->prepare($query);\n\t\ttry{\n\t\t\t$sth->execute($params);\n\t\t}catch(PDOException $e) {\n\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t}\n\n\t\t//2. Alter ap_settings table. Add new columns\n\t\t$query = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"settings` \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `enforce_tsv` int(1) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `enable_ip_restriction` int(1) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `ip_whitelist` text,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `enable_account_locking` int(1) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `account_lock_period` int(11) NOT NULL DEFAULT '30',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `account_lock_max_attempts` int(11) NOT NULL DEFAULT '6',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `default_form_theme_id` int(11) NOT NULL DEFAULT '0';\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t$params = array();\n\t\t$sth = $dbh->prepare($query);\n\t\ttry{\n\t\t\t$sth->execute($params);\n\t\t}catch(PDOException $e) {\n\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t}\n\n\t\t//3. Alter ap_users table. Add new columns\n\t\t$query = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"users` \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `tsv_enable` int(1) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `tsv_secret` varchar(16) DEFAULT NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `tsv_code_log` varchar(100) DEFAULT NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `login_attempt_date` datetime DEFAULT NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `login_attempt_count` int(11) NOT NULL DEFAULT '0';\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t$params = array();\n\t\t$sth = $dbh->prepare($query);\n\t\ttry{\n\t\t\t$sth->execute($params);\n\t\t}catch(PDOException $e) {\n\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t}\n\n\t\t//4. Alter ap_forms table. Add new columns\n\t\t$query = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"forms` \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `logic_webhook_enable` int(1) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `form_custom_script_enable` int(1) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `form_custom_script_url` text;\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t$params = array();\n\t\t$sth = $dbh->prepare($query);\n\t\ttry{\n\t\t\t$sth->execute($params);\n\t\t}catch(PDOException $e) {\n\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t}\n\n\t\t//5. Alter ap_webhook_options table. Add new columns\n\t\t$query = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"webhook_options` \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ADD COLUMN `rule_all_any` varchar(3) NOT NULL DEFAULT 'all';\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t$params = array();\n\t\t$sth = $dbh->prepare($query);\n\t\ttry{\n\t\t\t$sth->execute($params);\n\t\t}catch(PDOException $e) {\n\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t}\n\n\t\t//6. Update 'session_id' length on all ap_form_x_review tables. Set the length to 128 instead of 100. \n\t\t$query = \"select `form_id` from \".MF_TABLE_PREFIX.\"forms\";\n\t\t$params = array();\n\t\t$sth \t= mf_do_query($query,$params,$dbh);\n\t\t\t\t\n\t\t$form_id_array = array();\n\t\twhile($row = mf_do_fetch_result($sth)){\n\t\t\t$form_id = $row['form_id'];\n\t\t\t$form_id_array[] = $form_id;\n\t\t}\n\t\t\t\t\n\t\tforeach ($form_id_array as $form_id) {\n\t\t\t$query = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"form_{$form_id}_review` CHANGE `session_id` `session_id` VARCHAR(128) NULL;\";\n\t\t\t\n\t\t\t$params = array();\n\t\t\t$sth = $dbh->prepare($query);\n\t\t\ttry{\n\t\t\t\t$sth->execute($params);\n\t\t\t}catch(PDOException $e) {\n\t\t\t\t//do nothing, ignore if table review not exist\n\t\t\t}\n\t\t}\n\n\t\t//7. Run several UPDATE queries\n\t\t$misc_update_query_array = array();\n\n\t\t$misc_update_query_array[] = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"field_logic_conditions` ADD INDEX (`form_id`,`target_element_id`)\";\n\t\t$misc_update_query_array[] = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"email_logic_conditions` ADD INDEX (`form_id`,`target_rule_id`)\";\n\t\t$misc_update_query_array[] = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"page_logic_conditions` ADD INDEX (`form_id`,`target_page_id`)\";\n\t\t$misc_update_query_array[] = \"UPDATE \".MF_TABLE_PREFIX.\"form_themes SET field_bg_color='#FBFBFB' WHERE field_bg_color = '#ffffff' and theme_id <= 22\";\n\t\t$misc_update_query_array[] = \"UPDATE \".MF_TABLE_PREFIX.\"form_themes SET border_form_width=0 WHERE border_form_width=1 and theme_id <= 22\";\n\t\t\n\t\tforeach ($misc_update_query_array as $query) {\n\t\t\t$params = array();\n\t\t\t$sth = $dbh->prepare($query);\n\t\t\ttry{\n\t\t\t\t$sth->execute($params);\n\t\t\t}catch(PDOException $e) {\n\t\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t\t}\n\t\t}\n\n\t\treturn $post_install_error;\n\t}", "function xmldb_surveyfield_autofill_upgrade($oldversion) {\n global $DB;\n\n $dbman = $DB->get_manager();\n\n if ($oldversion < 2013092301) {\n\n // Rename field element01 on table survey_autofill to element01.\n $table = new xmldb_table('survey_autofill');\n $field = new xmldb_field('element_1', XMLDB_TYPE_CHAR, '32', null, null, null, null, 'hiddenfield');\n\n // Launch rename field element01.\n $dbman->rename_field($table, $field, 'element01');\n\n // Rename field element01 on table survey_autofill to element02.\n $table = new xmldb_table('survey_autofill');\n $field = new xmldb_field('element_2', XMLDB_TYPE_CHAR, '32', null, null, null, null, 'hiddenfield');\n\n // Launch rename field element01.\n $dbman->rename_field($table, $field, 'element02');\n\n // Rename field element01 on table survey_autofill to element03.\n $table = new xmldb_table('survey_autofill');\n $field = new xmldb_field('element_3', XMLDB_TYPE_CHAR, '32', null, null, null, null, 'hiddenfield');\n\n // Launch rename field element01.\n $dbman->rename_field($table, $field, 'element03');\n\n // Rename field element01 on table survey_autofill to element04.\n $table = new xmldb_table('survey_autofill');\n $field = new xmldb_field('element_4', XMLDB_TYPE_CHAR, '32', null, null, null, null, 'hiddenfield');\n\n // Launch rename field element01.\n $dbman->rename_field($table, $field, 'element04');\n\n // Rename field element01 on table survey_autofill to element05.\n $table = new xmldb_table('survey_autofill');\n $field = new xmldb_field('element_5', XMLDB_TYPE_CHAR, '32', null, null, null, null, 'hiddenfield');\n\n // Launch rename field element01.\n $dbman->rename_field($table, $field, 'element05');\n\n // Survey savepoint reached.\n upgrade_plugin_savepoint(true, 2013092301, 'surveyfield', 'autofill');\n }\n\n if ($oldversion < 2013100601) {\n\n // Rename field extrarow on table survey_autofill to position.\n $table = new xmldb_table('survey_autofill');\n $field = new xmldb_field('extrarow', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'customnumber');\n\n // Launch rename field extrarow.\n $dbman->rename_field($table, $field, 'position');\n\n // Survey savepoint reached.\n upgrade_plugin_savepoint(true, 2013100601, 'surveyfield', 'autofill');\n }\n\n if ($oldversion < 2013103101) {\n\n // Define table survey_age to be renamed to survey_autofill.\n $table = new xmldb_table('survey_autofill');\n\n // Launch rename table for survey_age.\n $dbman->rename_table($table, 'surveyfield_autofill');\n\n // Survey savepoint reached.\n upgrade_plugin_savepoint(true, 2013103101, 'surveyfield', 'autofill');\n }\n\n return true;\n}", "function bbp_move_reply_form_fields()\n{\n}", "protected function prepareUpdateContactLinks() {\n // Update 'Central Appointments Unit' revision URL's to full path.\n $this->drupal7DatabaseQuery(\"UPDATE field_revision_field_contact_additional_info\n SET field_contact_additional_info_value = REGEXP_REPLACE(field_contact_additional_info_value, 'public-appointment-vacancies-64059.htm', 'https://www.nidirect.gov.uk/articles/public-appointment-vacancies')\n WHERE entity_id = 439\");\n\n $this->drupal7DatabaseQuery(\"UPDATE field_revision_field_contact_additional_info\n SET field_contact_additional_info_value = REGEXP_REPLACE(field_contact_additional_info_value, 'becoming-a-public-appointee-66246.htm', 'https://www.nidirect.gov.uk/articles/public-appointments-explained#toc-1')\n WHERE entity_id = 439\");\n\n $this->drupal7DatabaseQuery(\"UPDATE field_revision_field_contact_additional_info\n SET field_contact_additional_info_value = REGEXP_REPLACE(field_contact_additional_info_value, 'public-appointments-explained-20147.htm', 'https://www.nidirect.gov.uk/articles/public-appointments-explained')\n WHERE entity_id = 439\");\n\n // Update 'Womens aid' URL to full path.\n $this->drupal7DatabaseQuery(\"UPDATE field_data_field_contact_additional_info\n SET field_contact_additional_info_value = REGEXP_REPLACE(field_contact_additional_info_value, 'womens-aid-federation-northern-ireland-18776.htm', 'https://www.nidirect.gov.uk/contacts/contacts-az/womens-aid-federation-northern-ireland-head-office')\n WHERE entity_id = 522\");\n\n // Update 'Womens aid' revision URL to full path.\n $this->drupal7DatabaseQuery(\"UPDATE field_revision_field_contact_additional_info\n SET field_contact_additional_info_value = REGEXP_REPLACE(field_contact_additional_info_value, 'womens-aid-federation-northern-ireland-18776.htm', 'https://www.nidirect.gov.uk/contacts/contacts-az/womens-aid-federation-northern-ireland-head-office')\n WHERE entity_id = 522\");\n }", "function wppb_pro_email_customizer_compatibility_upgrade(){\r\n\t$email_customizer_array = get_option( 'emailCustomizer', 'not_found' );\r\n\r\n\tif ( $email_customizer_array != 'not_found' ){\r\n\t\twppb_replace_and_save( $email_customizer_array['from_name'], 'wppb_emailc_common_settings_from_name' );\r\n\t\twppb_replace_and_save( $email_customizer_array['reply_to'], 'wppb_emailc_common_settings_from_reply_to_email' );\r\n\t\twppb_replace_and_save( $email_customizer_array['default_registration_email_subject'], 'wppb_user_emailc_default_registration_email_subject' );\r\n\t\twppb_replace_and_save( $email_customizer_array['default_registration_email_content'], 'wppb_user_emailc_default_registration_email_content' );\r\n\t\twppb_replace_and_save( $email_customizer_array['registration_w_admin_approval_email_subject'], 'wppb_user_emailc_registration_with_admin_approval_email_subject' );\r\n\t\twppb_replace_and_save( $email_customizer_array['registration_w_admin_approval_email_content'], 'wppb_user_emailc_registration_with_admin_approval_email_content' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_approval_aproved_status_email_subject'], 'wppb_user_emailc_admin_approval_notif_approved_email_subject' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_approval_aproved_status_email_content'], 'wppb_user_emailc_admin_approval_notif_approved_email_content' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_approval_unaproved_status_email_subject'], 'wppb_user_emailc_admin_approval_notif_unapproved_email_subject' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_approval_unaproved_status_email_content'], 'wppb_user_emailc_admin_approval_notif_unapproved_email_content' );\r\n\t\twppb_replace_and_save( $email_customizer_array['registration_w_email_confirmation_email_subject'], 'wppb_user_emailc_registr_w_email_confirm_email_subject' );\r\n\t\twppb_replace_and_save( $email_customizer_array['registration_w_email_confirmation_email_content'], 'wppb_user_emailc_registr_w_email_confirm_email_content' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_default_registration_email_subject'], 'wppb_admin_emailc_default_registration_email_subject' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_default_registration_email_content'], 'wppb_admin_emailc_default_registration_email_content' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_registration_w_admin_approval_email_subject'], 'wppb_admin_emailc_registration_with_admin_approval_email_subject' );\r\n\t\twppb_replace_and_save( $email_customizer_array['admin_registration_w_admin_approval_email_content'], 'wppb_admin_emailc_registration_with_admin_approval_email_content' );\r\n\t}\r\n}", "function caldera_forms_pro_db_delta_1(){\n\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\tglobal $wpdb;\n\t$charset_collate = '';\n\n\tif ( ! empty( $wpdb->charset ) ) {\n\t\t$charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n\t}\n\n\tif ( ! empty( $wpdb->collate ) ) {\n\t\t$charset_collate .= \" COLLATE $wpdb->collate\";\n\t}\n\t$table = \"CREATE TABLE `\" . $wpdb->prefix . \"cf_pro_messages` (\n\t\t\t`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t`cfp_id` bigint(20) unsigned DEFAULT NULL,\n\t\t\t`entry_id` bigint(20) unsigned DEFAULT NULL,\n\t\t\t`hash` varchar(255) DEFAULT NULL,\n\t\t\t`type` varchar(255) DEFAULT NULL,\n\t\t\tPRIMARY KEY ( `ID` )\n\t\t\t) \" . $charset_collate . \";\";\n\n\tdbDelta( $table );\n\n\n}", "function bbp_get_form_reply_log_edit()\n{\n}", "function caldera_forms_db_v6_update(){\n\tif( ! class_exists( 'Caldera_Forms_Forms' ) ){\n\t\treturn;\n\t}\n\n\t//This will make sure DB table is there if not already\n\tCaldera_Forms::check_tables();\n\t$forms = Caldera_Forms_Forms::get_forms( false, true );\n\tif( ! empty( $forms ) ){\n\t\tforeach ( $forms as $form ){\n\t\t\t//Migration happens automatically when getting form config\n\t\t\t//BTW means this isn't totally needed, but good to get it done in one go.\n\t\t\tCaldera_Forms_Forms::get_form( $form );\n\n\t\t}\n\n\t}\n\n\t//NOTE: Leaving options in place for now, especially beacuse of rollback.\n\n\n}", "function do_delta_update_3_0_to_3_2($dbh,$options=array()){\n\n\t\t$post_install_error = '';\n\n\t\t$mf_settings = mf_get_settings($dbh);\n\n\t\t//alter table ap_settings, add new columns\n\t\t$query = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"settings` ADD COLUMN `admin_theme` varchar(11) DEFAULT NULL;\";\n\t\t$params = array();\n\t\t$sth = $dbh->prepare($query);\n\t\ttry{\n\t\t\t$sth->execute($params);\n\t\t}catch(PDOException $e) {\n\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t}\n\n\t\t//alter table ap_form_elements, add new columns\n\t\t$query = \"ALTER TABLE `\".MF_TABLE_PREFIX.\"form_elements` \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tADD COLUMN `element_section_display_in_email` int(1) NOT NULL DEFAULT '0',\n \t\t\t\t\t\t\t\t\t\t\t\t\t \t\tADD COLUMN `element_section_enable_scroll` int(1) NOT NULL DEFAULT '0';\";\n\t\t$params = array();\n\t\t$sth = $dbh->prepare($query);\n\t\ttry{\n\t\t\t$sth->execute($params);\n\t\t}catch(PDOException $e) {\n\t\t\t$post_install_error .= $e->getMessage().'<br/><br/>';\n\t\t}\n\n\t\t//loop through each view.css file and add new classes\n\t\t$query = \"select `form_id` from \".MF_TABLE_PREFIX.\"forms\";\n\t\t$params = array();\n\t\t$sth \t= mf_do_query($query,$params,$dbh);\n\t\n\t\twhile($row = mf_do_fetch_result($sth)){\n\t\t\t$form_id = $row['form_id'];\n\t\t\t$form_id_array[] = $form_id;\n\t\t}\n\n\t\t$new_css_code = <<<EOT\n.section_scroll_small{\n\theight: 5em;\n\toverflow-y: scroll;\n}\n.section_scroll_medium{\n\theight: 10em;\n\toverflow-y: scroll;\n}\n.section_scroll_large{\n\theight: 20em;\n\toverflow-y: scroll;\n}\n#machform_review_table td.mf_review_section_break{\n\tpadding: 10px 5px;\n}\n.mf_canvas_pad{\n\tborder-radius: 10px;\n\tcursor: url(\"../../../js/signaturepad/pen.cur\"), crosshair;\n \tcursor: url(\"../../../js/signaturepad/pen.cur\") 16 16, crosshair;\n}\n#machform_review_table .mf_canvas_pad{\n cursor: auto;\n}\n.mf_sig_wrapper {\n\tborder-radius: 10px;\n\tborder: 1px solid #ccc;\n\twidth: 309px;\n\tpadding-bottom: 0px !important;\n\tpadding: 3px !important;\n}\n.mf_sigpad_clear{\n\tmargin-left: 280px;\n\tmargin-top: 5px;\n\tdisplay: block;\n}\n/** Built-in Class **/\n#main_body form li{\n\tclear: both;\n}\n#main_body form li.column_2{\n width: 47%;\n float: left;\n clear: none !important;\n}\n#main_body form li.column_3{\n\twidth: 31%;\n\tfloat: left;\n\tclear: none !important;\n}\n#main_body form li.column_4{\n\twidth: 22%;\n \tfloat: left;\n\tclear: none !important;\n}\n#main_body form li.column_5{\n\twidth: 17%;\n\tfloat: left;\n\tclear: none !important;\n}\n#main_body form li.column_6{\n\twidth: 14%;\n\tfloat: left;\n\tclear: none !important;\n}\n#main_body form li.new_row{\n\tclear: left !important;\n}\n#main_body form li.hidden{\n\tdisplay: none;\n}\n#main_body form li.guidelines_bottom .guidelines\n{\n\tbackground: none !important;\n\tborder: none !important;\n\tfont-size:105%;\n\tline-height:100%;\n\tmargin: 0 !important;\n padding: 0 0 5px;\n\tvisibility:visible;\n\twidth:100%;\n\tposition: static;\n\n}\nEOT;\n\t\tforeach ($form_id_array as $form_id) {\n\t\t\t$target_css_file = $mf_settings['data_dir'].\"/form_{$form_id}/css/view.css\";\n\t\t\tif(file_exists($target_css_file) && is_writable($target_css_file)){\n\t\t\t\tfile_put_contents($target_css_file, $new_css_code, FILE_APPEND);\n\t\t\t}\n\t\t}\n\n\t\treturn $post_install_error;\n\t}", "function wp_site_admin_email_change_notification($old_email, $new_email, $option_name)\n{\n}", "function _webform_civicrm_webform_frontend_form_alter(&$form) {\n $node = $form['#node'];\n if ($settings = $node->webform_civicrm) {\n civicrm_initialize();\n $enabled = webform_civicrm_enabled_fields($node);\n\n // If this is an edit op, use the original CID to avoid confusion\n if ($submission = $form['#submission']) {\n $cid = $submission->civicrm['contact_id'];\n }\n else {\n // If user is logged in, look up their CID\n global $user;\n if ($user->uid) {\n require_once 'CRM/Core/BAO/UFMatch.php';\n $cid = CRM_Core_BAO_UFMatch::getContactId($user->uid);\n }\n // If user is following a hashed link from CiviMail, validate it and set CID appropriately\n elseif ($_GET['cs'] && $_GET['cid']) {\n require_once 'CRM/Contact/BAO/Contact/Utils.php';\n if (CRM_Contact_BAO_Contact_Utils::validChecksum($_GET['cid'], $_GET['cs'])) {\n $_SESSION['webform_civicrm_cid'] = $cid = $_GET['cid'];\n $_SESSION['webform_civicrm_cs'] = $_GET['cs'];\n }\n }\n }\n // Form alterations for unknown contacts\n if (!$cid) {\n $form['#prefix'] .= filter_filter('process', 1, NULL, $settings['prefix_unknown']);\n if ($settings['block_unknown_users']) {\n $form = array();\n }\n return;\n }\n // Form alterations for known contacts\n require_once 'api/v2/Contact.php';\n $params = array('contact_id' => $cid);\n $contact = civicrm_contact_get($params);\n $fields = webform_civicrm_get_fields();\n $custom = FALSE;\n foreach ($fields as $id => $f) {\n if (strpos($id, 'custom')) {\n $custom = TRUE;\n $params[str_replace('civicrm', 'return', $id)] = 1;\n }\n }\n if ($custom) {\n $custom = civicrm_contact_get($params);\n $contact = array_merge($contact[$cid], $custom[$cid]);\n }\n else {\n $contact = $contact[$cid];\n }\n\n $form['#prefix'] .= filter_filter('process', 1, NULL, webform_civicrm_replace_tokens($settings['prefix_known'], $contact));\n\n // Do not alter form default values if this is an edit op\n if ($submission) {\n return;\n }\n\n // Some translation of array key strings is necessary due to irregulatities in CiviCRM API V2\n $contact_info = array();\n foreach ($enabled as $id => $val) {\n $new_id = str_replace(array('civicrm_', 'prefix', 'suffix'), array('', 'individual_prefix', 'individual_suffix'), $id);\n if (($value = $contact[$new_id]) || isset($contact[$new_id])) {\n $contact_info[$id] = $value;\n }\n }\n\n // Set default values for group field\n if ($enabled['civicrm_groups']) {\n require_once 'api/v2/GroupContact.php';\n $params = array('contact_id' => $cid);\n $groups = civicrm_group_contact_get($params);\n $contact_info['civicrm_groups'] = array();\n foreach ($groups as $group) {\n $contact_info['civicrm_groups'][] = $group['group_id'];\n }\n }\n // Recurse through FAPI array and set default values for civicrm elements\n webform_civicrm_fill_values($form['submitted'], $contact_info);\n\n if ($settings['message']) {\n webform_civicrm_set_message($settings['message'], $contact);\n }\n }\n}", "function xmldb_local_trigger_upgrade($oldversion) {\n global $DB;\n\n $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes\n\n\n if ($oldversion < 2022071501) {\n $table = new xmldb_table('local_trigger_webhooks');\n\n // Adding fields to table tool_dataprivacy_contextlist.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('authid', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null);\n $table->add_field('event', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null);\n $table->add_field('webhook', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null);\n $table->add_field('description', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null);\n $table->add_field('enabled', XMLDB_TYPE_INTEGER, '2', null, null, null, '0');\n $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');\n $table->add_field('createdby', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');\n $table->add_field('modifiedby', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');\n\n // Adding keys to table tool_dataprivacy_contextlist.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Conditionally launch create table for tool_dataprivacy_contextlist.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n upgrade_plugin_savepoint(true, 2022071501, 'local','trigger');\n }\n\n //Lets use varchar and not text for trigger db fields\n if ($oldversion < 2022112400) {\n $table = new xmldb_table('local_trigger_webhooks');\n $fields = array(\n new xmldb_field('authid', XMLDB_TYPE_CHAR, '255'),\n new xmldb_field('event', XMLDB_TYPE_CHAR, '255'),\n new xmldb_field('webhook', XMLDB_TYPE_CHAR, '255')\n );\n foreach ($fields as $fielddef) {\n if($dbman->field_exists($table, $fielddef)){\n $dbman->change_field_type($table, $fielddef);\n }\n }\n\n upgrade_plugin_savepoint(true, 2022112400, 'local','trigger');\n }\n\n if ($oldversion < 2022112500) {\n $table = new xmldb_table('local_trigger_sample');\n\n // Adding fields to table\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('event', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null);\n $table->add_field('eventdata', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null);\n $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');\n\n // Adding keys to table\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Conditionally launch create table.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n upgrade_plugin_savepoint(true, 2022112500, 'local','trigger');\n }\n\n if ($oldversion < 2022122800) {\n //The update.php created local_trigger_sample - \"event\" field as char(255) field type but install.xml created as text field type.\n //This update will change the text type event fields, to char 255. If its already char(255) it will do nothing.\n $table = new xmldb_table('local_trigger_sample');\n $field = new xmldb_field('event', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null);\n\n //The field, in reality, will already exist in either form, but let's just be safe and check first\n if ( $dbman->field_exists($table, $field)) {\n $dbman->change_field_type($table, $field);\n }else{\n $dbman->add_field($table, $field);\n }\n\n upgrade_plugin_savepoint(true, 2022122800, 'local','trigger');\n }\n\n // Final return of upgrade result (true, all went good) to Moodle.\n return true;\n}", "function ucroo_upgrade_159() {\n $sql = array(\n \"ALTER TABLE `ucroo_event` CHANGE COLUMN `campus_id` `campus_id` VARCHAR(150) NULL DEFAULT NULL AFTER `creator_id`;\",\n \"ALTER TABLE `service_event` CHANGE COLUMN `campus_id` `campus_id` VARCHAR(150) NULL DEFAULT NULL AFTER `max_attendees`;\"\n );\n return $sql;\n}", "function change_from_email( $original ) {\n\treturn get_option('admin_email');;\n}", "protected function fixOutdatedEmailAddress(): void {\n\n if ($this->config->get('emailTemplateUsageNeverUpdate') && $this->emailTemplateUsed) {\n return;\n }\n\n if (!$this->drupalUser) {\n return;\n }\n\n if ($this->drupalUser->get('mail')->value === $this->serverDrupalUser->deriveEmailFromLdapResponse($this->ldapEntry)) {\n return;\n }\n $update_type = $this->config->get('emailUpdate');\n\n if (in_array($update_type, ['update_notify', 'update'], TRUE)) {\n $this->drupalUser->set('mail', $this->serverDrupalUser->deriveEmailFromLdapResponse($this->ldapEntry));\n if (!$this->drupalUser->save()) {\n $this->logger\n ->error('Failed to make changes to user %username updated %changed.', [\n '%username' => $this->drupalUser->getAccountName(),\n '%changed' => $this->serverDrupalUser->deriveEmailFromLdapResponse($this->ldapEntry),\n ]\n );\n }\n elseif ($update_type === 'update_notify') {\n $this->messenger->addStatus(\n $this->t('Your e-mail has been updated to match your current account (%mail).', [\n '%mail' => $this->serverDrupalUser->deriveEmailFromLdapResponse($this->ldapEntry),\n ]\n )\n );\n }\n }\n }", "function upgrade_438_mysql() {\n # Table structure for table alias_domain\n #\n $table_alias_domain = table_by_key('alias_domain');\n db_query_parsed(\"\n CREATE TABLE IF NOT EXISTS $table_alias_domain (\n `alias_domain` varchar(255) NOT NULL default '',\n `target_domain` varchar(255) NOT NULL default '',\n `created` datetime NOT NULL default '0000-00-00 00:00:00',\n `modified` datetime NOT NULL default '0000-00-00 00:00:00',\n `active` tinyint(1) NOT NULL default '1',\n PRIMARY KEY (`alias_domain`),\n KEY `active` (`active`),\n KEY `target_domain` (`target_domain`)\n ) {MYISAM} COMMENT='Postfix Admin - Domain Aliases'\n \");\n}", "function cf7zl_cf7_email_hook($contact_form) {\n global $LOG;\n $LOG->debug('Entered function: %s:%s()', __FILE__, __FUNCTION__);\n $zoho_authtoken = get_option(CF7ZL_OPT_AUTHTOKEN, null);\n // Bail if there's no token\n if( !$zoho_authtoken )\n return;\n // Get the CF7 posted data and title\n $cf7_data = WPCF7_Submission::get_instance()->get_posted_data();\n $cf7_title = $contact_form->title();\n $zoho = new Zoho($zoho_authtoken);\n $leads = array();\n // Get the user-defined overrides\n $cf7zl_fields = $cf7_data[CF7ZL_POST_HIDDEN_FIELDS];\n // Build the default map\n $map = array(\n \"Company\" => \"company\",\n \"First Name\" => \"first-name\",\n \"Last Name\" => \"last-name\",\n \"Email\" => \"email\",\n \"Phone\" => \"phone\",\n \"Title\" => \"title\"\n );\n \n // Build the user-defined map\n $overrides = array();\n foreach (explode('|', $cf7zl_fields) as $chunk) {\n list($key, $val) = explode('=', $chunk);\n if( empty($key) ) continue;\n if( empty($val) ) $val = null;\n $overrides[$key] = $val;\n }\n // Map default CF7 fields to Zoho Leads fields\n foreach( $map as $k => $v )\n $lead[$k] = $cf7_data[$v] ?: null;\n // Map user-defined CF7 fields to Zoho Leads fields\n foreach( $overrides as $k => $v )\n $lead[$k] = (is_null($v) ? null : ($cf7_data[$v] ?: null));\n // Assign the CF7 title as the Lead Source\n $lead[\"Lead Source\"] = $cf7_title ?: null;\n $LOG->info('Inserting record in Zoho Leads');\n $LOG->debug('Zoho API request: %s', print_r($leads, true));\n $response = $zoho->insert_record(array($leads));\n $LOG->debug('Zoho API response: %s', print_r($response, true));\n $LOG->debug('Exiting function: %s:%s()', __FILE__, __FUNCTION__);\n}", "public function testUpdateEmailTemplate()\n {\n }", "function forena_confirm_email($formid, &$form_state, $docs, $count, $prompt_subject, $prompt_body) {\n // Make sure user has permission for email merge.\n if (!user_access('perform email merge')) {\n drupal_access_denied();\n exit();\n }\n // Save arguments away for rebuild\n if (!isset($form_state['storage']['args'])) {\n $form_state['storage']['args'] = array(\n 'docs' => $docs,\n 'count' => $count,\n 'prompt_subject' => $prompt_subject,\n 'prompt_body' => $prompt_body,\n );\n }\n else {\n // Retrieve arguements for rebuild case\n extract($form_state['storage']['args']);\n }\n if ($docs) {\n $values = @$form_state['values'];\n if ($prompt_subject) {\n $form['subject'] = array(\n '#type' => 'textfield',\n '#title' => t('Subject'),\n '#default_value' => @$values['subject'],\n\n );\n }\n\n if ($prompt_body) {\n $form['body'] = array(\n '#type' => 'text_format',\n '#title' => t('Message'),\n '#default_value' => @$values['body'],\n '#format' => variable_get('forena_email_input_format', filter_default_format())\n\n );\n }\n\n\n if (!variable_get('forena_email_override', FALSE)) {\n $form['send'] = array(\n '#type' => 'radios',\n '#title' => t('Send Email'),\n '#options' => array('send' => 'email to users',\n 'test' => 'emails to me (test mode)'),\n '#default_value' => 'test',\n );\n }\n $form['max'] = array(\n '#type' => 'textfield',\n '#title' => 'Only send first',\n '#description' => 'In test mode only, limits the number of messages to send',\n '#default_value' => 1,\n '#size' => 3,\n );\n\n $form_state['storage']['docs'] = $docs;\n $form_state['storage']['count'] = $count;\n }\n return confirm_form($form, t('Send mail to users'), 'forena', t('Send email to %count users?', array('%count' => $count)));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attempting to delete a model without an ID should fail.
public function testDeleteNoId() { $this->expectException(InvalidParameterException::class); $this->modelStub->delete(); }
[ "public function testDeleteEmptyModel() {\n\t\t\n\t\t$this->ApiResource->forModel();\n\t\t\n\t\t$this->ApiResource->withId();\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->delete();\n\t\t\n\t\t$this->assertFalse($test);\n\t\t\n\t}", "public function testDeleteModel_With_AnInvalidModelId_ThrowsClientException_ReturnsNull()\n {\n //Set return value of delete method\n $this->bridge->method('delete')\n ->withAnyParameters()\n ->will($this->throwException(new \\FindBrok\\WatsonBridge\\Exceptions\\WatsonBridgeException('InvalidUuidMessage', 400)));\n //Override Bridge in IOC\n $this->app->instance('WatsonTranslateBridge', $this->bridge);\n\n $this->translator->deleteModel('invalid-uid');\n }", "public abstract function deleteModel(\\MPF\\Db\\Model $model);", "public function testModelDelete()\n\t{\n\t\t$model = Post::model()->findByPk(1);\n\t\t$result = $this->event->emit(ERestEvent::MODEL_DELETE, [$model]);\n\t\t$this->assertInstanceOf('Post', $result);\n\n\t\t$model = Post::model()->findByPk(1);\n\t\t$this->assertEquals(null, $model);\n\t}", "public function deleteById($modelId);", "public function testFailDeleteTaskWhenInvalidId()\n {\n $task = Task::factory()->create();\n $response = $this->delete(self::BASE_ROUTE . \"10\");\n $response->assertStatus(404);\n $this->assertDatabaseHas(\"tasks\", [\"id\" => $task->id]);\n }", "public function testDeleteApiWithoutId()\n {\n $this->getManager();\n $response = $this->sendApiRequest('DELETE', '/api/v3/person');\n\n $this->assertEquals(Response::HTTP_BAD_REQUEST, $response->getStatusCode());\n }", "public function testDeletePk()\n {\n UnitTest::delete(3);\n\n try {\n $test = UnitTest::find(3);\n $this->fail();\n } catch (Mad_Model_Exception_RecordNotFound $e) {\n $msg = 'The record for id=3 was not found';\n $this->assertEquals($msg, $e->getMessage());\n }\n }", "public function testDeleteFailureThrowsRuntimeException()\n {\n $id = 'ab43ca3434f324acde';\n $this->modelMock->id = $id;\n\n $this->modelMock->expects($this->once())\n ->method('delete')\n ->will($this->returnValue(false));\n\n $this->modelMock->expects($this->once())\n ->method('find')\n ->with($id)\n ->will($this->returnValue($this->modelMock));\n\n $crudService = new CRUDService();\n $crudService->delete($this->modelMock, $id);\n }", "public function deleteModel(CrudableModel $model): CrudableModel;", "public function delete(Model $model);", "public function testDeleteBookRejectedOnInvalidId()\n {\n\t$id = 's';\n\n\ttry{\n\t$this->dbModel->deleteBook($id);\n\t$this->assertInstanceOf(InvalidArgumentException::class, null);\r\n } \r\n catch (InvalidArgumentException $e) {\n }\n }", "public function testDeleteProductWithInvalidId()\n {\n $id = 99999;\n $response = $this->delete(\"/api/delete/{$id}\");\n $response->assertStatus(404);\n }", "public function testDeleteResourceNotFound() {\n\t\t\n\t\t$this->ApiResource->forModel($this->test_model);\n\t\t\n\t\t$this->ApiResource->withId(1);\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->any())\n\t\t\t->method('exists')\n\t\t\t->will($this->returnValue(false));\n\t\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->any())\n\t\t\t->method('read')\n\t\t\t->will($this->returnValue(false));\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(4004));\n\t\t\n\t\t$test = $this->ApiResource->delete();\n\t\t\n\t\t$this->assertFalse($test);\n\t\t\n\t}", "public function testDeleteById() {\n //test with empty id \n $asData1 = $this->obModel->deleteById();\n $this->assertFalse($asData1);\n\n //test with numeric and valid value\n $asData2 = $this->obModel->deleteById(18);\n $this->assertEquals($asData2, 0);\n }", "public function forceDelete($id);", "function deleteResource($model)\n {\n }", "protected function deleteFromHash()\n\t{\n\t\tif (! is_null($this->getAttribute('id'))) {\n\t\t\t\n\t\t\t// Get the hash from the id\n\t\t\t$hash = static::getHashById($this->getAttribute('id'));\n\t\t\t\n\t\t\treturn $this->getConnection()->hdel(static::$bucketNamespace . ':' . $hash, $this->getAttribute('id'));\n\t\t}\n\t\t\n\t\t// Throw exception\n\t\tthrow new ModelIdRequiredException();\n\t}", "public function permanentlyDeleteById($modelId);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
logic can be implemented depending on the chosed algorithm like SHA
function calculateSHA($inputArray,$salt){ // will return true assuming that SAH validation passes return true; }
[ "function hash_algos () {}", "function sha256($str, $raw_output){}", "abstract protected static function getHashAlgorithm() : string;", "private static function buildSHA() {\n\t\tksort(self::$_fields);\n\t\t\n\t\t// Forward declare the var we are using for the sha string\n\t\t$sha_string = null;\n\n\t\tforeach (self::$_fields as $name => $value) {\n\n\t\t\tif (!empty($value))\n\t\t\t\t$sha_string .= strtoupper($name) . '=' . $value . self::$shasign;\n\t\t}\n\n\t\tif (function_exists('hash'))\n\t\t\t$shaout = hash(self::$hash_method, $sha_string);\n\t\telseif (function_exists('mhash'))\n\t\t\t$shaout = strtoupper(bin2hex(mhash(self::$hash_method, $sha_string)));\n\t\telse\n\t\t\tthrow new \\Fuel_Exception(\"No encryption method found\");\n\n\t\treturn $shaout;\n\t}", "function compute_digest() {\n $num_trigrams = 0;\n if ($this->num_char == 3) {\n // 3 chars -> 1 trigram\n $num_trigrams = 1;\n } elseif ($this->num_char == 4){\n // 4 chars -> 4 trigrams\n $num_trigrams = 4;\n } elseif ($this->num_char > 4) {\n // > 4 chars -> 8 for each char\n $num_trigrams = 8 * $this->num_char - 28;\n }\n # threshhold is the mean of the acc buckets\n $threshold = $num_trigrams / 256.0;\n\n $digest = array_fill(0, 32, 0);\n for ($i = 0; $i < 255; $i++) {\n if ($this->acc[$i] > $threshold) {\n // equivalent to i/8, 2**(i mod 7)\n $digest[$i >> 3] += 1 << ($i & 7);\n }\n }\n\n // set flag to true\n $this->complete = true;\n // store result in digest, reversed\n $this->digest = array_reverse($digest);\n }", "function shahash($val)\r\n{\r\n$c=hash(\"sha256\",\"$val\");\r\nreturn $c;\r\n}", "abstract protected function setHashAlgorithm();", "function core_sha1($x, $len)\n{\n\t/* append padding */\n\t$x[$len >> 5] |= 0x80 << (24 - $len % 32);\n\t$x[(($len + 64 >> 9) << 4) + 15] = $len;\n\n\t$w = array();\n\t$a = 1732584193;\n\t$b = -271733879;\n\t$c = -1732584194;\n\t$d = 271733878;\n\t$e = -1009589776;\n\n\tfor($i = 0; $i < count($x); $i += 16)\n\t{\n\t\t$olda = $a;\n\t\t$oldb = $b;\n\t\t$oldc = $c;\n\t\t$oldd = $d;\n\t\t$olde = $e;\n\n\t\tfor($j = 0; $j < 80; $j++)\n\t\t{\n\t\t\tif($j < 16) {$w[$j] = $x[$i + $j];}\n\t\t\telse {$w[$j] = rol($w[$j-3] ^ $w[$j-8] ^ $w[$j-14] ^ $w[$j-16], 1);}\n\t\t\t$t = safe_add(safe_add(rol($a, 5), sha1_ft($j, $b, $c, $d)),\n\t\t\t\tsafe_add(safe_add($e, $w[$j]), sha1_kt($j)));\n\t\t\t$e = $d;\n\t\t\t$d = $c;\n\t\t\t$c = rol($b, 30);\n\t\t\t$b = $a;\n\t\t\t$a = $t;\n\t\t}\n\n\t\t$a = safe_add($a, $olda);\n\t\t$b = safe_add($b, $oldb);\n\t\t$c = safe_add($c, $oldc);\n\t\t$d = safe_add($d, $oldd);\n\t\t$e = safe_add($e, $olde);\n\t}\n\treturn array($a, $b, $c, $d, $e);\n\n}", "public function slowHash(){\n $i = 0;\n while($i<10000){\n $this->hashedpassword = sha1($this->hashedpassword);\n $i++;\n }\n }", "function exlog_should_lowercase_hex_hash($algorithm, $hash) {\n// Case sensitive hashes and when no hash is used\n if ($algorithm == \"bcrypt\" || $algorithm == \"phpass\" || $algorithm == \"phpcrypt\" || $algorithm == \"none\") {\n return $hash;\n// Hex hashes that can be lower or upper case\n } else {\n return strtolower($hash);\n }\n\n }", "function sha512_hashing($input)\n{\n return hash(\"sha512\", $input);\n}", "protected function checkHashKey() {}", "function ph_sha256_compare( $data, $hash_to_compare, $secret ) {\n$hash =\nhash('sha256',$secret.$data[\"amount\"].$data[\"currency\"].$data[\"product_description\"].$data[\"order_id\"].\n$data[\"customer_name\"].$data[\"customer_email\"].$data[\"customer_phone\"].$data[\"transaction_id\"].$data[\"status\"]);\nif ($hash == $hash_to_compare) {\nreturn true;\n}\nelse\n{\nreturn false;\n}\n}", "function simulateClientsideHash($user, $plaintext) {\r\n return hash(\"sha512\", strtoupper($user) . $plaintext);\r\n}", "function hash_hmac_algos(): array {}", "abstract public function getShaOperationLib();", "function sha256(string $input): string\n{\n return hash('sha256', $input, true);\n}", "function smallHash($text)\n{\n $t = rtrim(base64_encode(hash('crc32',$text,true)),'=');\n return strtr($t, '+/', '-_');\n}", "function smallHash($text)\n{\n $t = rtrim(base64_encode(hash('crc32',$text,true)),'=');\n $t = str_replace('+','-',$t); // Get rid of characters which need encoding in URLs.\n $t = str_replace('/','_',$t);\n $t = str_replace('=','@',$t);\n return $t;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all ChannelFunctionType models.
public function actionIndex() { $searchModel = new ChannelFunctionTypeSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
[ "public function listofFunctions()\n {\n return view('Admin.ShowallFunctions');\n }", "public function actionIndex()\n {\n $searchModel = new TblchannelsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->orderBy(['updated_at'=>SORT_DESC])->all();\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function allChannels() {\n return view('SubscriberManagement::channel.all_channels');\n }", "public function getAll()\n {\n return Feature::orderBy('name', 'ASC')->get();\n }", "public function actionIndex()\n {\n $searchModel = new ChannelSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function all()\n {\n return FieldType::all();\n }", "public function listChannels()\n {\n return $this->httpGet(\"/\" . self::API_VERSION . \"/channels\");\n }", "public function getAll(){\n\t\treturn \\App\\DeviceType::all();\n\t}", "public static function List() {\n\t\t$models = array();\n\n\t\t// Get models from the database ordered.\n\t\t$dbh = Database::connect();\n\t\t$query = $dbh->prepare(\"SELECT id FROM device_models\");\n\t\t$query->execute();\n\t\t$rows = $query->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t// Go through the results creating Model objects.\n\t\tforeach ($rows as $model)\n\t\t\tarray_push($models, Model::FromID($model[\"id\"]));\n\n\t\treturn $models;\n\t}", "public function all()\n\t{\n\t\t$this->view->operation_types = Auto_Modeler_ORM::factory('operation_type')->fetch_all('name');\n\t}", "public function get_functions()\n\t{\n\t\treturn $this->driver_query('function_list', FALSE);\n\t}", "public function listFunctions()\n {\n $database_name = $this->database->getDatabase();\n $query_string = sprintf(\"SHOW FUNCTION STATUS WHERE Db = '%s';\",$database_name);\n \n $stmt = $this->database->prepare($query_string);\n $stmt->execute();\n \n $raw_functions = $stmt->fetchAll();\n $functions = array();\n \n foreach($raw_functions as $function) {\n $functions[] = $function['Name'];\n }\n \n return $functions;\n }", "public function getChannels();", "public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }", "public function getAllChannels()\n {\n return $this->_channel;\n }", "public function actionIndex()\n {\n $searchModel = new FcttypeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getListChannel(Request $request) {\n try {\n $name = $request->get('search_name');\n $channels = $this->channel->searchByName($name);\n return $this->response->withArray($channels);\n }catch (\\Exception $e){\n return $this->response->withNotFound($e->getMessage());\n }\n }", "public function channelList()\n {\n\t \n\t if (!env('USE_CACHE')) {\n Cache::forget('channels');\n }\n\n\t $data = Cache::remember('channels',env('CACHE_EXPIRY'), function() {\n\t \treturn [\n\t\t\t\t\"this\"\t=> $this->roots[1],\n\t \t\t\"parents\" => [\n\t \t\t\t\t\"guid\" => null,\n\t \t\t\t\t\"label\" => null\n\t \t\t\t],\n\t \t\t\"has_service_group\"\t=> true,\n \"service_group_type\" => \"Student Channel\",\n\t \t\t\"endpoints\" => Endpoint::Channels()\n\t\t ];\n\t });\n\n $data['endpoints'] = $this->insertImages($data['endpoints'], true, $data['has_service_group']);\n\n\t return $this->respondOK($data);\n\t}", "public function connector_types()\n {\n return $this\n -> connector_types_all()\n -> where('status','active');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests if constructing a new Indexer sets the instance properties.
public function testConstruct() { $this->assertAttributeSame($this->clientMock, 'client', $this->indexer); $this->assertAttributeSame('test_index', 'indexName', $this->indexer); $this->assertAttributeSame($this->eventDispatcherMock, 'eventDispatcher', $this->indexer); }
[ "public function __construct($idxer = null) {\n if ($idxer == null)\n $this->__indexer = new Indexer();\n else\n $this->__indexer = $idxer;\n\n $this->__index = $this->__indexer->getIndex();\n }", "public function __construct() {\n\t\t$this->indexerStrategy = $this->selectIndexer();\n\t}", "public function testGetIndexer()\n {\n $this->prepareIndexer();\n $this->assertInstanceOf(\\Magento\\Indexer\\Model\\Indexer::class, $this->_model->getIndexer());\n }", "public abstract function hasIndexer();", "function ___on_indexer_create () {\n }", "public function __construct()\n {\n if (tx_rnbase_util_Extensions::isLoaded('gridelements')) {\n $this->actualIndexer = tx_rnbase::makeInstance('tx_mksearch_indexer_ttcontent_Gridelements');\n } elseif (tx_rnbase_util_Extensions::isLoaded('templavoila')) {\n $this->actualIndexer = tx_rnbase::makeInstance('tx_mksearch_indexer_ttcontent_Templavoila');\n } else {\n $this->actualIndexer = tx_rnbase::makeInstance('tx_mksearch_indexer_ttcontent_Normal');\n }\n }", "protected function _construct()\n {\n $this->_loadIndexers();\n $this->_init('catalogindex/indexer');\n }", "public function __construct(Zend_Search_Lucene $index)\n {\n $this->_index = $index;\n }", "public function testSetIndex() {\n\n $obj = new FichesConfidentialitesMenus();\n\n $obj->setIndex(10);\n $this->assertEquals(10, $obj->getIndex());\n }", "public function prepareForIndexing();", "private function initialize(){\r\n\t\ttry{\r\n\t\t\t$this->index = Zend_Search_Lucene::open($this->indexPath);\r\n\t\t}catch (Zend_Search_Lucene_Exception $ex){\r\n\t\t\tthrow new Exception($ex->getMessage());\r\n\t\t}\r\n\t}", "public function is_initial_indexing()\n {\n }", "public function hasIndexer() {\n return $this->declaration->hasIndexer();\n }", "public static function isIndexerEnabled(){\n return self::$indexerEnabled;\n }", "public function testCreateNormalIndex()\n {\n $elasticsearch = new IndexBuilderStructure();\n $document = new Document();\n $elasticsearch::createIndices('Document');\n }", "public function testConstructor()\n\t{\n\t\t$search = new Search();\n\n\t\t$search->set('id', '25');\n\t\t$search->set('term', 'motor');\n\t\t$search->set('date', '2021-06-15');\n\t\t\n\t\t$this->assertEquals($search->get('id'), '25');\n\t\t$this->assertEquals($search->get('term'), 'motor');\n\n\t\t$this->assertNotEquals($search->get('term'), 'fiets');\n\t\t$this->assertNotEquals($search->get('date'), '1999-01-01');\n\t\t\n\t}", "public function __construct($conf)\n {\n //$this->index_classes = $conf['indexes'];\n }", "public function testIndexCreationParentBean()\n\t{\n\t\tR::nuke();\n\t\t$book = R::dispense( 'book' );\n\t\t$page = R::dispense( 'page' );\n\t\t$page->book = $book;\n\t\tR::store( $page );\n\t\t$indexes = getIndexes( 'page' );\n\t\tasrt( in_array( 'index_foreignkey_page_book', $indexes ), TRUE );\n\t}", "protected function prepareSectionIndexTest() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the user has all roles of a collection of roles
private function all($user, Collection $roles): bool { $results = collect(); foreach ($user->profiles as $profile) { $intersection = $profile->roles->pluck('code')->intersect($roles); foreach ($intersection as $item) { if (!$results->contains($item)) { $results->push($item); } } } dd($results->count() == $roles->count()); return $results->count() == $roles->count(); }
[ "public function hasAllRoles(array $roles): bool;", "public function hasAnyRole($roles);", "public function hasAnyRole($roles): bool;", "public function all(array $roles): bool\n {\n if ($this->isValidRolesArray($roles)) {\n if (AccessControlFacade::isAuthUser($this->user, true)) {\n $assignedRoleIds = AccessControlFacade::getAssignedRoles()\n ->map(fn ($assignedRole) => $assignedRole->role_id);\n\n if (is_null($assignedRoleIds)) {\n return false;\n }\n\n return count($roles) === count($assignedRoleIds) &&\n collect($roles)->every(function ($roleName) use ($assignedRoleIds) {\n if ($role = AccessControlFacade::getRole($roleName)) {\n return in_array($role->id, $assignedRoleIds->toArray());\n }\n\n return false;\n });\n } else {\n return $this->user->belongsToMany(Role::class, 'assigned_roles')->whereIn('name', $roles)->count() === count($roles);\n }\n }\n\n return false;\n }", "public function inRoles(array $user_roles = []): bool\n {\n return $this->user_roles->pluck('slug')->intersect($user_roles)->isNotEmpty();\n }", "public static function checkTheRules() {\n $user = self::getCurrentUser();\n $res = array();\n foreach (func_get_args() as $param) {\n if (!is_array($param)) {\n $res = in_array($param, $user->roles) ? true : $res ? true : false;\n }\n }\n return $res;\n }", "public static function hasRoles()\n {\n return count(static::$roles) > 0;\n }", "public function hasRoles()\n {\n return $this->roles()->count() ? true : false;\n }", "function cw_tool_user_has_role($role_ids, $account = NULL, $any = TRUE) {\n if (empty($account)) {\n $account = $GLOBALS['user'];\n }\n\n if (!is_array($role_ids)) {\n $role_ids = array($role_ids);\n }\n\n $account_role_ids = array_keys($account->roles);\n $common_role_ids = array_intersect($role_ids, $account_role_ids);\n\n if ($any) {\n if (!empty($common_role_ids)) {\n return TRUE;\n }\n }\n elseif (count($common_role_ids) == count($role_ids)) {\n return TRUE;\n }\n\n return FALSE;\n}", "public function inRoles($roles = [])\n {\n return $this->roles()->whereIn('slug', (array) $roles)->exists();\n }", "public static function hasRoles()\n {\n return count(static::$roles) > 0;\n }", "public static function hasRoles(): bool\n {\n return count(static::$roles) > 0;\n }", "public function isAll( $role ) {\n\t\tforeach ( $this->getArrayFrom( $role ) as $role ) {\n\t\t\tif ( ! $this->hasRole( $role ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function check_roles(\\WP_User $wp_user, $mrbs_roles)\r\n{\r\n if (!isset($mrbs_roles))\r\n {\r\n return false;\r\n }\r\n \r\n // Turn $mrbs_roles into an array if it isn't already\r\n $mrbs_roles = (array)$mrbs_roles;\r\n\r\n // Put the roles into the standard WordPress format\r\n $mrbs_roles = array_map(__NAMESPACE__ . \"\\\\standardise_role_name\", $mrbs_roles);\r\n \r\n return (count(array_intersect($wp_user->roles, $mrbs_roles)) > 0);\r\n}", "public function hasRole($slug, $requireAll = false)\n {\n # if $requireAll is passed in as true, need to make sure the user has all roles passed in\n # You can also pass an object and perform a check is_object then use $role->slug in loop\n if (is_array($slug)) {\n foreach ($slug as $roleName) {\n $hasRole = $this->hasRole($roleName);\n if ($hasRole && !$requireAll) {\n return true;\n } elseif (!$hasRole && $requireAll) {\n return false;\n }\n }\n return $requireAll;\n } else {\n foreach ($this->roles as $rol) {\n if ($rol->slug == $slug) {\n return true;\n }\n }\n }\n return false;\n }", "public function rolesForUser();", "public function isInOneRole() {\n $roles = func_get_args();\n foreach ($roles as $role) {\n if ($this->isInRole($role)) {\n return true;\n }\n }\n return false;\n }", "public function getUserRoles();", "public function authorizedRoles($roles){\n if ($this->hasAnyRole($roles)) {\n return true;\n }\n abort(401, 'This action is Unauthorized');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Output Shop Baranding settings for Dashboard and User Admin panel. Note. The WCVendors has the same hook for both so it has to use different htmltemplates.
public function vendor_dashboard_branding_settings() { $user = wp_get_current_user(); if( !is_admin() ) { // Phone & Address self::store_contact(); // Store Banner self::store_banner(); // Store Icon self::store_icon(); } else { $this->admin_user_meta_branding( $user ); } }
[ "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 admin_options()\n {\n echo '<h3>' . __('Oplata.com', 'kdc') . '</h3>';\n echo '<p>' . __('Payment gateway') . '</p>';\n echo '<table class=\"form-table\">';\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n echo '</table>';\n }", "public function admin_options() {\n ?>\n <h3><?php _e('Faspay','woothemes'); ?></h3>\t \t\n <p>\n <?php _e( 'Faspay Gateway Systems', 'woothemes' ); ?>\n </p>\n <table class=\"form-table\">\n <?php $this->generate_settings_html(); ?>\n </table> \t\n <p>\n <?php\n }", "function cubic_get_user_settings() {\n\tglobal $CFG, $USER, $OUTPUT;\n\t\n\t$title = get_string('menu-settings','theme_cubic');\n\t$html = '<div class=\"title\">'.$title.'</div>';\n\tif(isloggedin() && !isguestuser()) {\n\t\t$html.= \n\t\t\t'<div class=\"container\">'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/user/edit.php?id='.$USER->id.'\">'.\n\t\t\t\t\t\tget_string('settings-edit','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('t/edit').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/change_password.php?id=1\">'.\n\t\t\t\t\t\tget_string('settings-password','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('i/key').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/message/edit.php?id='.$USER->id.'\">'.\n\t\t\t\t\t\tget_string('settings-msg','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('t/email').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/logout.php?sesskey='.sesskey().'\">'.\n\t\t\t\t\t\tget_string('settings-logout','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('a/logout').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t'</div>';\n\t}\n\telse {\n\t\t$html.=\n\t\t\t'<div class=\"container\">'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/index.php\">'.\n\t\t\t\t\t\tget_string('settings-login','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('a/login').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/forgot_password.php\">'.\n\t\t\t\t\t\tget_string('settings-reset','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('i/key').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t'</div>';\n\t}\n\t\n\treturn $html;\n}", "public function admin_options() {\n\t\t?>\n\t\t<h3>Custom Payment 1 <?php _e( 'Settings', 'woocommerce' ); ?></h3>\n <div id=\"poststuff\">\n\t\t\t\t<div id=\"post-body\" class=\"metabox-holder columns-2\">\n\t\t\t\t\t<div id=\"post-body-content\">\n\t\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t\t<?php $this->generate_settings_html();?>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n </div>\n <div class=\"clear\"></div>\n </div>\n<?php\n\t}", "function renderAdminSettings( )\r\n\t{\r\n\t\t$params =& $this->getParams();\r\n\t\t$pluginParams =& $this->getPluginParams();\r\n\t\t?>\r\n\t\t<div id=\"page-<?php echo $this->_name;?>\" class=\"elementSettings\" style=\"display:none\">\r\n\t\t\t<?php \r\n\t\t\techo $pluginParams->render();\r\n\t\t\t?>\r\n\t</div><?php\r\n\t}", "function renderAdminSettings()\n\t{\n\t\t$pluginParams =& $this->getPluginParams();\n\t\t?>\n<div id=\"page-<?php echo $this->_name;?>\" class=\"elementSettings\"\n\tstyle=\"display: none\"><?php echo $pluginParams->render('details');?></div>\n\t\t<?php\n\t}", "public function settings_page(){\n\t\t_e('<div class=\"wrap\">\n\t\t\t<img class=\"alignleft\" style=\"margin:0 10px 10px 0\" alt=\"\" src=\"'.Salesforce_API_Connector::$plugin_dir_url.'assets/images/sf.png\" />\n\t\t\t<h2>Saleforce API Connector</h2>\n\t\t</div>');\n\t}", "public function settings_page() {\r\n\t\techo '<div id=\"beehive-settings-app\"></div>';\r\n\r\n\t\tAssets::instance()->enqueue_style( 'beehive-settings' );\r\n\t\tAssets::instance()->enqueue_script( 'beehive-settings' );\r\n\t}", "public function admin_settings_page() {\n include( 'views/settings/html-wf-settings.php' );\n }", "public function vp_config_page()\r\n\t{\r\n\t\t$attributes = array( 'vp_instance' => &$this );\r\n\t\techo vp_get_template_html( 'admin', $attributes );\r\n\t}", "function toolbelt_admin_page() {\n\n\ttoolbelt_save_admin_settings();\n\n\trequire TOOLBELT_PATH . 'admin/settings.php';\n\n}", "public function render()\n {\n $myConfig = $this->getConfig();\n\n parent::render();\n\n $oAuthUser = oxNew('oxuser');\n $oAuthUser->loadAdminUser();\n $blisMallAdmin = $oAuthUser->oxuser__oxrights->value == \"malladmin\";\n\n if ($blisMallAdmin && !$myConfig->isDemoShop()) {\n $aClassVars = get_object_vars($myConfig);\n $aSystemInfo = array();\n $aSystemInfo['pkg.info'] = $myConfig->getPackageInfo();\n $oSmarty = oxRegistry::get(\"oxUtilsView\")->getSmarty();\n while (list($name, $value) = each($aClassVars)) {\n if (gettype($value) == \"object\") {\n continue;\n }\n // security fix - we do not output dbname and dbpwd cause of demoshops\n if ($name == \"oDB\" || $name == \"dbUser\" || $name == \"dbPwd\" ||\n $name == \"oSerial\" || $name == \"aSerials\" || $name == \"sSerialNr\"\n ) {\n continue;\n }\n\n $value = var_export($value, true);\n $value = str_replace(\"\\n\", \"<br>\", $value);\n $aSystemInfo[$name] = $value;\n //echo( \"$name = $value <br>\");\n }\n $oSmarty->assign(\"oViewConf\", $this->_aViewData[\"oViewConf\"]);\n $oSmarty->assign(\"oView\", $this->_aViewData[\"oView\"]);\n $oSmarty->assign(\"shop\", $this->_aViewData[\"shop\"]);\n $oSmarty->assign(\"isdemo\", $myConfig->isDemoShop());\n $oSmarty->assign(\"aSystemInfo\", $aSystemInfo);\n echo $oSmarty->fetch(\"systeminfo.tpl\");\n echo(\"<br><br>\");\n\n phpinfo();\n\n oxRegistry::getUtils()->showMessageAndExit(\"\");\n } else {\n return oxRegistry::getUtils()->showMessageAndExit(\"Access denied !\");\n }\n }", "public function printConfiguration()\n {\n $config = array(\n 'isActive' => get_option('flyoutActive') == 1,\n 'forSessionOnly' => get_option('flyoutSessionOnly') == 1,\n 'showFrom' => Date::getStamp(Date::EU_DATE, get_option('flyoutFromDate')),\n 'showUntil' => Date::getStamp(Date::EU_DATE, get_option('flyoutToDate')),\n 'cookieId' => get_option('flyoutCookieId')\n );\n\n echo '\n <script type=\"text/javascript\">\n lbwpFlyoutConfig = ' . json_encode($config) . ';\n </script>\n ';\n }", "function apoc_admin_bar() {\n\tinclude( THEME_DIR . '/library/templates/admin-bar.php' );\n}", "function settings(){\n\n\t\t//$this->assets()->enqueue_assets( false );\n\t\t$this->settings_page->output();\n\n\t}", "function system_settings_overview() {\n // Check database setup if necessary\n if (function_exists('db_check_setup') && empty($_POST)) {\n db_check_setup();\n }\n\n $item = menu_get_item('admin/config');\n $content = system_admin_menu_block($item);\n\n $output = theme('admin_block_content', array('content' => $content));\n\n return $output;\n}", "function admin()\r\n {\r\n global $database;\r\n\r\n //get the purchases from the database\r\n $purchases = $database->getUserPurchase();\r\n $this->_f3->set('purchases', $purchases);\r\n\r\n //render admin view\r\n $view = new Template();\r\n echo $view->render('views/admin.html');\r\n }", "public function MiniAdminBar() {\n\n\t\t// Get current logged-in member\n\t\t$member = Member::currentUser();\n\t\t\n\t\tif(!$member) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Does the user have access to the CMS?\n\t\tif( !Permission::check('CMS_ACCESS_CMSMain') ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Does the user have permission to view CMS pages?\n\t\tif( !Permission::check('VIEW_DRAFT_CONTENT') ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the current page\n\t\t$page = $this->owner->data();\n\t\tif( !$page ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$cmsLink = Director::baseURL() . 'admin/show/' . $page->ID;\n\t\t$stageLink = Controller::join_links($page->AbsoluteLink(), '?stage=Stage');\n\t\t$liveLink = Controller::join_links($page->AbsoluteLink(), '?stage=Live');\n\n\t\tswitch( strtolower(Versioned::current_stage()) ) {\n\n\t\t\tcase 'stage':\n\t\t\t\t$currentStage = 'stage';\n\t\t\t\t$currentStageName = _t('ContentController.DRAFTSITE', 'Draft Site');\n\t\t\t\tbreak;\n\n\t\t\tcase 'live':\n\t\t\t\t$currentStage = 'live';\n\t\t\t\t$currentStageName = _t('ContentController.PUBLISHEDSITE', 'Published Site');\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn '';\n\n\t\t}\n\n\t\t$output = '';\n\t\t$output .= '<div id=\"miniadminbar\" class=\"miniadminbar-current-stage-'.$currentStage.'\">';\n\t\t$output .= '<strong>'.$currentStageName.'</strong>';\n\t\t$output .= '<div class=\"options\">';\n\t\t$output .= '<a href=\"'.Convert::raw2xml($cmsLink).'\" class=\"miniadminbar-cms first\">' . _t('ContentController.CMS', 'CMS') . '</a>';\n\t\tif( $currentStage != 'live' ) {\n\t\t\t$output .= '<a href=\"'.Convert::raw2xml($liveLink).'\" class=\"miniadminbar-live\">' . _t('ContentController.PUBLISHEDSITE', 'Published Site') . '</a>';\n\t\t}\n\t\tif( $currentStage != 'stage' ) {\n\t\t\t$output .= '<a href=\"'.Convert::raw2xml($stageLink).'\" class=\"miniadminbar-stage\">' . _t('ContentController.DRAFTSITE', 'Draft Site') . '</a>';\n\t\t}\n\t\t$output .= '</div>';\n\t\t$output .= '</div>';\n\n\t\treturn $output;\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add bid with a string for Bid_lowest_price should be error bid lowest_price MESSAGE_INVALID_BID_LOWEST_PRICE
public function testBADaddBid() { $parameters["json"] ="{\"property_id\":\"2\",\"auction_start_date\":\"0000-01-01\",\"auction_close_date\":\"0000-00-\",\"property_comments\":\"dssjkgagfsakh\",\"property_address\":\"asgfjasfgaksd\",\"auction_actual_selling_price\":\"0.00\",\"property_reserve_price\":\"1.00\",\"current_successful_bidder_user\":\"6587568765\",\"property_photo\":\"1\",\"property_rooms\":\"6587568765\",\"property_description\":\"lhsedjfhlkhf\"}"; $controller = new propertyController($this->model,ACTION_ADD ,$this->app , $parameters); $status = $this->app->response->getStatus(); $this->assertEqual($this->model->errordetails , MESSAGE_INVALID_BID_LOWEST_PRICE); $this->assertEqual(HTTPSTATUS_INTSERVERERR , $status ); }
[ "function AddBid(&$bid)\n\t{\n\t\t$bid->supplierId = $this->supplierId;\n\t\t$found = false;\n\t\tforeach($this->_bidList as $bid2)\n\t\t{\n\t\t\tif ($bid->bidId > 0 && $bid->bidId == $bid2->bidId)\n\t\t\t{\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$found)\n\t\t{\n\t\t\t$this->_bidList[] = $bid;\n\t\t}\n\t}", "public function addBusPrice($id, $slug, $pricekey, $pricevalue, $numkey, $numvalue, $durkey, $durvalue, $adcode)\n {\n $insert = new Busesprice();\n\n $insert->buses_id = $id;\n $insert->slug = $slug;\n $insert->price_key = $pricekey;\n $insert->price_value = $pricevalue;\n $insert->number_key = $numkey;\n $insert->number_value = $numvalue;\n $insert->duration_key = $durkey;\n $insert->duration_value = $durvalue;\n $insert->ad_code = $adcode;\n \n $insert->save();\n\n }", "function placebid($highbidnotify = 0, $lasthournotify = 0, $subscribed = 0, $id = 0, $project_user_id = 0, $bidamount = 0, $qty = 1, $bidderid = 0, $isproxy, $minimumbid, $reserveprice, $showerrormessages = true, $buyershipcost = 0, $buyershipperid = 0)\n {\n global $ilance, $ilpage, $phrase, $ilconfig;\n if ($ilance->permissions->check_access($bidderid, 'productbid') == 'no')\n {\n $area_title = '{_buying_menu_denied_upgrade_subscription}';\n $page_title = SITE_NAME . ' - {_buying_menu_denied_upgrade_subscription}';\n if ($showerrormessages)\n {\n print_notice('{_access_denied}', '{_your_current_subscription_level_does_not_permit_you_to_use_this_marketplace_resource} <a href=\"' . $ilpage['subscription'] . '\"><strong>{_click_here}</strong></a>.', $ilpage['subscription'], ucwords('{_subscription}'), fetch_permission_name('productbid'));\n exit();\n }\n else\n {\n return false;\n } \n }\n $area_title = '{_submitting_bid_proposal}';\n $page_title = SITE_NAME . ' {_submitting_bid_proposal}';\n\t\t$resexpiry = array();\n $sqlexpiry = $ilance->db->query(\"\n SELECT UNIX_TIMESTAMP(date_end) - UNIX_TIMESTAMP('\" . DATETIME24H . \"') AS mytime, date_end, countdownresets, status, cid, bids, project_title, buynow, buynow_price, buynow_qty, reserve, reserve_price, currentprice, currencyid, gtc\n FROM \" . DB_PREFIX . \"projects \n WHERE project_id = '\" . intval($id) . \"'\n\t\t\tLIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sqlexpiry) > 0)\n {\n $resexpiry = $ilance->db->fetch_array($sqlexpiry, DB_ASSOC);\n if ($resexpiry['mytime'] < 0 OR $resexpiry['status'] != 'open')\n {\n $area_title = '{_this_rfp_has_expired_bidding_is_over}';\n $page_title = SITE_NAME . ' - {_this_rfp_has_expired_bidding_is_over}';\n if ($showerrormessages)\n {\n print_notice($area_title, '{_this_rfp_has_expired_bidding_is_over}', $ilpage['main'], '{_main_menu}');\n exit();\n }\n else\n {\n return false;\n }\n }\n }\n unset($sqlexpiry);\n $ilance->watchlist->insert_item(intval($bidderid), $id, 'auction', 'n/a', 0, $highbidnotify, $lasthournotify, $subscribed);\n \n\t\t($apihook = $ilance->api('rfp_do_bid_submit_placebid')) ? eval($apihook) : false;\n\t\n\t\t// #### anti-bid sniping feature ###############################\n\t\tif ($ilconfig['productbid_enablesniping'] AND $resexpiry['cid'] > 0)\n\t\t{\n\t\t\t// #### check if bid sniping is active in this category\n\t\t\t$useantisnipe = $ilance->db->fetch_field(DB_PREFIX . \"categories\", \"cid = '\" . $resexpiry['cid'] . \"'\", \"useantisnipe\");\n\t\t\tif ($resexpiry['mytime'] <= $ilconfig['productbid_snipedurationcount'] AND $useantisnipe)\n\t\t\t{\n\t\t\t\t$otherbidders = false;\n\t\t\t\t$sql = $ilance->db->query(\"\n\t\t\t\t\tSELECT bid_id\n\t\t\t\t\tFROM \" . DB_PREFIX . \"project_bids\n\t\t\t\t\tWHERE project_id = '\" . intval($id) . \"'\n\t\t\t\t\t\tAND user_id != '\" . ($bidderid) . \"'\n\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t\t\t{\n\t\t\t\t\t$otherbidders = true;\n\t\t\t\t}\n\t\t\t\tif ($otherbidders)\n\t\t\t\t{\n\t\t\t\t\t// find out how much time we need to increase the end date\n\t\t\t\t\t$datetimestampnew = (strtotime($resexpiry['date_end']) - TIMESTAMPNOW);\n\t\t\t\t\t$secondstoincrease = ($ilconfig['productbid_snipeduration'] - $datetimestampnew);\n\t\t\t\t\t// limit the amount of times this listing can have the countdown reset\n\t\t\t\t\tif ($resexpiry['countdownresets'] < $ilconfig['productbid_countdownresets'] AND $secondstoincrease > 0) \n\t\t\t\t\t{\n\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\t\t\t\tSET date_end = DATE_ADD(date_end, INTERVAL $secondstoincrease SECOND),\n\t\t\t\t\t\t\t\tcountdownresets = countdownresets + 1\n\t\t\t\t\t\t\tWHERE project_id = '\" . intval($id) . \"'\n\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n if ($ilconfig['productbid_enableproxybid'] AND isset($isproxy) AND $isproxy AND $ilance->categories->useproxybid($_SESSION['ilancedata']['user']['slng'], $resexpiry['cid']))\n {\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"Proxy Bid Enabled for Category ID $resexpiry[cid]\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"User ID: $bidderid is placing a proxy bid amount: $bidamount, minimum bid including category increment is currently: $minimumbid\", 'NOTICE');\n $res = $ilance->bid_proxy->fetch_first_highest_proxybid($id);\n $highestproxy = $res[0];\n $highestproxyuserid = $res[1];\n unset($res);\n $res = $ilance->bid_proxy->fetch_second_highest_proxybid($id);\n $secondhighestproxy = $res[0];\n $secondhighestproxyuserid = $res[1];\n unset($res);\n $highestproxybiduser = $ilance->bid_proxy->fetch_highest_proxy_bid($id, $bidderid);\n $secondhighestproxybiduser = $ilance->bid_proxy->fetch_second_highest_proxy_bid($id, $bidderid);\n DEBUG(\"------------------------------------------\", 'NOTICE'); \n DEBUG(\"Highest proxy bid is currently: $highestproxy by user id: $highestproxyuserid\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"Second Highest proxy bid is currently $secondhighestproxy by user id: $secondhighestproxyuserid\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n // did this bidder already place a proxy bid for this auction?\n $sql = $ilance->db->query(\"\n SELECT id, project_id, user_id, maxamount, date_added\n FROM \" . DB_PREFIX . \"proxybid\n WHERE user_id = '\" . intval($bidderid) . \"'\n\t\t\t\t\tAND project_id = '\" . intval($id) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n // this bidder already placed a proxy bid at some point .. is this new proxy bid higher? if so, place it!\n $resproxy = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($resproxy['maxamount'] < $bidamount)\n {\n DEBUG(\"SQL: UPDATE \" . DB_PREFIX . \"proxybid with proxy bid amount $bidamount for User ID: $bidderid\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n // update existing proxybid\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"proxybid\n SET maxamount = '\" . sprintf(\"%01.2f\", $bidamount) . \"',\n date_added = '\" . DATETIME24H . \"'\n WHERE user_id = '\" . intval($bidderid) . \"'\n\t\t\t\t\t\t\tAND project_id = '\" . intval($id) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // inform bidder of proxy bid error (lower proxy bid being placed for same auction)\n if ($showerrormessages)\n {\n print_notice('{_cannot_bid_lower_than_original_proxy_amount} ' . $ilance->currency->format($resproxy['maxamount'], $resexpiry['currencyid']), '{_it_has_been_detected_that_you_have_already_placed_a_higher_proxy_bid}', HTTP_SERVER . $ilpage['rfp'] . '?cmd=bid&amp;id=' . $id . '&amp;state=product', '{_back}');\n exit();\n }\n else\n {\n return false;\n }\n }\n }\n else\n {\n DEBUG(\"SQL: INSERT INTO \" . DB_PREFIX . \"proxybid with proxy bid amount $bidamount for User ID: $bidderid\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n // bidder wishes to enter a new maximum highest bid for proxy\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"proxybid\n (id, project_id, user_id, maxamount, date_added)\n VALUES(\n NULL,\n '\" . intval($id) . \"',\n '\" . intval($bidderid) . \"',\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\n '\" . DATETIME24H . \"')\n \", 0, null, __FILE__, __LINE__);\n $proxybidid = $ilance->db->insert_id();\n }\n $sqlbids = $ilance->db->query(\"\n SELECT COUNT(*) AS bids\n FROM \" . DB_PREFIX . \"project_bids\n WHERE project_id = '\" . intval($id) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sqlbids) > 0)\n {\n $resbids = $ilance->db->fetch_array($sqlbids, DB_ASSOC);\n\t\t\t\t// #### no bids placed #########################\n if ($resbids['bids'] == 0)\n {\n DEBUG(\"No bids currently placed for this auction\", 'NOTICE');\n // #### reserve price enabled ##########\n if ($reserveprice > 0)\n {\n DEBUG(\"Reserve price exists: $reserveprice\", 'NOTICE');\n // when enabled, any bid placed that is lower than the reserve price\n // will be placed at the rate of the actual bid \n // this will get the bids rolling up to the reserve amount bypassing the increment logic.\n // side note: in this situation, this is the first bid being placed.\n if ($bidamount >= $reserveprice)\n {\n DEBUG(\"Reserve price has been met ($reserveprice); set the bid amount price ($bidamount) as reserve: $reserveprice\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"BID: $reserveprice\", 'NOTICE');\n \n $bidamount = $reserveprice;\n }\n else\n {\n DEBUG(\"Reserve price: $reserveprice has not been met\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"BID: $bidamount\", 'NOTICE');\n }\n }\n // #### reserve price disabled #########\n else \n {\n DEBUG(\"Reserve price disabled\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"BID: $minimumbid\", 'NOTICE');\n \n // when reserve price is inactive, the bid placed will adhere to the admin defined increment logic for the bids\n // which is basically the minimum bid amount passed to this function\n // side note: in this situation, this is the first bid being placed.\n $bidamount = $minimumbid;\n }\n }\n\t\t\t\t// #### one or more bids placed ################\n else if ($resbids['bids'] > 0)\n {\n DEBUG(\"Auction has $resbids[bids] bids currently placed\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n // #### reserve price enabled ##########\n if ($reserveprice > 0)\n {\n DEBUG(\"Reserve price exists: $reserveprice\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n if ($bidamount == $reserveprice)\n {\n DEBUG(\"Reserve price has been met: $reserveprice; set bid amount: $bidamount as reserve price: $reserveprice\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n \n $bidamount = $reserveprice;\n DEBUG(\"BID: $bidamount\", 'NOTICE');\n }\n else if ($bidamount > $reserveprice)\n {\n DEBUG(\"Reserve price has been met; bid being placed: $bidamount is higher than our reserve price ($reserveprice)\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n // if we have a high proxy bid, and if our bid amount is higher than the proxy bid, and if the highest proxy + increment <= bid amount\n // 310.01 > 0 and 360.00 > 310.01 and 320.01 <= 360.00\n // 360.00 > 0 and 330.01 > 360.00 and 370.00 <= 330.01\n if ($highestproxy > 0 AND $bidamount > $highestproxy AND $this->fetch_minimum_bid($highestproxy, $resexpiry['cid']) <= $bidamount)\n {\n\t\t\t\t\t\t\t\tif ($highestproxyuserid != $bidderid)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($highestproxy > $reserveprice)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$nextamount = $this->fetch_minimum_bid($highestproxy, $resexpiry['cid']);\n\t\t\t\t\t\t\t\t\t}\n\t\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$nextamount = $this->fetch_minimum_bid($reserveprice, $resexpiry['cid']);\n\t\t\t\t\t\t\t\t\t\t//$nextamount = $reserveprice;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n else\n {\n \tif ($highestproxy < $reserveprice)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//$nextamount = $this->fetch_minimum_bid($highestproxy, $resexpiry['cid']);\n\t\t\t\t\t\t\t\t\t\t$nextamount = $reserveprice;\n\t\t\t\t\t\t\t\t\t}\n\t\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\tif ($showerrormessages)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\trefresh($ilpage['merch'] . '?id=' . $id);\n\t\t\t\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n }\n DEBUG(\"Next Bid + Increment $nextamount is <= proxy bid $bidamount\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n $bidamount = $nextamount;\n DEBUG(\"BID: $bidamount\", 'NOTICE');\n }\n else\n {\n DEBUG(\"Higher proxy bid exists $highestproxy by user id: $highestproxyuserid, and this bid: $bidamount by user id: $bidderid\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n if ($highestproxyuserid != $bidderid)\n {\n DEBUG(\"Highest proxy bid user id: $highestproxyuserid ($highestproxy) is not the same bidder as user id: $bidderid ($bidamount) so we'll place the bid without the increment logic as it's much greater and will get the bids moving faster\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n }\n else\n {\n DEBUG(\"Highest proxy bid user id: $highestproxyuserid ($highestproxy) is not the same bidder as user id: $bidder ($bidamount) so we'll place the bid a minimum bid instead\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n if ($showerrormessages)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\trefresh($ilpage['merch'] . '?id=' . $id);\n\t\t\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t\t\t}\n\t\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\treturn true;\n\t\t\t\t\t\t\t\t\t}\n }\n DEBUG(\"BID: $bidamount\", 'NOTICE');\n }\n }\n else\n {\n DEBUG(\"Reserve price has not been met\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"BID: $bidamount\", 'NOTICE');\n }\n }\n\t\t\t\t\t// #### reserve price disabled #########\n\t\t\t\t\telse \n {\n DEBUG(\"Reserve price is disabled\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n if ($bidamount > $highestproxy)\n {\n DEBUG(\"Proxy bid amount being placed: $bidamount is greater than highest proxy: $highestproxy\", 'NOTICE');\n DEBUG(\"Category ID: #$resexpiry[cid]\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n $nextamount = $this->fetch_minimum_bid($highestproxy, $resexpiry['cid']);\n if ($nextamount >= $bidamount)\n {\n DEBUG(\"Next Bid + Bid Increment (in this category) $nextamount is >= to proxy bid $bidamount\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n \tif ($highestproxyuserid == $bidderid)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($showerrormessages)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\trefresh($ilpage['merch'] . '?id=' . $id);\n\t\t\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t\t\t}\n\t\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\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n }\n else\n {\n DEBUG(\"Next Bid + Increment $nextamount is < proxy bid $bidamount\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n if ($highestproxyuserid != $bidderid)\n {\n DEBUG(\"Highest proxy bid user id: $highestproxyuserid ($highestproxy) is not the same bidder as user id: $bidderid ($bidamount) so we'll place the bid without the increment logic as it's much greater and will get the bids moving faster\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n \t$bidamount = $nextamount;\n }\n else\n {\n DEBUG(\"Highest proxy bid user id: $highestproxyuserid ($highestproxy) is not the same bidder as user id: $bidderid ($bidamount) so we'll place the bid a minimum bid instead\", 'NOTICE');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n if ($showerrormessages)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\trefresh($ilpage['merch'] . '?id=' . $id);\n\t\t\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t\t\t}\n\t\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\treturn true;\n\t\t\t\t\t\t\t\t\t}\n }\n }\n }\n }\n }\n }\n }\n DEBUG(\"SQL: INSERT INTO \" . DB_PREFIX . \"project_bids bid amount: $bidamount for bidder id $bidderid\", 'NOTICE');\n // insert the next minimum bid for the bidder\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"project_bids\n (bid_id, user_id, project_id, project_user_id, bidamount, qty, date_added, bidstatus, bidstate, state, buyershipcost, buyershipperid)\n VALUES(\n NULL,\n '\" . intval($bidderid) . \"',\n '\" . intval($id) . \"',\n '\" . intval($project_user_id) . \"',\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\n '\" . intval($qty) . \"',\n '\" . DATETIME24H . \"',\n 'placed',\n '',\n 'product',\n\t\t\t'\" . sprintf(\"%01.2f\", $buyershipcost) . \"',\n\t\t\t'\" . intval($buyershipperid) . \"')\n \", 0, null, __FILE__, __LINE__);\n $this_bid_id = $ilance->db->insert_id();\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"project_realtimebids\n (id, bid_id, user_id, project_id, project_user_id, bidamount, qty, date_added, bidstatus, bidstate, state, buyershipcost, buyershipperid)\n VALUES(\n NULL,\n '\" . intval($this_bid_id) . \"',\n '\" . intval($bidderid) . \"',\n '\" . intval($id) . \"',\n '\" . intval($project_user_id) . \"',\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\n '\" . intval($qty) . \"',\n '\" . DATETIME24H . \"',\n 'placed',\n '',\n 'product',\n\t\t\t'\" . sprintf(\"%01.2f\", $buyershipcost) . \"',\n\t\t\t'\" . intval($buyershipperid) . \"')\n \", 0, null, __FILE__, __LINE__);\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"set_bid_counters() - Set bid counters for this bidder (increases bidstoday + bidsthismonth)\", 'NOTICE');\n // will increase bidstoday and bidsthismonth\n $this->set_bid_counters($bidderid, 'increase');\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"SQL UPDATE project table bids + 1\", 'NOTICE');\n // update bid count and set good until cancelled to off since a bid is placed and counter must go to zero for a winner to be declared\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET bids = bids + 1,\n\t\t\tcurrentprice = '\" . sprintf(\"%01.2f\", $bidamount) . \"',\n\t\t\tgtc = '0'\n WHERE project_id = '\" . intval($id) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n\t\tif ($resexpiry['gtc'] == '1')\n\t\t{\n\t\t\t// this will set a \"date\" so we know if this listing was originally using GTC or not\n\t\t\t// this will also let us put gtc = '1' back on this listing if a bid is retracted in the future\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\tSET gtc_cancelled = '\" . DATETIME24H . \"'\n\t\t\t\tWHERE project_id = '\" . intval($id) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t}\n\t\t// #### do we need to hide buy now price and controls? #########\n\t\t$hidebuynow = false;\n\t\tif ($resexpiry['buynow'] AND $resexpiry['buynow_price'] > 0 AND $resexpiry['buynow_qty'] > 0)\n\t\t{\n\t\t\t$sql = $ilance->db->query(\"\n\t\t\t\tSELECT hidebuynow\n\t\t\t\tFROM \" . DB_PREFIX . \"categories\n\t\t\t\tWHERE cid = '\" . intval($resexpiry['cid']) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t$res = $ilance->db->fetch_array($sql, DB_ASSOC);\n\t\t\tif ($bidamount >= $resexpiry['buynow_price'] OR $res['hidebuynow'])\n\t\t\t{\n\t\t\t\t$hidebuynow = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($resexpiry['reserve'] AND $resexpiry['reserve_price'] > 0)\n\t\t\t\t{\n\t\t\t\t\t// has reserve price been met?\n\t\t\t\t\tif ($bidamount >= $resexpiry['reserve_price'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$hidebuynow = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($bidamount >= $resexpiry['buynow_price'])\n\t\t\t\t\t{\n\t\t\t\t\t\t// bid amount higher than buy now price! hide buy now controls\n\t\t\t\t\t\t$hidebuynow = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// #### determine if we need to hide the buynow price (based on our bids exceeding or equaling the buy now price set)\n\t\tif ($hidebuynow)\n\t\t{\n\t\t\t// hide buy now controls\n\t\t\t$ilance->db->query(\"\n\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\tSET buynow = '0'\n\t\t\t\tWHERE project_id = '\" . intval($id) . \"'\n\t\t\t\tLIMIT 1\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t}\n // #### was this bidder invited? ###############################\n $sql_invites = $ilance->db->query(\"\n SELECT id, project_id, buyer_user_id, seller_user_id, email, name, invite_message, date_of_invite, date_of_bid, date_of_remind, bid_placed\n FROM \" . DB_PREFIX . \"project_invitations\n WHERE project_id = '\" . intval($id) . \"'\n\t\t\t\tAND buyer_user_id = '\" . intval($bidderid) . \"'\n\t\t\t\tAND bid_placed = 'no'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invites) > 0)\n {\n DEBUG(\"------------------------------------------\", 'NOTICE');\n DEBUG(\"It appears this bidder was invited by the seller, update invite table to bid_placed = yes\", 'NOTICE');\n // update invite table \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"project_invitations\n SET bid_placed = 'yes',\n\t\t\t\t date_of_bid = '\" . DATETIME24H . \"'\n WHERE buyer_user_id = '\" . intval($bidderid) . \"'\n\t\t\t\t\tAND project_id = '\" . intval($id) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $url = HTTP_SERVER . $ilpage['merch'] . '?id=' . intval($id);\n // email owner\n $ilance->email->mail = fetch_user('email', $project_user_id);\n $ilance->email->slng = fetch_user_slng($project_user_id);\n $ilance->email->get('invited_bid_placed_buyer');\t\t\n $ilance->email->set(array(\n '{{buyer}}' => fetch_user('username', $project_user_id),\n '{{vendor}}' => fetch_user('username', $bidderid),\n '{{rfp_title}}' => strip_tags($resexpiry['project_title']),\n '{{project_id}}' => $id,\n '{{url}}' => $url,\n ));\n $ilance->email->send();\n }\n // #### AUTOMATED PROXY BIDDER ENGINE ##########################\n if ($ilconfig['productbid_enableproxybid'] AND isset($isproxy) AND $isproxy AND $ilance->categories->useproxybid($_SESSION['ilancedata']['user']['slng'], $resexpiry['cid']))\n {\n DEBUG(\"---------------------------------------------\", 'NOTICE');\n DEBUG(\"PROXY: ILance Proxy Bid Engine \" . ILANCEVERSION . \"\", 'NOTICE');\n DEBUG(\"---------------------------------------------\", 'NOTICE');\n // background proxy bidder init for this last bidder\n // this is where the proxy automation comes into action\n $ilance->bid_proxy->do_proxy_bidder(intval($id), $bidderid, $project_user_id, 1, $bidderid);\n DEBUG(\"---------------------------------------------\", 'NOTICE');\n DEBUG(\"PROXY: Finished\", 'NOTICE');\n DEBUG(\"---------------------------------------------\", 'NOTICE');\n }\n // #### for debug purposes only ################################\n // print_r($GLOBALS['DEBUG']); exit;\n $ilance->watchlist->send_notification($bidderid, 'lowbidnotify', intval($id), $bidamount);\n $ilance->watchlist->send_notification($bidderid, 'highbidnotify', intval($id), $bidamount);\n \n\t\t($apihook = $ilance->api('product_sending_notifications_end')) ? eval($apihook) : false;\n\n $ilance->email->mail = fetch_user('email', $project_user_id);\n $ilance->email->slng = fetch_user_slng($project_user_id);\n $ilance->email->get('product_bid_notification_alert');\t\t\n $ilance->email->set(array(\n \t'{{ownername}}' => fetch_user('username', $project_user_id),\n '{{bidder}}' => fetch_user('username', $bidderid),\n '{{price}}' => $ilance->currency->format($bidamount, $resexpiry['currencyid']),\n '{{p_id}}' => intval($id),\n\t\t\t'{{project_title}}' => strip_tags($resexpiry['project_title']),\n\t\t\t'{{url}}' => HTTP_SERVER . $ilpage['merch'] . '?id=' . intval($id),\n ));\n $ilance->email->send(); \n log_event($_SESSION['ilancedata']['user']['userid'], $ilpage['rfp'], $ilance->GPC['cmd'], $ilance->GPC['subcmd'], $ilance->GPC['id']);\n if ($showerrormessages)\n {\n refresh(HTTP_SERVER . $ilpage['merch'] . '?id=' . $id); // todo: check for seo url instead!\n exit();\n }\n else\n {\n return true;\n }\n }", "function getLowShipmentBid($shipment_id) {\n\t \tAPP::import('Model','Bid');\n\t\t$this->Bid = new Bid();\n\t\treturn (float)$this->Bid->field('Min(bid_price)',array('Bid.shipment_id'=>$shipment_id));\n\t }", "function checkHighestBid($conn, $auction_id, $username, $price) {\r\n $sql = \"SELECT auction_id, highestbid FROM auction\r\n WHERE auction_id = '$auction_id'\";\r\n\r\n $result = $conn->query($sql);\r\n $data = mysqli_fetch_array($result);\r\n if(!$data){\r\n echo \"Error: \".$conn->error.\"<br>\";\r\n }\r\n\r\n //Checks for first bidder of the item\r\n if($price > $data['highestbid']) {\r\n $sql = \"UPDATE auction\r\n SET highestbid = '$price', highestuser = '$username'\r\n WHERE auction_id = '$auction_id'\";\r\n\r\n //Inserts user into auction table\r\n if(!($conn->query($sql) === TRUE)) {\r\n echo \"Error: \" . $sql . \"<br>\" . $conn->error;\r\n }\r\n }\r\n\r\n\r\n }", "public function addBid($auctionID, $userId, $bidPrice, $bidDate){\n\t\t$bidQuery = \"INSERT INTO `bids` (`auctionID`, `userId`, `bidPrice`, `bidDate`) VALUES ('$auctionID', '$userId', '$bidPrice', '$bidDate') ON DUPLICATE KEY UPDATE `bidDate` = '$bidDate', `bidPrice`='$bidPrice'\";\n\t\t//update auction bid count\n\t\t$updateQuery = \"UPDATE `auction` SET bids = bids+1 WHERE auctionID='$auctionID'\";\n\n\t\tif(mysqli_query($this->conn, $bidQuery) && mysqli_query($this->conn, $updateQuery)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function parseBid($bid)\n{\n if (!isset($bid) || !isset($bid->{'product'}) ||\n !isset($bid->{'amount'}) || !isset($bid->{'price'})\n ) {\n return null;\n }\n\n $product = trim(filter_var($bid->{'product'}, FILTER_SANITIZE_STRING));\n if (empty($product) || strlen($product) > 32) {\n return null;\n }\n\n $amount = filter_var($bid->{'amount'}, FILTER_VALIDATE_INT);\n if ($amount == false || $amount <= 0 || $amount > 1000000) {\n return null;\n }\n $price = filter_var($bid->{'price'}, FILTER_VALIDATE_FLOAT);\n if ($price == false || $price <= 0 || $price > 1000000) {\n return null;\n }\n return array($product, $amount, $price);\n}", "public function actionPlaceBid() \n\t{\n\t\t// Validate that the logged in user can to place bids\n\t\t$visitor = XenForo_Visitor::getInstance();\n\t\tif ( ! $visitor->hasPermission('auctions', 'bidOnAuctions'))\n\t\t{\n\t\t\treturn $this->responseNoPermission();\n\t\t}\n\t\t\n\t\t// Parse user input\n\t\t$input = $this->_input->filter(array(\n\t\t\t'id'\t\t=> XenForo_Input::UINT,\n\t\t\t'bid'\t\t=> XenForo_Input::UINT\n\t\t));\n\t\t\n\t\t// Retrieve auction details from database\n\t\t$auctionModel\t= XenForo_Model::create('XenAuction_Model_Auction');\n\t\t$auction \t= $auctionModel->getAuctionById($input['id']);\n\t\t\n\t\t// Prepare bid data to be written\n\t\t$dw = XenForo_DataWriter::create('XenAuction_DataWriter_Bid');\n\t\t$dw->bulkSet(array(\n\t\t\t'auction_id' \t=> $auction['auction_id'],\n\t\t\t'bid_user_id' \t=> $visitor->user_id,\n\t\t\t'amount'\t\t=> $input['bid'],\n\t\t\t'is_buyout'\t\t=> false\n\t\t));\n\t\t\n\t\t// Validate data before writing to DB\n\t\t$dw->preSave();\n\t\tif ($dwErrors = $dw->getErrors())\n\t\t{\n\t\t\treturn $this->responseError($dwErrors);\n\t\t}\n\t\t\n\t\t// Write bid to DB\n\t\t$dw->save();\n\t\t\n\t\t// Prepare auction data to be updated\n\t\t$dw = XenForo_DataWriter::create('XenAuction_DataWriter_Auction');\n\t\t$dw->setExistingData($auction);\n\t\t$dw->set('top_bid', \t$input['bid']);\n\t\t$dw->set('top_bidder',\t$visitor->user_id);\n\t\t$dw->set('bids',\t\t$auction['bids'] + 1);\n\t\t\n\t\t// Validate data before writing to DB\n\t\t$dw->preSave();\n\t\tif ($dwErrors = $dw->getErrors())\n\t\t{\n\t\t\treturn $this->responseError($dwErrors);\n\t\t}\n\t\t\n\t\t// Update auction DB entry\n\t\t$dw->save();\n\t\t\n\t\t// Check if this auction already had a top bidder\n\t\tif ($auction['top_bidder'])\n\t\t{\n\t\t\t// Set fetch conditions to retrieve the old winning bid\n\t\t\t$fetchConditions \t= array(\n\t\t\t\t'bid_user_id' \t=> $auction['top_bidder'],\n\t\t\t\t'auction_id'\t=> $auction['auction_id'],\n\t\t\t\t'amount'\t\t=> $auction['top_bid']\n\t\t\t);\n\t\t\t$fetchOptions \t\t= array(\n\t\t\t\t'join'\t=> XenAuction_Model_Auction::FETCH_BID\n\t\t\t);\n\t\t\t\n\t\t\t// Retrieve old winning bid\n\t\t\t$bid = $auctionModel->getAuction($fetchConditions, $fetchOptions);\n\t\t\t\n\t\t\t// Update status of old winning bid\n\t\t\t$dw = XenForo_DataWriter::create('XenAuction_DataWriter_Bid');\n\t\t\t$dw->setExistingData($bid);\n\t\t\t$dw->set('bid_status', XenAuction_Model_Auction::BID_STATUS_OUTBID);\n\t\t\t$dw->save();\n\t\t\t\n\t\t\t// If the user outbid someone other than himself we need to notify them\n\t\t\tif ($auction['top_bidder'] != $visitor->user_id)\n\t\t\t{\n\t\t\t\t// Retrieve outbid user profile from database\n\t\t\t\t$userModel \t= XenForo_Model::create('XenForo_Model_User');\n\t\t\t\t$outbidUser = $userModel->getUserById($auction['top_bidder']);\n\t\t\t\t\n\t\t\t\t// Set notification phrase variables\n\t\t\t\t$args = array(\n\t\t\t\t\t'top_bidder'\t=> $visitor->username,\n\t\t\t\t\t'link'\t\t\t=> XenForo_Link::buildPublicLink('full:auctions/details', null, array('id' => $auction['auction_id']))\n\t\t\t\t);\n\t\t\t\t$args = array_merge($outbidUser, $args);\n\t\t\t\t$args = array_merge($auction, $args);\n\t\t\t\t$args['top_bid'] = $input['bid'];\n\t\t\t\t\n\t\t\t\t// Parse PM title and message\n\t\t\t\t$title \t\t= new XenForo_Phrase('outbid_on_x', $auction);\n\t\t\t\t$message\t= new XenForo_Phrase('outbid_message', $args);\n\t\t\t\t\n\t\t\t\t// Send notification to outbid user\n\t\t\t\tXenAuction_Helper_Notification::sendNotification($outbidUser['user_id'], $title, $message);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// All done\n\t\treturn $this->responseRedirect(\n\t\t\tXenForo_ControllerResponse_Redirect::SUCCESS,\n\t\t\t$this->getDynamicRedirect()\n\t\t);\n\t}", "public static function checkBidPrice( $input, $auctionId )\n {\n $currentHighestBid = QueryOperator::getAuctionBids( $auctionId, 1 );\n // There exists a highest bid\n if ( !empty( $currentHighestBid ) )\n {\n $currentHighestBid = $currentHighestBid[ 0 ] -> getBidPrice();\n $currentHighestBid += HelperOperator::getIncrement( $currentHighestBid );\n }\n // There do not exist any bids yet\n else\n {\n $currentHighestBid = -1;\n }\n\n // Invalid bid price\n if ( $input < $currentHighestBid )\n {\n SessionOperator::setInputErrors( [ \"bidPrice\" => self::PRICES[ self::INVALID_BID ] . $currentHighestBid ] );\n return false;\n }\n\n // No error\n return true;\n }", "function placebid($bidderid = 0, $proposal = '', $lowbidnotify = 0, $lasthournotify = 0, $subscribed = 0, $id = 0, $project_user_id = 0, $bidamount = 0, $estimate_days = 0, $bidstate = '', $bidamounttype = '', $bidcustom = '', $bidfieldanswers = '', $paymethod = '', $showerrormessages = true)\r\n {\r\n global $ilance, $myapi, $ilpage, $phrase, $ilconfig, $area_title, $page_title;\r\n\r\n $ilance->subscription = construct_object('api.subscription');\r\n $ilance->watchlist = construct_object('api.watchlist');\r\n $ilance->email = construct_dm_object('email', $ilance);\r\n $ilance->bid_fields = construct_object('api.bid_fields');\r\n\r\n if ($ilance->subscription->check_access(intval($bidderid), 'servicebid') == 'no')\r\n {\r\n $area_title = $phrase['_buying_menu_denied_upgrade_subscription'];\r\n $page_title = SITE_NAME . ' - ' . $phrase['_buying_menu_denied_upgrade_subscription'];\r\n \r\n if ($showerrormessages)\r\n {\r\n print_notice($phrase['_access_denied'], $phrase['_your_current_subscription_level_does_not_permit_you_to_use_this_marketplace_resource'].\" <a href='\".$ilpage['subscription'].\"'><strong>\".$phrase['_click_here'].\"</strong></a>\", $ilpage['subscription'], ucwords($phrase['_click_here']), fetch_permission_name('servicebid'));\r\n exit();\r\n }\r\n else\r\n {\r\n return false;\r\n } \r\n }\r\n \r\n $area_title = $phrase['_submitting_bid_proposal'];\r\n $page_title = SITE_NAME . ' ' . $phrase['_submitting_bid_proposal'];\r\n \r\n\t\t$currencyid = fetch_auction('currencyid', $id);\r\n\t\t\r\n $sqlexpiry = $ilance->db->query(\"\r\n SELECT UNIX_TIMESTAMP(date_end) - UNIX_TIMESTAMP('\" . DATETIME24H . \"') AS mytime, status, bids, project_title\r\n FROM \" . DB_PREFIX . \"projects \r\n WHERE project_id = '\" . intval($id) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n if ($ilance->db->num_rows($sqlexpiry) > 0)\r\n {\r\n $resexpiry = $ilance->db->fetch_array($sqlexpiry, DB_ASSOC);\r\n if ($resexpiry['mytime'] < 0 OR $resexpiry['status'] != 'open')\r\n {\r\n $area_title = $phrase['_this_rfp_has_expired_bidding_is_over'];\r\n $page_title = SITE_NAME . ' - ' . $phrase['_this_rfp_has_expired_bidding_is_over'];\r\n \r\n if ($showerrormessages)\r\n {\r\n print_notice($area_title, $phrase['_this_rfp_has_expired_bidding_is_over'], $ilpage['main'], $phrase['_main_menu']);\r\n exit();\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n unset($sqlexpiry, $resexpiry);\r\n \r\n // #### add project to watchlist if applicable #################\r\n $ilance->watchlist->insert_item(intval($bidderid), $id, 'auction', 'n/a', $lowbidnotify, 0, $lasthournotify, $subscribed);\r\n \r\n if (empty($bidcustom))\r\n {\r\n $bidcustom = '';\r\n }\r\n \r\n if (empty($proposal))\r\n {\r\n $proposal = '';\t\r\n }\r\n \r\n // #### determine if listing is realtime auction ###############\r\n $project_details = fetch_auction('project_details', intval($id));\r\n \r\n // #### did we already place a bid on this project? ############\r\n $sql = $ilance->db->query(\"\r\n SELECT bid_id, bidstatus, bidstate\r\n FROM \" . DB_PREFIX . \"project_bids\r\n WHERE user_id = '\" . intval($bidderid) . \"'\r\n AND project_id = '\" . intval($id) . \"'\r\n ORDER BY bid_id DESC\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n if ($ilance->db->num_rows($sql) > 0)\r\n {\r\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\r\n if ($res['bidstatus'] == 'declined' OR $res['bidstate'] == 'retracted')\r\n {\r\n // #### insert bid proposal ####################\r\n $ilance->db->query(\"\r\n INSERT INTO \" . DB_PREFIX . \"project_bids\r\n (bid_id, user_id, project_id, project_user_id, proposal, bidamount, estimate_days, date_added, bidstatus, bidstate, bidamounttype, bidcustom, state, winnermarkedaspaidmethod)\r\n VALUES(\r\n NULL,\r\n '\" . intval($bidderid) . \"',\r\n '\" . intval($id) . \"',\r\n '\" . intval($project_user_id) . \"',\r\n '\" . $ilance->db->escape_string($proposal) . \"',\r\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\r\n '\" . intval($estimate_days) . \"',\r\n '\" . DATETIME24H . \"',\r\n 'placed',\r\n '\" . $ilance->db->escape_string($bidstate) . \"',\r\n '\" . $ilance->db->escape_string($bidamounttype) . \"',\r\n '\" . $ilance->db->escape_string($bidcustom) . \"',\r\n 'service',\r\n\t\t\t\t\t'\" . $ilance->db->escape_string($paymethod) . \"')\r\n \", 0, null, __FILE__, __LINE__);\r\n $this_bid_id = $ilance->db->insert_id();\r\n \r\n // insert realtime bid proposal\r\n $ilance->db->query(\"\r\n INSERT INTO \" . DB_PREFIX . \"project_realtimebids\r\n (id, bid_id, user_id, project_id, project_user_id, proposal, bidamount, estimate_days, date_added, bidstatus, bidstate, bidamounttype, bidcustom, state, winnermarkedaspaidmethod)\r\n VALUES(\r\n NULL,\r\n '\" . intval($this_bid_id) . \"',\r\n '\" . intval($bidderid) . \"',\r\n '\" . intval($id) . \"',\r\n '\" . intval($project_user_id) . \"',\r\n '\" . $ilance->db->escape_string($proposal) . \"',\r\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\r\n '\" . intval($estimate_days) . \"',\r\n '\" . DATETIME24H . \"',\r\n 'placed',\r\n '\" . $ilance->db->escape_string($bidstate) . \"',\r\n '\" . $ilance->db->escape_string($bidamounttype) . \"',\r\n '\" . $ilance->db->escape_string($bidcustom) . \"',\r\n 'service',\r\n\t\t\t\t\t'\" . $ilance->db->escape_string($paymethod) . \"')\r\n \", 0, null, __FILE__, __LINE__); \r\n \r\n // update bid count for auction\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"projects\r\n SET bids = bids + 1\r\n WHERE project_id = '\" . intval($id) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // will increase bidstoday and bidsthismonth for the user placing a bid\r\n $this->set_bid_counters(intval($bidderid), 'increase');\r\n }\r\n else\r\n {\r\n // update/revise existing bid amount placed\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"project_bids\r\n SET proposal = '\" . $ilance->db->escape_string($proposal) . \"',\r\n bidamount = '\" . sprintf(\"%01.2f\", $bidamount) . \"',\r\n estimate_days = '\" . intval($estimate_days) . \"',\r\n bidamounttype = '\" . $ilance->db->escape_string($bidamounttype) . \"',\r\n bidcustom = '\" . $ilance->db->escape_string($bidcustom) . \"',\r\n\t\t\t\t\twinnermarkedaspaidmethod = '\" . $ilance->db->escape_string($paymethod) . \"'\r\n WHERE bid_id = '\" . $res['bid_id'] . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // make sure our realtime applet has some live bid history info\r\n $ilance->db->query(\"\r\n INSERT INTO \" . DB_PREFIX . \"project_realtimebids\r\n (id, bid_id, user_id, project_id, project_user_id, proposal, bidamount, estimate_days, date_added, bidstatus, bidstate, bidamounttype, bidcustom, state, winnermarkedaspaidmethod)\r\n VALUES(\r\n NULL,\r\n '\" . $res['bid_id'] . \"',\r\n '\" . intval($bidderid) . \"',\r\n '\" . intval($id) . \"',\r\n '\" . intval($project_user_id) . \"',\r\n '\" . $ilance->db->escape_string($proposal) . \"',\r\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\r\n '\" . intval($estimate_days) . \"',\r\n '\" . DATETIME24H . \"',\r\n 'placed',\r\n '\".$ilance->db->escape_string($bidstate) . \"',\r\n '\".$ilance->db->escape_string($bidamounttype) . \"',\r\n '\".$ilance->db->escape_string($bidcustom) . \"',\r\n 'service',\r\n\t\t\t\t\t'\" . $ilance->db->escape_string($paymethod) . \"')\r\n \", 0, null, __FILE__, __LINE__); \r\n \r\n $this_bid_id = $res['bid_id'];\r\n }\r\n }\r\n \r\n\t\t// #### brand new bid proposal #################################\r\n\t\telse\r\n { \r\n // #### insert bid proposal ############################\r\n $ilance->db->query(\"\r\n INSERT INTO \" . DB_PREFIX . \"project_bids\r\n (bid_id, user_id, project_id, project_user_id, proposal, bidamount, estimate_days, date_added, bidstatus, bidstate, bidamounttype, bidcustom, state, winnermarkedaspaidmethod)\r\n VALUES(\r\n NULL,\r\n '\" . intval($bidderid) . \"',\r\n '\" . intval($id) . \"',\r\n '\" . intval($project_user_id) . \"',\r\n '\" . $ilance->db->escape_string($proposal) . \"',\r\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\r\n '\" . intval($estimate_days) . \"',\r\n '\" . DATETIME24H . \"',\r\n 'placed',\r\n '\" . $ilance->db->escape_string($bidstate) . \"',\r\n '\" . $ilance->db->escape_string($bidamounttype) . \"',\r\n '\" . $ilance->db->escape_string($bidcustom) . \"',\r\n 'service',\r\n\t\t\t\t'\" . $ilance->db->escape_string($paymethod) . \"')\r\n \", 0, null, __FILE__, __LINE__);\r\n $this_bid_id = $ilance->db->insert_id();\r\n \r\n // #### make sure our realtime applet has some live bid history info\r\n $ilance->db->query(\"\r\n INSERT INTO \" . DB_PREFIX . \"project_realtimebids\r\n (id, bid_id, user_id, project_id, project_user_id, proposal, bidamount, estimate_days, date_added, bidstatus, bidstate, bidamounttype, bidcustom, state, winnermarkedaspaidmethod)\r\n VALUES(\r\n NULL,\r\n '\" . $this_bid_id . \"',\r\n '\" . intval($bidderid) . \"',\r\n '\" . intval($id) . \"',\r\n '\" . intval($project_user_id) . \"',\r\n '\" . $ilance->db->escape_string($proposal) . \"',\r\n '\" . sprintf(\"%01.2f\", $bidamount) . \"',\r\n '\" . intval($estimate_days) . \"',\r\n '\" . DATETIME24H . \"',\r\n 'placed',\r\n '\" . $ilance->db->escape_string($bidstate) . \"',\r\n '\" . $ilance->db->escape_string($bidamounttype) . \"',\r\n '\" . $ilance->db->escape_string($bidcustom) . \"',\r\n 'service',\r\n\t\t\t\t'\" . $ilance->db->escape_string($paymethod) . \"')\r\n \", 0, null, __FILE__, __LINE__); \r\n \r\n // #### update bid count for auction\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"projects\r\n SET bids = bids + 1\r\n WHERE project_id = '\" . intval($id) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // will increase bidstoday and bidsthismonth\r\n $this->set_bid_counters(intval($bidderid), 'increase');\r\n \r\n // was this service provider invited?\r\n $sql_invites = $ilance->db->query(\"\r\n SELECT *\r\n FROM \" . DB_PREFIX . \"project_invitations\r\n WHERE project_id = '\" . intval($id) . \"'\r\n AND seller_user_id = '\" . intval($bidderid) . \"'\r\n AND bid_placed = 'no'\r\n \", 0, null, __FILE__, __LINE__);\r\n if ($ilance->db->num_rows($sql_invites) > 0)\r\n {\r\n // update invitations with bid placed for invited service provider\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"project_invitations\r\n SET bid_placed = 'yes',\r\n date_of_bid = '\" . DATETIME24H . \"'\r\n WHERE seller_user_id = '\" . intval($bidderid) . \"'\r\n AND project_id = '\" . intval($id) . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n $url = HTTP_SERVER . $ilpage['rfp'] . '?id=' . intval($id);\r\n \r\n // email user\r\n $ilance->email->mail = fetch_user('email', $project_user_id);\r\n $ilance->email->slng = fetch_user_slng($project_user_id);\r\n $ilance->email->get('invited_bid_placed_buyer');\t\t\r\n $ilance->email->set(array(\r\n '{{buyer}}' => fetch_user('username', $project_user_id),\r\n '{{vendor}}' => fetch_user('username', $bidderid),\r\n '{{rfp_title}}' => fetch_auction('project_title', intval($id)),\r\n '{{project_id}}' => intval($id),\r\n '{{url}}' => $url,\r\n )); \r\n $ilance->email->send();\r\n }\r\n }\r\n \r\n // #### capture custom bid fields ######################\r\n $ilance->bid_fields->process_custom_bid_fields($bidfieldanswers, intval($id), $this_bid_id);\r\n \r\n // #### lower bid notification bulk email sender #######\r\n $ilance->watchlist->send_notification(intval($bidderid), 'lowbidnotify', intval($id), $bidamount);\r\n \r\n $ilance->email->mail = fetch_user('email', $project_user_id);\r\n $ilance->email->slng = fetch_user_slng($project_user_id);\r\n $ilance->email->get('bid_notification_alert');\t\t\r\n $ilance->email->set(array(\r\n '{{provider}}' => fetch_user('username', $bidderid),\r\n '{{price}}' => $ilance->currency->format($bidamount, $currencyid),\r\n '{{p_id}}' => intval($id),\r\n\t\t\t'{{project_title}}' => strip_tags($resexpiry['project_title']),\r\n\t\t\t'{{bids}}' => $resexpiry['bids'],\r\n ));\r\n $ilance->email->send();\r\n \r\n if ($showerrormessages)\r\n {\r\n // todo: detect seo\r\n refresh($ilpage['rfp'] . '?id=' . intval($id));\r\n exit();\r\n }\r\n\t\t\r\n return true;\r\n }", "public static function fake_bid( $bid_id ) {\n global $wpdb;\n $auction_table = $wpdb->prefix.\"wauc_auction_log\";\n\n return $wpdb->update(\n $auction_table,\n array(\n 'is_fake' => 1,\n ),\n array( 'id' => $bid_id ),\n array(\n '%d',\t// value1\n ),\n array( '%d' )\n );\n }", "public function binance_buy_auto_limit_order_test($id, $quantity, $price, $symbol, $user_id) {\n\n $buy_order_arr = $this->get_buy_order($id);\n $created_date = date(\"Y-m-d G:i:s\");\n if ($buy_order_arr['status'] == 'new') {\n\n //Submit Limit Order to Binance\n //$order = $this->binance_api->place_buy_limit_order($symbol,$quantity,$price,$user_id);\n //$balance = $this->get_balance($symbol,$user_id);\n\n $upd_data = array(\n 'market_value' => $price,\n 'status' => 'submitted',\n 'modified_date' => $this->mongo_db->converToMongodttime($created_date),\n 'buy_date' => $this->mongo_db->converToMongodttime($created_date),\n 'binance_order_id' => '111000',\n );\n\n $this->mongo_db->where(array('_id' => $id));\n $this->mongo_db->set($upd_data);\n\n //Update data in mongoTable\n $this->mongo_db->update('buy_orders');\n\n ////////////////////// Set Notification //////////////////\n $message = \"Buy Limit Order is <b>SUBMITTED</b>\";\n $this->add_notification($id, 'buy', $message, $user_id);\n $message2 = \"<strong>\" . $symbol . \"</strong> Limit Trade is <b style='color:#2ca634'>SUBMITTED</b> for Buy\";\n $this->add_notification_for_app($id, 'trading_alerts', 'medium', $message2, $user_id, $symbol);\n //////////////////////////////////////////////////////////\n\n //////////////////////////////////////////////////////////////////////////////\n ////////////////////////////// Order History Log /////////////////////////////\n $log_msg = \"Buy Limit Order was <b>SUBMITTED</b>\";\n $this->insert_order_history_log($id, $log_msg, 'buy_submitted', $user_id);\n ////////////////////////////// End Order History Log /////////////////////////\n //////////////////////////////////////////////////////////////////////////////\n\n } //End if Order is New\n\n return true;\n\n }", "function max_auction_bid_byuser($user_id, $auction_id){\n\t\tglobal $wpdb;\n\t\t$query = $wpdb->prepare( \"SELECT bid,autobid FROM {$this->yithTable} WHERE user_id = %d AND auction_id = %d ORDER by CAST(bid AS decimal(50,5)) DESC LIMIT 1\", $user_id, $auction_id );\n\t\t$Rmaxbid = $wpdb->get_row( $query );\n\t\t$maxautobid = &$Rmaxbid->autobid;\n\t\t\n\t\t// print_r($Rmaxbid);\n\t\t\n\t\t//if autobid is zero in maxbid price\n\t\tif($maxautobid == 0){\n\t\t\t$qautobid = $wpdb->prepare( \"SELECT max(autobid) FROM {$this->yithTable} WHERE user_id = %d AND auction_id = %d\", $user_id, $auction_id );\n\t\t\t$maxautobid = $wpdb->get_var( $qautobid );\n\t\t}\n\t\t\n\t\t//if maximum autobid is more than simple bid\n\t\tif($maxautobid > 0 && $maxautobid > $Rmaxbid->bid){\n\t\t\treturn ['type'=>'autobid','price'=>$maxautobid];\n\t\t}\n\t\telse{\n\t\t\t$bid = (isset($Rmaxbid->bid))? $Rmaxbid->bid : 0;\n\t\t\treturn ['type'=>'bid','price'=>$bid];\n\t\t}\n\t}", "public function add_bid($product_deal_id) {\n $this->load->model('user_model');\n $this->load->model('product_model');\n $product_deal = $this->product_model->checkProductDealDetail($this->user_id, $product_deal_id);\n $user_data = $this->user_model->getUserWithSession($this->token_id, 'login');\n\n $this->r_data['message'] = 'Deal not added..!';\n if (!$user_data)\n $this->r_data['message'] = 'User not found..!';\n\n if (($product_deal && $product_deal->status == 'win') || ($this->product_model->getDealCompleted($this->user_id, $product_deal_id))) {\n $this->r_data['message'] = 'Deal Completed..!';\n $this->r_data['success'] = 1;\n return $this->r_data;\n }\n\n if ($user_data && $user_data->is_verify && $product_deal) {\n $this->r_data['message'] = 'You have not participate in this deal..!';\n if ($this->product_model->checkDealDateDetail($this->user_id, $product_deal->deal_start_datetime)) {\n $this->r_data['message'] = 'You can try after deal interval time..!';\n $check_bid = $this->product_model->checkBid($this->user_id, $product_deal_id);\n if ($check_bid) {\n $deal = $this->product_model->checkDealDetail($this->user_id, $product_deal_id);\n $bid_data = array(\n 'deal_id' => $deal->deal_id,\n 'product_deal_id' => $product_deal->product_deal_id,\n 'bid_value' => $product_deal->current_deal + $product_deal->deal_increment,\n 'bid_datetime' => DATETIME,\n 'user_id' => $this->user_id\n );\n $this->product_model->insertBid($bid_data);\n\n $this->r_data['data'] = new stdClass();\n $this->r_data['data']->deal = $this->product_model->checkProductDealDetail($this->user_id, $product_deal_id);\n $this->r_data['data']->history = $this->product_model->getDealHistory($product_deal_id);\n $this->r_data['data']->new_history = $this->product_model->getNewDealHistory($product_deal_id);\n $this->r_data['data']->winner = $this->product_model->getWinnerDetail($product_deal_id);\n $this->r_data['success'] = 1;\n $this->r_data['message'] = 'Deal added successfully..!';\n }\n }\n }\n return $this->r_data;\n }", "public function addBread(string $name, float $price, float $weight, string $description, int $baker) : bool {\n $name = mb_strtolower($name);\n $description = mb_strtolower($description);\n $stmt = $this->db->prepare(\" \n INSERT INTO bread (name, price, weight, description, baker_id) \n VALUES (:name, :price, :weight, :des, :baker) \n \");\n $stmt->bindValue(':name',$name);\n $stmt->bindValue(':price',$price);\n $stmt->bindValue(':weight',$weight);\n $stmt->bindValue(':des',$description);\n $stmt->bindValue(':baker',$baker);\n return $stmt->execute();\n }", "function addBid($idPaper, $rate)\r\n {\r\n $found = false;\r\n $bids = $this->findRating();\r\n foreach ($bids as $bid) {\r\n if ($bid->idPaper == $idPaper) {\r\n $bid->rate = $rate;\r\n $found = true;\r\n $bid->save();\r\n }\r\n }\r\n\r\n // Insert if not found\r\n if (!$found) {\r\n $ratingTbl = new Rating();\r\n $rating = $ratingTbl->createRow();\r\n $rating->idPaper = $idPaper;\r\n $rating->id_user = $this->id;\r\n $rating->rate = $rate;\r\n $rating->save();\r\n }\r\n }", "public function getLowestBid()\n {\n return $this->bids->getLowest();\n }", "public function placebid(Request $request, $refId)\n {\n try {\n // Validate the required fields\n $validation = ProductBids::validate(Input::all());\n if ($validation->fails()) {\n return redirect('productview/' . $refId)\n ->with('errors', $validation->errors());\n } else {\n // Decode the Id\n $id = intval($refId, 36) - 1000;\n\n $bid_amount = $request->input('amount');\n // Save the product bid\n $product_bid = new ProductBids;\n $product_bid->product_id = $id;\n $product_bid->email = $request->input('email');\n $product_bid->amount = $bid_amount;\n\n // Notify only if a higher bid is placed\n $highest_bid_amt = ProductBids::where('product_id', $id)->max('amount'); \n if($bid_amount > $highest_bid_amt) {\n $details = [\n 'greeting' => 'Hi',\n 'body' => 'Higher bid is placed for the product',\n 'actionURL' => url('/'),\n 'product_id' => $id,\n 'amount' => $bid_amount\n ];\n\n $product_bids = ProductBids::where('product_id', $id)->get();\n\n // dd($product_bids);\n\n // Send notification\n // Notification::send($product_bids, new HigherBidPlaced($details));\n }\n\n // Now save the bid to database\n $product_bid->save();\n\n // Using Helper Functions\n // if(function_exists('carbon')) {\n // $time = carbon();\n // $toupper = strupper('maninder');\n // }\n\n // Log the save information\n Log::info('Product details for the updated successfully.');\n\n return redirect('productview/' . $refId)\n ->with('message', Messages::PRODUCT_MESSAGE_PLACEBID_SUCCESS);\n }\n } catch (Exception $ex) {\n // Log the error\n Log::error(\"Method: \" . __METHOD__ . \", Line \" . __LINE__ . \": \" . (string)$ex);\n return redirect()->route('/');\n }\n }", "public function bid( $id, $bid, array $data = NULL ){\n return $this->writeToCache( $this->core->bid( $id, $bid, $data ) );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Schedules a `WP_Cron` job to delete expired export files.
function wp_schedule_delete_old_privacy_export_files() { }
[ "function eventorganiser_cron_jobs(){\n\twp_schedule_event(time()+60, 'daily', 'eventorganiser_delete_expired');\n}", "public function deleteFilesScheduledForDeletion() {\n foreach (self::$scheduledForDeletion as $file) {\n try {\n $this->deleteFile($file);\n unset(self::$scheduledForDeletion[$file]);\n }\n catch (\\Exception $e) {\n $this->logger->error('Failed to delete file scheduled for deletion.', [\n $file\n ]);\n }\n }\n }", "function eventorganiser_clear_cron_jobs(){\n\twp_clear_scheduled_hook('eventorganiser_delete_expired');\n}", "function edd_pup_delete_cron_schedule(){\n\n\twp_clear_scheduled_hook( 'edd_pup_cron_clear_queue' );\n\n}", "public function remove_cron(): void\n {\n //$path = BOOKCLUBPATH.DS.'bookclub.cron';\n //exec(\"crontab -r\");\n //unlink($path);\n }", "function CronJob ( )\r\n {\r\n\r\n $path = $this->logs_path;\r\n\r\n if ( ! ( $dir_hndl = opendir ( $this->logs_path ) ) )\r\n {\r\n trigger_error ( E_CRON_JOB, E_USER_WARNING);\r\n return;\r\n }\r\n\r\n while ( $fname = readdir ( $dir_hndl ) )\r\n {\r\n if ( substr( $fname, 0, 1 ) == '.' )\r\n continue;\r\n clearstatcache ( );\r\n $ftm = filemtime ( $path . $fname );\r\n if ( time ( ) - $ftm > $this->logs_timeout )\r\n @unlink ( $path . $fname );\r\n }\r\n\r\n closedir ( $dir_hndl );\r\n\r\n }", "function _performPeriodicCleanup() {\n\t\tif (time() % 100 == 0) {\n\t\t\t$temporaryFileDao =& DAORegistry::getDAO('TemporaryFileDAO');\n\t\t\t$expiredFiles = $temporaryFileDao->getExpiredFiles();\n\t\t\tforeach ($expiredFiles as $expiredFile) {\n\t\t\t\t$this->deleteFile($expiredFile->getId(), $expiredFile->getUserId());\n\t\t\t}\n\t\t}\n\t}", "public function delete_expired()\n {\n if ($files = $this->exists(true)) {\n // Disable all error reporting while deleting\n $ER = error_reporting(0);\n\n foreach ($files as $file) {\n if ($this->expired($file)) {\n // The cache file has already expired, delete it\n if (! unlink($file)) {\n Kohana::log('error', 'Cache: Unable to delete cache file: '.$file);\n }\n }\n }\n\n // Turn on error reporting again\n error_reporting($ER);\n }\n }", "public static function delete_old_export_files() {\r\n\t\tGFCommon::log_debug( __METHOD__ . '(): Starting.' );\r\n\t\t$uploads_folder = RGFormsModel::get_upload_root();\r\n\t\tif ( ! is_dir( $uploads_folder ) || is_link( $uploads_folder ) ) {\r\n\t\t\tGFCommon::log_debug( __METHOD__ . '(): No upload root - bailing.' );\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$export_folder = $uploads_folder . 'export';\r\n\t\tif ( ! is_dir( $export_folder ) || is_link( $export_folder ) ) {\r\n\t\t\tGFCommon::log_debug( __METHOD__ . '(): No export root - bailing.' );\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tGFCommon::log_debug( __METHOD__ . '(): Start deleting old export files' );\r\n\t\tforeach ( GFCommon::glob( '*.csv', $export_folder . DIRECTORY_SEPARATOR ) as $filename ) {\r\n\t\t\t$timestamp = filemtime( $filename );\r\n\t\t\tif ( $timestamp < time() - DAY_IN_SECONDS ) {\r\n\t\t\t\t// Delete files over a day old\r\n\t\t\t\tGFCommon::log_debug( __METHOD__ . '(): Proceeding to delete ' . $filename );\r\n\t\t\t\t$success = unlink( $filename );\r\n\t\t\t\tGFCommon::log_debug( __METHOD__ . '(): Delete successful: ' . ( $success ? 'yes' : 'no' ) );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function removeCronjobs(): void\n {\n $crontab = $this->reader->read();\n $crontab = $this->purgeOldCronjobs($crontab);\n\n $this->writer->write($crontab);\n }", "public static function onCronDailyRun($event)\n {\n\n $controller = $event->sender;\n $controller->stdout(\"Deleting old unassigned files... \");\n\n // Delete unused files\n $deleteTime = time() - (60 * 60 * 24 * 1); // Older than 1 day\n foreach (EmbeddedMedia::find()->andWhere(['<', 'created_at', date('Y-m-d', $deleteTime)])->andWhere('(object_model IS NULL or object_model = \"\")')->all() as $embeddedmedia) {\n $embeddedmedia->delete();\n }\n\n $controller->stdout('done.' . PHP_EOL, \\yii\\helpers\\Console::FG_GREEN);\n }", "public function deleteExpiredFiles()\n {\n $this->_garbageCollector->clean();\n }", "protected function maybe_remove_cronjobs() {\n\t\tif ( function_exists( 'as_next_scheduled_action' ) && as_next_scheduled_action( 'woocommerce_cleanup_draft_orders' ) ) {\n\t\t\tas_unschedule_all_actions( 'woocommerce_cleanup_draft_orders' );\n\t\t}\n\t}", "function cp_check_expired_cron() {\n\tglobal $wpdb, $cp_options;\n\n\t$message = '';\n\t$links_list = '';\n\t$subject = __( 'ClassiPress Ads Expired', APP_TD );\n\n\t// get expired ads\n\t$args = array(\n\t\t'post_type' => APP_POST_TYPE,\n\t\t'post_status' => array( 'publish', 'draft' ),\n\t\t'posts_per_page' => -1,\n\t\t'fields' => 'ids',\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => 'cp_sys_expire_date',\n\t\t\t\t'value' => current_time( 'mysql' ),\n\t\t\t\t'compare' => '<',\n\t\t\t),\n\t\t),\n\t\t'no_found_rows' => true,\n\t);\n\t$expired = new WP_Query( $args );\n\n\tif ( isset( $expired->posts ) && is_array( $expired->posts ) ) {\n\t\tforeach ( $expired->posts as $post_id ) {\n\t\t\twp_update_post( array( 'ID' => $post_id, 'post_status' => CP_POST_STATUS_EXPIRED ) );\n\t\t\t$links_list .= html( 'li', html_link( get_permalink( $post_id ) ) ) . PHP_EOL;\n\t\t}\n\t}\n\n\tif ( empty( $links_list ) ) {\n\t\t$message .= html( 'p', __( 'Your cron job has run successfully. ', APP_TD ) );\n\t\t$message .= html( 'p', __( 'No expired ads were found.', APP_TD ) );\n\t} elseif ( $cp_options->post_prune ) {\n\t\t$message .= html( 'p', __( 'Your cron job has run successfully. ', APP_TD ) );\n\t\t$message .= html( 'p', __( 'The following ads expired and have been taken down from your website: ', APP_TD ) );\n\t\t$message .= html( 'ul', $links_list );\n\t} else {\n\t\t$message .= html( 'p', __( 'Your cron job has run successfully. However, the pruning ads option is turned off so no expired ads were taken down from the website.', APP_TD ) );\n\t}\n\n\t$message .= html( 'p', __( 'Regards,', APP_TD ) );\n\t$message .= html( 'p', __( 'ClassiPress', APP_TD ) );\n\n\tif ( $cp_options->prune_ads_email ) {\n\t\t$email = array( 'to' => get_option( 'admin_email' ), 'subject' => $subject, 'message' => $message );\n\t\t$email = apply_filters( 'cp_email_admin_ads_expired', $email, $expired );\n\n\t\tappthemes_send_email( $email['to'], $email['subject'], $email['message'] );\n\t}\n\n}", "public function cleanupCronTasks()\n {\n $this->logger->info('Running CronManager cleanupCronTasks()');\n $connection = $this->resourceConnection->getConnection();\n $sql = '\n delete from cron_schedule\n where executed_at < date_sub(now(), interval ' . self::MAX_CRON_JOB_RUNTIME_MINUTES . ' minute)\n and status = \\'running\\'\n and job_code like \\'flowcommerce_flowconnector_%\\';\n ';\n $num = $connection->exec($sql);\n $this->logger->info('Cleaned up ' . $num . ' tasks.');\n }", "public static function schedule_clean_expired() {\n\t\tif ( AW()->options()->clean_expired_coupons ) {\n\t\t\tEvents::schedule_event( time() + ( MINUTE_IN_SECONDS * 5 ), 'automatewoo/coupons/clean_expired' );\n\t\t}\n\t}", "function postExpiratorResetCron() {\n postExpiratorTimezoneSetup();\n if (postExpirator_is_wpmu()) {\n\t\tglobal $current_blog;\n wp_clear_scheduled_hook('expirationdate_delete_'.$current_blog->blog_id);\n wp_schedule_event(mktime(date('H'),0,0,date('m'),date('d'),date('Y')), 'postexpiratorminute', 'expirationdate_delete_'.$current_blog->blog_id);\n } else {\n wp_clear_scheduled_hook('expirationdate_delete');\n wp_clear_scheduled_hook('expirationdate_delete_');\n wp_schedule_event(mktime(date('H'),0,0,date('m'),date('d'),date('Y')), 'postexpiratorminute', 'expirationdate_delete');\n\t}\n}", "protected function maybe_create_cronjobs() {\n\t\tif ( function_exists( 'as_next_scheduled_action' ) && false === as_next_scheduled_action( 'woocommerce_cleanup_draft_orders' ) ) {\n\t\t\tas_schedule_recurring_action( strtotime( 'midnight tonight' ), DAY_IN_SECONDS, 'woocommerce_cleanup_draft_orders' );\n\t\t}\n\t}", "private function delete() {\r\n onapp_debug(__METHOD__);\r\n global $_ALIASES;\r\n $this->ssh_connect ( );\r\n\r\n $this->remove_cronjob( urldecode(onapp_get_arg('cron_job')) );\r\n\r\n $_SESSION['message'] = 'CRON_JOB_HAS_BEEN_DELETED_SUCCESSFULLY';\r\n onapp_redirect( ONAPP_BASE_URL . '/' . $_ALIASES['cron_manager'] );\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inject a helper instance with the registered translator
public function injectTranslator($helper) { if (!$helper instanceof TranslatorAwareInterface) { return; } $locator = $this->getServiceLocator(); if (!$locator) { return; } if ($locator->has('MvcTranslator')) { $helper->setTranslator($locator->get('MvcTranslator')); return; } if ($locator->has(TranslatorInterface::class)) { $helper->setTranslator($locator->get(TranslatorInterface::class)); return; } if ($locator->has('Translator')) { $helper->setTranslator($locator->get('Translator')); return; } }
[ "public function registerTranslator()\n {\n $this->registerService('translator', function () {\n $translator = new \\App\\Helper\\Translator($this->container);\n\n return $translator;\n });\n }", "protected function getTemplating_Helper_TranslatorService()\n {\n return $this->services['templating.helper.translator'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\TranslatorHelper($this->get('translator'));\n }", "protected function getTemplating_Helper_TranslatorService()\n {\n return $this->services['templating.helper.translator'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\TranslatorHelper($this->get('translator.default'));\n }", "protected function registerTranslator() {\n $config = $this->config;\n\n $this->container->set('translator', function() use ($config) {\n $translator = null;\n $transFolder = $config->get('dir_translations');\n\n if (is_dir($transFolder)) {\n $transFiles = scandir($transFolder);\n\n if (count($transFiles) > 0) {\n $translator = new Translator($transFiles);\n }\n }\n\n return $translator;\n });\n }", "public function injectTranslator($validator)\r\n {\r\n if ($validator instanceof Translator\\TranslatorAwareInterface) {\r\n $locator = $this->getServiceLocator();\r\n if ($locator && $locator->has('MvcTranslator')) {\r\n $validator->setTranslator($locator->get('MvcTranslator'));\r\n }\r\n }\r\n }", "private function registerRouteTranslator()\n {\n $this->app->singleton('xannn94.localization.translator', function ($app) {\n /** @var \\Illuminate\\Translation\\Translator $translator */\n $translator = $app['translator'];\n\n return new RouteTranslator($translator);\n });\n }", "private function dummyMethodToIncludeTranslatableString(){\n return;\n /** @var TranslatorInterface $translator */\n $translator = $this->container->get('translator');\n if ($translator !== null) {\n $translator->trans('hasFacebook', array(), 'advertise');\n $translator->trans('hasTwitter', array(), 'advertise');\n $translator->trans('hasInstagram', array(), 'advertise');\n }\n unset($translator);\n }", "protected function registerTranslators()\n {\n $this->app->bind('pubsub.events.translators.simple', function () {\n return new SimpleEventMessageTranslator();\n });\n\n $this->app->bind('pubsub.events.translators.topic', function () {\n return new TopicEventMessageTranslator();\n });\n\n $this->app->bind('pubsub.events.translators.schema', function () {\n return new SchemaEventMessageTranslator();\n });\n }", "private function registerRouteTranslator()\n {\n $this->app->singleton('arcanedev.localization.translator', function ($app) {\n /** @var \\Illuminate\\Translation\\Translator $translator */\n $translator = $app['translator'];\n\n return new RouteTranslator($translator);\n });\n }", "protected function registerCommandTranslator()\n {\n $this->app->bind('Domain\\Commander\\Commands\\CommandTranslator',\n 'Domain\\Commander\\Commands\\BaseCommandTranslator');\n }", "public function getTranslator();", "public function initTranslations();", "protected function registerCommandTranslator()\n {\n $this->app->bind('Laracasts\\Commander\\CommandTranslator', 'Laracasts\\Commander\\BasicCommandTranslator');\n }", "private function dummyMethodToIncludeTranslatableString(){\n return;\n /** @var TranslatorInterface $translator */\n $translator = $this->container->get('translator');\n if ($translator !== null) {\n $translator->trans('eventsCount', array(), 'advertise');\n }\n unset($translator);\n }", "function setTranslationManager($inManager);", "public function _initTranslate() {\n// $translator = new Zend_Translate(array('adapter' => 'array', 'content' => '../library/translate', 'locale' => 'pt_BR', 'scan' => Zend_Translate::LOCALE_DIRECTORY));\n// Zend_Validate_Abstract::setDefaultTranslator($translator);\n }", "private function dummyMethodToIncludeTranslatableString(){\n return;\n /** @var TranslatorInterface $translator */\n $translator = $this->container->get('translator');\n if ($translator !== null) {\n $translator->trans('videoCount', array(), 'advertise');\n }\n unset($translator);\n }", "public function _initTranslate()\n {\n $translate = new Zend_Translate(array(\n 'adapter' => 'gettext',\n 'content' => APPLICATION_PATH . '/translations/',\n 'scan' => Zend_Translate::LOCALE_FILENAME,\n 'disableNotices'=> true\n ));\n \n // load in registry\n Zend_Registry::set('Zend_Translate', $translate);\n }", "public function SetTranslator (callable $translator = NULL);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Throws an exception if HTTP headers have already been sent.
protected function throwExceptionIfHeadersAlreadySent() { $file = ''; $line = 0; if (headers_sent($file, $line)) { throw new HeadersAlreadySentException(sprintf('HTTP headers have already been sent in file "%s" at line "%s".', $file, $line)); } }
[ "public static function assumeHeadersNotSent() {\n if (headers_sent($file, $line)) {\n throw new HeadersSentException(tr(\n 'Headers already sent in file %1 on line %2', $file, $line\n ));\n }\n }", "private function send_headers()\n\t{\n\t\tif (!empty(self::$headers[$this->error_code]) && !headers_sent()) {\n\t\t\t header(self::$headers[$this->error_code]);\n\t\t}\t\t\n\t}", "public function testHeadersAlreadySentCheck()\n {\n echo ' ';\n $response = new Response();\n $response->sendHeaders();\n }", "private function check_response_headers() {\n\t\t$code = $this->get_http_response_code($this->response_headers);\n\t\t$this->response_code = (int)$code;\n\t\tif($this->response_code != 200 && $this->die_on_error)\n\t\t\tthrow new Exception('Error: response header is: ' . $this->response_headers[0]);\n\t}", "public function canSetHeader()\n {\n return !headers_sent();\n }", "protected function checkHeadersSent()\n\t{\n\t\treturn headers_sent();\n\t}", "private function assertNoPreviousOutput()\n {\n if (headers_sent()) {\n throw new HttpException('HTTP Error: Headers already sent');\n }\n\n if (ob_get_level() > 0 && ob_get_length() > 0) {\n throw new HttpException('HTTP Error: Output buffer is not empty');\n }\n }", "public function checkHeadersSent () {\n return $this->_headers_sent;\n }", "public static function validate_headers()\n {\n if (!isset($_SERVER['HTTP_AUTHTOKEN'])) {\n // V1.0.0\n coreErrorController::throw_coreError('ERR_NEOCORTEX_REQUIRED_HTTP_HEADER_AUTHTOKEN_NOT_FOUND');\n }\n\n if (!isset($_SERVER[\"HTTP_USER_AGENT\"])) {\n if (!isset($_SERVER[\"HTTP_TOKENAGENT\"])) {\n // V1.0.0\n coreErrorController::throw_coreError('ERR_NEOCORTEX_REQUIRED_HTTP_HEADER_AGENT_NOT_FOUND');\n }\n }\n }", "protected function needs_headers()\n\t{\n\t\treturn $this->has_header && count($this->headers) === 0;\n\t}", "function setHeader($header, $throwException = FALSE) {\n\tif (!headers_sent()) {\n\t\theader($header);\n\t} else {\n\t\tif ($throwException) {\n\t\t\tthrow new Exception(_('Could not send new headers.'));\n\t\t}\n\t}\n}", "public function testHttpRequestHasHeaderWhenNotExists()\n {\n $request = $this->request;\n $this->assertSame(false, $request->hasHeader('Content-Length'));\n }", "public function sendHeaders()\n {\n // Send the 404 header\n header('HTTP/1.1 404 File Not Found');\n }", "public function testHeaderEqualsFailsIfHeaderIsPresentMultipleTimes()\r\n {\r\n $this->assertFailure();\r\n $this->assertions->headerEquals('X-Multiple-Times', 'expected content');\r\n }", "public function sendHeadersOnly()\n {\n $this->sendCookies();\n http_response_code($this->statusCode);\n $this->sendHeaders();\n }", "public function check_headers(){\n\t\t //$headers = $this->input->request_headers();\n\t\t //$this->auth($headers)[\"errors\"];\n\t }", "protected function sendHeaders()\n {\n if (headers_sent()) {\n return;\n }\n\n foreach ($this->headers as $name => $values) {\n header($name . \": \" . implode(', ', $values), false);\n }\n header(sprintf('HTTP/%s %s %s', $this->httpVersion, $this->statusCode, $this->getStatusText()), true, $this->statusCode);\n }", "public function sendHeaders() {\n\t\t// Send the 404 header\n\t\theader('HTTP/1.1 404 File Not Found');\n\t}", "public function useHeaders()\r\n {\r\n return !($this->_preferNotToUseHeaders() && !$this->_isHeadersRequired());\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/! \static Splits a list of email addresses into an array where each entry is an email address.
function &splitList( $emails ) { $emails =& preg_split( "/[,;]/", $emails ); return $emails; }
[ "function &splitList( $emails )\r\n {\r\n $emails =& preg_split( \"/[,;]/\", $emails );\r\n return $emails;\r\n }", "function emailList()\n {\n $emails = preg_split( \"/[,;]/\", $this->EmailNotice );\n return $emails;\n }", "public function emailAddressLines()\n {\n if($this->payer_email){\n $email_parts = explode('@', $this->payer_email);\n return preg_replace('/[^\\da-z]/i', '', $email_parts[0]);\n }\n return [];\n }", "function parse_email($emails)\n{\n $result = array();\n $regex = '/^\\s*[\\\"\\']?\\s*([^\\\"\\']+)?\\s*[\\\"\\']?\\s*<([^@]+@[^>]+)>\\s*$/';\n if (is_string($emails))\n {\n $emails = preg_split('/[,;]\\s{0,}/', $emails);\n foreach ($emails as $email)\n {\n $email = trim($email);\n if (preg_match($regex, $email, $out))\n {\n $email = trim($out[2]);\n $name = trim($out[1]);\n $result[$email] = (!empty($name) ? $name : NULL);\n }\n else if (strpos($email, \"@\") && !preg_match('/\\s/', $email))\n {\n $result[$email] = NULL;\n } else {\n return FALSE;\n }\n }\n } else {\n // Return FALSE if input not string\n return FALSE;\n }\n return $result;\n}", "public static function explodeAddresses($addressList) {\r\n\t\t\t$retlist = array();\r\n\t\t\t$cmplist = array();\r\n\t\t\t$addresses = preg_split(\"/[\\s,;: ]+/\", $addressList);\r\n\t\t\tforeach($addresses as $address) {\r\n\t\t\t\t$address = trim($address);\r\n\t\t\t\tif(filter_var($address, FILTER_VALIDATE_EMAIL) !== false && array_search(strtolower($address), $cmplist) === false ) {\r\n\t\t\t\t\t$retlist[] = $address;\r\n\t\t\t\t\t$cmplist[] = strtolower($address);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $retlist;\r\n\t\t}", "private static function _parseEmail($email) { \n\t\t$parts = explode('@', $email); \n\t\t$domain = array_pop($parts); \n\t\t$user= implode('@', $parts); \n\t\treturn array($user, $domain); \n\t}", "public static function email_split( $email = '' ) {\n\t\t$email .= ' ';\n\t\t$pattern = '/([\\w\\s\\'\\\"]+[\\s]+)?(<)?(([\\w-\\.]+)@((?:[\\w]+\\.)+)([a-zA-Z]{2,4}))?(>)?/';\n\t\tpreg_match( $pattern, $email, $match );\n\t\t$name = ( isset( $match[1] ) ) ? $match[1] : '';\n\t\t$email = ( isset( $match[3] ) ) ? $match[3] : '';\n\t\treturn array( 'name' => trim( $name ), 'email' => trim( $email ) );\n\t}", "public function getValidEmails(array $emailsAddresses);", "private function disposableEmailList()\n {\n return array(\n 'df@mailinator.com',\n 'df@spamevader.com',\n 'temp@tempmail.com',\n 'something@trbvm.com',\n 'anything@boximail.com',\n );\n }", "private function getEmailsFromText($text)\n {\n $emails = preg_split('/\\r\\n|[\\r\\n]|[,; ]/', strtolower($text));\n\n $validEmails = collect();\n foreach($emails as $email) {\n $email = $email;\n $validator = Validator::make(['email' => $email], [\n 'email' => 'email|required'\n ]);\n if (!$validator->fails()) {\n if (!$validEmails->contains($email)) {\n $validEmails->push($email);\n }\n }\n }\n\n return $validEmails;\n }", "public function parseEmails($str) {\n\t\t\n\t\t$str = str_replace(',', ' ', $str); \t\n\t\t$emails = array();\n\t\t\n\t\tforeach(explode(' ', $str) as $value) {\n\t\t\t$email = null;\n\t\t\t\n\t\t\tif(strpos($value, '@')) {\n\t\t\t\t// regular email address\n\t\t\t\t$email = $value; \n\t\t\t\t\n\t\t\t} else if(strpos($value, ':')) {\n\t\t\t\t// reference to email address somewhere else\t\t\t\n\t\t\t\tlist($a, $b) = explode(':', $value); \n\t\t\t\tif(empty($a) || empty($b)) continue; \n\t\t\t\tif($a == 'field') {\n\t\t\t\t\t$email = $this->page->get($b); \t\n\t\t\t\t} else if($a == 'user') {\n\t\t\t\t\t$user = $this->wire('users')->get($b); \n\t\t\t\t\tif($user && $user->id) $email = $user->email;\t\n\t\t\t\t} else {\n\t\t\t\t\t// page ID or page path\n\t\t\t\t\t$page = $this->wire('pages')->get($a); \n\t\t\t\t\tif($page->id) $email = $page->get($b); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// unrecognized\n\t\t\t}\n\t\t\t\n\t\t\tif($email) {\n\t\t\t\t$email = $this->wire('sanitizer')->email($email);\n\t\t\t\tif($email) $emails[] = $email;\n\t\t\t}\n\t\t}\n\t\treturn $emails; \n\t}", "private static function explodeEmailString($email)\n {\n if (preg_match('/^(.*)\\s\\<(.*)\\>/', $email, $matches)) {\n $name = $matches[1];\n $email = $matches[2];\n }\n\n return array(\n 'email' => $email,\n 'name' => isset($name) ? $name : null\n );\n }", "public static function emails($text = '') {\n\t\t$matches = [];\n\t\t$regex = '/' . self::REGEX_MATCH_TAG . '|' . self::REGEX_CHAR_BACK . self::REGEX_EMAIL . '/i';\n\t\tpreg_match_all($regex, $text, $matches);\n\t\t$results = array_filter($matches[2]);\n\t\treturn array_unique($results);\n\t}", "public function providerValidEmailAddress() {\n return array(\n [\"email@example.com\"],\n [\"firstname.lastname@example.com\"],\n [\"email@subdomain.example.com\"],\n [\"firstname+lastname@example.com\"],\n [\"email@[123.123.123.123]\"],\n ['\"email\"@example.com'],\n [\"1234567890@example.com\"],\n [\"email@example-one.com\"],\n [\"_______@example.com\"],\n [\"email@example.name\"],\n [\"email@example.museum\"],\n [\"email@example.co.jp\"],\n [\"firstname-lastname@example.com\"],\n ['much.\"more\\ unusual\"@example.com'],\n );\n }", "function extract_emails($str)\n{\n // a string:\n $regexp = '/([a-z0-9_\\.\\-])+\\@(([a-z0-9\\-])+\\.)+([a-z0-9]{2,4})+/i';\n preg_match_all($regexp, $str, $m);\n \n return isset($m[0]) ? $m[0] : array(); \n}", "function extract_emails($str){\n\t\t$regexp = '/([a-z0-9_\\.\\-])+\\@(([a-z0-9\\-])+\\.)+([a-z0-9]{2,4})+/i';\n\t\tpreg_match_all($regexp, $str, $m);\n\n\t\treturn isset($m[0]) ? $m[0] : array();\n\t}", "public static function extractEmailAddresses($str)\n\t{\n\t\tif (is_array($str))\n\t\t{\n\t\t\t$out = array();\n\n\t\t\t// Filter invalid email addresses\n\t\t\tforeach ($str as $email)\n\t\t\t{\n\t\t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL))\n\t\t\t\t{\n\t\t\t\t\t$out[] = $email;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $out;\n\t\t}\n\n\t\t$str = explode(',', $str);\n\t\t$out = array();\n\n\t\tforeach ($str as $s)\n\t\t{\n\t\t\t$s = trim($s);\n\t\t\tif (preg_match('/(?:([\\'\"]).*?\\1\\s*)?<([^>]*)>/', $s, $match) && filter_var(trim($match[2]), FILTER_VALIDATE_EMAIL))\n\t\t\t{\n\t\t\t\t$out[] = trim($match[2]);\n\t\t\t}\n\t\t\telseif (filter_var($s, FILTER_VALIDATE_EMAIL))\n\t\t\t{\n\t\t\t\t$out[] = $s;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// unrecognized, skip\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}", "public static function extractEmails($text,$options = []) \r\n {\r\n $emails = array();\r\n \r\n $text = str_replace(';',',',$text);\r\n $text = str_replace(' ',',',$text);\r\n $text = str_replace(\"\\r\\n\",',',$text);\r\n $temp_arr = explode(',',$text);\r\n foreach($temp_arr as $email) {\r\n if(trim($email) != '') {\r\n $emails[] = $email;\r\n } \r\n }\r\n \r\n return $emails;\r\n }", "function get_email_list($request) {\n // Get how many emails can current user send.\n $emails = Config::MAX_EMAIL_DELIVERY_COUNT_GUEST;\n if ($request->user) {\n $emails = Config::MAX_EMAIL_DELIVERY_COUNT_USER;\n }\n\n // Get the emails filled in.\n $recipient_count = 0;\n $email_list = array();\n for ($i = 1; $i <= $emails; $i++) {\n if ($request->cookie->find(\"email-$i\")) {\n $recipient_count++;\n $email_list[] = $request->cookie->find((\"email-$i\"));\n }\n }\n \n return $email_list;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Moves the stream pointer to begining
public function rewind() : void { if (! \is_resource($this->resource)) { throw new Exception\UnseekableStreamException('Stream is not resourceable'); } if (! $this->isSeekable()) { throw new Exception\UnseekableStreamException('Stream is not seekable'); } $result = \fseek($this->resource, 0, \SEEK_SET); if (! (0 === $result)) { throw new Exception\UnseekableStreamException('Unable to move the stream pointer to beginning'); } }
[ "public function rewind()\n {\n if($this->isSeekable())\n {\n $this->getStream()->rewind();\n }\n }", "final public function stream_start () {\n\t\t\t$this->log('Stream started');\n\t\t\twhile (feof($this->stream) !== true && $this->refresh === false && $this->connect) { \n\t\t\t\t$this->output(stream_get_line($this->stream, 65535));\n\t\t\t\tif ($this->refresh_checked < time() - self::REFRESH_INTERVAL) {\n\t\t\t\t\t$this->refresh_checked = time();\n\t\t\t\t\t$this->refresh();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($this->stream);\n\t\t\tif ($this->refresh) {\n\t\t\t\t$this->connect();\n\t\t\t\t$this->stream_start();\n\t\t\t}\n\t\t}", "private function stream() {\n\t $i = $this->start;\n\t set_time_limit(0);\n\t while(!feof($this->stream) && $i <= $this->end) {\n\t $bytesToRead = $this->buffer;\n\t if(($i+$bytesToRead) > $this->end) {\n\t $bytesToRead = $this->end - $i + 1;\n\t }\n\t $data = fread($this->stream, $bytesToRead);\n\t echo $data;\n\t flush();\n\t $i += $bytesToRead;\n\t }\n\t }", "public function rewind() : void\n {\n $this->seek(0);\n }", "public function rewind() {\n\t\t// Set the line pointer to 1 as that is the first entry in the data array\n\t\t$this->setFilePos(1);\n\t}", "function seekToStart() : void;", "public function rewind() {\r\n\t\t$this->_position = $this->_startRow;\r\n\t}", "public function rewind() {\n $this->next();\n }", "public function rewind(): void\n {\n if ($this->tell() === 0) {\n return;\n }\n throw new \\BadMethodCallException('Stream is not seekable');\n }", "public function rewind(){}", "public function rewind()\n\t{\n\t\t$this->reset();\n\t\t$this->starts->rewind();\n\t}", "public function reset()\n\t{\n\t\t$this->resetPointer();\n\t\t$this->stream_string = '';\n\t}", "public function start() {\r\t\t\t$this->pointer = 0;\r\t\t}", "public function rewind(): void\n {\n reset($this->payload);\n }", "function FlushStream(){\r\n\r\n // Reset the stream\r\n $this->Stream = '';\r\n }", "function rewind($fp) {}", "function seek(int $_index) : void\r\n {\r\n if ($_index <= $this->_index)\r\n {\r\n $this->_index = $_index;// just jump; don't update stream state (line, ...)\r\n return;\r\n }\r\n // seek forward\r\n $this->_index = min($_index, $this->_size);\r\n }", "public function rewind() : void\n {\n $this->page(1);\n }", "public function rewind()\n {\n // throw new \\RuntimeException('Not possible to rewind a TweetStreamer');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines the relationship with the pizzas
public function getPizzas() { return $this->hasMany(Pizza::className(), ['id' => 'pizza_id']) ->via('pizzaIngredients'); // the relationship needs the junction table to work }
[ "public function relationships();", "public function pizzas()\n {\n return $this->belongsToMany('App\\Models\\Pizza', 'pizza_ingredients');\n }", "private function _set_relationships()\n {\n if(empty($this->_relationships))\n {\n $options = array('has_one','has_many','has_many_pivot');\n foreach($options as $option)\n {\n if(isset($this->{$option}) && !empty($this->{$option}))\n {\n foreach($this->{$option} as $key => $relation)\n {\n $foreign_model = (is_array($relation)) ? $relation[0] : $relation;\n $foreign_model_name = strtolower($foreign_model);\n $this->load->model($foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n if($option=='has_many_pivot')\n {\n $tables = array($this->table, $foreign_table);\n sort($tables);\n $pivot_table = $tables[0].'_'.$tables[1];\n $foreign_key = (is_array($relation)) ? $relation[1] : $this->{$foreign_model_name}->primary;\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n else\n {\n $foreign_key = (is_array($relation)) ? $relation[1] : singular($this->table) . '_id';\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n $this->_relationships[$key] = array('relation' => $option, 'relation_key' => $key, 'foreign_model' => $foreign_model_name, 'foreign_table' => $foreign_table, 'foreign_key' => $foreign_key, 'local_key' => $local_key);\n ($option == 'has_many_pivot') ? ($this->_relationships[$key]['pivot_table'] = $pivot_table) : FALSE;\n\n }\n }\n }\n }\n }", "private function _set_relationships()\n {\n if(empty($this->_relationships))\n {\n $options = array('has_one','has_many');\n foreach($options as $option)\n {\n if(isset($this->{$option}) && !empty($this->{$option}))\n {\n $this->load->helper('inflector');\n foreach($this->{$option} as $key => $relation)\n {\n $foreign_model = (is_array($relation)) ? $relation[0] : $relation;\n $foreign_model_name = strtolower($foreign_model);\n $this->load->model($foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n $foreign_key = (is_array($relation)) ? $relation[1] : singular($this->table) . '_id';\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n $this->_relationships[$key] = array('relation' => $option, 'relation_key' => $key, 'foreign_model' => $foreign_model_name, 'foreign_table' => $foreign_table, 'foreign_key' => $foreign_key, 'local_key' => $local_key);\n }\n }\n }\n }\n }", "public function getPai()\n {\n return $this->hasOne(Pais::className(), ['pai_id' => 'pai_id']);\n }", "public function setupAssociations() \n {\n \n }", "public function getRelationship();", "public function pelado_quimicos(): HasMany\n {\n return $this->hasMany(PeladoQuimico::class);\n }", "public function asignatura_pies()\n \t\t{\n \t\t\treturn $this->hasMany(AsignaturaPie::class);\n \t\t}", "public function getPresensis() {\n\t\treturn $this->hasMany(Presensi::className(), ['jadwal_id' => 'id']);\n\t}", "public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }", "public function parishes()\n {\n return $this->hasMany(Parish::class);\n }", "public function preferito()\n {\n return $this->hasMany('App\\Preferito');\n }", "abstract protected function Relations();", "public function getPessoas()\n {\n return $this->hasMany(Pessoas::className(), ['posto_id' => 'id']);\n }", "public function getIdpratos()\n {\n return $this->hasMany(Prato::className(), ['idprato' => 'idprato'])->viaTable('pratospedido', ['idpedido' => 'idpedido']);\n }", "public function hasManyAssociations(){}", "public function Pulled_aparts(){\n\t\treturn $this->belongsTo(Pulled_aparts::class);\n\t}", "public function paciente ()\n {\n \treturn $this->belongsTo('App\\Paciente');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write chart relationships to XML format.
public function writeChartRelationships(Chart $pChart): string { // Create XML writer $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY); // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); // Relationships $objWriter->startElement('Relationships'); $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); // Write spreadsheet relationship? if ($pChart->hasIncludedSpreadsheet()) { $this->writeRelationship($objWriter, 1, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/package', '../embeddings/' . $pChart->getIndexedFilename() . '.xlsx'); } $objWriter->endElement(); // Return return $objWriter->getData(); }
[ "public function writeChartRelationships(ShapeChart $pChart)\r\n {\r\n // Create XML writer\r\n $objWriter = $this->getXMLWriter();\r\n\r\n // XML header\r\n $objWriter->startDocument('1.0', 'UTF-8', 'yes');\r\n\r\n // Relationships\r\n $objWriter->startElement('Relationships');\r\n $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');\r\n\r\n // Write spreadsheet relationship?\r\n if ($pChart->hasIncludedSpreadsheet()) {\r\n $this->writeRelationship($objWriter, 1, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/package', '../embeddings/' . $pChart->getIndexedFilename() . '.xlsx');\r\n }\r\n\r\n $objWriter->endElement();\r\n\r\n // Return\r\n return $objWriter->getData();\r\n }", "public function writeSlideMasterRelationships()\n\t{\n\t\t// Create XML writer\n\t\t$objWriter = null;\n\t\tif ($this->getParentWriter()->getUseDiskCaching()) {\n\t\t\t$objWriter = new PHPPowerPoint_Shared_XMLWriter(PHPPowerPoint_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());\n\t\t} else {\n\t\t\t$objWriter = new PHPPowerPoint_Shared_XMLWriter(PHPPowerPoint_Shared_XMLWriter::STORAGE_MEMORY);\n\t\t}\n\n\t\t// XML header\n\t\t$objWriter->startDocument('1.0','UTF-8','yes');\n\n\t\t// Relationships\n\t\t$objWriter->startElement('Relationships');\n\t\t$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');\n\n\t\t\t// Write slideLayout relationships\n\t\t\t$layoutPack\t\t= $this->getParentWriter()->getLayoutPack();\n\t\t\tfor ($i = 0; $i < count($layoutPack->getLayouts()); ++$i) {\n\t\t\t\t$this->_writeRelationship(\n\t\t\t\t\t$objWriter,\n\t\t\t\t\t$i + 1,\n\t\t\t\t\t'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout',\n\t\t\t\t\t'../slideLayouts/slideLayout' . ($i + 1) . '.xml'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Relationship theme/theme1.xml\n\t\t\t$this->_writeRelationship(\n\t\t\t\t$objWriter,\n\t\t\t\tcount($layoutPack->getLayouts()) + 1,\n\t\t\t\t'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',\n\t\t\t\t'../theme/theme1.xml'\n\t\t\t);\n\n\t\t$objWriter->endElement();\n\n\t\t// Return\n\t\treturn $objWriter->getData();\n\t}", "public function writePresentationRelationships()\n {\n // Create XML writer\n $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);\n\n // XML header\n $objWriter->startDocument('1.0', 'UTF-8', 'yes');\n\n // Relationships\n $objWriter->startElement('Relationships');\n $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');\n\n // Relation id\n $relationId = 1;\n\n foreach ($this->getPresentation()->getAllMasterSlides() as $oMasterSlide) {\n // Relationship slideMasters/slideMasterX.xml\n $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster', 'slideMasters/slideMaster' . $oMasterSlide->getRelsIndex() . '.xml');\n }\n\n // Add slide theme (only one!)\n // Relationship theme/theme1.xml\n $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme', 'theme/theme1.xml');\n\n // Relationships with slides\n $slideCount = $this->getPresentation()->getSlideCount();\n for ($i = 0; $i < $slideCount; ++$i) {\n $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slides/slide' . ($i + 1) . '.xml');\n }\n\n $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps', 'presProps.xml');\n $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps', 'viewProps.xml');\n $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles', 'tableStyles.xml');\n\n // Comments Authors\n foreach ($this->getPresentation()->getAllSlides() as $oSlide) {\n foreach ($oSlide->getShapeCollection() as $oShape) {\n if (!($oShape instanceof Comment)) {\n continue;\n }\n $oAuthor = $oShape->getAuthor();\n if (!($oAuthor instanceof Author)) {\n continue;\n }\n $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors', 'commentAuthors.xml');\n break 2;\n }\n }\n $objWriter->endElement();\n\n // Return\n return $objWriter->getData();\n }", "public function writeRelationships(Spreadsheet $spreadsheet)\n {\n // Create XML writer\n $objWriter = null;\n if ($this->getParentWriter()->getUseDiskCaching()) {\n $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());\n } else {\n $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);\n }\n\n // XML header\n $objWriter->startDocument('1.0', 'UTF-8', 'yes');\n\n // Relationships\n $objWriter->startElement('Relationships');\n $objWriter->writeAttribute('xmlns', Namespaces::RELATIONSHIPS);\n\n $customPropertyList = $spreadsheet->getProperties()->getCustomProperties();\n if (!empty($customPropertyList)) {\n // Relationship docProps/app.xml\n $this->writeRelationship(\n $objWriter,\n 4,\n Namespaces::RELATIONSHIPS_CUSTOM_PROPERTIES,\n 'docProps/custom.xml'\n );\n }\n\n // Relationship docProps/app.xml\n $this->writeRelationship(\n $objWriter,\n 3,\n Namespaces::RELATIONSHIPS_EXTENDED_PROPERTIES,\n 'docProps/app.xml'\n );\n\n // Relationship docProps/core.xml\n $this->writeRelationship(\n $objWriter,\n 2,\n Namespaces::CORE_PROPERTIES,\n 'docProps/core.xml'\n );\n\n // Relationship xl/workbook.xml\n $this->writeRelationship(\n $objWriter,\n 1,\n Namespaces::OFFICE_DOCUMENT,\n 'xl/workbook.xml'\n );\n // a custom UI in workbook ?\n $target = $spreadsheet->getRibbonXMLData('target');\n if ($spreadsheet->hasRibbon()) {\n $this->writeRelationShip(\n $objWriter,\n 5,\n Namespaces::EXTENSIBILITY,\n is_string($target) ? $target : ''\n );\n }\n\n $objWriter->endElement();\n\n return $objWriter->getData();\n }", "protected function documentRelationsXml() {\n\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n\t\t. '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">'\n\t\t. '<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/>'\n\t\t. '<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>'\n\t\t. '<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>'\n\t\t. '</Relationships>'\n\t\t\t;\n\t}", "protected function workbookRelationsXml() {\n\n\t\t// Xml\n\t\t$sXml = '<?xml version=\"1.0\"?>'\n\t\t\t. '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">'\n\t\t\t. '%s' // workbook sheets\n\t\t\t. '<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>'\n\t\t\t. '</Relationships>'\n\t\t;\n\n\t\t$sSheets = '';\n\t\t$sSheetTemplate = '<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/%s.xml\"/>';\n\t\t$iId = 1;\n\t\t// iterate dom sheets\n\t\tforeach($this->aSheets as $oSheet) {\n\t\t\t/** @var Sheet $oSheet */\n\n\t\t\t// add filename by sheet identifier\n\t\t\t$sSheets .= sprintf($sSheetTemplate, $iId, $oSheet->getIdentifier());\n\n\t\t\t// increase id\n\t\t\t$iId ++;\n\t\t}\n\n\t\t// add Shared Strings\n\t\tif (!empty($this->aSharedStrings)) {\n\t\t\t$sSheets .= sprintf('<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\"/>', $iId+2);\n\t\t}\n\n\t\t// return generated XML\n\t\treturn sprintf($sXml, $sSheets, $iId);\n\t}", "public function getRelationsXMLFile()\n\t{\n\t\t// worksheets\n\t\t$worksheets = '';\n\t\tforeach ($this->worksheets as $worksheet) {\n\t\t\t$worksheets .= '<Relationship Id=\"rId' . $worksheet->getId() . '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/sheet' . $worksheet->getId() . '.xml\"/>';\n\t\t}\n\t\t\n\t\t// shared strings\n\t\t$sharedStrings = '';\n\t\tif ($this->getSharedStrings()->getCount()) {\n\t\t\t$sharedStrings = '<Relationship Id=\"rId' . (count($this->worksheets) + 1) . '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\"/>';\n\t\t}\n\t\t\t\t\n\t\treturn $this->renderXMLTemplate('workbook_xml_rels', array(\n\t\t\t'worksheets' => $worksheets,\n\t\t\t'sharedStrings' => $sharedStrings\n\t\t));\n\t}", "public function writeWorksheetRelationships(ExcelWorksheet $pWorksheet = null, $pWorksheetId = 1)\n {\n // Create XML writer\n $xDoc = null;\n if ($this->getParentWriter()->getUseDiskCaching())\n {\n $xDoc = new ExcelXmlWriter(ExcelXmlWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());\n }\n else\n {\n $xDoc = new ExcelXmlWriter(ExcelXmlWriter::STORAGE_MEMORY);\n }\n \n // XML header\n $xDoc->startDocument('1.0', 'UTF-8', 'yes');\n \n // Relationships\n $xDoc->startElement('Relationships');\n $xDoc->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');\n \n // Write drawing relationships?\n if ($pWorksheet->getDrawingCollection()->count() > 0)\n {\n $this->_writeRelationship($xDoc, 1, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing', '../drawings/drawing' . $pWorksheetId . '.xml');\n }\n \n // Write hyperlink relationships?\n $i = 1;\n foreach ($pWorksheet->getCellCollection() as $cell)\n {\n if ($cell->hasHyperlink() && !$cell->getHyperlink()->isInternal())\n {\n $this->_writeRelationship($xDoc, '_hyperlink_' . $i, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', $cell->getHyperlink()->getUrl(), 'External');\n \n ++$i;\n }\n }\n \n // Write comments relationship?\n $i = 1;\n if (count($pWorksheet->getComments()) > 0)\n {\n $this->_writeRelationship($xDoc, '_comments_vml' . $i, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', '../drawings/vmlDrawing' . $pWorksheetId . '.vml');\n \n $this->_writeRelationship($xDoc, '_comments' . $i, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments', '../comments' . $pWorksheetId . '.xml');\n }\n \n // Write header/footer relationship?\n $i = 1;\n if (count($pWorksheet->getHeaderFooter()->getImages()) > 0)\n {\n $this->_writeRelationship($xDoc, '_headerfooter_vml' . $i, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', '../drawings/vmlDrawingHF' . $pWorksheetId . '.vml');\n }\n \n $xDoc->endElement();\n \n // Return\n return $xDoc->getData();\n }", "public function writePresentationRelationships(PHPPowerPoint $pPHPPowerPoint = null)\n\t{\n\t\t// Create XML writer\n\t\t$objWriter = null;\n\t\tif ($this->getParentWriter()->getUseDiskCaching()) {\n\t\t\t$objWriter = new PHPPowerPoint_Shared_XMLWriter(PHPPowerPoint_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());\n\t\t} else {\n\t\t\t$objWriter = new PHPPowerPoint_Shared_XMLWriter(PHPPowerPoint_Shared_XMLWriter::STORAGE_MEMORY);\n\t\t}\n\n\t\t// XML header\n\t\t$objWriter->startDocument('1.0','UTF-8','yes');\n\n\t\t// Relationships\n\t\t$objWriter->startElement('Relationships');\n\t\t$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');\n\n\t\t\t// Relation id\n\t\t\t$relationId = 1;\n\t\t\t\n\t\t\t// Add slide masters\n\t\t\t$masterSlides = $this->getParentWriter()->getLayoutPack()->getMasterSlides();\n\t\t\tforeach ($masterSlides as $masterSlide) {\n\t\t\t\t// Relationship slideMasters/slideMasterX.xml\n\t\t\t\t$this->_writeRelationship(\n\t\t\t\t\t$objWriter,\n\t\t\t\t\t$relationId++,\n\t\t\t\t\t'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster',\n\t\t\t\t\t'slideMasters/slideMaster' . $masterSlide['masterid'] . '.xml'\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t// Add slide theme (only one!)\n\t\t\t// Relationship theme/theme1.xml\n\t\t\t$this->_writeRelationship(\n\t\t\t\t$objWriter,\n\t\t\t\t$relationId++,\n\t\t\t\t'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',\n\t\t\t\t'theme/theme1.xml'\n\t\t\t);\n\n\t\t\t// Relationships with slides\n\t\t\t$slideCount = $pPHPPowerPoint->getSlideCount();\n\t\t\tfor ($i = 0; $i < $slideCount; ++$i) {\n\t\t\t\t$this->_writeRelationship(\n\t\t\t\t\t$objWriter,\n\t\t\t\t\t($i + $relationId),\n\t\t\t\t\t'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide',\n\t\t\t\t\t'slides/slide' . ($i + 1) . '.xml'\n\t\t\t\t);\n\t\t\t}\n\n\t\t$objWriter->endElement();\n\n\t\t// Return\n\t\treturn $objWriter->getData();\n\t}", "public function writeThemeRelationships($masterId = 1)\n\t{\n\t\t// Create XML writer\n\t\t$objWriter = null;\n\t\tif ($this->getParentWriter()->getUseDiskCaching()) {\n\t\t\t$objWriter = new PHPPowerPoint_Shared_XMLWriter(PHPPowerPoint_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());\n\t\t} else {\n\t\t\t$objWriter = new PHPPowerPoint_Shared_XMLWriter(PHPPowerPoint_Shared_XMLWriter::STORAGE_MEMORY);\n\t\t}\n\n\t\t// Layout pack\n\t\t$layoutPack\t\t= $this->getParentWriter()->getLayoutPack();\n\n\t\t// XML header\n\t\t$objWriter->startDocument('1.0','UTF-8','yes');\n\n\t\t// Relationships\n\t\t$objWriter->startElement('Relationships');\n\t\t$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');\n\n \t\t// Other relationships\n \t\t$otherRelations = $layoutPack->getThemeRelations();\n \t\tforeach ($otherRelations as $otherRelation)\n \t\t{\n \t\t\tif ($otherRelation['masterid'] == $masterId) {\n\t \t\t\t$this->_writeRelationship(\n\t \t\t\t\t$objWriter,\n\t \t\t\t\t$otherRelation['id'],\n\t \t\t\t\t$otherRelation['type'],\n\t \t\t\t\t$otherRelation['target']\n\t \t\t\t);\n \t\t\t}\n \t\t}\n\n\t\t$objWriter->endElement();\n\n\t\t// Return\n\t\treturn $objWriter->getData();\n\t}", "public function writeWorkbookRelationships($workbook = null)\n {\n // Create XML writer\n $xDoc = null;\n if ($this->getParentWriter()->getUseDiskCaching())\n {\n $xDoc = new ExcelXmlWriter(ExcelXmlWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());\n }\n else\n {\n $xDoc = new ExcelXmlWriter(ExcelXmlWriter::STORAGE_MEMORY);\n }\n \n // XML header\n $xDoc->startDocument('1.0', 'UTF-8', 'yes');\n \n // Relationships\n $xDoc->startElement('Relationships');\n $xDoc->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');\n \n // Relationship styles.xml\n $this->_writeRelationship($xDoc, 1, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles', 'styles.xml');\n \n // Relationship theme/theme1.xml\n $this->_writeRelationship($xDoc, 2, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme', 'theme/theme1.xml');\n \n // Relationship sharedStrings.xml\n $this->_writeRelationship($xDoc, 3, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings', 'sharedStrings.xml');\n \n // Relationships with sheets\n $sheetCount = $workbook->getSheetCount();\n for ($i = 0; $i < $sheetCount; ++$i)\n {\n $this->_writeRelationship($xDoc, ($i + 1 + 3), 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet', 'worksheets/sheet' . ($i + 1) . '.xml');\n }\n \n $xDoc->endElement();\n \n // Return\n return $xDoc->getData();\n }", "function generate_relations_xml_out($relations_array)\n{\n\t$out = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"; // print XML header tag to output file\n\t$out .= \"<tables>\\n\";\n\n\tforeach($relations_array as $key => $value)\n\t{\n\t\t$out .= \"\\t<table name=\\\"\" . $key . \"\\\">\\n\";\n\t\tforeach($value as $key_child => $relation) //generate relations in tags named as table children\n\t\t{\n\t\t\t$out .= \"\\t\\t<relation to=\\\"\" . $key_child . \"\\\" relation_type=\\\"\" . $relation . \"\\\" />\\n\";\n\t\t}\n\t\t$out .= \"\\t\\t</table>\\n\";\n\t}\n\t$out .= \"</tables>\\n\";\n\n\treturn $out;\n}", "public function createEmbeddedXmlChart();", "public function toXml($writer, $includeNamespaces = true)\n {\n $writer->startElementNS('fs', 'childAndParentsRelationship', null);\n if ($includeNamespaces) {\n $writer->writeAttributeNs('xmlns', 'gx', null, 'http://gedcomx.org/v1/');\n $writer->writeAttributeNs('xmlns', 'fs', null, 'http://familysearch.org/v1/');\n }\n $this->writeXmlContents($writer);\n $writer->endElement();\n }", "public function writeAssociationSets();", "public function relationships();", "public function createTwoGraphXML()\n {\n $content = $this->prepareXML(getIncludeContents(__DIR__ . DIRECTORY_SEPARATOR . 'templates/two_graph.xml'));\n file_put_contents($this->file_name, $content);\n }", "public function createOneGraphXML()\n {\n $content = $this->prepareXML(getIncludeContents(__DIR__ . DIRECTORY_SEPARATOR . 'templates/one_graph.xml'));\n file_put_contents($this->file_name, $content);\n }", "public function toXML();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Partition capacity. Generated from protobuf field int64 capacity_bytes = 4;
public function getCapacityBytes() { return $this->capacity_bytes; }
[ "public function setCapacityBytes($var)\n {\n GPBUtil::checkInt64($var);\n $this->capacity_bytes = $var;\n\n return $this;\n }", "public function capacity(): int\n {\n return $this->internal->capacity();\n }", "public function getPartitionSizeBytes()\n {\n return $this->partition_size_bytes;\n }", "public function getCapacity ();", "public function getCapacity()\n {\n return $this->capacity;\n }", "public function capacity(): int\n {\n return $this->capacity;\n }", "public function getCapacity() {\r\n\t\treturn $this->_capacity;\r\n\t}", "public function getCapacity()\n {\n return $this->capacity;\n }", "public function getStorageCapacity(): int\n {\n return $this->storageCapacity;\n }", "public function setCapacity($capacity);", "public function remainingCapacity();", "public function getCapacityGb()\n {\n return $this->capacity_gb;\n }", "public function getCapacity()\n {\n return isset($this->source['capacity']) ? $this->source['capacity'] : null;\n }", "public function getCapacity()\n {\n if (array_key_exists(\"capacity\", $this->_propDict)) {\n return $this->_propDict[\"capacity\"];\n } else {\n return null;\n }\n }", "public function getMinimumCapacity()\n {\n return $this->minimum_capacity;\n }", "public function getTotalCapacity()\n {\n return $this->total_capacity;\n }", "public function allocate($capacity){}", "public function allocate(int $capacity) {}", "public function getCapacityRemaining()\n {\n return $this->capacityRemaining;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register extended class used to create base node type
public function registerNodeClass ($baseclass, $extendedclass) {}
[ "public function registerNodeClass($baseclass, $extendedclass)\n {\n }", "protected function registerAdditionalNodeTypesFromConfiguration() {}", "function uopz_extend($class, $parent) {}", "public static function _register()\n {\n self::assignElements([], parent::NAME);\n self::assignAttributes([]);\n }", "function uopz_extend(string $class, string $parent) {}", "public static function register() {\n $called_class = get_called_class();\n\n register_taxonomy(\n $called_class::get_cat_tax(),\n $called_class::$type_string,\n array(\n 'label' => $called_class::$taxonomy_args[ 'cat' ][ 'label' ],\n 'hierarchical' => true,\n 'rewrite' => array( 'slug' => $called_class::$taxonomy_args[ 'cat' ][ 'slug' ] )\n )\n );\n\n register_taxonomy(\n $called_class::get_tag_tax(),\n $called_class::$type_string,\n array(\n 'label' => $called_class::$taxonomy_args[ 'tag' ][ 'label' ],\n 'rewrite' => array( 'slug' => $called_class::$taxonomy_args[ 'tag' ][ 'slug' ] )\n )\n );\n\n register_post_type( $called_class::$type_string, $called_class::$registration_args );\n }", "public static function register_type()\n {\n }", "abstract protected function registerNodeTypePrimaryItem();", "abstract public function register();", "abstract public function registerClasses();", "function register_class()\n\t{\n\t\t\n\t\t// NO LONGER NEEDED\n\t}", "function register_field_type($class)\n {\n }", "function wsf_write_sub_classes($node) {\n global $written_classes;\n $code = \"\";\n if ($node) {\n if ($node->hasAttributes()) {\n // Wrapper element found\n $attrs = $node->attributes;\n $type_name = \"\";\n if($attrs->getNamedItem(WSF_TYPE)) {\n $type_name = $attrs->getNamedItem(WSF_TYPE)->value;\n }\n else if($attrs->getNamedItem(WSF_EXTENSION)) {\n $type_name = $attrs->getNamedItem(WSF_EXTENSION)->value;\n }\n else if($attrs->getNamedItem(WSF_XSI_TYPE)) {\n $type_name = $attrs->getNamedItem(WSF_XSI_TYPE)->value;\n }\n\n // array to hold child elements corresponding to sub classes\n $child_array = array ();\n\n // check if the class was already written \n if(array_key_exists($type_name, $written_classes) && $written_classes[$type_name] == TRUE) {\n return;\n }\n \n if($type_name == WSF_XSD_BASE64 && !$node->hasChildNodes()) {\n //return;\n }\n\n // write the extension code..\n $extension_code = wsf_write_extension($node, $code);\n\n $code = $code . \"class \" . $type_name . $extension_code. \" {\\n\";\n $written_classes[$type_name] = TRUE;\n\n $child_array = array();\n $derived_classes_code = \"\";\n $code .= wsf_write_content_model($node, $child_array, $derived_classes_code);\n\n $code = $code . \"\\n}\\n\\n\";\n // done writing the current class, now go and write the sub classes\n foreach($child_array as $child) {\n $code = $code . wsf_write_sub_classes($child);\n }\n\n $code .= $derived_classes_code;\n }\n // TODO: What about arrays?, ok this is for array api, not class api\n }\n return $code;\n}", "private function registerClasses()\r\n\t{\r\n \t$this->addValidator(self::DEFAULT_VALIDATOR_LABEL, new Validator($this)); //Connect form validator\r\n \t$this->setEntityRepository(new EntityRepository($this));\r\n \t$this->setResponse(new Response($this));\r\n \t$this->setDict(new Dictionary($this)); //Connect dictionary\r\n \t$this->setStore(new Store($this)); //Connect Store\r\n\t\t$this->setBin(new Bin($this)); // Connect Bin\r\n \t$this->setUserService(new UserService($this));\r\n \t$this->setRouter(new Router($this));\r\n }", "function init()\n{\n register_extended_taxonomy(\n 'pcc-role',\n 'pcc-person',\n [\n 'show_in_rest' => false,\n 'required' => true,\n ],\n [\n 'singular' => __('Role', 'pcc-framework'),\n 'plural' => __('Roles', 'pcc-framework'),\n 'slug' => __('role', 'pcc-framework'),\n ]\n );\n}", "function antibody_define_node_type () {\n $content['type'] = array(\n 'name' => 'Antibody',\n 'type' => 'antibody',\n 'description' => 'Antibody description',\n 'has_title' => TRUE,\n 'has_body' => TRUE,\n 'title_label' => 'Title',\n 'body_label' => 'Body',\n 'min_word_count' => '0',\n 'help' => '',\n 'node_options' => \n array(\n 'status' => TRUE,\n 'promote' => FALSE,\n 'sticky' => FALSE,\n 'revision' => FALSE,\n ),\n 'upload' => TRUE,\n 'print_display' => '1',\n 'orig_type' => '',\n 'module' => 'node',\n 'custom' => FALSE,\n 'modified' => FALSE,\n 'locked' => FALSE,\n 'content_profile' => FALSE,\n 'comment' => '2',\n 'comment_default_mode' => '4',\n 'comment_default_order' => '1',\n 'comment_default_per_page' => '50',\n 'comment_controls' => '3',\n 'comment_anonymous' => 0,\n 'comment_subject_field' => '1',\n 'comment_preview' => '1',\n 'comment_form_location' => '0',\n 'print_display_comment' => '0',\n );\n $content['fields'] = array(\n array(\n 'widget_type' => 'nodereference_autocomplete',\n 'label' => 'Gene',\n 'weight' => '',\n 'description' => '',\n 'default_value_widget' => \n array(\n 'field_gene' => \n array(\n array(\n 'nid' => NULL,\n ),\n ),\n ),\n 'default_value_php' => '',\n 'group' => FALSE,\n 'required' => '0',\n 'multiple' => '1',\n 'previous_field' => '',\n 'referenceable_types' => array ('gene' => 'gene'),\n 'field_name' => 'field_gene',\n 'type' => 'nodereference',\n 'module' => 'nodereference',\n 'widget_module' => 'nodereference',\n 'columns' => \n array(\n 'nid' => \n array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => FALSE,\n ),\n ),\n 'default_value' => \n array(\n array(\n 'nid' => NULL,\n ),\n ),\n ),\n array(\n 'widget_type' => 'text_textfield',\n 'label' => 'Source',\n 'weight' => '',\n 'rows' => 1,\n 'description' => 'From what lab can this Antibody be obtained?',\n 'default_value_widget' => \n array(\n 'field_source' => \n array(\n array(\n array(\n 'value' => '',\n ),\n 'value' => '',\n ),\n ),\n ),\n 'default_value_php' => '',\n 'group' => FALSE,\n 'required' => '0',\n 'multiple' => '1',\n 'previous_field' => '',\n 'text_processing' => '0',\n 'max_length' => '',\n 'allowed_values' => '',\n 'allowed_values_php' => '',\n 'field_name' => 'field_source',\n 'type' => 'text',\n 'module' => 'text',\n 'widget_module' => 'text',\n 'columns' => \n array(\n 'value' => \n array(\n 'type' => 'text',\n 'size' => 'big',\n 'not null' => FALSE,\n 'sortable' => TRUE\n )\n )\n )\n );\n $macro = \"\\$content = \" . var_export($content, TRUE) . \";\\n\";\n $form_state['values'] = array(\n 'type_name' => '<create>',\n 'macro' => $macro,\n 'op' => t('Submit')\n );\n drupal_load('module', 'content_copy');\n drupal_execute('content_copy_import_form', $form_state);\n}", "private function add_base_classes() {\n $this->classes[] = 'input-group';\n $this->classes[] = 'wpcsl-' . $this->type;\n }", "public static function register_type() {\n\n\t\tregister_graphql_enum_type(\n\t\t\t'TermNodeIdTypeEnum',\n\t\t\t[\n\t\t\t\t'description' => __( 'The Type of Identifier used to fetch a single resource. Default is \"ID\". To be used along with the \"id\" field.', 'wp-graphql' ),\n\t\t\t\t'values' => self::get_values(),\n\t\t\t]\n\t\t);\n\n\t\t/**\n\t\t * Register a unique Enum per Taxonomy. This allows for granular control\n\t\t * over filtering and customizing the values available per Taxonomy.\n\t\t */\n\t\t$allowed_taxonomies = \\WPGraphQL::get_allowed_taxonomies();\n\t\tif ( ! empty( $allowed_taxonomies ) && is_array( $allowed_taxonomies ) ) {\n\t\t\tforeach ( $allowed_taxonomies as $taxonomy ) {\n\t\t\t\t$taxonomy_object = get_taxonomy( $taxonomy );\n\n\t\t\t\tregister_graphql_enum_type(\n\t\t\t\t\t$taxonomy_object->graphql_single_name . 'IdType',\n\t\t\t\t\t[\n\t\t\t\t\t\t'description' => __( 'The Type of Identifier used to fetch a single resource. Default is ID.', 'wp-graphql' ),\n\t\t\t\t\t\t'values' => self::get_values(),\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t}\n\t\t}\n\n\t}", "function register_custom_taxonomies () {\n\n\t \t\t$this->register_single_custom_taxonomy ( $this->token, $this->singular_label, $this->plural_label, $this->post_types_supported );\n\t \t\t\n\t \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
POPULATE REMOVE SECTIONS hook : czr_remove_section_map
function czr_fn_popul_remove_section_map( $_sections ) { //customizer option array $remove_section = array( 'static_front_page' , 'nav', 'title_tagline', 'tc_page_comments' ); return array_merge( $_sections, $remove_section ); }
[ "function removeSection( $view, $field_name, $field_map_id ) {\n $field = $this->getFieldFromMap($view, $field_name);\n if( $field['field_type'] != 'section' ) {\n $this->addDebug(\"removeSection\", \"Field is not a section: $view-$field_name\", 1);\n return false;\n }\n $id = $field['field_map_id'];\n $res = $this->_zen->db_delete($this->_zen->table_field_map, 'field_map_id', $id);\n $this->_zen->addDebug(\"removeSection\", \"Section deleted[$res]: $view, $field_name\", 3);\n return $res;\n }", "private function remove_sections() {\n\t\t$this->customize->remove_section( 'themes' );\n\t\t$this->customize->remove_section( 'static_front_page' );\n\t}", "public function removeSection($section);", "function remove_sections($wp_customize)\n {\n $wp_customize->remove_section(\"colors\");\n }", "public function removeAllSections()\n {\n $this->sections = array();\n }", "function czr_fn_popul_section_map( $_sections ) {\r\n //declare a var to check wp version >= 4.0\r\n global $wp_version;\r\n $_is_wp_version_before_4_0 = ( ! version_compare( $wp_version, '4.0', '>=' ) ) ? true : false;\r\n\r\n //For nav menus option\r\n $locations = get_registered_nav_menus();\r\n $menus = wp_get_nav_menus();\r\n $num_locations = count( array_keys( $locations ) );\r\n\r\n\r\n $nav_section_desc = sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations, 'customizr' ), number_format_i18n( $num_locations ) );\r\n //adapt the nav section description for v4.3 (menu in the customizer from now on)\r\n if ( version_compare( $wp_version, '4.3', '<' ) ) {\r\n $nav_section_desc .= \"<br/>\" . sprintf( __(\"You can create new menu and edit your menu's content %s.\" , \"customizr\"),\r\n sprintf( '<strong><a href=\"%1$s\" target=\"_blank\" title=\"%3$s\">%2$s &raquo;</a></strong>',\r\n admin_url('nav-menus.php'),\r\n __(\"on the Menus screen in the Appearance section\" , \"customizr\"),\r\n __(\"create/edit menus\", \"customizr\")\r\n )\r\n );\r\n } else {\r\n $nav_section_desc .= \"<br/>\" . sprintf( __(\"You can create new menu and edit your menu's content %s.\" , \"customizr\"),\r\n sprintf( '<strong><a href=\"%1$s\" title=\"%3$s\">%2$s &raquo;</a><strong>',\r\n \"javascript:wp.customize.section('nav').container.find('.customize-section-back').trigger('click'); wp.customize.panel('nav_menus').focus();\",\r\n __(\"in the menu panel\" , \"customizr\"),\r\n __(\"create/edit menus\", \"customizr\")\r\n )\r\n );\r\n }\r\n\r\n if ( ! czr_fn_is_ms() ) {\r\n $nav_section_desc .= \"<br/><br/>\". __( 'If a menu location has no menu assigned to it, a default page menu will be used.', 'customizr');\r\n }\r\n\r\n $_new_sections = array(\r\n /*---------------------------------------------------------------------------------------------\r\n -> PANEL : GLOBAL SETTINGS\r\n ----------------------------------------------------------------------------------------------*/\r\n //the title_tagline section holds the default WP setting for the Site Title and the Tagline\r\n //This section has been previously removed from its initial location and is added back here\r\n 'title_tagline' => array(\r\n 'title' => __( 'Site Identity : Logo, Title, Tagline and Site Icon', 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 7 : 0,\r\n 'panel' => 'tc-global-panel',\r\n 'section_class' => 'CZR_Customize_Sections',\r\n 'ubq_panel' => array(\r\n 'panel' => 'tc-header-panel',\r\n 'priority' => '1'\r\n )\r\n ),\r\n 'skins_sec' => array(\r\n 'title' => __( 'Primary color of the theme' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 1 : 7,\r\n 'description' => __( 'Pick a primary color for the theme' , 'customizr' ),\r\n 'panel' => 'tc-global-panel'\r\n ),\r\n 'fonts_sec' => array(\r\n 'title' => __( 'Fonts' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 40 : 10,\r\n //'description' => __( 'Set up the font global settings' , 'customizr' ),\r\n 'panel' => 'tc-global-panel'\r\n ),\r\n 'socials_sec' => array(\r\n 'title' => __( 'Social links' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 9 : 20,\r\n //'description' => __( 'Set up your social links' , 'customizr' ),\r\n 'panel' => 'tc-global-panel'\r\n ),\r\n 'formatting_sec' => array(\r\n 'title' => __( 'Formatting : links, paragraphs ...' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 22 : 30,\r\n //'description' => __( 'Various links settings' , 'customizr' ),\r\n 'panel' => 'tc-global-panel'\r\n ),\r\n 'images_sec' => array(\r\n 'title' => __( 'Image settings' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 95 : 50,\r\n //'description' => __( 'Various images settings' , 'customizr' ),\r\n 'section_class' => 'CZR_Customize_Sections',\r\n 'panel' => 'tc-global-panel',\r\n 'ubq_panel' => array(\r\n 'panel' => 'tc-content-panel',\r\n 'priority' => '100'\r\n )\r\n ),\r\n 'sliders_sec' => array(\r\n 'title' => __( 'Sliders options' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 96 : 60,\r\n //'description' => __( 'Post authors settings' , 'customizr' ),\r\n 'panel' => 'tc-global-panel'\r\n ),\r\n 'authors_sec' => array(\r\n 'title' => __( 'Authors' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 220 : 70,\r\n //'description' => __( 'Post authors settings' , 'customizr' ),\r\n 'panel' => 'tc-global-panel'\r\n ),\r\n 'smoothscroll_sec' => array(\r\n 'title' => __( 'Smooth Scroll' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 97 : 75,\r\n //'description' => __( 'Smooth Scroll settings' , 'customizr' ),\r\n 'panel' => 'tc-global-panel'\r\n ),\r\n\r\n /*---------------------------------------------------------------------------------------------\r\n -> PANEL : HEADER\r\n ----------------------------------------------------------------------------------------------*/\r\n 'header_layout_sec' => array(\r\n 'title' => $_is_wp_version_before_4_0 ? __( 'Header design and layout', 'customizr' ) : __( 'General design settings', 'customizr' ),\r\n 'priority' => 10,//$_is_wp_version_before_4_0 ? 5 : 20,\r\n 'panel' => 'tc-header-panel'\r\n ),\r\n 'header_desktop_sec' => array(\r\n 'title' => __( 'Design settings for desktop and laptops', 'customizr' ),\r\n 'priority' => 20,\r\n 'panel' => 'tc-header-panel'\r\n ),\r\n 'header_mobile_sec' => array(\r\n 'title' => __( 'Design settings for smartphones and tablets in portrait orientation', 'customizr' ),\r\n 'priority' => 30,\r\n 'panel' => 'tc-header-panel'\r\n ),\r\n 'nav' => array(\r\n 'title' => __( 'Navigation Menus' , 'customizr' ),\r\n 'theme_supports' => 'menus',\r\n 'priority' => 40,//$_is_wp_version_before_4_0 ? 10 : 40,\r\n 'description' => $nav_section_desc,\r\n 'panel' => 'tc-header-panel'\r\n ),\r\n\r\n\r\n /*---------------------------------------------------------------------------------------------\r\n -> PANEL : CONTENT\r\n ----------------------------------------------------------------------------------------------*/\r\n 'frontpage_sec' => array(\r\n 'title' => __( 'Front Page Content' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 12 : 10,\r\n //'description' => __( 'Set up front page options' , 'customizr' ),\r\n 'section_class' => 'CZR_Customize_Sections',\r\n 'panel' => '',//tc-content-panel',\r\n 'active_callback' => 'czr_fn_is_home',\r\n 'ubq_panel' => array(\r\n 'panel' => 'tc-content-panel',\r\n 'priority' => '10'\r\n )\r\n ),\r\n\r\n 'post_layout_sec' => array(\r\n 'title' => __( 'Pages &amp; Posts Layout' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 15 : 15,\r\n //'description' => __( 'Set up layout options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n\r\n 'post_lists_sec' => array(\r\n 'title' => __( 'Post lists : blog, archives, ...' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 16 : 20,\r\n //'description' => __( 'Set up post lists options : blog page, archives like tag or category, search results.' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n 'single_posts_sec' => array(\r\n 'title' => __( 'Single posts' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 17 : 24,\r\n //'description' => __( 'Set up single posts options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n 'single_pages_sec' => array(\r\n 'title' => __( 'Single pages' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 17 : 24,\r\n //'description' => __( 'Set up single pages options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n 'breadcrumb_sec' => array(\r\n 'title' => __( 'Breadcrumb' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 11 : 30,\r\n //'description' => __( 'Set up breadcrumb options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n 'post_metas_sec' => array(\r\n 'title' => __( 'Post metas (category, tags, custom taxonomies)' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 20 : 50,\r\n //'description' => __( 'Set up post metas options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n 'galleries_sec' => array(\r\n 'title' => __( 'Galleries' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 20 : 55,\r\n //'description' => __( 'Set up gallery options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n 'comments_sec' => array(\r\n 'title' => __( 'Comments' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 25 : 60,\r\n //'description' => __( 'Set up comments options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel',\r\n 'section_class' => 'CZR_Customize_Sections',\r\n 'ubq_panel' => array(\r\n 'panel' => 'tc-global-panel',\r\n 'priority' => '100'\r\n )\r\n ),\r\n 'post_navigation_sec' => array(\r\n 'title' => __( 'Post/Page Navigation' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 30 : 65,\r\n //'description' => __( 'Set up post/page navigation options' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n\r\n\r\n /*---------------------------------------------------------------------------------------------\r\n -> PANEL : SIDEBARS\r\n ----------------------------------------------------------------------------------------------*/\r\n 'sidebar_socials_sec' => array(\r\n 'title' => __( 'Socials in Sidebars' , 'customizr' ),\r\n 'priority' => 110,\r\n //'description' => __( 'Set up your social profiles links in the sidebar(s).' , 'customizr' ),\r\n 'panel' => 'tc-content-panel'\r\n ),\r\n /*---------------------------------------------------------------------------------------------\r\n -> PANEL : FOOTER\r\n ----------------------------------------------------------------------------------------------*/\r\n 'footer_global_sec' => array(\r\n 'title' => __( 'Footer global settings' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 40 : 10,\r\n //'description' => __( 'Set up footer global options' , 'customizr' ),\r\n 'panel' => 'tc-footer-panel'\r\n ),\r\n\r\n\r\n /*---------------------------------------------------------------------------------------------\r\n -> PANEL : ADVANCED\r\n ----------------------------------------------------------------------------------------------*/\r\n 'custom_sec' => array(\r\n 'title' => __( 'Custom CSS' , 'customizr' ),\r\n 'priority' => $_is_wp_version_before_4_0 ? 100 : 10,\r\n 'panel' => 'tc-advanced-panel'\r\n ),\r\n 'performances_sec' => array(\r\n 'title' => __( 'Website Performances' , 'customizr' ),\r\n 'priority' => 20,\r\n //'description' => __( 'On the web, speed is key ! Improve the load time of your pages with those options.' , 'customizr' ),\r\n 'panel' => 'tc-advanced-panel'\r\n ),\r\n 'placeholder_sec' => array(\r\n 'title' => __( 'Front-end placeholders and help blocks' , 'customizr' ),\r\n 'priority' => 30,\r\n 'panel' => 'tc-advanced-panel'\r\n ),\r\n 'extresources_sec' => array(\r\n 'title' => __( 'Front-end Icons (Font Awesome)' , 'customizr' ),\r\n 'priority' => 40,\r\n 'panel' => 'tc-advanced-panel'\r\n ),\r\n 'responsive_sec' => array(\r\n 'title' => __( 'Mobile devices' , 'customizr' ),\r\n 'priority' => 40,\r\n 'panel' => 'tc-advanced-panel'\r\n ),\r\n 'style_sec' => array(\r\n 'title' => __( 'Theme style' , 'customizr' ),\r\n 'priority' => 40,\r\n 'panel' => 'tc-advanced-panel'\r\n )\r\n );\r\n\r\n if ( czr_fn_is_pro_section_on() ) {\r\n $_new_sections = array_merge( $_new_sections, array(\r\n /*---------------------------------------------------------------------------------------------\r\n -> SECTION : GO-PRO\r\n ----------------------------------------------------------------------------------------------*/\r\n 'go_pro_sec' => array(\r\n 'title' => esc_html__( 'Upgrade to Customizr Pro', 'customizr' ),\r\n 'pro_subtitle' => esc_html__( 'What are the benefits of Customizr Pro ?' , 'customizr'),\r\n 'pro_doc_url' => esc_url( 'docs.presscustomizr.com/article/264-what-are-the-benefits-of-customizr-pro-compared-to-other-wordpress-themes' ),\r\n 'pro_text' => esc_html__( 'Go Pro', 'customizr' ),\r\n 'pro_url' => sprintf('%scustomizr-pro/', CZR_WEBSITE ),\r\n 'priority' => 0,\r\n 'section_class' => 'CZR_Customize_Section_Pro',\r\n 'active_callback' => 'czr_fn_pro_section_active_cb'\r\n ),\r\n ) );\r\n }\r\n\r\n return array_merge( $_sections, $_new_sections );\r\n}", "function remove_dynamic_section( $section ) {\n\t\t\tif ( isset( $this->parent->field_types[ $this->field_name ] ) ) {\n\t\t\t\t$section = array();\n\t\t\t}\n\n\t\t\treturn $section;\n\t\t}", "public function clearSections()\n\t{\n\t\t$this->collSections = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function remove_sections($slugs) {\n self::$Sections = array_diff_key(self::$Sections, array_flip($slugs));\n }", "public function remove_section($id)\n {\n }", "public function remove($section, $key = null);", "public function sectionClear(){\n $this->clearStack();\n $this->clearValues();\n }", "public function removeKey(string $key, string $section): void;", "function customizer_sections( $wp_customize ) {\n\t$wp_customize->remove_section( 'static_front_page' );\n\t$wp_customize->remove_section( 'custom_css' );\n}", "protected function initializeRemovalMap() {}", "private function removeRestrictedSectionsFromTree() {\r\n $sectionUids = $this->getSectionRestriction();\r\n foreach($this->tree as $key => $value) {\r\n if (!in_array($value['row']['uid'], $sectionUids)) {\r\n // BE user can't access this section\r\n unset($this->tree[$key]);\r\n }\r\n }\r\n $this->tree = array_values($this->tree); // Re-index\r\n }", "function dahz_remove_customizer_sections( $wp_customize ) {\r\n\t $wp_customize->remove_section( 'title_tagline' );\r\n\r\n\t}", "function prop_remove_css_section($wp_customize)\n{\n\n $wp_customize->remove_section('custom_css');\n\n}", "function del($section, $key = null) {\n if (is_null($key)) {\n if (isset($this->__flatData[$section])) {\n unset ($this->__flatData[$section]);\n unset ($this->__data[$section]);\n return;\n }\n $key = $section;\n $section = 'main';\n }\n unset ($this->__flatData[$section][$key]);\n unset ($this->__data[$section][$key]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks a voucher template as deleted
public function mark_as_deleted($templateId) { global $wpdb; $wpdb->update($this->table_name, array(self::COL_DELETED => 1), array(self::COL_ID => $templateId), array("%d"), array("%d") ); }
[ "public function forceDeleted(Template $template): void\n {\n //\n }", "public function delete(): void\n {\n $removetemp = rex_sql::factory();\n $removetemp->setTable(\\rex::getTablePrefix() . 'template');\n $removetemp->setWhere(['id' => $this->d2u_template_id]);\n $removetemp->delete();\n\n // remove addon config\n if ($this->rex_addon->hasConfig('template_'. $this->d2u_template_id)) {\n $this->rex_addon->removeConfig('template_'. $this->d2u_template_id);\n }\n\n // template specific uninstall action\n if (file_exists($this->template_folder . self::TEMPLATE_UNINSTALL)) {\n include $this->template_folder . self::TEMPLATE_UNINSTALL;\n }\n }", "private function _deleteTemplate()\n {\n $this->model->deleteTemplate();\n $this->view->display($this->model);\n }", "public function deleted(Template $template)\n {\n if ($template->images) {\n $this->deleteFiles($template);\n }\n }", "public function deleteTemplate()\n {\n $this->page->setTemplate('generic/json');\n $this->page->layout_template = 'contentonly.phtml';\n\n if (empty($this->vars['id'])) {\n $this->page->setStatus(400, 'Lacking id of template to delete');\n return;\n }\n\n if (!$this->model->deleteTemplate(intval($this->vars['id']))) {\n $this->page->setStatus(500, 'Failed to delete template');\n return;\n }\n }", "function delete()\n {\n $Account = Account::getInstance();\n $this->instance_id = $Account->instance_id;\n\n $query = <<<SQL\nDELETE\nFROM\n template\nWHERE\n id = $this->id AND\n instance_id = $this->instance_id\nSQL;\n $result = $this->DB->execute($query,\"Deleting template #$this->id\");\n if($result)\n if($this->_deleteQuestionAssociation())\n\treturn TRUE;\n else\n\treturn FALSE;\n else\n {\n $this->error = 'Unable to delete template due to a database error: \"'.$this->DB->getError().'\"';\n return FALSE;\n }\n }", "function delete() {\n $this->access_only_admin();\n $this->validate_submitted_data(array(\n \"id\" => \"numeric|required\"\n ));\n\n $id = $this->request->getPost('id');\n if (get_setting(\"default_template\") === $id) {\n app_redirect(\"forbidden\");\n }\n\n if ($this->request->getPost('undo')) {\n if ($this->Contract_templates_model->delete($id, true)) {\n echo json_encode(array(\"success\" => true, \"data\" => $this->_row_data($id), \"message\" => app_lang('record_undone')));\n } else {\n echo json_encode(array(\"success\" => false, app_lang('error_occurred')));\n }\n } else {\n if ($this->Contract_templates_model->delete($id)) {\n echo json_encode(array(\"success\" => true, 'message' => app_lang('record_deleted')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => app_lang('record_cannot_be_deleted')));\n }\n }\n }", "public function delete_template($data){\n $this->db->where('id', $data);\n $this->db->delete('email_template');\n return true;\n }", "public function delete() {\n\t\t$removemod = rex_sql::factory();\n\t\t$removemod->setTable(\\rex::getTablePrefix() . 'template');\n\t\t$removemod->setWhere(['id' => $this->d2u_template_id]);\n\t\t$removemod->delete();\n\n\t\t// remove addon config\n\t\tif($this->rex_addon->hasConfig(\"template_\". $this->d2u_template_id)) {\n\t\t\t$this->rex_addon->removeConfig(\"template_\". $this->d2u_template_id);\n\t\t}\n\t\t\n\t\t// template specific uninstall action\n\t\tif(file_exists($this->template_folder .\"install.php\")) {\n\t\t\t$success = include $this->template_folder .\"install.php\";\n\t\t\tif(!$success) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "public function on_wxbutton_deletetemplate()\n\t{\n\t\t// Which template does the user wish to delete ?\n\t\t$user_selection = $this->wxlistbox_templates->GetSelection();\n\t\tif( $user_selection == wxNOT_FOUND ) return;\n\t\t\n\t\t$user_choice = $this->wxlistbox_templates->GetString(\n\t\t\t$user_selection\n\t\t);\n\t\t\n\t\t\n\t\t$result = $this->website_project->db_delete(\n\t\t\tDILL2_CORE_CONSTANT_DB_TABLE_TEMPLATE_NAME,\n\t\t\tarray(\n\t\t\t\tDILL2_CORE_CONSTANT_DB_TABLE_TEMPLATE_COLUMN_TEMPLATENAME,\n\t\t\t\t\"=\",\n\t\t\t\t$user_choice,\n\t\t\t\tSQLITE3_TEXT\n\t\t\t)\n\t\t);\n\t\t\n\t\tif( $result )\n\t\t{\n\t\t\t$this->refresh_related_controls();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The template could not be deleted due to an error.\n\t\t\t$wxdialog_error = new wxMessageDialog(\n\t\t\t\t$wxdialog,\n\t\t\t\t\"The selected template could not be deleted.\",\n\t\t\t\tDILL2_TEXT_DIALOG_ERROR_CAPTION,\n\t\t\t\twxOK | wxCENTRE | wxICON_ERROR\n\t\t\t);\n\t\t\t$wxdialog_error->ShowModal();\t\t\t\n\t\t}\n\t}", "function ocupload_delete_confirm($form, &$form_state, $template) {\n $form['tid'] = array(\n '#type' => 'value',\n '#value' => $template->tid,\n );\n\n return confirm_form(\n $form,\n t('Do you really want to delete template') . ' ' . $template->tid . '?',\n 'admin/config/content/ocupload'\n );\n}", "function wcap_delete_template_bulk_action_handler_function( $template_id ) {\n global $wpdb;\n $id_remove = $template_id;\n $query_remove = \"DELETE FROM `\" . WCAP_EMAIL_TEMPLATE_TABLE . \"` WHERE id='\" . $id_remove . \"' \";\n $wpdb->query( $query_remove );\n\n wp_safe_redirect( admin_url( '/admin.php?page=woocommerce_ac_page&action=cart_recovery&section=emailtemplates&wcap_template_deleted=YES' ) );\n }", "function delete_template($template_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $template_id\n ));\n \n parent::delete('i', $parameter_array);\n }", "function delete() {\n $this->access_only_admin();\n $this->validate_submitted_data(array(\n \"id\" => \"numeric|required\"\n ));\n\n $id = $this->request->getPost('id');\n if (get_setting(\"default_template\") === $id) {\n app_redirect(\"forbidden\");\n }\n\n if ($this->request->getPost('undo')) {\n if ($this->Proposal_templates_model->delete($id, true)) {\n echo json_encode(array(\"success\" => true, \"data\" => $this->_row_data($id), \"message\" => app_lang('record_undone')));\n } else {\n echo json_encode(array(\"success\" => false, app_lang('error_occurred')));\n }\n } else {\n if ($this->Proposal_templates_model->delete($id)) {\n echo json_encode(array(\"success\" => true, 'message' => app_lang('record_deleted')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => app_lang('record_cannot_be_deleted')));\n }\n }\n }", "public function delete(int $hostTemplateId): void;", "function culturefeed_templates_delete_form($form, &$form_state, $template) {\n\n $form['#template'] = $template;\n\n // Always provide entity id in the same form key as in the entity edit form.\n $form['template_id'] = array('#type' => 'value', '#value' => $template->id);\n\n return confirm_form($form,\n t('Are you sure you want to delete %title?', array('%title' => $template->name)),\n '',\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n\n}", "public function deleteById($templateId);", "public function test_template_deleted() {\n $this->resetAfterTest(true);\n $this->setAdminUser();\n $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');\n\n $template = $lpg->create_template();\n\n // Trigger and capture the event.\n $sink = $this->redirectEvents();\n api::delete_template($template->get('id'));\n\n // Get our event event.\n $events = $sink->get_events();\n $event = reset($events);\n\n // Check that the event data is valid.\n $this->assertInstanceOf('\\core\\event\\competency_template_deleted', $event);\n $this->assertEquals($template->get('id'), $event->objectid);\n $this->assertEquals($template->get('contextid'), $event->contextid);\n $this->assertEventContextNotUsed($event);\n $this->assertDebuggingNotCalled();\n }", "function delete()\n\t{\t\t\n\t\t// put here role template specific stuff\n\t\tglobal $rbacadmin;\n\n\t\t// delete rbac permissions\n\t\t$rbacadmin->deleteTemplate($this->getId(),$_GET[\"ref_id\"]);\n\n\t\t// always call parent delete function at the end!!\n\t\treturn (parent::delete()) ? true : false;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that [size] renders a font size in a span.
public function testSize() { $this->assertEquals('<span>Size</span>', $this->object->reset('[size]Size[/size]')->parse()); $this->assertEquals('<span style="font-size: 10px">Size</span>', $this->object->reset('[size="10"]Size[/size]')->parse()); $this->assertEquals('<span style="font-size: 20px">Size</span>', $this->object->reset('[size="20"]Size[/size]')->parse()); $this->assertEquals('<span style="font-size: 29px">Size</span>', $this->object->reset('[size="29"]Size[/size]')->parse()); // invalid, out of range $this->assertEquals('<span>Size</span>', $this->object->reset('[size="ten"]Size[/size]')->parse()); $this->assertEquals('<span>Size</span>', $this->object->reset('[size="9"]Size[/size]')->parse()); $this->assertEquals('<span>Size</span>', $this->object->reset('[size="30"]Size[/size]')->parse()); }
[ "protected function size()\n {\n $this->matches[\"/\\[size=(\\d+)\\](.*?)\\[\\/size\\]/is\"] = function ($match) {\n return $this->html->span($match[2], ['style' => 'font-size:' . $match[1] . '%']);\n };\n }", "function test_named_font_size()\n {\n }", "function test_custom_font_size()\n {\n }", "public function updateFontSize($size);", "public function setFontSize($size);", "public function testValidFontSize(): void\n {\n $params = array(\n \"lines\" => \"text\",\n \"size\" => \"18\",\n );\n $model = new RendererModel(\"src/templates/main.php\", $params, self::$database);\n $this->assertEquals(18, $model->size);\n }", "function setFontAndSize($font, $size){}", "public function setFontSize ($pointsize) {}", "public function test_named_font_size() {\n\t\t$block_type_settings = array(\n\t\t\t'attributes' => array(),\n\t\t\t'supports' => array(\n\t\t\t\t'typography' => array(\n\t\t\t\t\t'fontSize' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->register_block_type( 'core/example', $block_type_settings );\n\n\t\t$block = array(\n\t\t\t'blockName' => 'core/example',\n\t\t\t'attrs' => array(\n\t\t\t\t'fontSize' => 'large',\n\t\t\t),\n\t\t\t'innerBlock' => array(),\n\t\t\t'innerContent' => array(),\n\t\t\t'innerHTML' => array(),\n\t\t);\n\n\t\t$expected_classes = 'foo-bar-class wp-block-example has-large-font-size';\n\t\t$expected_styles = 'test: style;';\n\n\t\t$this->assert_content_and_styles_and_classes_match( $block, $expected_classes, $expected_styles );\n\t}", "public function test_custom_font_size() {\n\t\t$block_type_settings = array(\n\t\t\t'attributes' => array(),\n\t\t\t'supports' => array(\n\t\t\t\t'typography' => array(\n\t\t\t\t\t'fontSize' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->register_block_type( 'core/example', $block_type_settings );\n\n\t\t$block = array(\n\t\t\t'blockName' => 'core/example',\n\t\t\t'attrs' => array(\n\t\t\t\t'style' => array( 'typography' => array( 'fontSize' => '10px' ) ),\n\t\t\t),\n\t\t\t'innerBlock' => array(),\n\t\t\t'innerContent' => array(),\n\t\t\t'innerHTML' => array(),\n\t\t);\n\n\t\t$expected_classes = 'foo-bar-class wp-block-example';\n\t\t$expected_styles = 'test: style; font-size: 10px;';\n\n\t\t$this->assert_content_and_styles_and_classes_match( $block, $expected_classes, $expected_styles );\n\t}", "function setFontSize( $size ) {\r\n $this->_fontSize = $size;\r\n }", "public function setfontsize($pointsize){}", "function css_fontsize($size)\n\t\t{\n\t\treturn intval($size)>0 ? 'font-size:'.intval($size).'px;' : '';\n\t\t}", "public function size() {\r\n return (int) $this->data->textElement->font['size'] ? (int) $this->data->textElement->font['size'] : 10;\r\n }", "function set_font_size($size)\n\t{\n\t\t$size *= 2;\n\t\t$this->TextDecoration .= $this->_font_size($size);\n\t}", "public function setfontsize($pointsize)\n {\n }", "function SetFontSize($size)\n{\n\tif($this->FontSizePt==$size)\n\t\treturn;\n\t$this->FontSizePt=$size;\n\t$this->FontSize=$size/$this->k;\n\tif($this->page>0)\n\t\t$this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));\n}", "public function getFontSize() {}", "function getFontSize(){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if current page is a query category page
function themify_is_query_page() { static $is = NULL; if ($is === null) { global $themify; $is = isset($themify->query_category) && '' !== $themify->query_category; } return $is; }
[ "protected function isCategoryPage()\n {\n return ($this->request->layout == 'category' || $this->request->task == 'category' || $this->request->view == 'latest');\n }", "protected function isCategoryPage()\n {\n return ($this->request->view == $this->viewCategory);\n }", "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 }", "function em_is_categories_page(){\n\treturn em_get_page_type() == 'categories';\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}", "function ec3_is_event_category_q(&$query) {\n global $ec3;\n // This bit nabbed from is_category()\n if($query->is_category) {\n $cat_obj = $query->get_queried_object();\n if($cat_obj->term_id == $ec3->event_category) {\n return true;\n }\n }\n return false;\n}", "protected function _isCategory() {\n return $this->_getRouteName() == 'catalog'\n && $this->_getControllerName() == 'category';\n }", "function is_category() {\n\t$pcat = CAT_ID;\n\treturn(!empty($pcat));\n}", "function is_product_cat() {\n $current_url_page_path = strtok($_SERVER[\"REQUEST_URI\"], '?'); \n $cat_key_value = 'product-category';\n $found_in_path = strpos_recursive($current_url_page_path, $cat_key_value);\n if($found_in_path) {\n return true;\n };\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 }", "function show_front_category( $query ) {\n if ( $query->is_home() && $query->is_main_query() ) {\n $query->set( 'cat', '10' );\n }\n}", "public function hasCurrentCategory()\n {\n if (is_null($this->_currentCategory)) {\n $this->_currentCategory = Mage::registry('current_category');\n }\n if (is_object($this->_currentCategory))\n return true;\n return false;\n }", "function in_comic_category( $category = false, $_post = null ) {\n $category = ( $category ) ? $category : get_comic_category( true );\n\n if ( $_post )\n $_post = get_post( $_post );\n else\n $_post =& $GLOBALS[ 'post' ];\n\n if ( !$_post )\n return;\n\n $r = is_object_in_term( $_post->ID, 'category', $category );\n \n if ( is_wp_error( $r ) )\n return;\n \n return $r;\n}", "public static function needsCategoriesMenu()\n\t{\n\t\t$db = Container::getInstance('com_ars')->db;\n\n\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('COUNT(id)')\n\t\t\t\t->from('#__menu')\n\t\t\t\t->where($db->qn('link').' = '.$db->q('index.php?option=com_ars&view=Categories&layout=repository'))\n\t\t\t\t->where($db->qn('published').' = '.$db->q(1));\n\n\t\treturn !(bool) $db->setQuery($query)->loadResult();\n\t}", "function wct_current_category() {\n\t//currently queried object\n\t$queriedObject = get_queried_object();\n\t//check if it has term id\n\tif ( property_exists( $queriedObject, 'term_id' ) ) {\n\t\treturn $queriedObject->term_id;\n\t} else {\n\t\treturn false; //we must be on the shop page\n\t}\n}", "function accouk_is_photography_page() {\n if( is_category('photography') || \n (isset($GLOBALS['main_category']) && \n $GLOBALS['main_category']['slug'] === \"photography\")\n ) {\n return true;\n }\n\n return false;\n}", "function exclude_category($query) {\nif ( $query->is_front_page() ) {\n/* to get category id login into wp backend, go to catagories page and hover over category. The url will have the id in it. */\n\t\t\t// category, category id\n$query->set('cat', '-192');\n}\nreturn $query;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chemist Class view function.
public function chemistClass() { if(!Auth::check()){ return redirect('login'); } if(!Utility::userRolePermission(Session::get('role_id'),55)){ return redirect('404_page'); } $data['page'] = 'Setting'; return view('classes.chemistClass',$data); }
[ "public function byClass()\n {\n \t$category=\"Class\";\n \n $classes = Classes::all();\n\n $url = URL::current();\n\n \treturn view('drugs.by-class',compact('category','classes','url'));\n }", "public function getClases();", "function ClassInfo($c_id) {\n\t$class_query = array('_id'=>new MongoId($c_id));\n\t\n\t$class_info = FindOneInCollection('Classes', $class_query);\n\treturn \t$class_info;\t\n}", "public function objectClassComputer();", "public function viewClass() {\r\n Auth::checkAuthentication();\r\n $teacherID = Session::get('user_id');\r\n $isTeacher = AccountModel::isTeacher(Session::get('user_role'));\r\n $classID = Request::get('classID');\r\n if (isset($teacherID) && isset($isTeacher) && isset($classID)) {\r\n if ($isTeacher) {\r\n if (ClassModel::isClassTaughtByTeacher($classID, $teacherID)) {\r\n $allStudentsInClassProgress = ClassModel::getAllStudentsInClassProgress($classID);\r\n $className = ClassModel::getClassName($classID, $teacherID);\r\n $allStudentsInClassProgress[\"className\"] = $className;\r\n $this->View->render('class/viewClass', $allStudentsInClassProgress);\r\n } else {\r\n Redirect::to(\"error/index\");\r\n }\r\n } else {\r\n Redirect::to(\"error/index\");\r\n }\r\n } else {\r\n Redirect::to(\"error/index\");\r\n }\r\n }", "function qode_class_attribute($value) {\n echo qode_get_class_attribute($value);\n }", "public function getClassAces();", "private function Classifier(){\n\t\t$classifier = new Classifier();\t\t\n\t\t$this->data['class'] = $classifier->getProbableClass($this->text . $this->url);\n\t}", "public function getDataClass();", "public function fetch_class(){\n return $this->_class;\n }", "function biagiotti_mikado_class_attribute( $value ) {\n\t\techo biagiotti_mikado_get_class_attribute( $value );\n\t}", "public function getClassIndex() {\n\t\treturn $this->find('list', array('fields' => array('slug', 'name'), 'order' => 'ApiClass.name ASC'));\n\t}", "function getClass(){\n\t\treturn $this->class;\n\t}", "public function generateClass();", "function fetch_class()\n\t{\n\t\treturn $this->class;\n\t}", "function ONTCLASS()\r\n\t{\r\n\t\treturn new ResResource(OWL_NS.'Class');\t\r\n\t}", "public function getWeightClass() {}", "abstract protected function buildClass();", "abstract protected function getDataClass();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fct pour retourner un tableau avec l'id_auteur et le nom du proprio d'un groupe
function accesgroupes_trouve_proprio_groupe($id_grpe) { $sql = "SELECT spip_accesgroupes_groupes.proprio, spip_auteurs.nom FROM spip_accesgroupes_groupes LEFT JOIN spip_auteurs ON spip_accesgroupes_groupes.proprio = spip_auteurs.id_auteur WHERE id_grpacces = $id_grpe LIMIT 1"; $result = spip_query($sql); if ($row = spip_fetch_array($result)) { // si le proprio est un admin restreint $row['nom'] est vide return array('id_proprio' => $row['proprio'], 'nom_proprio' => ($row['nom'] != '' ? $row['nom'] : _T('accesgroupes:tous_les_admins')) ); } }
[ "function act_nombre($grupo_id)\n {\n $row = $this->Pcrn->registro_id('grupo', $grupo_id);\n \n $registro['nombre_grupo'] = $this->generar_nombre($row->nivel, $row->grupo);\n \n $this->db->where('id', $grupo_id);\n $this->db->update('grupo', $registro);\n }", "function cambiar_grupo_trabajo($acceso,$id_orden,$id_gt){\nrequire_once \"Clases/trans_pago.php\";\n\t\t$obj_trans=new trans_pago();\n\t\t$obj_trans->begin($acceso);\n\t$acceso->objeto->ejecutarSql(\"Update orden_grupo Set id_gt='$id_gt' Where id_orden='$id_orden'\");\n\t$obj_trans->commit($acceso);\n\t/*\n\trequire_once \"Clases/orden_grupo.php\";\n\t\t\t$obj=new orden_grupo($id_orden,$id_gt,\"f\");\n\t\t\t$obj->modif_orden_grupo_aut($acceso);\n\t\t\t*/\n}", "function show_groupes()\n{\n\tbegin_box(_(\"Affichage des groupes existants\"));\n\t\n\t$sql=\"SELECT DISTINCT id_groupe,pseudo FROM groupes INNER JOIN users u ON id_groupe=u.id_user\";\n\t\n\t$req=requete($sql);\n\tif(num_rows($req)==0)\n\t{\n\t\tmsg(_(\"Aucun groupe existant\"));\n\t\tend_box();\n\t\treturn;\n\t}\t\n\twhile($response=fetch_array($req))\n\t{\n\t\tmsg(\"<a href='?view=groupes&id_groupe=\".$response[\"id_groupe\"].\"'>\".$response[\"pseudo\"].\"</a>\");\n\t}\n\tend_box();\n}", "function consultaGrupos($idTutor)\n{\n $sql=\"SELECT DISTINCT gp.id_grupo as id ,\n gp.nombre_grupo as nombre ,\n gp.clave as clave,\n gp.id_escuela as \\\"idEscuela\\\",\n gp.id_empresa as \\\"idEmpresa\\\",\n gp.tipo_grupo as \\\"tipoGrupo\\\" \n FROM rel_curso_tutor r_c_t\n JOIN rel_curso_grupo r_c_g\n ON r_c_t.id_rel_curso_grupo = r_c_g.id_rel_curso_grupo\n JOIN grupo gp\n ON gp.id_grupo = r_c_g.id_grupo \n WHERE \tgp.status = 1\n AND r_c_t.id_tutor = \".$idTutor;\n \n $consultaGrupo= new Query(\"SG\");\n $consultaGrupo->sql=$sql;\n $resultado = $consultaGrupo->select(\"obj\");\n \n return $resultado;\n}", "function filtre_selecteur_asso_groupe($sel='') {\r\n\t$sql = sql_select('id_groupe, nom', 'spip_asso_groupes', 'id_groupe>99', '', 'nom'); // on ne prend en consideration que les groupe d'id >= 100, les autres sont reserves a la gestion des autorisations\r\n\tif ( !$sql || !sql_count($sql) )\r\n\t\treturn ''; // ne proposer que s'il y a des groupes definis\r\n\t$res = \"<select name='groupe' onchange='form.submit()' id='asso_groupe'>\\n\";\r\n\t$res .= '<option value=\"\"';\r\n\t$res .= (!$sel?' selected=\"selected\"':'');\r\n\t$res .= '>'. _T('asso:tous_les_groupes') .\"</option>\\n\";\r\n\twhile ($val = sql_fetch($sql)) {\r\n\t\t$res .= '<option value=\"'.$val['id_groupe'].'\"';\r\n\t\t$res .= ($sel==$val['id_groupe']?' selected=\"selected\"':'');\r\n\t\t$res .= '>'.$val['nom'].\"</option>\\n\";\r\n\t}\r\n\tsql_free($sql);\r\n\treturn \"$res</select>\\n\";\r\n}", "static function abilitaGruppo($id,$gruppo,$conn){\n\t\t$values['ID_LINK']=$id;\n\t\t$values['ID_GRUPPOU']=$gruppo;\n\t\t$values['GROUP_LINK']=LK_GROUP_LINK;\n\t\t$str=\"select count(*) conto from \".LK_TABLE_LINK_GRUPPIU.\" where id_link=:id_link and id_gruppou=:id_gruppou and group_link=:group_link\";\n\t\t$query= new query($conn);\n\t\t$query->exec($str,$values);//binded\n\t\t$query->get_row();\n\t\tif($query->row['CONTO']==0){\n\t\t\t$query->insert($values,LK_TABLE_LINK_GRUPPIU);\n\t\t\t$conn->commit();\n\t\t\treturn Label::testo(\"Gruppo Abilitato\");\n\t\t}\n\t\telse\n\t\treturn Label::testo(\"Gruppo Prec. Abilitato\");\n\t}", "function carregar_grupo($connection, $tipo, $id_user) {\n // $query_grupo->execute(array(':tipo' => $tipo, ':id_utilizador' => $id_user));\n \n $query_adm = $connection->prepare(\"SELECT admin FROM utilizador WHERE id=:id_utilizador LIMIT 1\");\n $query_adm->execute(array(':id_utilizador' => $id_user));\n $reg_usr = $query_adm->fetch(PDO::FETCH_ASSOC);\n \n if ($reg_usr['admin'] == 0) {\n// $query_grupo = $connection->prepare(\"SELECT last_estado_grupos.id_grupo, g.nome, g.id_tipo, tp.designacao, last_estado_grupos.estado FROM (SELECT * FROM (SELECT * FROM estado_grupo ORDER BY id_grupo ASC, date_reg DESC) AS estados GROUP BY estados.id_grupo) AS last_estado_grupos INNER JOIN grupo g ON last_estado_grupos.id_grupo=g.id INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN tipo_grupo tp ON g.id_tipo=tp.id WHERE last_estado_grupos.estado='1' AND ug.id_user=:id_utilizador ORDER BY g.nome ASC\");//Comentei esta pois estava a dar problemas na opção \"Utilizadores\"\n $query_grupo = $connection->prepare(\"SELECT last_estado_grupos.id_grupo, g.nome, g.id_tipo, tp.designacao, last_estado_grupos.estado FROM estado_grupo last_estado_grupos JOIN (SELECT id_grupo, MAX(date_reg) AS max_date FROM estado_grupo GROUP BY id_grupo ) t1 ON t1.id_grupo=last_estado_grupos.id_grupo AND t1.max_date=last_estado_grupos.date_reg INNER JOIN grupo g ON last_estado_grupos.id_grupo=g.id INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN tipo_grupo tp ON g.id_tipo=tp.id WHERE last_estado_grupos.estado='1' AND ug.id_user=:id_utilizador ORDER BY g.nome ASC\"); //Meti esta com a query atualizada\n $query_grupo->execute(array(':id_utilizador' => $id_user));\n \n } elseif ($reg_usr['admin'] == 1) {\n// $query_grupo = $connection->prepare(\"SELECT last_estado_grupos.id_grupo, g.nome, g.id_tipo, tp.designacao, last_estado_grupos.estado FROM (SELECT * FROM (SELECT * FROM estado_grupo ORDER BY id_grupo ASC, date_reg DESC) AS estados GROUP BY estados.id_grupo) AS last_estado_grupos INNER JOIN grupo g ON last_estado_grupos.id_grupo=g.id INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN tipo_grupo tp ON g.id_tipo=tp.id INNER JOIN utilizador u ON ug.id_user=u.id WHERE last_estado_grupos.estado='1' AND u.parent=:id_utilizador ORDER BY g.nome ASC\");//estava esta\n $query_grupo = $connection->prepare(\"SELECT last_estado_grupos.id_grupo, g.nome, g.id_tipo, tp.designacao, last_estado_grupos.estado FROM estado_grupo last_estado_grupos JOIN (SELECT id_grupo, MAX(date_reg) AS max_date FROM estado_grupo GROUP BY id_grupo ) t1 ON t1.id_grupo=last_estado_grupos.id_grupo AND t1.max_date=last_estado_grupos.date_reg INNER JOIN grupo g ON last_estado_grupos.id_grupo=g.id INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN tipo_grupo tp ON g.id_tipo=tp.id INNER JOIN utilizador u ON ug.id_user=u.id WHERE last_estado_grupos.estado='1' AND u.parent=:id_utilizador ORDER BY g.nome ASC\");//meti esta\n $query_grupo->execute(array(':id_utilizador' => $id_user));\n \n } else {\n include('./terminar_sessao.php');\n }\n \n return $query_grupo;\n}", "function membres_groupe($id) {\n\n\tglobal $pdo;\n\t$stmt = $pdo->prepare('SELECT g_m.type AS type, m.* FROM groupes_membres AS g_m\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN groupes AS g ON g.id = g_m.id_groupe\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN membres AS m ON m.id = g_m.id_membre\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE g.id = :id');\n\t$stmt->bindValue('id', $id, PDO::PARAM_INT);\n\t$stmt->execute();\n\t$resultat = array('tous' => array(), 'types' => array());\n\twhile($ligne = $stmt->fetch()) {\n\t\t$resultat['tous'][] = $ligne;\n\t\t$resultat['types'][$ligne['type']][] = $ligne;\n\t}\n\treturn $resultat;\n}", "public function select($persona_has_grupo);", "function show_all_user_grup(){\n\t$res=mysql_query(\"SELECT concat(`login`,' ',`surname` , ' ', `firstname` , ' ', `fathername` ) AS fio, `u_id` , group_concat( `fk_g_id` ) AS gr FROM `tb_relations` RIGHT JOIN tb_users ON `fk_u_id` = `u_id` where (univer_id is null or univer_id= 0) GROUP BY `fk_u_id` ORDER BY `fio` ASC \") or die(mysql_error());\n\t$result=\"<table border='0'>\";\n\t$result.=\"<tr><th width='16px'></th><th width='16px'></th><th width='16px'></th><th>Название группы</th></tr>\";\n\t$result.=\"<tr><td><a href='#' onClick=\\\"show_add_to_group('ARM')\\\"><img border=0 src='./ico/add_to_group.gif'/></a></td>\n<td><a href='#' onClick=\\\"show_rename_group_field('ARM')\\\"><img border=0 src='./ico/textfield_rename.gif'/></a></td>\n<td><a href='#' onClick=\\\"show_delete_group('ARM')\\\"><img border=0 src='./ico/cross.gif'/></a></td>\n<td><span id='ARM'>ARM Установка параметров должность и ранг для пользователей(Другая таблица)</span></td></tr>\";\n\twhile($row= mysql_fetch_array($res))\n\t{\n\t\t$result.= \"\\t<tr><td><a href='#' onClick=\\\"show_add_to_group('\".$row[1].\"')\\\"><img border=0 src='./ico/add_to_group.gif'/></a></td>\n<td><a href='#' onClick=\\\"show_rename_group_field('\".$row[1].\"')\\\"><img border=0 src='./ico/textfield_rename.gif'/></a></td>\n<td><a href='#' onClick=\\\"show_delete_group('\".$row[1].\"')\\\"><img border=0 src='./ico/cross.gif'/></a></td>\n<td><span id='\".$row[1].\"'>\".$row[0].\"</span></td></tr>\\n\";\n\t\t//\t$result.= \"\\t<tr><td><img src='./ico/textfield_rename.gif'/></td>\t\t<td><img src='./ico/cross.gif'/></td><td>\".$row[0].\"</td></tr>\\n\";\n\t}\n\t$result.= \"</table>\";\n\treturn $result;\n}", "public function agrupamentosParaCalculo()\n {\n // Incluindo Todos os Modelos que possuem o mesmo nome na coluna\n\n // Model/Table da coluna\n\n }", "function getCargosProfessor($db,$idprofessors) {\n $sql = \"SELECT pc.*,g.idgrups,c.nom_carrec,g.nom \";\n $sql .= \"FROM professor_carrec pc \";\n $sql .= \"LEFT JOIN carrecs c ON pc.idcarrecs = c.idcarrecs \";\n $sql .= \"LEFT JOIN grups g ON pc.idgrups = g.idgrups \";\n $sql .= \"WHERE pc.idprofessors=$idprofessors \";\n $sql .= \"ORDER BY c.nom_carrec,g.nom \";\t\n\t\n $rec = $db->query($sql);\n\n return $rec;\n}", "public function gestorGrpGtr()\n {\n \t//Mantenimiento de grupos y gestores\n $crud = new grocery_CRUD();\n \n \t//Tema twitter bootstrap adaptativo\n \t// desactivado de momento por que no filtra bien en algunos casos\n \t//$crud->set_theme('twitter-bootstrap'); \t\n \t$crud->set_theme('datatables'); \n \n //Establecemos la tabla\n \t$crud->set_table('GRUPOS');\n \t\n \t//Establecemos la relacion\n \t$crud->set_relation_n_n('GESTOR', 'REL_GESTOR_GRUPO', 'USUARIOS', 'IDGRUPO', 'IDUSUARIO', 'NOMBRE',null,'IDTIPOUSUARIO IN (1,2)'); \t \n \t$crud->columns('NOMBRE','DESCRIPCION','ACTIVO','GESTOR','FECHA_ALTA','FECHA_MODIFICACION','FECHA_BAJA');\n \t\n \t\n \t//Indicamos los campos obligatorios\n \t$crud->required_fields('NOMBRE','ACTIVO', 'GESTOR');\n\n \t//Validaciones sobre los campos\n \t$crud->set_rules('NOMBRE','Nombre','trim|required|min_length[5]|max_length[50]');\n \t$crud->set_rules('DESCRIPCION','Descripcion','trim|max_length[50]');\n \t$crud->set_rules('ACTIVO','Activo','trim|required');\n \t \t\n \t//Nomber que aparece al lado de Añadir\n \t$crud->set_subject('Grupo');\n \t\n \t//Valores para el campo ATIVO\n \t$crud->field_type('ACTIVO','dropdown',\n \t\t\tarray('SI' => 'SI', 'NO' => 'NO'));\n \t\n \t//Ocultamos las fechas para que no salgan en el alta o modificacoin \n \t$crud->change_field_type('FECHA_ALTA','invisible');\n \t$crud->change_field_type('FECHA_MODIFICACION','invisible');\n \t$crud->change_field_type('FECHA_BAJA','invisible');\n \t\n\n \t$crud->fields('NOMBRE','DESCRIPCION','ACTIVO','GESTOR','FECHA_ALTA','FECHA_MODIFICACION');\n \t$crud->callback_before_insert(array($this,'get_date_insert'));\n \t$crud->callback_before_update(array($this,'get_date_update')); \t\n \t\n\n \t$output = $crud->render();\n \t//Mirar el metodo\n \t$this->_example_output($output, self::VISTA_GRUPO_GESTOR);\n }", "function renseigner_table_objet_sql($table_sql,&$infos){\n\t if (!isset($infos['type'])){\n\t\t // si on arrive de base/trouver_table, on a la cle primaire :\n\t\t // s'en servir pour extrapoler le type\n\t\t if (isset($desc['key'][\"PRIMARY KEY\"])){\n\t\t\t $primary = $desc['key'][\"PRIMARY KEY\"];\n\t\t\t $primary = explode(',',$primary);\n\t\t\t $primary = reset($primary);\n\t\t\t $infos['type'] = preg_replace(',^spip_|^id_|s$,', '', $primary);\n\t\t }\n\t\t else\n\t\t\t $infos['type'] = preg_replace(',^spip_|s$,', '', $table_sql);\n\t }\n\t if (!isset($infos['type_surnoms']))\n\t\t $infos['type_surnoms'] = array();\n\n\t if (!isset($infos['table_objet']))\n\t\t $infos['table_objet'] = preg_replace(',^spip_,', '', $table_sql);\n\t if (!isset($infos['table_objet_surnoms']))\n\t\t $infos['table_objet_surnoms'] = array();\n\n\t if (!isset($infos['principale']))\n\t\t $infos['principale'] = (isset($GLOBALS['tables_principales'][$table_sql])?'oui':false);\n\n\t // normaliser pour pouvoir tester en php $infos['principale']?\n\t // et dans une boucle {principale=oui}\n\t $infos['principale'] = (($infos['principale'] AND $infos['principale']!='non')?'oui':false);\n\n\t // declarer et normaliser pour pouvoir tester en php $infos['editable']?\n\t // et dans une boucle {editable=oui}\n\t if (!isset($infos['editable'])) $infos['editable'] = 'oui';\n\t $infos['editable'] = (($infos['editable'] AND $infos['editable']!='non')?'oui':false);\n\n\t // les urls publiques sont par defaut page=type pour les tables principales, et rien pour les autres\n\t // seules les exceptions sont donc a declarer\n\t if (!isset($infos['page']))\n\t\t $infos['page'] = ($infos['principale']?$infos['type']:'');\n\n\t if (!isset($infos['url_voir']))\n\t\t $infos['url_voir'] = $infos['type'];\n\t if (!isset($infos['url_edit']))\n\t\t $infos['url_edit'] = $infos['url_voir'].($infos['editable']?\"_edit\":'');\n\t if (!isset($infos['icone_objet']))\n\t\t $infos['icone_objet'] = $infos['type'];\n\n\t // chaines de langue\n\t // par defaut : objet:icone_xxx_objet\n\t if (!isset($infos['texte_retour']))\n\t\t $infos['texte_retour'] = 'icone_retour';\n\t if (!isset($infos['texte_modifier']))\n\t\t $infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];\n\t if (!isset($infos['texte_creer']))\n\t\t $infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];\n\t if (!isset($infos['texte_objets']))\n\t\t $infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];\n\t if (!isset($infos['texte_objet']))\n\t\t $infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];\n\t if (!isset($infos['texte_logo_objet'])) // objet:titre_logo_objet \"Logo de ce X\"\n\t\t $infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];\n\t\t\n\t // objet:info_aucun_objet\n\t if (!isset($infos['info_aucun_objet']))\n\t\t $infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];\n\t // objet:info_1_objet\n\t if (!isset($infos['info_1_objet']))\n\t\t $infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];\n\t // objet:info_nb_objets\n\t if (!isset($infos['info_nb_objets']))\n\t\t $infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];\n\n\n\t if (!isset($infos['champs_editables']))\n\t\t $infos['champs_editables'] = array();\n\t if (!isset($infos['champs_versionnes']))\n\t\t $infos['champs_versionnes'] = array();\n\t if (!isset($infos['rechercher_champs']))\n\t\t $infos['rechercher_champs'] = array();\n\t if (!isset($infos['rechercher_jointures']))\n\t\t $infos['rechercher_jointures'] = array();\n\n\t if (!isset($infos['modeles']))\n\t\t $infos['modeles'] = array($infos['type']);\n\n\t return $infos;\n }", "function carregar_grupo($connection) {\n // $query_grupo = $connection->prepare(\"SELECT q1.id, q2.nome, q2.estado FROM (SELECT DISTINCT g.id FROM grupo g INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN utilizador u ON ug.id_user=u.id INNER JOIN entidade ent ON ent.id=u.id_entidade WHERE ent.id=:id_entidade ORDER BY g.id) AS q1 INNER JOIN (SELECT DISTINCT g.id, g.nome, eg.estado, eg.date_reg FROM grupo g INNER JOIN estado_grupo eg ON g.id=eg.id_grupo INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN utilizador u ON ug.id_user=u.id INNER JOIN entidade ent ON ent.id=u.id_entidade WHERE ent.id=:id_entidade1 ORDER BY g.id ASC, eg.date_reg DESC) AS q2 ON q1.id=q2.id GROUP BY q1.id ASC ORDER BY q2.nome ASC\");\n\t\n\t$query_grupo = $connection->prepare(\"SELECT q1.id, q2.nome, q2.estado FROM (SELECT DISTINCT g.id FROM grupo g INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN utilizador u ON ug.id_user=u.id INNER JOIN entidade ent ON ent.id=u.id_entidade WHERE ent.id=:id_entidade) AS q1 LEFT JOIN (SELECT DISTINCT g.id, g.nome, eg.estado, eg.date_reg FROM grupo g INNER JOIN estado_grupo eg ON g.id=eg.id_grupo INNER JOIN user_grupo ug ON g.id=ug.id_grupo INNER JOIN utilizador u ON ug.id_user=u.id INNER JOIN entidade ent ON ent.id=u.id_entidade WHERE ent.id=:id_entidade1) AS q2 ON q1.id=q2.id ORDER BY q2.nome ASC, q2.date_reg DESC\"); //pedente\n\t$query_grupo->execute(array(':id_entidade' => $_SESSION['id_entidade'], 'id_entidade1' => $_SESSION['id_entidade']));\n return $query_grupo;\n}", "function grand_ma($id_rubrique, $rang_rub)\n{\n$req=spip_query(\"SELECT id_rubrique, titre FROM spip_rubriques WHERE id_parent=$id_rubrique\");\nwhile ($row=spip_fetch_array($req))\n\t{\n\t$id_rubrique=$row['id_rubrique'];\n\t$titre=$row['titre'];\n\t$rang_rub++;\n\t$retrait = 20*$rang_rub;\n\tdebut_ligne_claire($retrait);\n\techo \"<img src='\"._DIR_IMG_PACK.\"gaf_salon.gif' align='absmiddle'> \n\t\t<span class='verdana2'>\".$id_rubrique.\"</span> - <b>\".propre($titre).\"</b>\\n\";\n\tfin_bloc();\n\n\tbb_article($id_rubrique, $rang_rub);\n\tgrand_ma($id_rubrique, $rang_rub);\n\t}\n}", "function nettoie_categ($idpb,$origine)\r\n\t{\r\n\t\t//echo \"<br />Bienvenu dans la fonction nettoie_categ pour supprimer le ticket $idpb\";\r\n\t\t//echo \"<br />J'arrive de $origine\";\r\n\r\n\t\t//On supprime tous les r&eacute;f&eacute;rences de cat&eacute;gorie dans la table jointe categorie_personnelle_ticket\r\n\t\t$query_supp=\"DELETE FROM categorie_personnelle_ticket WHERE id_pb = '\".$idpb.\"';\";\r\n\t\t$result_supp = mysql_query($query_supp);\r\n\r\n\t\t//On supprime toutes les r&eacute;f&eacute;rences dans le champ ID_PB_CATEG\r\n\t\t$query=\"SELECT ID_CATEG, ID_PB_CATEG FROM categorie WHERE ID_PB_CATEG LIKE '%\".$idpb.\"%';\";\r\n\t\t$result = mysql_query($query);\r\n\r\n\t\tif(!$result)\r\n\t\t{\r\n\t\t\techo \"<br />2 : Erreur d'execution de la requ&egrave;te ou de connexion &agrave; la base de donn&eacute;es\";\r\n\t\t\t//echo \"<br /> <a href = \\\"gestion_ticket.php?tri=G&amp;indice=0\\\" target = \\\"body\\\">Retour &agrave; la Gestion des tickets</a>\";\r\n\t\t\tmysql_close();\r\n\t\t\texit;\r\n\t\t}\r\n\t\t$res_cat = mysql_fetch_row($result);\r\n\t\tif($res_cat[0] <> \"\")\r\n\t\t{\r\n\t\t\t//Il faut regarder chaque enregistrement et supprimer la r&eacute;f&eacute;rence au ticket\r\n\t\t\t//echo \"<br />avant l'affectation du tableau\";\r\n\t\t\t//echo \"<br />N° cat&eacute;gorie : $res_cat[0]\";\r\n\t\t\t//echo \"<br />Tickets dans cette cat&eacute;gorie : $res_cat[1]<br />\";\r\n\t\t\t$chaine_a_modifier = $res_cat[1];\r\n\t\t\t$chaine_a_supprimer=\"$idpb\".\";\";\r\n\t\t\t//echo \"<br />Chaine &agrave; supprimer : $chaine_a_supprimer<br />\";\r\n\t\t\t//echo \"<br />Chaine &agrave; modifier : $chaine_a_modifier<br />\";\r\n\t\t\t$chaine_modifiee = ereg_replace($chaine_a_supprimer,'', $chaine_a_modifier);\r\n\t\t\t//echo \"<br />Chaine &agrave; enregistrer apr&egrave;s traitement : $chaine_modifiee<br />\";\r\n\r\n\t\t\t//Requ&egrave;te proc&eacute;dant &agrave; la mise &agrave; jour de la cat&eacute;gorie\r\n\t\t\t$query_modif = \"UPDATE categorie SET\r\n\t\t\t\tID_PB_CATEG = '$chaine_modifiee'\r\n\t\t\t\tWHERE ID_CATEG = '$res_cat[0]';\";\r\n\t\t\t$results_modif = mysql_query($query_modif);\r\n\r\n\t\t\t//Dans le cas où aucun r&eacute;sultats n'est retourn&eacute;\r\n\t\t\tif(!$results_modif)\r\n\t\t\t{\r\n\t\t\t\techo \"2 : Erreur d'execution de la requ&egrave;te ou de connexion &agrave; la base de donn&eacute;es\";\r\n\t\t\t\techo \"<br /> <a href = \\\"gestion_ticket.php?tri=G&amp;indice=0\\\" target = \\\"body\\\">Retour &agrave; la Gestion des cat&eacute;gories</a>\";\r\n\t\t\t\tmysql_close();\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\tnettoie_categ($idpb,fonction); \r\n\t\t}\r\n\t}", "function salvaGrupo($bd){\r\n\t\t//se nao foi enviado nome ou id do grupo(mesmo que seja 0) retorna erro\r\n\t\tif(!isset($_POST['id']) || !isset($_POST['nome'])){\r\n\t\t\treturn \"Faltam dados para salvar os dados corretamente. Nenhum dado foi salvo.\";\r\n\t\t}\r\n\t\t//se id=0 faz criacao do documento\r\n\t\tif ($_POST['id'] == 0){\r\n\t\t\t//insere a tupla correspondente na tabela de grupos\r\n\t\t\t$res = $bd->query(\"INSERT INTO label_grupos (nome) VALUES ('\".$_POST['nome'].\"')\");\r\n\t\t\t//se insercao bem sucedida\r\n\t\t\t/*if(count($res)){\r\n\t\t\t\t//consulta o ID do grupo criado\r\n\t\t\t\t$res = $bd->query(\"SELECT id FROM label_grupos WHERE nome = '\".$_POST['nome'].\"'\");\r\n\t\t\t\t$id = $res[0]['id'];\r\n\t\t\t\t//adiciona a coluna desse grupo na tabela de acoes (permissoes)\r\n\t\t\t\t$res = $bd->query(\"ALTER TABLE label_acao ADD G\".$id.\" BOOLEAN NOT NULL DEFAULT 0\");\r\n\t\t\t}*/\r\n\t\t//se id!=0 eh a edicao de um grupo\r\n\t\t} else {\r\n\t\t\t//apenas atualiza o nome no BD\r\n\t\t\t$res = $bd->query(\"UPDATE label_grupos SET nome = '\".$_POST['nome'].\"' WHERE id = \".$_POST['id']);\r\n\t\t}\r\n\t\t//se tudo deu certo, retorna feedback positivo\r\n\t\tif($res){\r\n\t\t\treturn 'Dados salvos com sucesso. Para editar as permiss&otilde;es, <a href=\"adm.php?area=pe&amp;acao=geren\">aqui</a>.';\r\n\t\t//senao, retorna mensagem de erro\r\n\t\t} else {\r\n\t\t\treturn \"Erro ao salvar os dados\";\r\n\t\t}\r\n\t}", "public function crudGrupo_ficha()\n {\n $grfc = new grupo_ficha();\n\n //Se obtienen los datos del grupo_ficha a editar.\n if(isset($_REQUEST['idgrupo_ficha']))\n {\n $grfc = $this->model->obtenerGrupo_ficha($_REQUEST['idgrupo_ficha']);\n }\n\n //Llamado de las vistas.\n require_once '../vista/header.php';\n require_once '../vista/grupo_ficha/grupo_ficha-editar.php';\n require_once '../vista/footer.php';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
choose project to show taxes
public function chooseProject() { $projects=Project::where('done',0)->get(); $array=[ 'projects'=>$projects, 'active'=>'tax' ]; return view('production.allprojects',$array); }
[ "protected function taxesAction() {\n\t\t$this->_view->priceIncTax = $this->_configMapper->getConfigParam('showPriceIncTax');\n\t\t$this->_view->rules = array_map(function ($rule) {\n\t\t\treturn $rule->toArray();\n\t\t}, Models_Mapper_Tax::getInstance()->fetchAll());\n\t\t$this->_view->zones = array_map(function ($zone) {\n\t\t\treturn $zone->toArray();\n\t\t}, Models_Mapper_Zone::getInstance()->fetchAll());\n $this->_view->helpSection = Tools_Misc::SECTION_STORE_TAXES;\n $this->_layout->content = $this->_view->render('taxes.phtml');\n\t\techo $this->_layout->render();\n\t}", "public function action_gettaxval()\n {\n $common_model = Model::factory( 'commonmodel' );\n echo $company_tax = ( FARE_SETTINGS == 2 && !empty( $_REQUEST['company'] ) ) ? $common_model->company_tax( $_REQUEST['company'] ) : TAX;\n exit;\n }", "public function actionByProject()\n {\n // Get dates\n $filters = CostsComponent::getFilteringCriteria();\n\n // Get page size variable\n if (isset($_GET['pageSize'])) {\n Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);\n unset($_GET['pageSize']);\n }\n\n // Sorting\n $sort = new CSort;\n $sort->attributes = array(\n 'id',\n );\n\n // Form the data provider\n $dataProvider = new CArrayDataProvider(\n WipComponent::getByProject($filters), array(\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),\n ),\n 'sort' => $sort\n )\n );\n\n // Get summaries\n $summary = CostsComponent::getAllCostsSummary($filters);\n\n // Render template\n $this->render('by_project', array(\n 'dataProvider' => $dataProvider,\n 'summary' => $summary,\n 'pageTitle' => 'Wip By Project',\n 'filters' => $filters,\n ) + $filters);\n }", "public function employee_tax_type(){\n\t\t\n\t\t$this->load->view(\"app/payroll/file_maintenance/employee_tax_type/index\",$this->data);\n\t}", "function index(){\n\t\t\t$qry_cf = \"select * from cash_proj where kd_project = 11101 order by kodecash asc\";\n\t\t\t$data['judulcf'] = $this->db->query($qry_cf)->result();\n\t\t\t\n\t\t\t/* bank per project */\n\t\t\t$qry_bank = \"select * from db_bank where id_subproject = 11101 order by bank_id asc\";\n\t\t\t$data['bankcf'] = $this->db->query($qry_bank)->result();\n\t\t\t\n\t\t\t$this->load->view('cb/cashflow-view',$data);\n\t\t}", "public function business_project_select_territory()\n\t{\n\t\t\n\t\t\t$client_id\t=\t$this->input->post('client_id');\n\t\t\t$qu=\"SELECT * from tbl_clients where pk_client_id = '\".$client_id.\"'\";\n\t\t\t$gh=$this->db->query($qu);\n\t\t\t$rt=$gh->result_array();\n\t\t\t$qu2=\"SELECT * from tbl_offices where pk_office_id = '\".$rt[0]['fk_office_id'].\"'\";\n\t\t\t$gh2=$this->db->query($qu2);\n\t\t\t$rt2=$gh2->result_array();\n\t\t\techo '<select class=\"form-control\" name=\"Territory\" id=\"Territory\" >';\n\t\t\tforeach($rt2 as $value)\n\t\t\t{\n\t\t\t\techo '<option value=\"';\n\t\t\t\techo $value['pk_office_id'];\n\t\t\t\techo '\">';\n\t\t\t\techo $value['office_name'];\n\t\t\t\techo '</option>';\n\t\t\t}\n\t\t\techo '</select>';\n\t}", "function print_choose_project($snuuid) {\n if(!is_numeric($snuuid)) return 'Invalid SNUUID';\n\n $ret = '<div class=\\'\\'>Select a project site to work with:';\n $sql = \"SELECT projname, projid FROM projects WHERE snuuid=$1\";\n\n $res = pg_query_params($sql, array($snuuid));\n if($res) {\n $ret .= '<form action=\\'.\\' >\n\t<input type=\\'hidden\\' name=\\'action\\' value=\\'do_choose_project\\'>\n\t<select name=\\'choose_project\\'>\n\t';\n while($row = pg_fetch_assoc($res)) {\n $ret .= '<option value=\\''.$row['projid'].'\\'>';\n $ret .= $row['projname'].'</option>';\n }\n $ret .= \"</select>\\n\";\n $ret .= \"<input type='submit' value='Choose Project'></form>\\n\";\n } else {\n $ret .= 'Error loading projects.';\n }\n\n return $ret.'</div>';\n}", "public function taxesAction()\n\t{\n\t\t$this->view->headScript()->appendScript(\"\n\t\t$(document).ready(function() {\n\t\t\tvar i = 1;\n\t\t\t$(\\\"a.add-link\\\").click(function() {\n \t\t\t\t$(\\\"#taxes-table tr:last\\\").clone().find(\\\"input\\\").each(function() {\n \t\t\t\t$(this).val('').attr('name', function(_, id) { return id + i });\n \t\t\t\t}).end().appendTo(\\\"#taxes-table\\\");\n \t\t\t\ti++;\n\t\t\t});\n\t\t\t\n\t\t\t$(\\\"a.delete-link\\\").live(\\\"click\\\", function() {\n\t\t\t\t$(this).parent().parent().remove();\n\t\t\t});​\n\t\t});​\");\n\t\t\n\t\t$request = $this->getRequest();\n if ($request->isPost()) {\n \t$taxes = array();\n \t$params = $request->getParams();\n \tfor ($i=0;$i<count($params['description']);$i++) {\n \t\t$taxes[] = array(\n \t\t\t'id'\t\t\t=> $params['tax_id'][$i],\n \t\t\t'description'\t=> $params['description'][$i],\n \t\t\t'amount'\t\t=> $params['amount1'][$i],\n \t\t\t'amount_2'\t\t=> $params['amount2'][$i]\n \t\t);\n \t}\n \t\n \t// ToDo: Save taxes\n }\n \n $taxes_table = new ZendInvoices_Db_table_Taxes();\n $this->view->taxes = $taxes_table->fetchAll();\n\t}", "function insight_server_get_projects_options() {\n global $base_path;\n $options = ['' => t('Please select the project')];\n $result = db_query('SELECT n.nid, n.title FROM {node} n WHERE n.type = :type ORDER BY n.title',\n [':type' => 'insight_server_project']);\n\n foreach ($result as $item) {\n $options[$base_path . 'admin/config/services/insight_server/dashboard/' . $item->nid] = $item->title;\n }\n\n return $options;\n}", "function ViewAll_Premium_projects_1()\n\t{\n\t\tglobal $db;\n\t\t$sql=\"SELECT count(*) as cnt FROM \".project_MASTER.\" AS PM \"\n\t\t .\" LEFT JOIN \".MEMBER_MASTER.\" AS MM ON PM.auth_id_of_post_by = MM.user_auth_id \"\n\t\t\t .\" WHERE PM.premium_project = 1\";\n\n\t\t$db->query($sql);\n\t\t$db->next_record();\n\t\t$_SESSION['total_record'] = $db->f(\"cnt\") ;\n\t\t$db->free();\n\n\t\t# Reset the start record if required\n\t\tif($_SESSION['user_page_size'] >= $_SESSION['total_record'])\n\t\t{\n\t\t\t$_SESSION['start_record'] = 0;\n\t\t}\n\n\t\t$sql= \" SELECT * FROM \".project_MASTER.\" AS PM \"\n\t\t .\" LEFT JOIN \".MEMBER_MASTER.\" AS MM ON PM.auth_id_of_post_by = MM.user_auth_id \"\n\t\t\t .\" WHERE PM.premium_project = 1 \"\n\t\t\t .\" ORDER BY PM.premium_project DESC,PM.project_posted_date DESC \"\n\t\t\t .\" LIMIT \". $_SESSION['start_record']. \", \". $_SESSION['user_page_size'];\n\t\t$db->query($sql);\n\t}", "public function tarikinvestasi(){\n\t\t$q = urldecode($this->input->get('q', TRUE));\n\t\t$start = intval($this->input->get('start'));\n\n\t\t$investasiberjangka = $this->Investasiberjangka_model->get_investasi_ditarik($start, $q);\n\t\t\n\t\t$wilayah = $this->Wilayah_model->get_all();\n\n\t\t$data = array(\n\t\t\t'wilayah_data' => $wilayah,\n\t\t\t'investasiberjangka_data' => $investasiberjangka,\n\t\t\t'q' => $q,\n\t\t\t'start' => $start,\n\t\t\t'content' => 'backend/investasiberjangka/investasiberjangka',\n\t\t\t'item'=> 'tarikinvestasi/tarikinvestasi.php',\n\t\t\t'active' => 4,\n\t\t\t);\n\t\t$this->load->view(layout(), $data);\n\t}", "public function edit_tax_form(){\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'Edit Tax';\n\t\t\t$tax_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $tax_id);\n\t\t\t$this->data['countryDisplay'] = $this->product_model->SelectAllCountry();\n\t\t\t$this->data['tax_details'] = $this->product_model->get_all_details(STATE_TAX,$condition);\n\t\t\tif ($this->data['tax_details']->num_rows() == 1){\n\t\t\t\t$this->load->view('crmadmin/tax/edit_tax',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect('deals_crm');\n\t\t\t}\n\t\t}\n\t}", "function ViewAll_Standard_projects()\n\t{\n\t\tglobal $db;\n\t\n\t\t$sql=\" SELECT * FROM \".project_MASTER.\" AS PM \"\n\t\t .\" LEFT JOIN \".MEMBER_MASTER.\" AS MM ON PM.auth_id_of_post_by = MM.user_auth_id \"\n\t\t\t .\" WHERE PM.premium_project = 0 AND (PM.project_status =1 OR PM.project_status =2)\"\n\t\t .\" ORDER BY PM.project_posted_date DESC,MM.membership_id DESC LIMIT 0,50\";\n\t\t$db->query($sql);\n\t}", "public function view_countrywise_tax($id) {\n $this->db->flush_cache();\n $this->db->select('tabqy_taxes.tax_country,tabqy_taxes.tax_company_id');\n $this->db->from('tabqy_taxes');\n $this->db->where('tabqy_taxes.tax_status', '1');\n $this->db->where('tabqy_taxes.tax_id', $id);\n $query_c = $this->db->get();\n $tabqy_taxes = $this->db->row($query_c);\n\n if ($tabqy_taxes) {\n $company_id = $tabqy_taxes['tax_company_id'];\n $country_code = $tabqy_taxes['tax_country'];\n $this->db->flush_cache();\n $this->db->select('tabqy_taxes.*,tabqy_countries.country_name');\n $this->db->from('tabqy_taxes');\n $this->db->join('tabqy_countries', \"tabqy_countries.country_code=tabqy_taxes.tax_country\", \"inner\");\n $this->db->where('tabqy_taxes.tax_company_id', $company_id);\n $this->db->where('tabqy_taxes.tax_country', $country_code);\n $this->db->where('tabqy_taxes.tax_status', '0');\n $query_d = $this->db->get();\n $commissions = $this->db->result($query_d);\n echo json_encode($commissions);\n die;\n }\n }", "public function view_tax()\n\t{\n\t\tif ($this->checkLogin('A') == '')\n\t\t{\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['heading'] = 'View State';\n\t\t\t$tax_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $tax_id);\n\t\t\t\n\t\t\t$this->data['tax_details'] = $this->location_model->get_all_details(STATE_TAX,$condition);\t\t\t\n\t\t\t\n\t\t\t$condition1 = array('id' => $this->data['tax_details']->row()->countryid);\n\t\t\t$this->data['CountryList'] = $this->location_model->get_all_details(COUNTRY_LIST,$condition1);\n\n\t\t\tif ($this->data['tax_details']->num_rows() == 1){\n\t\t\t\t$this->load->view('admin/location/view_tax',$this->data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}", "function btrProject_select_form_submit($form, &$form_state) {\n $values = $form_state['values']['select_project'];\n list($origin, $project) = explode(':', $values['project'], 2);\n $lng = $values['lng'];\n\n drupal_goto(\"/btr/project/$origin/$project/$lng/dashboard\");\n}", "function nature_taxonomies_project() {\n\t\t$project_type_labels = array(\n\t\t\t'name' => __('Project Types','nature'),\n\t\t\t'singular_name' => __('Project Type','nature'),\n\t\t\t'search_items' => __('Search Project Types','nature'),\n\t\t\t'all_items' => __('All Project Types','nature'),\n\t\t\t'parent_item' => __('Parent Project Type','nature'),\n\t\t\t'parent_item_colon' =>__('Parent Project Type:','nature'),\n\t\t\t'edit_item' => __('Edit Project Type','nature'),\n\t\t\t'update_item' => __('Update Project Type','nature'),\n\t\t\t'add_new_item' => __('Add New Project Type','nature'),\n\t\t\t'new_item_name' => __('Project Type Name','nature'),\n\t\t\t'menu_name' => __('Project Types','nature')\n\t\t);\nregister_taxonomy(\n\t'project_type',\n\t'project',\n\t\tarray(\n\t\t'hierarchical' => true,\n\t\t'labels' => $project_type_labels,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'project-type','nature')\n\t\t)\n\t);\n}", "public function getTaxservice()\n {\n return view('dashboard.taxservice');\n }", "public function project()\n {\n $this->response->html($this->helper->layout->admin('admin/setting/project', [\n 'colors' => $this->colorModel->getList(),\n 'project_views' => $this->projectModel->getViews(),\n 'default_columns' => implode(', ', $this->boardModel->getDefaultColumns()),\n 'title' => t('Admin').' &raquo; '.t('Project settings'),\n ]));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns if the user owns the given team
public function isOwnerOfTeam( $team );
[ "function lanorg_is_owner_of_team($team_id, $user_id) {\n\tglobal $wpdb;\n\n\t$team_id = (int) $team_id;\n\t$user_id = (int) $user_id;\n\t$table_name = $wpdb->prefix . 'lanorg_teams';\n\n\treturn $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(id) FROM $table_name WHERE id = $team_id AND owner_id = $user_id\")) > 0;\n}", "private function isOwner(Team $entity)\n {\n $user = $this->get('security.context')->getToken()->getUser();\n\n return ($entity->getOwner()->getId() !== $user->getId()) ? false : true;\n }", "function is_team() {\n\tglobal $current_user;\n\tget_currentuserinfo();\n\n\t$team = array('teamhair', 'admin');\n\n\tif(in_array($current_user->user_login, $team)) {\n\t\treturn true;\n\t}\n\n\telse {\n\t\treturn false;\n\t}\n\n}", "public function is_team(){\n return $this->account_type == \"Team\" ? true : false;\n }", "function canCreateTeam()\n{\n return isAuthenticated() && !ownsTeams($_SESSION[\"user\"][\"email\"]);\n}", "public function getOwnedByTeam()\n {\n return $this->owned_by_team;\n }", "public function isOrgTeamMember()\n {\n return in_array($this->roleName, [\n self::ROLE_PA_TEAM_MEMBER,\n self::ROLE_PROF_TEAM_MEMBER\n ]);\n }", "public function exists($user, array $teams);", "public function IsInTeam()\n\t{\n\t\treturn $this->IsStaff();\n\t}", "function isOnMyTeam($UID)\n{\n return !empty(getSharedTeams($UID));\n}", "public function hasTeam()\n {\n return $this->getTeam() !== null;\n }", "public function hasTeam()\n {\n return $this->team !== null;\n }", "public function isTeam() {\n return $this->team_or_user instanceof Team;\n }", "public function belongsToTeam($team) : bool\n {\n return $this->teams->contains(function ($t) use ($team) {\n return $t->uuid === $team->uuid;\n }) || $this->ownsTeam($team);\n }", "function isInTheTeam() {\n\n if (isset($this->team['User']) && count($this->team['User'])) {\n foreach ($this->team['User'] as $data) {\n if ($data['items_id'] == Session::getLoginUserID()) {\n return true;\n }\n }\n }\n\n if (isset($_SESSION['glpigroups']) && count($_SESSION['glpigroups'])\n && isset($this->team['Group']) && count($this->team['Group'])) {\n foreach ($_SESSION['glpigroups'] as $groups_id) {\n foreach ($this->team['Group'] as $data) {\n if ($data['items_id'] == $groups_id) {\n return true;\n }\n }\n }\n }\n return false;\n }", "public function hasPermissionOnTeamTo(string $route, TeamInterface $team, Authenticatable $user): bool;", "public function getHasTeam ()\r\n {\r\n return $this->hasTeam;\r\n }", "function oa_core_member_of_team($team_id, $user_id) {\n $cache = &drupal_static(__FUNCTION__);\n\n if (!isset($cache[$team_id][$user_id])) {\n $result = db_select('field_data_field_oa_team_users', 'f')\n ->fields('f', array('field_oa_team_users_target_id'))\n ->condition('field_oa_team_users_target_id', $user_id)\n ->condition('entity_type', 'node')\n ->condition('entity_id', $team_id)\n ->condition('deleted', 0)\n ->execute();\n if ($result->rowCount() > 0) {\n $access = TRUE;\n }\n else {\n // not explicitly in team, but check ownership of team node\n // do NOT use node_load as this is called from hook_node_grants()\n $result = db_select('node', 'n')\n ->fields('n', array('uid'))\n ->condition('nid', $team_id)\n ->execute()\n ->fetchAssoc();\n $access = ($result['uid'] == $user_id) ? TRUE : FALSE;\n }\n $cache[$team_id][$user_id] = $access;\n }\n\n return $cache[$team_id][$user_id];\n}", "function isTeamAdmin() {\n\t$me = $_SESSION['userId'];\n\t$team = $_SESSION['target_team_id'];\n\t$query_admin = \"SELECT team_admin_id FROM team WHERE team_id = '$team' AND team_admin_id = '$me' AND team_status = 'active'\";\n\n global $conn;\n $query_status = mysqli_query($conn, $query_admin);\n if(mysqli_num_rows($query_status) > 0) {\n \treturn true;\n }\n return false;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add one or more members to a sorted set, or update its score if it already exists
public function zadd($key, $score, $member=null) { return $this->sorted_set->zadd($key, $score, $member); }
[ "public function redis_sorted_sets_zScore_float_member_int_score()\n {\n // Start from scratch\n $this->assertGreaterThanOrEqual(0, $this->redis->delete($this->key));\n $total = random_int(1, 10);\n $data = [];\n for ($i = 0; $i < $total; $i++) {\n $member = ($i * 1.1) + 65;\n $value = 1.1 * $i;\n $data[(string) $member] = $value;\n $this->assertEquals(1, $this->redis->zAdd($this->key, $value, $member));\n }\n // T E S T -----------------------------------------------------------\n $member = random_int(1, $total);\n $member = array_keys($data)[$member - 1];\n $score = $this->redis->zScore($this->key, $member);\n $this->assertIsFloat($score);\n $this->assertEquals($data[$member], $score);\n // Remove all the keys used\n $this->assertEquals(1, $this->redis->delete($this->key));\n }", "public function zMscore(string $key, string $member, string ...$other_members): array|false {}", "public function incrementHits()\r\n {\r\n $this->hits += 1;\r\n $this->modified = true;\r\n }", "public function sadd($key, $member);", "function RecruitMembers ($members = array ()) {\n\t$this->MoveMembers ($members, $this->ID, PUBLIC_GROUP_ID);\n}", "public function add(Member $member) {\n\t\tif (!$this->contains($member))\n\t\t\t$this->members[] = $member;\n\t}", "public function updateScore()\n {\n $matchScores = $this->match_scores;\n\n if (sizeof($matchScores) == 0) {\n $this->left_score = 0;\n $this->right_score = 0;\n } elseif (sizeof($matchScores) == 1) {\n $this->left_score = $matchScores[0]->left_score;\n $this->right_score = $matchScores[0]->right_score;\n } else {\n $this->left_score = 0;\n $this->right_score = 0;\n\n foreach ($matchScores as $matchScore) {\n if ($matchScore->left_score > $matchScore->right_score) {\n $this->left_score++;\n } elseif ($matchScore->left_score < $matchScore->right_score) {\n $this->right_score++;\n }\n // Ignore draws\n }\n }\n \n $this->forceSave();\n }", "public function add($member)\n {\n $this->map[$member] = true;\n }", "function addToSet(& $set, $number) {\n\tif (count($set) == 0) {\n\t\tarray_push($set, $number);\n\t}\n\telse {\n\t\t$found = false;\n\t\tfor ($i = 0; $i < count($set); $i = $i + 1) {\n\t\t\tif ($set[$i] == $number) {\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$found) {\n\t\t\tarray_push($set, $number);\n\t\t}\n\t}\n}", "function bbp_viewed_by_add($member, $postid){\n\n\t// check if user id exists\n\tif ( !get_current_user_id() ) {\n\t\treturn;\n\t}\n\n\t// check if the user is already in array\n\t// we don't need to add them if they are already in it\n\t$existing_viewed_by = bbp_viewed_by($postid);\n\tif ( in_array($member, $existing_viewed_by) ) {\n\t\treturn;\n\t}\n\n\t// if the user isn't already in the viewed_by list, add them to it now\n\tadd_post_meta( $postid, 'coopp_viewed_by', $member );\n}", "public function incrementHits()\r\n {\r\n $this->hits += 1;\r\n }", "public function addGroupHTHS()\n { //postfix: make sure all members are in HTHS global group\n $sql = \"SELECT `name` FROM `users`\";\n $resultSet = $this->db->query($sql);\n $total = $resultSet->num_rows();\n for ($i = 0; $i < $total; $i++) {\n $row = $resultSet->row_array($i);\n if (!$this->datamod->inGroup($row['name'], 'hths')) //prevent duplicate additions to hths group\n $this->datamod->addgroup($row['name'], 'hths');\n }\n\n }", "public function add_score() {\n $this->score;\n $this->totalscore = 0;\n\n foreach($this->score as $score_value) {\n $this->totalscore += $score_value;\n };\n\n $this->check_hand();\n\n //Set aces to value 1 if necessary\n while (($this->totalscore > 21) AND ($this->aces > 0)) {\n $this->totalscore -= 10;\n $this->aces--;\n }\n\n }", "public static function bulkInsertOrUpdate(array $members) {\n $arguments = array();\n foreach ($members as $member) {\n if (is_array($member)) {\n $arguments[] = new GroupHealthMember($member);\n }\n else {\n $arguments[] = $member;\n }\n }\n $results = HttpClient::post('/GroupHealthMember/BulkInsertOrUpdateGroupHealthMember', $arguments);\n return $results;\n }", "public function setMembers($members);", "function addMatchStats($matches, $user) {\r\n foreach ($matches as $i => $match) {\r\n // compute the average score and std. dev. and append it to the match array\r\n $avg = '';\r\n $your = '';\r\n $stddev = '';\r\n $ranking = $this->i_matchRanking($match['matchId']);\r\n $sum = 0;\r\n $count = 0;\r\n $sumsq = 0;\r\n foreach ($ranking as $uid => $score) {\r\n if ($uid == $user) $your = $score['points'];\r\n $sc = $score['points'];\r\n $sum += $sc;\r\n $sumsq += $sc * $sc;\r\n $count++;\r\n }\r\n if ($count > 0) $avg = round($sum / $count, 3);\r\n if ($count > 1) $stddev = round(sqrt(($sumsq - $sum * $avg) / ($count - 1)), 3);\r\n\r\n $match['averageScore'] = $avg;\r\n $match['yourScore'] = $your;\r\n $match['stdDev'] = $stddev;\r\n $match['normAverageScore'] = $this->i_normalizeScore($avg);\r\n $match['normYourScore'] = $this->i_normalizeScore($your);\r\n $match['normStdDev'] = $this->i_normalizeScore($stddev);\r\n\r\n $matches[$i] = $match;\r\n }\r\n return $matches;\r\n }", "public function addMembers(Collection $members)\n {\n foreach ($members as $member) {\n $this->addMember($member);\n }\n }", "public function run()\n {\n if (!is_null($this->data)) {\n $this->members = Member::all();\n\n //set scores\n foreach ($this->data as $policy_id => $agrees) {\n foreach ($this->members as $member) {\n $position = PolicyPosition::where('member_id', $member->id)\n ->where('policy_id', $policy_id)\n ->first();\n\n if (!is_null($position)) {\n if ($agrees) {\n $score = 1 - $position->distance;\n } else {\n $score = $position->distance;\n }\n\n if (array_key_exists($member->id, $this->memberScores)) {\n $this->memberScores[$member->id] += $score;\n } else {\n $this->memberScores[$member->id] = $score;\n }\n }\n }\n }\n\n //find highest score\n $highest_score = 0;\n $match_id = null;\n\n foreach ($this->memberScores as $member_id => $score) {\n if ($score > $highest_score) {\n $highest_score = $score;\n $match_id = $member_id;\n }\n }\n\n $this->match = Member::find($match_id);\n }\n }", "public function add($value) : SetCollection;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get list organisation for XmlHttpRequest need for add organisation into application route /admin/organisation/getorg?search=keysearch&page=page_number&page_limit=page_limit
public function getOrgAction() { $page = $this->params()->fromQuery('page', 1); $limit = (int) $this->params()->fromQuery('page_limit', 10); $search = $this->params()->fromQuery('search'); /** * Only get organistion not has user with user_id equal this params * If not set will return all. */ $notHasUser = $this->params()->fromQuery('not_has_user'); $offset = ($page - 1) * $limit; $sl = $this->getServiceLocator(); $orgIds = array(); if ($notHasUser) { /* @var $userOrg \HtAuthentication\Model\UserOrganisation */ $userOrgModel = $sl->get('UserOrg'); $userOrgs = $userOrgModel->getAll(array('user_id' => $notHasUser)); foreach ($userOrgs as $userOrg) { $orgIds[] = $userOrg->getOrganisationId(); } } $where = function (Select $select) use ($search, $orgIds) { $select->where->like('title', "%{$search}%"); if (!empty($orgIds)) { $predicate = new NotIn('organisation_id', $orgIds); $select->where->addPredicate($predicate); } }; /* @var $organisation \HtAuthentication\Model\Organisation */ $organisation = $sl->get('Org'); $total = $organisation->count($where); $results = $organisation->getAll($where, $offset, $limit); $organisations = $results->toArray(); return new JsonModel(array( 'total' => $total, 'organisations' => $organisations )); }
[ "public function getOrgAction()\n {\n // authorize the request\n require 'module/Users/src/Users/Tools/AuthUser.php';\n \n // get org id from param\n $id = $_GET['id'];\n $id = (int) $id;\n // get org from orgtable by id\n $orgTable = $this->getServiceLocator()->get('OrgnizationTable');\n try {\n $org = $orgTable->getOrgnizationById($id);\n } catch (\\Exception $e) {\n return $this->returnJson(false);\n }\n \n // return Json org\n return $this->returnJson($org);\n }", "public function getOrganizations(){\n $url = $this->urlBase.\"/organizations\".$this->apiToken;\n $opts = array(\n 'http'=>array(\n 'method'=>\"GET\",\n )\n );\n $context = stream_context_create($opts);\n // gets json string using the HTTP headers set above\n $data = file_get_contents($url, false, $context);\n //let's decode json\n $json = json_decode($data,true)[\"data\"];\n $result = [];\n // Lets yield id, name, people_count, address_formatted_address and of course notes\n foreach($json as $k => $OrgData){\n $result[$k][\"id\"] = $OrgData[\"id\"];\n $result[$k][\"name\"] = $OrgData[\"name\"];\n $result[$k][\"adress\"] = $OrgData[\"address_formatted_address\"];\n $result[$k][\"people_count\"] = $OrgData[\"people_count\"];\n //can be null\n $result[$k][\"notes\"] = (int) $OrgData[\"notes_count\"] > 0 ? $this->getNotesById($result[$k][\"id\"],'org') : null;\n }\n \n return $result;\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 get_list_org() {\r\n\t\trequire_once 'role_aksi.php';\r\n\t\t$role_aksi = new role_aksi($this->Command);\r\n\r\n\t\t$role = $role_aksi->getModelByUsername($this->Command->getUserLogged()->get_username());\r\n\t\t$tingkat_organisasi = $role->TINGKAT_ORGANISASI;\r\n\t\t$this->model = new role_detail();\r\n\t\t$this->model->set_role($role->ID_ROLE);\r\n\t\t$role_details = $this->svc->select_model($this->model);\r\n\t\t$list_id = array();\r\n\t\tforeach ($role_details as $r_d) {\r\n\t\t\t$list_id[] = $r_d->ORGANISASI;\r\n\t\t}\r\n\t\t\r\n\t\t$result['tingkat_organisasi'] = $tingkat_organisasi;\r\n\t\t$result['organisasi'] = $list_id;\r\n\t\treturn $result;\r\n\t}", "public function organisationAction() {\n if($this->_getParam('id',false)){\n $this->view->orgs = $this->_organisations\n ->getOrgDetails($this->_getParam('id'));\n $this->view->members = $this->_organisations\n ->getMembers($this->_getParam('id'));\n } else {\n throw new Pas_Exception_Param($this->_missingParameter, 500);\n }\n }", "public function getOrganisations(){\n return CHtml::listData(Organisation::model()->findAll(),'id','name');\n \n }", "function get_organizations_list()\n {\n return \\App\\Organization::where('id', '>', 1)->lists('name', 'id')->all();\n\n }", "protected function getOrganization() {\n $account_id = $this->getAccountId();\n $data = $this->get('https://www.drupal.org/api-d7/node.json?type=organization&title=' . urlencode($account_id));\n if (isset($data['list']) && count($data['list']) === 1) {\n return reset($data['list']);\n }\n else {\n return [];\n }\n }", "public function list_projects_and_organizations() {\n\n\t\tif ( file_exists( Config::get_config( 'organization_file' ) ) ) {\n\t\t\t$organizations = file_get_contents( Config::get_config( 'organization_file' ) );\n\t\t}\n\n\t\tif ( empty( $organizations ) ) {\n\t\t\t$organizations = Authentication::login()->organizations;\n\t\t}\n\n\t\tif ( ! is_array( $organizations ) ) {\n\t\t\t$organizations = json_decode( $organizations );\n\t\t}\n\n\t\tforeach ( $organizations as $organization ) {\n\n\t\t\techo \"- Organization name: {$organization->name}\\n\";\n\t\t\techo \"- Organization uuid: {$organization->uuid}\\n\";\n\n\t\t\t$projects = $this->get_projects( $organization->uuid );\n\n\t\t\tif ( $projects === false ) {\n\t\t\t\techo \"No projects \\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( $projects->projects as $project ) {\n\t\t\t\techo \"--- Project name: {$project->name}\\n\";\n\t\t\t\techo \"--- Project uuid: {$project->uuid}\\n\";\n\t\t\t}\n\n\t\t}\n\t}", "private function getOrganizations() {\n try {\n $this->presenter->presentResponse(\n $this->organizationsService->getOrganizations());\n }\n catch (ServiceException $e) {\n $this->presenter->presentException($e);\n }\n }", "public static function getOrganizations() {\n }", "private static function getRestOrganizations() {\n $organizations = [];\n $connection = self::get_connection();\n $stmt = $connection->prepare(\n \"EXECUTE GetPartnerOrgs\"\n );\n if ($stmt->execute()) {\n $organizations = array_merge([],$stmt->fetchAll(PDO::FETCH_ASSOC));\n }\n\n return $organizations;\n }", "public function search_org()\n\t{\n\t $this->data['orgs'] = $this->employer->search_org($this->input->post('search_text'), 0, 10);\n\t $this->data['pagination'] = '';\n\t \n\t // Check if no results\n\t if (!$this->data['orgs'])\n\t {\n\t redirect('/admin/orgs', 'refresh');\n\t return;\n\t }\n\t \n\t $this->load->view('global_header.php', $this->data);\n\t\t$this->load->view('admin/orgs.php', $this->data);\n\t\t$this->load->view('global_footer.php');\n\t}", "public function getOrganizaciones(){\n\n $organizaciones = Organizacion::getOrganizaciones();\n\n foreach( $organizaciones as $organizacion ){\n $organizacion['necesidades'] = Necesidad::listarNecesidadesPantallaPrincipal( $organizacion->idUsuario );\n }\n\n return json_encode([\n 'organizaciones' => $organizaciones\n ]);\n }", "public function scrapeCentralOrganizationList() {\n $json = ScraperUtils::grabber(\"https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsonlist&name=cz_public_organizations_2_details&query=select%20*%20from%20swdata\");\n\t $array = json_decode($json);\n\t return array('central_organization' => $array);\n }", "private function fetchUserOrganizations() {\n $response = $this->request->pagedRequest(\n 'users/' . Session::getValue('user_uuid') . '/memberships/organizations'\n );\n\n $data = array();\n foreach ($response['data'] as $membership) {\n if ($membership->role == 'unprivileged') {\n // Users with unprivileged role in organizations can't see organization\n // sites, but must be added to the team\n continue;\n }\n\n $data[] = array(\n 'id' => $membership->id,\n 'name' => $membership->organization->profile->name,\n 'type' => 'organization'\n );\n }\n\n return $data;\n }", "public function all()\n {\n return $this->get('/user/memberships/orgs');\n }", "public function organisations()\n {\n dd($this->afasOrganisationRepository->all());\n }", "public function getOrganization();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the index of the specified color + alpha or its closest possible alternative
function imagecolorresolvealpha ($image, $red, $green, $blue, $alpha) {}
[ "function imagecolorclosestalpha($im, $red, $green, $blue, $alpha) {}", "function gd_color_closest_alpha ($image, $red, $green, $blue, $alpha)\n{\n return imagecolorclosestalpha($image, $red, $green, $blue, $alpha);\n}", "function imagecolorclosestalpha($image, $red, $green, $blue, $alpha)\n{\n return 0;\n}", "public function getColorIndex();", "#[Pure]\nfunction imagecolorclosest(GdImage $image, int $red, int $green, int $blue): int {}", "function imagecolorclosest($image, $red, $green, $blue)\n{\n return 0;\n}", "function gd_color_closest ($image, $red, $green, $blue)\n{\n return imagecolorclosest($image, $red, $green, $blue);\n}", "function imagecolorclosest($image, $red, $green, $blue)\n {\n }", "function imagecolorclosesthwb ($image, $red, $green, $blue) {}", "function imagecolorclosesthwb($image, $red, $green, $blue){}", "function imagecolorclosesthwb($im, $red, $green, $blue) {}", "public function colorAt($index) \n {\n $sampleCount = $this->samples[$index * 5 + self::IDX_COUNT];\n $alphaSum = $this->samples[$index * 5 + self::IDX_A];\n return $sampleCount == 0 || $alphaSum == 0 ? 0 :\n ColorUtils::from(\n (int)($alphaSum / $sampleCount),\n (int)($this->samples[$index * 5 + self::IDX_R] / $alphaSum),\n (int)($this->samples[$index * 5 + self::IDX_G] / $alphaSum),\n (int)($this->samples[$index * 5 + self::IDX_B] / $alphaSum)\n );\n }", "private function getPaletteIndex($color/*Array*/){\n\t\t\tfor($i = 0; $i < count($this->colors); $i++){\n\t\t\t\tif($this->colors[$i] == $color){\n\t\t\t\t\treturn $i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->palette[] = imagecolorallocate($this->image,$color[0],$color[1],$color[2]);\n\t\t\t$this->colors[] = $color;\n\n\t\t\treturn count($this->palette)-1;\n\t\t}", "function imagecolorsforindex ($image, $index) {}", "function pickcolor($img, $data_array, $row, $col)\n{\n$d = $data_array[$row][$col+1]; // col+1 skips over the row's label\nif ($d >= 80) return 0;\nif ($d >= 60) return 1;\nreturn 2;\n}", "function sage_closest_color($hex) {\n // these are not the actual rgb values\n $colors = array('WHITE' => '#FFFFFF', 'BRAND' => '#E5921B', 'BLACK' => '#000000');\n\n $deviation = PHP_INT_MAX;\n $closestColor = \"\";\n foreach ($colors as $name => $rgbColor) {\n $diff = sage_color_diff($rgbColor, $hex);\n if ( $diff < $deviation) {\n $deviation = $diff;\n $closestColor = $name;\n }\n\n }\n return $closestColor;\n\n}", "function gd_colors_for_index ($image, $index)\n{\n return imagecolorsforindex($image, $index);\n}", "public function findSplitPoint()\n {\n $longestDimension = $this->getLongestColorDimension();\n\n // We need to sort the colors in this box based on the longest color dimension.\n // As we cant use a Comparator to define the sort logic, we modify each color so that\n // its most significant is the desired dimension.\n $this->colorCutQuantizer->modifySignificantOctet($longestDimension, $this->lowerIndex, $this->upperIndex);\n\n // Get array to be sorted\n $colors = array_slice($this->colorCutQuantizer->getColors(), $this->lowerIndex, $this->upperIndex - $this->lowerIndex + 1);\n\n sort($colors);\n\n // Now revert all of the colors so that they are packed a RGB again\n $this->colorCutQuantizer->modifySignificantOctet($longestDimension, $this->lowerIndex, $this->upperIndex);\n\n $dimensionMidPoint = $this->midPoint($longestDimension);\n\n for ($i = $this->lowerIndex; $i <= $this->upperIndex; $i++) {\n $color = $this->colorCutQuantizer->getColors()[$i];\n\n switch ($longestDimension) {\n case ColorCutQuantizer::COMPONENT_RED:\n if (Color::red($color) >= $dimensionMidPoint) {\n return $i;\n }\n break;\n case ColorCutQuantizer::COMPONENT_GREEN:\n if (Color::green($color) >= $dimensionMidPoint) {\n return $i;\n }\n break;\n case ColorCutQuantizer::COMPONENT_BLUE:\n if (Color::blue($color) >= $dimensionMidPoint) {\n return $i;\n }\n break;\n }\n }\n\n return $this->lowerIndex;\n }", "function roundToClosest($color)\n{ \n if($color > 255){\n $color = 255;\n }elseif($color < 0){\n $color = 0;\n }\n return $color;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
True if system call handlers that are are not in the expected kernel or module code regions are present. Generated from protobuf field bool unexpected_system_call_handler = 7;
public function setUnexpectedSystemCallHandler($var) { GPBUtil::checkBool($var); $this->unexpected_system_call_handler = $var; return $this; }
[ "protected function hasSystemCallBeenInterrupted()\n {\n $lastError = error_get_last();\n\n // stream_select returns false when the `select` system call is interrupted by an incoming signal\n return isset($lastError['message']) && false !== stripos($lastError['message'], 'interrupted system call');\n }", "public function isSystemCall() {\n\t\treturn !( $this->user instanceof User );\n\t}", "final public static function signals() {\n\n return function_exists(\"pcntl_signal\");\n\n }", "public function setUnexpectedInterruptHandler($var)\n {\n GPBUtil::checkBool($var);\n $this->unexpected_interrupt_handler = $var;\n\n return $this;\n }", "public function isHandledCode()\n {\n return array_key_exists($this->returnCode, $this->getHandledCodes());\n }", "public function testUnknownHandler()\n {\n $registry = new HandlerRegistry;\n\n self::assertFalse($registry->has('signal'));\n self::assertIsCallable($handler = $registry->get('signal'));\n\n self::expectException(Exception\\UnknownSignal::class);\n\n $handler();\n }", "public function isSystemException()\n {\n return ($this->getCode() <= 0 ) ? true : false;\n }", "public function isHandled(): bool\n {\n return $this->handled;\n }", "public function testHandleErrorWithoutErrorHandler()\n {\n $this->testHandleError(true);\n }", "protected function hasHandlers(): bool\n {\n return !empty(config('resumablejs.handlers', false));\n }", "public function hasCatchCallbacks()\n {\n return isset($this->options['catch']) && ! empty($this->options['catch']);\n }", "public function isUnhandled()\n {\n foreach ($this->backtrace as $frame) {\n $this->processFrame($frame);\n\n // stop iterating early if we know we're done\n if ($this->state === self::STATE_DONE) {\n break;\n }\n }\n\n return $this->unhandled;\n }", "public function hasProcessControlFunctions()\n {\n return function_exists('proc_open');\n }", "public function setUnexpectedFtraceHandler($var)\n {\n GPBUtil::checkBool($var);\n $this->unexpected_ftrace_handler = $var;\n\n return $this;\n }", "private function checkShellAccess(): bool\n\t\t{\n\t\t\t$disabled = explode(',', ini_get('disable_functions'));\n\n\t\t\t// if exec is within the disabled functions section of the php.ini, return false\n\t\t\treturn ! in_array('exec', $disabled);\n\t\t}", "function _isdef_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) {\n $GLOBALS['_isdef_error_detected'] = TRUE;\n return TRUE;\n}", "public function checkForSignals()\n {\n if ($this->hasPcntl === false) {\n return;\n }\n\n pcntl_signal_dispatch();\n }", "public function isSupported()\n {\n return function_exists('pcntl_signal');\n }", "protected function supportsAsyncSignals()\n {\n return extension_loaded('pcntl');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of resetpassword.
public function getResetpassword() { return $this->resetpassword; }
[ "public function getPasswordresettoken()\n\t{\n\t\treturn $this->passwordresettoken;\n\t}", "public function getPasswordReset(){\n return $this->password_reset;\n }", "public function getPasswordResetToken()\n {\n return $this->password_reset_token;\n }", "public function getPasswordReset()\n {\n return $this->passwordReset;\n }", "public function getPasswordResetToken()\n {\n return $this->passwordResetToken;\n }", "public function getResetPasswordToken()\n {\n return $this->passwordResetToken;\n }", "public function getResetPasswordToken()\n {\n return $this->resetPasswordToken;\n }", "public function getResetPasswordCode() {\n return $this->reset_password_code;\n }", "public static function getResetTokenField(): string;", "public function getResetPasswordToken();", "public function getResetPassword()\n {\n\t\t$http_request = Application::getHTTPRequest();\n if(isset($http_request->getGetData()['token']) && isset($http_request->getGetData()['id']))\n {\n $user_manager = new UserManager;\n $this->response['token_validity'] = $user_manager->testTokenValidity($http_request->getGetData()['id'], $http_request->getGetData()['token']);\n if(isset($this->post_params['reset-password']) && $this->response['token_validity'])\n {\n $this->response['reset_password_error'] = $user_manager->resetPassword(\n\t\t\t\t$http_request->getGetData()['id'],\n\t\t\t\t$http_request->getGetData()['token'],\n\t\t\t\t$this->post_params['password'],\n\t\t\t\t$this->post_params['retype_password']);\n } \n }\n }", "public function getPasswordResetToken();", "function getPassword() {\n return $this->getFieldValue('password');\n }", "public function getEmailForPasswordReset();", "public function getPassword() {\n\t return $this->getValue(self::FIELD_PASSWORD);\n\t}", "public function getTokenpassword()\n {\n return $this->tokenpassword;\n }", "public function getPassword() {}", "public function getPasswordResetKey()\n {\n return $this->definition->getPasswordResetKey($this);\n }", "public function getPassword()\n {\n return isset($this->Password) ? $this->Password : null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Init all days for being displayed
protected function initDays() { $this->initShortModes(); $this->initEmptyDays(); $Statement = $this->DatasetQuery->statementToFetchActivities($this->TimestampStart, $this->TimestampEnd); while ($Training = $Statement->fetch()) { $w = Time::diffInDays($Training['time'], $this->TimestampStart); if ( in_array($Training['typeid'], $this->TypesShort) || (!in_array($Training['typeid'], $this->TypesNotShort) && in_array($Training['sportid'], $this->SportsShort)) ) { $this->Days[$w]['shorts'][] = $Training; } else { $this->Days[$w]['trainings'][] = $Training; } $this->AllDaysEmpty = false; } if (\Runalyze\Configuration::DataBrowser()->reverseMode()) { $this->Days = array_reverse($this->Days); } }
[ "protected function setUpDayDisplay()\n {\n $arrayPointer = $this->firstDayOfWeek;\n $shortNames = explode(\" \", $this->__(/* !First Letter of each Day of week */'S M T W T F S'));\n $longNames = explode(\" \", $this->__('Sunday Monday Tuesday Wednesday Thursday Friday Saturday'));\n for ($i = 0; $i < 7; $i++) {\n if ($arrayPointer >= 7) {\n $arrayPointer = 0;\n }\n $this->dayDisplay['long'][$i] = $longNames[$arrayPointer];\n $this->dayDisplay['short'][$i] = $shortNames[$arrayPointer];\n $arrayPointer++;\n }\n // clone DateTime objects for later modification\n $firstClone = clone $this->requestedDate;\n $firstClone->modify(\"first day of this month\");\n $dayClone = clone $this->requestedDate;\n switch ($this->firstDayOfWeek) {\n case self::MONDAY_IS_FIRST:\n $this->dayDisplay['firstDayOfMonth'] = $firstClone->modify(\"-1 day\")->format(\"w\");\n $this->dayDisplay['dayOfWeek'] = $dayClone->modify(\"-1 day\")->format(\"w\");\n $this->dayDisplay['colclass'][5] = \"pcWeekend\";\n $this->dayDisplay['colclass'][6] = \"pcWeekend\";\n break;\n case self::SATURDAY_IS_FIRST:\n $this->dayDisplay['firstDayOfMonth'] = $firstClone->modify(\"+1 day\")->format(\"w\");\n $this->dayDisplay['dayOfWeek'] = $dayClone->modify(\"+1 day\")->format(\"w\");\n $this->dayDisplay['colclass'][0] = \"pcWeekend\";\n $this->dayDisplay['colclass'][1] = \"pcWeekend\";\n break;\n case self::SUNDAY_IS_FIRST:\n default:\n $this->dayDisplay['firstDayOfMonth'] = $firstClone->format(\"w\");\n $this->dayDisplay['dayOfWeek'] = $this->requestedDate->format('w');\n $this->dayDisplay['colclass'][0] = \"pcWeekend\";\n $this->dayDisplay['colclass'][6] = \"pcWeekend\";\n break;\n }\n }", "protected function initDefaultNumberOfDays() {}", "private function calendar()\n {\n $calendars = array_map(\n function( $item ){ return basename( $item, '.png' ); },\n array_values ( Kohana::list_files( 'images' . DIRECTORY_SEPARATOR . 'calendar', [ DOCROOT ] ) )\n );\n \n $m = date( 'm' );\n $y = date( 'Y' );\n\n $actual = array_search( sprintf( '%d_%s', $y, $m ), $calendars );\n\n $this->_page->content = View::factory( 'front/tplt/front_tplt_calendar',\n [\n 'actual' => $actual,\n 'months' => __( 'months' ),\n 'm' => $m,\n 'y' => $y,\n 'calendars' => $calendars\n ] );\n\n array_push( $this->styles, 'almafont', 'magnific-popup' );\n\n array_push( $this->scripts, 'magnific-popup', 'calendar' );\n }", "protected function drawDays() {\n\n $this->now = new \\DateTime(\"Now\", new \\DateTimeZone(\"America/Detroit\"));\n $this->calendar .= \"\\t<tr>\\n\";\n $x = 1;\n while ($x <= 7) {\n if ($this->selectedMonth->format('n') === $this->current->format('n')) {\n $this->currentDays();\n } else {\n $this->calendar .= \"\\t\\t\" . '<td class=\"fade\">' . $this->current->format(\"j\") . '</td>' . \"\\n\";\n }\n\n $this->current->modify(\"+1 day\");\n $x += 1;\n }\n $this->calendar .= \"\\t</tr>\\n\";\n }", "protected function setDates()\n\t{\n\t\t$this->today = date(\"Y-m-d\", strtotime(\"today\"));\n $this->thisWeek = date(\"W\", strtotime(\"this week\"));\n $this->nextTwoWeeks = date(\"U\", strtotime(\"+2 weeks 11:59pm\"));\n\t}", "function initialize_events() {\n global $daily_events, $calendardata, $month, $day, $year;\n\n for ($i=7;$i<23;$i++){\n if ($i<10){\n $evntime = '0' . $i . '00';\n } else {\n $evntime = $i . '00';\n }\n $daily_events[$evntime] = 'empty';\n }\n\n $cdate = $month . $day . $year;\n\n if (isset($calendardata[$cdate])){\n\t\tforeach($calendardata[$cdate] as $calfoo) {\n $daily_events[\"$calfoo[key]\"] = $calendardata[$cdate][$calfoo['key']];\n }\n }\n}", "private static function initDaysOffSettings()\n {\n self::initSettings('daysOff', []);\n }", "public function calendar() {\n\t\t$c = new Calendar();\n\n\t\t$dados = array(\n\t\t\t'linhas' => $c->getDiaLinhas(),\n\t\t\t'dia_inicio' => $c->getDiaInicio(),\n\t\t\t'mes_atual' => $c->getMesAtual(),\n\t\t\t'mes_nome' => $c->getMesNome(),\n\t\t\t'roms' => $c->getRoms(),\n\t\t\t'qt' => $c->getQt(),\n\t\t\t'report' => $c->getReport(),\n\t\t\t'profit' => $c->getProfit(),\n\t\t\t'profit_month' => $c->getProfitMonth(),\n\t\t\t'profit_now' => $c->getProfitNow()\n\t\t);\n\n\t\t\n\t\t$this->loadTemplate('projects/calendar', $dados);\n\t}", "function Calendar() {\r\n\t}", "public function initDays(): bool {\n $this->days = [0 => [], 1 => [], 2 => [], 3 => [], 4 => [], 5 => [], 6 => []];\n $this->currentDay = 0;\n return true;\n }", "function show_events_cal() {\n global $txtf;\n\n $structure = $this->vars['structure'];\n $content = $this->vars['content'];\n $day = $this->vars['day'];\n $month = $this->vars['month'];\n $year = $this->vars['year'];\n $hour = $this->vars['hour'];\n $minute = $this->vars['minute'];\n\n $sq = new sql;\n\n if ($this->vars[\"structure\"] && !$this->vars[\"content\"]) {\n $this->url_page = $_SERVER['PHP_SELF'] . \"?structure=\".$this->vars[\"structure\"];\n }\n else if ($this->vars[\"structure\"] && $this->vars[\"content\"]) {\n $this->url_page = $_SERVER['PHP_SELF'] . \"?structure=\".$this->vars[\"structure\"].\"&content=\".$this->vars[\"content\"];\n }\n else {\n $this->url_page = \"?\";\n }\n\n if (!$this->url) {\n $this->url = $this->url_page;\n }\n\n if (!ereg(\"\\?\", $this->url)) $this->url .= \"?\";\n if (!ereg(\"\\?\", $this->url_page)) $this->url_page .= \"?\";\n\n\n $month_name = array (\"\", $txtf->display(\"month_1\"), $txtf->display(\"month_2\"), $txtf->display(\"month_3\"), $txtf->display(\"month_4\"), $txtf->display(\"month_5\"), $txtf->display(\"month_6\"), $txtf->display(\"month_7\"), $txtf->display(\"month_8\"), $txtf->display(\"month_9\"), $txtf->display(\"month_10\"), $txtf->display(\"month_11\"), $txtf->display(\"month_12\"));\n $day_name = array($txtf->display(\"day_1\"), $txtf->display(\"day_2\"), $txtf->display(\"day_3\"), $txtf->display(\"day_4\"), $txtf->display(\"day_5\"), $txtf->display(\"day_6\"), $txtf->display(\"day_0\"));\n\n $datime = time();\n\n if(!isset($month) || !is_numeric($month)) {\n $month = date(\"n\", $datime);\n }\n\n if(!isset($year) || !is_numeric($year)) {\n $year = date(\"Y\", $datime);\n }\n\n if ($month == date(\"n\",$datime) && $year == date(\"Y\",$datime)) {\n $today = date(\"j\", $datime);\n }\n\n if(!isset($hour)) $hour = date(\"H\");\n if(!isset($minute)) $minute = date(\"i\");\n\n // ########################################\n\n // instantiate template class\n $tpl = new template;\n $tpl->setCacheLevel($this->cachelevel);\n $tpl->setCacheTtl($this->cachetime);\n $usecache = checkParameters();\n\n $dirname_this = dirname($_SERVER[\"PHP_SELF\"]);\n\n if (substr($dirname_this, -5) == \"admin\" && basename($_SERVER[\"PHP_SELF\"]) != \"index.php\") {\n $template = $this->template;\n }\n else {\n $template = $GLOBALS[\"templates_\".$this->language][$this->tmpl][1] . \"/\" . $this->template;\n }\n\n $tpl->setInstance($_SERVER['PHP_SELF'].\"?language=\".$this->language.\"&module=calendar&day=$day&month=$month&year=$year\");\n $tpl->setTemplateFile($template);\n\n // PAGE CACHED\n if ($tpl->isCached($template) == true && $usecache == true) {\n $GLOBALS[\"caching\"][] = \"calendar\";\n if ($GLOBALS[\"modera_debug\"] == true) {\n return \"<!-- module calendar cached -->\\n\" . $tpl->parse();\n }\n else {\n return $tpl->parse();\n }\n }\n\n $lastmonth = $month - 1;\n $lastyear = $year;\n if ($lastmonth < 1) { $lastmonth = 12; $lastyear = $year - 1; }\n $tpl->addDataItem(\"URL_PREVIOUS\", $this->url . \"&year=$lastyear&month=$lastmonth\");\n\n $nextmonth = $month + 1;\n $nextyear = $year;\n if ($nextmonth > 12) { $nextmonth = 1; $nextyear = $year + 1; }\n $tpl->addDataItem(\"URL_NEXT\", $this->url . \"&year=$nextyear&month=$nextmonth\");\n $tpl->addDataItem(\"CURRENT_MONTH\", $month_name[$month] . \" \" . $year);\n\n $wdays = \"<th class=\\\"static\\\">\" . $txtf->display(\"week_short\") . \"</th>\\n\";\n for ($c = 0; $c < 7; $c++) {\n $wdays .= \"<th>\".substr($day_name[$c],0,1).\"</th>\\n\";\n }\n\n $tpl->addDataItem(\"WEEKDAYS\", $wdays);\n\n // ####\n // Initial empty days\n $c = 1;\n $firstmonday = date(\"w\", mktime(0,0,0,$month, 1, $year));\n if ($firstmonday == 0) $firstmonday = 7;\n $dayz = \"<tr>\\n\";\n // WEEK NUMBER\n if ($c != $firstmonday) {\n $wn = date(\"W\", mktime(0, 0, 0, $month, $c, $year)) + 0;\n $dayz .= \"<td class=\\\"static\\\">\" . $wn . \"</td>\\n\";\n\n while ($firstmonday > $c) {\n $dayz .= \"<td>&nbsp;</td>\\n\";\n $c++;\n }\n }\n // ####\n\n for ($c = 1; $c <= 31; $c++) {\n $wd = date(\"w\", mktime(0, 0, 0, $month, $c, $year));\n if (!$wd) {\n $wd = 7;\n }\n\n // TODAY\n if($c == $today) {\n $daystyle = \"today\";\n }\n elseif($c != $today) {\n $daystyle = \"\";\n }\n if ($wd == 6 || $wd == 7) {\n $daystyle = ($daystyle ? $daystyle . \" \" : \"\") . \"sunday\";\n }\n\n\n // SELECTED DAY\n// if ($c == $day) { $daystyle = \"selected\"; }\n\n if ($wd == 1) { // monday\n $dayz .= \"<tr>\\n\";\n // WEEK NUMBER\n $wn = date(\"W\", mktime(0, 0, 0, $month, $c, $year)) + 0;\n $dayz .= \"<td class=\\\"static\\\">\" . $wn . \"</td>\\n\";\n }\n\n if (checkdate($month, $c, $year)) {\n if (is_array($this->events[$year][$month][$c])) {\n $dayz .= \"<td class=\\\"$daystyle\\\"><a href=\\\"\".$this->url.\"&day=\".$c.\"&month=\".$month.\"&year=\".$year.\"\\\"><b>$c</b></a></td>\\n\";\n }\n else {\n $dayz .= \"<td class=\\\"$daystyle\\\"><a href=\\\"\".$this->url.\"&day=\".$c.\"&month=\".$month.\"&year=\".$year.\"\\\">$c</a></td>\\n\";\n }\n }\n\n if ($wd == 7) { // sunday\n $dayz .= \"</tr>\\n\";\n }\n }\n\n if ($wd < 7) {\n for ($i = $wd; $i <= 7; $i++) {\n $dayz .= \"<td>&nbsp;</td>\\n\";\n }\n $dayz .= \"</tr>\\n\";\n }\n\n $tpl->addDataItem(\"DAYS\", $dayz);\n\n $f_hour = \"\";\n for ($c = 0; $c < 24; $c++) {\n if ($c < 10) $z = \"0\" . $c;\n else { $z = $c; }\n if ($hour == $z) $sel = \"selected\";\n else { $sel = \"\"; }\n $f_hour .= \"<option value=\\\"$z\\\" $sel>$z</option>\\n\";\n }\n $f_minute = \"\";\n for ($c = 0; $c < 60; $c = $c + 5) {\n if ($c < 10) $z = \"0\" . $c;\n else { $z = $c; }\n if ($minute == $z) $sel = \"selected\";\n else { $sel = \"\"; }\n $f_minute .= \"<option value=\\\"$z\\\" $sel>$z</option>\\n\";\n }\n\n // Hours\n $tpl->addDataItem(\"HOURS\", $f_hour);\n // Minutes\n $tpl->addDataItem(\"MINUTES\", $f_minute);\n\n if (!$day) $day = date(\"j\");\n\n $tpl->addDataItem(\"DAY\", $day);\n $tpl->addDataItem(\"MONTH\", $month);\n $tpl->addDataItem(\"YEAR\", $year);\n $tpl->addDataItem(\"HOUR\", $hour);\n $tpl->addDataItem(\"MINUTE\", $minute);\n $tpl->addDataItem(\"FIELD\", $this->field);\n $tpl->addDataItem(\"TYPE\", $_GET[\"type\"]);\n\n // ####\n return $tpl->parse();\n\n }", "protected function init_week_days() {\n\n\t\t// Day values\n\t\t$days = array(\n\t\t\t'0' => 'sunday',\n\t\t\t'1' => 'monday',\n\t\t\t'2' => 'tuesday',\n\t\t\t'3' => 'wednesday',\n\t\t\t'4' => 'thursday',\n\t\t\t'5' => 'friday',\n\t\t\t'6' => 'saturday'\n\t\t);\n\n\t\t// Get the day index\n\t\t$index = array_search( $this->start_of_week, array_keys( $days ) );\n\t\t$start = array_slice( $days, $index, count( $days ), true );\n\t\t$finish = array_slice( $days, 0, $index, true );\n\n\t\t// Set days for week\n\t\t$this->week_days = $start + $finish;\n\t}", "public function dayview()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\t$db = JFactory::getDbo();\n\t\t$view = $this->getView('pbbooking','html');\n\n\t\t$dateparam = $input->get('dateparam',date_create(\"now\",new DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),'string');\n\t\t$view->dateparam = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$cals = $db->setQuery('select * from #__pbbooking_cals')->loadObjectList();\n\t\t$config = $db->setQuery('select * from #__pbbooking_config')->loadObject();\n\t\t$opening_hours = json_decode($config->trading_hours,true);\n\t\t$start_time_arr = str_split($opening_hours[(int)$view->dateparam->format('w')]['open_time'],2);\n\t\t$end_time_arr = str_split($opening_hours[(int)$view->dateparam->format('w')]['close_time'],2);\n\n\t\t$view->cals = array();\n\t\t$view->opening_hours = $opening_hours[(int)$view->dateparam->format('w')];\n\t\t$view->day_dt_start = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$view->day_dt_end = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$view->day_dt_start->setTime($start_time_arr[0],$start_time_arr[1],0);\n\t\t$view->day_dt_end->setTime($end_time_arr[0],$end_time_arr[1],0);\n\t\t$view->config = $config;\n\n\t\t//step back one time slot on $view->day_dt_end\n\t\t$view->dt_last_slot = clone $view->day_dt_end;\n\t\t$view->dt_last_slot->modify('- '.$config->time_increment.' minutes');\n\n\t\tforeach ($cals as $i=>$cal) {\n\t\t\t$view->cals[$i] = new Calendar();\n\t\t\t$view->cals[$i]->loadCalendarFromDbase(array($cal->id)); \n\t\t}\n\n\t\t$view->setLayout('dayview');\n\t\t$view->display();\n\t\t\n\t}", "function displayDayFirst() {\n\t\t/**\n\t\t * Load the template, from a file, from a resource, whatever.\n\t\t */\n\t\t$template = $this->loadTemplate();\n\n\t\t/**\n\t\t * In case, we are allowed to switch the date by the GET vars that we are using (specified in flexforms config),\n\t\t * we have to check the three GET vars f1/f2/f3 which hold the <year>/<month>/<day> and adjust the day that we are\n\t\t * going to display accordingly. If they are not set, we just use the default, which is the \"current\" day.\n\t\t */\n\t\tif (!$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'ignore_pivars_date') && isset ($this->piVars['f3']))\n\t\t\t$day = intval($this->piVars['f3']);\n\t\telse\n\t\t\t$day = date('d');\n\n\t\tif (!$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'ignore_pivars_date') && isset ($this->piVars['f2']))\n\t\t\t$month = intval($this->piVars['f2']);\n\t\telse\n\t\t\t$month = date('m');\n\n\t\tif (!$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'ignore_pivars_date') && isset ($this->piVars['f1']))\n\t\t\t$year = intval($this->piVars['f1']);\n\t\telse\n\t\t\t$year = date('Y');\n\n\t\t/* now switch to seconds, so that we can use strotoime() */\n\t\t$daytime = mktime(0, 0, 0, $month, $day, $year);\n\n\t\t/*\n\t\t * You can create a default \"offset\" date, which can be used to display e.g. the NEXT month by default\n\t\t * instead of the current one. If an offset is set, adjust all those values above.\n\t\t */\n\t\t$date_off = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'date_offset');\n\t\tif ($date_off != \"\") {\n\t\t\t$daytime = strtotime($date_off, $daytime);\n\t\t\t$year = date('Y', $daytime);\n\t\t\t$month = date('m', $daytime);\n\t\t\t$day = date('d', $daytime);\n\t\t}\n\t\t/* We also need to know about the end of this day, which is the start of the next day */\n\t\t$endtime = strtotime(\"+1 days\", $daytime);\n\n\t\t/* Select this day's events */\n\t\t$eventmatrix = $this->getEventsInRange($year, $month, $day, date('Y', $endtime), date('m', $endtime), date('d', $endtime));\n\n\t\t/* What follows is Typo3 API - create a content object, create a day \"row\" (see makeDayRow() above), display it */\n\t\t$dayobj = t3lib_div :: makeInstance('tslib_cObj'); // Create new tslib_cObj for our use\n\t\t$day = $this->makeDayRow($eventmatrix, $template, $daytime, $month);\n\t\t$dayobj->start($day);\n\t\t$lConf = $this->conf['displayDay.'];\n\t\treturn $dayobj->cObjGetSingle($lConf['day'], $lConf['day.']);\n\t}", "function _displayDailyView($tpl){\t \n\t\t$model = & $this->getModel('Calendar');\n\t\t$this->events = $model->_listIcalEventsByDaily();\n\t\t$this->day \t= JRequest::getVar('day',date('Y-m-d', time()));\n\t\t$this->Itemid = JRequest::getInt('Itemid', 0) ;\t\t\n\t\t\t\t\t\t\n\t\tparent::display($tpl);\t\n\t}", "function setFirstDay()\n {\n $weekDays = $this->cE->getWeekDays(\n $this->calendar->thisYear(),\n $this->calendar->thisMonth(),\n $this->calendar->thisDay()\n );\n $endDays = array();\n $tmpDays = array();\n $begin = false;\n foreach ($weekDays as $day) {\n if ($begin) {\n $endDays[] = $day;\n } else if ($day === $this->firstDay) {\n $begin = true;\n $endDays[] = $day;\n } else {\n $tmpDays[] = $day;\n }\n }\n $this->daysOfWeek = array_merge($endDays, $tmpDays);\n }", "private function create_calendar()\n\t{\n\t\t$weekStartOnMonday= Options::get( 'clickheat__week_start_on_monday' );\n\n\t\t$cal = '<table class=\"clickheat-calendar\"><tr>';\n\t\t$days = explode(',', 'M,T,W,T,F,S,S');\n\t\tfor ($d = 0; $d < 7; $d++)\n\t\t{\n\t\t\t$D = $d + ($weekStartOnMonday ? 0 : 6);\n\t\t\tif ($D > 6)\n\t\t\t\t$D -= 7;\n\n\t\t\t$cal .= '<th>'.$days[$D].'</th>';\n\t\t}\n\t\t$cal .= '</tr><tr>';\n\n\t\t$before = date('w', mktime(0, 0, 0, $this->month, 1, $this->year)) - ($weekStartOnMonday ? 1 : 0);\n\t\tif ($before < 0)\n\t\t\t$before += 7;\n\n\t\t$this->lastDayOfMonth = date('t', mktime(0, 0, 0, $this->month - 1, 1, $this->year));\n\t\tfor ($d = 1; $d <= $before; $d++)\n\t\t\t$cal .= '<td id=\"clickheat-calendar-10'.$d.'\">'.($this->lastDayOfMonth - $before + $d).'</td>';\n\n\t\t$cols = $before - 1;\n\t\t$this->js = 'var weekDays = [';\n\t\tfor ($d = 1, $days = date('t', $this->date); $d <= $days; $d++) {\n\t\t\t$D = mktime(0, 0, 0, $this->month, $d, $this->year);\n\t\t\tif (++$cols === 7) {\n\t\t\t\t$cal .= '</tr><tr>';\n\t\t\t\t$cols = 0;\n\t\t\t}\n\n\t\t\t$cal .= '<td id=\"clickheat-calendar-'.$d.'\"><a href=\"#\" onclick=\"clickheat.updateCalendar('.$d.'); return false;\">'.$d.'</a></td>';\n\t\t\t$this->js .= ','.(date('W', $D) + (date('w', $D) == 0 && !$weekStartOnMonday ? 1 : 0));\n\t\t}\n\t\t$this->js .= '];';\n\n\t\tfor ($d = 1; $cols < 6; $cols++, $d++)\n\t\t\t$cal .= '<td id=\"clickheat-calendar-11'.$d.'\">'.$d.'</td>';\n\n\t\t$cal .= '</tr></table>';\n\t\treturn $cal;\n\t}", "public function indexAction()\n {\n $days = $this->sortDaysByDateAndTime(\n $this->getCollectedDays()\n );\n $this->view->assign('days', $days);\n }", "function HD_program_days(){\n\trequire_once(HD_PLUGIN_DIR.'/program/gui/days.gui.php');\n\t$qry = new SQL(\"SELECT * FROM `hd_program_days` ORDER BY `hpd_name` ASC\");\n\twhile($r = mysql_fetch_assoc($qry->run())){\n\t\t$days[$r['hpd_id']] = $r['hpd_name'];\n\t}\n\tHD_gui_program_days($days);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
In this action the page or asset with the given id is loaded and its roles set to the ones given.
function doAction() { $objId = \Scrivo\Request::post( "itemId", \Scrivo\Request::TYPE_INTEGER); try { $obj = \Scrivo\Page::fetch($this->context, $objId); } catch (\Exception $e) { $obj = \Scrivo\Asset::fetch($this->context, $objId); } // Convert the array with role ids. $rls = array(); foreach (\Scrivo\Request::post( "roles", \Scrivo\Request::TYPE_INTEGER) as $id) { $r = new \stdClass; $r->id = intval($id); $rls[] = $r; } // Set the roles for the object. \Scrivo\ObjectRole::set($this->context, $obj->id, $rls); $this->setResult(self::SUCCESS); }
[ "protected function _loadRoles()\n {\n $this->role->load($this->auth->handle);\n }", "protected function _init_role()\n\t{\n\t\t$role_id = $this->request->param('id');\n\t\tif (!$role_id)\n\t\t{\n\t\t\t$this->session->set('error', 'Invalid role id');\n\t\t\t$this->request->redirect('/admin/role');\n\t\t}\n\t\t\n\t\t// check if role exists\n\t\t$this->role = Sprig::factory('role', array(\n\t\t\t'role_id' => $role_id\n\t\t));\n\t\t\n\t\t$this->role->load();\n\t\tif (!$this->role->loaded())\n\t\t{\n\t\t\t$this->session->set('error', 'Role not found');\n\t\t\t$this->request->redirect('/admin/role');\n\t\t}\n\t}", "function doAction() {\n\n\t\t$objId = \\Scrivo\\Request::get(\n\t\t\t\"itemId\", \\Scrivo\\Request::TYPE_INTEGER);\n\n\t\ttry {\n\t\t\t$obj = \\Scrivo\\Page::fetch($this->context, $objId);\n\t\t} catch (\\Exception $e) {\n\t\t\t$obj = \\Scrivo\\Asset::fetch($this->context, $objId);\n\t\t}\n\n\t\t$res1 = array();\n\t\tforeach (\\Scrivo\\Role::select(\n\t\t\t\t$this->context, \\Scrivo\\Role::PUBLIC_ROLE) as $role) {\n\t\t\t$res1[$role->id] = array(\"label\" => (string)$role->title,\n\t\t\t\t\t\"checked\" => isset($obj->roles[$role->id]));\n\t\t}\n\n\t\t$res2 = array();\n\t\tforeach (\\Scrivo\\Role::select(\n\t\t\t\t$this->context, \\Scrivo\\Role::EDITOR_ROLE) as $role) {\n\t\t\t$res2[$role->id] = array(\"label\" => (string)$role->title,\n\t\t\t\t\"checked\" => isset($obj->roles[$role->id]));\n\t\t}\n\n\t\t$res = array(\"publicRoles\" => $res1, \"editorRoles\" => $res2);\n\n\n\t\t$this->setResult(self::SUCCESS, $res);\n\t}", "public function setAction($id)\n {\n if (!$this->request->isAjax() || !$this->request->isPost()) {\n echo json_encode(['status' => 'NOK', 'message' => 'Not ajax/post']);\n return;\n }\n\n $permission = Permissions::findFirstById($id);\n if (!$permission) {\n echo json_encode(['status' => 'NOK', 'message' => 'Permission does not exist']);\n return;\n }\n\n $roleNames = $this->request->getPost('roles');\n if ($permission->setRoles($roleNames)) {\n echo json_encode(['status' => 'OK', 'message' => 'Permissions updated.']);\n return;\n }\n\n echo json_encode(['status' => 'NOK', 'message' => 'Could not set roles.']);\n }", "function load_roles()\n\t{\n\t\t$CI =& get_instance();\n\t\t\n\t\t$CI->load->model('role_model');\n\t\t\n\t\tif ($this->usr_id !== NULL)\n\t\t{\n\t\t\t$this->set_roles(Role_model::get_by_user($this->usr_id));\n\t\t}\n\t}", "protected function initRoles()\n {\n $this->roles = CAT_Roles::getInstance()->getRoles(\n array('for'=>'user','user'=>$this->user['user_id'])\n );\n }", "public function getRoles($id);", "protected function _lazy_load() : void\n\t{\n\t\t$user_id = (int)$this->id;\n\t\t$cache_key = 'database.user_entity.'.$user_id.'.acl.php';\n\t\tif (!$this->lazy_loaded) {\n\t\t\tif (!$roles_permissions = ci('cache')->get($cache_key)) {\n\t\t\t\t$roles_permissions = $this->_internal_query($user_id);\n\t\t\t\t$roles_permissions['roles'][EVERYONE_ROLE_ID] = 'Everyone';\n\t\t\t\tci('cache')->save($cache_key, $roles_permissions, ci('cache')->ttl());\n\t\t\t}\n\t\t\t$this->roles = (array) $roles_permissions['roles'];\n\t\t\t$this->permissions = (array) $roles_permissions['permissions'];\n\t\t\t$this->lazy_loaded = true;\n\t\t}\n\t}", "abstract public function loadRole();", "public function setEmployeeRoles($id)\n {\n $self='employee-roles';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message' => language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $emp_roles=EmployeeRoles::find($id);\n return view('admin.set-employee-roles',compact('emp_roles'));\n }", "public function set_role_data() {}", "public function load()\n {\n $this->loadID((int) Request::get('id'));\n }", "public function loadRights(): void\n {\n $roles = Role::findByUserSid($this->sId);\n $rights = [];\n\n foreach ($roles as $role) {\n $rights[] = $role->getRights();\n }\n\n $rights = array_merge([], ...$rights);\n\n $rights = array_unique($rights);\n\n $this->rights = $rights;\n }", "public function EditSubAgent($id)\n {\n $this->setLeftSideBarData();\n $agents = array();\n $data = array();\n $user_id = Session::get('user_id');\n $role_id = Session::get('role_id');\n\n $where = array('users.id' =>$id);\n $user = DB::table('users')\n ->leftJoin('user_profiles', 'users.id', '=', 'user_profiles.user_id')\n ->where($where)\n ->whereNull('deleted_at')\n ->get();\n\n $r_id = $user[0]->role_id;\n $agent_id = $user[0]->agent_id;\n\n $loggedUser = User::find($user_id);\n $data['id'] = $loggedUser->id;\n $data['username'] = $loggedUser->username;\n array_push($agents,$data);\n\n if($role_id == 1)\n {\n $permittedRoleIds = RolePermission::select('role_id')->where('r_id',$r_id)->where('can_add',1)->where('status','active')->get()->pluck('role_id');\n $agents = User::whereIn('role_id',$permittedRoleIds)->where('status','active')->get()->toArray();\n if($agents)\n {\n if(!in_array($agents[0]['id'], $data))\n {\n array_push($agents,$data);\n }\n }\n }\n else\n {\n $permittedRoleIds = RolePermission::select('role_id')->where('r_id',$r_id)->where('can_add',1)->where('status','active')->get()->pluck('role_id');\n $agents = User::find($user_id)->children()->whereIn('role_id',$permittedRoleIds)->where('status','active')->get()->toArray();\n if($agents)\n {\n if(!in_array($agents[0]['id'], $data))\n {\n array_push($agents,$data);\n }\n }\n }\n\n $where = array('role_permissions.role_id' =>$role_id,'role_permissions.can_add' =>1,'role_permissions.status' =>'active');\n $role_permissions = DB::table('role_permissions')\n ->leftJoin('roles', 'role_permissions.r_id', '=', 'roles.id')\n ->where($where)\n ->orderBy('role_permissions.role_id', 'asc')\n ->orderBy('roles.id', 'asc')\n ->get();\n\n\n if($this->role_id == 1)\n {\n $bet_rules = BetRule::whereNull('deleted_at')->get();\n }\n else\n {\n $bet_rules = BetRule::where('user_id', $user_id)\n ->orwhereNull('user_id')\n ->whereNull('deleted_at')\n ->get();\n }\n\n $country = Country::orderBy('countries.name', 'asc')\n ->get()\n ->toArray();\n\n $language = Language::where('status', 'active')\n ->get()\n ->toArray();\n\n $currency = Currency::where('status', 'active')\n ->get()\n ->toArray();\n\n return view('admin/sub-agent/admin_edit_sub_agent',['role_permissions' => $role_permissions, 'agents' => $agents, 'user_data' => $user, 'user_id' => $id,'bet_rules' => $bet_rules, 'country' => $country, 'language' => $language,'currency' => $currency, 'profile_image' => $this->profile_image, 'parent_menu' => $this->parent_menu, 'sub_menu' =>$this->sub_menu]);\n }", "private static function selectRoles(\\Scrivo\\Context $context, array $assets) {\n\n\t\t$ids = implode(\",\", array_keys($assets));\n\n\t\t$sth = $context->connection->prepare(\n\t\t\t\"SELECT page_id, role_id FROM object_role\n\t\t\tWHERE instance_id = :instId AND page_id in ($ids)\");\n\n\t\t$context->connection->bindInstance($sth);\n\n\t\t$sth->execute();\n\n\t\twhile ($rd = $sth->fetch(\\PDO::FETCH_ASSOC)) {\n\n\t\t\t$assets[intval($rd[\"page_id\"])]->roles[] =\n\t\t\t\tintval($rd[\"role_id\"]);\n\n\t\t}\n\t}", "abstract public function loadRolesForContentObjects( $contentIds );", "public function loadRoles() {\n $allRoles = $this->getRoles();\n foreach ($allRoles as $role) {\n // if (!empty($role->id_parent)) {\n //$this->_acl->addRole(new Zend_Acl_Role($role->id),$role->id_parent);\n // } else {\n //***if not place the role\n if (!in_array($role->id,$this->_acl->getRoles())) \n $this->_acl->addRole(new Zend_Acl_Role($role->id));\n // }\n }\n return true;\n }", "protected function initRoles()\n {\n $this->roles = new ArrayCollection();\n }", "function loadMenuByRole() {\n $moduleDAO = new Application_Model_DbTable_Modules();\n $arrayIdFunction = explode(\",\", $this->getSession()->userInfor->getUserRole()->id_functions);\n $listModuleByRole = $moduleDAO->getListModuleByFunctionId($arrayIdFunction);\n $this->view->listModuleByRole = $listModuleByRole;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is called when we unserialize the Time object.
public function __wakeup(): void { /** * Prior to unserialization, this is a string. * * @var string $timezone */ $timezone = $this->timezone; $this->timezone = new DateTimeZone($timezone); parent::__construct($this->date, $this->timezone); }
[ "public function parseTime() {}", "public function testDeconvertTimestamp()\n {\n $serializer = new Gson3;\n $time = time();\n $deconverted = $serializer->deconvertTimestamp($time);\n $this->assertEquals($time, $deconverted, \"Incorrect deconversion for Timestamp\");\n }", "private function _parseTimestamp()\n {\n $sec = hexdec($this->_multiByteShift(4));\n $msec = hexdec($this->_multiByteShift(4));\n\n // set osc special case to now\n if ($sec == 0 && $msec == 1) {\n $this->_appendStore(new DateTime);\n } else {\n $date = new DateTime('1900/1/1');\n $date->add(new DateInterval(sprintf(\"PT%sS.\", $sec)));\n $this->_appendStore($date);\n }\n }", "function __wakeup()\r\r\n\t{\r\r\n\t\tparent::__construct($this->dateString, new DateTimeZone($this->tzString));\r\r\n\t}", "public function testUnserializeWithDateTime()\n {\n $obj = new class {\n public $datetime;\n public function __construct()\n {\n $this->datetime = new \\DateTime();\n }\n };\n\n $data = [\n 'datetime' => '2000-12-31T23:59:59+00:00'\n ];\n\n $expectedDateTime = \\DateTime::createFromFormat(\\DateTime::RFC3339, $data['datetime']);\n\n $result = AutoUnserializeHelper::unserialize($obj, $data);\n $this->assertEquals($expectedDateTime, $result->datetime);\n }", "public function unserialize ($serialized) {}", "public function unserialize()\n {\n parent::unserialize();\n\n $this->sequence = $this->getNumber2();\n $this->version = $this->getNumber2();\n $this->level = $this->getNumber();\n $this->event = $this->getNumber();\n $this->node = $this->getNumber2();\n $this->peer = $this->getNumber2();\n $this->time = $this->getNumber8();\n $this->host = $this->getString();\n $this->data = $this->getLongString();\n\n // Cleanup\n $this->needle = 0;\n // 0xAAA0 is the signature of the messages\n $this->buffer = pack('C*', 0xAA, 0xA0 | 0, static::ID);\n }", "public function unserialize () {\n if (!empty(static::$fields_serialize)) {\n foreach (static::$fields_serialize as $field) {\n if (is_string($this->{$field})) {\n $this->{$field} = unserialize($this->{$field});\n }\n }\n }\n }", "function testDeconstructFieldsTime() {\n\t\t$this->loadFixtures ( 'Apple' );\n\t\t$TestModel = & new Apple ();\n\t\t\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] ['hour'] = '';\n\t\t$data ['Apple'] ['mytime'] ['min'] = '';\n\t\t$data ['Apple'] ['mytime'] ['sec'] = '';\n\t\t\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$expected = array (\n\t\t\t\t'Apple' => array (\n\t\t\t\t\t\t'mytime' => '' \n\t\t\t\t) \n\t\t);\n\t\t$this->assertEqual ( $TestModel->data, $expected );\n\t\t\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] ['hour'] = '';\n\t\t$data ['Apple'] ['mytime'] ['min'] = '';\n\t\t$data ['Apple'] ['mytime'] ['meridan'] = '';\n\t\t\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$expected = array (\n\t\t\t\t'Apple' => array (\n\t\t\t\t\t\t'mytime' => '' \n\t\t\t\t) \n\t\t);\n\t\t$this->assertEqual ( $TestModel->data, $expected, 'Empty values are not returning properly. %s' );\n\t\t\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] ['hour'] = '12';\n\t\t$data ['Apple'] ['mytime'] ['min'] = '0';\n\t\t$data ['Apple'] ['mytime'] ['meridian'] = 'am';\n\t\t\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$expected = array (\n\t\t\t\t'Apple' => array (\n\t\t\t\t\t\t'mytime' => '00:00:00' \n\t\t\t\t) \n\t\t);\n\t\t$this->assertEqual ( $TestModel->data, $expected, 'Midnight is not returning proper values. %s' );\n\t\t\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] ['hour'] = '00';\n\t\t$data ['Apple'] ['mytime'] ['min'] = '00';\n\t\t\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$expected = array (\n\t\t\t\t'Apple' => array (\n\t\t\t\t\t\t'mytime' => '00:00:00' \n\t\t\t\t) \n\t\t);\n\t\t$this->assertEqual ( $TestModel->data, $expected, 'Midnight is not returning proper values. %s' );\n\t\t\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] ['hour'] = '03';\n\t\t$data ['Apple'] ['mytime'] ['min'] = '04';\n\t\t$data ['Apple'] ['mytime'] ['sec'] = '04';\n\t\t\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$expected = array (\n\t\t\t\t'Apple' => array (\n\t\t\t\t\t\t'mytime' => '03:04:04' \n\t\t\t\t) \n\t\t);\n\t\t$this->assertEqual ( $TestModel->data, $expected );\n\t\t\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] ['hour'] = '3';\n\t\t$data ['Apple'] ['mytime'] ['min'] = '4';\n\t\t$data ['Apple'] ['mytime'] ['sec'] = '4';\n\t\t\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$expected = array (\n\t\t\t\t'Apple' => array (\n\t\t\t\t\t\t'mytime' => '03:04:04' \n\t\t\t\t) \n\t\t);\n\t\t$this->assertEqual ( $TestModel->data, $expected );\n\t\t\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] ['hour'] = '03';\n\t\t$data ['Apple'] ['mytime'] ['min'] = '4';\n\t\t$data ['Apple'] ['mytime'] ['sec'] = '4';\n\t\t\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$expected = array (\n\t\t\t\t'Apple' => array (\n\t\t\t\t\t\t'mytime' => '03:04:04' \n\t\t\t\t) \n\t\t);\n\t\t$this->assertEqual ( $TestModel->data, $expected );\n\t\t\n\t\t$db = ConnectionManager::getDataSource ( 'test_suite' );\n\t\t$data = array ();\n\t\t$data ['Apple'] ['mytime'] = $db->expression ( 'NOW()' );\n\t\t$TestModel->data = null;\n\t\t$TestModel->set ( $data );\n\t\t$this->assertEqual ( $TestModel->data, $data );\n\t}", "private function parse() {\n $data = getdate($this->timestamp);\n \n if($data) {\n $this->year = (integer) $data['year'];\n $this->month = (integer) $data['mon'];\n $this->day = (integer) $data['mday'];\n $this->hour = (integer) $data['hours'];\n $this->minute = (integer) $data['minutes'];\n $this->second = (integer) $data['seconds'];\n } // if\n }", "public function getDeserveTime()\n {\n return $this->deserve_time;\n }", "#[@test]\n public function serialization() {\n $original= Date::fromString('2007-07-18T09:42:08 Europe/Athens');\n $copy= unserialize(serialize($original));\n $this->assertEquals($original, $copy);\n }", "public function __wakeup()\n\t{\n\t\t// Re-initialize start time on wake-up\n\t\t$this->start_time = $this->microtime_float();\n\t}", "protected function unserializeData()\n {\n $this->data = unserialize($this->data);\n }", "public function afterLoad()\n\t{\n\t\t$this->unserializeData();\n\t}", "public function testSerialize_NoTZ()\n\t{\n\t\t$now = date('Y-m-d H:i:s');\n\t\t$dt = new DateTime($now);\n\t\t$pdt = new PropelDateTime($now);\n\n\t\t$this->assertDatesIdentical($dt, $pdt);\n\n\t\t// We expect these to be the same -- there's no time zone info\n\t\t$ser = serialize($pdt);\n\t\tunset($pdt);\n\n\t\t$pdt = unserialize($ser);\n\t\t$this->assertDatesIdentical($dt, $pdt);\n\t}", "protected function convertTimesToRFC2822() {\n foreach ($this->_props as $prop => $settings) {\n if ($settings['type'] == 'date') {\n $this->_props[$prop]['value'] = Time::toRFC2822($settings['value']);\n }\n }\n }", "public function unserializeProperties()\n {\n }", "public function postInit()\n {\n parent::postInit();\n if ($this->m_timezoneAttribute !== null) {\n $node = $this->getOwnerInstance();\n $parts = explode('.', $this->m_timezoneAttribute);\n $attr = $node->getAttribute($parts[0]);\n $attr->addFlag(self::AF_FORCE_LOAD);\n }\n\n $this->m_date->postInit();\n $this->m_time->postInit();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add dynamicAdSlot failed caused by expressions null only when have DefaultLibraryAdSlot or DefaultAdSlot
public function addDynamicAdSlotWithLibraryExpressionNullOnly(ApiTester $I) { $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT; //'libraryAdSlot expressions' null $jsonData['libraryAdSlot']['libraryExpressions'] = null; $I->sendPOST(URL_API . '/dynamicadslots', $jsonData); $I->seeResponseCodeIs(201); //allow if has defaultLibraryAdSlot or defaultAdSlot //$I->seeResponseCodeIs(400); }
[ "public function addDynamicAdSlotWithLibraryAdSlotInvalidByDefaultLibraryAdSlotNullOnly(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions defaultLibraryAdSlot' null\n $jsonData['libraryAdSlot']['defaultLibraryAdSlot'] = null;\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n //$I->seeResponseCodeIs(400);\n $I->seeResponseCodeIs(201); //allow, because already have LibraryExpressions\n }", "public function addDynamicAdSlotWithLibraryAdSlotInvalidByMissingDefaultLibraryAdSlotOnly(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions defaultLibraryAdSlot' missing\n unset($jsonData['libraryAdSlot']['defaultLibraryAdSlot']);\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n //$I->seeResponseCodeIs(400);\n $I->seeResponseCodeIs(201); //allow, because already have LibraryExpressions\n }", "public function addLibraryDynamicAdSlotFailedByDefaultLibraryAdSlotNull(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_LIBRARY_DYNAMIC_AD_SLOT;\n\n //'defaultLibraryAdSlot' null\n $jsonData['defaultLibraryAdSlot'] = null;\n\n $I->sendPOST(URL_API . '/librarydynamicadslots', $jsonData);\n //$I->seeResponseCodeIs(400);\n $I->seeResponseCodeIs(201); //allow, because already have libraryExpressiosn\n }", "public function addDynamicAdSlotFailedByDefaultAdSlotNullOnly(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'defaultAdSlot' null\n $jsonData['defaultAdSlot'] = null;\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n //$I->seeResponseCodeIs(400);\n $I->seeResponseCodeIs(201); //allow, because already have LibraryExpressions\n }", "public function addLibraryDynamicAdSlotFailedByDefaultLibraryAdSlotNotExisted(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_LIBRARY_DYNAMIC_AD_SLOT;\n\n //'defaultLibraryAdSlot' not existed\n $jsonData['defaultLibraryAdSlot'] = -1;\n $I->sendPOST(URL_API . '/librarydynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotFailedByInCompatibleNativeAdSlotForDefaultAdSlot(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions' native and defaultAdSlot incompatible\n //$jsonData['libraryAdSlot']['native'] = false; //make sure not supported native. TODO: unknown the way to set this to 'false' as boolean. Codeception always convert to string :(\n $jsonData['defaultAdSlot'] = PARAMS_NATIVE_AD_SLOT; //native ad slot\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotFailedByMissingDefaultAdSlotOnly(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'defaultAdSlot' missing\n unset($jsonData['defaultAdSlot']);\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n //$I->seeResponseCodeIs(400);\n $I->seeResponseCodeIs(201); //allow, because already have LibraryExpressions\n }", "public function addDynamicAdSlotWithLibraryExpressionInvalidByExpressionsNull(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions expectAdSlot' null\n $jsonData['libraryAdSlot']['libraryExpressions'][0]['expressions'] = null;\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(201);\n }", "public function addLibraryDynamicAdSlotFailedByInCompatibleNativeAdSlotForExpectLibraryAdSlot(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_LIBRARY_DYNAMIC_AD_SLOT;\n\n //'libraryExpressions' native and expectAdSlot incompatible\n //$jsonData['native'] = false; //make sure not supported native\n $jsonData['libraryExpressions'][0]['expectLibraryAdSlot'] = PARAMS_LIBRARY_NATIVE_AD_SLOT; //library native ad slot\n\n $I->sendPOST(URL_API . '/librarydynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotFailedByDefaultAdSlotNotExisted(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'DefaultAdSlot' not existed\n $jsonData['defaultAdSlot'] = -1;\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotFailedByMissingLibraryAdSlot(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'site' null\n unset($jsonData['libraryAdSlot']);\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotWithLibraryExpressionInvalidByStartingPositionNull(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions startingPosition' null\n $jsonData['libraryAdSlot']['libraryExpressions'][0]['startingPosition'] = null;\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(201); //allow because api auto-correct\n //$I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotWithLibraryExpressionInvalidByExpressionsMissingExpectAdSlot(ApiTester $I)\n {\n// $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n//\n// //'libraryAdSlot libraryExpressions expectAdSlot' null\n// unset($jsonData['libraryAdSlot']['libraryExpressions'][0]['expressions']['expectAdSlot']);\n//\n// $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n// $I->seeResponseCodeIs(400);\n\n $I->comment('not yet fixed in api');\n }", "public function addAdSlotWithLibraryAdSlotNull(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_AD_SLOT;\n //libraryAdSlot null\n $jsonData['libraryAdSlot'] = null;\n\n $I->sendPOST(URL_API . '/displayadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotWithLibraryExpressionInvalidByExpressionsExpectAdSlotNotExisted(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions expectAdSlot' not existed\n $jsonData['libraryAdSlot']['libraryExpressions'][0]['expressions']['expectAdSlot'] = -1;\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotWithLibraryExpressionMissingDescriptor(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions expressionDescriptor' null\n unset($jsonData['libraryAdSlot']['libraryExpressions'][0]['expressionDescriptor']);\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotWithLibraryExpressionInvalidByMissingExpressions(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions expectAdSlot' null\n unset($jsonData['libraryAdSlot']['libraryExpressions'][0]['expressions']);\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(201);\n }", "public function addLibraryDynamicAdSlotWithLibraryExpressionsDescriptorGroupValNull(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_LIBRARY_DYNAMIC_AD_SLOT;\n\n //'libraryExpressions expressionDescriptor groupVal' null\n $jsonData['libraryExpressions'][0]['expressionDescriptor']['groupVal'] = null;\n\n $I->sendPOST(URL_API . '/librarydynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }", "public function addDynamicAdSlotWithLibraryExpressionNotJsonArray(ApiTester $I)\n {\n $jsonData = self::$JSON_DATA_SAMPLE_DYNAMIC_AD_SLOT;\n\n //'libraryAdSlot libraryExpressions' not json_array\n $jsonData['libraryAdSlot']['libraryExpressions'] = 'libraryExpressions_not_json_array';\n\n $I->sendPOST(URL_API . '/dynamicadslots', $jsonData);\n $I->seeResponseCodeIs(400);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method controls what happens when you move to /local/editSave in your app. Edits a local (performs the editing after form submit). POST request.
public function editSave() { localModel::updateLocal(); Redirect::to('local'); }
[ "public function editAction(Request $request, Local $local)\n {\n $deleteForm = $this->createDeleteForm($local);\n $editForm = $this->createForm('Bo\\AdminBundle\\Form\\LocalType2', $local);\n $editForm->handleRequest($request);\n\n if($editForm->isSubmitted() && $editForm->isValid()){\n\t\t\t$res = $this->updateEntity($local);\n\t\t\tif($res>0){\n\t\t\t\t$this->setActivity($local->getReference().\" have been modified by this user\");\n\t\t\t\treturn $this->redirectToRoute('local_show', array('id' => $local->getId()));\t\t\t\t\n\t\t\t}\n }\n\t\t\n return $this->render('local/edit.html.twig', array(\n 'local' => $local,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n\t\t\t'pm'=>\"local\",\n\t\t\t'sm'=>\"local\",\n ));\n }", "public function editAction() {\n\n \t//CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET POST SUBJECT\n $post = Engine_Api::_()->core()->getSubject('sitestore_post');\n\n //GET SITESTORE SUBJECT\n $sitestore = $post->getParent('sitestore_store');\n\n //PACKAGE BASE PRIYACY START\n if (Engine_Api::_()->sitestore()->hasPackageEnable()) {\n if (!Engine_Api::_()->sitestore()->allowPackageContent($sitestore->package_id, \"modules\", \"sitestorediscussion\")) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n } else {\n $isStoreOwnerAllow = Engine_Api::_()->sitestore()->isStoreOwnerAllow($sitestore, 'sdicreate');\n if (empty($isStoreOwnerAllow)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n }\n //PACKAGE BASE PRIYACY END\n\n //GET TOPIC ITEM\n $topic = Engine_Api::_()->getItem('sitestore_topic', $post->topic_id);\n\n //START MANAGE-ADMIN CHECK\n $can_edit = Engine_Api::_()->sitestore()->isManageAdmin($sitestore, 'edit');\n if ($can_edit != 1 && !$post->isOwner(Engine_Api::_()->user()->getViewer()) ) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\t\t//END MANAGE-ADMIN CHECK\n\n\t\t//GET POST EDIT FORM\n $this->view->form = $form = new Sitestore_Form_Post_Edit();\n\n //CHECK FORM VALIDATION\n if (!$this->getRequest()->isPost()) {\n $form->populate($post->toArray());\n return;\n }\n\n //CHECK FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //PROCESS\n $db = $post->getTable()->getAdapter();\n $db->beginTransaction();\n try {\n \t//SAVE POST\n $post->setFromArray($form->getValues());\n $post->modified_date = date('Y-m-d H:i:s');\n $post->save();\n\n //COMMIT\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n //REDIRECTING\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'closeSmoothbox' => true,\n 'parentRefresh' => true,\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('The changes to your post have been saved.')),\n ));\n }", "public function editAction() {\n\n //TAB CREATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_viewsitestore');\n\n //GET STORE ID AND STORE OBJECT\n $store_id = $this->_getParam('id');\n $sitestore = Engine_Api::_()->getItem('sitestore_store', $store_id);\n\n //FORM GENERATION\n $this->view->form = $form = new Sitestore_Form_Admin_Manage_Edit();\n\n if (!empty($sitestore->declined)) {\n return $this->_forward('notfound', 'error', 'core');\n }\n\n $status_storeOption = array();\n $approved = $sitestore->approved;\n if (empty($sitestore->aprrove_date) && empty($approved)) {\n $status_storeOption[\"0\"] = \"Approval Pending\";\n $status_storeOption[\"1\"] = \"Approved Store\";\n $status_storeOption[\"2\"] = \"Declined Store\";\n } else {\n $status_storeOption[\"1\"] = \"Approved\";\n $status_storeOption[\"0\"] = \"Dis-Approved\";\n }\n $form->getElement(\"status_store\")->setMultiOptions($status_storeOption);\n\n if (!$this->getRequest()->isPost()) {\n\n $form->getElement(\"closed\")->setValue($sitestore->closed);\n $form->getElement(\"status_store\")->setValue($sitestore->approved);\n $form->getElement(\"featured\")->setValue($sitestore->featured);\n $form->getElement(\"sponsored\")->setValue($sitestore->sponsored);\n $title = \"<a href='\" . $this->view->url(array('store_url' => $sitestore->store_url), 'sitestore_entry_view') . \"' target='_blank'>\" . $sitestore->title . \"</a>\";\n $form->title_dummy->setDescription($title);\n if (Engine_Api::_()->sitestore()->hasPackageEnable()) {\n $form->package_title->setDescription(\"<a href='\" . $this->view->url(array('route' => 'admin_default', 'module' => 'sitestore', 'controller' => 'package', 'action' => 'packge-detail', 'id' => $sitestore->package_id), 'admin_default') . \"' class ='smoothbox'>\" . ucfirst($sitestore->getPackage()->title) . \"</a>\");\n\n $package = $sitestore->getPackage();\n if ($package->isFree()) {\n\n $form->getElement(\"status\")->setMultiOptions(array(\"free\" => \"NA (Free)\"));\n $form->getElement(\"status\")->setValue(\"free\");\n $form->getElement(\"status\")->setAttribs(array('disable' => true));\n } else {\n $form->getElement(\"status\")->setValue($sitestore->status);\n }\n }\n } elseif ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n //PROCESS\n $values = $form->getValues();\n \n if(!empty ($values) && isset ($values['toggle_products_status'])){\n if(isset ($values['toggle_products_status']) && $values['toggle_products_status'] == 2){\n Engine_Api::_()->getDbtable('stores', 'sitestore')->toggleStoreProductsStatus($store_id, 1);\n }elseif(isset ($values['toggle_products_status']) && $values['toggle_products_status'] == 3){\n Engine_Api::_()->getDbtable('stores', 'sitestore')->toggleStoreProductsStatus($store_id, 0);\n }\n }\n \n if ($values['status_store'] == 2) {\n $values['declined'] = 1;\n } else {\n $approved = $values['status_store'];\n }\n $sitestore->setFromArray($values);\n if (!empty($sitestore->declined)) {\n Engine_Api::_()->sitestore()->sendMail(\"DECLINED\", $sitestore->store_id);\n }\n $sitestore->save();\n $db->commit();\n if ($approved != $sitestore->approved) {\n\n return $this->_helper->redirector->gotoRoute(array('module' => 'sitestore', 'controller' => 'admin', 'action' => 'approved', \"id\" => $store_id), \"default\", true);\n }\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }\n }", "public function __edit()\n {\n // Load up settings from the environments\n $file = filter_naughty(post_param_string('file'));\n $lang = filter_naughty(post_param_string('lang'));\n $zone = filter_naughty(post_param_string('zone'));\n if (addon_installed('page_management')) {\n $new_file = filter_naughty(has_actual_page_access(get_member(), 'admin_sitemap') ? post_param_string('title', $file) : $file);\n } else {\n $new_file = filter_naughty($file);\n }\n if ($file == '') {\n $file = $new_file;\n }\n\n $validated = post_param_integer('validated', 0);\n if (!addon_installed('unvalidated')) {\n $validated = 1;\n }\n require_code('antispam');\n inject_action_spamcheck();\n if (!has_bypass_validation_comcode_page_permission($zone)) {\n $validated = 0;\n }\n $parent_page = post_param_string('parent_page', '');\n $order = post_param_integer('order');\n $show_as_edit = post_param_integer('show_as_edit', 0);\n $text_raw = post_param_string('post');\n require_code('content2');\n $meta_data = actual_meta_data_get_fields('comcode_page', $zone . ':' . $file, null, $new_file);\n\n // Handle attachments\n require_code('attachments2');\n $_text = do_comcode_attachments($text_raw, 'comcode_page', $zone . ':' . $file);\n $text = $_text['comcode'];\n\n // Some general CRUD maintenance that we don't do within the save_comcode_page function\n $resource_owner = $GLOBALS['SITE_DB']->query_select_value_if_there('comcode_pages', 'p_submitter', array('the_zone' => $zone, 'the_page' => $file));\n if (is_null($resource_owner)) { // Add\n if (!has_add_comcode_page_permission($zone)) {\n access_denied('ADD_COMCODE_PAGE');\n }\n\n require_code('submit');\n give_submit_points('COMCODE_PAGE_ADD');\n\n require_code('member_mentions');\n dispatch_member_mention_notifications('comcode_page', $zone . ':' . $file, $resource_owner);\n } else { // Edit\n if (!has_edit_comcode_page_permission($zone, $file, $resource_owner)) {\n access_denied('EDIT_COMCODE_PAGE');\n }\n\n require_code('submit');\n $just_validated = (!content_validated('comcode_page', $zone . ':' . $file)) && ($validated == 1);\n if ($just_validated) {\n send_content_validated_notification('comcode_page', $zone . ':' . $file);\n }\n }\n require_code('permissions2');\n set_page_permissions_from_environment($zone, $file);\n if (addon_installed('awards')) {\n require_code('awards');\n handle_award_setting('comcode_page', $zone . ':' . $new_file);\n }\n if (addon_installed('content_reviews')) {\n require_code('content_reviews2');\n content_review_set('comcode_page', $zone . ':' . $new_file, $zone . ':' . $file);\n }\n\n // Main save function\n $path = save_comcode_page($zone, $new_file, $lang, $text, $validated, $parent_page, $order, $meta_data['add_time'], $meta_data['edit_time'], $show_as_edit, $meta_data['submitter'], $file, post_param_string('meta_keywords', ''), post_param_string('meta_description', ''));\n\n // Deleting?\n if (post_param_integer('delete', 0) == 1) {\n check_delete_permission('high', $resource_owner);\n unlink(get_custom_file_base() . '/' . $path);\n sync_file($path);\n\n // Delete custom fields\n require_code('fields');\n delete_form_custom_fields('comcode_page', $zone . ':' . $file);\n } else {\n // Save custom fields\n require_code('fields');\n save_form_custom_fields('comcode_page', $zone . ':' . $new_file, $zone . ':' . $file);\n }\n\n // Look for bad title semantics\n $_text['html'] = $_text['tempcode']->evaluate();\n if ((substr($file, 0, 1) != '_') && (substr($file, 0, 6) != 'panel_') && (trim($_text['html']) != '')) {\n if ((strpos($_text['html'], '<h1') === false) && (strpos($_text['comcode'], '[title]') === false) && (strpos($_text['comcode'], '[title=\"1\"]') === false)) {\n attach_message(do_lang_tempcode('NO_LEVEL_1_HEADERS'), 'notice');\n }\n $matches = array();\n if ((strpos($_text['html'], '<h2') === false) && (preg_match_all('#\\n\\[(b|font|size)\\][^\\.]+\\[/(b|font|size)\\]\\n#', $_text['comcode'], $matches) >= 2)) {\n attach_message(do_lang_tempcode('NO_LEVEL_2_HEADERS'), 'inform');\n }\n }\n\n // Messaging to user\n if ($validated == 0) {\n require_code('submit');\n $edit_url = build_url(array('page' => '_SELF', 'type' => '_edit', 'page_link' => $zone . ':' . $new_file), '_SELF', null, false, false, true);\n if (addon_installed('unvalidated')) {\n send_validation_request('COMCODE_PAGE_EDIT', 'comcode_pages', true, $zone . ':' . $new_file, $edit_url);\n }\n }\n $completion_text = ($validated == 0) ? do_lang_tempcode('SUBMIT_UNVALIDATED') : do_lang_tempcode('SUCCESS');\n $url = post_param_string('redirect', '');\n if ($url != '') {\n return redirect_screen($this->title, $url, $completion_text);\n }\n return $this->do_next_manager($this->title, $file, $zone, $completion_text);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward(array(\n 'controller' => \"koumoku_mrs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $koumoku_mr = KoumokuMrs::findFirstByid($id);\n\n if (!$koumoku_mr) {\n $this->flash->error(\"項目マスタが見つからなくなりました。\" . $id);\n\n $this->dispatcher->forward(array(\n 'controller' => \"koumoku_mrs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n if ($koumoku_mr->updated !== $this->request->getPost(\"updated\")) {\n $this->flash->error(\"他のプロセスから項目マスタが変更されたため更新を中止しました。\"\n . $id . \",uid=\" . $koumoku_mr->kousin_user_id . \" tb=\" . $koumoku_mr->updated .\" pt=\" . $this->request->getPost(\"updated\"));\n\n $this->dispatcher->forward(array(\n 'controller' => \"koumoku_mrs\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $post_flds = [];\n $post_flds = [\"cd\",\n \"name\",\n \"table_mr_cd\",\n \"jun\",\n \"data_kata\",\n \"nagasa\",\n \"shougoujunjo\",\n \"zokusei\",\n \"nullka\",\n \"default_ti\",\n \"sonota\",\n \"indekkusu\",\n \"updated\",\n ];\n \n\n $thisPost=[]; // カンマ編集を消すとか日付編集0000-00-00を入れるとか$thisPost[]で行う\n $chg_flg = 0;\n foreach ($post_flds as $post_fld) {\n if ((array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld)) !== $koumoku_mr->$post_fld) {\n $chg_flg = 1;\n break;\n }\n }\n if ($chg_flg === 0) {\n $this->flash->error(\"変更がありません。\" . $id);\n\n $this->dispatcher->forward(array(\n \"controller\" => \"koumoku_mrs\",\n \"action\" => \"edit\",\n \"params\" => array($koumoku_mr->id)\n ));\n\n return;\n }\n\n $this->_bakOut($koumoku_mr);\n\n foreach ($post_flds as $post_fld) {\n $koumoku_mr->$post_fld = array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld);\n }\n\n if (!$koumoku_mr->save()) {\n\n foreach ($koumoku_mr->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward(array(\n 'controller' => \"koumoku_mrs\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $this->flash->success(\"項目マスタの情報を更新しました。\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"koumoku_mrs\",\n 'action' => 'edit',\n 'params' => array($koumoku_mr->id)\n ));\n }", "public function saveAction()\n\t{\n\t\t/* Use same name in databse */\n\t\t$a_Params = $this->params->requests->getParams();\n\t\tif ( $this->params->requests->isAjax())\n\t\t{\n\t\t\t$service = $this->services->System->Object->Save($a_Params);\n\t\t\techo $service->getMessage();\n\t\t}\n\n\t\t/* We process in ajax, no need to render view and layout */\n\t\t$this->setHtmlRender(false);\n\t\t$this->setLayoutRender(false);\n\t}", "public function saveAction()\n {\n if (!$this->isAdmin()) {\n $this->dispatcher->forward([\n \"controller\" => \"index\",\n \"action\" => \"index\"\n ]);\n\n return;\n }\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n \"controller\" => \"players\",\n \"action\" => \"index\"\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $player = Players::findFirstByid($id);\n\n if (!$player) {\n $this->flash->error(\"Player does not exist \" . $id);\n\n $this->dispatcher->forward([\n \"controller\" => \"players\",\n \"action\" => \"index\"\n ]);\n\n return;\n }\n\n $player->first_name = $this->request->getPost(\"first_name\");\n $player->last_name = $this->request->getPost(\"last_name\");\n $player->nationality = $this->request->getPost(\"nationality\");\n $player->club = $this->request->getPost(\"club\");\n $player->position = $this->request->getPost(\"position\");\n \n\n if (!$player->save()) {\n\n foreach ($player->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n \"controller\" => \"players\",\n \"action\" => \"edit\",\n \"params\" => [$player->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Player was updated successfully.\");\n\n $this->dispatcher->forward([\n \"controller\" => \"players\",\n \"action\" => \"index\"\n ]);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"acteur\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $acteur = Acteur::findFirstByid($id);\n\n if (!$acteur) {\n $this->flash->error(\"L'acteur n'existe pas :\" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"acteur\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $acteur->nom = $this->request->getPost(\"nom\");\n $acteur->prenom = $this->request->getPost(\"prenom\");\n $acteur->categorie = \"acteur\";\n $acteur->login = $this->request->getPost(\"login\");\n $acteur->trigramme = substr($acteur->nom,0,2).\"-\".substr($acteur->prenom,0,1);\n\n\n if (!$acteur->save()) {\n foreach ($acteur->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"acteur\",\n 'action' => 'edit',\n 'params' => [$acteur->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"L'acteur a été modifié avec succès !\");\n\n $this->dispatcher->forward([\n 'controller' => \"acteur\",\n 'action' => 'index'\n ]);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $perguntacodper = $this->request->getPost(\"perguntacodper\");\n $opcao = Opcao::findFirstByperguntacodper($perguntacodper);\n\n if (!$opcao) {\n $this->flash->error(\"opcao does not exist \" . $perguntacodper);\n\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $opcao->perguntacodper = $this->request->getPost(\"perguntacodper\");\r\n $opcao->desopc = $this->request->getPost(\"desopc\");\r\n \n\n if (!$opcao->save()) {\n\n foreach ($opcao->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'edit',\n 'params' => [$opcao->perguntacodper]\n ]);\n\n return;\n }\n\n $this->flash->success(\"opcao was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"opcao\",\n 'action' => 'index'\n ]);\n }", "function editTodo() {\n\n $results = array();\n $results['pageTitle'] = \"Edit To-Do\";\n $results['formAction'] = \"editTodo\";\n $results['errorReturnAction'] = \"listTodos\";\n $results['errorMessage'] = \"To-do not found. Please try again.\";\n\n if ( isset( $_POST['saveChanges'] ) ) {\n\n // User has posted the to-do edit form: save the changes\n if ( !checkAuthToken() ) return;\n\n if ( $todo = Todo::getById( (int)$_POST['todoId'] ) ) {\n if ( $todo->userId == User::getLoggedInUser()->id ) {\n $todo->__construct( $_POST );\n $todo->update();\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n \n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } elseif ( isset( $_POST['cancel'] ) ) {\n\n // User has canceled their edits: return to the to-do list\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n\n } else {\n\n // User has not posted the to-do edit form yet: display the form\n if ( $results['todo'] = Todo::getById( (int)$_GET['todoId'] ) ) {\n if ( $results['todo']->userId == User::getLoggedInUser()->id ) {\n require( TEMPLATE_PATH . \"/editTodo.php\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n }\n}", "public function saveAction() {\n if(EDIT_MODE) {\n $postObj = json_decode(\n json_encode(\n filter_input_array(INPUT_POST)\n ), false\n );\n \n \\Mappers\\BuildDBMapper::updateMeta($postObj);\n \\Mappers\\BuildDBMapper::saveCube($postObj);\n \\Mappers\\BuildDBMapper::saveItems($postObj);\n \\Mappers\\BuildDBMapper::saveActiveSkills($postObj);\n \\Mappers\\BuildDBMapper::savePassiveSkills($postObj);\n \\Mappers\\BuildDBMapper::saveScope($postObj);\n $this->redirect('build/edit/'.$postObj->id);\n } else {\n $this->redirect('build');\n }\n }", "public function editSave()\n {\n NoteModel::updateNote(Request::post('note_id'), Request::post('note_text'));\n Redirect::to('note');\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 }", "public function editSave()\n {\n oeuvreModel::updateOeuvre();\n Redirect::to('oeuvre');\n }", "public function save()\r\n {\r\n $aParams = oxConfig::getParameter( \"editval\" );\r\n $oMarmPiwik = $this->getMarmPiwik();\r\n $oMarmPiwik->changeConfig($aParams);\r\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"adm_perfil\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $idPerfil = $this->request->getPost(\"idPerfil\");\n $adm_perfil = AdmPerfil::findFirstByidPerfil($idPerfil);\n\n if (!$adm_perfil) {\n $this->flash->error(\"adm_perfil does not exist \" . $idPerfil);\n\n $this->dispatcher->forward([\n 'controller' => \"adm_perfil\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $adm_perfil->nombrePerfil = $this->request->getPost(\"nombrePerfil\");\n $adm_perfil->descPerfil = $this->request->getPost(\"descPerfil\");\n \n\n if (!$adm_perfil->save()) {\n\n foreach ($adm_perfil->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"adm_perfil\",\n 'action' => 'edit',\n 'params' => [$adm_perfil->idPerfil]\n ]);\n\n return;\n }\n\n $this->flash->success(\"adm_perfil was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"adm_perfil\",\n 'action' => 'index'\n ]);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"admin\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $admin = Admin::findFirstByid($id);\n\n if (!$admin) {\n $this->flash->error(\"admin does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"admin\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $admin->setId($this->request->getPost(\"id\"));\n $admin->setNombre($this->request->getPost(\"nombre\"));\n $admin->setEmail($this->request->getPost(\"email\", \"email\"));\n $admin->setContrasena($this->request->getPost(\"contrasena\"));\n $admin->setD1($this->request->getPost(\"d1\"));\n \n\n if (!$admin->save()) {\n\n foreach ($admin->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"admin\",\n 'action' => 'edit',\n 'params' => [$admin->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"admin was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"admin\",\n 'action' => 'index'\n ]);\n }", "function mfcs_request_edit_0_form_submit($form, &$form_state) {\n global $mfcs_determined;\n\n $url_arguments = '';\n if (!empty($mfcs_determined['complete'])) {\n $url_arguments .= '?' . $mfcs_determined['complete'];\n }\n\n $clicked_id = '';\n if (isset($form_state['triggering_element']['#id'])) {\n $clicked_id = $form_state['triggering_element']['#id'];\n }\n\n $failure = FALSE;\n $request = &$form['form']['request']['#value'];\n $request_id = (int) $request['mer']['id'][0]->value;\n $status = (int) $request['top']['status'][0]->value;\n $step = (int) $request['top']['step'][0]->value;\n\n // make sure the cancel button is never treated as a save submit.\n if ($clicked_id == 'submit-request-cancel') {\n if (empty($form_state['values']['redirect_to'])) {\n if (empty($request_id)) {\n $form_state['redirect'] = mfcs_build_redirect_array('requests');\n }\n else {\n $form_state['redirect'] = mfcs_build_redirect_array('requests/view-0/' . $request_id);\n }\n }\n else {\n $form_state['redirect'] = $form_state['values']['redirect_to'];\n }\n\n return;\n }\n\n mfcs_include(MFCS_INCLUDE_STRUCTURE);\n mfcs_include(MFCS_INCLUDE_TABLE);\n\n $user = cf_current_user();\n $instance = mfcs_instance();\n\n // The 'Venue Coordinator' location is not a real location, so find the first available location for the room and use it on save.\n if ($form_state['values']['request']['location'][0] == MFCS_BANNER_LOCATION_VENUE_COORDINATOR) {\n $locations = mfcs_load_locations_by_room($form_state['values']['request']['room'][0]);\n $location = reset($locations);\n $form_state['values']['request']['location'][0] = (int) $location->location_id;\n }\n\n $changes = array(\n 'status' => $form_state['values']['request']['status'][0],\n 'step' => $form_state['values']['request']['step'][0],\n 'type' => $form_state['values']['request']['information']['type'][0],\n 'classification' => $form_state['values']['request']['request_coordinator']['classification'][0],\n 'location' => $form_state['values']['request']['location'][0],\n 'building' => $form_state['values']['request']['building'][0],\n 'room' => $form_state['values']['request']['room'][0],\n 'venue_coordinator' => $form_state['values']['request']['venue_coordinator']['user_id'][0],\n 'title' => $form_state['values']['request']['information']['title'][0],\n );\n\n $prepared = mfcs_prepare_request_values($request, $changes);\n if ($prepared === FALSE) {\n form_set_error('form', 'An error occurred while trying to save the request. Please contact the support staff.');\n\n $form_state['rebuild'] = TRUE;\n $form_state['redirect'] = FALSE;\n $form_state['submitted'] = FALSE;\n return;\n }\n\n $structure = mfcs_table_structure();\n $success = mfcs_set_request_values($request, $prepared, $structure, $form['form']['existing']['#value'], $form_state, TRUE);\n if ($success === FALSE) {\n form_set_error('form', 'An error occurred while trying to save the request. Please contact the support staff.');\n $form_state['rebuild'] = TRUE;\n $form_state['redirect'] = FALSE;\n $form_state['submitted'] = FALSE;\n return;\n }\n elseif ($success === TRUE) {\n // forcefully clear the request cache so that it can reflect the changes.\n mfcs_load_request_by_id($request_id, FALSE);\n\n mfcs_include(MFCS_INCLUDE_WORKFLOW);\n\n $parameters = array();\n $parameters['changed_by'] = $user->uid;\n $parameters['changed_type'] = 'user';\n $parameters['status'] = $status;\n $parameters['step'] = $step;\n\n\n // when switching the type to a quick meeting, do not send out update e-mails.\n $to_quick_meeting = NULL;\n if (isset($form_state['values']['request']['information']['type'][0])) {\n $to_quick_meeting = $form_state['values']['request']['information']['type'][0];\n if (is_string($to_quick_meeting)) {\n $to_quick_meeting = (int) $to_quick_meeting;\n }\n }\n\n if ($status === MFCS_REQUEST_STATUS_LOCKED || $status === MFCS_REQUEST_STATUS_CLOSED_ACCEPTED || $status === MFCS_REQUEST_STATUS_CLOSED_ACCEPTED_CANCELLED) {\n $loaded_request = mfcs_load_request_by_id($request_id);\n\n $revision_id = NULL;\n if (isset($loaded_request['mer']['revision'][0]->value) && is_numeric($loaded_request['mer']['revision'][0]->value)) {\n $revision_id = (int) $loaded_request['mer']['revision'][0]->value;\n }\n\n // do not send e-mail when the previous step is already set to venue available.\n if ($step !== MFCS_REVIEW_STEP_VENUE_AVAILABLE && !is_null($revision_id)) {\n $parameters['amendment'] = TRUE;\n $parameters['message'] = mfcs_request_edit_0_form_build_revision_history_message($request_id, $revision_id);\n $parameters['restriction'] = MFCS_REVIEW_RESTRICTIONS_COORDINATOR;\n\n if (is_bool($parameters['message'])) {\n unset($parameters['message']);\n }\n\n mfcs_send_workflow_emails($request_id, $parameters);\n }\n }\n }\n\n\n // redirect after submitting.\n if (empty($form_state['values']['redirect_to'])) {\n if (empty($request_id)) {\n $form_state['redirect'] = mfcs_build_redirect_array('requests');\n }\n else {\n $form_state['redirect'] = mfcs_build_redirect_array('requests/view-0/' . $request_id);\n }\n }\n else {\n $form_state['redirect'] = $form_state['values']['redirect_to'];\n }\n}", "public function actionSaveRequest()\n {\n Craft::log(__METHOD__, LogLevel::Info, true);\n\n // Determine whether this is an existing or new request\n // -----------------------------------------------------------------------------\n\n if($id = craft()->request->getPost('requestId')) {\n $model = craft()->placid_requests->findRequestById($id);\n } else {\n $model = craft()->placid_requests->newRequest($id);\n }\n\n // Get the params from the form\n $params = craft()->request->getPost('params');\n\n // Prepare the params for entry\n // -----------------------------------------------------------------------------\n\n $params = $this->_prepParams($params);\n\n // Define the record attributes\n $atts = array(\n 'name' => craft()->request->getPost('requestName'),\n 'handle' => craft()->request->getPost('handle'),\n 'oauth' => craft()->request->getPost('oauth'),\n 'tokenId' => craft()->request->getPost('tokenId'),\n 'url' => craft()->request->getPost('requestUrl'),\n 'params' => $params,\n );\n\n // Set these new attributes in the model\n $model->setAttributes($atts);\n\n // Try and save the request, otherwise show an error\n // -----------------------------------------------------------------------------\n\n if(craft()->placid_requests->saveRequest($model))\n {\n craft()->userSession->setNotice(Craft::t('Request saved'));\n return $this->redirectToPostedUrl(array('requestId' => $model->getAttribute('id')));\n }\n else\n {\n craft()->userSession->setError(Craft::t(\"Couldn't save request.\"));\n craft()->urlManager->setRouteVariables(array('request' => $model));\n }\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get and set weightedScore
public function setWeightedScore($weightedScore) { $this->weightedScore = $weightedScore; }
[ "private function weightScore() {\n $this->maxScore = round($this->maxScore*self::SCORE_WEIGHT); \n }", "public function getWeight(){\n return $this->_get(self::WEIGHT);\n }", "public function getWeightRate();", "public function getWeight()\n {\n return $this->Weight;\n }", "public function getRatingScore()\n {\n return $this->ratingScore;\n }", "public function getWeight()\n {\n return $this->weight * $this->qty;\n }", "public function get_weight()\n {\n return $this->get(self::WEIGHT);\n }", "private function getScore() {\n\t\treturn $this->score;\n\t}", "public function getScore ()\r\n {\r\n return $this->score;\r\n }", "public function getWeight() {\n return $this->item->getWeight();\n }", "public function setWeight($weight);", "public function get_score()\n\t{\n\t\treturn $this->score;\n\t}", "public function setWeighted($value)\n {\n if (!isset($this->data['fields']['weighted'])) {\n if (!$this->isNew()) {\n $this->getWeighted();\n if ($this->isFieldEqualTo('weighted', $value)) {\n return $this;\n }\n } else {\n if (null === $value) {\n return $this;\n }\n $this->fieldsModified['weighted'] = null;\n $this->data['fields']['weighted'] = $value;\n return $this;\n }\n } elseif ($this->isFieldEqualTo('weighted', $value)) {\n return $this;\n }\n\n if (!isset($this->fieldsModified['weighted']) && !array_key_exists('weighted', $this->fieldsModified)) {\n $this->fieldsModified['weighted'] = $this->data['fields']['weighted'];\n } elseif ($this->isFieldModifiedEqualTo('weighted', $value)) {\n unset($this->fieldsModified['weighted']);\n }\n\n $this->data['fields']['weighted'] = $value;\n\n return $this;\n }", "public function setPricePerWeight($value);", "public function testSetAndGetWeight()\n {\n $value = 20;\n\n self::assertEquals(0, $this->fixture->getWeight());\n self::assertEquals($this->fixture, $this->fixture->setWeight($value));\n self::assertEquals($value, $this->fixture->getWeight());\n }", "public function getRepWeight(): float {\n return $this->weight;\n }", "public function getWeightFrom();", "public function getWeights()\r\n {\r\n return $this->weights;\r\n }", "public function getScore();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Buils a HTML dropdown selector of countries replacement for buildStaticInfoSelector function from StaticInfo extension because we want to show country selector without default selection
function buildCountrySelector($name='', $class='', $selected='', $country='', $submit=0) { $nameAttribute = (trim($name)) ? 'name="'.trim($name).'" ' : ''; $classAttribute = (trim($class)) ? 'class="'.trim($class).'" ' : ''; $onchangeAttribute = ''; if( $submit ) { if( $submit == 1 ) { $onchangeAttribute = 'onchange="'.$this->staticInfo->conf['onChangeAttribute'].'" '; } else { $onchangeAttribute = 'onchange="'.$submit.'" '; } } $selector = '<select size="1" '.$nameAttribute.$classAttribute.$onchangeAttribute.'>'.chr(10); $names = $this->staticInfo->initCountries(); $selected = (trim($selected)) ? trim($selected) : $this->staticInfo->defaultCountry; $allowed = array(); $excluded = array(); if( $this->config["allowedCountry"] != '' || $this->config["excludedCountry"] != '' ) { if( $this->config["allowedCountry"] != '' ) { $allowed = explode(",",$this->config["allowedCountry"]); } if( $this->config["excludedCountry"] != '' ) { $excluded = explode(",",$this->config["excludedCountry"]); } reset($names); while(list($key,$name)=each($names)) { if ( (count($allowed) > 0) && (! in_array($key, $allowed))) { unset($names[$key]); } if ( in_array($key, $excluded)) { unset($names[$key]); } } if( count($allowed) == 1 ) { $selected = $allowed[0] ; } } if( count($names) > 0 ) { $selector .= '<option value=""></option>'.chr(10); $selector .= $this->staticInfo->optionsConstructor($names, $selected); $selector .= '</select>'.chr(10); } else { $selector = ''; } return $selector; }
[ "function countrySelect()\n {\n $list='';\n\n $result=$GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,cn_short_en', 'static_countries', '');\n\n while($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\n {\n\n if(!empty($this->piVars['country'])){\n\n $selected=($this->piVars['country']==$row['uid'])? 'SELECTED':'';\n }else{\n $selected=($row[cn_short_en]=='United States')? 'SELECTED':'';\n }\n\n $list.=\"<OPTION value=\\\"$row[uid]\\\" $selected>$row[cn_short_en]</OPTION>\";\n }\n\n return $list;\n }", "function construct_country_pulldown($countryid = 0, $countryname = '', $fieldname = 'country', $disablestates = false, $statesfieldname = 'state', $showworldwide = false, $usacanadafirst = false, $regionsonly = false, $statesdivid = 'stateid', $onlyiso = false)\n{\n global $ilance, $myapi, $ilconfig, $phrase;\n $html = '<select name=\"' . $fieldname . '\" id=\"' . $fieldname . '\"';\n\t//echo $countryname;\n $html .= ($disablestates == false)\n\t\t? ' onchange=\"return print_states(\\'' . $statesfieldname . '\\', \\'' . $fieldname . '\\', \\'' . $statesdivid . '\\');\"'\n\t\t: '';\n\t\t\n $html .= ' style=\"font-family: verdana\">';\n \n\t$extraquery = ($usacanadafirst) ? \"WHERE locationid != '500' AND locationid != '330'\" : '';\n\t$extraquery = ($regionsonly) ? \"\" : $extraquery;\n $sql = $ilance->db->query(\"\n SELECT locationid, location_\" . $_SESSION['ilancedata']['user']['slng'] . \" AS location, region, cc\n FROM \" . DB_PREFIX . \"locations\n\t\t$extraquery\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n\t\tif ($regionsonly == false)\n\t\t{\n\t\t\t$html .= ($showworldwide)\n\t\t\t\t? '<option value=\"\"></option><option value=\"' . $phrase['_worldwide'] . '\">' . $phrase['_worldwide'] . '</option><option value=\"' . $phrase['_worldwide'] . '\">-------------------------------</option>'\n\t\t\t\t: '';\n\t\t\t\t\n\t\t\t$html .= ($usacanadafirst)\n\t\t\t\t? '<option value=\"330\">Canada</option><option value=\"500\">USA</option><option value=\"\" disabled=\"disabled\">-------------------------------</option>'\n\t\t\t\t: '';\n\t\t}\n\t\t\n while ($res = $ilance->db->fetch_array($sql, DB_ASSOC))\n {\n\t\t\tif ($onlyiso == false)\n\t\t\t{\n\t\t\t\t$html .= ($regionsonly)\n\t\t\t\t\t? '<option value=\"' . mb_strtolower(str_replace(' ', '_', $res['region'])) . '.' . $res['locationid'] . '\"'\n\t\t\t\t\t: '<option value=\"' . $res['location'] . '\"';\n\t\t\t\t\n\t\t\t\t$html .= (mb_strtolower(str_replace(' ', '_', $res['region']) . '.' . $res['locationid']) == $countryname)\n\t\t\t\t\t? ' selected=\"selected\"'\n\t\t\t\t\t: '';\n\t\t\t\t\t\n\t\t\t\t$html .= ($res['locationid'] == $countryid)\n\t\t\t\t\t? ' selected=\"selected\"'\n\t\t\t\t\t: '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html .= '<option value=\"' . $res['cc'] . '\"';\n\t\t\t\t$html .= ($res['locationid'] == $countryid)\n\t\t\t\t\t? ' selected=\"selected\"'\n\t\t\t\t\t: '';\n\t\t\t}\n\t\t\t\n $html .= '>' . handle_input_keywords($res['location']) . '</option>';\n }\n }\n \n $html .= '</select>';\n \n return $html;\n}", "public function getCountriesForSelect();", "function tep_get_country_list($name, $selected = '', $parameters = '') {\r\n $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));\r\n $countries = tep_get_countries();\r\n\r\n for ($i=0, $n=sizeof($countries); $i<$n; $i++) {\r\n $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);\r\n }\r\n\r\n return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);\r\n }", "function buildCountrySelect($selected) {\n // TODO: Include full list\n $countries = [\n 'Afghanistan',\n 'Albania',\n 'Algeria',\n 'Andorra',\n 'Angola'\n ];\n\n $output = '<select id=\"country\" name=\"country\">';\n $output .= '<option value=\"\">Select a country</option>'; \n foreach($countries as $country) {\n $output .= '<option '. ($selected == $country ? 'selected ' : '') .'value=\"'.$country.'\">'.$country.'</option>';\n }\n $output .= '</select>';\n\n return $output;\n}", "protected function country()\n {\n $this->parts['{country}'] = $this->form->field($this->model, $this->model->getCountryPropertyName(), ['options' => ['class' => 'form-group']])->dropDownList(\n ArrayHelper::map(Country::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), [\n 'id' => $this->fieldIds['country']\n , 'prompt' => Yii::t('jlorente/location', 'Select country')\n , 'name' => $this->getSubmitModelName($this->model->getCountryPropertyName())\n ]);\n }", "public function get_for_browse_countries(){\n $country_name = NULL;\n $sql = \"SELECT * from travelimagedetails GROUP by CountryCodeISO\";\n $countrycodes = $this->query($sql);\n while($country = $countrycodes->fetch()){\n $sql = \"select * from geocountries where ISO ='\" . $country[\"CountryCodeISO\"]. \"'\";\n $result = $this->query($sql);\n $countrynames = $result->fetch();\n echo \"<option value='\". $countrynames[\"ISO\"] .\"'> \". $countrynames[\"CountryName\"] .\" </option>\";\n } \n }", "function countrySelect() {\n\t\t\t$country_info = $this->country->country_info($_POST['Country']);\n\n\t\t\t$country_info_display_html = \"\n\t\t\t\t<ul>\n\t\t\t\t\t<li>Country: \".utf8_encode($country_info['Name']).\"</li>\n\t\t\t\t\t<li>Continent: \".$country_info['Continent'].\"</li>\n\t\t\t\t\t<li>Region: \".$country_info['Region'].\"</li>\n\t\t\t\t\t<li>Population: \".$country_info['Population'].\"</li>\n\t\t\t\t\t<li>Life Expectancy: \".$country_info['LifeExpectancy'].\"</li>\n\t\t\t\t\t<li>Government Form: \".$country_info['GovernmentForm'].\"</li>\n\t\t\t\t</ul>\n\t\t\t\";\n\n\t\t\t$data['html'] = $country_info_display_html;\n\t\t\techo json_encode($data);\n\t\t}", "function tep_get_country_list($name, $selected = '', $parameters = '') {\n $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));\n $countries = tep_get_countries();\n\n for ($i=0, $n=sizeof($countries); $i<$n; $i++) {\n $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);\n }\n\n return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);\n }", "public function country_list()\n {\n $result = common_select_values('id, name', 'ad_countries', '', 'result');\n return $result; \n }", "function bp_add_custom_country_list() {\r\n \r\n if ( !xprofile_get_field_id_from_name('Country') && 'bp-profile-setup' == $_GET['page'] ) {\r\n \r\n\t\t$country_list_args = array(\r\n\t\t 'field_group_id' => 1,\r\n\t\t 'name' => 'Country',\r\n\t\t 'description'\t => 'Please select your country',\r\n\t\t 'can_delete' => false,\r\n\t\t 'field_order' \t => 2,\r\n\t\t 'is_required' => false,\r\n\t\t 'type' => 'selectbox',\r\n\t\t 'order_by'\t => 'custom'\r\n \r\n\t\t);\r\n \r\n\t\t$country_list_id = xprofile_insert_field( $country_list_args );\r\n \r\n\t\tif ( $country_list_id ) {\r\n \r\n\t\t\t$countries = array(\r\n\t\t\t\t\"United States\",\t\t\t\r\n\t\t\t\t\"Afghanistan\",\r\n\t\t\t\t\"Albania\",\r\n\t\t\t\t\"Algeria\",\r\n\t\t\t\t\"Andorra\",\r\n\t\t\t\t\"Angola\",\r\n\t\t\t\t\"Antigua and Barbuda\",\r\n\t\t\t\t\"Argentina\",\r\n\t\t\t\t\"Armenia\",\r\n\t\t\t\t\"Australia\",\r\n\t\t\t\t\"Austria\",\r\n\t\t\t\t\"Azerbaijan\",\r\n\t\t\t\t\"Bahamas\",\r\n\t\t\t\t\"Bahrain\",\r\n\t\t\t\t\"Bangladesh\",\r\n\t\t\t\t\"Barbados\",\r\n\t\t\t\t\"Belarus\",\r\n\t\t\t\t\"Belgium\",\r\n\t\t\t\t\"Belize\",\r\n\t\t\t\t\"Benin\",\r\n\t\t\t\t\"Bhutan\",\r\n\t\t\t\t\"Bolivia\",\r\n\t\t\t\t\"Bosnia and Herzegovina\",\r\n\t\t\t\t\"Botswana\",\r\n\t\t\t\t\"Brazil\",\r\n\t\t\t\t\"Brunei\",\r\n\t\t\t\t\"Bulgaria\",\r\n\t\t\t\t\"Burkina Faso\",\r\n\t\t\t\t\"Burundi\",\r\n\t\t\t\t\"Cambodia\",\r\n\t\t\t\t\"Cameroon\",\r\n\t\t\t\t\"Canada\",\r\n\t\t\t\t\"Cape Verde\",\r\n\t\t\t\t\"Central African Republic\",\r\n\t\t\t\t\"Chad\",\r\n\t\t\t\t\"Chile\",\r\n\t\t\t\t\"China\",\r\n\t\t\t\t\"Colombi\",\r\n\t\t\t\t\"Comoros\",\r\n\t\t\t\t\"Congo (Brazzaville)\",\r\n\t\t\t\t\"Congo\",\r\n\t\t\t\t\"Costa Rica\",\r\n\t\t\t\t\"Cote d'Ivoire\",\r\n\t\t\t\t\"Croatia\",\r\n\t\t\t\t\"Cuba\",\r\n\t\t\t\t\"Cyprus\",\r\n\t\t\t\t\"Czech Republic\",\r\n\t\t\t\t\"Denmark\",\r\n\t\t\t\t\"Djibouti\",\r\n\t\t\t\t\"Dominica\",\r\n\t\t\t\t\"Dominican Republic\",\r\n\t\t\t\t\"East Timor (Timor Timur)\",\r\n\t\t\t\t\"Ecuador\",\r\n\t\t\t\t\"Egypt\",\r\n\t\t\t\t\"El Salvador\",\r\n\t\t\t\t\"Equatorial Guinea\",\r\n\t\t\t\t\"Eritrea\",\r\n\t\t\t\t\"Estonia\",\r\n\t\t\t\t\"Ethiopia\",\r\n\t\t\t\t\"Fiji\",\r\n\t\t\t\t\"Finland\",\r\n\t\t\t\t\"France\",\r\n\t\t\t\t\"Gabon\",\r\n\t\t\t\t\"Gambia, The\",\r\n\t\t\t\t\"Georgia\",\r\n\t\t\t\t\"Germany\",\r\n\t\t\t\t\"Ghana\",\r\n\t\t\t\t\"Greece\",\r\n\t\t\t\t\"Grenada\",\r\n\t\t\t\t\"Guatemala\",\r\n\t\t\t\t\"Guinea\",\r\n\t\t\t\t\"Guinea-Bissau\",\r\n\t\t\t\t\"Guyana\",\r\n\t\t\t\t\"Haiti\",\r\n\t\t\t\t\"Honduras\",\r\n\t\t\t\t\"Hungary\",\r\n\t\t\t\t\"Iceland\",\r\n\t\t\t\t\"India\",\r\n\t\t\t\t\"Indonesia\",\r\n\t\t\t\t\"Iran\",\r\n\t\t\t\t\"Iraq\",\r\n\t\t\t\t\"Ireland\",\r\n\t\t\t\t\"Israel\",\r\n\t\t\t\t\"Italy\",\r\n\t\t\t\t\"Jamaica\",\r\n\t\t\t\t\"Japan\",\r\n\t\t\t\t\"Jordan\",\r\n\t\t\t\t\"Kazakhstan\",\r\n\t\t\t\t\"Kenya\",\r\n\t\t\t\t\"Kiribati\",\r\n\t\t\t\t\"Korea, North\",\r\n\t\t\t\t\"Korea, South\",\r\n\t\t\t\t\"Kuwait\",\r\n\t\t\t\t\"Kyrgyzstan\",\r\n\t\t\t\t\"Laos\",\r\n\t\t\t\t\"Latvia\",\r\n\t\t\t\t\"Lebanon\",\r\n\t\t\t\t\"Lesotho\",\r\n\t\t\t\t\"Liberia\",\r\n\t\t\t\t\"Libya\",\r\n\t\t\t\t\"Liechtenstein\",\r\n\t\t\t\t\"Lithuania\",\r\n\t\t\t\t\"Luxembourg\",\r\n\t\t\t\t\"Macedonia\",\r\n\t\t\t\t\"Madagascar\",\r\n\t\t\t\t\"Malawi\",\r\n\t\t\t\t\"Malaysia\",\r\n\t\t\t\t\"Maldives\",\r\n\t\t\t\t\"Mali\",\r\n\t\t\t\t\"Malta\",\r\n\t\t\t\t\"Marshall Islands\",\r\n\t\t\t\t\"Mauritania\",\r\n\t\t\t\t\"Mauritius\",\r\n\t\t\t\t\"Mexico\",\r\n\t\t\t\t\"Micronesia\",\r\n\t\t\t\t\"Moldova\",\r\n\t\t\t\t\"Monaco\",\r\n\t\t\t\t\"Mongolia\",\r\n\t\t\t\t\"Morocco\",\r\n\t\t\t\t\"Mozambique\",\r\n\t\t\t\t\"Myanmar\",\r\n\t\t\t\t\"Namibia\",\r\n\t\t\t\t\"Nauru\",\r\n\t\t\t\t\"Nepal\",\r\n\t\t\t\t\"Netherlands\",\r\n\t\t\t\t\"New Zealand\",\r\n\t\t\t\t\"Nicaragua\",\r\n\t\t\t\t\"Niger\",\r\n\t\t\t\t\"Nigeria\",\r\n\t\t\t\t\"Norway\",\r\n\t\t\t\t\"Oman\",\r\n\t\t\t\t\"Pakistan\",\r\n\t\t\t\t\"Palau\",\r\n\t\t\t\t\"Panama\",\r\n\t\t\t\t\"Papua New Guinea\",\r\n\t\t\t\t\"Paraguay\",\r\n\t\t\t\t\"Peru\",\r\n\t\t\t\t\"Philippines\",\r\n\t\t\t\t\"Poland\",\r\n\t\t\t\t\"Portugal\",\r\n\t\t\t\t\"Qatar\",\r\n\t\t\t\t\"Romania\",\r\n\t\t\t\t\"Russia\",\r\n\t\t\t\t\"Rwanda\",\r\n\t\t\t\t\"Saint Kitts and Nevis\",\r\n\t\t\t\t\"Saint Lucia\",\r\n\t\t\t\t\"Saint Vincent\",\r\n\t\t\t\t\"Samoa\",\r\n\t\t\t\t\"San Marino\",\r\n\t\t\t\t\"Sao Tome and Principe\",\r\n\t\t\t\t\"Saudi Arabia\",\r\n\t\t\t\t\"Senegal\",\r\n\t\t\t\t\"Serbia and Montenegro\",\r\n\t\t\t\t\"Seychelles\",\r\n\t\t\t\t\"Sierra Leone\",\r\n\t\t\t\t\"Singapore\",\r\n\t\t\t\t\"Slovakia\",\r\n\t\t\t\t\"Slovenia\",\r\n\t\t\t\t\"Solomon Islands\",\r\n\t\t\t\t\"Somalia\",\r\n\t\t\t\t\"South Africa\",\r\n\t\t\t\t\"Spain\",\r\n\t\t\t\t\"Sri Lanka\",\r\n\t\t\t\t\"Sudan\",\r\n\t\t\t\t\"Suriname\",\r\n\t\t\t\t\"Swaziland\",\r\n\t\t\t\t\"Sweden\",\r\n\t\t\t\t\"Switzerland\",\r\n\t\t\t\t\"Syria\",\r\n\t\t\t\t\"Taiwan\",\r\n\t\t\t\t\"Tajikistan\",\r\n\t\t\t\t\"Tanzania\",\r\n\t\t\t\t\"Thailand\",\r\n\t\t\t\t\"Togo\",\r\n\t\t\t\t\"Tonga\",\r\n\t\t\t\t\"Trinidad and Tobago\",\r\n\t\t\t\t\"Tunisia\",\r\n\t\t\t\t\"Turkey\",\r\n\t\t\t\t\"Turkmenistan\",\r\n\t\t\t\t\"Tuvalu\",\r\n\t\t\t\t\"Uganda\",\r\n\t\t\t\t\"Ukraine\",\r\n\t\t\t\t\"United Arab Emirates\",\r\n\t\t\t\t\"United Kingdom\",\r\n\t\t\t\t\"Uruguay\",\r\n\t\t\t\t\"Uzbekistan\",\r\n\t\t\t\t\"Vanuatu\",\r\n\t\t\t\t\"Vatican City\",\r\n\t\t\t\t\"Venezuela\",\r\n\t\t\t\t\"Vietnam\",\r\n\t\t\t\t\"Yemen\",\r\n\t\t\t\t\"Zambia\",\r\n\t\t\t\t\"Zimbabwe\"\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\tforeach ( $countries as $country ) {\r\n\t\t\t\t\r\n\t\t\t\txprofile_insert_field( array(\r\n\t\t\t\t\t'field_group_id'\t=> 1,\r\n\t\t\t\t\t'parent_id'\t\t=> $country_list_id,\r\n\t\t\t\t\t'type'\t\t\t=> 'option',\r\n\t\t\t\t\t'name'\t\t\t=> $country,\r\n\t\t\t\t\t'option_order' \t=> $i++\r\n\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t}\r\n \r\n\t\t}\r\n\t}\r\n}", "function country_menu ($selected){\n/*\n\t$countries = array(\"Not Selected\",\n\t\"Afghanistan\",\n\t\"Albania\",\n\t\"Algeria\",\n\t\"American Samoa\",\n\t\"Andorra\",\n\t\"Angola\",\n\t\"Anguilla\",\n\t\"Antarctica\",\n\t\"Antigua and Barbuda\",\n\t\"Argentina\",\n\t\"Armenia\",\n\t\"Aruba\",\n\t\"Australia\",\n\t\"Austria\",\n\t\"Azerbaijan\",\n\t\"Bahamas\",\n\t\"Bahrain\",\n\t\"Bangladesh\",\n\t\"Barbados\",\n\t\"Belarus\",\n\t\"Belgium\",\n\t\"Belize\",\n\t\"Benin\",\n\t\"Bermuda\",\n\t\"Bhutan\",\n\t\"Bolivia\",\n\t\"Bosnia and Herzegovina\",\n\t\"Botswana\",\n\t\"Bouvet Island\",\n\t\"Brazil\",\n\t\"British Indian Ocean Terr.\",\n\t\"Brunei Darussalam\",\n\t\"Bulgaria\",\n\t\"Burkina Faso\",\n\t\"Burundi\",\n\t\"Cambodia\",\n\t\"Cameroon\",\n\t\"Canada\",\n\t\"Cape Verde\",\n\t\"Cayman Islands\",\n\t\"Central African Republic\",\n\t\"Chad\",\n\t\"Chile\",\n\t\"China\",\n\t\"Christmas Island\",\n\t\"Cocos (Keeling) Islands\",\n\t\"Colombia\",\n\t\"Comoros\",\n\t\"Congo\",\n\t\"Cook Islands\",\n\t\"Costa Rica\",\n\t\"Cote d'Ivoire\",\n\t\"Croatia (Hrvatska)\",\n\t\"Cuba\",\n\t\"Cyprus\",\n\t\"Czech Republic\",\n\t\"Denmark\",\n\t\"Djibouti\",\n\t\"Dominica\",\n\t\"Dominican Republic\",\n\t\"East Timor\",\n\t\"Ecuador\",\n\t\"Egypt\",\n\t\"El Salvador\",\n\t\"Equatorial Guinea\",\n\t\"Eritrea\",\n\t\"Estonia\",\n\t\"Ethiopia\",\n\t\"Falkland Islands/Malvinas\",\n\t\"Faroe Islands\",\n\t\"Fiji\",\n\t\"Finland\",\n\t\"France\",\n\t\"France, Metropolitan\",\n\t\"French Guiana\",\n\t\"French Polynesia\",\n\t\"French Southern Terr.\",\n\t\"Gabon\",\n\t\"Gambia\",\n\t\"Georgia\",\n\t\"Germany\",\n\t\"Ghana\",\n\t\"Gibraltar\",\n\t\"Greece\",\n\t\"Greenland\",\n\t\"Grenada\",\n\t\"Guadeloupe\",\n\t\"Guam\",\n\t\"Guatemala\",\n\t\"Guinea\",\n\t\"Guinea-Bissau\",\n\t\"Guyana\",\n\t\"Haiti\",\n\t\"Heard & McDonald Is.\",\n\t\"Honduras\",\n\t\"Hong Kong\",\n\t\"Hungary\",\n\t\"Iceland\",\n\t\"India\",\n\t\"Indonesia\",\n\t\"Iran\",\n\t\"Iraq\",\n\t\"Ireland\",\n\t\"Israel\",\n\t\"Italy\",\n\t\"Jamaica\",\n\t\"Japan\",\n\t\"Jordan\",\n\t\"Kazakhstan\",\n\t\"Kenya\",\n\t\"Kiribati\",\n\t\"Korea, North\",\n\t\"Korea, South\",\n\t\"Kuwait\",\n\t\"Kyrgyzstan\",\n\t\"Lao People's Dem. Rep.\",\n\t\"Latvia\",\n\t\"Lebanon\",\n\t\"Lesotho\",\n\t\"Liberia\",\n\t\"Libyan Arab Jamahiriya\",\n\t\"Liechtenstein\",\n\t\"Lithuania\",\n\t\"Luxembourg\",\n\t\"Macau\",\n\t\"Macedonia\",\n\t\"Madagascar\",\n\t\"Malawi\",\n\t\"Malaysia\",\n\t\"Maldives\",\n\t\"Mali\",\n\t\"Malta\",\n\t\"Marshall Islands\",\n\t\"Martinique\",\n\t\"Mauritania\",\n\t\"Mauritius\",\n\t\"Mayotte\",\n\t\"Mexico\",\n\t\"Micronesia\",\n\t\"Moldova\",\n\t\"Monaco\",\n\t\"Mongolia\",\n\t\"Montserrat\",\n\t\"Morocco\",\n\t\"Mozambique\",\n\t\"Myanmar\",\n\t\"Namibia\",\n\t\"Nauru\",\n\t\"Nepal\",\n\t\"Netherlands\",\n\t\"Netherlands Antilles\",\n\t\"New Caledonia\",\n\t\"New Zealand\",\n\t\"Nicaragua\",\n\t\"Niger\",\n\t\"Nigeria\",\n\t\"Niue\",\n\t\"Norfolk Island\",\n\t\"Northern Mariana Is.\",\n\t\"Norway\",\n\t\"Oman\",\n\t\"Pakistan\",\n\t\"Palau\",\n\t\"Panama\",\n\t\"Papua New Guinea\",\n\t\"Paraguay\",\n\t\"Peru\",\n\t\"Philippines\",\n\t\"Pitcairn\",\n\t\"Poland\",\n\t\"Portugal\",\n\t\"Puerto Rico\",\n\t\"Qatar\",\n\t\"Reunion\",\n\t\"Romania\",\n\t\"Russian Federation\",\n\t\"Rwanda\",\n\t\"S.Georgia & S.Sandwich Is.\",\n\t\"Saint Kitts and Nevis\",\n\t\"Saint Lucia\",\n\t\"Samoa\",\n\t\"San Marino\",\n\t\"Sao Tome & Principe\",\n\t\"Saudi Arabia\",\n\t\"Senegal\",\n\t\"Seychelles\",\n\t\"Sierra Leone\",\n\t\"Singapore\",\n\t\"Slovakia (Slovak Republic)\",\n\t\"Slovenia\",\n\t\"Solomon Islands\",\n\t\"Somalia\",\n\t\"South Africa\",\n\t\"Spain\",\n\t\"Sri Lanka\",\n\t\"St. Helena\",\n\t\"St. Pierre & Miquelon\",\n\t\"St. Vincent & Grenadines\",\n\t\"Sudan\",\n\t\"Suriname\",\n\t\"Svalbard & Jan Mayen Is.\",\n\t\"Swaziland\",\n\t\"Sweden\",\n\t\"Switzerland\",\n\t\"Syrian Arab Republic\",\n\t\"Taiwan\",\n\t\"Tajikistan\",\n\t\"Tanzania\",\n\t\"Thailand\",\n\t\"Togo\",\n\t\"Tokelau\",\n\t\"Tonga\",\n\t\"Trinidad and Tobago\",\n\t\"Tunisia\",\n\t\"Turkey\",\n\t\"Turkmenistan\",\n\t\"Turks & Caicos Islands\",\n\t\"Tuvalu\",\n\t\"U.S. Minor Outlying Is.\",\n\t\"Uganda\",\n\t\"Ukraine\",\n\t\"United Arab Emirates\",\n\t\"United Kingdom\",\n\t\"United States\",\n\t\"Uruguay\",\n\t\"Uzbekistan\",\n\t\"Vanuatu\",\n\t\"Vatican (Holy See)\",\n\t\"Venezuela\",\n\t\"Vietnam\",\n\t\"Virgin Islands (British)\",\n\t\"Virgin Islands (U.S.)\",\n\t\"Wallis & Futuna Is.\",\n\t\"Western Sahara\",\n\t\"Yemen\",\n\t\"Yugoslavia\",\n\t\"Zaire\",\n\t\"Zambia\",\n\t\"Zimbabwe\");\n\t*/\n\t$countries = array(\"(未選択)\",\n\t\"北海道\", \n\t\"青森県\", \n\t\"岩手県\", \n\t\"宮城県\", \n\t\"秋田県\", \n\t\"山形県\", \n\t\"福島県\", \n\t\"茨城県\", \n\t\"栃木県\", \n\t\"群馬県\", \n\t\"埼玉県\", \n\t\"千葉県\", \n\t\"東京都\", \n\t\"神奈川県\", \n\t\"新潟県\", \n\t\"富山県\", \n\t\"石川県\", \n\t\"福井県\", \n\t\"山梨県\", \n\t\"長野県\", \n\t\"岐阜県\", \n\t\"静岡県\", \n\t\"愛知県\", \n\t\"三重県\", \n\t\"滋賀県\", \n\t\"京都府\", \n\t\"大阪府\", \n\t\"兵庫県\", \n\t\"奈良県\", \n\t\"和歌山県\", \n\t\"鳥取県\", \n\t\"島根県\", \n\t\"岡山県\", \n\t\"広島県\", \n\t\"山口県\", \n\t\"徳島県\", \n\t\"香川県\", \n\t\"愛媛県\", \n\t\"高知県\", \n\t\"福岡県\", \n\t\"佐賀県\", \n\t\"長崎県\", \n\t\"熊本県\", \n\t\"大分県\", \n\t\"宮崎県\", \n\t\"鹿児島県\", \n\t\"沖縄県\");\n\n\t$menu_code = '<select name=\"country\">'.\"\\n\";\n\tforeach ($countries as $country){\n\t\tif($selected == $country) $select_text = ' selected=\"selected\"'; else $select_text = NULL;\n\t\t$menu_code .= '<option value=\"'.$country.'\"'.$select_text.'>'.$country.'</option>'.\"\\n\";\n\t}\n\t$menu_code .= '</select>';\n\treturn $menu_code;\n}", "function countrylist($sourcelang = false, $countries = false,$selected = false,$allownone = true) {\n $r = '';\n if ($allownone) $r .= \"<option value=\\\"\\\">(no_selection)</option>\";\n foreach ($this->regiondata->country_names_en as $country => $loc_name) {\n if (($countries == false) || (in_array($country,$countries))) {\n if (isset($this->regiondata->country_names[$country])) {\n $native = $this->regiondata->country_names[$country];\n if (is_array($native)) { reset($native); $native = current($native); }\n if (($native != '') && ($native != $loc_name)) {\n $native = ' ('.$native.')';\n } else {\n $native = '';\n }\t\t\n if ($selected == $country) {\n $extra = \" selected=\\\"selected\\\"\";\n } else {\n $extra = '';\n }\n $r .= \"<option value=\\\"$country\\\"$extra>\".$loc_name.$native.\"</option>\";\n }\n }\n }\n return $r;\n }", "function displayAvailableCountries() {\n $db = dbConnect();\n $countries = dbGetAllCountries($db); // Récupération des pays\n\n // Création d'une ligne par pays avec comme value le code ISO et comme texte le nom du pays\n foreach($countries as $country) {\n echo \"<option value='\" . $country->getIso_code() . \"'>\" . $country->getName() . \"</option>\";\n }\n }", "function select_country_tag($name, $selected = null, $options = array())\n{\n $c = new sfCultureInfo(sfContext::getInstance()->getUser()->getCulture());\n $countries = $c->getCountries();\n\n if ($country_option = _get_option($options, 'countries'))\n {\n foreach ($countries as $key => $value)\n {\n if (!in_array($key, $country_option))\n {\n unset($countries[$key]);\n }\n }\n }\n\n asort($countries);\n\n $option_tags = options_for_select($countries, $selected, $options);\n unset($options['include_blank'], $options['include_custom']);\n\n return select_tag($name, $option_tags, $options);\n}", "function print_item_shipping_countries_pulldown($projectid = 0, $string = false, $onlyregions = false, $worldwide = false, $selectedcid = 0)\r\n{\r\n\tglobal $ilance, $phrase, $show;\r\n\t\r\n\t$html = '';\r\n\tif ($string == false)\r\n\t{\r\n\t\t//$html = '<select name=\"showshippingdestinations\" id=\"showshippingdestinations\" style=\"font-family: verdana\" onchange=\"show_listing_shipping_rows()\"><option value=\"\">-</option>';\r\n\t\t$html = '<select name=\"showshippingdestinations\" id=\"showshippingdestinations\" style=\"font-family: verdana\"><option value=\"\">-</option>';\r\n\t}\r\n\t\r\n\t$sql = $ilance->db->query(\"\r\n\t\tSELECT country, countryid, region\r\n\t\tFROM \" . DB_PREFIX . \"projects_shipping_regions\r\n\t\tWHERE project_id = '\" . intval($projectid) . \"'\r\n\t\t\" . ($onlyregions ? \"GROUP BY region\" : \"\") . \"\r\n\t\t\" . ($string == false ? \"GROUP BY country\" : \"\") . \"\r\n\t\tORDER BY country ASC\r\n\t\");\r\n\tif ($ilance->db->num_rows($sql) > 0)\r\n\t{\r\n\t\twhile ($res = $ilance->db->fetch_array($sql, DB_ASSOC))\r\n\t\t{\r\n\t\t\tif ($string == false)\r\n\t\t\t{\r\n\t\t\t\t$html .= (isset($selectedcid) AND $selectedcid > 0 AND $selectedcid == $res['countryid'])\r\n\t\t\t\t\t? '<option value=\"' . $res['countryid'] . '\" selected=\"selected\">' . handle_input_keywords($res['country']) . '</option>'\r\n\t\t\t\t\t: '<option value=\"' . $res['countryid'] . '\">' . handle_input_keywords($res['country']) . '</option>';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$html .= ($onlyregions)\r\n\t\t\t\t\t? ucwords(str_replace('_', ' ', $res['region'])) . ', '\r\n\t\t\t\t\t: handle_input_keywords($res['country']) . ', ';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($html) AND $string)\r\n\t\t{\r\n\t\t\t$html = substr($html, 0, -2);\r\n\t\t}\r\n\t}\r\n\t\r\n\t$html .= ($string == false) ? '</select>' : '';\r\n\t\r\n\treturn $html;\r\n}", "public function c_select($selected='United States',$name='country',$class='form-control'){\n\t\n\t\n\t\tif(isset($cdata)){\n\t\t\t$results=array('country'=>$selected);\n\t\t}else{\n\t\t\t$results=array('country'=>$selected);\n\t\t}\n\t\t//$results['country']==\"\";\n\t\t?>\n\t\t\n\t\t<select class=\"form-control input-sm\" id=\"country\" name=\"<?php echo $name;?>\" required tabindex=\"4\" class=<?php echo $class;?>>\n\t\t<option value=\"\" <?php if($results['country']==\"\"){ ?>selected=\"selected\"<?php } ?> disabled>Select Country</option> \n\t\t<option value=\"Afghanistan\" <?php if($results['country']==\"Afghanistan\"){ ?>selected=\"selected\"<?php } ?>>Afghanistan</option>\n\t\t<option value=\"Albania\" <?php if($results['country']==\"Albania\"){ ?>selected=\"selected\"<?php } ?>>Albania</option>\n\t\t<option value=\"Algeria\" <?php if($results['country']==\"Algeria\"){ ?>selected=\"selected\"<?php } ?>>Algeria</option>\n\t\t<option value=\"American Samoa\" <?php if($results['country']==\"American Samoa\"){ ?>selected=\"selected\"<?php } ?>>American Samoa</option> \n\t\t<option value=\"Andorra\" <?php if($results['country']==\"Andorra\"){ ?>selected=\"selected\"<?php } ?>>Andorra</option>\n\t\t<option value=\"Angola\" <?php if($results['country']==\"Angola\"){ ?>selected=\"selected\"<?php } ?>>Angola</option> \n\t\t<option value=\"Anguilla\" <?php if($results['country']==\"Anguilla\"){ ?>selected=\"selected\"<?php } ?>>Anguilla</option>\n\t\t<option value=\"Antarctica\" <?php if($results['country']==\"Antarctica\"){ ?>selected=\"selected\"<?php } ?>>Antarctica</option>\n\t\t<option value=\"Antigua and Barbuda\" <?php if($results['country']==\"Antigua and Barbuda\"){ ?>selected=\"selected\"<?php } ?>>Antigua and Barbuda</option>\n\t\t <option value=\"Argentina\" <?php if($results['country']==\"Argentina\"){ ?>selected=\"selected\"<?php } ?>>Argentina</option>\n\t\t<option value=\"Armenia\" <?php if($results['country']==\"Armenia\"){ ?>selected=\"selected\"<?php } ?>>Armenia</option> \n\t\t<option value=\"Aruba\" <?php if($results['country']==\"Aruba\"){ ?>selected=\"selected\"<?php } ?>>Aruba</option>\n\t\t<option value=\"Australia\" <?php if($results['country']==\"Australia\"){ ?>selected=\"selected\"<?php } ?>>Australia</option>\n\t\t<option value=\"Austria\" <?php if($results['country']==\"Austria\"){ ?>selected=\"selected\"<?php } ?>>Austria</option>\n\t\t<option value=\"Azerbaijan\" <?php if($results['country']==\"Azerbaijan\"){ ?>selected=\"selected\"<?php } ?>>Azerbaijan</option>\n\t\t<option value=\"Bahamas\" <?php if($results['country']==\"Bahamas\"){ ?>selected=\"selected\"<?php } ?>>Bahamas</option> \n\t\t<option value=\"Bahrain\" <?php if($results['country']==\"Bahrain\"){ ?>selected=\"selected\"<?php } ?>>Bahrain</option>\n\t\t<option value=\"Bangladesh\" <?php if($results['country']==\"Bangladesh\"){ ?>selected=\"selected\"<?php } ?>>Bangladesh</option>\n\t\t<option value=\"Barbados\" <?php if($results['country']==\"Barbados\"){ ?>selected=\"selected\"<?php } ?>>Barbados</option> \n\t\t<option value=\"Belarus\" <?php if($results['country']==\"Belarus\"){ ?>selected=\"selected\"<?php } ?>>Belarus</option>\n\t\t<option value=\"Belgium\" <?php if($results['country']==\"Belgium\"){ ?>selected=\"selected\"<?php } ?>>Belgium</option> \n\t\t<option value=\"Belize\" <?php if($results['country']==\"Belize\"){ ?>selected=\"selected\"<?php } ?>>Belize</option>\n\t\t<option value=\"Benin\" <?php if($results['country']==\"Benin\"){ ?>selected=\"selected\"<?php } ?>>Benin</option>\n\t\t<option value=\"Bermuda\" <?php if($results['country']==\"Bermuda\"){ ?>selected=\"selected\"<?php } ?>>Bermuda</option>\n\t\t<option value=\"Bhutan\" <?php if($results['country']==\"Bhutan\"){ ?>selected=\"selected\"<?php } ?>>Bhutan</option>\n\t\t<option value=\"Bolivia\" <?php if($results['country']==\"Bolivia\"){ ?>selected=\"selected\"<?php } ?>>Bolivia</option>\n\t\t<option value=\"Bosnia and Herzegovina\" <?php if($results['country']==\"Bosnia and Herzegovina\"){ ?>selected=\"selected\"<?php } ?>>Bosnia and Herzegovina</option> \n\t\t<option value=\"Botswana\" <?php if($results['country']==\"Botswana\"){ ?>selected=\"selected\"<?php } ?>>Botswana</option> \n\t\t<option value=\"Bouvet Island\" <?php if($results['country']==\"Bouvet Island\"){ ?>selected=\"selected\"<?php } ?>>Bouvet Island</option>\n\t\t <option value=\"Brazil\" <?php if($results['country']==\"Brazil\"){ ?>selected=\"selected\"<?php } ?>>Brazil</option> \n\t\t<option value=\"British Indian Ocean Territory\" <?php if($results['country']==\"British Indian Ocean Territory\"){ ?>selected=\"selected\"<?php } ?>>British Indian Ocean Territory</option>\n\t\t<option value=\"Brunei Darussalam\" <?php if($results['country']==\"Brunei Darussalam\"){ ?>selected=\"selected\"<?php } ?>>Brunei Darussalam</option> \n\t\t<option value=\"Bulgaria\" <?php if($results['country']==\"Bulgaria\"){ ?>selected=\"selected\"<?php } ?>>Bulgaria</option> \n\t\t<option value=\"Burkina Faso\" <?php if($results['country']==\"Burkina Faso\"){ ?>selected=\"selected\"<?php } ?>>Burkina Faso</option> \n\t\t<option value=\"Burundi\" <?php if($results['country']==\"Burundi\"){ ?>selected=\"selected\"<?php } ?>>Burundi</option> \n\t\t<option value=\"Cambodia\" <?php if($results['country']==\"Cambodia\"){ ?>selected=\"selected\"<?php } ?>>Cambodia</option> \n\t\t<option value=\"Cameroon\" <?php if($results['country']==\"Cameroon\"){ ?>selected=\"selected\"<?php } ?>>Cameroon</option> \n\t\t<option value=\"Canada\" <?php if($results['country']==\"Canada\"){ ?>selected=\"selected\"<?php } ?>>Canada</option>\n\t\t<option value=\"Cape Verde\" <?php if($results['country']==\"Cape Verde\"){ ?>selected=\"selected\"<?php } ?>>Cape Verde</option>\n\t\t<option value=\"Cayman Islands\" <?php if($results['country']==\"Cayman Islands\"){ ?>selected=\"selected\"<?php } ?>>Cayman Islands</option> \n\t\t<option value=\"Central African Republic\" <?php if($results['country']==\"Central African Republic\"){ ?>selected=\"selected\"<?php } ?>>Central African Republic</option> \n\t\t<option value=\"Chad\" <?php if($results['country']==\"Chad\"){ ?>selected=\"selected\"<?php } ?>>Chad</option>\n\t\t<option value=\"Chile\" <?php if($results['country']==\"Chile\"){ ?>selected=\"selected\"<?php } ?>>Chile</option>\n\t\t<option value=\"China\" <?php if($results['country']==\"China\"){ ?>selected=\"selected\"<?php } ?>>China</option>\n\t\t<option value=\"Christmas Island\" <?php if($results['country']==\"Christmas Island\"){ ?>selected=\"selected\"<?php } ?>>Christmas Island</option>\n\t\t<option value=\"Cocos (Keeling) Islands\" <?php if($results['country']==\"Cocos (Keeling) Islands\"){ ?>selected=\"selected\"<?php } ?>>Cocos (Keeling) Islands</option>\n\t\t<option value=\"Colombia\" <?php if($results['country']==\"Colombia\"){ ?>selected=\"selected\"<?php } ?>>Colombia</option>\n\t\t <option value=\"Comoros\" <?php if($results['country']==\"Comoros\"){ ?>selected=\"selected\"<?php } ?>>Comoros</option> \n\t\t<option value=\"Congo\" <?php if($results['country']==\"Congo\"){ ?>selected=\"selected\"<?php } ?>>Congo</option> \n\t\t<option value=\"Congo, The Democratic Republic of The\" <?php if($results['country']==\"Congo, The Democratic Republic of The\"){ ?>selected=\"selected\"<?php } ?>>Congo, The Democratic Republic of The</option>\n\t\t<option value=\"Cook Islands\" <?php if($results['country']==\"Cook Islands\"){ ?>selected=\"selected\"<?php } ?>>Cook Islands</option>\n\t\t<option value=\"Costa Rica\" <?php if($results['country']==\"osta Rica\"){ ?>selected=\"selected\"<?php } ?>>Costa Rica</option> <option value=\"Cote D'ivoire\">Cote D'ivoire</option>\n\t\t <option value=\"Croatia\" <?php if($results['country']==\"Croatia\"){ ?>selected=\"selected\"<?php } ?>>Croatia</option>\n\t\t<option value=\"Cuba\" <?php if($results['country']==\"Cuba\"){ ?>selected=\"selected\"<?php } ?>>Cuba</option> \n\t\t<option value=\"Cyprus\" <?php if($results['country']==\"Cyprus\"){ ?>selected=\"selected\"<?php } ?>>Cyprus</option>\n\t\t <option value=\"Czech Republic\" <?php if($results['country']==\"Czech Republic\"){ ?>selected=\"selected\"<?php } ?>>Czech Republic</option>\n\t\t<option value=\"Denmark\" <?php if($results['country']==\"Denmark\"){ ?>selected=\"selected\"<?php } ?>>Denmark</option> \n\t\t<option value=\"Djibouti\" <?php if($results['country']==\"Djibouti\"){ ?>selected=\"selected\"<?php } ?>>Djibouti</option>\n\t\t<option value=\"Dominica\" <?php if($results['country']==\"Dominica\"){ ?>selected=\"selected\"<?php } ?>>Dominica</option>\n\t\t <option value=\"Dominican Republic\" <?php if($results['country']==\"Dominican Republic\"){ ?>selected=\"selected\"<?php } ?>>Dominican Republic</option> \n\t\t<option value=\"Ecuador\" <?php if($results['country']==\"Ecuador\"){ ?>selected=\"selected\"<?php } ?>>Ecuador</option>\n\t\t <option value=\"Egypt\" <?php if($results['country']==\"Egypt\"){ ?>selected=\"selected\"<?php } ?>>Egypt</option> \n\t\t<option value=\"El Salvador\" <?php if($results['country']==\"El Salvador\"){ ?>selected=\"selected\"<?php } ?>>El Salvador</option> \n\t\t<option value=\"Equatorial Guinea\" <?php if($results['country']==\"Equatorial Guinea\"){ ?>selected=\"selected\"<?php } ?>>Equatorial Guinea</option>\n\t\t<option value=\"Eritrea\" <?php if($results['country']==\"Eritrea\"){ ?>selected=\"selected\"<?php } ?>>Eritrea</option>\n\t\t <option value=\"Estonia\" <?php if($results['country']==\"Estonia\"){ ?>selected=\"selected\"<?php } ?>>Estonia</option>\n\t\t<option value=\"Ethiopia\" <?php if($results['country']==\"Ethiopia\"){ ?>selected=\"selected\"<?php } ?>>Ethiopia</option> \n\t\t<option value=\"Falkland Islands (Malvinas)\" <?php if($results['country']==\"Falkland Islands (Malvinas)\"){ ?>selected=\"selected\"<?php } ?>>Falkland Islands (Malvinas)</option>\n\t\t<option value=\"Faroe Islands\" <?php if($results['country']==\"Faroe Islands\"){ ?>selected=\"selected\"<?php } ?>>Faroe Islands</option>\n\t\t<option value=\"Fiji\" <?php if($results['country']==\"Fiji\"){ ?>selected=\"selected\"<?php } ?>>Fiji</option> \n\t\t<option value=\"Finland\" <?php if($results['country']==\"Finland\"){ ?>selected=\"selected\"<?php } ?>>Finland</option>\n\t\t <option value=\"France\" <?php if($results['country']==\"France\"){ ?>selected=\"selected\"<?php } ?>>France</option>\n\t\t <option value=\"French Guiana\" <?php if($results['country']==\"French Guiana\"){ ?>selected=\"selected\"<?php } ?>>French Guiana</option>\n\t\t<option value=\"French Polynesia\" <?php if($results['country']==\"French Polynesia\"){ ?>selected=\"selected\"<?php } ?>>French Polynesia</option>\n\t\t<option value=\"French Southern Territories\" <?php if($results['country']==\"French Southern Territories\"){ ?>selected=\"selected\"<?php } ?>>French Southern Territories</option> \n\t\t<option value=\"Gabon\" <?php if($results['country']==\"Gabon\"){ ?>selected=\"selected\"<?php } ?>>Gabon</option> \n\t\t<option value=\"Gambia\" <?php if($results['country']==\"Gambia\"){ ?>selected=\"selected\"<?php } ?>>Gambia</option> \n\t\t<option value=\"Georgia\" <?php if($results['country']==\"Georgia\"){ ?>selected=\"selected\"<?php } ?>>Georgia</option> \n\t\t<option value=\"Germany\" <?php if($results['country']==\"Germany\"){ ?>selected=\"selected\"<?php } ?>>Germany</option>\n\t\t<option value=\"Ghana\" <?php if($results['country']==\"Ghana\"){ ?>selected=\"selected\"<?php } ?>>Ghana</option>\n\t\t<option value=\"Gibraltar\" <?php if($results['country']==\"Gibraltar\"){ ?>selected=\"selected\"<?php } ?>>Gibraltar</option> \n\t\t<option value=\"Greece\" <?php if($results['country']==\"Greece\"){ ?>selected=\"selected\"<?php } ?>>Greece</option> \n\t\t<option value=\"Greenland\" <?php if($results['country']==\"Greenland\"){ ?>selected=\"selected\"<?php } ?>>Greenland</option>\n\t\t<option value=\"Grenada\" <?php if($results['country']==\"Grenada\"){ ?>selected=\"selected\"<?php } ?>>Grenada</option> \n\t\t<option value=\"Guadeloupe\" <?php if($results['country']==\"Guadeloupe\"){ ?>selected=\"selected\"<?php } ?>>Guadeloupe</option> \n\t\t<option value=\"Guam\" <?php if($results['country']==\"Guam\"){ ?>selected=\"selected\"<?php } ?>>Guam</option>\n\t\t<option value=\"Guatemala\" <?php if($results['country']==\"Guatemala\"){ ?>selected=\"selected\"<?php } ?>>Guatemala</option>\n\t\t<option value=\"Guinea\" <?php if($results['country']==\"Guinea\"){ ?>selected=\"selected\"<?php } ?>>Guinea</option> \n\t\t<option value=\"Guinea-bissau\" <?php if($results['country']==\"Guinea-bissau\"){ ?>selected=\"selected\"<?php } ?>>Guinea-bissau</option> \n\t\t<option value=\"Guyana\" <?php if($results['country']==\"Guyana\"){ ?>selected=\"selected\"<?php } ?>>Guyana</option> \n\t\t<option value=\"Haiti\" <?php if($results['country']==\"Haiti\"){ ?>selected=\"selected\"<?php } ?>>Haiti</option> \n\t\t<option value=\"Heard Island and Mcdonald Islands\" <?php if($results['country']==\"Heard Island and Mcdonald Islands\"){ ?>selected=\"selected\"<?php } ?>>Heard Island and Mcdonald Islands</option> \n\t\t<option value=\"Holy See (Vatican City State)\" <?php if($results['country']==\"Holy See (Vatican City State)\"){ ?>selected=\"selected\"<?php } ?>>Holy See (Vatican City State)</option> \n\t\t<option value=\"Honduras\" <?php if($results['country']==\"Honduras\"){ ?>selected=\"selected\"<?php } ?>>Honduras</option> <option value=\"Hong Kong\">Hong Kong</option> \n\t\t<option value=\"Hungary\" <?php if($results['country']==\"Hungary\"){ ?>selected=\"selected\"<?php } ?>>Hungary</option> \n\t\t<option value=\"Iceland\" <?php if($results['country']==\"Iceland\"){ ?>selected=\"selected\"<?php } ?>>Iceland</option> \n\t\t<option value=\"India\" <?php if($results['country']==\"India\"){ ?>selected=\"selected\"<?php } ?>>India</option> \n\t\t<option value=\"Indonesia\" <?php if($results['country']==\"Indonesia\"){ ?>selected=\"selected\"<?php } ?>>Indonesia</option>\n\t\t<option value=\"Iran, Islamic Republic of\" <?php if($results['country']==\"Iran, Islamic Republic of\"){ ?>selected=\"selected\"<?php } ?>>Iran, Islamic Republic of</option> \n\t\t<option value=\"Iraq\" <?php if($results['country']==\"Iraq\"){ ?>selected=\"selected\"<?php } ?>>Iraq</option> \n\t\t<option value=\"Ireland\" <?php if($results['country']==\"Ireland\"){ ?>selected=\"selected\"<?php } ?>>Ireland</option>\n\t\t<option value=\"Israel\" <?php if($results['country']==\"Israel\"){ ?>selected=\"selected\"<?php } ?>>Israel</option> \n\t\t<option value=\"Italy\" <?php if($results['country']==\"Italy\"){ ?>selected=\"selected\"<?php } ?>>Italy</option> \n\t\t<option value=\"Jamaica\" <?php if($results['country']==\"Jamaica\"){ ?>selected=\"selected\"<?php } ?>>Jamaica</option>\n\t\t<option value=\"Japan\" <?php if($results['country']==\"Japan\"){ ?>selected=\"selected\"<?php } ?>>Japan</option>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <option value=\"Jordan\" <?php if($results['country']==\"Jordan\"){ ?>selected=\"selected\"<?php } ?>>Jordan</option>\n\t\t<option value=\"Kazakhstan\" <?php if($results['country']==\"Kazakhstan\"){ ?>selected=\"selected\"<?php } ?>>Kazakhstan</option>\n\t\t<option value=\"Kenya\" <?php if($results['country']==\"Kenya\"){ ?>selected=\"selected\"<?php } ?>>Kenya</option>\n\t\t<option value=\"Kiribati\" <?php if($results['country']==\"Kiribati\"){ ?>selected=\"selected\"<?php } ?>>Kiribati</option> \n\t\t<option value=\"Korea, Democratic People's Republic of\" <?php if($results['country']==\"Korea, Democratic People's Republic of\"){ ?>selected=\"selected\"<?php } ?>>Korea, Democratic People's Republic of</option>\n\t\t<option value=\"Korea, Republic of\" <?php if($results['country']==\"Korea, Republic of\"){ ?>selected=\"selected\"<?php } ?>>Korea, Republic of</option> <option value=\"Kuwait\">Kuwait</option> \n\t\t<option value=\"Kyrgyzstan\" <?php if($results['country']==\"Kyrgyzstan\"){ ?>selected=\"selected\"<?php } ?>>Kyrgyzstan</option>\n\t\t<option value=\"Lao People's Democratic Republic\" <?php if($results['country']==\"Lao People's Democratic Republic\"){ ?>selected=\"selected\"<?php } ?>>Lao People's Democratic Republic</option> \n\t\t<option value=\"Latvia\" <?php if($results['country']==\"Latvia\"){ ?>selected=\"selected\"<?php } ?>>Latvia</option>\n\t\t<option value=\"Lebanon\" <?php if($results['country']==\"Lebanon\"){ ?>selected=\"selected\"<?php } ?>>Lebanon</option> \n\t\t<option value=\"Lesotho\" <?php if($results['country']==\"Lesotho\"){ ?>selected=\"selected\"<?php } ?>>Lesotho</option> \n\t\t<option value=\"Liberia\" <?php if($results['country']==\"Liberia\"){ ?>selected=\"selected\"<?php } ?>>Liberia</option>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <option value=\"Libyan Arab Jamahiriya\" <?php if($results['country']==\"Libyan Arab Jamahiriya\"){ ?>selected=\"selected\"<?php } ?>>Libyan Arab Jamahiriya</option> \n\t\t<option value=\"Liechtenstein\" <?php if($results['country']==\"Liechtenstein\"){ ?>selected=\"selected\"<?php } ?>>Liechtenstein</option>\n\t\t<option value=\"Lithuania\" <?php if($results['country']==\"Lithuania\"){ ?>selected=\"selected\"<?php } ?>>Lithuania</option> \n\t\t<option value=\"Luxembourg\" <?php if($results['country']==\"Luxembourg\"){ ?>selected=\"selected\"<?php } ?>>Luxembourg</option> <option value=\"Macao\">Macao</option>\n\t\t<option value=\"Macedonia, The Former Yugoslav Republic of\" <?php if($results['country']==\"Macedonia, The Former Yugoslav Republic of\"){ ?>selected=\"selected\"<?php } ?>>Macedonia, The Former Yugoslav Republic of</option> \n\t\t<option value=\"Madagascar\" <?php if($results['country']==\"Madagascar\"){ ?>selected=\"selected\"<?php } ?>>Madagascar</option> \n\t\t<option value=\"Malawi\" <?php if($results['country']==\"Malawi\"){ ?>selected=\"selected\"<?php } ?>>Malawi</option>\n\t\t<option value=\"Malaysia\" <?php if($results['country']==\"Malaysia\"){ ?>selected=\"selected\"<?php } ?>>Malaysia</option> \n\t\t<option value=\"Maldives\" <?php if($results['country']==\"Maldives\"){ ?>selected=\"selected\"<?php } ?>>Maldives</option>\n\t\t<option value=\"Mali\" <?php if($results['country']==\"Mali\"){ ?>selected=\"selected\"<?php } ?>>Mali</option>\n\t\t <option value=\"Malta\" <?php if($results['country']==\"Malta\"){ ?>selected=\"selected\"<?php } ?>>Malta</option>\n\t\t <option value=\"Marshall Islands\" <?php if($results['country']==\"Marshall Islands\"){ ?>selected=\"selected\"<?php } ?>>Marshall Islands</option>\n\t\t<option value=\"Martinique\" <?php if($results['country']==\"Martinique\"){ ?>selected=\"selected\"<?php } ?>>Martinique</option>\n\t\t <option value=\"Mauritania\" <?php if($results['country']==\"Mauritania\"){ ?>selected=\"selected\"<?php } ?>>Mauritania</option> \n\t\t<option value=\"Mauritius\" <?php if($results['country']==\"Mauritius\"){ ?>selected=\"selected\"<?php } ?>>Mauritius</option> <option value=\"Mayotte\">Mayotte</option>\n\t\t<option value=\"Mexico\" <?php if($results['country']==\"Mexico\"){ ?>selected=\"selected\"<?php } ?>>Mexico</option>\n\t\t<option value=\"Micronesia, Federated States of\" <?php if($results['country']==\"Micronesia, Federated States of\"){ ?>selected=\"selected\"<?php } ?>>Micronesia, Federated States of</option>\n\t\t<option value=\"Moldova, Republic of\" <?php if($results['country']==\"Moldova, Republic of\"){ ?>selected=\"selected\"<?php } ?>>Moldova, Republic of</option>\n\t\t<option value=\"Monaco\" <?php if($results['country']==\"Monaco\"){ ?>selected=\"selected\"<?php } ?>>Monaco</option>\n\t\t<option value=\"Mongolia\" <?php if($results['country']==\"Mongolia\"){ ?>selected=\"selected\"<?php } ?>>Mongolia</option> \n\t\t<option value=\"Montserrat\" <?php if($results['country']==\"Montserrat\"){ ?>selected=\"selected\"<?php } ?>>Montserrat</option>\n\t\t<option value=\"Morocco\" <?php if($results['country']==\"Morocco\"){ ?>selected=\"selected\"<?php } ?>>Morocco</option>\n\t\t<option value=\"Mozambique\" <?php if($results['country']==\"Mozambique\"){ ?>selected=\"selected\"<?php } ?>>Mozambique</option> \n\t\t<option value=\"Myanmar\" <?php if($results['country']==\"Myanmar\"){ ?>selected=\"selected\"<?php } ?>>Myanmar</option> \n\t\t<option value=\"Namibia\" <?php if($results['country']==\"Namibia\"){ ?>selected=\"selected\"<?php } ?>>Namibia</option>\n\t\t<option value=\"Nauru\" <?php if($results['country']==\"Nauru\"){ ?>selected=\"selected\"<?php } ?>>Nauru</option>\n\t\t<option value=\"Nepal\" <?php if($results['country']==\"Nepal\"){ ?>selected=\"selected\"<?php } ?>>Nepal</option>\n\t\t<option value=\"Netherlands\" <?php if($results['country']==\"Netherlands\"){ ?>selected=\"selected\"<?php } ?>>Netherlands</option>\n\t\t<option value=\"Netherlands Antilles\" <?php if($results['country']==\"Netherlands Antilles\"){ ?>selected=\"selected\"<?php } ?>>Netherlands Antilles</option> \n\t\t<option value=\"New Caledonia\" <?php if($results['country']==\"New Caledonia\"){ ?>selected=\"selected\"<?php } ?>>New Caledonia</option>\n\t\t<option value=\"New Zealand\" <?php if($results['country']==\"New Zealand\"){ ?>selected=\"selected\"<?php } ?>>New Zealand</option> \n\t\t<option value=\"Nicaragua\" <?php if($results['country']==\"Nicaragua\"){ ?>selected=\"selected\"<?php } ?>>Nicaragua</option> \n\t\t<option value=\"Niger\" <?php if($results['country']==\"Niger\"){ ?>selected=\"selected\"<?php } ?>>Niger</option> \n\t\t<option value=\"Nigeria\" <?php if($results['country']==\"Nigeria\"){ ?>selected=\"selected\"<?php } ?>>Nigeria</option>\n\t\t<option value=\"Niue\" <?php if($results['country']==\"Niue\"){ ?>selected=\"selected\"<?php } ?>>Niue</option> \n\t\t<option value=\"Norfolk Island\" <?php if($results['country']==\"Norfolk Island\"){ ?>selected=\"selected\"<?php } ?>>Norfolk Island</option>\n\t\t<option value=\"Northern Mariana Islands\" <?php if($results['country']==\"Northern Mariana Islands\"){ ?>selected=\"selected\"<?php } ?>>Northern Mariana Islands</option>\n\t\t<option value=\"Norway\" <?php if($results['country']==\"Norway\"){ ?>selected=\"selected\"<?php } ?>>Norway</option>\n\t\t<option value=\"Oman\" <?php if($results['country']==\"Oman\"){ ?>selected=\"selected\"<?php } ?>>Oman</option>\n\t\t<option value=\"Pakistan\" <?php if($results['country']==\"Pakistan\"){ ?>selected=\"selected\"<?php } ?>>Pakistan</option> \n\t\t<option value=\"Palau\" <?php if($results['country']==\"Palau\"){ ?>selected=\"selected\"<?php } ?>>Palau</option>\n\t\t<option value=\"Palestinian Territory, Occupied\" <?php if($results['country']==\"Palestinian Territory, Occupied\"){ ?>selected=\"selected\"<?php } ?>>Palestinian Territory, Occupied</option> \n\t\t<option value=\"Panama\" <?php if($results['country']==\"Panama\"){ ?>selected=\"selected\"<?php } ?>>Panama</option> \n\t\t<option value=\"Papua New Guinea\" <?php if($results['country']==\"Papua New Guinea\"){ ?>selected=\"selected\"<?php } ?>>Papua New Guinea</option>\n\t\t<option value=\"Paraguay\" <?php if($results['country']==\"Paraguay\"){ ?>selected=\"selected\"<?php } ?>>Paraguay</option> <option value=\"Peru\">Peru</option>\n\t\t<option value=\"Philippines\" <?php if($results['country']==\"Philippines\"){ ?>selected=\"selected\"<?php } ?>>Philippines</option>\n\t\t<option value=\"Pitcairn\" <?php if($results['country']==\"Pitcairn\"){ ?>selected=\"selected\"<?php } ?>>Pitcairn</option> \n\t\t<option value=\"Poland\" <?php if($results['country']==\"Poland\"){ ?>selected=\"selected\"<?php } ?>>Poland</option>\n\t\t<option value=\"Portugal\" <?php if($results['country']==\"Portugal\"){ ?>selected=\"selected\"<?php } ?>>Portugal</option>\n\t\t<option value=\"Puerto Rico\" <?php if($results['country']==\"Puerto Rico\"){ ?>selected=\"selected\"<?php } ?>>Puerto Rico</option> \n\t\t<option value=\"Qatar\" <?php if($results['country']==\"Qatar\"){ ?>selected=\"selected\"<?php } ?>>Qatar</option>\n\t\t<option value=\"Reunion\" <?php if($results['country']==\"Reunion\"){ ?>selected=\"selected\"<?php } ?>>Reunion</option>\n\t\t<option value=\"Romania\" <?php if($results['country']==\"Romania\"){ ?>selected=\"selected\"<?php } ?>>Romania</option>\n\t\t<option value=\"Russian Federation\" <?php if($results['country']==\"Russian Federation\"){ ?>selected=\"selected\"<?php } ?>>Russian Federation</option> \n\t\t<option value=\"Rwanda\" <?php if($results['country']==\"Rwanda\"){ ?>selected=\"selected\"<?php } ?>>Rwanda</option>\n\t\t<option value=\"Saint Helena\" <?php if($results['country']==\"Saint Helena\"){ ?>selected=\"selected\"<?php } ?>>Saint Helena</option>\n\t\t<option value=\"Saint Kitts and Nevis\" <?php if($results['country']==\"Saint Kitts and Nevis\"){ ?>selected=\"selected\"<?php } ?>>Saint Kitts and Nevis</option> \n\t\t<option value=\"Saint Lucia\" <?php if($results['country']==\"Saint Lucia\"){ ?>selected=\"selected\"<?php } ?>>Saint Lucia</option> \n\t\t<option value=\"Saint Pierre and Miquelon\" <?php if($results['country']==\"Saint Pierre and Miquelon\"){ ?>selected=\"selected\"<?php } ?>>Saint Pierre and Miquelon</option>\n\t\t<option value=\"Saint Vincent and The Grenadines\" <?php if($results['country']==\"aint Vincent and The Grenadines\"){ ?>selected=\"selected\"<?php } ?>>Saint Vincent and The Grenadines</option> \n\t\t<option value=\"Samoa\" <?php if($results['country']==\"Samoa\"){ ?>selected=\"selected\"<?php } ?>>Samoa</option> \n\t\t<option value=\"San Marino\" <?php if($results['country']==\"San Marino\"){ ?>selected=\"selected\"<?php } ?>>San Marino</option> \n\t\t<option value=\"Sao Tome and Principe\" <?php if($results['country']==\"Sao Tome and Principe\"){ ?>selected=\"selected\"<?php } ?>>Sao Tome and Principe</option>\n\t\t<option value=\"Saudi Arabia\" <?php if($results['country']==\"Saudi Arabia\"){ ?>selected=\"selected\"<?php } ?>>Saudi Arabia</option>\n\t\t<option value=\"Senegal\" <?php if($results['country']==\"Senegal\"){ ?>selected=\"selected\"<?php } ?>>Senegal</option> \n\t\t<option value=\"Serbia and Montenegro\" <?php if($results['country']==\"Serbia and Montenegro\"){ ?>selected=\"selected\"<?php } ?>>Serbia and Montenegro</option>\n\t\t<option value=\"Seychelles\" <?php if($results['country']==\"Seychelles\"){ ?>selected=\"selected\"<?php } ?>>Seychelles</option> \n\t\t<option value=\"Sierra Leone\" <?php if($results['country']==\"Sierra Leone\"){ ?>selected=\"selected\"<?php } ?>>Sierra Leone</option>\n\t\t<option value=\"Singapore\" <?php if($results['country']==\"Singapore\"){ ?>selected=\"selected\"<?php } ?>>Singapore</option>\n\t\t<option value=\"Slovakia\" <?php if($results['country']==\"Slovakia\"){ ?>selected=\"selected\"<?php } ?>>Slovakia</option>\n\t\t<option value=\"Slovenia\" <?php if($results['country']==\"Slovenia\"){ ?>selected=\"selected\"<?php } ?>>Slovenia</option>\n\t\t<option value=\"Solomon Islands\" <?php if($results['country']==\"Solomon Islands\"){ ?>selected=\"selected\"<?php } ?>>Solomon Islands</option> \n\t\t<option value=\"Somalia\" <?php if($results['country']==\"Somalia\"){ ?>selected=\"selected\"<?php } ?>>Somalia</option>\n\t\t<option value=\"South Africa\" <?php if($results['country']==\"South Africa\"){ ?>selected=\"selected\"<?php } ?>>South Africa</option> \n\t\t<option value=\"South Georgia and The South Sandwich Islands\" <?php if($results['country']==\"South Georgia and The South Sandwich Islands\"){ ?>selected=\"selected\"<?php } ?>>South Georgia and The South Sandwich Islands</option>\n\t\t<option value=\"Spain\" <?php if($results['country']==\"Spain\"){ ?>selected=\"selected\"<?php } ?>>Spain</option> \n\t\t<option value=\"Sri Lanka\" <?php if($results['country']==\"Sri Lanka\"){ ?>selected=\"selected\"<?php } ?>>Sri Lanka</option> \n\t\t<option value=\"Sudan\" <?php if($results['country']==\"Sudan\"){ ?>selected=\"selected\"<?php } ?>>Sudan</option>\n\t\t<option value=\"Suriname\" <?php if($results['country']==\"Suriname\"){ ?>selected=\"selected\"<?php } ?>>Suriname</option>\n\t\t<option value=\"Svalbard and Jan Mayen\" <?php if($results['country']==\"Svalbard and Jan Mayen\"){ ?>selected=\"selected\"<?php } ?>>Svalbard and Jan Mayen</option>\n\t\t<option value=\"Swaziland\" <?php if($results['country']==\"Swaziland\"){ ?>selected=\"selected\"<?php } ?>>Swaziland</option> \n\t\t<option value=\"Sweden\" <?php if($results['country']==\"Sweden\"){ ?>selected=\"selected\"<?php } ?>>Sweden</option> \n\t\t<option value=\"Switzerland\" <?php if($results['country']==\"Switzerland\"){ ?>selected=\"selected\"<?php } ?>>Switzerland</option> \n\t\t<option value=\"Syrian Arab Republic\" <?php if($results['country']==\"Syrian Arab Republic\"){ ?>selected=\"selected\"<?php } ?>>Syrian Arab Republic</option>\n\t\t<option value=\"Taiwan, Province of China\" <?php if($results['country']==\"Taiwan, Province of China\"){ ?>selected=\"selected\"<?php } ?>>Taiwan, Province of China</option>\n\t\t<option value=\"Tajikistan\" <?php if($results['country']==\"Tajikistan\"){ ?>selected=\"selected\"<?php } ?>>Tajikistan</option> \n\t\t<option value=\"Tanzania, United Republic of\" <?php if($results['country']==\"Tanzania, United Republic of\"){ ?>selected=\"selected\"<?php } ?>>Tanzania, United Republic of</option> \n\t\t<option value=\"Thailand\" <?php if($results['country']==\"Thailand\"){ ?>selected=\"selected\"<?php } ?>>Thailand</option> \n\t\t<option value=\"Timor-leste\" <?php if($results['country']==\"Timor-leste\"){ ?>selected=\"selected\"<?php } ?>>Timor-leste</option>\n\t\t<option value=\"Togo\" <?php if($results['country']==\"Togo\"){ ?>selected=\"selected\"<?php } ?>>Togo</option> \n\t\t<option value=\"Tokelau\" <?php if($results['country']==\"Tokelau\"){ ?>selected=\"selected\"<?php } ?>>Tokelau</option>\n\t\t<option value=\"Tonga\" <?php if($results['country']==\"Tonga\"){ ?>selected=\"selected\"<?php } ?>>Tonga</option>\n\t\t<option value=\"Trinidad and Tobago\" <?php if($results['country']==\"Trinidad and Tobago\"){ ?>selected=\"selected\"<?php } ?>>Trinidad and Tobago</option> \n\t\t<option value=\"Tunisia\" <?php if($results['country']==\"Tunisia\"){ ?>selected=\"selected\"<?php } ?>>Tunisia</option>\n\t\t<option value=\"Turkey\" <?php if($results['country']==\"Turkey\"){ ?>selected=\"selected\"<?php } ?>>Turkey</option> \n\t\t<option value=\"Turkmenistan\" <?php if($results['country']==\"Turkmenistan\"){ ?>selected=\"selected\"<?php } ?>>Turkmenistan</option>\n\t\t<option value=\"Turks and Caicos Islands\" <?php if($results['country']==\"Turks and Caicos Islands\"){ ?>selected=\"selected\"<?php } ?>>Turks and Caicos Islands</option> \n\t\t<option value=\"Tuvalu\" <?php if($results['country']==\"Tuvalu\"){ ?>selected=\"selected\"<?php } ?>>Tuvalu</option>\n\t\t<option value=\"Uganda\" <?php if($results['country']==\"Uganda\"){ ?>selected=\"selected\"<?php } ?>>Uganda</option> \n\t\t<option value=\"Ukraine\" <?php if($results['country']==\"Ukraine\"){ ?>selected=\"selected\"<?php } ?>>Ukraine</option> \n\t\t<option value=\"United Arab Emirates\" <?php if($results['country']==\"United Arab Emirates\"){ ?>selected=\"selected\"<?php } ?>>United Arab Emirates</option>\n\t\t<option value=\"United Kingdom\" <?php if($results['country']==\"United Kingdom\"){ ?>selected=\"selected\"<?php } ?>>United Kingdom</option> \n\t\t<option value=\"United States\" <?php if($results['country']==\"United States\"){ ?>selected=\"selected\"<?php } ?>>United States</option> \n\t\t<option value=\"United States Minor Outlying Islands\" <?php if($results['country']==\"United States Minor Outlying Islands\"){ ?>selected=\"selected\"<?php } ?>>United States Minor Outlying Islands</option>\n\t\t<option value=\"Uruguay\" <?php if($results['country']==\"Uruguay\"){ ?>selected=\"selected\"<?php } ?>>Uruguay</option>\n\t\t<option value=\"Uzbekistan\" <?php if($results['country']==\"Uzbekistan\"){ ?>selected=\"selected\"<?php } ?>>Uzbekistan</option>\n\t\t<option value=\"Vanuatu\" <?php if($results['country']==\"Vanuatu\"){ ?>selected=\"selected\"<?php } ?>>Vanuatu</option>\n\t\t<option value=\"Venezuela\" <?php if($results['country']==\"Venezuela\"){ ?>selected=\"selected\"<?php } ?>>Venezuela</option>\n\t\t<option value=\"Viet Nam\" <?php if($results['country']==\"Viet Nam\"){ ?>selected=\"selected\"<?php } ?>>Viet Nam</option>\n\t\t<option value=\"Virgin Islands, British\" <?php if($results['country']==\"Virgin Islands, British\"){ ?>selected=\"selected\"<?php } ?>>Virgin Islands, British</option>\n\t\t<option value=\"Virgin Islands, U.S.\" <?php if($results['country']==\"Virgin Islands, U.S.\"){ ?>selected=\"selected\"<?php } ?>>Virgin Islands, U.S.</option>\n\t\t<option value=\"Wallis and Futuna\" <?php if($results['country']==\"Wallis and Futuna\"){ ?>selected=\"selected\"<?php } ?>>Wallis and Futuna</option>\n\t\t<option value=\"Western Sahara\" <?php if($results['country']==\"Western Sahara\"){ ?>selected=\"selected\"<?php } ?>>Western Sahara</option>\n\t\t<option value=\"Yemen\" <?php if($results['country']==\"Yemen\"){ ?>selected=\"selected\"<?php } ?>>Yemen</option>\n\t\t<option value=\"Zambia\" <?php if($results['country']==\"Zambia\"){ ?>selected=\"selected\"<?php } ?>>Zambia</option>\n\t\t<option value=\"Zimbabwe\" <?php if($results['country']==\"Zimbabwe\"){ ?>selected=\"selected\"<?php } ?>>Zimbabwe</option> \n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t<?php\n\t\t\n\t\t}", "public function getCountriesForDropdown(){\n // TODO: Refactor this to BLL and DAL\n return Countries::get()->toJson();\n }", "function wpestate_country_list($selected,$class='') {\n\n \n \n $countries = array( 'Afghanistan' => esc_html__('Afghanistan','wpestate'),\n 'Albania' => esc_html__('Albania','wpestate'),\n 'Algeria' => esc_html__('Algeria','wpestate'),\n 'American Samoa' => esc_html__('American Samoa','wpestate'),\n 'Andorra' => esc_html__('Andorra','wpestate'),\n 'Angola' => esc_html__('Angola','wpestate'),\n 'Anguilla' => esc_html__('Anguilla','wpestate'),\n 'Antarctica' => esc_html__('Antarctica','wpestate'),\n 'Antigua and Barbuda' => esc_html__('Antigua and Barbuda','wpestate'),\n 'Argentina' => esc_html__('Argentina','wpestate'),\n 'Armenia' => esc_html__('Armenia','wpestate'),\n 'Aruba' => esc_html__('Aruba','wpestate'),\n 'Australia' => esc_html__('Australia','wpestate'),\n 'Austria' => esc_html__('Austria','wpestate'),\n 'Azerbaijan' => esc_html__('Azerbaijan','wpestate'),\n 'Bahamas' => esc_html__('Bahamas','wpestate'),\n 'Bahrain' => esc_html__('Bahrain','wpestate'),\n 'Bangladesh' => esc_html__('Bangladesh','wpestate'),\n 'Barbados' => esc_html__('Barbados','wpestate'),\n 'Belarus' => esc_html__('Belarus','wpestate'),\n 'Belgium' => esc_html__('Belgium','wpestate'),\n 'Belize' => esc_html__('Belize','wpestate'),\n 'Benin' => esc_html__('Benin','wpestate'),\n 'Bermuda' => esc_html__('Bermuda','wpestate'),\n 'Bhutan' => esc_html__('Bhutan','wpestate'),\n 'Bolivia' => esc_html__('Bolivia','wpestate'),\n 'Bosnia and Herzegowina'=> esc_html__('Bosnia and Herzegowina','wpestate'),\n 'Botswana' => esc_html__('Botswana','wpestate'),\n 'Bouvet Island' => esc_html__('Bouvet Island','wpestate'),\n 'Brazil' => esc_html__('Brazil','wpestate'),\n 'British Indian Ocean Territory'=> esc_html__('British Indian Ocean Territory','wpestate'),\n 'Brunei Darussalam' => esc_html__('Brunei Darussalam','wpestate'),\n 'Bulgaria' => esc_html__('Bulgaria','wpestate'),\n 'Burkina Faso' => esc_html__('Burkina Faso','wpestate'),\n 'Burundi' => esc_html__('Burundi','wpestate'),\n 'Cambodia' => esc_html__('Cambodia','wpestate'),\n 'Cameroon' => esc_html__('Cameroon','wpestate'),\n 'Canada' => esc_html__('Canada','wpestate'),\n 'Cape Verde' => esc_html__('Cape Verde','wpestate'),\n 'Cayman Islands' => esc_html__('Cayman Islands','wpestate'),\n 'Central African Republic' => esc_html__('Central African Republic','wpestate'),\n 'Chad' => esc_html__('Chad','wpestate'),\n 'Chile' => esc_html__('Chile','wpestate'),\n 'China' => esc_html__('China','wpestate'),\n 'Christmas Island' => esc_html__('Christmas Island','wpestate'),\n 'Cocos (Keeling) Islands' => esc_html__('Cocos (Keeling) Islands','wpestate'),\n 'Colombia' => esc_html__('Colombia','wpestate'),\n 'Comoros' => esc_html__('Comoros','wpestate'),\n 'Congo' => esc_html__('Congo','wpestate'),\n 'Congo, the Democratic Republic of the' => esc_html__('Congo, the Democratic Republic of the','wpestate'),\n 'Cook Islands' => esc_html__('Cook Islands','wpestate'),\n 'Costa Rica' => esc_html__('Costa Rica','wpestate'),\n 'Cote dIvoire' => esc_html__('Cote dIvoire','wpestate'),\n 'Croatia (Hrvatska)' => esc_html__('Croatia (Hrvatska)','wpestate'),\n 'Cuba' => esc_html__('Cuba','wpestate'),\n 'Curacao' => esc_html__('Curacao','wpestate'),\n 'Cyprus' => esc_html__('Cyprus','wpestate'),\n 'Czech Republic' => esc_html__('Czech Republic','wpestate'),\n 'Denmark' => esc_html__('Denmark','wpestate'),\n 'Djibouti' => esc_html__('Djibouti','wpestate'),\n 'Dominica' => esc_html__('Dominica','wpestate'),\n 'Dominican Republic' => esc_html__('Dominican Republic','wpestate'),\n 'East Timor' => esc_html__('East Timor','wpestate'),\n 'Ecuador' => esc_html__('Ecuador','wpestate'),\n 'Egypt' => esc_html__('Egypt','wpestate'),\n 'El Salvador' => esc_html__('El Salvador','wpestate'),\n 'Equatorial Guinea' => esc_html__('Equatorial Guinea','wpestate'),\n 'Eritrea' => esc_html__('Eritrea','wpestate'),\n 'Estonia' => esc_html__('Estonia','wpestate'),\n 'Ethiopia' => esc_html__('Ethiopia','wpestate'),\n 'Falkland Islands (Malvinas)' => esc_html__('Falkland Islands (Malvinas)','wpestate'),\n 'Faroe Islands' => esc_html__('Faroe Islands','wpestate'),\n 'Fiji' => esc_html__('Fiji','wpestate'),\n 'Finland' => esc_html__('Finland','wpestate'),\n 'France' => esc_html__('France','wpestate'),\n 'France Metropolitan' => esc_html__('France Metropolitan','wpestate'),\n 'French Guiana' => esc_html__('French Guiana','wpestate'),\n 'French Polynesia' => esc_html__('French Polynesia','wpestate'),\n 'French Southern Territories' => esc_html__('French Southern Territories','wpestate'),\n 'Gabon' => esc_html__('Gabon','wpestate'),\n 'Gambia' => esc_html__('Gambia','wpestate'),\n 'Georgia' => esc_html__('Georgia','wpestate'),\n 'Germany' => esc_html__('Germany','wpestate'),\n 'Ghana' => esc_html__('Ghana','wpestate'),\n 'Gibraltar' => esc_html__('Gibraltar','wpestate'),\n 'Greece' => esc_html__('Greece','wpestate'),\n 'Greenland' => esc_html__('Greenland','wpestate'),\n 'Grenada' => esc_html__('Grenada','wpestate'),\n 'Guadeloupe' => esc_html__('Guadeloupe','wpestate'),\n 'Guam' => esc_html__('Guam','wpestate'),\n 'Guatemala' => esc_html__('Guatemala','wpestate'),\n 'Guinea' => esc_html__('Guinea','wpestate'),\n 'Guinea-Bissau' => esc_html__('Guinea-Bissau','wpestate'),\n 'Guyana' => esc_html__('Guyana','wpestate'),\n 'Haiti' => esc_html__('Haiti','wpestate'),\n 'Heard and Mc Donald Islands' => esc_html__('Heard and Mc Donald Islands','wpestate'),\n 'Holy See (Vatican City State)'=> esc_html__('Holy See (Vatican City State)','wpestate'),\n 'Honduras' => esc_html__('Honduras','wpestate'),\n 'Hong Kong' => esc_html__('Hong Kong','wpestate'),\n 'Hungary' => esc_html__('Hungary','wpestate'),\n 'Iceland' => esc_html__('Iceland','wpestate'),\n 'India' => esc_html__('India','wpestate'),\n 'Indonesia' => esc_html__('Indonesia','wpestate'),\n 'Iran (Islamic Republic of)' => esc_html__('Iran (Islamic Republic of)','wpestate'),\n 'Iraq' => esc_html__('Iraq','wpestate'),\n 'Ireland' => esc_html__('Ireland','wpestate'),\n 'Israel' => esc_html__('Israel','wpestate'),\n 'Italy' => esc_html__('Italy','wpestate'),\n 'Jamaica' => esc_html__('Jamaica','wpestate'),\n 'Japan' => esc_html__('Japan','wpestate'),\n 'Jordan' => esc_html__('Jordan','wpestate'),\n 'Kazakhstan' => esc_html__('Kazakhstan','wpestate'),\n 'Kenya' => esc_html__('Kenya','wpestate'),\n 'Kiribati' => esc_html__('Kiribati','wpestate'),\n 'Korea, Democratic People Republic of' => esc_html__('Korea, Democratic People Republic of','wpestate'),\n 'Korea, Republic of' => esc_html__('Korea, Republic of','wpestate'),\n 'Kuwait' => esc_html__('Kuwait','wpestate'),\n 'Kyrgyzstan' => esc_html__('Kyrgyzstan','wpestate'),\n 'Lao, People Democratic Republic' => esc_html__('Lao, People Democratic Republic','wpestate'),\n 'Latvia' => esc_html__('Latvia','wpestate'),\n 'Lebanon' => esc_html__('Lebanon','wpestate'),\n 'Lesotho' => esc_html__('Lesotho','wpestate'),\n 'Liberia' => esc_html__('Liberia','wpestate'),\n 'Libyan Arab Jamahiriya'=> esc_html__('Libyan Arab Jamahiriya','wpestate'),\n 'Liechtenstein' => esc_html__('Liechtenstein','wpestate'),\n 'Lithuania' => esc_html__('Lithuania','wpestate'),\n 'Luxembourg' => esc_html__('Luxembourg','wpestate'),\n 'Macau' => esc_html__('Macau','wpestate'),\n 'Macedonia, The Former Yugoslav Republic of' => esc_html__('Macedonia, The Former Yugoslav Republic of','wpestate'),\n 'Madagascar' => esc_html__('Madagascar','wpestate'),\n 'Malawi' => esc_html__('Malawi','wpestate'),\n 'Malaysia' => esc_html__('Malaysia','wpestate'),\n 'Maldives' => esc_html__('Maldives','wpestate'),\n 'Mali' => esc_html__('Mali','wpestate'),\n 'Malta' => esc_html__('Malta','wpestate'),\n 'Marshall Islands' => esc_html__('Marshall Islands','wpestate'),\n 'Martinique' => esc_html__('Martinique','wpestate'),\n 'Mauritania' => esc_html__('Mauritania','wpestate'),\n 'Mauritius' => esc_html__('Mauritius','wpestate'),\n 'Mayotte' => esc_html__('Mayotte','wpestate'),\n 'Mexico' => esc_html__('Mexico','wpestate'),\n 'Micronesia, Federated States of' => esc_html__('Micronesia, Federated States of','wpestate'),\n 'Moldova, Republic of' => esc_html__('Moldova, Republic of','wpestate'),\n 'Monaco' => esc_html__('Monaco','wpestate'),\n 'Mongolia' => esc_html__('Mongolia','wpestate'),\n 'Montserrat' => esc_html__('Montserrat','wpestate'),\n 'Morocco' => esc_html__('Morocco','wpestate'),\n 'Mozambique' => esc_html__('Mozambique','wpestate'),\n 'Montenegro' => esc_html__('Montenegro','wpestate'),\n 'Myanmar' => esc_html__('Myanmar','wpestate'),\n 'Namibia' => esc_html__('Namibia','wpestate'),\n 'Nauru' => esc_html__('Nauru','wpestate'),\n 'Nepal' => esc_html__('Nepal','wpestate'),\n 'Netherlands' => esc_html__('Netherlands','wpestate'),\n 'Netherlands Antilles' => esc_html__('Netherlands Antilles','wpestate'),\n 'New Caledonia' => esc_html__('New Caledonia','wpestate'),\n 'New Zealand' => esc_html__('New Zealand','wpestate'),\n 'Nicaragua' => esc_html__('Nicaragua','wpestate'),\n 'Niger' => esc_html__('Niger','wpestate'),\n 'Nigeria' => esc_html__('Nigeria','wpestate'),\n 'Niue' => esc_html__('Niue','wpestate'),\n 'Norfolk Island' => esc_html__('Norfolk Island','wpestate'),\n 'Northern Mariana Islands' => esc_html__('Northern Mariana Islands','wpestate'),\n 'Norway' => esc_html__('Norway','wpestate'),\n 'Oman' => esc_html__('Oman','wpestate'),\n 'Pakistan' => esc_html__('Pakistan','wpestate'),\n 'Palau' => esc_html__('Palau','wpestate'),\n 'Panama' => esc_html__('Panama','wpestate'),\n 'Papua New Guinea' => esc_html__('Papua New Guinea','wpestate'),\n 'Paraguay' => esc_html__('Paraguay','wpestate'),\n 'Peru' => esc_html__('Peru','wpestate'),\n 'Philippines' => esc_html__('Philippines','wpestate'),\n 'Pitcairn' => esc_html__('Pitcairn','wpestate'),\n 'Poland' => esc_html__('Poland','wpestate'),\n 'Portugal' => esc_html__('Portugal','wpestate'),\n 'Puerto Rico' => esc_html__('Puerto Rico','wpestate'),\n 'Qatar' => esc_html__('Qatar','wpestate'),\n 'Reunion' => esc_html__('Reunion','wpestate'),\n 'Romania' => esc_html__('Romania','wpestate'),\n 'Russian Federation' => esc_html__('Russian Federation','wpestate'),\n 'Rwanda' => esc_html__('Rwanda','wpestate'),\n 'Saint Kitts and Nevis' => esc_html__('Saint Kitts and Nevis','wpestate'),\n 'Saint Lucia' => esc_html__('Saint Lucia','wpestate'),\n 'Saint Vincent and the Grenadines' => esc_html__('Saint Vincent and the Grenadines','wpestate'),\n 'Samoa' => esc_html__('Samoa','wpestate'),\n 'San Marino' => esc_html__('San Marino','wpestate'),\n 'Sao Tome and Principe' => esc_html__('Sao Tome and Principe','wpestate'),\n 'Saudi Arabia' => esc_html__('Saudi Arabia','wpestate'),\n 'Serbia' => esc_html__('Serbia','wpestate'),\n 'Senegal' => esc_html__('Senegal','wpestate'),\n 'Seychelles' => esc_html__('Seychelles','wpestate'),\n 'Sierra Leone' => esc_html__('Sierra Leone','wpestate'),\n 'Singapore' => esc_html__('Singapore','wpestate'),\n 'Slovakia (Slovak Republic)'=> esc_html__('Slovakia (Slovak Republic)','wpestate'),\n 'Slovenia' => esc_html__('Slovenia','wpestate'),\n 'Solomon Islands' => esc_html__('Solomon Islands','wpestate'),\n 'Somalia' => esc_html__('Somalia','wpestate'),\n 'South Africa' => esc_html__('South Africa','wpestate'),\n 'South Georgia and the South Sandwich Islands' => esc_html__('South Georgia and the South Sandwich Islands','wpestate'),\n 'Spain' => esc_html__('Spain','wpestate'),\n 'Sri Lanka' => esc_html__('Sri Lanka','wpestate'),\n 'St. Helena' => esc_html__('St. Helena','wpestate'),\n 'St. Pierre and Miquelon'=> esc_html__('St. Pierre and Miquelon','wpestate'),\n 'Sudan' => esc_html__('Sudan','wpestate'),\n 'Suriname' => esc_html__('Suriname','wpestate'),\n 'Svalbard and Jan Mayen Islands' => esc_html__('Svalbard and Jan Mayen Islands','wpestate'),\n 'Swaziland' => esc_html__('Swaziland','wpestate'),\n 'Sweden' => esc_html__('Sweden','wpestate'),\n 'Switzerland' => esc_html__('Switzerland','wpestate'),\n 'Syrian Arab Republic' => esc_html__('Syrian Arab Republic','wpestate'),\n 'Taiwan, Province of China' => esc_html__('Taiwan, Province of China','wpestate'),\n 'Tajikistan' => esc_html__('Tajikistan','wpestate'),\n 'Tanzania, United Republic of'=> esc_html__('Tanzania, United Republic of','wpestate'),\n 'Thailand' => esc_html__('Thailand','wpestate'),\n 'Togo' => esc_html__('Togo','wpestate'),\n 'Tokelau' => esc_html__('Tokelau','wpestate'),\n 'Tonga' => esc_html__('Tonga','wpestate'),\n 'Trinidad and Tobago' => esc_html__('Trinidad and Tobago','wpestate'),\n 'Tunisia' => esc_html__('Tunisia','wpestate'),\n 'Turkey' => esc_html__('Turkey','wpestate'),\n 'Turkmenistan' => esc_html__('Turkmenistan','wpestate'),\n 'Turks and Caicos Islands' => esc_html__('Turks and Caicos Islands','wpestate'),\n 'Tuvalu' => esc_html__('Tuvalu','wpestate'),\n 'Uganda' => esc_html__('Uganda','wpestate'),\n 'Ukraine' => esc_html__('Ukraine','wpestate'),\n 'United Arab Emirates' => esc_html__('United Arab Emirates','wpestate'),\n 'United Kingdom' => esc_html__('United Kingdom','wpestate'),\n 'United States' => esc_html__('United States','wpestate'),\n 'United States Minor Outlying Islands' => esc_html__('United States Minor Outlying Islands','wpestate'),\n 'Uruguay' => esc_html__('Uruguay','wpestate'),\n 'Uzbekistan' => esc_html__('Uzbekistan','wpestate'),\n 'Vanuatu' => esc_html__('Vanuatu','wpestate'),\n 'Venezuela' => esc_html__('Venezuela','wpestate'),\n 'Vietnam' => esc_html__('Vietnam','wpestate'),\n 'Virgin Islands (British)'=> esc_html__('Virgin Islands (British)','wpestate'),\n 'Virgin Islands (U.S.)' => esc_html__('Virgin Islands (U.S.)','wpestate'),\n 'Wallis and Futuna Islands' => esc_html__('Wallis and Futuna Islands','wpestate'),\n 'Western Sahara' => esc_html__('Western Sahara','wpestate'),\n 'Yemen' => esc_html__('Yemen','wpestate'),\n 'Yugoslavia' => esc_html__('Yugoslavia','wpestate'),\n 'Zambia' => esc_html__('Zambia','wpestate'),\n 'Zimbabwe' => esc_html__('Zimbabwe','wpestate')\n );\n\n \n \n if ($selected == '') {\n $selected = get_option('wp_estate_general_country');\n }\n \n $country_select = '<select id=\"property_country\" name=\"property_country\" class=\"'.$class.'\">';\n\n \n foreach ($countries as $key=>$country) {\n $country_select.='<option value=\"' . $key . '\"';\n if (strtolower($selected) == strtolower ($key) ) {\n $country_select.='selected=\"selected\"';\n }\n $country_select.='>' . $country . '</option>';\n }\n\n $country_select.='</select>';\n return $country_select;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a char name from a char id.
function get_char_name($char_id=null) { if ($char_id === null) { if(defined('DEBUG') && DEBUG && $char_id===null){ nw_error('Deprecated call to get_char_name(null) with a null argument. For clarity reasons, this is now deprecated, use self_name() instead.'); } return self_name(); } else { // Determine some other character's username and return it. $sql = "SELECT uname FROM players WHERE player_id = :player"; return query_item($sql, array(':player'=>$char_id)); } }
[ "function getName()\r\n {\r\n return $this->char_name;\r\n }", "function charity_name_id($charity_id) \n {\n $query = $this->db->select('name')\n\t ->from('donation_outlets')\n\t\t\t\t ->where('id',$charity_id)\n\t\t\t\t ->get();\n\tif($query->num_rows > 0)\n\t{\n\t foreach($query->result_array() as $r)\n\t {\n\t $name = $r['name']; \n\t }\n\t return $name;\n\t}\n }", "public static function pokemonCharacterName(): string\n {\n return (string) static::randomElement(PokemonData::getCharacterNames());\n }", "public function getCharID() {\n\t\treturn $this->getState('__charID');\n\t}", "function get_char_account_id($char_id){\n\treturn account_id_by_ninja_id($char_id);\n}", "public static function getPlayerNameWithID($id){\n $query = \"SELECT NAME FROM `PLAYERS` WHERE ID = $id\";\n\t\treturn mysqli_fetch_assoc(MySQL::executeQuery($query))[\"NAME\"];\n }", "function getCustomerName($id)\n\t{\n\t\t$ret = $this->getCustomerData($id);\n\t\treturn $ret['name'];\n\t}", "function get_character_name($c_id, $connection)\n{\n $sql = \"SELECT name FROM characters WHERE c_id = $c_id\";\n\n if (!$result = mysql_query($sql,$connection)) \n showerror();\n \n if (mysql_num_rows($result) != 1)\n return 0;\n else {\n while ($row=mysql_fetch_array($result)) {\n $name = $row[\"name\"];\n \t return $name;\n }\n }\n}", "public function getName()\r\n {\r\n\t\treturn new String(\"charAt\");\r\n\t}", "function get_device_name($id) {\r\n\t\t$sql = \"SELECT device_name FROM oa_device WHERE device_id = ? LIMIT 1\";\r\n\t\t$data = array(\"$id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\t$row = $query->row();\r\n\t\treturn ($row->device_name);\r\n\t}", "function get_country_name_by_id($id='')\n\t{\n\t\t$query = $this->db->get_where('countries',array('id'=>$id));\n\t\t\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->name;\n\t\t}\n\t\telse\n\t\t\treturn '';\n\t}", "function getNpcName($nameid)\n{\n global $tabGatherInfos;\n \n $key = strtoupper($nameid);\n \n if (isset($tabGatherInfos[$key]))\n return $tabGatherInfos[$key]['name'];\n else\n {\n if (substr($key,0,4) == \"NPC_\" && substr($key,strlen($key)-3,3) == \"_SP\")\n {\n $key = substr($key,4,stripos($key,\"_SP\") - 4);\n \n if (isset($tabGatherInfos[$key]))\n return $tabGatherInfos[$key]['name'];\n else\n return \"\";\n }\n else\n return \"\";\n }\n}", "function lookupCharID($charName) {\n $pheal = new Pheal();\n try {\n log_message('info', '<' . __FUNCTION__ . '> Pheal->CharacterID(): ' . $charName);\n $result = $pheal->eveScope->CharacterID(array('names' => $charName));\n } catch (PhealAPIException $exc) {\n log_message('error', '<' . __FUNCTION__ . '> Pheal: ' . $exc->getMessage());\n $this->errorMessage = $exc->getMessage();\n return FALSE;\n }\n $charID = $result->characters[0]->characterID;\n return $charID;\n }", "public static function getCustomerNameByID($id){\n\t\t$sql = \"\n\t\t\tSELECT CONCAT(c.first_name, ' ', c.last_name) AS customer_name\n\t\t\tFROM customer AS c\n\t\t\tWHERE id = $id\n\t\t\t\";\n\n\t\t// Make a PDO statement\n\t\t$statement = DB::prepare($sql);\n\n\t\t// Execute\n\t\tDB::execute($statement);\n\n\t\t// Get all the results of the statement into an array\n\t\t$results = $statement->fetchAll();\n\n\t\treturn $results[0]['customer_name'];\n\t}", "function get_country_name($id)\n {\n $ci = & get_instance();\n return $ci->db->get_where('xx_countries', array('id' => $id))->row_array()['name'];\n }", "public function Dot_GetCountryNameFromID($id) {\n\t\t$id = mysqli_real_escape_string($this->db, $id);\n\t\t$query = mysqli_query($this->db, \"SELECT name FROM dot_countries WHERE id = '$id'\") or die(mysqli_error($this->db));\n\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\tif ($data['name']) {\n\t\t\t$name = $data['name'];\n\t\t\treturn $name;\n\t\t}\n\t}", "public function getColorCodeName($id){\n\t\t$sql = \"select name from sy_color_codes where id=?\";\n\t\t$SyColorCode = $this->runRequest($sql, array($id));\n\t\tif ($SyColorCode->rowCount() == 1){\n\t\t\t$tmp = $SyColorCode->fetch();\n\t\t\treturn $tmp[0]; // get the first line of the result\n\t\t}\n\t\telse{\n\t\t\treturn \"\";\t\n\t\t}\n\t}", "function convertDivisionIdToChar($id) {\n $m = array(0 => 'N', 1 => 'B', 2 => 'I', 3 => 'A');\n return $m[$id];\n }", "function convertGenderIdToChar($id) {\n $m = array(1 => 'M', 2 => 'F', 3 => 'C');\n return $m[$id];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the response row key composed from the date and the date range index values.
protected static function get_response_row_key( $date, $date_range_index ) { return "{$date}_{$date_range_index}"; }
[ "public function getRowKey()\n {\n return $this->row_key;\n }", "public function getRowKey()\n {\n return $this->RowKey;\n }", "public function rows_key()\n\t{\n\t\t$arguments = func_get_args();\n\t\t\n\t\tif (count($arguments) > 1) $key = array_shift($arguments);\n\t\telse throw new \\Exception('The rows_key function requires at least 2 parameters: $key and $query.');\n\t\t\t\t\n\t\t$rows = call_user_func_array(array($this, 'rows'), $arguments);\n\t\t\n\t\tif (count($rows) == 0) return $rows;\n\t\t\n\t\tif (property_exists($rows[0],$key) == false) \n\t\t\tthrow new \\Exception('The specified key does not exist in the result set.');\n\t\t\n\t\tforeach ($rows as $row) \n\t\t\t$rows_key[$row->$key] = $row;\n\t\t\n\t\treturn $rows_key;\n\t}", "public static function rows_key()\n\t{\n\t\t$arguments = func_get_args();\n\t\t\n\t\tif (count($arguments) > 1) $key = array_shift($arguments);\n\t\telse throw new \\Exception('The rows_key function requires at least 2 parameters: $key and $query.');\n\t\t\t\t\n\t\t$rows = call_user_func_array('static::rows', $arguments);\n\t\t\n\t\tif (count($rows) == 0) return $rows;\n\t\t\n\t\tif (property_exists($rows[0],$key) == false) \n\t\t\tthrow new \\Exception('The specified key does not exist in the result set.');\n\t\t\n\t\tforeach ($rows as $row) \n\t\t\t$rows_key[$row->$key] = $row;\n\t\t\n\t\treturn $rows_key;\n\t}", "public function getKey() {\n return sprintf('%d:%d', $this->row, $this->column);\n }", "public function getDateIndex();", "function response_id_key();", "function getResponseByDate($start_date, $end_date)\n {\n \n }", "public function getResponseKey();", "private function makeCacheKey()\n {\n return (string) $this->range->getStartDate()->timestamp .\n (string) $this->range->getEndDate()->timestamp;\n }", "abstract public function getResultKey();", "public static function getRangeKeyAttribute();", "public function key() {\n\t\treturn $this->current_row;\n\t}", "public function getUsergroupDetailsByDate($date_range);", "public function getChartLabelsKey($dateClosed);", "public function getRowLabel( $key )\r\n {\r\n return $this->getLabel('row', $key);\r\n }", "protected function getRowKey(array $row)\n\t{\n\t\t$key = '';\n\n\t\tforeach ($this->positionColumns as $positionColumn)\n\t\t{\n\t\t\t$key .= $row[$positionColumn];\n\t\t}\n\n\t\treturn $key;\n\t}", "function GetRowIndex($row)\n//=============================================================================\n {\n $ssAttrs = $row->attributes('ss', true);\n return $ssAttrs['Index'];\n }", "public function Key()\n {\n return( $this->iCurrentRow );\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Remove Post Type Support / Remove Page Fields
function remove_page_fields() { remove_meta_box( 'slugdiv' , 'page' , 'normal' ); //removes slugdiv remove_meta_box( 'slugdiv' , 'post' , 'normal' ); //removes slugdiv }
[ "public function removePageSupport(){\n\t\tremove_post_type_support( 'page', 'author' );\n\t\tremove_post_type_support( 'page', 'custom-fields' );\n\t}", "function thistle_remove_postcustom_support() {\n remove_post_type_support( 'post', 'custom-fields' );\n remove_post_type_support( 'page', 'custom-fields' );\n }", "function customize_post_type_support()\n {\n remove_post_type_support('page', 'editor');\n remove_post_type_support('page', 'comments');\n remove_post_type_support('page', 'author');\n remove_meta_box('slugdiv', 'page', 'normal');\n remove_meta_box('edit-slug-box', 'page', 'normal');\n }", "function jb_remove_post_custom_fields_now() {\n\tforeach ( get_post_types( '', 'names' ) as $post_type ) {\n\t\tremove_meta_box( 'postcustom' , $post_type , 'normal' );\n\t}\n}", "function alice_remove_post_type_support()\n{\n\tremove_post_type_support( 'post', 'post-formats' );\n}", "function sld_rm_post_custom_fields() {\n\t// pages\n\tremove_meta_box( 'postcustom' , 'page' , 'normal' );\n\tremove_meta_box( 'commentstatusdiv' , 'page' , 'normal' );\n\tremove_meta_box( 'commentsdiv' , 'page' , 'normal' );\n\tremove_meta_box( 'authordiv' , 'page' , 'normal' );\n\n\t// posts\n\tremove_meta_box( 'postcustom' , 'post' , 'normal' );\n\tremove_meta_box( 'postexcerpt' , 'post' , 'normal' );\n\tremove_meta_box( 'trackbacksdiv' , 'post' , 'normal' );\n}", "function transform_remove_post_info() {\n//\tif ('podcast' == get_post_type()) {//add in your CPT name\n\t\tremove_action( 'genesis_entry_footer', 'genesis_post_meta' );\n\t//\t}\n}", "public function remove_post_type_support() {\n\t\tremove_post_type_support( 'post', 'comments' );\n\t\tremove_post_type_support( 'post', 'trackbacks' );\n\t\tremove_post_type_support( 'post', 'excerpt' );\n\n\t\tremove_post_type_support( 'page', 'comments' );\n\t\tremove_post_type_support( 'page', 'trackbacks' );\n\t\tremove_post_type_support( 'page', 'excerpt' );\n\t}", "function sample_remove_entry_meta() {\n\tremove_post_type_support( 'post', 'genesis-entry-meta-before-content' );\n\tremove_post_type_support( 'post', 'genesis-entry-meta-after-content' );\n}", "function remove_post_type_after_entry() {\n\tremove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );\n\tremove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );\n}", "function remove_post_custom_fields() {\n\tremove_meta_box( 'postcustom' , 'post' , 'normal' );\n}", "function ch5_hcf_remove_custom_fields_metabox() {\n\tremove_meta_box( 'postcustom', 'post', 'normal' );\n\tremove_meta_box( 'postcustom', 'page', 'normal' );\n}", "function gat_remove_layout_meta_boxes() {\n\n\tremove_post_type_support( 'post', 'genesis-layouts' );\t\t\t\t\t\t\t// Posts\n\tremove_post_type_support( 'page', 'genesis-layouts' );\t\t\t\t\t\t\t// Pages\n\n}", "function newsroom_elated_remove_default_custom_fields() {\n foreach (array('normal', 'advanced', 'side') as $context) {\n foreach (array(\"page\", \"post\") as $postType) {\n remove_meta_box('postcustom', $postType, $context);\n }\n }\n }", "function remove_post_type_support($post_type, $feature)\n {\n }", "function my_remove_meta_box_page() {\n // Custom Fields\n remove_meta_box('postcustom', 'page', 'normal');\n // Discussion\n remove_meta_box('commentsdiv' , 'page', 'normal');\n // Comments\n remove_meta_box('commentstatusdiv', 'page', 'normal');\n // Revisions\n remove_meta_box('revisionsdiv', 'page', 'normal');\n // Author\n remove_meta_box('authordiv', 'page', 'normal');\n // Page Attributes\n //remove_meta_box( pageparentdiv ,'page', 'normal');\n // Publish\n //remove_meta_box( submitdiv ,'page', 'normal'); \n remove_meta_box('slugdiv', 'page', 'normal'); // Slug Metabox\n}", "public function removeExtraFieldsFromAdmin()\n {\n remove_meta_box('postcustom', $this->type, 'normal');\n }", "public function modify_post_supports()\n {\n remove_post_type_support(self::SLUG, 'custom-fields');\n }", "public static function removeContentEditorForPages() {\n\t\tremove_post_type_support('page', 'editor');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the trnf column Example usage: $query>filterByTrnf(1234); // WHERE trnf = 1234 $query>filterByTrnf(array(12, 34)); // WHERE trnf IN (12, 34) $query>filterByTrnf(array('min' => 12)); // WHERE trnf > 12
public function filterByTrnf($trnf = null, $comparison = null) { if (is_array($trnf)) { $useMinMax = false; if (isset($trnf['min'])) { $this->addUsingAlias(AliHoldheadTableMap::COL_TRNF, $trnf['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($trnf['max'])) { $this->addUsingAlias(AliHoldheadTableMap::COL_TRNF, $trnf['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(AliHoldheadTableMap::COL_TRNF, $trnf, $comparison); }
[ "public function filterByTrnf($trnf = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($trnf)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliTsalehTableMap::COL_TRNF, $trnf, $comparison);\n }", "public function filterByTrnf($trnf = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($trnf)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliIsalehTableMap::COL_TRNF, $trnf, $comparison);\n }", "public function filterByIdTrabalho($idTrabalho = null, $comparison = null)\n {\n if (is_array($idTrabalho)) {\n $useMinMax = false;\n if (isset($idTrabalho['min'])) {\n $this->addUsingAlias(TbalunoImportPeer::ID_TRABALHO, $idTrabalho['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idTrabalho['max'])) {\n $this->addUsingAlias(TbalunoImportPeer::ID_TRABALHO, $idTrabalho['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(TbalunoImportPeer::ID_TRABALHO, $idTrabalho, $comparison);\n }", "public function filterByTratamento($tratamento = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($tratamento)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $tratamento)) {\n $tratamento = str_replace('*', '%', $tratamento);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TabUfPeer::TRATAMENTO, $tratamento, $comparison);\n }", "private function getFilterType($filter){\n if(!is_array($filter))\n {\n return false;\n }\n if(count(array_intersect(array('from', 'to'), array_keys($filter)))>0)\n {\n return 'numericrange';\n }\n return 'terms';\n }", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "private function filterbyfuel ($query,Request $request){\n\n if (isset($request->search)) {\n $query->where('vehicle.vehicle_name', 'LIKE', \"%{$request->search}%\");\n \n }\n if (isset($request->type)) {\n $query->where(DB::raw(\"'fuel'\"), '=', $request->type);\n }\n\n if (isset($request->mincost)) {\n \n $query->where('fuel_entries.cost', '>' , $request->mincost);\n }\n if (isset($request->maxcost)) {\n $query->where('fuel_entries.cost', '<' , $request->maxcost);\n \n }\n if (isset($request->mindate)) {\n $query->whereDate('fuel_entries.entry_date', '>' , $request->mindate);\n \n }\n if (isset($request->maxdate)) {\n $query->whereDate('fuel_entries.entry_date', '<' , $request->maxdate);\n \n }\n\n }", "private function getFilterType($filter) {\n if (is_array($filter)) {\n if (array_key_exists('from', $filter) || array_key_exists('to', $filter)) {\n return 'numericrange';\n } else {\n return 'term';\n }\n }\n return false;\n }", "public function addFilterQuery($fq) {}", "function get_sup_filter($sup_restriction, $table = '') {\n $sup_filters = array();\n foreach ($sup_restriction as $sup) {\n $sup_filters[] = $table . ($table != '' ? '.' : '') . 'supervisor = \"' . $sup . '\"';\n }\n \n if (count($sup_filters) > 0) {\n return '(' . join(' || ', $sup_filters) . ')';\n } else {\n return \"0\";\n }\n}", "public function filter($filter)\n { \n $sql = \" WHERE\";\n $ind = 0;\n foreach($filter as $k => $f){\n if($ind > 0){\n $sql .= \" AND\";\n }\n switch($k){\n case \"tid\":\n $sql .= \" teacher_id = \".$f;\n break;\n case \"level\":\n $sql .= \" level_id = \".$f;\n break;\n case \"category\":\n $sql .= \" ctg_id = \".$f;\n break;\n case \"language\":\n $sql .= \" course_language = '\".$f.\"'\";\n break;\n default:\n $sql .= \" course_period \".$f;\n break;\n };\n $ind++;\n }\n return $sql;\n }", "function filterGetList($filtr=NULL) {\n\t\tglobal $_gTables; //Debug($filtr);\n\n\t\t$sql = '';\n\n\t\tif (isset($filtr) && is_array($filtr)) {\n\t\t\tif (isset($filtr['nazwa_aukcji']) && $filtr['nazwa_aukcji'] != '')\n\t\t\t\t$sql.= \" AND a.nazwa_aukcji LIKE '%\" . Common::clean_input($filtr['nazwa_aukcji']) . \"%' \";\n\n\t\t\tif (isset($filtr['id_serwisu']) && $filtr['id_serwisu'] > 0 && is_numeric($filtr['id_serwisu'])) {\n\t\t\t\t$sql .= \" AND a.id_serwisu = '\" . $filtr['id_serwisu'] . \"' \";\n\t\t\t}\n\n\t\t\tif (isset($filtr['website_ids']) && is_array($filtr['website_ids']))\n\t\t\t\t$sql.= \" AND a.id_serwisu IN (\" . implode(',', $filtr['website_ids']) . \") \";\n\n\t\t\tif (isset($filtr['typ']) && (int) $filtr['typ'] > 0) {\n\t\t\t\tswitch ($filtr['typ']) {\n\t\t\t\t\tcase 3: //trwajace\n\t\t\t\t\t\t$sql.= \" AND ( a.data_zakonczenia > NOW() AND a.flaga_zakonczona=0 )\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4: //zakonczone\n\t\t\t\t\t\t$sql.= \" AND ( a.data_zakonczenia <= NOW() OR a.flaga_zakonczona=1 )\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($filtr['po_czasie_aktywne'])) {\n\t\t\t\t$sql.= \" AND data_zakonczenia < NOW() AND flaga_zakonczona = '0'\";\n\t\t\t}\n\n\t\t\tif (isset($filtr['sprzedano'])) {\n\t\t\t\tif ($filtr['sprzedano'] == 0) {\n\t\t\t\t\t//niesprzedano\n\t\t\t\t\t$sql.= \" AND a.sprzedano = 0 \";\n\t\t\t\t} elseif ($filtr['sprzedano'] == 1) {\n\t\t\t\t\t$sql.= \" AND a.sprzedano > 0 \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (isset($filtr['brak_ofert'])) {\n\t\t\t\tif ($filtr['brak_ofert'] == 0) {\n\t\t\t\t\t//niesprzedano\n\t\t\t\t\t$sql.= \" AND a.sprzedano > 0 AND a.flaga_zakonczona = 1\";\n\t\t\t\t} elseif ($filtr['brak_ofert'] == 1) {\n\t\t\t\t\t$sql.= \" AND a.sprzedano = 0 AND a.flaga_zakonczona = 1\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($filtr['oczekujace'])\n\t\t\t\t$sql.= \" AND a.data_cron > NOW() \";\n\t\t\tif (isset($filtr['cron']) && $filtr['cron']==0) {\n\t\t\t\t$sql.= \" AND a.id_aukcji > 0\";\n\t\t\t}\n\n\t\t\tif ($filtr['wystawione'])\n\t\t\t\t$sql.= \" AND a.data_wystawienia < NOW() \";\n\t\t\t\n\n\t\t\tif (isset($filtr['id_kategoria']) && is_numeric($filtr['id_kategoria']) && (int) $filtr['id_kategoria'] > 0) {\n\t\t\t\t$kat = new Kategoria();\n\t\t\t\t$drzewko = $kat->getAllChildren($filtr['id_kategoria']);\n\t\t\t\t$drzewko[] = $filtr['id_kategoria'];\n\t\t\t\t$drzewko = implode(',', $drzewko);\n\t\t\t\tif (substr($drzewko, strlen($drzewko) - 1, 1) == ',')\n\t\t\t\t\t$drzewko = substr($drzewko, 0, strlen($drzewko) - 1);\n\t\t\t\t$sql.= \" AND p.id_kategoria IN (\" . $drzewko . \") \";\n\t\t\t}\n\n\t\t\tif (isset($filtr['id_kategoria']) && is_array($filtr['id_kategoria']) && count($filtr['id_kategoria']) > 0) {\n\t\t\t\t$kat = new Kategoria();\n\t\t\t\tforeach ($filtr['id_kategoria'] as $tmp) {\n\t\t\t\t\t$drzewko = $kat->getAllChildren($tmp);\n\t\t\t\t\t$drzewko[] = $tmp;\n\t\t\t\t}\n\t\t\t\t$drzewko = implode(',', $drzewko);\n\t\t\t\tif (substr($drzewko, strlen($drzewko) - 1, 1) == ',')\n\t\t\t\t\t$drzewko = substr($drzewko, 0, strlen($drzewko) - 1);\n\t\t\t\t$sql.= \" AND p.id_kategoria IN (\" . $drzewko . \") \";\n\t\t\t}\n\n\t\t\tif (isset($filtr['admin']) && !empty($filtr['admin'])) {\n\t\t\t\t$admin = explode(' ', trim($filtr['admin']));\n\t\t\t\tif (count($admin) > 0) {\n\t\t\t\t\tif (count($admin) > 1) {//wiecej niz jedno slowo to musi byc imie i nazwisko\n\t\t\t\t\t\t$sql.= \" AND ( ad.first_name LIKE '%\" . implode(\"%' OR ad.first_name LIKE '%\", $admin) . \"%' ) AND ( ad.last_name LIKE '%\" . implode(\"%' OR ad.last_name LIKE '%\", $admin) . \"%' )\";\n\t\t\t\t\t} else { //tylko jedno slowo to albo imie albo nazwisko\n\t\t\t\t\t\t$sql.= \" AND ( ad.first_name LIKE '%\" . implode(\"%' OR ad.first_name LIKE '%\", $admin) . \"%' OR ad.last_name LIKE '%\" . implode(\"%' OR ad.last_name LIKE '%\", $admin) . \"%' )\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($filtr['ids']) && is_array($filtr['ids']) && !empty($filtr['ids'])) {\n\t\t\t\t$sql.= \" AND (a.id = '\" . implode(\"' OR a.id='\", $filtr['ids']) . \"')\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($filtr['id_aukcji'] && (int) $filtr['id_aukcji'] > 0 && !is_array($filtr['id_aukcji']))\n\t\t\t\t$sql.= \" AND a.id_aukcji=\" . (int)$filtr['id_aukcji'];\n\t\t\t\n\t\t\tif (isset($filtr['id_aukcji']) && is_array($filtr['id_aukcji']) && !empty($filtr['id_aukcji'])) {\n\t\t\t\t$sql.= \" AND (a.id_aukcji = '\" . implode(\"' OR a.id_aukcji='\", $filtr['id_aukcji']) . \"')\";\n\t\t\t}\n\t\t\t\n\t\t\tif( isset($filtr['format_sprzedazy']) && is_numeric($filtr['format_sprzedazy']) ) {\n\t\t\t\t$filtr['format_sprzedazy'] = (int)$filtr['format_sprzedazy'];\n\t\t\t\t$sql.= \" AND id_rodzaju=\" . $filtr['format_sprzedazy'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function filtrar(&$filtro) {\n parent::filtrar($filtro);\n $filtro_sql = '';\n if ($filtro->filtro('estado'))\n $filtro_sql .= \" AND {$this->getTableName()}.estado like '%{$filtro->filtro('codigo')}%' \";\n if ($filtro->filtro('descripcion'))\n $filtro_sql .= \" AND {$this->getTableName('Modelo_carta')}.descripcion like '%{$filtro->filtro('descripcion')}%' \";\n if ($filtro->filtro('titulo'))\n $filtro_sql .= \" AND {$this->getTableName('Modelo_carta')}.titulo like '%{$filtro->filtro('titulo')}%' \";\n if ($filtro->filtro('tipo_proyecto'))\n $filtro_sql .= \" AND {$this->getTableName('Modelo_carta')}.tipo_proyecto like '%{$filtro->filtro('tipo_proyecto')}%' \";\n if ($filtro->filtro('estado_proyecto'))\n $filtro_sql .= \" AND {$this->getTableName('Modelo_carta')}.estado_proyecto like '%{$filtro->filtro('estado_proyecto')}%' \";\n if ($filtro->filtro('estado'))\n $filtro_sql .= \" AND {$this->getTableName()}.estado like '%{$filtro->filtro('estado')}%' \";\n if ($filtro->filtro('id'))\n $filtro_sql .= \" AND {$this->getTableName()}.id like '%{$filtro->filtro('id')}%' \";\n return $filtro_sql;\n }", "function validateFilter($filter)\n {\n // Get the field that it applies to\n // $relation holds the tablename and $field holds the field\n list($relation, $field) = explode('.', $filter);\n\n // if the filter includes a tablename\n if ($field != \"\")\n {\n // check if the filter table is the same as the nodes table\n if (strtolower(trim($relation)) !== strtolower($this->m_table)) return \"\";\n\n // go on to check the field\n $relation = $field;\n }\n\n // All standard SQL operators\n $sqloperators = array('=','<>','>','<','>=','<=','BETWEEN','LIKE','IN');\n\n // Check the filter for every operator\n foreach ($sqloperators as $sqloperator)\n {\n // split the fieldname from the fieldvalue\n list($relation_new, $dummy) = explode($sqloperator, $relation);\n\n // check if the fieldname is in the attriblist\n \tif (in_array(trim($relation_new), array_keys($this->m_attribList))) return $filter;\n }\n return \"\";\n }", "public function filter(){\n $value = null;\n\n $constraint18 = null;\n\n\n try {\n // Sparql10.g:166:5: ( FILTER constraint ) \n // Sparql10.g:166:7: FILTER constraint \n {\n $this->match($this->input,$this->getToken('FILTER'),self::$FOLLOW_FILTER_in_filter973); \n $this->pushFollow(self::$FOLLOW_constraint_in_filter975);\n $constraint18=$this->constraint();\n\n $this->state->_fsp--;\n\n $value = new Erfurt_Sparql_Query2_Filter($constraint18);\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return $value;\n }", "public function filterByFoneTrabalho($foneTrabalho = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($foneTrabalho)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $foneTrabalho)) {\n $foneTrabalho = str_replace('*', '%', $foneTrabalho);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TbalunoImportPeer::FONE_TRABALHO, $foneTrabalho, $comparison);\n }", "public function filterByIdTrabalho($idTrabalho = null, $comparison = null)\n {\n if (is_array($idTrabalho)) {\n $useMinMax = false;\n if (isset($idTrabalho['min'])) {\n $this->addUsingAlias(TbalunobackupPeer::ID_TRABALHO, $idTrabalho['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idTrabalho['max'])) {\n $this->addUsingAlias(TbalunobackupPeer::ID_TRABALHO, $idTrabalho['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(TbalunobackupPeer::ID_TRABALHO, $idTrabalho, $comparison);\n }", "public function filter(){\n try {\n // Sparql11query.g:220:3: ( FILTER constraint ) \n // Sparql11query.g:221:3: FILTER constraint \n {\n $this->match($this->input,$this->getToken('FILTER'),self::$FOLLOW_FILTER_in_filter760); \n $this->pushFollow(self::$FOLLOW_constraint_in_filter762);\n $this->constraint();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "protected function translate_filter($filtstr)\n\t{\n\t\t// if < or > is used, this will be a numeric intrepretation, = will be interpreted as an exact specification, wildcards are also detected and in nothing, wildcards are put before and after\n\t\t$fc = substr($filtstr,0,1);\n\t\tif($fc == \"=\")\n\t\t\treturn(\"='\". substr($filtstr,1). \"'\");\n\t\telse if($fc == \"<\")\n\t\t\treturn(\"<'\". substr($filtstr,1). \"'\");\t\t\t\n\t\telse if($fc == \">\")\n\t\t\treturn(\">'\". substr($filtstr,1). \"'\");\n\t\telse\n\t\t{ // here we intrepret wildcards first, if none put wildcards around it\n\t\t\tif(strpos($filtstr,'_') !== FALSE || strpos($filtstr,'%') !== FALSE)\n\t\t\t{ // String contains wildcards, so use it as is\n\t\t\t\treturn(\"LIKE '\". $filtstr. \"'\");\n\t\t\t}\n\t\t\telse // Add ildcards before and after\n\t\t\t\treturn(\"LIKE '%\". $filtstr. \"%'\");\n\t\t}\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the moder_approved column Example usage: $query>filterByModerApproved(true); // WHERE moder_approved = true $query>filterByModerApproved('yes'); // WHERE moder_approved = true
public function filterByModerApproved($moderApproved = null, $comparison = null) { if (is_string($moderApproved)) { $moderApproved = in_array(strtolower($moderApproved), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; } return $this->addUsingAlias(JobsPeer::MODER_APPROVED, $moderApproved, $comparison); }
[ "public function setModerApproved($v)\n {\n if ($v !== null) {\n if (is_string($v)) {\n $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n } else {\n $v = (boolean) $v;\n }\n }\n\n if ($this->moder_approved !== $v) {\n $this->moder_approved = $v;\n $this->modifiedColumns[] = AdvsPeer::MODER_APPROVED;\n }\n\n\n return $this;\n }", "public function filters(): array\n {\n return [\n WherePivot::make('approved')->asBoolean(),\n ];\n }", "protected function getWhereClauseForEnabledFields() {}", "public function getModerApproved()\n {\n\n return $this->moder_approved;\n }", "public function filter()\n {\n $this->items->filter([$this->filter, 'viewable']);\n }", "public function _admin_filters()\n {\n }", "public function get_approved_items() {\n return $this->query(\"SELECT * FROM `items` where `approved` order by `premium`, `date`\");\n }", "public function whereFilter()\n {\n\n }", "private function filterForUser(&$query){\n\n $idApp=Yii::$app->params['sesionApp']['idApp'];\n $userRole=Yii::$app->params['sesionApp']['userRole'];\n $idUser=Yii::$app->params['sesionApp']['userId'];\n\n switch(Perfil::roleToCodePerfil($userRole)){\n case 'ADM':\n case 'EJE':\n // llamamos todos los pedidos de la aplicacion\n $query->where(['pedido.app_idApp'=>$idApp]); \n break;\n case 'RES':\n // llamamod a todos los pedido del responsable y sus encargados\n $empleados=User::getEmployes($idApp,$idUser); //Obtenemos los empleados del usuario\n $query->where(['pedido.app_idApp'=>$idApp,'idResponsable'=>array_merge([$idUser],$empleados)]); \n break;\n\n case 'OPE':\n $query->where(['pedido.app_idApp'=>$idApp,'idResponsable'=>$idUser]); \n\n }\n\n }", "public function filterAction()\n {\n $authenticatedUser = $this->communityUserService->getCommunityUser();\n $this->view->assign('kantons', $authenticatedUser->getPartyAdminAllowedCantons());\n $this->view->assign('demand', $this->getDemandFromSession(true));\n $statusFilters = array(\n 'active' => LocalizationUtility::translate('panelInvitations.filter.status.active', 'easyvote_education'),\n 'pending' => LocalizationUtility::translate('panelInvitations.filter.status.pending', 'easyvote_education'),\n 'archived' => LocalizationUtility::translate('panelInvitations.filter.status.archived',\n 'easyvote_education'),\n );\n $this->view->assign('statusFilters', $statusFilters);\n }", "protected function applyColumnFilter()\n {\n $this->columns->each->bindFilterQuery($this->model());\n }", "private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }", "public function whereDisabled()\n {\n return $this->rawFilter($this->schema->filterDisabled());\n }", "protected function getGeneralWhereClause() {}", "function charity_is_hope_query_posts_where($where, $query) { \n\t\tglobal $wpdb; \n\t\tif (is_admin() || $query->is_attachment) return $where;\n\t\tif (charity_is_hope_strpos($where, 'post_status')===false && (!isset($_REQUEST['preview']) || $_REQUEST['preview']!='true') && (!isset($_REQUEST['vc_editable']) || $_REQUEST['vc_editable']!='true')) {\n\t\t\tif (current_user_can('read_private_pages') && current_user_can('read_private_posts'))\n\t\t\t\t$where .= \" AND ({$wpdb->posts}.post_status='publish' OR {$wpdb->posts}.post_status='private')\";\n\t\t\telse\n\t\t\t\t$where .= \" AND {$wpdb->posts}.post_status='publish'\";\n\t\t}\n\n\t\treturn $where;\n\t}", "function Collaborators_Friend_Collaborators_Where($userid,$inscriptionsonly=TRUE,$inscribedonly=True)\n {\n if ($inscribedonly)\n {\n $where=array\n (\n \"Friend\" => $userid,\n );\n }\n\n }", "public function getApprovedField() {\n\n\t\t$approved = CheckboxField::create(\n\t\t\t'Approved',\n\t\t\t'',\n\t\t\t$this->Approved\n\t\t)->addExtraClass('approved');\n\n\t\t// Restrict this field appropriately.\n\n\t\t$user = Member::currentUserID();\n\t\tif(!Permission::checkMember($user, 'EXTENSIBLE_SEARCH_SUGGESTIONS')) {\n\t\t\t$approved->setAttribute('disabled', 'true');\n\t\t}\n\t\treturn $approved;\n\t}", "public function addWhereApproved( Builder $builder, Model $model )\n\t{\n\t\t$builder->macro('whereApproved', function(Builder $builder) use( $model )\n\t\t{\n\t\t\t$builder->where( $model->getQualifiedApprovedAtColumn(), '<=', $this->now() )\n\t\t\t\t->where( $model->getQualifiedApprovedAtColumn(), '!=', $this->rejected );\n\n\t\t\treturn $builder;\n\t\t});\n\t}", "protected function filterColumn()\n {\n return $this->filter_column;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the page arguments to register this admin page.
public function get_page_arguments() { return [ $this->get_parent_slug(), $this->get_page_title(), $this->get_title(), $this->get_capability(), $this->get_slug(), $this->get_render_func() ?: [ $this, 'render_page' ], ]; }
[ "public static function get_settings_arguments() {\n\t\treturn self::$settings_arguments;\n\t}", "public function get_admin_pages() {\n\t\treturn apply_filters( 'pslug_admin_pages_object', array(\n\t\t\t'settings' => array(\n\t\t\t\t'general',\n\t\t\t),\n\t\t) );\n\t}", "public function registerAdminPage() {\n add_options_page(\n self::PAGE_TITLE, // the admin page title of the plugin\n self::MENU_CAPTION, // the text on the settings menu item\n 'activate_plugins', //the permission of the page is the save with activate plugins\n self::PAGE_SLUG, // the GET param that navigate to the plugin admin page\n array($this, 'adminPanelEntryPoint') //the callback of the entry point\n );\n }", "protected function get_admin_page() {\r\n\t\treturn Forminator_Core::sanitize_text_field( 'page' );\r\n\t}", "public function get_admin_pages(){\n return is_array($this->admin_pages) ? $this->admin_pages : [$this->admin_pages];\n }", "private static function admin_pages() {\n\t\tglobal $wpseo_admin_pages;\n\n\t\treturn $wpseo_admin_pages;\n\t}", "function bbp_get_tools_admin_pages()\n{\n}", "public function register_admin_page()\n {\n }", "function set__args() {\n\n\t\t// Version\n\t\tif ( isset( $this->option_page['version'] ) AND ! empty( $this->option_page['version'] ) ) {\n\t\t\t$this->set( 'version', $this->option_page['version'] );\n\t\t}\n\n\t\t// add_submenu_page\n\t\tif ( isset( $this->option_page['add_submenu_page'] ) AND is_array( $this->option_page['add_submenu_page'] ) AND ! empty( $this->option_page['add_submenu_page'] ) ) {\n\t\t\t$this->set( 'add_submenu_page', $this->option_page['add_submenu_page'] );\n\t\t}\n\n\t\tif ( isset( $this->option_page['is_add_menu_page'] ) AND ! empty( $this->option_page['is_add_menu_page'] ) ) {\n\t\t\t$this->set( 'have_add_menu_page', 1 );\n\t\t}\n\n\t\t// option_name\n\t\tif ( isset( $this->option_page['option_name'] ) AND ! empty( $this->option_page['option_name'] ) ) {\n\t\t\t$this->set( 'option_name', $this->option_page['option_name'] );\n\t\t}\n\n\t\t// option_group\n\t\tif ( $this->have_option_name() AND isset( $this->option_page['option_group'] ) AND ! empty( $this->option_page['option_group'] ) ) {\n\t\t\t$this->set( 'option_group', $this->option_page['option_group'] );\n\t\t}\n\n\t\t// raw_options\n\t\tif ( $this->have_option_name() AND $this->have_option_group() AND isset( $this->option_page['options'] ) AND ! empty( $this->option_page['options'] ) ) {\n\t\t\t$this->set( 'raw_options', $this->option_page['options'] );\n\t\t}\n\n\t}", "protected function getArgumentsOptions() {\n $arguments = $this->displayHandler->getHandlers('argument');\n $arguments_options = [];\n\n /** @var \\Drupal\\views\\Plugin\\views\\argument\\ArgumentPluginBase $argument */\n foreach ($arguments as $id => $argument) {\n $arguments_options[$id] = $argument->adminLabel();\n }\n return $arguments_options;\n }", "public function getAdminPages() { return array(); }", "public static function get_admin_setting_page() {\r\n return admin_url('wp-admin/admin.php?page='.self::page_setting_slug);\r\n }", "protected function defineArguments()\n {\n return array(\n 'var' => array(),\n 'presentation' => array('required' => true),\n 'entry' => array(),\n );\n }", "function get_site_screen_help_tab_args()\n {\n }", "public function setupAdminPage() \n\t{\n\n\t}", "static public function arguments() {\n if($route = static::route()) return $route->arguments();\n }", "public function create_arguments() {\n\t\t$this->create_labels_argument();\n\n\t\t$this->arguments = array(\n\t\t\t'labels' => $this->label_arguments,\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'author' ),\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => true,\n\t\t\t'query_var' => true,\n\t\t\t'menu_position' => null,\n\t\t\t'menu_icon' => 'dashicons-admin-users',\n\t\t\t'show_in_rest' => true,\n\t\t\t'rest_base' => 'person',\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t);\n\n\t}", "function getExtraArgs() {\n return $this->extra;\n }", "public function getThemeArguments() {\n return $this->get('theme arguments');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[addSetTopBoxModelProcess add set top box model related data to db]
public function addSetTopBoxModelProcess(\App\Http\Requests\SetTopBoxModelRequest $request){ $set_top_box_model_data = $request->all(); $set_top_box_model_data['stb_brands_id'] = $request->input('model_modal_brand'); $add_set_top_box_model = SetTopBoxModel::create($set_top_box_model_data); return response()->json(["status"=>"success", "id"=> $add_set_top_box_model->id, "text" => $add_set_top_box_model->name]); }
[ "public function addSetTopBox(){\n // pass set top box brand value\n $set_top_box_brand = SetTopBoxBrand::all();\n return view('SubscriberManagement::settopbox.add_set_top_box')\n ->with('set_top_box_brand', $set_top_box_brand);\n }", "public function set_top_box_model()\n {\n return $this->belongsTo('App\\Modules\\SubscriberManagement\\Models\\SetTopBoxModel', 'stb_models_id');\n }", "public function addSetTopBoxProcess(Request $request, RoleAccess $role_access){\n $set_top_box = new SetTopBox($request->all());\n $set_top_box->users_id = $role_access->getDistributor($request);\n $set_top_box->subdistributor = $role_access->getSubdistributor($request);\n $set_top_box->save();\n \n return redirect('/allsettopboxes')->with('success', 'Set Top Box \"' . $request->number . '\" Successfully Created & Assigned.');\n }", "function _add_system() {\n\n if (!$this->has_arg('name')) $this->_error('Please specify a system name');\n \n $this->db->pq('INSERT INTO ispyb4a_db.bf_system (systemid,name,description) VALUES (s_bf_system.nextval, :1, :2) RETURNING systemid INTO :id', array($this->arg('name'), $this->has_arg('desc') ? $this->arg('desc') : ''));\n \n $sysid = $this->db->id();\n $bls = $this->check_bls($_POST['bls']);\n \n foreach ($bls as $b) {\n $this->db->pq('INSERT INTO ispyb4a_db.bf_system_beamline (system_beamlineid, systemid, beamlinename) VALUES (s_bf_system_beamline.nextval,:1, :2)', array($sysid, $b));\n }\n \n $this->_output(1);\n }", "function addModel($p_sxml_node, $p_id) {\n $models = new PluginFusioninventoryModelInfos;\n $mib_networking = new PluginFusioninventoryMib;\n\n $models->getFromDB($p_id);\n $sxml_model = $p_sxml_node->addChild('MODEL');\n $sxml_model->addAttribute('ID', $p_id);\n $sxml_model->addAttribute('NAME', $models->fields['name']);\n $mib_networking->oidList($sxml_model,$p_id);\n }", "public function setNewModel();", "function SetSystemModelFeatures()\r\n\t\t{\r\n\t\t\t//model features\r\n\t\t\t$this->model_features_string = array('name', 'type', 'sub_type', 'table_name', 'length', 'min_value', 'max_value', 'default_value', 'by_default');\r\n\t\t\t$this->model_features_boolean = array('primary_key', 'not_null');\r\n\t\t}", "function saveMetaBoxe(){\n\n if(isset($_POST['post_type']) && $_POST['post_type'] == $this->name && isset($_POST[\"_safeWpMeta\"])){ \n $id = $_POST['post_ID']; \n \n foreach($this->models as $modelName => $model){\n \n pn_select_save_method($id, $this->name, $modelName, $model); \n \n } \n \n } \n \n }", "public function order(){\n\t\t$capsule_ids = $this->input->post('capsule_id');\n\t\tforeach($capsule_ids as $key => $capsule_id){\n\t\t\t$this->commonmodel->commonAddEdit('capsule', array('weight' => $key), $capsule_id);\n\t\t}\n\t\texit;\n\t}", "function saveOptionsMetaBox() {\n foreach($this->options_menu['models'] as $modelName => $model) {\n if ($model[\"type\"] == \"title\") {\n continue;\n }\n\n $name = $modelName;\n if (isset($model[\"options\"][\"multiLang\"])) {\n $name = $name . \"_\" .ICL_LANGUAGE_CODE;\n }\n $data = isset($_POST[$modelName]) ? $_POST[$modelName] : \"\";\n\n update_option($name, $data);\n }\n }", "public function set_top_boxes()\n {\n return $this->hasMany('App\\Modules\\SubscriberManagement\\Models\\SetTopBox', 'users_id');\n }", "public function addSetTopBoxBrandProcess(\\App\\Http\\Requests\\SetTopBoxBrandRequest $request){\n $add_brand = SetTopBoxBrand::create($request->all());\n return response()->json([\"status\"=>\"success\", \"id\"=> $add_brand->id, \"text\" => $add_brand->name]);\n }", "public function saveBoxes($order)\n {\n $currencyCode = $this->_storeManager->getStore()->getCurrentCurrency()->getCode();\n $boxesRequired = $this->_helper->calculateBoxes($order->getAllVisibleItems(), $currencyCode);\n\n foreach ($boxesRequired as $boxIndex => $boxInfo) {\n $boxLength = $boxInfo['length'] ? $boxInfo['length'] : $this->_scopeConfig->getValue(\n 'temando/defaults/length',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n $boxWidth = $boxInfo['width'] ? $boxInfo['width'] : $this->_scopeConfig->getValue(\n 'temando/defaults/width',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n $boxHeight = $boxInfo['height'] ? $boxInfo['height'] : $this->_scopeConfig->getValue(\n 'temando/defaults/height',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n $boxWeight = $boxInfo['weight'] ? $boxInfo['weight'] : $this->_scopeConfig->getValue(\n 'temando/defaults/height',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n\n $boxArticles = array();\n\n $this->_box\n ->setShipmentId($this->_shipment->getId())\n ->setComment($boxInfo['comment'])\n ->setQty($boxInfo['qty'])//->setQty($qty)\n ->setValue($boxInfo['value'])\n ->setLength($boxLength)\n ->setWidth($boxWidth)\n ->setHeight($boxHeight)\n ->setMeasureUnit(\n $this->_scopeConfig->getValue(\n 'temando/units/measure',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n )\n )->setWeight($boxWeight)\n ->setWeightUnit(\n $this->_scopeConfig->getValue(\n 'temando/units/weight',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n )\n )->setFragile($boxInfo['fragile'])\n ->setDangerous($boxInfo['dangerous'])\n ->setArticles(json_encode($boxInfo['comment']))\n ->save();\n //$this->_box->cleanModelCache()->clearInstance();\n $this->_box->setId(null);\n }\n return $order;\n }", "function add_model($text)\n {\n $query=$this->db2->query(\"INSERT INTO buses_model VALUES ('','$text')\");\n if($query)\n return 1;\n else\n return 0;\n }", "public function insertProductsSizes($model)\n {\n $id_size = $model->getIdSize();\n $id_product = $model->getIdProduct();\n\n $this->db->set('id_product', $id_product)\n ->set('id_size', $id_size)\n ->insert($this->table);\n }", "function meta_box_add_process()\n\t{\n\t\tadd_action( 'add_meta_boxes_'.$this->post_type, [$this,'add_custom_meta_box']);\n\t\t//\n\t\tadd_action( \"save_post_\".$this->post_type,[$this,'save_meta_data'],10,2);\n\t}", "public function model_insert_form(){\n\n $data = $this->get_session_data();\n\n $data['title'] = 'ALS - Model';\n $this->parser->parse('templates/header.php', $data);\n\n // models are only applicable for items,\n // so only query for item_type that has is_assembled = 0\n $this->db->select('b.*, i.name as item_type_name');\n $this->db->from('brands b, item_types i');\n $this->db->where('b.item_type_id = i.id and i.is_assembled = 0');\n $this->db->order_by('item_type_name, b.name asc');\n $data['brands'] = $this->db->get()->result();\n\n $this->parser->parse('masters/models/insert_form.php', $data);\n\n $this->parser->parse('templates/footer.php', $data);\n }", "function ufandshands_meta_add_box() {\n $metaBoxes = ufandshands_getMetaBoxes();\n \n foreach ($metaBoxes as $metaBox) {\n\t add_meta_box($metaBox['id'], $metaBox['title'], 'display_html', $metaBox['page'], $metaBox['context'], $metaBox['priority'], $metaBox);\n }\n}", "final public function AddBox(BoxModel $box, $module = '') {\n $box->module = $module;\n $box->Before($this);\n $html = $box->GetHTML();\n $r = $box->region;\n if (isset($this->_regions[$r]))\n $this->_regions[$r].= $html;\n else\n $this->_regions[$r] = $html;\n $box->After($this);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
// CodeGenrator View Class Properties // // // CodeGenrator View Class Methods // // Add column to view.
public function addViewColumn(CodeGeneratorColumn $column){ $column->setReadOnly(true); // if($column->getKey() == CodeGeneratorColumn::KEY_PRIMARY){ // $this->setPrimaryKey($column); // } return $this->columns[$column->getName()] = $column; }
[ "public function addView() {\n\t\t$this->set(static::COLUMN_VIEWS, $this->get(static::COLUMN_VIEWS)+1);\n\t}", "public static function addColumns();", "abstract protected function addColumns();", "public function addColumn() {\n\t\t\tif ($this->strQueryType == self::SELECT_QUERY) {\n\t\t\t\t$strColumnMethod = 'addSelectColumn';\n\t\t\t} else {\n\t\t\t\t$strColumnMethod = 'addAlterColumn';\n\t\t\t}\n\t\t\t\n\t\t\t$arrFunctionArgs = func_get_args();\n\t\t\tcall_user_func_array(array($this, $strColumnMethod), $arrFunctionArgs);\n\t\t}", "function gen_add_column( $add )\n\t{\n\t\t$s = $this->gen_column( $add );\n\t\t$s = \"ALTER TABLE \" . $add['table'] . \" ADD COLUMN \" . $s;\n\t\tif( $this->DBO ) {\n\t\t\t$this->DBO->query( $s );\n\t\t}\n\t\treturn $s;\n\t}", "public function addColumns()\n {\n $this->addColumn([\n 'index' => 'id',\n 'label' => 'ردیف',\n 'type' => 'number',\n 'searchable' => false,\n 'sortable' => true,\n 'filterable' => false\n ]);\n\n $this->addColumn([\n 'index' => 'category_name',\n 'label' => 'نام دسته بندی',\n 'type' => 'string',\n 'searchable' => false,\n 'sortable' => false,\n 'filterable' => false\n ]);\n $this->addColumn([\n 'index' => 'description',\n 'label' => 'توضیحات',\n 'type' => 'string',\n 'searchable' => false,\n 'sortable' => false,\n 'filterable' => false\n ]);\n }", "abstract protected function buildAddColumns();", "public function buildView(ColumnView $view, ColumnInterface $column, array $options): void;", "public function testAddColumn()\r\n {\r\n $name = 'new_add_column_table';\r\n $content = 'test content here';\r\n\r\n $this->_createTable( $name );\r\n\r\n $this->assertTrue( self::$db->tableExists( $name ) );\r\n\r\n $this->assertTrue( self::$db->addColumn( $name, 'test_col', 'INTEGER' ) );\r\n\r\n // insert record with new column\r\n $query = \"INSERT INTO $name ( test_name, test_col ) VALUES ( ?, ? )\";\r\n\r\n $id = self::$db->insert( $query, [ $content, 5 ] );\r\n\r\n $this->assertEquals( 1, $id );\r\n }", "public function addColumn($column)\r\n {\r\n if(is_array($column)) {\r\n $column = new Columns\\Column($column);\r\n }\r\n\r\n if(is_scalar($column)) {\r\n $column = new Columns\\Column(array('name'=>$column));\r\n }\r\n\r\n $column->setTable($this);\r\n\r\n $this->javascript .= $column->getJavaScript();\r\n\r\n // if column is not meant to be visible, like for admin reasons, take it out of the visible columns\r\n if( !$column->isVisible() && is_array( $this->visibleColumns ) ) {\r\n $flip = array_flip( $this->visibleColumns );\r\n unset( $flip[$column->name] );\r\n $this->visibleColumns = $flip;\r\n }\r\n\r\n if( ! $this->noFilters && $this->visibleColumns != false && ! in_array($column->name, $this->visibleColumns)) {\r\n $column->visible = false;\r\n }\r\n\r\n if( $column->isVisible() ) {\r\n $this->headers[] = 1;\r\n }\r\n\r\n $this->columns[] = $column;\r\n\r\n $this->setTableFooter($column);\r\n return $this;\r\n }", "public function addNewColumn($columnName);", "public function addColumnItem($columnName, $view, $data = array(), $weight = 0) {\n\t\t$column = &$this->_columnItems[$columnName];\n\t\t$column[] = array($view, $data, $weight);\n\t\treturn $this;\n\t}", "public function buildView(ColumnView $view, ColumnInterface $column, array $options);", "public function addColumns() {\n $new_columns = func_get_args();\n $this->_columns = $this->_columns + $new_columns;\n return $this;\n }", "function add_column(pointer $pointer, view $rod):void{\r\n //\r\n //Get the name of the pointer column; it is the name of the home entity \r\n //of the pointer\r\n $cname= $pointer->home()->name;\r\n //\r\n //Get the expression for the pointer\r\n $exp= $rod->columns['friend'];\r\n //\r\n //Construct the new field\r\n $field=new field(\r\n //\r\n //This registrar query is the home of this field\r\n $this,\r\n //\r\n //This is the local name of the field \r\n $cname,\r\n $exp\r\n );\r\n //\r\n //Add this field to the registrar query\r\n $this->columns[$cname]= $field;\r\n }", "protected function generateColumns()\n\t{\n\t\tforeach ($this->dataSource->getColumns() as $name) {\n\t\t\t$this->addColumn($name);\n\t\t}\n\t}", "protected function addColumns()\r\n {\r\n $content = '';\r\n\r\n foreach( $this->model->getProperties() as $field => $type ) {\r\n\r\n if(!$this->tableHasColumn($field)) {\r\n $this->columnsChanged = true;\r\n $rule = \"\\t\\t\\t\";\r\n\r\n // Primary key check\r\n if ( $field === 'id' and $type === 'integer' )\r\n $rule .= $this->increment();\r\n else {\r\n $rule .= $this->setColumn($this->model->validTypes[$type], $field);\r\n\r\n if ( !empty($setting) )\r\n $rule .= $this->addColumnOption($setting);\r\n }\r\n\r\n array_push($this->columnsAdded, $field);\r\n\r\n $content .= $rule . \";\\n\";\r\n }\r\n }\r\n\r\n return $content;\r\n }", "public function columnPreview()\n {\n }", "public function addColumn( $type, $column, $field );" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The following will recursively do an array_diff_assoc, which will calculate differences on a multidimensional level. This not display any notices if a key don't exist and if error_reporting is set to E_ALL
function PU_array_diff_assoc_recursive($array1, $array2) { foreach ($array1 as $key => $value) { if (is_array($value)) { if (!isset($array2[$key])) { $difference[$key] = $value; } elseif (!is_array($array2[$key])) { $difference[$key] = $value; } else { $new_diff = PU_array_diff_assoc_recursive($value, $array2[$key]); if ($new_diff != false) { $difference[$key] = $new_diff; } } } elseif (!isset($array2[$key]) || $array2[$key] != $value) { $difference[$key] = $value; } } return !isset($difference) ? 0 : $difference; }
[ "function array_diff_assoc_recursive($array1, $array2){\n $difference = array();\n foreach($array1 as $key => $value){\n if(is_array($value)){\n if(!isset($array2[$key])){\n $difference[$key] = $value;\n }elseif(!is_array($array2[$key])){\n $difference[$key] = $value;\n }else{\n $new_diff = array_diff_assoc_recursive($value, $array2[$key]);\n if($new_diff != FALSE){\n $difference[$key] = $new_diff;\n }\n }\n }elseif(!isset($array2[$key]) || $array2[$key] != $value){\n $difference[$key] = $value;\n }\n }\n return $difference;\n}", "static function recursive_array_diff_assoc($array1, $array2) {\n\t\treturn Arrays::recursive_array_diff_assoc($array1,$array2);\n\t}", "function array_diff_key_recursive(array $arr1, array $arr2)\r\n\t{\r\n\t\t$diff = array_diff_key($arr1, $arr2);\r\n\t\t$intersect = array_intersect_key($arr1, $arr2);\r\n\r\n\t\tforeach ($intersect as $k => $v) {\r\n\t\t\tif (is_array($arr1[$k]) && is_array($arr2[$k])) {\r\n\t\t\t\t$d = array_diff_key_recursive($arr1[$k], $arr2[$k]);\r\n\r\n\t\t\t\tif ($d) {\r\n\t\t\t\t\t$diff[$k] = $d;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $diff;\r\n\t}", "function arrayRecursiveDiff($aArray1, $aArray2) { \n\t$aReturn = array(); \n\tforeach ($aArray1 as $mKey => $mValue) { \n\t\tif (array_key_exists($mKey, $aArray2)) { \n\t\t\tif (is_array($mValue)) { \n\t\t\t\t$aRecursiveDiff = arrayRecursiveDiff($mValue, $aArray2[$mKey]); \n\t\t\t\tif (count($aRecursiveDiff)) { $aReturn[$mKey] = $aRecursiveDiff; } \n\t\t\t} else { \n\t\t\t\tif ($mValue != $aArray2[$mKey]) { \n\t\t\t\t\t$aReturn[$mKey] = $mValue; \n\t\t\t\t} \n\t\t\t} \n\t\t} else { \n\t\t\t$aReturn[$mKey] = $mValue; \n\t\t} \n\t}\n\treturn $aReturn; \n}", "function array_multi_diff($a1,$a2) {\n\t$diff = array();\n\t\n\tforeach($a1 as $k=>$v){\n\t\t$dv = null;\n\t\tif(is_int($k)){\n\t\t\t// Compare values\n\t\t\tif(array_search($v,$a2)===false) $dv=$v;\n\t\t\telse if(is_array($v)) $dv = array_multi_diff($v,$a2[$k]);\n\t\t\tif($dv) $diff[]=$dv;\n\t\t} else {\n\t\t\t// Compare noninteger keys\n\t\t\tif(!$a2[$k]) $dv=$v;\n\t\t\telse if(is_array($v)) $dv = array_multi_diff($v,$a2[$k]);\n\t\t\tif($dv) $diff[$k]=$dv;\n\t\t}\n\t}\n\t\n\treturn $diff;\n}", "function php_compat_array_diff_key()\n{\n $args = func_get_args();\n if (count($args) < 2) {\n user_error('Wrong parameter count for array_diff_key()', E_USER_WARNING);\n return;\n }\n\n // Check arrays\n $array_count = count($args);\n for ($i = 0; $i !== $array_count; $i++) {\n if (!is_array($args[$i])) {\n user_error('array_diff_key() Argument #' .\n ($i + 1) . ' is not an array', E_USER_WARNING);\n return;\n }\n }\n\n $result = $args[0];\n if (function_exists('array_key_exists')) {\n // Optimize for >= PHP 4.1.0\n foreach ($args[0] as $key => $value) {\n for ($i = 1; $i !== $array_count; $i++) {\n if (array_key_exists($key,$args[$i])) {\n unset($result[$key]);\n break;\n }\n }\n }\n } else {\n foreach ($args[0] as $key1 => $value1) {\n for ($i = 1; $i !== $array_count; $i++) {\n foreach ($args[$i] as $key2 => $value2) {\n if ((string) $key1 === (string) $key2) {\n unset($result[$key2]);\n break 2;\n }\n }\n }\n }\n }\n return $result; \n}", "function array_diff_strict(array $array1, array $array2) : array\r\n{\r\n if (count($array1) !== count($array2)) {\r\n throw new Exception('Arrays must be of the same length');\r\n }\r\n return array_kvreduce($array1, function (array $diff, $key, $value) use ($array2) : array {\r\n if ($value !== $array2[$key]) {\r\n $diff[] = [\r\n 'offset' => $key,\r\n 'left' => $value,\r\n 'right' => $array2[$key],\r\n ];\r\n }\r\n return $diff;\r\n }, []);\r\n}", "function array_diff_key (array $array1, array $array2) {}", "function array_udiff_assoc (array $array1, array $array2, array $_ = null, callable $data_compare_func) {}", "function array_diff_uassoc($array1, $array2=null, $data_compare_func=null) {\n if (($n=func_num_args()) < 3) {\n trigger_error(__FUNCTION__.'() : at least 3 parameters are required, '.$n.' given', E_USER_WARNING);\n return;\n } elseif (!is_callable($data_compare_func=func_get_arg($n-1))) {\n trigger_error(__FUNCTION__.'() expects parameter '.$n.' to be a valid callback', E_USER_WARNING);\n return;\n } elseif (!is_array(func_get_arg(0))) {\n trigger_error(__FUNCTION__.' : Argument #1 is not an array', E_USER_WARNING);\n return;\n }\n\n $diff = array();\n foreach (func_get_arg(0) as $key => $value) {\n for ($i=1, $found=false; $i<$n-1 && !$found; $i++) {\n if (is_array($arg=func_get_arg($i))) {\n foreach ($arg as $k => $v) {\n if ($value == $arg[$key] && $data_compare_func($key, $k) == 0) {\n continue 2;\n }\n }\n } else {\n trigger_error(__FUNCTION__.' : Argument #'.($i+1).' is not an array', E_USER_WARNING);\n return;\n }\n }\n if (!$found) {\n $diff[$key] = $value;\n }\n }\n\n return $diff;\n }", "function array_diff_key() {\n $argCount = func_num_args();\n\n if ($argCount < 2) {\n return false;\n }\n \n $argValues = func_get_args();\n foreach ($argValues as $argParam) {\n if (!is_array($argParam)) {\n return false;\n }\n }\n \n $valuesDiff = array();\n foreach ($argValues[0] as $valueKey => $valueData) {\n for ($i = 1; $i < $argCount; $i++) {\n if (isset($argValues[$i][$valueKey])) {\n continue 2;\n }\n }\n $valuesDiff[$valueKey] = $valueData;\n }\n \n return $valuesDiff;\n }", "function array_diff_multidimensional($array1, $array2, $strict = true)\n {\n return ArrayDiffMultidimensional::compare($array1, $array2, $strict);\n }", "function __comparing($arr1, $arr2, $nestedKey=[], &$fieldChanges = []) {\n foreach ($arr1 as $k1 => $v1) {\n if (!is_array($v1)) {\n $v2 = $arr2[$k1] ?? null;\n if ($v1 !== $v2) {\n $fieldChanges[] = array_merge($nestedKey, [$k1]);\n }\n continue;\n } else {\n __comparing($v1, $arr2[$k1], [$k1], $fieldChanges);\n }\n }\n\n return $fieldChanges;\n}", "private static function compareArrays(&$orig, &$new, $vars) {\n\t\t// and mark them and any subkeys as new\n\t\tforeach ($new as $key => $value) {\n\t\t\tif ($key === \"__+__\") continue;\n\t\t\tif ($key === \"__-__\") continue;\n\t\t\tif ($key === \"__*__\") continue;\n\n\t\t\tif ($orig === null || !array_key_exists($key, $orig)) {\n\t\t\t\t$new[$key][\"__+__\"] = true;\n\t\t\t}\n\t\t\tif (isset($new[$key][\"__values__\"])) {\n\t\t\t\tif (isset($orig[$key])) {\n\t\t\t\t\t$new[$key][\"__orig__\"] = $orig[$key];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$newVars = array_key_exists(\"*\", $vars) ? $vars : \n\t\t\t\t\t(array_key_exists($key, $vars) ? $vars[$key] : array());\n\t\t\t\tself::compareArrays($orig[$key], $new[$key], $newVars);\n\t\t\t}\n\t\t}\n\n\t\t// If the original didn't have this key then we can exit here\n\t\tif (!$orig) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check the old array for any values that aren't present in the new\n\t\t// array, and mark them as either deleted or unsure, depending on if\n\t\t// we can find a variable that might refernce that translation key\n\t\tforeach ($orig as $key => $value) {\n\t\t\tif (!array_key_exists($key, $new)) {\n\t\t\t\t$refs = array_key_exists(\"*\", $vars) ? $vars[\"*\"] : array();\n\n\t\t\t\t// If the original is an array then we have to go mark all the\n\t\t\t\t// sub keys as missing\n\t\t\t\tif (is_array($orig[$key])) {\n\t\t\t\t\t$new[$key] = array();\n\t\t\t\t\t$new[$key][(count($refs) > 0 ? \"__*__\" : \"__-__\")] = true;\n\t\t\t\t\t$newVars = array_key_exists(\"*\", $vars) ? $vars : \n\t\t\t\t\t\t(array_key_exists($key, $vars) ? $vars[$key] : array());\n\t\t\t\t\tself::compareArrays($orig[$key], $new[$key], $newVars);\n\t\t\t\t} else {\n\t\t\t\t\tif (count($refs) > 0) {\n\t\t\t\t\t\t$new[$key] = $refs;\n\t\t\t\t\t\t$new[$key][\"__*__\"] = true;\n\t\t\t\t\t\t$new[$key][\"__values__\"] = true;\n\t\t\t\t\t\t$new[$key][0][\"val\"] = $orig[$key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$new[$key][\"__-__\"] = true;\n\t\t\t\t\t\t$new[$key][\"__values__\"] = true;\n\t\t\t\t\t\t$new[$key][0][\"val\"] = $orig[$key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function array_keys_verify(array $format, array $check, $depth = '', $errors = []){\n\n\tforeach ($format as $key => $sub_format){\n\t\t$current_depth = $depth.'.'.$key;\n\t\t// First see if they key is even set\n\t\tif (!isset($check[$key])){\n\t\t\t$errors[$current_depth] = \"The key '$key' must be set, even if it is blank\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (is_null($sub_format)){\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the sub-format isn't an array we're done with this key\n\t\tif (!is_array($sub_format)){\n\t\t\t$type = gettype($check[$key]);\n\t\t\tif ($sub_format==='non-zero'){\n\t\t\t\t// non-zero isn't a regular type, but requiring non-zero values\n\t\t\t\t// can be as relevant to operational logic, preventing div by zero etc\n\t\t\t\tif ((int)$check[$key]===0){\n\t\t\t\t\t$errors[$current_depth] = \"The key '$key' must be a non-zero integer\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($type!==$sub_format) {\n\t\t\t\t$errors[$current_depth] = \"The key '$key' must be of type '$sub_format', not '$type''\";\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If sub-format is an array and the value we're checking isn't, that's a problem\n\t\tif (!is_array($check[$key])){\n\t\t\t$errors[$current_depth] = \"The key '$key' must be an array, even if it is empty\";\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If our sub-format is an array with values we then dive into that\n\t\tif (!empty($sub_format)){\n\t\t\t$errors = array_keys_verify($sub_format, $check[$key], $current_depth, $errors);\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn $errors;\n}", "function array_udiff_assoc($array1, $array2=null, $data_compare_func=null) {\n if (($n=func_num_args()) < 3) {\n trigger_error(__FUNCTION__.'() : at least 3 parameters are required, '.$n.' given', E_USER_WARNING);\n return;\n } elseif (!is_callable($data_compare_func=func_get_arg($n-1))) {\n trigger_error(__FUNCTION__.'() expects parameter '.$n.' to be a valid callback', E_USER_WARNING);\n return;\n } elseif (!is_array(func_get_arg(0))) {\n trigger_error(__FUNCTION__.' : Argument #1 is not an array', E_USER_WARNING);\n return;\n }\n\n $diff = array();\n foreach (func_get_arg(0) as $key => $value) {\n for ($i=1, $found=false; $i<$n-1 && !$found; $i++) {\n if (is_array($arg=func_get_arg($i))) {\n if (isset($arg[$key]) && $data_compare_func($value, $arg[$key]) == 0) {\n continue 2;\n }\n } else {\n trigger_error(__FUNCTION__.' : Argument #'.($i+1).' is not an array', E_USER_WARNING);\n return;\n }\n }\n if (!$found) {\n $diff[$key] = $value;\n }\n }\n\n return $diff;\n }", "function multi_diff($name1,$arr1,$name2,$arr2) {\n\t$result = array();\n\t$merged = $arr1+$arr2;// array_merge($arr1,$arr2);\n\tforeach ($merged as $k=>$v){\n\t\tif(!isset($arr2[$k])) {\n\t\t\t$result[$k] = array($name1 => $arr1[$k], $name2 => NULL);\n\t\t} else if(!isset($arr1[$k])) {\n\t\t\t$result[$k] = array($name1 => NULL,$name2 => $arr2[$k]);\n\t\t} else {\n\t\t\tif(is_array($arr1[$k]) && is_array($arr2[$k])){\n\t\t\t\t$diff = multi_diff($name1, $arr1[$k], $name2, $arr2[$k]);\n\t\t\t\tif(!empty($diff)) {\n\t\t\t\t\t$result[$k] = $diff;\n\t\t\t\t}\n\t\t\t} else if ($arr1[$k] !== $arr2[$k]) {\n\t\t\t\t$result[$k] = array($name1 => $arr1[$k],$name2 => $arr2[$k]);\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "static function recursive_array_diff($arr1, $arr2) {\n\t\treturn Arrays::recursive_array_diff($arr1,$arr2);\n\t}", "function array_diff_ukey (array $array1, array $array2, array $_ = null, callable $key_compare_func) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'createReceipt'
public function createReceiptRequest($receipts) { // Verify the required parameter 'receipts' is set if ($receipts === null || (is_array($receipts) && count($receipts) === 0)) { throw new InvalidArgumentException(sprintf( 'Missing the required parameter $%s when calling %s', 'receipts', 'createReceipt' )); } $resourcePath = '/Receipts'; $formParams = []; $queryParams = []; $httpBody = null; $multipart = false; // Body parameter $_tempBody = null; if (isset($receipts)) { $_tempBody = $receipts; } 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. if ($headers['Content-Type'] === 'application/json') { $httpBodyText = $this->jsonEncode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBodyText = $_tempBody; } $httpBody = $this->createStream($httpBodyText); } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // FIXME: how do we do multiparts with PSR-7? // MultipartStream() is a Guzzle tool. // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = $this->createStream($this->jsonEncode($formParams)); } else { // for HTTP post (form) $httpBody = $this->createStream($this->buildQuery($formParams)); } } return $this->buildHttpRequest( $headers, $queryParams, $httpBody, 'PUT', $resourcePath ); }
[ "public function actionCreateReceipt() {\n try {\n $result = ApiModule::$defaultFailedResponse;\n // Check format of request\n $this->checkRequest();\n // Parse json\n $root = json_decode(filter_input(INPUT_POST, DomainConst::KEY_ROOT_REQUEST));\n // Check required parameters\n $this->checkRequiredParam($root, array(\n DomainConst::KEY_TOKEN,\n DomainConst::KEY_DETAIL_ID,\n DomainConst::KEY_DATE,\n DomainConst::KEY_DISCOUNT,\n DomainConst::KEY_FINAL,\n DomainConst::KEY_CUSTOMER_CONFIRM,\n DomainConst::KEY_RECEIPTIONIST_ID,\n DomainConst::KEY_NOTE\n ));\n // Get user\n $mUser = $this->getUserByToken($result, $root->token);\n // Check treatment schedule id\n $isValid = (new TreatmentScheduleDetails())->isIdActiveExist($root->detail_id);\n if (!$isValid) {\n $result[DomainConst::KEY_MESSAGE] = DomainConst::CONTENT00226;\n ApiModule::sendResponse($result, $this);\n }\n // Check date\n if (empty($root->date)) {\n $result[DomainConst::KEY_MESSAGE] = DomainConst::CONTENT00234;\n ApiModule::sendResponse($result, $this);\n }\n $this->handleCreateReceipt($result, $mUser, $root);\n } catch (Exception $exc) {\n ApiModule::catchError($exc, $this);\n }\n }", "protected function addQuickReceiptRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addQuickReceipt'\n );\n }\n\n $resourcePath = '/beta/quickReceipt';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $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('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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 createReceiptsTest()\n {\n /*$this->number;\n $this->expire;\n $this->amount = '350000';*/\n // ZTest::assertEquals(1, $token);\n\n $token = Az::$app->payer->payme->create();\n vdd(Az::$app->payer->payme->createReceipts());\n }", "public function createReceipt()\n {\n $contentBody = \"\";\n $finalProductsCost = 0.00;\n $salesTaxTotal = 0.00;\n $importTaxTotal = 0.00;\n\n $count = 1;\n foreach ($this->getProducts() as $product) {\n $productCount = count($this->getProducts()->where('id', '=', $product->id)->all());\n\n $productDescription = (new ProductFunctions($product))->getDescription();\n $costsTaxInclusive = (new ProductFunctions($product))->finalCost();\n\n $finalProductsCost += ((new ProductFunctions($product))->getPrice() * $productCount);\n $salesTaxTotal += ((new ProductFunctions($product))->getSalesTaxCost() * $productCount);\n $importTaxTotal += ((new ProductFunctions($product))->getImportTaxCost() * $productCount);\n\n $contentBody .= ($productCount) . ' ' . $productDescription . ': ' . money_format('%i', $costsTaxInclusive);\n $count != count($this->getProducts()) ? $contentBody .= \"\\n\" : null;\n $count++;\n }\n\n $totalTaxes = ($salesTaxTotal + $importTaxTotal);\n $contentBody .= \"\\nSales Taxes: \" . money_format('%i', $totalTaxes);\n $contentBody .= \"\\nTotal: \" . money_format('%i', ($finalProductsCost + $totalTaxes));\n\n $receipt = new Receipt(\n [\n 'final_product_cost_total' => money_format('%i', $finalProductsCost),\n 'sales_tax_total' => money_format('%i', $salesTaxTotal),\n 'import_tax_total' => money_format('%i', $importTaxTotal),\n 'final_taxes_total' => money_format('%i', $totalTaxes),\n 'final_receipt_total' => money_format('%i', ($finalProductsCost + $totalTaxes)),\n 'receipt_content' => $contentBody,\n 'basket_id' => $this->basket->id\n ]\n );\n $receipt->save();\n\n if (!empty($receipt)) {\n $this->basket->receipt_id = $receipt->id;\n $this->basket->save();\n }\n\n return $receipt;\n }", "private function requestCreateOrder() {\n\t\t$data = [\"CREATESO\"];\n\t\t$this->requestDplus($data, $addcustID = false);\n\t}", "protected function executeQuickReceiptRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling executeQuickReceipt'\n );\n }\n\n $resourcePath = '/beta/quickReceipt/executeQuickReceipt';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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 create( &$receipt ) {\n\t\t$receipt->set_date_created( time() );\n\n\t\t$receipt_id = wp_insert_post(\n\t\t\tapply_filters(\n\t\t\t\t'pos_host_new_receipt_data',\n\t\t\t\tarray(\n\t\t\t\t\t'post_type' => 'pos_host_receipt',\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t'post_author' => get_current_user_id(),\n\t\t\t\t\t'post_title' => $receipt->get_name( 'edit' ),\n\t\t\t\t\t'post_content' => '',\n\t\t\t\t\t'post_excerpt' => '',\n\t\t\t\t\t'post_date' => gmdate( 'Y-m-d H:i:s', $receipt->get_date_created()->getOffsetTimestamp() ),\n\t\t\t\t\t'post_date_gmt' => gmdate( 'Y-m-d H:i:s', $receipt->get_date_created()->getTimestamp() ),\n\t\t\t\t)\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\tif ( $receipt_id ) {\n\t\t\t$receipt->set_id( $receipt_id );\n\t\t\t$this->update_post_meta( $receipt );\n\t\t\t$receipt->save_meta_data();\n\t\t\t$receipt->apply_changes();\n\t\t\tdelete_transient( 'rest_api_pos_host_receipts_type_count' );\n\t\t\tdo_action( 'pos_host_new_pos_host_receipt', $receipt_id, $receipt );\n\t\t}\n\t}", "public static function createReceiptTable()\n\t{\n\t\t$create = \"CREATE TABLE IF NOT EXISTS RECEIPT (\n\t\t\treceiptcode \tINT AUTO_INCREMENT NOT NULL,\n\t\t\tuid \t\t\tINT NOT NULL,\n\t\t\ttransactiondate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\ttotalspent \t\tdecimal(10,3) NOT NULL,\n\n\t\t\tFOREIGN KEY (uid) REFERENCES USER (uid),\n\t\t\tPRIMARY KEY (receiptcode)\n\t\t);\";\n\n\t\treturn $create;\n\t}", "private function createRequest()\n {\n\n // Get the metadata\n $metaData = $this->createMetadata();\n \n // Get the audio data\n $audioData = $this->getAudioData();\n \n // Get the request file name\n $reqFile = $this->getRequestFileName();\n\n // Create the equest data\n $reqData = BOUNDARY_TERM;\n $reqData .= '\\n';\n $reqData .= 'Content-Disposition: form-data; name=\"metadata\"';\n $reqData .= '\\n';\n $reqData .= 'Content-Type: application/json; charset=UTF-8';\n $reqData .= '\\n';\n\n // Add metadata\n $reqData .= $metaData;\n $reqData .= '\\n';\n $reqData .= BOUNDARY_TERM;\n $reqData .= '\\n';\n $reqData .= 'Content-Disposition: form-data; name=\"audio\"';\n $reqData .= '\\n';\n $reqData .= 'Content-Type: application/octet-stream';\n $reqData .= '\\n';\n\n // Add audiodata\n $reqData .= $audioData;\n $reqData .= '\\n';\n $reqData .= BOUNDARY_END;\n\n // Write the metadata to the request file\n file_put_contents($reqFile,$reqData);\n }", "public function getPaymentCreateRequest() {\n $data = null;\n if ($this->amount && $this->currency) {\n // capture pre-authorized payment\n if ($this->parentTransactionId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"authorization\" => $this->parentTransactionId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using Simplify customer identifier\n else if ($this->cardId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"customer\" => $this->cardId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using card token\n else if ($this->cardToken) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"token\" => $this->cardToken,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using raw card data\n else if ($this->cardNumber) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"card\" => array(\n \"expYear\" => $this->expirationYear,\n \"expMonth\" => $this->expirationMonth, \n \"cvc\" => $this->cvc,\n \"number\" => $this->cardNumber\n ),\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n if ($this->billing) {\n $data[\"card\"][\"name\"] = $this->billing->getName();\n $data[\"card\"][\"addressCity\"] = $this->billing->getCity();\n $data[\"card\"][\"addressLine1\"] = $this->billing->getStreetLine(1);\n $data[\"card\"][\"addressLine2\"] = $this->billing->getStreetLine(2);\n $data[\"card\"][\"addressZip\"] = $this->billing->getPostcode();\n $data[\"card\"][\"addressState\"] = $this->billing->getRegion();\n $data[\"card\"][\"addressCountry\"] = $this->billing->getCountryId();\n }\n } \n }\n return $data;\n }", "function sendReceiptMessage($recipientId, Application $app) {\n // Generate a random receipt ID as the API requires a unique ID\n $receiptId = 'order'.floor(rand(0, 1000));\n\n $messageData = array(\n 'recipient' => array(\n 'id' => $recipientId\n ),\n 'message' => array(\n 'attachment' => array(\n 'type' => 'template',\n 'payload' => array(\n 'template_type' => 'receipt',\n 'recipient_name' => 'Peter Chang',\n 'order_number' => $receiptId,\n 'currency' => 'USD',\n 'payment_method' => 'VISA 1234',\n 'timestamp' => '1428444852',\n 'elements' => array(\n array(\n 'title' => 'Oculus Rift',\n 'subtitle' => 'Includes: headset, sensor, remote',\n 'quantity' => 1,\n 'price' => 599.00,\n 'currency' => 'USD',\n 'image_url' => $app['server_url'].'/assets/riftsq.png'\n ),\n array(\n 'title' => 'Samsung Gear VR',\n 'subtitle' => 'Frost White',\n 'quantity' => 1,\n 'price' => 99.00,\n 'currency' => 'USD',\n 'image_url' => $app['server_url'].'/assets/gearvrsq.png'\n )\n ),\n 'address' => array(\n 'street_1' => '1 Hacker Way',\n 'street_2' => '',\n 'city' => 'Menlo Park',\n 'postal_code' => '94025',\n 'state' => 'CA',\n 'country' => 'US'\n ),\n 'summary' => array(\n 'subtotal' => 698.99,\n 'shipping_cost' => 20.00,\n 'total_tax' => 57.67,\n 'total_cost' => 626.66\n ),\n 'adjustments' => array(\n array(\n 'name' => 'New Customer Discount',\n 'amount' => -50\n ),\n array(\n 'name' => '$100 Off Coupon',\n 'amount' => -100\n )\n )\n )\n )\n )\n );\n\n callSendApi($messageData, $app);\n}", "public function requireReceipt(): void {\n\t}", "public function CreateCashReceipt($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t\"(CreateCashReceipt)\",\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall(\"CreateCashReceipt\", $args);\n\t}", "protected function create_transaction() {\n\n\t\t$order = $this->get_order();\n\n\t\t$data = array(\n\t\t\t'ssl_invoice_number' => $this->str_truncate( ltrim( $order->get_order_number(), _x( '#', 'hash before order number', 'woocommerce-gateway-elavon' ) ), 25, '' ),\n\t\t\t'ssl_amount' => $order->payment_total,\n\t\t\t'ssl_salestax' => $order->get_total_tax(),\n\t\t);\n\n\t\t$data = array_merge( $data, $this->get_customer_data_from_order( $order ) );\n\n\t\t// clean any extra special characters to avoid API issues\n\t\t$data = $this->remove_special_characters( $data );\n\n\t\tif ( isset( $order->payment->token ) ) {\n\t\t\t$data['ssl_token'] = $order->payment->token;\n\t\t}\n\n\t\t$this->request_data = $data;\n\t}", "protected function updateItemReceiptRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateItemReceipt'\n );\n }\n\n $resourcePath = '/beta/itemReceipt';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $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('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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 }", "private function createRequest()\n {\n $xml = new DOMDocument();\n $xml->formatOutput = true;\n\n // Create the QuantumViewRequest element\n $quantumViewRequest = $xml->appendChild($xml->createElement('QuantumViewRequest'));\n $quantumViewRequest->setAttribute('xml:lang', 'en-US');\n\n // Create the SubscriptionRequest element\n if (null !== $this->name || null !== $this->beginDateTime || null !== $this->fileName) {\n $subscriptionRequest = $quantumViewRequest->appendChild($xml->createElement('SubscriptionRequest'));\n\n // Subscription name\n if (null !== $this->name) {\n $subscriptionRequest->appendChild($xml->createElement('Name', $this->name));\n }\n\n // Date Time Range\n if (null !== $this->beginDateTime) {\n $dateTimeRange = $subscriptionRequest->appendChild($xml->createElement('DateTimeRange'));\n $dateTimeRange->appendChild($xml->createElement('BeginDateTime', $this->beginDateTime));\n $dateTimeRange->appendChild($xml->createElement('EndDateTime', $this->endDateTime));\n\n // File name\n } elseif (null !== $this->fileName) {\n $subscriptionRequest->appendChild($xml->createElement('FileName', $this->fileName));\n }\n }\n\n // Create the Bookmark element\n if (null !== $this->bookmark) {\n $quantumViewRequest->appendChild($xml->createElement('Bookmark', $this->bookmark));\n }\n\n // Create the Request element\n $request = $quantumViewRequest->appendChild($xml->createElement('Request'));\n\n $node = $xml->importNode($this->createTransactionNode(), true);\n $request->appendChild($node);\n\n $request->appendChild($xml->createElement('RequestAction', 'QVEvents'));\n\n return $xml->saveXML();\n }", "private function bunqRequestCreate() {\n $bunqRequestId = Helper::BunqService()->makePaymentRequest(\n $this->transactions()->sum('amount'),\n $this->shop_keeper->user->email,\n $this->shop_keeper->name,\n 'Refund.'\n );\n\n $this->update([\n 'bunq_request_id' => $bunqRequestId\n ]);\n\n return $bunqRequestId;\n }", "public function createReceiptShipmentRequest($shop_id, $receipt_id, $tracking_code = null, $carrier_name = null, $send_bcc = null)\n {\n // verify the required parameter 'shop_id' is set\n if ($shop_id === null || (is_array($shop_id) && count($shop_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shop_id when calling createReceiptShipment'\n );\n }\n if ($shop_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$shop_id\" when calling ShopReceiptApi.createReceiptShipment, must be bigger than or equal to 1.');\n }\n\n // verify the required parameter 'receipt_id' is set\n if ($receipt_id === null || (is_array($receipt_id) && count($receipt_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $receipt_id when calling createReceiptShipment'\n );\n }\n if ($receipt_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$receipt_id\" when calling ShopReceiptApi.createReceiptShipment, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/v3/application/shops/{shop_id}/receipts/{receipt_id}/tracking';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shop_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shop_id' . '}',\n ObjectSerializer::toPathValue($shop_id),\n $resourcePath\n );\n }\n // path params\n if ($receipt_id !== null) {\n $resourcePath = str_replace(\n '{' . 'receipt_id' . '}',\n ObjectSerializer::toPathValue($receipt_id),\n $resourcePath\n );\n }\n\n // form params\n if ($tracking_code !== null) {\n $formParams['tracking_code'] = ObjectSerializer::toFormValue($tracking_code);\n }\n // form params\n if ($carrier_name !== null) {\n $formParams['carrier_name'] = ObjectSerializer::toFormValue($carrier_name);\n }\n // form params\n if ($send_bcc !== null) {\n $formParams['send_bcc'] = ObjectSerializer::toFormValue($send_bcc);\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/x-www-form-urlencoded']\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function buildOrderCreateRequest($data)\n\t{\n\t\t$xml = OpenPayU::buildOpenPayURequestDocument($data, 'OrderCreateRequest');\n\t\treturn $xml;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes a Shot Record
public function deleteAction() { // check if logged in $this->verifyUser(); // get record $record = $this->getRecord($this->request->getParam('id')); // if owner if($record->getOwnerId() == $this->auth->getIdentity()->id) { // set as deleted $record->setDeleted(1); $record->save(); // message $this->msg->messages[] = sprintf($this->translate->_("Shot record \"%s\" deleted successfully."), Petolio_Service_Util::Tr($record->getSickness())); // not owner? message } else $this->msg->messages[] = sprintf($this->translate->_("Shot record \"%s\" cannot be deleted. Only the owner of the shot record can delete it."), Petolio_Service_Util::Tr($record->getSickness())); // redirect return $this->_helper->redirector('index', 'shot', 'frontend', array('pet' => $record->getPetId())); }
[ "public function delete($record);", "public function delete()\n {\n $this->_record->delete();\n }", "public function delete() {\r\n\r\n $sql = $this->db->quoteInto(\"o_id = ?\", $this->model->getObjectId());\r\n\r\n // $sql = \"o_id = \" . $this->model->getObjectId();\r\n Logger::debug(\"query= \" . $sql);\r\n $this->db->delete($this->getTableName(), $sql);\r\n }", "public function deletePhoto()\r\n\t{\r\n \t$this->delete(\"photoId = \" . $this->photoId);\r\n\t}", "public function deleteRecord() {\n\t\tif (!GlideUtil::isValidSysID($this->__get(\"sys_id\"))) {\n\t\t\tthrow new GlideRecordException(\"Cannot delete this record (no sys_id - is it a valid record?\");\n\t\t}\n\t\t\n\t\t// Build URL\n\t\t$url = \"table/\".$this->_table_name.\"/\".$this->__get(\"sys_id\");\n\t\t\n\t\t// Use GlideAccess to run the DELETE command \n\t\t// Throw a GlideAccessException or a GlideAuthenticationException on error \n\t\t$result = $this->_access->delete($url);\n\t\t\t\n\t\t// Unset this record from the current result set\n\t\t$this->offsetUnset($this->_data_position);\n\t}", "public function deleted(Share $share)\n {\n //\n }", "public function deleteTrack(): void\n\t{\n\t\tif ($this->track_short_path === null) {\n\t\t\treturn;\n\t\t}\n\t\tStorage::delete($this->track_short_path);\n\t\t$this->track_short_path = null;\n\t\t$this->save();\n\t}", "public function delete(){\r\n\t\t$mysqli = \\Database::Instance()->get();\r\n\r\n\t\t$stmt = $mysqli->prepare(\"DELETE FROM `hotspots` WHERE `id` = ?\");\r\n\t\t$stmt->bind_param(\"i\",$this->id);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->close();\r\n\r\n\t\t\\CacheHandler::deleteFromCache(\"hotspot_\" . $this->id);\r\n\t}", "public function delete(Vote $vote);", "public function delete(){\n $record_id = isset($_POST['record_id'])? $_POST['record_id']:'';\n if($record_id === '')\n return;\n \n $this->record_obj\n ->ready()\n ->delete()\n ->where([\n 'record_id' => $record_id\n ])\n ->go();\n }", "public function delete_photo(){\n $sql=\"DELETE FROM photos WHERE id=\".$this->id;\n self::$connect->query($sql);\n\n }", "public function delete()\r\n {\r\n $db = Loader::db();\r\n $db->delete('btShsGalleriaImages', array('bID' => $this->bID));\r\n $db->delete('btShsGalleriaVideos', array('bID' => $this->bID));\r\n parent::delete();\r\n }", "public function deleted(RideShare $rideShare)\n {\n //\n }", "public function delete($playerid);", "public function deleteById($giftproductId);", "function richmedia_delete_track($userid, $richmediaid) {\r\n global $DB;\r\n $DB->delete_records('richmedia_track', array('userid' => $userid, 'richmediaid' => $richmediaid));\r\n}", "public function delete()\r\n\t{\r\n\t\t$sql = 'DELETE FROM '.static::$_table.' WHERE id=\"'.$this->_obj_id.'\"';\r\n\t\tself::db()->delete($sql);\r\n\t}", "public function deleteTrack(DeleteTrackRequest $request): void\n\t{\n\t\t$request->album()->deleteTrack();\n\t}", "public function delete($hash) {\n\t\t$item = $this->listings_model->get($hash);\n\n\t\t// Abort if the listing does not exist.\n\t\tif($item == FALSE) \n\t\t\tredirect('listings');\n\t\t\t\n\t\t// Delete an items images as well.\n\t\tif($this->listings_model->delete($hash) !== FALSE) {\n\t\t\tif(count($item['images']) > 0) {\n\t\t\t\t// Delete each image.\n\t\t\t\tforeach($item['images'] as $image) {\n\t\t\t\t\t$this->images_model->delete_item_img($hash, $image['hash']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tredirect('listings');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ getHelpIconsDescriptionListCount: which takes 2 arguments and returns the total no. of help icon.
public function getHelpIconsDescriptionListCount($filterValue, $searchText) { try {// method calling... $helpIconsDescriptionListCount = UserHelpManagement::model()->getHelpIconsDescriptionListCount($filterValue, $searchText); } catch (Exception $ex) { Yii::log("SkiptaUserService:getHelpIconsDescriptionListCount::".$ex->getMessage()."--".$ex->getTraceAsString(), 'error', 'application'); } return $helpIconsDescriptionListCount; }
[ "function GetIconCount(){}", "public function count() {\n return count($this->_icons);\n }", "public function getNumberIcons(): int {\n return count($this->getIcons());\n }", "function IconCount() { return 1;}", "public function getHelpfulCount() {\n\t\treturn $this->helpfulCount;\n\t}", "function IconCount() { return 4;}", "public function getDescriptionCount()\n {\n return $this->count(self::DESCRIPTION);\n }", "public function getNumberDescs(): int {\n return count($this->getDescs());\n }", "public function totalIcons()\n {\n return count($this->formats);\n }", "public function getIconSrcCount()\n {\n return $this->count(self::ICON_SRC);\n }", "public function getNumberImages ();", "public function getCmdListListCount()\n {\n return $this->count(self::CMDLISTLIST);\n }", "public function GetNumberOfItemsInList()\n {\n $oWishlistItems = $this->GetFieldPkgShopWishlistArticleList();\n\n return $oWishlistItems->Length();\n }", "function num_staff_icons()\n{\n\t$allowed_icons=0;\n\n\trequire_all_lang();\n\tload_up_all_self_page_permissions(get_member());\n\n\t$hooks=find_all_hooks('systems','do_next_menus');\n\tforeach ($hooks as $hook=>$sources_dir)\n\t{\n\t\t$run_function=extract_module_functions(get_file_base().'/'.$sources_dir.'/hooks/systems/do_next_menus/'.$hook.'.php',array('run'));\n\t\tif (!is_null($run_function[0]))\n\t\t{\n\t\t\t$info=is_array($run_function[0])?call_user_func_array($run_function[0][0],$run_function[0][1]):eval($run_function[0]);\n\n\t\t\tforeach ($info as $i)\n\t\t\t{\n\t\t\t\tif (is_null($i)) continue;\n\t\t\t\tif ($i[0]=='') continue;\n\n\t\t\t\tif (has_actual_page_access(get_member(),$i[2][0],$i[2][2])) $allowed_icons++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $allowed_icons;\n}", "public function get_num_items();", "public function getNumberImages () {}", "public function getHelpWidth()\n {\n return $this->helpWidth;\n }", "function GetToolsCount(){}", "public function getFormattedIconList();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Manager should be able to get index of comments on job poster.
public function testIndexByJobForManager(): void { // Factories. $job = factory(JobPoster::class)->create(); $job->comments()->saveMany(factory(Comment::class, 3)->make(['job_poster_id' => $job->id, 'user_id' => $job->manager->user->id])); // Get comments from job poster. $response = $this->followingRedirects() ->actingAs($job->manager->user) ->json('get', "api/jobs/$job->id/comments"); $response->assertOk(); $expectedComments = Comment::where('job_poster_id', $job->id)->get()->toArray(); $response->assertJson($expectedComments); }
[ "public function testIndexByJobForManager(): void\n {\n // Factories.\n $job = factory(JobPoster::class)->create();\n $job->comments()->saveMany(factory(Comment::class, 3)->make(['job_poster_id' => $job->id, 'user_id' => $job->manager->user->id]));\n\n // Get comments from job poster.\n $response = $this->followingRedirects()\n ->actingAs($job->manager->user)\n ->json('get', \"$this->baseUrl/jobs/$job->id/comments\");\n $response->assertOk();\n $expectedComments = Comment::where('job_poster_id', $job->id)->get()->toArray();\n $response->assertJson($expectedComments);\n }", "public function testIndexByJobFailsForUnauthorizedUser(): void\n {\n // Factories.\n $job = factory(JobPoster::class)->create();\n $job->comments()->saveMany(factory(Comment::class, 3)->make(['job_poster_id' => $job->id, 'user_id' => $job->manager->user->id]));\n\n // Get comments from job poster.\n $response = $this->followingRedirects()\n ->json('get', \"$this->baseUrl/jobs/$job->id/comments\");\n $response->assertStatus(403);\n }", "public function testIndexReturnsJsonResponse()\n {\n // Init models\n $job = Job::factory()->make(['id' => 1]);\n $comments = Comment::factory()->for($job)->count(5)->make();\n\n // Set up mock\n $this->commentRepoMock\n ->shouldReceive('getCommentsByJob')\n ->once()\n ->with($job)\n ->andReturn($comments);\n\n // Test\n $response = $this->commentController->index($job);\n $this->assertInstanceOf(JsonResponse::class, $response);\n $this->assertEquals(\n $response->getData(),\n json_decode($comments->toJson())\n );\n }", "public function getCommentAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t$jobObj=\\Extended\\job::getRowObject($params[\"jobID\"]);\n \t$comment=$jobObj->getComments();\n \t$title=$jobObj->getJob_title();\n \t$resultArr=array(\"title\"=>$title,\"comment\"=>$comment);\n \techo Zend_Json::encode($resultArr);\n \tdie;\n }", "public function getComments() {\n\n $comments = $this->commentController->index();\n return $comments;\n\n }", "public function getQuery()\n {\n return $this->job_comment;\n }", "public function testJobPosterHasManyComments()\n {\n $job_poster = factory(JobPoster::class)->create();\n $comment = factory(Comment::class)->create(['job_poster_id' => $job_poster->id]);\n\n $this->assertInstanceOf('Illuminate\\Database\\Eloquent\\Collection', $job_poster->comments);\n }", "public function jobCommentPost()\n\t{\n\n\t}", "public function getCommentIndex($index, $flags){}", "function GetCommentsByInstanceId() {\r\n\t\t$lCon = new DBCn();\r\n\t\t$lCon->Open();\r\n\t\t$lSql = '\n\t\t\tSELECT spGetDocumentLatestCommentRevisionId(i.document_id, 0) as version_id\n\t\t\tFROM pwt.document_object_instances i\n\t\t\tWHERE i.id = ' . ( int ) $this->m_pubdata ['instance_id'];\r\n\t\t$lCon->Execute($lSql);\r\n\t\t$lVersionId = ( int ) $lCon->mRs ['version_id'];\r\n\t\t\r\n\t\t$lSql = 'SELECT m2.id id,\n\t\t\t\t\t\tm2.document_id document_id,\n\t\t\t\t\t\tm2.root_object_instance_id instance_id,\n\t\t\t\t\t\tm2.author author,\n\t\t\t\t\t\tm2.msg msg,\n\t\t\t\t\t\tm2.rootid rootid,\n\t\t\t\t\t\tm2.subject subject,\n\t\t\t\t\t\tm2.usr_id usr_id,\n\t\t\t\t\t\tm2.lastmoddate lastmoddate,\r\n\t\t\t\t\t\tEXTRACT(EPOCH FROM m2.lastmoddate) as lastmoddate_in_seconds,\n\t\t\t\t\t\tu.photo_id photo_id,\n\t\t\t\t\t\tu.first_name || \\' \\' || u.last_name as fullname,\n\t\t\t\t\t\tm2.mdate mdate,\r\n\t\t\t\t\t\tEXTRACT(EPOCH FROM m2.mdate) as mdate_in_seconds,\n\t\t\t\t\t\tcoalesce(m2.start_object_instances_id, 0) as start_instance_id,\n\t\t\t\t\t\tcoalesce(m2.end_object_instances_id, 0) as end_instance_id,\n\t\t\t\t\t\tcoalesce(m2.start_object_field_id, 0) as start_field_id,\n\t\t\t\t\t\tcoalesce(m2.end_object_field_id, 0) as end_field_id,\n\t\t\t\t\t\tcoalesce(m2.start_offset, 0) as start_offset,\n\t\t\t\t\t\tcoalesce(m2.end_offset, 0) as end_offset,\n\t\t\t\t\t\tm2.is_resolved::int as is_resolved,\n\t\t\t\t\t\tm2.resolve_uid,\n\t\t\t\t\t\tcoalesce(u2.first_name, \\'\\') || \\' \\' || coalesce(u2.last_name, \\'\\') as resolve_fullname,\n\t\t\t\t\t\tm2.resolve_date,\n\t\t\t\t\t\tm2.is_disclosed::int as is_disclosed,\n\t\t\t\t\t\tm2.undisclosed_usr_id,\n\t\t\t\t\t\tuu.name as undisclosed_user_fullname\n\t\t\t\tFROM (SELECT * FROM pwt.spGetVersionRoleFilteredMsgRootIds(' . $lVersionId . ')) m1\n\t\t\t\tJOIN pwt.msg m2 ON (m1.id = m2.rootid)\n\t\t\t\tJOIN usr u ON m2.usr_id = u.id\n\t\t\t\tLEFT JOIN usr u2 ON m2.resolve_uid = u2.id\n\t\t\t\tLEFT JOIN undisclosed_users uu ON uu.id = m2.undisclosed_usr_id\n\t\t\t\tLEFT JOIN usr_titles ut ON ut.id = u.usr_title_id\n\t\t\t\tJOIN pwt.document_object_instances i ON i.id = m2.root_object_instance_id AND m2.revision_id = spGetDocumentLatestCommentRevisionId(i.document_id, 0)\n\t\t\t\tJOIN pwt.document_object_instances p ON p.document_id = i.document_id AND p.pos = substring(i.pos, 1, char_length(p.pos))\n\t\t\t\tWHERE p.id = ' . ( int ) $this->m_pubdata ['instance_id'] . '\n\t\t\t\tORDER BY m2.rootid, m2.ord, m2.mdate';\r\n\t\t// var_dump($lSql);\r\n\t\t$this->comments = new crsgroup(array (\r\n\t\t\t\t'ctype' => 'crsgroup',\r\n\t\t\t\t'sqlstr' => $lSql,\r\n\t\t\t\t'splitcol' => 'rootid',\r\n\t\t\t\t'hideroot' => 1,\r\n\t\t\t\t'preview_can_be_edited' => $this->m_canEditDocument,\r\n\t\t\t\t'preview_is_readonly' => !$this->m_canEditDocument,\r\n\t\t\t\t'in_preview_mode' => ( int ) $this->m_inPreviewMode,\r\n\t\t\t\t'templs' => array (\r\n\t\t\t\t\t\tG_HEADER => 'comments.browseHead',\r\n\t\t\t\t\t\tG_STARTRS => 'comments.browseStart',\r\n\t\t\t\t\t\tG_SPLITHEADER => 'comments.browseSplitHead',\r\n\t\t\t\t\t\tG_ROWTEMPL => 'comments.browseRow',\r\n\t\t\t\t\t\tG_SPLITFOOTER => 'comments.browseSplitFoot',\r\n\t\t\t\t\t\tG_ENDRS => 'comments.browseEnd',\r\n\t\t\t\t\t\tG_FOOTER => 'comments.browseFoot',\r\n\t\t\t\t\t\tG_NODATA => 'comments.browseNoData' \r\n\t\t\t\t) \r\n\t\t));\r\n\t\t$this->comments->GetData();\r\n\t\t$this->m_pubdata ['comments'] = $this->comments->Display();\r\n\t}", "function juicer_get_comment_count() : int {\n\tglobal $juicer_post;\n\n\tif ( ! juicer_in_the_loop() ) {\n\t\t_doing_it_wrong( 'juicer_get_comment_count()', __( 'The function was called outside the Juicer Loop.', 'hm-juicer' ), '0.1.0' );\n\t\treturn 0;\n\t}\n\n\treturn $juicer_post->comments;\n}", "public function getNumberOfComments()\n {\n return count($this->comments);\n \n /*$redis = Yii::$app->redis;\n $key = 'post:'. $this->id .':comments';\n \n return ($redis->get($key)>0)?$redis->get($key):0;*/\n }", "public function getComments()\n {\n // Lets load the data if it doesn't already exist\n if(empty($this->_comments))\n {\n $query = $this->_buildQuery();\n $this->_comments = $this->_getList($query, $this->getStart(), $this->getState('list.limit'));\n\n foreach($this->_comments as $key => $comment)\n {\n if($comment->userid > 0)\n {\n $this->_comments[$key]->cmtname = JHTML::_('joomgallery.displayname', $comment->userid);\n }\n\n $this->_comments[$key]->cmttext = JoomHelper::processText($comment->cmttext);\n }\n }\n\n return $this->_comments;\n }", "public function getCommentsNumber()\n {\n return $this->commentsNumber;\n }", "public function getCommentIndex ($index, $flags = null) {}", "function index_comments($num)\r\n{\r\n $sql = 'SELECT DISTINCT a.id_value,b.goods_id,b.goods_thumb,b.goods_name FROM '. $GLOBALS['ecs']->table('comment') .' AS a,'. $GLOBALS['ecs']->table('goods') .'AS b WHERE a.status = 1 AND a.parent_id = 0 and a.comment_type=0 and a.id_value=b.goods_id'.' ORDER by a.comment_id DESC';\r\n\t\t\t\r\n if ($num > 0)\r\n {\r\n $sql .= ' LIMIT ' . $num;\r\n }\r\n $res = $GLOBALS['db']->getAll($sql);\r\n $comments = array();\r\n foreach ($res AS $idx => $row)\r\n {\r\n $comments[$idx]['id_value'] = $row['id_value'];\r\n\t \r\n\t\t $sqli='SELECT add_time,content,user_name FROM '. $GLOBALS['ecs']->table('comment') .' where id_value='.$row['id_value'].' and status = 1 AND parent_id = 0 and comment_type=0 ORDER by add_time desc';\r\n\t\t $resi = $GLOBALS['db']->getRow($sqli);\r\n\t\t \r\n\t\t $result = mysql_query($sqli);\r\n\t\t $getall = $GLOBALS['db']->num_rows($result);\r\n\r\n\t $comments[$idx]['number'] = $getall;//条数\r\n\t\t $comments[$idx]['add_time'] = date(\"Y年m月d日\",$resi['add_time']);\r\n\t\t $comments[$idx]['content'] = $resi['content'];\r\n\t\t $comments[$idx]['user_name'] = $resi['user_name'];\r\n\t \r\n\t $comments[$idx]['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);\r\n\t $comments[$idx]['goods_name'] = $row['goods_name'];\r\n }\r\n return $comments;\r\n}", "public function comments()\n {\n if (empty($this->params['requested'])) {\n $this->redirect('/');\n }\n\n if (!$this->Access->isAuthorizedToken('/comments/comments/index')) {\n return 'disable';\n }\n $user_id = $this->Auth->user('id');\n $result = $this->Item->find('responsible', array('user' => $user_id));\n $ids = Set::extract($result, '/Item/id');\n $conditions = array('Comment.object_fk' => $ids, 'Comment.object_model' => 'Item', 'Comment.approved' => 0);\n $comments = array();\n\n // $comments = $this->Item->Comment->find('all', compact('conditions'));\n return $comments;\n }", "public function testListPostComments()\n {\n Sanctum::actingAs(InternalUser::factory()->create(), ['*']);\n\n // Cache users first bc of foreign keys\n $this->get('api/user');\n $this->get('api/post');\n\n $id = 3;\n\n $response = $this->get(\"api/post/{$id}/comments\");\n\n $response->assertStatus(200)\n ->assertJsonFragment(['name' => 'aut inventore non pariatur sit vitae voluptatem sapiente']);\n\n $response = $this->get(\"api/post/{$id}/comments\");\n\n $response->assertStatus(200)\n ->assertJsonFragment(['name' => 'aut inventore non pariatur sit vitae voluptatem sapiente']);\n }", "function getSubmitterComments() {\n\t\treturn $this->_SubmitterComments;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The post array for the collectionorders endpoint, the defined parameters are required in the XML, but may be left empty.
public function postCollectionOrders() : array { return [ 'firstname', 'concerning', 'emailaddress1', 'emailaddress2', 'telephone1', 'telephone2', 'address_street', 'address_number', 'address_postcode', 'address_city', 'address_country', 'id_batch', 'return_url', 'invoice.*.invoice_date_due', ]; }
[ "public function postOrder(array $data=[]){\n $this->type='POST';\n $this->path='/fapi/v1/order';\n $this->data=array_merge($this->data,$data);\n return $this->exec();\n }", "public function postBatchOrders(array $data=[]){\n $this->type='POST';\n $this->path='/fapi/v2/batchOrders';\n $this->data=array_merge($this->data,$data);\n return $this->exec();\n }", "protected function postOrderItemCollectionRequest($orderItem = null)\n {\n\n $resourcePath = '/order_items';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($orderItem)) {\n $_tempBody = $orderItem;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html'],\n ['application/ld+json', 'application/json', 'text/csv', 'text/html']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testCreateOrderItemUsingPOST()\n {\n }", "public function listOrders($request);", "public function postCollection();", "protected function ordersV2PostRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling ordersV2Post'\n );\n }\n\n $resourcePath = '/v2/orders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($id !== null) {\n $formParams['Id'] = ObjectSerializer::toFormValue($id);\n }\n // form params\n if ($amount !== null) {\n $formParams['Amount'] = ObjectSerializer::toFormValue($amount);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['CustomerId'] = ObjectSerializer::toFormValue($customer_id);\n }\n // form params\n if ($currency_code !== null) {\n $formParams['CurrencyCode'] = ObjectSerializer::toFormValue($currency_code);\n }\n // form params\n if ($created_utc !== null) {\n $formParams['CreatedUtc'] = ObjectSerializer::toFormValue($created_utc);\n }\n // form params\n if ($vat_amount !== null) {\n $formParams['VatAmount'] = ObjectSerializer::toFormValue($vat_amount);\n }\n // form params\n if ($roundings_amount !== null) {\n $formParams['RoundingsAmount'] = ObjectSerializer::toFormValue($roundings_amount);\n }\n // form params\n if ($delivered_amount !== null) {\n $formParams['DeliveredAmount'] = ObjectSerializer::toFormValue($delivered_amount);\n }\n // form params\n if ($delivered_vat_amount !== null) {\n $formParams['DeliveredVatAmount'] = ObjectSerializer::toFormValue($delivered_vat_amount);\n }\n // form params\n if ($delivered_roundings_amount !== null) {\n $formParams['DeliveredRoundingsAmount'] = ObjectSerializer::toFormValue($delivered_roundings_amount);\n }\n // form params\n if ($delivery_customer_name !== null) {\n $formParams['DeliveryCustomerName'] = ObjectSerializer::toFormValue($delivery_customer_name);\n }\n // form params\n if ($delivery_address1 !== null) {\n $formParams['DeliveryAddress1'] = ObjectSerializer::toFormValue($delivery_address1);\n }\n // form params\n if ($delivery_address2 !== null) {\n $formParams['DeliveryAddress2'] = ObjectSerializer::toFormValue($delivery_address2);\n }\n // form params\n if ($delivery_postal_code !== null) {\n $formParams['DeliveryPostalCode'] = ObjectSerializer::toFormValue($delivery_postal_code);\n }\n // form params\n if ($delivery_city !== null) {\n $formParams['DeliveryCity'] = ObjectSerializer::toFormValue($delivery_city);\n }\n // form params\n if ($delivery_country_code !== null) {\n $formParams['DeliveryCountryCode'] = ObjectSerializer::toFormValue($delivery_country_code);\n }\n // form params\n if ($your_reference !== null) {\n $formParams['YourReference'] = ObjectSerializer::toFormValue($your_reference);\n }\n // form params\n if ($our_reference !== null) {\n $formParams['OurReference'] = ObjectSerializer::toFormValue($our_reference);\n }\n // form params\n if ($invoice_address1 !== null) {\n $formParams['InvoiceAddress1'] = ObjectSerializer::toFormValue($invoice_address1);\n }\n // form params\n if ($invoice_address2 !== null) {\n $formParams['InvoiceAddress2'] = ObjectSerializer::toFormValue($invoice_address2);\n }\n // form params\n if ($invoice_city !== null) {\n $formParams['InvoiceCity'] = ObjectSerializer::toFormValue($invoice_city);\n }\n // form params\n if ($invoice_country_code !== null) {\n $formParams['InvoiceCountryCode'] = ObjectSerializer::toFormValue($invoice_country_code);\n }\n // form params\n if ($invoice_customer_name !== null) {\n $formParams['InvoiceCustomerName'] = ObjectSerializer::toFormValue($invoice_customer_name);\n }\n // form params\n if ($invoice_postal_code !== null) {\n $formParams['InvoicePostalCode'] = ObjectSerializer::toFormValue($invoice_postal_code);\n }\n // form params\n if ($delivery_method_name !== null) {\n $formParams['DeliveryMethodName'] = ObjectSerializer::toFormValue($delivery_method_name);\n }\n // form params\n if ($delivery_method_code !== null) {\n $formParams['DeliveryMethodCode'] = ObjectSerializer::toFormValue($delivery_method_code);\n }\n // form params\n if ($delivery_term_name !== null) {\n $formParams['DeliveryTermName'] = ObjectSerializer::toFormValue($delivery_term_name);\n }\n // form params\n if ($delivery_term_code !== null) {\n $formParams['DeliveryTermCode'] = ObjectSerializer::toFormValue($delivery_term_code);\n }\n // form params\n if ($eu_third_party !== null) {\n $formParams['EuThirdParty'] = ObjectSerializer::toFormValue($eu_third_party);\n }\n // form params\n if ($customer_is_private_person !== null) {\n $formParams['CustomerIsPrivatePerson'] = ObjectSerializer::toFormValue($customer_is_private_person);\n }\n // form params\n if ($order_date !== null) {\n $formParams['OrderDate'] = ObjectSerializer::toFormValue($order_date);\n }\n // form params\n if ($status !== null) {\n $formParams['Status'] = ObjectSerializer::toFormValue($status);\n }\n // form params\n if ($number !== null) {\n $formParams['Number'] = ObjectSerializer::toFormValue($number);\n }\n // form params\n if ($modified_utc !== null) {\n $formParams['ModifiedUtc'] = ObjectSerializer::toFormValue($modified_utc);\n }\n // form params\n if ($delivery_date !== null) {\n $formParams['DeliveryDate'] = ObjectSerializer::toFormValue($delivery_date);\n }\n // form params\n if ($house_work_amount !== null) {\n $formParams['HouseWorkAmount'] = ObjectSerializer::toFormValue($house_work_amount);\n }\n // form params\n if ($house_work_automatic_distribution !== null) {\n $formParams['HouseWorkAutomaticDistribution'] = ObjectSerializer::toFormValue($house_work_automatic_distribution);\n }\n // form params\n if ($house_work_corporate_identity_number !== null) {\n $formParams['HouseWorkCorporateIdentityNumber'] = ObjectSerializer::toFormValue($house_work_corporate_identity_number);\n }\n // form params\n if ($house_work_property_name !== null) {\n $formParams['HouseWorkPropertyName'] = ObjectSerializer::toFormValue($house_work_property_name);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // form params\n if ($shipped_date_time !== null) {\n $formParams['ShippedDateTime'] = ObjectSerializer::toFormValue($shipped_date_time);\n }\n // form params\n if ($rot_reduced_invoicing_type !== null) {\n $formParams['RotReducedInvoicingType'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_type);\n }\n // form params\n if ($rot_property_type !== null) {\n $formParams['RotPropertyType'] = ObjectSerializer::toFormValue($rot_property_type);\n }\n // form params\n if ($persons !== null) {\n $formParams['Persons'] = ObjectSerializer::toFormValue($persons);\n }\n // form params\n if ($reverse_charge_on_construction_services !== null) {\n $formParams['ReverseChargeOnConstructionServices'] = ObjectSerializer::toFormValue($reverse_charge_on_construction_services);\n }\n // form params\n if ($uses_green_technology !== null) {\n $formParams['UsesGreenTechnology'] = ObjectSerializer::toFormValue($uses_green_technology);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function massOrderAction()\n {\n try {\n $api_arr = array(Mage::helper('simple_relevance')->config('apikey'), Mage::helper('simple_relevance')->config('sitename'));\n $api = Mage::getModel('simple_relevance/api', $api_arr);\n $orders = $this->getRequest()->getPost('order_ids', array());\n $orderArray = array();\n\n foreach ($orders as $orderId) {\n $order = Mage::getModel('sales/order')->load($orderId);\n\n if (!$order->getId()) {\n continue;\n }\n\n $purchase = Mage::getModel('simple_relevance/purchase', $order);\n $postData = $purchase->getPostData();\n\n foreach($postData['items'] as $p) {\n $orderArray[] = $p;\n }\n }\n $result = $api->postPurchases($orderArray, true);\n\n if ($api->errorCode) {\n $this->_getSession()->addError($this->__('Error uploading purchases(s) to SimpleRelevance. Email support@simplerelevance.com to let us know.'));\n } else {\n $this->_getSession()->addSuccess($this->__('Purchases(s) have been uploaded to SimpleRelevance.'));\n }\n }\n\n catch (Exception $e) {\n try {\n $api->_log($e->getMessage());\n }\n catch (Exception $e) {\n // do nothing\n }\n $this->_redirect('adminhtml/sales_order/index');\n }\n\n $this->_redirect('adminhtml/sales_order/index');\n }", "public function testCreateAccountOrderBulkUsingPost()\n {\n }", "public function orders() : array\n {\n return $this->_data['orders'];\n }", "public function actionGetOrderItems(){\n $order = OrdersDao::findById($_POST[\"idOrders\"]);\n\n $orderItems = array_map( function($ol) {\n return [\n 'idArticle' => $ol->getArticle()->getId(),\n 'quantity' => $ol->getQuantity(),\n 'unitName' => $ol->getArticle()->getUnit()->getName(),\n 'articleName' => $ol->getArticle()->getDisplayName()\n ];\n }, $order->getOrderLines());\n\n echo json_encode(['id'=>$_POST[\"idOrders\"], 'orderItems' => $orderItems]);\n }", "public function action_setorder(){\n $orders = Arr::get($_POST, 'orders', array());\n foreach($orders as $item_id=>$order)\n $item = ORM::factory($this->_model_name, $item_id)->set($this->_setorder_field, $order)->save();\n// $this->go($this->_crud_uri. URL::query());\n $this->redirect( Request::$current->referrer() );\n }", "public function Action_GetOrders()\n\t{\n\t\tforeach($this->router->request->details as $field => $val) {\n\t\t\tforeach($val as $k => $v) {\n\t\t\t\t$_REQUEST[$k] = (string)$v;\n\t\t\t}\n\t\t}\n\n\t\t$start = 0;\n\t\tif(!empty($_REQUEST['start'])) {\n\t\t\t$start = (int)$_REQUEST['start'];\n\t\t}\n\t\tif(!isset($_REQUEST['noPaging'])) {\n\t\t\t$addLimit = ISC_ORDERS_PER_PAGE;\n\t\t}\n\t\telse {\n\t\t\t$addLimit = false;\n\t\t}\n\n\t\t$orders = GetClass('ISC_ADMIN_ORDERS');\n\t\t$order_grid = $orders->_GetOrderList($start, \"orderid\", \"asc\", $num_orders, $addLimit);\n\t\t$order_array = array();\n\n\t\tif($num_orders > 0) {\n\t\t\twhile($row = $GLOBALS['ISC_CLASS_DB']->Fetch($order_grid)) {\n\t\t\t\tunset($row['extrainfo'], $row['customertoken'], $row['custpassword'], $row['customerpasswordresettoken'], $row['custimportpassword']);\n\t\t\t\t$order_array['item'][] = $row;\n\t\t\t}\n\t\t}\n\n\t\treturn array(\n\t\t\t'start' => $start,\n\t\t\t'end' => min($start + ISC_ORDERS_PER_PAGE, $num_orders),\n\t\t\t'numResults' => $num_orders,\n\t\t\t'results' => $order_array\n\t\t);\n\t}", "public function requestPostParameters(): CollectionUnitList\n {\n $collection = new ParametersCollection($this->postParameters);\n return $collection->getCollection();\n }", "protected function applianceOrdersPostRequest($appliances)\n {\n // verify the required parameter 'appliances' is set\n if ($appliances === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $appliances when calling applianceOrdersPost'\n );\n }\n\n $resourcePath = '/appliance_orders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($appliances !== null) {\n $formParams['appliances'] = ObjectSerializer::toFormValue($appliances);\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getOrderStatusCollectionRequest($name = null, $orderId = null, $orderName = null, $page = null, $itemsPerPage = null)\n {\n\n $resourcePath = '/order_statuses';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($name !== null) {\n $queryParams['name'] = ObjectSerializer::toQueryValue($name);\n }\n // query params\n if ($orderId !== null) {\n $queryParams['order[id]'] = ObjectSerializer::toQueryValue($orderId);\n }\n // query params\n if ($orderName !== null) {\n $queryParams['order[name]'] = ObjectSerializer::toQueryValue($orderName);\n }\n // query params\n if ($page !== null) {\n $queryParams['page'] = ObjectSerializer::toQueryValue($page);\n }\n // query params\n if ($itemsPerPage !== null) {\n $queryParams['itemsPerPage'] = ObjectSerializer::toQueryValue($itemsPerPage);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html'],\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 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 testSalesOrderDocumentTypePOSTRequestDocumentTypesPost()\n {\n }", "protected function createBatchOrdersRequest($order)\n {\n // verify the required parameter 'order' is set\n if ($order === null || (is_array($order) && count($order) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $order when calling createBatchOrders'\n );\n }\n\n $resourcePath = '/spot/batch_orders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($order)) {\n $_tempBody = $order;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $signHeaders = $this->buildSignHeaders('POST', $resourcePath, $query, $httpBody);\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $signHeaders,\n $headers\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function orderdetail_post() {\n\t\t\n\t\tif($this->post('custno')){\n\n\t\t\t$custno = $this->post('custno');\n\t\t\t$orders_object = Orders::ordersService();\n\n\t\t\ttry{\n\t\t\t\t$orderdetail = $orders_object->insertNewOrder(LICENCE, $custno);\n\t\t\t}\n\t\t\tcatch(SoapFault $soapFault){\n\t\t\t\tvar_dump($soapFault);\n \t\techo \"Request :<br>\", htmlentities($orders_object->__getLastRequest()), \"<br>\";\n \t\techo \"Response :<br>\", htmlentities($orders_object->__getLastResponse()), \"<br>\";\n\t\t\t}\n\n\t\t\tif(isset($orderdetail)){\n \t\t$this->response($orderdetail, 201);\n \t\t}\n \t\telse{\n \t\t\t$this->response(array('success' => false, 'error' => 'No data found!'), 404);\n \t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->response(array('success'=>false, 'error'=>'Order custno is missing/invalid'), 400);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Function for Finding user ADS for profiel page Input: Username. Output: Items of the user.
function findUserAds($username) { GLOBAL $connection; GLOBAL $QueryUserAds; $stmt = $connection->prepare($QueryUserAds); $stmt->execute(array($username)); return $stmt->fetchAll(); }
[ "function find_users() {\n\t\tmain()->NO_GRAPHICS = true;\n\t\tif (!$_POST || !main()->USER_ID || IS_ADMIN != 1) {\n\t\t\techo '';\n\t\t}\n\t\t// Continue execution\n\t\t$Q = db()->query(\n\t\t\t\"SELECT id, nick \n\t\t\tFROM \".db('user').\" \n\t\t\tWHERE \"._es($_POST[\"search_field\"]).\" LIKE '\"._es($_POST[\"param\"]).\"%' \n\t\t\tLIMIT \".intval($this->USER_RESULTS_LIMIT));\n\t\twhile($A = db()->fetch_assoc($Q)) {\n\t\t\t$finded_users[$A['id']] = $A['nick'];\n\t\t}\n\t\techo $finded_users ? json_encode($finded_users) : '*';\n\t}", "function search_users($username) {\n\t\n\t$users = array();\n\t\n\t//send the request to instagram and retrieve the response\n\t$url ='https://api.instagram.com/v1/users/search?q=' . $username . '&access_token='. YOUR_TOKEN;\n\t$response = retrieve_values($url);\n\t\n\t//decode the answer\n\t$json = json_decode($response, true);\n\t$datas = $json['data'];\n\tforeach ($datas as $data)\n\tarray_push($users, array(\n\t\t\t'username' => $data['username'],\n\t\t\t'fullname' => $data['full_name'],\n\t\t\t'profile_picture' => $data['profile_picture'],\n\t\t\t'id' => $data['id']\n\t));\n\t\n\treturn $users;\n}", "function searchUser($artist, $connection) {\r\t$results = $connection->get(\"users/search\", array(\"q\" => $artist, \"count\" => \"20\"));\r\t$verifiedFound = false;\r\tfor ($i = 0; $i < count($results); $i++) {\r\t\t$verified = $results[$i]->verified;\r\t\tif ($verified == 1) {\r\t\t\t$accountName = $results[$i]->name;\r\t\t\t$verifiedFound = true;\r\t\t\tbreak;\r\t\t}\r\t}\r\tif ($verifiedFound == true) {\r\t\tparseData($accountName, $connection, 0);\r\t} else {\r\t\t$output = \"<br>Failure<br>\";\r\t\techo $output;\r\t}\r}", "public function get_user_items_by_site($user_name){\n\t return $this->call(\"market/user-items-by-site:\".$user_name);\n }", "public function getUsersItems($user_id);", "public function actionGetadusers()\n {\n\t\tstatic $ldap_cookie='';\n\t\t$params = Yii::$app->request->queryParams;\n\t\t$total_cnt=0;\n\t\t$page=isset($params['page'])?$params['page']:1;\n\t\t$limit=50;\n\t\t\\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n\t\t$out['items'] = array();\n\t\t$out['total_count']=0;\n\t\t$out['pagination']['more']=false;\n\t\t$q=$params['q'];\n\t\t$offset=( ( $page - 1 ) * $limit );\n\t\t$Adusers = ArrayHelper::map(User::find()->where([\"usr_type\"=>'3'])->select(['ad_uid','usr_username'])->all(), 'ad_uid', 'usr_username');\n\t\t$AduserList = array_keys($Adusers);\n\t\t$AduserNameList = array_values($Adusers);\n\t\t//echo \"<pre>\",print_r($Adusers),print_r($AduserList),print_r($AduserNameList),\"</prE>\";die;\n\t\t//$AduserList = ArrayHelper::map(User::find()->where([\"usr_type\"=>'3'])->select(['ad_uid'])->all(), 'usr_username', 'usr_username');\n \t$ldap_users = array();\n\n \t$ldap_data=(new Settings)->ldapsearchWithPagination($ldap_cookie,$q);\n\t\t//echo \"<pre>\",print_r($ldap_data),\"</pre>\";die;\n \tif(!empty($ldap_data))\n \t{\n\t\t\t$info=$ldap_data['info'];\n\t\t\t$ldap_cookie=$info['cookies'];\n\t\t\t$out['total_count']=$info['count'];\n\t\t\tunset($ldap_data['info']);\n \t\tforeach ($ldap_data as $key=>$data)\n \t\t{\n \t\t\t//if(!in_array($key,$AduserList))\n\t\t\t\t{\n\t\t\t\t\tif(isset($data['samaccountname']) && $data['samaccountname']!=\"\"){\n\t\t\t\t\t\tif(!in_array($data['samaccountname'],$AduserNameList)){\n\t\t\t\t\t\t\tif(!in_array($key,$ldap_users)){\n\t\t\t\t\t\t\t\t$ldap_users[$key]=$key;\n\t\t\t\t\t\t\t\t$val=Html::decode($data['cn']);\n\t\t\t\t\t\t\t\t$out['items'][] = ['id' => $data['samaccountname'], 'text' => $val];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(!in_array($key,$ldap_users)){\n\t\t\t\t\t\t\t$ldap_users[$key]=$key;\n\t\t\t\t\t\t\t$val=Html::decode($data['cn']);\n\t\t\t\t\t\t\t$out['items'][] = ['id' => $key, 'text' => $val];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \t}\n \t/*$AduserList = ArrayHelper::map(User::find()->where([\"usr_type\"=>'3'])->select(['ad_uid'])->all(), 'ad_uid', 'ad_uid');\n \t$ldap_users = array();\n\n \t$ldap_data=(new Settings)->ldapsearch();\n \t//echo \"<pre>\",print_r($ldap_data),\"</pre>\";die;\n \tif(!empty($ldap_data))\n \t{\n \t\tforeach ($ldap_data as $key=>$data)\n \t\t{\n \t\t\tif(!in_array($key,$AduserList))\n \t\t\t\t$ldap_users[$key]=$data['cn'];\n \t\t}\n \t}*/\n \tif($out['total_count'] > 0 && ($page * $limit) < $out['total_count']){\n\t\t\t$out['pagination']['more']=true;\n\t\t}\n\t\treturn $out;\n \t//echo json_encode($ldap_users);\n \t//die;\n }", "private function readAllUsers()\n\t{\n\t\t// Build search base\n\t\tif(($dn = $this->settings->getSearchBase()) && substr($dn,-1) != ',')\n\t\t{\n\t\t\t$dn .= ',';\n\t\t}\n\t\t$dn .=\t$this->settings->getBaseDN();\n\t\t\n\t\t// page results\n\t\t$filter = $this->settings->getFilter();\n\t\t$page_filter = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','-');\n\t\t$chars = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');\n\t\t\n\t\tforeach($page_filter as $letter)\n\t\t{\n\t\t\t$new_filter = '(&';\n\t\t\t$new_filter .= $filter;\n\t\t\t\n\t\t\tswitch($letter)\n\t\t\t{\n\t\t\t\tcase '-':\n\t\t\t\t\t$new_filter .= ('(!(|');\n\t\t\t\t\tforeach($chars as $char)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_filter .= ('('.$this->settings->getUserAttribute().'='.$char.'*)');\n\t\t\t\t\t}\n\t\t\t\t\t$new_filter .= ')))';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$new_filter .= ('('.$this->settings->getUserAttribute().'='.$letter.'*))');\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->log->write(__METHOD__.': Searching with ldap search and filter '.$new_filter.' in '.$dn);\n\t\t \t$res = $this->queryByScope($this->settings->getUserScope(),\n\t\t \t\t$dn,\n\t \t\t\t$new_filter,\n\t\t\t\tarray($this->settings->getUserAttribute()));\n\n\t\t\t$tmp_result = new ilLDAPResult($this->lh,$res);\n\t\t\tif(!$tmp_result->numRows())\n\t\t\t{\n\t\t\t\t$this->log->write(__METHOD__.': No users found. Aborting.');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->log->write(__METHOD__.': Found '.$tmp_result->numRows().' users.');\n\t\t\tforeach($tmp_result->getRows() as $data)\n\t\t\t{\n\t\t\t\tif(isset($data[$this->settings->getUserAttribute()]))\n\t\t\t\t{\n\t\t\t\t\t$this->readUserData($data[$this->settings->getUserAttribute()],false,false);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->log->write(__METHOD__.': Unknown error. No user attribute found.');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($tmp_result);\n\t\t}\n\t\treturn true;\n\t}", "public function listOwnItems(){\n $userId = $_SESSION['userID'];\n $item = new Item();\n $data=$item->listOwnItems($userId);\n }", "public function getUserList(){\n\t\t\t$query = ParseUser::query();\n\t\t\t$query->exists(\"username\");\n\t\t\t$query->notEqualTo(\"objectId\",$_SESSION['userId']);\n\t\t\t$results = $query->find();\n\n\t\t\treturn $results;\n\t\t}", "public function getAwardsByUser($db, $user){ \n $query = \"SELECT * FROM awards_report_page WHERE user= :user\";\n $pdostm = $db->prepare($query);\n $pdostm->bindValue(':make', $user, \\PDO::PARAM_STR);\n $pdostm->execute();\n $s = $pdostm->fetchAll(PDO::FETCH_OBJ);\n return $s;\n }", "abstract public static function get_displayusernames();", "public function getUsers() {\n $SQL_SELECT_ALL = \"SELECT username FROM User\";\n $rows = array();\n $users = \"\";\n $result = $this -> query($SQL_SELECT_ALL);\n if($result === false) {\n return false;\n }\n while ($row = $result -> fetch_assoc()) {\n $fullun = $row[\"username\"];\n $shortun = $this->shorten($fullun, 17);\n $users .= \"<a keyword='\" . $fullun . \"' class='username-link'>\" . $shortun . \"</a>\";\n }\n return $users;\n }", "public function userList() {\n try {\n // Prepare statement to search for all infos of all users\n $stmt = self::$_database->prepare('SELECT `id`,`name`,`damages`,`asleep_for`,`type`,`special` FROM `user`');\n // If the execute() return true, fetch all informations in associative array\n if ($stmt->execute()){\n $data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n // If the data was found\n if ($data !== false){\n foreach ($data as $dataKey => $user){\n foreach ($user as $key => $value) {\n // Make sure numbers are of the type Number\n if (is_numeric($value)) { $user[$key] = intval($value); }\n }\n $data[$dataKey] = $user;\n }\n }\n return $data;\n } else { return false; }\n } catch (PDOException $e) { return $e->getMessage(); }\n }", "static function getUserItems() {\n\t\t$id = Users::getUser();\n\t\t\n\t\t$id = parent::escape($id, \"sql\");\n\t\t\n\t\t$data = parent::query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM `user_objects`\n\t\t\t\t\t\t\t\tWHERE `user_id` = '$id'\n\t\t\t\t\t\t\t\tAND `approve` = '1'\n\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t\n\t\treturn $data;\n\t}", "function meals_by_username($username) {\n $query = '\n SELECT * FROM meal \n\t\tJOIN accounts USING (accountID)\n WHERE accounts.username = :username\n\t\tORDER BY meal.favorited DESC';\n $bindStr = array(':username');\n\t$bindVar = array($username);\n return complete_fetch($query, $bindStr, $bindVar);\n}", "function show()\n {\n \t$this->out->elementStart('ol', array('id' => 'users'));\n \t\n $cnt = 0;\n while ($this->profiles->fetch()) {\n $cnt++;\n \n if($cnt > PROFILES_PER_PAGE) {\n break;\n }\n \n $this->out->elementStart('li', array('class' => 'user', 'pid' => $this->profiles->id));\n $this->showAvatar($this->profiles);\n $this->showNickname($this->profiles);\n $this->showInfos($this->profiles);\n $this->out->elementStart('div', 'op');\n $this->showOperations($this->profiles);\n $this->out->elementEnd('div');\n $this->out->elementEnd('li');\n }\n \n $this->out->elementEnd('ol');\n \n return $cnt;\n }", "function getUserUrls(){\n\n $url = 'https://swgoh.gg/g/3532/r2-destroyers/';\n\n $html = file_get_html($url);\n\n $items = $html->find('tr');\n $users = array();\n\n //echo htmlspecialchars($items[0]->children(0)->plaintext);\n\n foreach($items as $item){\n if ($item->children(0)->plaintext == 'Name'){\n continue;\n }\n //echo htmlspecialchars($item->children(0)->children(0)->href) . \"<br>\";\n //array_push($users, 'https://swgoh.gg' . $item->children(0)->children(0)->href . 'collection/');\n $user = $item->children(0)->children(0)->plaintext;\n $profile = $item->children(0)->children(0)->href;\n $users[$user] = $profile;\n }\n return $users;\n}", "public function getRecordsByUserAcct($userid,$page) {\n\t$finds = $this->getAdapter();\n\t$select = $finds->select()\n\t\t->from($this->_name, array('objecttype', 'broadperiod', 'id',\n\t\t'old_findID', 'description', 'secwfstage'))\n\t\t->joinLeft('people','finds.finderID = people.secuid', array())\n\t\t->joinLeft('findspots','findspots.findID = finds.secuid', array('county'))\n\t\t->joinLeft('finds_images','finds.secuid = finds_images.find_id', array()) \n\t\t->joinLeft('slides','slides.secuid = finds_images.image_id', array('i' => 'imageID','f' => 'filename')) \n\t\t->joinLeft('users','users.id = finds.createdBy', array('username','imagedir'))\t\t\t\n\t\t->where('people.dbaseID = ?' , $userid)\n\t\t->group('finds.id');\n\tif(in_array($this->getRole(),$this->_restricted)){\n\t$select->where('finds.secwfstage > ?', (int)2);\n\t}\n\t$paginator = Zend_Paginator::factory($select);\n\t$paginator->setItemCountPerPage(10) \n\t\t->setPageRange(20);\n\tif(isset($page) && ($page != \"\")) {\n\t$paginator->setCurrentPageNumber((int)$page); \n\t}\n\treturn $paginator;\t\t \n\t}", "function svc_getProfilesByUsername($search, $staffonly){\n\n\tglobal $db, $debug;\n\n\t$searchquery = \"%\".$search.\"%\";\n\t$query = \"SELECT p.prof_first_name, p.prof_last_name, p.prof_main_character, p.prof_catchphrase, a.user_username, a.user_type, r.rank_consec_games \n\tFROM user_profile p \n\tINNER JOIN user_authentication a on p.UUID = a.UUID \n\tINNER JOIN user_ranking r on r.UUID = p.UUID \n\tWHERE a.user_locked in (0, 1, 4) \";\n\n\tif ($staffonly){\n\t\t$query .= \" AND (a.user_type BETWEEN 2 AND 4)\";\n\t} else {\n\t\t$query .= \" AND (a.user_type BETWEEN 1 AND 4)\";\n\t}\n\n\tif ($search != null){\n\t\t$query .= \" AND (a.user_username LIKE '$searchquery' OR p.prof_first_name LIKE '$searchquery' OR p.prof_last_Name LIKE '$searchquery')\";\n\t}\n\n\t$query .= \" ORDER BY a.user_username ASC\";\n\n\t$result = mysqli_query($db, $query);\n\twriteLog(TRACE, \"Directory query = \".$query);\n\n\tif (!$result){\n\t\twriteLog(SEVERE, \"getProfilesByUsername FAILED with search=\".$search.\", staffonly=\".$staffonly);\n\t\twriteLog(SEVERE, \"Query: \".$query);\n\t\twriteLog(SEVERE, \"MySQL Error: \".mysqli_error($db));\n\t} else {\n\t\twriteLog(DEBUG, \"getProfilesByUsername called with search=\".$search.\", staffonly=\".$staffonly);\n\t}\n\n\treturn $result;\n\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method called to associate a ChildUserWebsite object to this object through the ChildUserWebsite foreign key attribute.
public function addUserWebsite(ChildUserWebsite $l) { if ($this->collUserWebsites === null) { $this->initUserWebsites(); $this->collUserWebsitesPartial = true; } if (!$this->collUserWebsites->contains($l)) { $this->doAddUserWebsite($l); if ($this->userWebsitesScheduledForDeletion and $this->userWebsitesScheduledForDeletion->contains($l)) { $this->userWebsitesScheduledForDeletion->remove($this->userWebsitesScheduledForDeletion->search($l)); } } return $this; }
[ "function wp_sub_add_user_to_site( int $user_id, int $site_id ) : bool {\n\tif ( ! get_site( $site_id ) instanceof WP_Site ) {\n\t\treturn false;\n\t}\n\n\tif ( wp_sub_user_exists_on_site( $user_id, $site_id ) ) {\n\t\treturn false;\n\t}\n\n\treturn boolval( add_user_meta( $user_id, \\WP_SUB\\WP_Separate_User_Base::SITE_META_KEY, $site_id ) );\n}", "public function insert($accountId, $webPropertyId, Google_Service_Analytics_EntityUserLink $postBody, $optParams = array())\n {\n $params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Google_Service_Analytics_EntityUserLink\");\n }", "public function website()\n {\n return $this->belongsTo(Website::class);\n }", "public function website()\n {\n return $this->belongsTo(Website::class, 'website_id');\n }", "public function websites()\n {\n return $this->belongsToMany('App\\Models\\Website','merchantwebsite','merchant_id','website_id');\n }", "protected function _associateUserModel() {\n\t\t$userClass = Configure::read('App.UserClass');\n\t\tif (empty($userClass)) {\n\t\t\t$userClass = 'User';\n\t\t}\n\n\t\t$this->belongsTo['User'] = array(\n\t\t\t'className' => $userClass,\n\t\t\t'foreignKey' => 'user_id'\n\t\t);\n\t}", "public function add_user_to_object($object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post', $unique = \\false)\n {\n }", "public function save($force_create = FALSE)\n {\n parent::save($force_create);\n // Link property to selected sections\n Model::fly('Model_UserPropUser')->link_userprop_to_users($this, $this->userprops);\n }", "public function websites()\n {\n return $this->hasMany('App\\Website');\n }", "public function add_sites_to_user($user_id) {\n $data = array();\n $sites = $this->input->post('sites');\n if (is_array($sites)) {\n foreach ($sites as $site_id) {\n if ($site_id == 'none') {\n continue;\n }\n // Non-Official site\n if ($site_id == 'other') {\n $site_id = $this->get_site_by_name_or_create($this->input->post('new_site'));\n }\n\n $data[] = array('user_id' => $user_id,\n 'site_id' => $site_id);\n }\n if (count($data)) {\n $this->db->insert_batch('users2sites', $data);\n }\n }\n }", "public function\t\taddWebsite() {\n\t\t\t\n\t\t}", "public function addTo(User $user) {\n $existUserPrize = UsersPrizes::findOne([\n 'user_id' => $user->id,\n 'prize_id' => $this->prizeData['data']['id']\n ]);\n\n if(!$existUserPrize){\n $newPrizeLink = new UsersPrizes();\n $newPrizeLink->user_id = $user->id;\n $newPrizeLink->prize_id = $this->prizeData['data']['id'];\n $newPrizeLink->num++;\n if(!$newPrizeLink->save()) {\n // @TODO Do something exceptional\n }\n } else {\n $existUserPrize->num++;\n if(!$existUserPrize->save()) {\n // @TODO Do something exceptional\n }\n }\n }", "public function websites()\n {\n return $this->hasMany(Website::class);\n }", "public function addLinkage($company_id, $user_id);", "public function onUserAddToSightVisit(AddUserToSightVisitEvent $args)\n {\n $user = $args->getTokenStorage()->getToken()->getUser();\n $sightVisit = $args->getSightVisit();\n\n $sightVisit->setUser($user);\n }", "public function addUser($webId)\n {\n $acModelUri = $this->_acModelUri;\n $store = $this->_store;\n\n // Only add the user if allowed...\n if (!Erfurt_App::getInstance()->getAc()->isActionAllowed('RegisterNewUser')) {\n return false;\n }\n\n // Does user already exist?\n $users = Erfurt_App::getInstance()->getUsers();\n if (isset($users[$webId])) {\n return false;\n }\n\n $actionConfig = Erfurt_App::getInstance()->getActionConfig('RegisterNewUser');\n\n $foafData = $this->_getFoafData($webId);\n if (isset($foafData[$webId][EF_RDF_TYPE][0]['value'])) {\n if ($foafData[$webId][EF_RDF_TYPE][0]['value'] === 'http://xmlns.com/foaf/0.1/OnlineAccount' ||\n $foafData[$webId][EF_RDF_TYPE][0]['value'] === 'http://xmlns.com/foaf/0.1/Person') {\n\n // Look for label, email\n if (isset($foafData[$webId]['http://xmlns.com/foaf/0.1/mbox'][0]['value'])) {\n $email = $foafData[$webId]['http://xmlns.com/foaf/0.1/mbox'][0]['value'];\n }\n if (isset($foafData[$webId]['http://xmlns.com/foaf/0.1/name'][0]['value'])) {\n $label = $foafData[$webId]['http://xmlns.com/foaf/0.1/name'][0]['value'];\n } else if (isset($foafData[$webId][EF_RDFS_LABEL][0]['value'])) {\n $label = $foafData[$webId]['http://xmlns.com/foaf/0.1/name'][0]['value'];\n }\n }\n }\n\n // uri rdf:type sioc:User\n $store->addStatement(\n $acModelUri,\n $webId,\n EF_RDF_TYPE,\n array(\n 'value' => $this->_uris['user_class'],\n 'type' => 'uri'\n ),\n false\n );\n\n if (!empty($email)) {\n // Check whether email already starts with mailto:\n if (substr($email, 0, 7) !== 'mailto:') {\n $email = 'mailto:' . $email;\n }\n\n // uri sioc:mailbox email\n $store->addStatement(\n $acModelUri,\n $userUri,\n $this->_config->ac->user->mail,\n array(\n 'value' => $email,\n 'type' => 'uri'\n ),\n false\n );\n }\n\n if (!empty($label)) {\n // uri rdfs:label $label\n $store->addStatement(\n $acModelUri,\n $userUri,\n EF_RDFS_LABEL,\n array(\n 'value' => $label,\n 'type' => 'literal'\n ),\n false\n );\n }\n\n if (isset($actionConfig['defaultGroup'])) {\n $store->addStatement(\n $acModelUri,\n $actionConfig['defaultGroup'],\n $this->_uris['group_membership'],\n array(\n 'value' => $webId,\n 'type' => 'uri'\n ),\n false\n );\n }\n\n return true;\n }", "private function assign_user_to_wbs() {\n WbsUser::updateAll(['status' => 0], \"wbs_id =\" . $this->model_wbs->id);\n if (!empty($this->form_model_wbs->wbsuser)) {\n foreach ($this->form_model_wbs->wbsuser as $user_id) {\n $wbs_user_model = WbsUser::find()->where(['user_id' => $user_id, 'wbs_id' => $this->model_wbs->id])->one();\n if (empty($wbs_user_model)) {\n $wbs_user_model = new \\app\\models\\WbsUser();\n //$wbs_user_model->availability = $this->model_wbs->check_availability;\n } else {\n //$wbs_user_model->availability = $this->model_wbs->check_availability;\n }\n\n $wbs_user_model->wbs_id = $this->model_wbs->id;\n $wbs_user_model->user_id = $user_id;\n $wbs_user_model->status = Wbs::STATUS_WBS_USER_ACTIVE;\n if ($wbs_user_model->save()) {\n\n } else {\n\n }\n }\n } \n }", "public function saveChild($id_child = 0)\n {\n $user_child = new UserChild();\n $user_child->user_id = Yii::app()->user->id;\n $user_child->user_child_id = $id_child;\n $user_child->save();\n }", "public function attachUser() {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test ajax add favorite with no existing catalog
public function testAjaxAddFavoriteNotExistingCatalog() { $id = $this->getNotExistingID('Catalog'); $post_data = array( 'id' => $id, 'type' => 'catalog' ); $response = $this->ajax_post('favorites/add', $post_data); $this->assertEquals('200', $response->foundation->getStatusCode()); $content = $response->content; $this->assertContains('"status":"Error"', $content); $this->assertContains('errors', $content); }
[ "public function testAjaxAddFavoriteCourse() {\n $post_data = array(\n 'id' => $this->course->id,\n 'type' => 'course'\n );\n $response = $this->ajax_post('favorites/add', $post_data);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $content = $response->content;\n $this->assertContains('\"status\":\"Ok\"', $content);\n\n //Check if favorite is saved\n $id = $this->course->catalog()->first()->id;\n $check = $this->isSavedAsFavorite($id);\n $this->assertTrue($check);\n }", "public function testAjaxAddFavoriteWithNoValidType() {\n $post_data = array(\n 'id' => '1',\n 'type' => 'question'\n );\n $response = $this->ajax_post('favorites/add', $post_data);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $content = $response->content;\n $this->assertContains('\"status\":\"Error\"', $content);\n $this->assertContains('errors', $content);\n }", "private function addFavorite()\n {\n try\n {\n $request = $_POST;\n\n if (!isset($request['type'])) {\n throw_error_msg(\"Type not provided\");\n }\n\n if ($request['type'] == 'video' || $request['type'] == 'collection') {\n //check if video id provided\n if( !isset($request['type_id']) || $request['type_id']==\"\" )\n throw_error_msg(\"type_id not provided.\");\n\n if( !is_numeric($request['type_id']) )\n throw_error_msg(\"invalid type_id\");\n\n $type_id = mysql_clean($request['type_id']);\n if ($request['type'] == 'video') {\n global $cbvid;\n $cbvid->action->add_to_fav($type_id);\n }\n\n if ($request['type'] == 'collection') {\n global $cbcollection;\n $cbcollection->action->add_to_fav($type_id);\n }\n \n }\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n { \n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'added to favorites', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function testAddProductToFavorite()\n {\n $data = [\n 'favoriteable_id' => ($product = Product::first())->id,\n 'favoriteable_type' => get_class($product)\n ];\n\n $this->addFavorite($data)\n ->assertRedirect();\n\n $this->assertNotNull(auth()->user()->favorites()->where($data)->get());\n }", "public function testAjaxRemoveFavoriteWithNoValidType() {\n $post_data = array(\n 'id' => '1',\n 'type' => 'question'\n );\n $response = $this->ajax_post('favorites/remove', $post_data);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $content = $response->content;\n $this->assertContains('\"status\":\"Error\"', $content);\n $this->assertContains('errors', $content);\n }", "public function actionAddFavourite()\n {\n $post = \\Yii::$app->request->post();\n $storeOwner = \\Yii::$app->user->getIdentity()->storeOwner;\n $storeOwnerId = $storeOwner->id;\n $driver = Driver::findOne($post['driverId']);\n if (!$driver || $driver->favouriteForStoreOwner($storeOwnerId)) {\n return Json::encode([\n 'success' => false\n ]);\n }\n $storeOwner->addFavouriteDriver($driver->id);\n return Json::encode([\n 'success' => true\n ]);\n }", "public function testFavoritesList()\n {\n }", "public function testAddFavorite()\n {\n }", "public function testListFavorites()\n {\n }", "public function ajax_variation_exist() {\n if ( isset( $_POST['product_id'] ) && isset( $_POST['variation_id'] ) ) {\n\n $message = '';\n $return = $this->exists( $_POST['product_id'], $_POST['variation_id'] );\n if ( $return == 'true' ) {\n $message = apply_filters( 'yith_ywraq_product_already_in_list_message', __( 'Product already in the list.', 'yith-woocommerce-request-a-quote' ) );\n }\n\n wp_send_json(\n array(\n 'result' => $return,\n 'message' => $message,\n 'label_browse' => ywraq_get_browse_list_message(),\n 'rqa_url' => $this->get_raq_page_url(),\n )\n );\n }\n }", "public function ajax_add_favourite()\r\n {\r\n try\r\n {\r\n\t\t\t$property_id= $this->input->post('property_id');\t\t\t\r\n\t\t\t$user_id \t= decrypt($this->data[\"loggedin\"][\"user_id\"]);\r\n\t\t\t$info \t= $this->mod_rect->fetch_this($property_id); \r\n\t\t\tif(!empty($this->data[\"loggedin\"]))\r\n\t\t\t{\r\n\t\t\tif($info[\"i_owner_user_id\"] == $user_id)\r\n\t\t\t{\r\n\t\t\t\t//$this->session->set_userdata(array('message'=>$this->cls_msg[\"owner_err\"],'message_type'=>'err'));\r\n\t\t\t\t//redirect(base_url().'property/details/'.encrypt($property_id));\r\n\t\t\t\techo 'owner_error';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$s_where = \" WHERE f.i_property_id = \".$property_id.\" AND f.i_user_id = \".$user_id.\" \";\r\n\t\t\t\t$i_favourite_count = $this->mod_rect->count_favourite_exist($s_where);\r\n\t\t\t\tif($i_favourite_count>0)\r\n\t\t\t\t{\r\n\t\t\t\t\t//$this->session->set_userdata(array('message'=>$this->cls_msg[\"exist_err\"],'message_type'=>'err'));\r\n\t\t\t\t\t//redirect(base_url().'property/details/'.encrypt($property_id));\r\n\t\t\t\t\techo 'exist';\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$s_table = $this->db->FAVOURITES;\r\n\t\t\t\t\t$arr\t = array();\r\n\t\t\t\t\t$arr[\"i_user_id\"]\t\t=\t$user_id;\r\n\t\t\t\t\t$arr[\"i_property_id\"]\t=\t$property_id;\r\n\t\t\t\t\t$arr[\"dt_created_on\"]\t=\ttime();\r\n\t\t\t\t\t$this->load->model('common_model','mod_common');\r\n\t\t\t\t\t$i_favourite = $this->mod_common->common_add_info($s_table,$arr);\t\r\n\t\t\t\t\tif($i_favourite)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//$this->session->set_userdata(array('message'=>$this->cls_msg[\"fav_succ\"],'message_type'=>'succ'));\r\n\t\t\t\t\t\t//redirect(base_url().'property/details/'.encrypt($property_id));\r\n\t\t\t\t\t\techo 'ok';\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo 'login_error';\r\n\t\t\t}\r\n \r\n unset($s_table,$arr,$s_where,$i_favourite_count,$i_favourite,$info,$user_id,$property_id);\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n }\r\n }", "function addconfig_to_favoritesAction()\n\t{\n\t\t$session = Mage::getSingleton('customer/session');\n\t\t $this->_customerId = $session->getCustomer()->getId();\n\t\t $list = Mage::getModel('amlist/list');\n\t \t $listId = $this->getRequest()->getParam('list');\n\t\t $post = $this->getRequest()->getPost();\n\t\t $products = $post['product'];\n\t\t if (!$listId){ //get default - last\n\t $listId = Mage::getModel('amlist/list')->getLastListId($this->_customerId);\n\t \t }\n\t \t if (!$listId) { //create new\n\t Mage::getSingleton('amlist/session')->setAddProductId($post['selected_productid']);\n\t $this->_redirect('amlist/list/edit/');\n\t return;\n\t }\n\t\n\t\t\n\t\t\n\t\t\tif($post['selected_productid'])\n\t\t\t{\n\t\t\t\tforeach($products as $_product){\n\t\t\t\t\tif($post['selected_productid']==$_product[product]):\n\t\t\t\t\t\t$item = Mage::getModel('amlist/item')\n\t\t\t\t\t\t->setProductId($_product[product])\n\t\t\t\t\t\t->setListId($listId) \n\t\t\t\t\t\t->setQty($_product[qty])\n\t\t\t\t\t\t->setBuyRequest(serialize($_product));\n\t\t\t\t\t\t$item->save();\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t}\n\t\t\t\t Mage::getSingleton('core/session')->addSuccess($this->__('Product has been successfully added to the folder.'));\n\t\t\t\t $this->_redirectReferer();\n\t\t\t\t \n\t\t\t}\n\t\n\t}", "public function make_product_favorite_post() {\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $special_id = (int)$this -> post('special_id') ? (int)$this -> post('special_id') : 0;\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n\n $result = $this -> productmodel -> make_product_favorite($user_id, $product_id, $special_id);\n\n if ($result == 'ADD') {\n $message = \"Product added to favourite list\";\n $favorite_status = \"1\";\n }\n else {\n $message = \"Product removed from favourite list\";\n $favorite_status = \"0\";\n }\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['is_favorite'] = $favorite_status;\n $retArr['message'] = $message;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n $retArr['status'] = FAIL;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n }", "public function testAddProductToFavoriteWithInvalidProductId()\n {\n $data = [\n 'favoriteable_id' => ($product = Product::first())->id + 11,\n 'favoriteable_type' => get_class($product)\n ];\n\n $this->addFavorite($data)\n ->assertJsonStructure([\n 'message',\n 'errors' => [\n 'favoriteable_id'\n ]\n ]);\n }", "public static function add_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if ( ! empty( $_GET['id'] ) ) {\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n $favorites = ! is_array( $favorites ) ? array() : $favorites;\n\n if ( empty( $favorites ) ) {\n $favorites = array();\n }\n\n $post = get_post( $_GET['id'] );\n $post_type = get_post_type( $post->ID );\n\n if ( 'property' != $post_type ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'This is not property ID.', 'realia-favorites' ),\n );\n } else {\n $found = false;\n\n foreach ( $favorites as $property_id ) {\n if ( $property_id == $_GET['id']) {\n $found = true;\n break;\n }\n }\n\n if ( ! $found ) {\n $favorites[] = $post->ID;\n update_user_meta( get_current_user_id(), 'favorites', $favorites );\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property is already in list', 'realia-favorites' ),\n );\n }\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property ID is missing.', 'realia-favorites' ),\n );\n }\n\n echo json_encode( $data );\n exit();\n }", "public function add_favorite_product(Request $request)\n {\n $user = User::where('api_token', $request->api_token)->first();\n $product = Product::where('id',$request->product_id)->first();\n $user_id = $user->id;\n if(FavoriteProduct::where('user_id', '=', $user_id)->where('product_id','=',$request->product_id)->exists()){\n return response()->json(['code' =>0,\"data\"=>'You already added product'.' '.$product->name.' '. 'to your favorite'], 401);\n\n }\n else{\n \n $data = [\n 'product_id' => $product->id,\n 'user_id' => $user_id\n ];\n $favorite = FavoriteProduct::create($data);\n return response()->json(['code' => 1,\"data\"=>'Product'.' '.$product->name.' '.'is added successfully to favorite'], 200);\n }\n }", "public function testFavoriteView() {\n Sentry::logout();\n $response = $this->get('favorites/learning');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function addFavouriteVideos()\n {\n $this->setRules(['video_slug' => 'required']);\n if ($this->_validate()) {\n $date = $this->_favouriteVideo->freshTimestamp();\n $video_slug = $this->request->video_slug;\n $selectedVideoID = Video::where($this->getKeySlugorId(), $video_slug)->value('id');\n if ($selectedVideoID) {\n try { \n $existingvideo = $this->_favouriteVideo->where('customer_id',authUser()->id)->where('video_id',$selectedVideoID)->first(); \n if($existingvideo)\n {\n $favorite = $this->_favouriteVideo->where('customer_id',authUser()->id)->where('video_id',$selectedVideoID)->first();\n } else {\n $favorite = $this->_favouriteVideo; \n } \n $favorite->customer_id = auth()->user()->id; \n $favorite->video_id = $selectedVideoID;\n $favorite->created_at = $date;\n $favorite->save();\n return true; \n \n }\n catch (\\Exception $e)\n {\n return false;\n }\n } else {\n return false;\n }\n }\n }", "public function onAddFavorite() {\n try {\n if (!$user = $this->user()) {\n return;\n }\n\n $eventId = (int)post('id');\n\n FavoriteModel::create([\n 'user_id' => $user->id,\n 'event_id' => $eventId\n ]);\n\n $this->page['event'] = EventModel::findOrFail($eventId);\n $this->page['user'] = $user;\n\n Flash::success(Lang::get('klubitus.calendar::lang.favorite.added'));\n } catch (Exception $e) {\n Flash::error(Lang::get('klubitus.calendar::lang.favorite.add_failed'));\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add YWRFD post type
public function add_ywrfd_post_type() { $labels = array( 'name' => _x( 'Review Discounts', 'Post Type General Name', 'yith-woocommerce-review-for-discounts' ), 'singular_name' => _x( 'Review Discount', 'Post Type Singular Name', 'yith-woocommerce-review-for-discounts' ), 'add_new_item' => __( 'Add New Review Discount', 'yith-woocommerce-review-for-discounts' ), 'add_new' => __( 'Add Review Discount', 'yith-woocommerce-review-for-discounts' ), 'new_item' => __( 'New Review Discount', 'yith-woocommerce-review-for-discounts' ), 'edit_item' => __( 'Edit Review Discount', 'yith-woocommerce-review-for-discounts' ), 'view_item' => __( 'View Review Discount', 'yith-woocommerce-review-for-discounts' ), 'search_items' => __( 'Search Review Discount', 'yith-woocommerce-review-for-discounts' ), 'not_found' => __( 'Not found', 'yith-woocommerce-review-for-discounts' ), 'not_found_in_trash' => __( 'Not found in Trash', 'yith-woocommerce-review-for-discounts' ), ); $args = array( 'labels' => $labels, 'supports' => array( 'title' ), 'hierarchical' => false, 'public' => false, 'show_ui' => true, 'menu_position' => 10, 'show_in_nav_menus' => false, 'has_archive' => true, 'exclude_from_search' => true, 'menu_icon' => 'dashicons-awards', 'capability_type' => 'ywrfd-discount', 'capabilities' => $this->get_capabilities(), 'map_meta_cap' => true, 'rewrite' => false, 'publicly_queryable' => false, 'query_var' => false, ); register_post_type( $this->post_type, $args ); }
[ "public function register_post_types() {}", "protected function addPostType()\n {\n WordPress::registerType('lbwp-nl-item', 'Beitrag', 'Beiträge', array(\n 'show_in_menu' => 'newsletter',\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'supports' => array(\n 'title', 'thumbnail'\n )\n ));\n }", "public static function post_type(){}", "public function register_post_type() {\n register_post_type($this->postType, $this->args);\n }", "public function create_post_types() {\n }", "function register_post_type(){\n\t\tadd_action( 'init', array(&$this,'init_register_post_type') );\n\t}", "function documentaries_post_type(){\n create_custom_post_type(\"Documentaries\");\n}", "function register_post_types()\n {\n }", "public function register_post_types()\n {\n\n }", "public static function register_post_type() {\n static::$_post_args['labels'] = static::$_post_labels;\n register_post_type( static::$_post_type, static::$_post_args );\n }", "public function register_post_types() {\n\n }", "function register_post_type(){\n\t\tadd_action( 'init', array( $this,'init_register_post_type') );\n\t}", "public function createPostTypes()\n {\n }", "protected function register_post_types(){ /* NOP - To be overridden by implementing plugin */ }", "public function register_post_types()\n {\n }", "public function register_post_types() {\n }", "public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}", "public function register_post_types() {\n\n\t}", "function rep_create_post_type() {\n\t/*$name = 'name';\n\n\tregister_post_type(\n\t\t$name,\n\t\tarray(\n\t\t\t'labels' => Rep\\Helpers\\post_type_labels( $name ),\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => false,\n\t\t\t'hierarchical' => false,\n\t\t\t'menu_position' => 99,\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'custom-fields',\n\t\t\t\t'page-attributes',\n\t\t\t)\n\t\t)\n\t);*/\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set CalendarFolder value This property belongs to a choice that allows only one property to exist. It is therefore removable from the request, consequently if the value assigned to this property is null, the property is removed from this object
public function setCalendarFolder(?\StructType\EwsCalendarFolderType $calendarFolder = null): self { // validation for constraint: choice(Folder, CalendarFolder, ContactsFolder, SearchFolder, TasksFolder) if ('' !== ($calendarFolderChoiceErrorMessage = self::validateCalendarFolderForChoiceConstraintsFromSetCalendarFolder($calendarFolder))) { throw new InvalidArgumentException($calendarFolderChoiceErrorMessage, __LINE__); } if (is_null($calendarFolder) || (is_array($calendarFolder) && empty($calendarFolder))) { unset($this->CalendarFolder); } else { $this->CalendarFolder = $calendarFolder; } return $this; }
[ "public function setFolderObject($value)\n {\n return $this->set('FolderObject', $value);\n }", "public function validateCalendarFolderForChoiceConstraintsFromSetCalendarFolder($value): string\n {\n $message = '';\n if (is_null($value)) {\n return $message;\n }\n $properties = [\n 'Folder',\n 'ContactsFolder',\n 'SearchFolder',\n 'TasksFolder',\n ];\n try {\n foreach ($properties as $property) {\n if (isset($this->{$property})) {\n throw new InvalidArgumentException(sprintf('The property CalendarFolder can\\'t be set as the property %s is already set. Only one property must be set among these properties: CalendarFolder, %s.', $property, implode(', ', $properties)), __LINE__);\n }\n }\n } catch (InvalidArgumentException $e) {\n $message = $e->getMessage();\n }\n \n return $message;\n }", "public function setFolderId($value) {\r\n\t\t$this->folderId = $value;\r\n\t}", "public function setFolderId($value) {\r\n $this->folderId = $value;\r\n }", "public function setFolderId($value)\n {\n return $this->set('FolderId', $value);\n }", "public function setFolderID($value)\n {\n return $this->set('FolderID', $value);\n }", "public function setUploadFolderAttribute($value)\n {\n $this->attributes['upload_folder'] = folder_decode($value, false, false);\n }", "function setFolderType( $value )\n {\n $this->FolderType = $value;\n }", "public function setRealFolder($value)\n {\n return $this->set('RealFolder', $value);\n }", "public function set_folder($folder)\n {\n if ($this->folder === $folder) {\n return;\n }\n\n $this->folder = $folder;\n }", "public function setFolder($path)\n {\n $this->_folder = $path ? realpath($path) : getcwd();\n }", "public function setParentFolderId(?string $value): void {\n $this->getBackingStore()->set('parentFolderId', $value);\n }", "protected function _setFolder()\n {\n if (PaymentHelper::getInstance()->isMolliePaymentMethod(Registry::getSession()->getBasket()->getPaymentId()) === false) {\n return parent::_setFolder();\n }\n\n if ($this->blMollieFinalizeReturnMode === false && $this->blMollieFinishOrderReturnMode === false) { // Mollie module has it's own folder management, so order should not be set to status NEW by oxid core\n $this->oxorder__oxfolder = new Field(Registry::getConfig()->getShopConfVar('sMollieStatusPending'), Field::T_RAW);\n }\n }", "public function setIsFolder($val)\n {\n $this->_propDict[\"isFolder\"] = boolval($val);\n return $this;\n }", "public function setContactsFolder(?\\StructType\\EwsContactsFolderType $contactsFolder = null): self\n {\n // validation for constraint: choice(Folder, CalendarFolder, ContactsFolder, SearchFolder, TasksFolder)\n if ('' !== ($contactsFolderChoiceErrorMessage = self::validateContactsFolderForChoiceConstraintsFromSetContactsFolder($contactsFolder))) {\n throw new InvalidArgumentException($contactsFolderChoiceErrorMessage, __LINE__);\n }\n if (is_null($contactsFolder) || (is_array($contactsFolder) && empty($contactsFolder))) {\n unset($this->ContactsFolder);\n } else {\n $this->ContactsFolder = $contactsFolder;\n }\n \n return $this;\n }", "public function setCalendar(?Calendar $value): void {\n $this->getBackingStore()->set('calendar', $value);\n }", "private function setFolder($folder) {\n\t\t$array = explode('/',$folder);\n\t\t$this->folder = str_replace('/','',$array[0]);\n\t}", "public function validateWellKnownFolderForChoiceConstraintsFromSetWellKnownFolder($value): string\n {\n $message = '';\n if (is_null($value)) {\n return $message;\n }\n $properties = [\n 'FolderId',\n ];\n try {\n foreach ($properties as $property) {\n if (isset($this->{$property})) {\n throw new InvalidArgumentException(sprintf('The property WellKnownFolder can\\'t be set as the property %s is already set. Only one property must be set among these properties: WellKnownFolder, %s.', $property, implode(', ', $properties)), __LINE__);\n }\n }\n } catch (InvalidArgumentException $e) {\n $message = $e->getMessage();\n }\n \n return $message;\n }", "public function setIsFolder($isFolder): void\n {\n $this->attributes['isFolder'] = VT::toBool($isFolder);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The parent verify maverick confirm page
public function familyVerifyMaverickConfirmAction() { // get the view vars $errors = $this->view->errors; /* @var Sly_Errors $errors */ $site = $this->view->site; /* @var BeMaverick_Site $site */ $loginUser = $this->view->loginUser; /* @var BeMaverick_User $loginUser */ // set the input params $requiredParams = array( 'password', ); $input = $this->processInput( $requiredParams, null, $errors ); // check if there were any errors if ( $errors->hasErrors() ) { return $this->renderPage( 'errors' ); } $loginUser->setPassword( $input->getUnescaped( 'password' ) ); $emailAddress = $loginUser->getEmailAddress(); $kids = $site->getKidsByParentEmailAddress( $emailAddress ); $systemConfig = $site->getSystemConfig(); if ( $kids[0] ) { // send the email $vars = array( 'EMAIL_ADDRESS' => $emailAddress, 'USERNAME' => $kids[0]->getUsername(), 'APP_URL' => $systemConfig->getSetting( 'APP_DEEPLINK' ), ); BeMaverick_Email::sendTemplate( $site, 'parent-new-user', array( $emailAddress ), $vars ); } $successPage = 'authParentVerifyMaverickConfirm'; if ( $this->view->ajax && $this->view->ajax != 'dynamicModule' ) { $successPage = $this->view->ajax.'Ajax'; } return $this->renderPage( $successPage ); }
[ "public function actionConfirm()\n {\n $this->checkDetails();\n }", "public function Confirmation(){\n\n /* * * * * * * * * * * * * * * * * * * * * * * *\n * <head> STUFF </head>\n */\n define(\"PAGE_TITLE\", SITE_NAME);\n define(\"PAGE_DESCR\", SITE_NAME);\n define(\"PAGE_ID\", \"confirmation\");\n \n /* Load the view */\n // In a V2 project, we will implement the real paiement via visa card\n\t $array = '';\n\t $this->load->view('cart', 'confirmation', $array); \n\t\t\t$_SESSION['doneff'] = false;\n \n \n }", "protected function confirmPageHeader() {\n }", "public function redirectToConfirmation()\n {\n // Check if user went through the payment preparation detail and completed it\n $detail = unserialize($this->context->cookie->express_checkout);\n\n if (!empty($detail['payer_id']) && !empty($detail['token'])) {\n $values = ['get_confirmation' => true];\n \\Tools::redirect(\\Context::getContext()->link->getModuleLink('paypal', 'incontextconfirm', $values));\n }\n }", "function ShowConfirmationStep()\n\t{\n\t\t$user = &GetUser();\n\n\t\t$formsession = IEM::sessionGet('Form');\n\n\t\t$formid = 0; $loaded = false;\n\n\t\tif (isset($formsession['FormID'])) {\n\t\t\t$formid = (int)$formsession['FormID'];\n\t\t}\n\n\t\t$GLOBALS['Action'] = 'Step3';\n\n\t\t$found_content = true;\n\n\t\tif ($formid > 0) {\n\t\t\t$formapi = $this->GetApi();\n\t\t\t$loaded = $formapi->Load($formid);\n\t\t\tif ($loaded) {\n\t\t\t\t$GLOBALS['CancelButton'] = GetLang('EditFormCancelButton');\n\t\t\t\t$GLOBALS['Heading'] = GetLang('EditForm');\n\t\t\t\t$GLOBALS['Intro'] = GetLang('EditFormIntro');\n\n\t\t\t\t$GLOBALS['SendFromName'] = $formapi->pages['ConfirmPage']['sendfromname'];\n\t\t\t\t$GLOBALS['SendFromEmail'] = $formapi->pages['ConfirmPage']['sendfromemail'];\n\t\t\t\t$GLOBALS['ReplyToEmail'] = $formapi->pages['ConfirmPage']['replytoemail'];\n\t\t\t\t$GLOBALS['BounceEmail'] = $formapi->pages['ConfirmPage']['bounceemail'];\n\t\t\t\t$GLOBALS['ConfirmSubject'] = $formapi->pages['ConfirmPage']['emailsubject'];\n\n\t\t\t\t$GLOBALS['TextContent'] = $formapi->pages['ConfirmPage']['emailtext'];\n\t\t\t\t$htmlvalue = $formapi->pages['ConfirmPage']['emailhtml'];\n\n\t\t\t\t$GLOBALS['ConfirmPageHTML'] = $formapi->pages['ConfirmPage']['html'];\n\t\t\t\t$GLOBALS['ConfirmPageURL'] = $formapi->pages['ConfirmPage']['url'];\n\n\t\t\t\tif ($formapi->pages['ConfirmPage']['emailtext'] == '' || $formapi->pages['ConfirmPage']['emailhtml'] == '') {\n\t\t\t\t\t$found_content = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($formid <= 0 || !$loaded || !$found_content) {\n\t\t\tif ($formid <= 0 || !$loaded) {\n\t\t\t\t$GLOBALS['CancelButton'] = GetLang('CreateFormCancelButton');\n\t\t\t\t$GLOBALS['Heading'] = GetLang('CreateForm');\n\t\t\t\t$GLOBALS['Intro'] = GetLang('ConfirmPageIntro');\n\t\t\t}\n\n\t\t\t// if there's more than one list, we'll use the users information.\n\t\t\tif (sizeof($formsession['IncludeLists']) > 1) {\n\t\t\t\t$GLOBALS['SendFromName'] = $user->Get('fullname');\n\t\t\t\t$GLOBALS['SendFromEmail'] = $GLOBALS['ReplyToEmail'] = $GLOBALS['BounceEmail'] = $user->Get('emailaddress');\n\t\t\t} else {\n\t\t\t\t// if there's only one list, load up those details.\n\t\t\t\t$listapi = $this->GetApi('Lists');\n\n\t\t\t\t$lists = current($formsession['IncludeLists']);\n\t\t\t\t$listapi->Load($lists);\n\t\t\t\t$GLOBALS['SendFromName'] = $listapi->Get('ownername');\n\t\t\t\t$GLOBALS['SendFromEmail'] = $listapi->Get('owneremail');\n\t\t\t\t$GLOBALS['ReplyToEmail'] = $listapi->Get('replytoemail');\n\t\t\t\t$GLOBALS['BounceEmail'] = $listapi->Get('bounceemail');\n\t\t\t}\n\n\t\t\tswitch ($formsession['FormType']) {\n\t\t\t\tcase 'm':\n\t\t\t\t\t$GLOBALS['ConfirmSubject'] = GetLang('FormConfirmPage_Modify_Subject');\n\t\t\t\t\t$GLOBALS['ConfirmPageHTML'] = GetLang('FormConfirmPageHTML_Modify');\n\t\t\t\t\t$htmlvalue = GetLang('FormConfirmPage_Modify_Email_HTML');\n\t\t\t\t\t$GLOBALS['TextContent'] = GetLang('FormConfirmPage_Modify_Email_Text');\n\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\t$GLOBALS['ConfirmSubject'] = GetLang('FormConfirmPage_Subscribe_Subject');\n\t\t\t\t\t$GLOBALS['ConfirmPageHTML'] = GetLang('FormConfirmPage_Subscribe_HTML');\n\t\t\t\t\t$htmlvalue = GetLang('FormConfirmPage_Subscribe_Email_HTML');\n\t\t\t\t\t$GLOBALS['TextContent'] = GetLang('FormConfirmPage_Subscribe_Email_Text');\n\t\t\t\tbreak;\n\t\t\t\tcase 'u':\n\t\t\t\t\t$GLOBALS['ConfirmSubject'] = GetLang('FormConfirmPage_Unubscribe_Subject');\n\t\t\t\t\t$GLOBALS['ConfirmPageHTML'] = GetLang('FormConfirmPage_Unsubscribe_HTML');\n\t\t\t\t\t$htmlvalue = GetLang('FormConfirmPage_Unsubscribe_Email_HTML');\n\t\t\t\t\t$GLOBALS['TextContent'] = GetLang('FormConfirmPage_Unsubscribe_Email_Text');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$GLOBALS['ConfirmPageURL'] = 'http://';\n\t\t}\n\n\t\tswitch ($formsession['FormType']) {\n\t\t\tcase 'm':\n\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ConfirmPageHTML_Subscribe');\n\t\t\tbreak;\n\t\t\tcase 'u':\n\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ConfirmPageHTML_Unsubscribe');\n\t\t\tbreak;\n\t\t}\n\n\t\t$GLOBALS['ConfirmUrlStyle'] = 'none';\n\t\t$GLOBALS['ConfirmHTMLStyle'] = \"''\";\n\t\t$GLOBALS['ConfirmUrlField'] = '';\n\t\t$GLOBALS['ConfirmHTMLField'] = ' CHECKED';\n\n\t\tif ($GLOBALS['ConfirmPageURL'] != 'http://' && $GLOBALS['ConfirmPageURL'] != '') {\n\t\t\t$GLOBALS['ConfirmUrlStyle'] = \"''\";\n\t\t\t$GLOBALS['ConfirmHTMLStyle'] = 'none';\n\t\t\t$GLOBALS['ConfirmUrlField'] = ' CHECKED';\n\t\t\t$GLOBALS['ConfirmHTMLField'] = '';\n\t\t}\n\n\t\t$GLOBALS['HTMLContent'] = $this->GetHTMLEditor($GLOBALS['ConfirmPageHTML'], false, 'confirmhtml', 'exact', 260, 400);\n\t\t$GLOBALS['HTMLEditorName'] = 'confirmhtml';\n\t\t$GLOBALS['ConfirmHTML'] = $this->ParseTemplate('Form_Editor_HTML', true, false);\n\n\t\tswitch ($formsession['FormType']) {\n\t\t\tcase 'm':\n\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t$GLOBALS['TextHelpTip'] = $this->_GenerateHelpTip('HLP_ConfirmTextVersion_Subscribe');\n\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ConfirmHTMLVersion_Subscribe');\n\t\t\tbreak;\n\t\t\tcase 'u':\n\t\t\t\t$GLOBALS['TextHelpTip'] = $this->_GenerateHelpTip('HLP_ConfirmTextVersion_Unsubscribe');\n\t\t\t\t$GLOBALS['HTMLHelpTip'] = $this->_GenerateHelpTip('HLP_ConfirmHTMLVersion_Unsubscribe');\n\t\t\tbreak;\n\t\t}\n\n\t\t$GLOBALS['HTMLContent'] = $this->GetHTMLEditor($htmlvalue, false, 'confirmemail_html', 'exact', 260, 400);\n\t\t$GLOBALS['HTMLEditorName'] = 'confirmemail_html';\n\t\t$GLOBALS['EditorHTML'] = $this->ParseTemplate('Form_Editor_HTML', true, false);\n\t\t$GLOBALS['EditorText'] = $this->ParseTemplate('Form_Editor_Text', true, false);\n\n\t\t$GLOBALS['ShowBounceInfo'] = 'none';\n\t\tif ($user->HasAccess('Lists', 'BounceSettings')) {\n\t\t\t$GLOBALS['ShowBounceInfo'] = '';\n\t\t}\n\n\t\t$GLOBALS['FormConfirmPage'] = $this->ParseTemplate('Form_Form_ConfirmPage', true);\n\n\t\t$this->ParseTemplate('Form_Form_Step2');\n\t}", "public function processParentConfirmationAction()\n {\n $params = $this->getRequest()->getParams();\n $errors = array();\n if (!isset ($params[\"children\"])) {\n $errors[] = $this->__(\"You need to select one children\");\n }\n if (!isset ($params[\"paymentAccount\"])) {\n $errors[] = $this->__(\"You need to select one payment account\");\n }\n if ((bool)count($errors)) {\n foreach ($errors as $error) {\n Mage::getSingleton(\"core/session\")->addError($error);\n }\n $this->_redirect(\"*/*/parentConfirmation\");\n } else {\n Mage::helper(\"virtualpiggy\")->getUser()->addData(array(\n \"selected_children\" => $params[\"children\"],\n \"selected_payment_account\" => $params[\"paymentAccount\"],\n \"deliver_to_children\" => isset ($params[\"deliverToChildAddress\"]),\n \"notify_children\" => isset ($params[\"notifyChild\"]),\n ));\n Mage::getSingleton(\"customer/session\")->setParentConfirmation(true);\n $this->_redirect(\"*/*/index\");\n }\n }", "public function actionConfirm() {\n $this->renderPartial('manage/show',\n array('model' => $this->loadAuthItem(), 'updateList' => false, 'delete' => true),\n false, true);\n }", "public function clickDialogBoxConfirm() {\n if ($this->getJeedomVersion() == 3)\n $this->waitElemIsClickable(By::xpath(\"//button[@data-bb-handler='confirm']\"))->click();\n else\n $this->waitElemIsClickable(By::xpath(\"//button[contains(@class,'bootbox-accept')]\"))->click(); \n }", "public function actionConfirm()\n {\n parent::actionConfirm();\n $api = $this->buildApi();\n\n $details = HelperCommon::getStore('details');\n $api->updateData($details);\n\n // fill items with product details\n $items = array();\n foreach ($api->getBasket()->getItems() as $item)\n {\n $items[] = array(\n 'productUrlImage' => $this->getProductUrlImage($item->getDescription()),\n 'description' => $item->getDescription(),\n 'quantity' => $item->getQuantity(),\n 'unitGrossAmount' => number_format($item->getUnitGrossAmount(), 2),\n 'totalGrossAmount' => number_format($item->getTotalGrossAmount(), 2),\n );\n }\n\n $env = $this->sagepayConfig->getEnv();\n\n // Render confirm page for form payment\n $view = new HelperView('form/confirm');\n $view->setData(array(\n 'basket' => array(\n 'items' => $items,\n 'deliveryGrossPrice' => number_format($api->getBasket()->getDeliveryGrossAmount(), 2),\n 'totalGrossPrice' => number_format($api->getBasket()->getAmount(), 2),\n ),\n 'env' => $env,\n 'vendorName' => $this->sagepayConfig->getVendorName(),\n 'integrationType' => $this->integrationType,\n 'currency' => $this->sagepayConfig->getCurrency(),\n 'purchaseUrl' => $this->sagepayConfig->getPurchaseUrl('form', $env),\n 'request' => $api->createRequest(),\n 'displayQueryString' => htmlspecialchars(rawurldecode(utf8_encode($api->getQueryData()))),\n 'details' => $details,\n ));\n $view->render();\n }", "protected function verifyPage()\n {\n }", "public function testing_verify() {\n\t\t$_SESSION['messages'][] = 'You are viewing this in testing mode. Form submission will not work.';\n\n\t\t$this->display( 'verify.tpl' );\n\t}", "function confirmation_redirect() {\n if (!SwpmFbForm::is_form_submitted() || $this->form->is_fatal() || !$this->form->is_valid()) {\n return;\n }\n\n global $wpdb;\n\n $form_id = ( isset($_REQUEST['form_id']) ) ? (int) esc_html($_REQUEST['form_id']) : '';\n\n // Get forms\n $order = sanitize_sql_orderby('form_id DESC');\n $forms = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order\", $form_id));\n\n foreach ($forms as $form) :\n // If text, return output and format the HTML for display\n if ('page' == $form->form_success_type) {\n $page = get_permalink($form->form_success_message);\n wp_redirect($page);\n exit();\n }\n // If redirect, redirect to the URL\n elseif ('redirect' == $form->form_success_type) {\n wp_redirect(esc_url($form->form_success_message));\n exit();\n }\n\n endforeach;\n }", "public function confirm() {\n\n\t\t//Use false to prevent valid boolean to get deleted\n\t\t$cart = VirtueMartCart::getCart();\n\t\tif ($cart) {\n\t\t\t$cart->confirmDone();\n\t\t\t$view = $this->getView('cart', 'html');\n\t\t\t$view->setLayout('order_done');\n\t\t\t// Display it all\n\t\t\t$view->display();\n\t\t} else {\n\t\t\t$mainframe = JFactory::getApplication();\n\t\t\t$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart', FALSE), JText::_('COM_VIRTUEMART_CART_DATA_NOT_VALID'));\n\t\t}\n\t}", "public function redirectVerification() {\n Mage::app()->getResponse()->setRedirect( 'accountverification' );\n }", "public function verificationAction() {\n $this->loadLayout ();\n $this->renderLayout ();\n }", "public function showConfirmForm()\n {\n return view( config('lasallesoftware-librarybackend.path_to_back_end_authentication_view_path') . '.passwords.confirm' );\n }", "public function confirm()\n {\n $task = $this->getTask();\n $link = $this->getExternalTaskLink($task);\n\n $this->response->html($this->template->render('task_external_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }", "public function confirm() {\n\n\t\t//Use false to prevent valid boolean to get deleted\n\t\t$cart = retinashopCart::getCart();\n\t\tif ($cart) {\n\t\t\t$cart->confirmDone();\n\t\t\t$view = $this->getView('cart', 'html');\n\t\t\t$view->setLayout('order_done');\n\t\t\t// Display it all\n\t\t\t$view->display();\n\t\t} else {\n\t\t\t$mainframe = JFactory::getApplication();\n\t\t\t$mainframe->redirect(JRoute::_('index.php?option=com_retinashop&view=cart'), RText::_('COM_RETINASHOP_CART_DATA_NOT_VALID'));\n\t\t}\n\t}", "public function actionConfirm() {\n $this->checkLogin();\n $member_id = Yii::app()->loginUser->getUserId();\n $error = '';\n //查找会员密保问题关联id\n $member_to_security = UcMemberToSecurityQuestion::model()->findByAttributes(array('member_id' => $member_id));\n if (isset($_POST['SecurityQuestion']['answer']) && $_POST['SecurityQuestion']['answer']) {\n if ($member_to_security->answer_1 != $this->getString($_POST['SecurityQuestion']['answer'])) {\n $error = '密保答案不正确';\n } else {\n $member_to_security->status = 1;\n $member_to_security->save();\n $this->redirect('ucenter.php?r=account/questionDone');\n }\n }\n //查找会员密保问题\n $member_question = UcSecurityQuestion::model()->findByPk($member_to_security->security_question_id_1);\n $arrRender = array(\n 'error' => $error,\n 'member_id' => $member_id,\n 'gShowHeader' => true,\n 'return_url' => $this->createAbsoluteUrl('account/index'),\n 'headerTitle' => '确认安全问题',\n 'question' => $member_question->question_text,\n );\n $this->smartyRender('account/confirm_one.tpl', $arrRender);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The path calculated by Fleet Engine from the previous waypoint to the current waypoint. Generated from protobuf field repeated .google.type.LatLng path_to_waypoint = 4;
public function getPathToWaypoint() { return $this->path_to_waypoint; }
[ "public function getPathway()\r\n {\r\n return $this->getParent()->channelGetPathway($this->getId());\r\n }", "private function buildPath()\n {\n $path = array();\n $ref = $this->goal;\n\n if (!isset($this->previous[$ref[0]][$ref[1]])) {\n return \"Could not find the prey!\";\n }\n $path [] = \"[{$ref[0]}, {$ref[1]}]\";\n while ($this->previous[$ref[0]][$ref[1]] != null) {\n $ref = $this->previous[$ref[0]][$ref[1]];\n $path [] = \"[{$ref[0]}, {$ref[1]}]\";\n }\n\n\n return $path;\n }", "public function getWaypoints()\n {\n $waypoints = $this->GPXFile->waypoints;\n\n return $this->mapPoints($waypoints);\n }", "public function getDirections(){}", "public function resolvePath($path) {\n $this->processPath($path);\n $this->handleMoves();\n /**\n * Part 1 & Part 2 code is jumbled up together, need to refactor this whole thing.\n * The following two lines print the list of all traveled points across the coordinate system - the complete\n * movement history - every step taken while executing movements from the move sequence, and the current\n * coordinates, which are actually the coordinates of Easter Bunny HQ. The execution of the handleMoves method\n * is stopped when the location is found.\n * This is used in Part 2\n * The final line calculates the distance to HQ, because the current coordinates are set to the first\n * occurrence of point that was visited twice - hence those are the coordinates of the HQ and the distance is\n * calculated to those coordinates.\n *\n */\n print_r($this->visitedLocations);\n echo PHP_EOL . $this->currentX . \" : \" . $this->currentY;\n return $this->calculateFinalDistance();\n }", "public function getRoutePath();", "public function getDirections()\n {\n return $this->directions;\n }", "function &getPathWay() {\n\t\treturn $this->_pathway;\n\t}", "public function getDirections($from, $to)\n {\n // $find the nearest bus stop from $to\n }", "public function setTraversalPath($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Api\\Ref::class);\n $this->traversal_path = $arr;\n\n return $this;\n }", "public function getPath2()\n {\n return $this->path2;\n }", "public function getRoutePath(): string;", "public function getUserRoutePathAltitude()\n {\n return $this->userRoutePathAltitude;\n }", "public function path(){\n try {\n // Sparql11update.g:245:3: ( pathAlternative ) \n // Sparql11update.g:246:3: pathAlternative \n {\n $this->pushFollow(self::$FOLLOW_pathAlternative_in_path952);\n $this->pathAlternative();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function getRoutingPath()\n {\n $tempPath = substr($this->path, 1);\n\n if (strpos($tempPath, '/') !== false) {\n $pathPieces = explode('/', $tempPath);\n return $pathPieces;\n } else if ($tempPath) {\n return array($tempPath);\n } else {\n return array();\n }\n }", "public function path() {\n $path = array();\n $pair = $this;\n do {\n $path[] = $pair;\n $pair = $pair->parent;\n } while ($pair != null);\n\n return array_reverse($path);\n }", "public function setPaths($var)\n\t{\n\t\t$arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Gobgpapi\\Path::class);\n\t\t$this->paths = $arr;\n\n\t\treturn $this;\n\t}", "public function findPath()\n {\n $this->queue [] = [$this->root[0], $this->root[1]];\n\n //(right, left, down, up) coordinate increase for finding adjacent nodes\n $xIncrease = [0, 0, 1, -1];\n $yIncrease = [1, -1, 0, 0];\n\n $this->previous [$this->root[0]] [$this->root[1]] = null;\n $this->checked[$this->root[0]][$this->root[1]] = true;\n\n while (count($this->queue) > 0) {\n $current = array_shift($this->queue);\n\n if ($current[0] == $this->goal[0] && $current[1] == $this->goal[1]) {\n break;\n }\n\n //Find adjacent Nodes\n for ($i = 0; $i < 4; $i++) {\n $adjacentx = $xIncrease[$i] + $current[0];\n $adjacentY = $yIncrease[$i] + $current[1];\n\n if ($this->checkAdjacentNode($adjacentx, $adjacentY)) {\n $this->previous [$adjacentx] [$adjacentY] = $current;\n $this->queue [] = [$adjacentx, $adjacentY];\n $this->checked[$adjacentx][$adjacentY] = true; //Marco como visitado dicho estado para no volver a recorrerlo\n }\n }\n }\n\n return $this->buildPath();\n\n }", "public function setPath($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->path = $arr;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inserts new token at given position.
protected function _insertToken($position, $token) { switch($position) { case 0: array_unshift($this->_tokens, $token); break; case (sizeof($this->_tokens)): $this->_tokens[] = $token; break; default: { $tmp = array(); $i = 1; while($tk = array_shift($this->_tokens)) { $tmp[] = $tk; if($i == $position) { $tmp[] = $token; } $i++; } $this->_tokens = $tmp; } } }
[ "public function insertToken($token, $position)\n {\n for ($i = 6; $i >= 0; $i --) {\n if (strcasecmp($this->board[$i][$position], \"#\") != 0) {\n $this->board[$i][$position] = $token;\n }\n }\n }", "function phpJSO_insert_token (&$token_array, $token, $token_index)\n{\n\t// Loop through array and shift all indexes up one spot until we reach the\n\t// index we are inserting at\n\t$jump = 1;\n\t$token_index_count = $token_index - 1;\n\tfor ($i = count($token_array) - 1; $i > $token_index_count; --$i)\n\t{\n\t\tif ($token_array[$i] == '')\n\t\t{\n\t\t\t++$jump;\n\t\t\tcontinue;\n\t\t}\n\t\t$token_array[$i+$jump] = $token_array[$i];\n\t\t$jump = 1;\n\t}\n\t$token_array[$token_index] = $token;\n}", "public function insert($new, $pos);", "public function Insert($pos, $value){\n $this->_AddElement($value,$pos-1);\n }", "public function insert($arg, $pos) {\n $this->source= substr($this->source, 0, $pos).$arg.substr($this->source, $pos);\n $this->line+= substr_count($arg, \"\\n\");\n return $this;\n }", "public function insert($i, $tokenStream) {\n if ($i == $this->count() - 1) { // end => append\n $this->append($tokenStream);\n return;\n }\n \n // remove following stream to append later\n $after = array_splice($this->tokens, $i);\n \n // \"magic\" append\n $count = $this->append($tokenStream);\n \n // fix iterator position\n if ($i < $this->position) {\n $this->position += $count;\n }\n \n // append $after\n foreach ($after as $token) {\n $this->tokens[] = $token;\n }\n }", "abstract protected function insertToken(string $cmd): string;", "public function insert ($pos, $x) {\r\n\t\t#C:\\HaxeToolkit\\haxe\\std/php/_std/Array.hx:89: characters 3-11\r\n\t\t$this->length++;\r\n\t\t#C:\\HaxeToolkit\\haxe\\std/php/_std/Array.hx:90: characters 3-56\r\n\t\tarray_splice($this->arr, $pos, 0, [$x]);\r\n\t}", "public function insert($offset, $value);", "public function insert($object, $position, $key = null);", "public function pushToken() \n {\n array_push($this->tokenStack, array($this->type, $this->token));\n }", "function add_token($token, &$token_array, $type, $data)\n{\n $token->type = $type;\n $token->data = $data;\n $token_array[] = $token;\n}", "function SetInsertionPoint($pos){}", "public function insertAt($position = NULL)\n {\n if($position === NULL) $position = $this->listifyTop();\n $this->insertAtPosition($position);\n }", "public function insert(string $string, int $position)\n {\n $this->data = substr_replace($this->data, $string, $position, 0);\n }", "protected abstract function append($token);", "public function push(Token $t){\n\t\t$this->tokens[] = $t;\n\t}", "function mINSERT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$INSERT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:19:3: ( 'insert' ) \n // Tokenizer11.g:20:3: 'insert' \n {\n $this->matchString(\"insert\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function insertBaseTokens($content);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the components.json file.
private function loadComponentsJson() { if (!file_exists('components.json')) { return; } if (!$str = file_get_contents('components.json')) { $this->fatalError('Can\'t open components.json file.'); } $components = $this->parseJson($str); if (!isset($components['components'])) { return; } if (!is_array($components['components'])) { $this->fatalError('Syntax error in components.json'); } foreach ($components['components'] as $component => $data) { $this->components[$component] = $data; } }
[ "private function loadJson(){\n if(file_exists($this->fullPath.$this->jsonFile)) {\n $arCfg = get_object_vars(json_decode(file_get_contents($this->fullPath.$this->jsonFile)));\n $this->loadConfigs($arCfg);\n }\n }", "private function load()\n\t{\n\t\t$this->_container = json_decode(file_get_contents($this->_file), true);\n\t}", "private function loadComposerJson()\n {\n if (!$str = file_get_contents('composer.json')) {\n $this->fatalError('Can\\'t open composer.json file.');\n }\n\n $composer = $this->parseJson($str);\n\n if (isset($composer['config']) && isset($composer['config']['vendor-dir'])) {\n $this->vendorDir = $composer['config']['vendor-dir'];\n }\n\n if (!isset($composer['extra'])) {\n return;\n }\n\n if (!isset($composer['extra']['post-install'])) {\n return;\n }\n\n if (!is_array($composer['extra']['post-install'])) {\n $this->fatalError('Invalid format for extra.post-install entry');\n }\n\n foreach ($composer['extra']['post-install'] as $component => $data) {\n $data['source'] = $this->vendorDir . DS . $component;\n $this->components[$component] = $data;\n }\n }", "public function registeredComponentsJson();", "public function load_components () {\n\t\t$this->components['bundled'] = $this->load_bundled_components();\n\t\t$this->components['downloadable'] = $this->load_downloadable_components();\n\t\t$this->components['standalone'] = $this->load_standalone_components();\n\t}", "public function load(){\n\t\t$this->entries = array();\n\n\t\tif (!file_exists($this->filepath)){\n\t\t\treturn;\n\t\t}\n\n\t\t$json = file_get_contents($this->filepath);\n\t\tif (!$json) return;\n\t\t$this->entries = json_decode(file_get_contents($this->filepath), true);\n\t\t$this->rehash();\n\t}", "protected function loadData()\n\t{\n\t\t$jsonPath = $this->getPath() . 'module.json';\n\t\t$contents = $this->app['files']->get($jsonPath);\n\n\t\treturn json_decode($contents);\n\t}", "private function load_plugins() {\n\t\t$file = file_get_contents( CAF_DIR . 'addons.json' );\n\t\t$this->plugins = json_decode( $file );\n\t}", "private function load()\n {\n if ($this->packageModuleMap === null) {\n $jsonData = $this->reader->getComposerJsonFiles()->toArray();\n foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) {\n $key = $moduleDir . '/composer.json';\n if (isset($jsonData[$key]) && $jsonData[$key]) {\n try {\n $packageData = $this->serializer->unserialize($jsonData[$key]);\n } catch (\\InvalidArgumentException $e) {\n throw new \\InvalidArgumentException(\n sprintf(\n \"%s composer.json error: %s\",\n $moduleName,\n $e->getMessage()\n )\n );\n }\n\n if (isset($packageData['name'])) {\n $this->packageModuleMap[$packageData['name']] = $moduleName;\n }\n if (isset($packageData['version'])) {\n $this->modulePackageVersionMap[$moduleName] = $packageData['version'];\n }\n if (!empty($packageData['require'])) {\n $this->requireMap[$moduleName] = array_keys($packageData['require']);\n }\n if (!empty($packageData['conflict'])) {\n $this->conflictMap[$moduleName] = $packageData['conflict'];\n }\n }\n }\n }\n }", "protected function load()\n {\n $decoder = new JsonDecoder();\n\n $this->json = file_exists($this->path)\n ? (array) $decoder->decodeFile($this->path, $this->schemaPath)\n : array();\n\n if (isset($this->json['_order'])) {\n $this->json['_order'] = (array) $this->json['_order'];\n\n foreach ($this->json['_order'] as $path => $entries) {\n foreach ($entries as $key => $entry) {\n $this->json['_order'][$path][$key] = (array) $entry;\n }\n }\n }\n\n // The root node always exists\n if (!isset($this->json['/'])) {\n $this->json['/'] = null;\n }\n\n // Make sure the JSON is sorted in reverse order\n krsort($this->json);\n }", "private function _getComponents()\n {\n $result = array();\n $iterator = new IteratorIterator(\n new DirectoryIterator($GLOBALS['fs_base'] . '/config/components.d')\n );\n foreach ($iterator as $file) {\n if ($file->isFile() &&\n substr($file->getFilename(), -5) == '.json') {\n $result[$file->getFilename()] = json_decode(\n file_get_contents($file->getPathname())\n );\n }\n }\n return $result;\n }", "public function load()\n {\n $path = $this->manifestPath.'/collections.json';\n\n if ($this->files->exists($path) and is_array($manifest = json_decode($this->files->get($path), true)))\n {\n foreach ($manifest as $key => $entry)\n {\n $entry = new Entry($entry['fingerprints'], $entry['development']);\n\n $this->entries->put($key, $entry);\n }\n }\n }", "private function load_component(){\n\n\t\t\tinclude_once(dirname(__FILE__) .'/inc/class-fields.php');\n\t\t\tinclude_once(dirname(__FILE__) .'/inc/class-display.php');\n\t\t\tinclude_once(dirname(__FILE__) .'/inc/class-wp.php');\n\t\t\tinclude_once(dirname(__FILE__) .'/inc/class-metabox.php');\n\t\t\t//include_once(dirname(__FILE__) .'/inc/class-themecheck.php');\n\t\t\tinclude_once(dirname(__FILE__) .'/inc/class-post-type.php');\n\t\t\tinclude_once(dirname(__FILE__) .'/inc/class-taxonomy.php');\n\t\t\t//\n\t\t\t$this->load_fields();\n\t\t}", "public function LoadComponents ( ) {\n\t\teval ( GLOBALS );\n\t\t\n\t\t$Config = $this->GetSys ( \"Config\" );\n\t\t\n\t\t$configpaths = $Config->GetPath();\n\t\t\n\t\t$componentdir = $zApp->GetPath() . DS . 'components';\n\t\t\n\t\t$components = scandirs ( $componentdir );\n\t\t\n\t\t$config = array ();\n\t\tforeach ( $components as $comp => $component ) {\n\t\t\t$filename = $componentdir . DS . $component . DS . $component . '.conf';\n\t\t\t\n\t\t\tif ( is_file ( $filename ) ) {\n\t\t\t\t$path[$component][] = $filename;\n\t\t\t}\n\t\t\t\n\t\t\tforeach ( $configpaths as $cpath => $configpath ) {\n\t\t\t\t$filename = $zApp->GetPath() . DS . 'configurations' . DS . $configpath . DS . 'components' . DS . $component . '.conf';\n\t\t\t\tif ( is_file ( $filename ) ) {\n\t\t\t\t\t$path[$component][] = $filename;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// No configuration files found, continue loop\n\t\t\tif ( !isset ( $path[$component] ) ) continue;\n\t\t\t\n\t\t\t\n\t\t\t$config[$component] = array();\n\t\t\t\n\t\t\tforeach ( $path[$component] as $p => $filename ) {\n\t\t\t\t$currentvalues = $config[$component];\n\t\t\t\t$configvalues = $this->Parse ( $filename );\n\t\t\t\t\n\t\t\t\t$clearall = isset ( $configvalues['clearall'] ) ? $configvalues['clearall'] : false;\n\t\t\t\t\n\t\t\t\tif ( $clearall == 'true' ) {\n\t\t\t\t\t$currentvalues = array ();\n\t\t\t\t\tunset ( $configvalues['clearall'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$config[$component] = array_merge ( $currentvalues, $configvalues );\n\t\t\t}\n\t\t\t\n\t\t\t// If the component isn't enabled, then unset the values and continue\n\t\t\tif ($config[$component]['enabled'] != 'true' ) {\n\t\t\t\tunset ($config[$component]);\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$this->_Components[] = $component;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn ($config);\n\t\t\n\t}", "protected function load_components()\n {\n return true;\n }", "public function load_bundled_components () {\n\t\t/*\n\t\tstatic $components = array();\n\n\t\tif ( isset( $components ) )\n\t\t\treturn $components;\n\t\t*/\n\t\t$files = WooDojo_Utils::glob_php( '*.php', GLOB_MARK, $this->config->components_path );\n\n\t\tforeach ( $files as $file ) {\n\t\t\tif ( $headers = $this->get_component( $file ) ) {\n\t\t\t\t$slug = $this->get_component_slug( $file );\n\t\t\t\t$components[$slug] = $headers;\n\t\t\t\t$components[$slug]->filepath = $this->clean_component_path( $file );\n\t\t\t\t$components[$slug]->current_version = $components[$slug]->version;\n\t\t\t}\n\t\t}\n\n\t\treturn $components;\n\t}", "public function load() {\n $this->jsonConfigRepository = new JsonConfigRepository($this->configFile);\n $this->config = $this->jsonConfigRepository->read();\n $this->csvCoursesRepository = new CsvCoursesRepository($this->config);\n $apiConnector = new ApiConnector($this->config);\n $this->restContentMigrationsRepository = new RestContentMigrationsRepository($apiConnector);\n $this->restCoursesSearchRepository = new RestCoursesSearchRepository($apiConnector);\n }", "public function load() {\n\n\t\t$this->initialize_components();\n\t\t$this->initialize_pages();\n\n\t\tforeach ( $this->components as $component ) {\n\t\t\t$component->load();\n\t\t}\n\n\t\tforeach ( $this->pages as $page ) {\n\t\t\t$page->load();\n\t\t}\n\t}", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Avatar group to resize
protected function _getAvatarGroup() { return [ 'small' => [ 'width' => _const('AVATAR_SMALL'), 'height' => _const('AVATAR_SMALL') ] ]; }
[ "private function resize()\n {\n if (!$this->width && !$this->height && $this->sizeType == 'org') {\n return false;\n }\n\n //get image size\n $currentWidth = $this->imagick->getImageWidth();\n $currentHeight = $this->imagick->getImageHeight();\n\n //get image resize ratio\n $witdhRatio = $this->width / $currentWidth;\n $heightRatio = $this->height / $currentHeight;\n\n if ($this->imageFormat == 'gif') {\n $this->imagick = $this->imagick->coalesceImages();\n } elseif(in_array($this->imageFormat, array('png', 'svg'))) {\n $this->imagick->setBackgroundColor(new ImagickPixel('transparent'));\n\n if(in_array($this->imageFormat, array('svg'))) {\n $this->imagick->readImageBlob(file_get_contents($this->currentFileLocation));\n }\n }\n\n //resizes and crops\n if ($this->sizeType == 'fixed') {\n if($witdhRatio >= $heightRatio){\n $newHeight = floor($currentHeight * $witdhRatio);\n\n if ($this->imageFormat != 'gif') {\n $this->imagick->resizeImage($this->width, null, imagick::FILTER_LANCZOS, 1);\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($this->width, null);\n $frame->setImagePage($this->width, null, 0, 0);\n }\n }\n\n if ($this->height != 0 && $newHeight > $this->height) {\n if ($this->imageFormat != 'gif') {\n $this->imagick->cropImage($this->width, $this->height, 0, floor(($newHeight - $this->height) / 2));\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($this->width, $this->height);\n $frame->setImagePage($this->width, $this->height, 0, 0);\n }\n }\n }\n } else {\n $newWidth = floor($currentWidth * $heightRatio);\n\n if ($this->imageFormat != 'gif') {\n $this->imagick->resizeImage(null, $this->height, imagick::FILTER_LANCZOS, 1);\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage(null, $this->height);\n $frame->setImagePage(null, $this->height, 0, 0);\n }\n }\n\n if ($this->width != 0 && $newWidth > $this->width) {\n if ($this->imageFormat != 'gif') {\n $this->imagick->cropImage($this->width, $this->height, ceil(($newWidth - $this->width) / 2 ), 0);\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($this->width, $this->height);\n $frame->setImagePage($this->width, $this->height, 0, 0);\n }\n }\n }\n }\n } else {\n if ($witdhRatio >= $heightRatio) {\n if ($currentWidth > $this->width || $this->allowSizeOverflow) {\n if ($this->imageFormat != 'gif') {\n $this->imagick->resizeImage($this->width, null, imagick::FILTER_LANCZOS, 1);\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($this->width, null);\n $frame->setImagePage($this->width, null, 0, 0);\n }\n }\n }\n\n if ($this->height != 0 && $this->imagick->getImageHeight() > $this->height) {\n if ($this->imageFormat != 'gif') {\n $this->imagick->resizeImage(null, $this->height, imagick::FILTER_LANCZOS, 1);\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage(null, $this->height);\n $frame->setImagePage(null, $this->height, 0, 0);\n }\n }\n }\n } else {\n if ($currentHeight > $this->height || $this->allowSizeOverflow) {\n\n if ($this->imageFormat != 'gif') {\n $this->imagick->resizeImage(null, $this->height, imagick::FILTER_LANCZOS, 1);\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage(null, $this->height);\n $frame->setImagePage(null, $this->height, 0, 0);\n }\n }\n }\n\n if ($this->width != 0 && $this->imagick->getImageWidth() > $this->width) {\n if ($this->imageFormat != 'gif') {\n $this->imagick->resizeImage($this->width, null, imagick::FILTER_LANCZOS, 1);\n } else {\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($this->width, null);\n $frame->setImagePage($this->width, null, 0, 0);\n }\n }\n }\n }\n }\n\n if ($this->imageFormat == 'gif') {\n $this->imagick = $this->imagick->deconstructImages();\n }\n }", "function _do_resize()\n {\n require( ROOT_PATH . 'modules/gallery/lib/image.php' );\n \n if( is_array( $this->ipsclass->input['cats'] ) )\n {\n $cats = implode( \",\", $this->ipsclass->input['cats'] );\n }\n else\n {\n $cats = $this->ipsclass->input['cats'];\n }\n\n $start = ( $this->ipsclass->input['start'] ) ? $this->ipsclass->input['start'] : 0;\n\n if( $this->ipsclass->input['album'] )\n {\n $album = \" OR album_id > 0 \";\n }\n\n $this->ipsclass->DB->simple_construct( array( 'select' => 'id, masked_file_name, medium_file_name, directory, media',\n 'from' => 'gallery_images',\n 'where' => \"category_id IN ( {$cats} ) {$album}\",\n 'limit' => array( $start, $this->ipsclass->input['num'] ) ) );\n $q = $this->ipsclass->DB->simple_exec();\n\n if( $this->ipsclass->DB->get_num_rows( $q ) )\n {\n while( $i = $this->ipsclass->DB->fetch_row( $q ) )\n { \n if( $i['media'] )\n {\n \tcontinue;\n }\n\n $total++;\n \n $dir = ( $i['directory'] ) ? \"{$i['directory']}/\" : \"\";\n \n // Image Info\n $img_load = array( 'out_dir' => $this->ipsclass->vars['gallery_images_path'].'/'.$dir,\n 'in_dir' => $this->ipsclass->vars['gallery_images_path'].'/'.$dir,\n 'in_file' => $i['masked_file_name'],\n 'out_file' => $i['masked_file_name'],\n );\n \n // Create the image\n $img = new Image( $img_load );\n $img->ipsclass = &$this->ipsclass;\n $img->glib = &$this->glib;\n $img->lib_setup();\n if( $img->resize_proportional( $this->ipsclass->vars['gallery_max_img_width'], $this->ipsclass->vars['gallery_max_img_height'], 1 ) )\n {\n $img->write_to_file();\n }\n unset( $img );\n \n /**\n * Does the image have a medium sized file?\n **/\n\t\t\t if( $this->ipsclass->vars['gallery_medium_width'] || $this->ipsclass->vars['gallery_medium_height'] )\n \t \t {\n \t \t\t$img_load['out_file'] = 'med_' . $i[ 'masked_file_name' ];\n \t \t\t$img = new Image( $img_load );\n \t$img->ipsclass =& $this->ipsclass;\n \t$img->glib =& $this->glib;\n \t$img->lib_setup();\n \t \t\n \t \t\tif( $img->resize_proportional( $this->ipsclass->vars['gallery_medium_width'], $this->ipsclass->vars['gallery_medium_height'] ) )\n \t \t\t{\n \t \t\t\t$img->write_to_file();\t\n \t \t\t}\n \t \t\t\n \t \t\t/**\n \t \t\t* Did the picture already have one? If not, update DB record\n \t \t\t**/\n \t \t\tif( empty( $i['medium_file_name'] ) )\n \t \t\t{\n \t \t\t\t$this->ipsclass->DB->do_update( \"gallery_images\", array( 'medium_file_name' => $img_load['out_file'] ), \"id = {$i['id']}\" );\n \t \t\t\t$q2 = $this->ipsclass->DB->exec_query();\n \t \t\t}\n \t \t\tunset( $img );\n \t \t}\n } \n }\n else\n {\n $this->ipsclass->admin->error( \"No images match the options you specified, so no images were resized\" );\n }\n\n // Now we need to see if there are more images to do, or if we are done\n $this->ipsclass->DB->simple_construct( array( 'select' => 'count(id) AS images',\n 'from' => 'gallery_images',\n 'where' => \"category_id IN ( {$cats} ) {$album}\" ) );\n $this->ipsclass->DB->simple_exec();\n\n $count = $this->ipsclass->DB->fetch_row();\n\n $processed = $start + $this->ipsclass->input['num'];\n if( $processed >= $count['images'] )\n {\n $this->ipsclass->admin->save_log( \"Resized Images\" );\n $this->ipsclass->admin->done_screen(\"Images have been resized\", \"Gallery Manager\", \"section=components&act=gallery\" );\n }\n else\n {\n $start = $start + $total;\n $this->ipsclass->admin->redirect( \"cats={$cats}&num={$this->ipsclass->input['num']}&section=components&act=gallery&code=tools&tool=resize&op=do&album={$this->ipsclass->input['album']}&start={$start}\", \"<b>{$processed} images processed, moving on to the next batch...</b><BR>DO NOT exit the browser or press the stop button, or your images will not be finished resizing\" );\n $this->ipsclass->admin->output();\n }\n }", "function resize()\n {\n if( $this->ipsclass->input['op'] == 'do' )\n {\n $this->_do_resize();\n return;\n }\n\n // Thanks Mark!\n require( ROOT_PATH . 'modules/gallery/categories.php' );\n $this->category = new Categories;\n $this->category->ipsclass =& $this->ipsclass;\n $this->category->glib =& $this->gallery_lib;\n\n $this->category->read_data( false, 'Choose from the categories below:' );\n\n $options = $this->category->build_dropdown();\n\n $cat_select = \"<select name='cats[]' class='dropdown' multiple='multiple' size='10'>{$options}</select>\";\n\n $this->ipsclass->admin->page_title = \"Resize Images\";\n $this->ipsclass->admin->page_detail = \"This tool will allow you to resize the images in your gallery\";\n\n $this->ipsclass->adskin->td_header[] = array( \"Option\" , \"35%\" );\n $this->ipsclass->adskin->td_header[] = array( \"Value\" , \"65%\" );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'tools' ),\n 2 => array( 'act' , 'gallery' ),\n 3 => array( 'tool' , 'resize' ),\n 4 => array( 'op' , 'do' ),\n 5 => array( 'section', 'components' ),\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Resize Options\" );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n '<b>Choose which categories to resize images in</b>',\n $cat_select,\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n '<b>Resize album images as well?</b>',\n $this->ipsclass->adskin->form_yes_no( 'album', 1 ),\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n '<b>Number to resize per cycle</b>',\n $this->ipsclass->adskin->form_input( 'num', 100 ),\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->end_form( \"Begin Image Resizing\" );\n $this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n $this->ipsclass->admin->output(); \n }", "function td_bbp_change_avatar_size($author_avatar, $topic_id, $size) {\r\n$author_avatar = '';\r\nif ($size == 14) {\r\n$size = 40;\r\n}\r\n\r\n$topic_id = bbp_get_topic_id( $topic_id );\r\nif ( !empty( $topic_id ) ) {\r\nif ( !bbp_is_topic_anonymous( $topic_id ) ) {\r\n$author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );\r\n} else {\r\n$author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );\r\n}\r\n}\r\nreturn $author_avatar;\r\n}", "function path_add_image_sizes() {\n\n\tadd_image_size( 'path-thumbnail', 300, 170, true );\n\tadd_image_size( 'path-smaller-thumbnail', 80, 80, true );\n\tadd_image_size( 'path-slider-thumbnail', 660, 300, true );\n\t\n}", "public function after_setup_theme() {\n\t add_image_size('team-thumb', 100, 100, true); // 100px x 100px with hard crop enabled\n\t}", "public function testResizingImages()\n {\n }", "function resizeImage ( ) {/* Contructor */}", "public function resizePicture()\r\n {\r\n $width = Yii::$app->params['picture']['width'];\r\n $height = Yii::$app->params['picture']['height'];\r\n\r\n $manager = new ImageManager(['driver' => 'imagick']);\r\n\r\n $image = $manager->make($this->picture->tempName);\r\n $image->resize($width, $height, function ($constraint) {\r\n $constraint->aspectRatio();\r\n $constraint->upsize();\r\n })->save();\r\n }", "function avignon_thumbnail_sizes() {\n add_image_size( 'teacher-thumb', 220, 220, true );\n add_image_size( 'teacher-small-thumb', 60, 60, true );\n add_image_size( 'gallery-thumb', 290, 215, true );\n}", "function openlab_group_avatar_markup() {\n\t$group_type = cboxol_get_edited_group_group_type();\n\tif ( is_wp_error( $group_type ) ) {\n\t\treturn;\n\t}\n\n\t$the_group = groups_get_current_group();\n\t$the_group_id = null;\n\tif ( $the_group ) {\n\t\t$the_group_id = $the_group->id;\n\t}\n\n\t$scripts = array( 'bp-plupload', 'bp-avatar', 'bp-webcam' );\n\tforeach ( $scripts as $id => $script ) {\n\t\twp_enqueue_script( $id );\n\t}\n\n\t// Enqueue the Attachments scripts for the Avatar UI.\n\tbp_attachments_enqueue_scripts( 'BP_Attachment_Avatar' );\n\tbp_core_add_cropper_inline_css();\n\n\twp_enqueue_script( 'openlab-avatar-upload', get_template_directory_uri() . '/js/avatar-upload.js', array( 'bp-avatar' ), openlab_get_asset_version(), true );\n\n\t$existing_avatar = null;\n\tif ( $the_group_id ) {\n\t\t$existing_avatar = bp_core_fetch_avatar(\n\t\t\tarray(\n\t\t\t\t'item_id' => $the_group_id,\n\t\t\t\t'object' => 'group',\n\t\t\t\t'type' => 'full',\n\t\t\t\t'html' => false,\n\t\t\t)\n\t\t);\n\t}\n\n\t?>\n\n\t<div class=\"panel panel-default\" id=\"avatar-panel\">\n\t\t<div class=\"panel-heading semibold\"><label for=\"group-avatar\"><?php esc_html_e( 'Upload Avatar', 'commons-in-a-box' ); ?></label></div>\n\n\t\t<div class=\"panel-body\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-sm-8\">\n\t\t\t\t\t<div id=\"avatar-wrapper\">\n\t\t\t\t\t\t<div class=\"padded-img\">\n\t\t\t\t\t\t\t<?php if ( $existing_avatar ) : ?>\n\t\t\t\t\t\t\t\t<img class=\"img-responsive padded\" src =\"<?php echo esc_url( $existing_avatar ); ?>\" alt=\"<?php echo esc_attr( $the_group->name ); ?>\"/>\n\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t<img class=\"img-responsive padded\" src=\"<?php echo esc_url( cboxol_default_avatar( 'full' ) ); ?>\" alt=\"avatar-blank\" />\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"col-sm-16\">\n\n\t\t\t\t\t<p><?php echo esc_html( $group_type->get_label( 'avatar_help_text' ) ); ?></p>\n\n\t\t\t\t\t<?php // translators: Max upload size ?>\n\t\t\t\t\t<p><?php echo esc_html( sprintf( __( 'The maximum upload size is %s.', 'commons-in-a-box' ), size_format( wp_max_upload_size() ) ) ); ?></p>\n\n\t\t\t\t\t<p id=\"avatar-upload\">\n\t\t\t\t\t<div class=\"form-group form-inline avatar-upload-form\">\n\t\t\t\t\t\t<div class=\"form-control type-file-wrapper\">\n\t\t\t\t\t\t\t<input type=\"file\" name=\"file\" id=\"file\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input class=\"btn btn-primary top-align\" type=\"submit\" name=\"upload\" id=\"upload\" value=\"<?php esc_attr_e( 'Upload Image', 'commons-in-a-box' ); ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" id=\"action\" value=\"bp_avatar_upload\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<?php\n\t\t\t\t\t// Load Backbone template.\n\t\t\t\t\tbp_attachments_get_template_part( 'avatars/index' );\n\t\t\t\t\t?>\n\n\t\t\t\t\t<p class=\"italics\"><?php echo esc_html( $group_type->get_label( 'avatar_help_text_cant_decide' ) ); ?></p>\n\n\t\t\t\t\t<input type=\"hidden\" name=\"avatar-item-uuid\" value=\"<?php echo esc_attr( openlab_group_avatar_item_id() ); ?>\" />\n\t\t\t\t\t<?php wp_nonce_field( 'bp_avatar_upload' ); ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<?php\n}", "function openlab_group_avatar_markup() {\n\t$group_type = cboxol_get_edited_group_group_type();\n\tif ( is_wp_error( $group_type ) ) {\n\t\treturn;\n\t}\n\n\t$the_group = groups_get_current_group();\n\t$the_group_id = null;\n\tif ( $the_group ) {\n\t\t$the_group_id = $the_group->id;\n\t}\n\n\t$scripts = array( 'bp-plupload', 'bp-avatar', 'bp-webcam' );\n\tforeach ( $scripts as $id => $script ) {\n\t\twp_enqueue_script( $id );\n\t}\n\n\t// Enqueue the Attachments scripts for the Avatar UI.\n\tbp_attachments_enqueue_scripts( 'BP_Attachment_Avatar' );\n\tbp_core_add_cropper_inline_css();\n\n\twp_enqueue_script( 'openlab-avatar-upload', get_template_directory_uri() . '/js/avatar-upload.js', array( 'bp-avatar' ), openlab_get_asset_version(), true );\n\n\t$existing_avatar = null;\n\tif ( $the_group_id ) {\n\t\t$existing_avatar = bp_core_fetch_avatar(\n\t\t\tarray(\n\t\t\t\t'item_id' => $the_group_id,\n\t\t\t\t'object' => 'group',\n\t\t\t\t'type' => 'full',\n\t\t\t\t'html' => false,\n\t\t\t)\n\t\t);\n\t}\n\n\t?>\n\n\t<div class=\"panel panel-default\" id=\"avatar-panel\">\n\t\t<div class=\"panel-heading semibold\"><label for=\"group-avatar\"><?php esc_html_e( 'Upload Avatar', 'openlab-theme' ); ?></label></div>\n\n\t\t<div class=\"panel-body\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-sm-8\">\n\t\t\t\t\t<div id=\"avatar-wrapper\">\n\t\t\t\t\t\t<div class=\"padded-img\">\n\t\t\t\t\t\t\t<?php if ( $existing_avatar ) : ?>\n\t\t\t\t\t\t\t\t<img class=\"img-responsive padded\" src =\"<?php echo esc_url( $existing_avatar ); ?>\" alt=\"<?php echo esc_attr( $the_group->name ); ?>\"/>\n\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t<img class=\"img-responsive padded\" src=\"<?php echo esc_url( cboxol_default_avatar( 'full' ) ); ?>\" alt=\"avatar-blank\" />\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"col-sm-16\">\n\n\t\t\t\t\t<p><?php echo esc_html( $group_type->get_label( 'avatar_help_text' ) ); ?></p>\n\n\t\t\t\t\t<p><?php echo esc_html( sprintf( __( 'The maximum upload size is %s.', 'openlab-theme' ), size_format( wp_max_upload_size() ) ) ); ?></p>\n\n\t\t\t\t\t<p id=\"avatar-upload\">\n\t\t\t\t\t<div class=\"form-group form-inline avatar-upload-form\">\n\t\t\t\t\t\t<div class=\"form-control type-file-wrapper\">\n\t\t\t\t\t\t\t<input type=\"file\" name=\"file\" id=\"file\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input class=\"btn btn-primary top-align\" type=\"submit\" name=\"upload\" id=\"upload\" value=\"<?php _e( 'Upload Image', 'openlab-theme' ) ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" id=\"action\" value=\"bp_avatar_upload\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<?php\n\t\t\t\t\t// Load Backbone template.\n\t\t\t\t\tbp_attachments_get_template_part( 'avatars/index' );\n\t\t\t\t\t?>\n\n\t\t\t\t\t<p class=\"italics\"><?php echo esc_html( $group_type->get_label( 'avatar_help_text_cant_decide' ) ); ?></p>\n\n\t\t\t\t\t<input type=\"hidden\" name=\"avatar-item-uuid\" value=\"<?php echo esc_attr( openlab_group_avatar_item_id() ); ?>\" />\n\t\t\t\t\t<?php wp_nonce_field( 'bp_avatar_upload' ) ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<?php\n}", "function remote_avatar_dims()\n{\n\tglobal $db;\n\n\t$sql = 'SELECT user_id, user_avatar\n\t\tFROM ' . USERS_TABLE . '\n\t\tWHERE user_avatar_type = ' . AVATAR_REMOTE;\n\t$result = $db->sql_query($sql);\n\n\t$remote_avatars = array();\n\twhile ($row = $db->sql_fetchrow($result))\n\t{\n\t\t$remote_avatars[(int) $row['user_id']] = $row['user_avatar'];\n\t}\n\t$db->sql_freeresult($result);\n\n\tforeach ($remote_avatars as $user_id => $avatar)\n\t{\n\t\t$width = (int) get_remote_avatar_dim($avatar, 0);\n\t\t$height = (int) get_remote_avatar_dim($avatar, 1);\n\n\t\t$sql = 'UPDATE ' . USERS_TABLE . '\n\t\t\tSET user_avatar_width = ' . (int) $width . ', user_avatar_height = ' . (int) $height . '\n\t\t\tWHERE user_id = ' . $user_id;\n\t\t$db->sql_query($sql);\n\t}\n}", "function td_bbp_change_avatar_size($author_avatar, $topic_id, $size) {\r\n\t$author_avatar = '';\r\n\tif ($size == 14) {\r\n\t\t$size = 40;\r\n\t}\r\n\t$topic_id = bbp_get_topic_id( $topic_id );\r\n\tif ( !empty( $topic_id ) ) {\r\n\t\tif ( !bbp_is_topic_anonymous( $topic_id ) ) {\r\n\t\t\t$author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );\r\n\t\t} else {\r\n\t\t\t$author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );\r\n\t\t}\r\n\t}\r\n\treturn $author_avatar;\r\n}", "public function register_image_sizes() {\n\n }", "function register_image_sizes( $sizes ) {\n foreach ( $sizes as $id => $size ) {\n add_image_size( $id, $size['width'], $size['height'], $size['crop'] );\n }\n}", "private function registerImagesSizes(): void\n {\n add_image_size('our-works', 328, 272, true);\n add_image_size('cards', 326, 454, true);\n add_image_size('slider', 178, 252, true);\n }", "function resize($maxWidth = 0, $maxHeight = 0)\n\n\t{\n\n\t\tif(eregi('\\.png$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$img = ImageCreateFromPNG($this->userFullName);\n\n\t\t}\n\n\t\n\n\t\tif(eregi('\\.(jpg|jpeg)$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$img = ImageCreateFromJPEG($this->userFullName);\n\n\t\t}\n\n\t\n\n\t\tif(eregi('\\.gif$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$img = ImageCreateFromGif($this->userFullName);\n\n\t\t}\n\n\n\n \t$FullImageWidth = imagesx($img); \n\n \t$FullImageHeight = imagesy($img); \n\n\n\n\t\tif(isset($maxWidth) && isset($maxHeight) && $maxWidth != 0 && $maxHeight != 0)\n\n\t\t{\n\n\t\t\t$newWidth = $maxWidth;\n\n\t\t\t$newHeight = $maxHeight;\n\n\t\t}\n\n\t\telse if(isset($maxWidth) && $maxWidth != 0)\n\n\t\t{\n\n\t\t\t$newWidth = $maxWidth;\n\n\t\t\t$newHeight = ((int)($newWidth * $FullImageHeight) / $FullImageWidth);\n\n\t\t}\n\n\t\telse if(isset($maxHeight) && $maxHeight != 0)\n\n\t\t{\n\n\t\t\t$newHeight = $maxHeight;\n\n\t\t\t$newWidth = ((int)($newHeight * $FullImageWidth) / $FullImageHeight);\n\n\t\t}\t\t\n\n\t\telse\n\n\t\t{\n\n\t\t\t$newHeight = $FullImageHeight;\n\n\t\t\t$newWidth = $FullImageWidth;\n\n\t\t}\t\n\n\n\n \t$fullId = ImageCreateTrueColor($newWidth , $newHeight);\n\n\t\tImageCopyResampled($fullId, $img, 0,0,0,0, $newWidth, $newHeight, $FullImageWidth, $FullImageHeight);\n\n\t\t\n\n\t\tif(eregi('\\.(jpg|jpeg)$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$full = ImageJPEG($fullId, $this->userFullName,100);\n\n\t\t}\n\n\t\t\n\n\t\tif(eregi('\\.png$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$full = ImagePNG($fullId, $this->userFullName);\n\n\t\t}\n\n\t\t\n\n\t\tif(eregi('\\.gif$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$full = ImageGIF($fullId, $this->userFullName);\n\n\t\t}\n\n\t\tImageDestroy($fullId);\n\n\t\tunset($maxWidth);\n\n\t\tunset($maxHeight);\n\n\t}", "public function mosaicImages () {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get member If cache exists return that otherwise get member instance from display name
function & getMember($displayname) { if (!isset($this->_cache[$displayname])) { $this->_cache[$displayname] =& MEMBER::createFromName($displayname); } return $this->_cache[$displayname]; }
[ "public function getMember();", "public function getMember()\n {\n return Member::get_by_id(Member::class, $this->slug);\n }", "function get_by_key($key=\"\"){\r\n\t\t$member = $this->find(\"first\", array(\"conditions\"=>array(\"Member.username\"=>$key)));\r\n\t\tif (!$member){\r\n\t\t\t$member = $this->find(\"first\", array(\"conditions\"=>array(\"Member.id\"=>$key)));\r\n\t\t}\r\n\t\treturn $member;\r\n\t}", "public function getMember() {\n global ${'sess_user_name'};\n if(empty($this->oMember)){\n $sessionName = ${'sess_user_name'} ? ${'sess_user_name'} : 'user';\n $this->oMember = new CMS_Member($this->oSession, $sessionName);\n }\n return $this->oMember;\n }", "function get_member_by( $field, $value ) {\n\t$memberdata = MP_Member::get_mp_data_by( $field, $value );\n\n\tif ( ! $memberdata ) {\n\t\treturn false;\n\t}\n\n\t$member = new MP_Member;\n\t$member->init( $memberdata );\n\n\treturn $member;\n}", "public function getMember()\n {\n }", "public function get_member()\r\n {\r\n return $this->member;\r\n }", "function _load_member( $username )\n\t{\n\t\t$this->ipsclass->DB->cache_add_query( 'login_getmember', array( 'username' => strtolower($username) ) );\n\t\t$this->ipsclass->DB->cache_exec_query();\n\t\n\t\t$this->member = $this->ipsclass->DB->fetch_row();\n\t}", "protected function getMember($member) {\n\t\tif (isset($this->$member)) {\n\t\t\treturn $this->$member;\n\t\t}\n\t\treturn false;\n\t}", "private function getObject($name){\n return $this->cache->get($name);\n }", "public function getMember()\n {\n return $this->member;\n }", "function getItem($name){\n\t\t$i = cacheItem::getInstance($name);\n\t\tif(empty($i->cacheTime) && empty($i->content) ){\n\t\t\t$datas = $this->db->select_row(self::$tableName,'*',array('WHERE name=?',$name));\n\t\t\tif( false !== $datas)\n\t\t\t\t$i->setDatas($datas);\n\t\t}\n\t\treturn $i;\n\t}", "public function getMember()\n {\n if (array_key_exists('member', $this->_params)) {\n return $this->_params['member'];\n } else {\n return null;\n }\n }", "public function __get($member){\n return isset($this->json_result[$member])?$this->json_result[$member]:null;\n }", "public function get_member( $id )\n\t{\t\t\n\t\treturn $this->Member->find('first', array( \n\t\t\t\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t\t\t\t'Member.id' => $id\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) );\n\t}", "public function loadbyName($name)\n\t{\n\t\t$cache = CacheControl::getCache('models', $this->getType(), 'loadByName', $name);\n\n\t\t$id = $cache->getData();\n\n\t\tif($cache->isStale())\n\t\t{\n\t\t\t$db = DatabaseConnection::getConnection('default_read_only');\n\t\t\t$stmt = $db->stmt_init();\n\t\t\t$stmt->prepare('SELECT memgroup_id FROM memberGroup WHERE memgroup_name = ?');\n\t\t\t$stmt->bindAndExecute('s', $name);\n\n\t\t\tif($stmt->num_rows == 1)\n\t\t\t{\n\t\t\t\t$results = $stmt->fetch_array();\n\t\t\t\t$id = $results['memgroup_id'];\n\t\t\t}else{\n\t\t\t\t$id = false;\n\t\t\t}\n\t\t\t$cache->storeData($id);\n\t\t}\n\t\treturn $this->load($id);\n\t}", "public function getMemberUniqueName();", "private function &get_cache() {\r\n\t\tif ( self::$field ) {\r\n\t\t\treturn self::$field;\r\n\t\t} else if ( self::$section ) {\r\n\t\t\treturn self::$section;\r\n\t\t} else if ( self::$page ) {\r\n\t\t\treturn self::$page;\r\n\t\t} else {\r\n\t\t\treturn self::$falseVal;\r\n\t\t}\r\n\t}", "private function member_exists($name, $id = NULL)\r\n\t {\r\n\t \t//nullify string case\r\n\t \t$name = strtolower($name);\r\n\r\n\t \treturn $this->db->query(\"SELECT id FROM {$this->table}.members WHERE LOWER(name) = '{$name}'\")->fetchColumn();\r\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all Facturas models.
public function actionIndex() { $dataProvider = new ActiveDataProvider([ 'query' => Facturas::find(), ]); $model = new Facturas; return $this->render('index', [ 'dataProvider' => $dataProvider,'model'=>$model ]); }
[ "public function index()\n\t{\n\t\treturn Actividad::all();\n\t}", "public function actionIndex()\n {\n $model = new Financeiro();\n $searchModel = new FinanceiroSearch(['tipo' => 1]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new CategoriaFilmeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionListado()\n {\n try{\n $searchModel = new FondoFijoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams); \n \n }catch (\\Exception $e) { \n Yii::error('Fondo Fijo '.$e);\n Yii::$app->session->setFlash('error', Yii::$app->params['operacionFallida']);\n }\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n \n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('FantasiaBundle:Modelo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex()\n {\n $searchModel = new DetallecarritoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n { \n $searchModel = new FechasPagoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getFacturas() {\n $sql = \"select * from facturas\";\n $params = array(\n \":id_usuario\" => $idUsuario\n );\n $this->_db->execute($sql, $params);\n return $this->_db->fetchAll();\n }", "public function actionIndex()\n {\n $searchModel = new FestivoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MDWRosantBundle:Modelo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }", "public function actionIndex()\n {\n $searchModel = new MarcasSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new FincaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ItesACBackendBundle:Modelo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function facturas()\n {\n return $this->hasMany('App\\Factura');\n }", "public function actionIndex()\n {\n $searchModel = new CatciasSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex() {\n $searchModel = new ForoComentarioSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new ContenidosSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('INHack20ControlDistribucionBundle:Fiscalia')->findAll();\n\n return array('entities' => $entities);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an Array of Images.
public function getImages() { return $this->images_array; }
[ "public function getImages();", "abstract public function getImages();", "public function getImages() ;", "public function get_all_images()\n {\n $images = [];\n // Get all the files from the specified folder on the disk.\n $files = Storage::disk($this->workingDisk)->files($this->workingDir);\n\n foreach ($files as $key => $file) {\n // Create a full url for each image.\n $url = url('/') . '/storage/' . $file;\n\n // Add 2 keys in a returned array for the actual image and its full url\n $images[$key]['image'] = $file;\n $images[$key]['url'] = $url;\n }\n\n return $images;\n }", "function images()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $return_array = array();\r\n $image_array = array();\r\n\r\n $db->array_query( $image_array, \"SELECT ImageID FROM eZContact_CompanyImageDict WHERE CompanyID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $image_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZImage( $image_array[$i][$db->fieldName( \"ImageID\" )], false );\r\n }\r\n\r\n return $return_array;\r\n }", "function images()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $return_array = array();\r\n $image_array = array();\r\n\r\n $db->array_query( $image_array, \"SELECT ImageID FROM eZBug_BugImageLink WHERE BugID='$this->ID' ORDER BY Created\" );\r\n\r\n for ( $i = 0; $i < count( $image_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZImage( $image_array[$i][$db->fieldName( \"ImageID\" )], false );\r\n }\r\n return $return_array;\r\n }", "public function getImages()\n {\n return [\n 'method' => 'GET',\n 'path' => 'images',\n 'params' => [\n 'changessince' => $this->params->changessinceJson(),\n 'limit' => $this->params->limitJson(),\n 'marker' => $this->params->markerJson(),\n 'name' => $this->params->nameJson(),\n 'status' => $this->params->statusJson(),\n 'type' => $this->params->typeJson(),\n ],\n ];\n }", "public function getImagesArray()\n {\n if ($this->_imagesArray === null) {\n $this->_imagesArray = $this->getQueryCacheHelper((new Query())->from('{{%admin_storage_image}}')->select(['id', 'file_id', 'filter_id', 'resolution_width', 'resolution_height'])->indexBy('id'), self::CACHE_KEY_IMAGE);\n }\n\n return $this->_imagesArray;\n }", "public function get_all_images() {\n $output = [];\n\n foreach ($this->get_all_observations_by_time() as $raw_observation) {\n\n $observation = $this->get_observation($raw_observation);\n \n if (isset($observation['image'])) {\n array_push($output, $observation);\n }\n }\n\n return $output;\n }", "function get_images() \t{\n\t \t\treturn $this->getImages();\n\t \t}", "function images()\r\n {\r\n $return_array = array();\r\n $image_array = array();\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $image_array, \"SELECT ImageID FROM eZMail_MailImageLink WHERE MailID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $image_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZImage( $image_array[$i][$db->fieldName( \"ImageID\" )], false );\r\n }\r\n return $return_array;\r\n }", "public function getImages() {\n \n $conditions = array(\n 'post_id' => $this->id\n );\n \n $images = Image::all(array('conditions' => $conditions));\n return $images;\n }", "public function get_images()\r\n {\r\n // Makes sure we're loaded\r\n $this->load();\r\n\r\n // Image collection array\r\n $images = array();\r\n \r\n // For all found img tags\r\n foreach($this->document->getElementsByTagName('img') as $img)\r\n {\r\n // Extract what we want\r\n $image = array\r\n (\r\n 'src' => self::make_absolute($img->getAttribute('src'), $this->base),\r\n );\r\n \r\n // Skip images without src\r\n if( ! $image['src'])\r\n continue;\r\n\r\n // Add to collection. Use src as key to prevent duplicates.\r\n $images[$image['src']] = $image;\r\n }\r\n\r\n // Return values\r\n return array_values($images);\r\n }", "public function getImagens()\r\n\r\n {\r\n\r\n return $this->imagens->toArray();\r\n\r\n }", "public function getImages()\n {\n }", "public function getImages()\n {\n $images = [];\n\n $entries = $this->m_rar->getEntries();\n foreach ($entries as $index => $entry) {\n $name = $entry->getName();\n $size = $entry->getUnpackedSize();\n\n if (ImageArchive::isImage($name)) {\n $images[] = [\n 'name' => $name,\n 'size' => $size,\n 'index' => $index\n ];\n }\n }\n\n return $images;\n }", "public function gallery()\n {\n $this->_build_image_array();\n \n return $this->images;\n }", "public function imageList()\n\t\t{\n\t\t\t$statement = $this->_db->_pdo->prepare('call ImageList()');\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\t$arr = array();\n\t\t\t\t$statement->execute();\n\t\t\t\t\n\t\t\t\twhile ($row = $statement->fetch(PDO::FETCH_NUM)) \n\t\t\t\t{\n\t\t\t\t\tarray_push($arr,$row);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t\tcatch(PDOException $e)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}", "public function getAllImages()\n {\n return $this->all_images;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
echo "warn_about_impossible_opcache_types for $function $opcache_union_type $reflection_union_type\n";
function warn_about_impossible_opcache_types(string $function, UnionType $opcache_union_type, UnionType $reflection_union_type) : void { foreach ($opcache_union_type->getTypeSet() as $type) { if (!$type->asUnionType()->canCastToUnionType($reflection_union_type)) { echo "Incompatible type for $function found in zend_func_info.c: $type not in $reflection_union_type\n"; } } }
[ "function _fail_php_type_check($type, $function_name, $name, $value, $echo = false)\n{\n if ($echo) {\n echo 'TYPE_MISMATCH in \\'' . $function_name . '\\' (' . $name . ' is ' . (is_string($value) ? $value : strval($value)) . ' which is not a ' . $type . ')<br />';\n } else {\n attach_message(do_lang_tempcode('TYPE_MISMATCH', escape_html($function_name), escape_html($name), is_string($value) ? $value : strval($value)/*, $type*/), 'warn');\n }\n}", "function drush_idu_iduDrupal($op) {\n\n $function = 'idu_drush_drupal_'.$op;\n if (!function_exists($function)) { drush_log(\"The specified Drupal function '$function' does not exist!\", 'error'); }\n\n $count = call_user_func($function);\n $finish = date('H:i:s');\n idu_drush_log(\"Completed $count 'iduDrupal - $op' operations at $finish. \\n\", 'status');\n\n}", "function eval_operation($operation, $force_type = 'string') {\n\n $operation = str_replace('\"', '\\\\\"', $operation);\n $final_cmd = \"echo ($operation);\";\n $res = shell_exec('php -r \"'.$final_cmd.'\"');\n if (preg_match(\"/^\\nParse error/\", $res)) {\n log\\error('OPERATION_SYNTAX_ERROR', 'In '.basename(__FILE__).' > eval_operation, for expression :\"'.$final_cmd.'\"');\n return false;\n }\n return $res;\n}", "function om_warnings_get_warning_types()\n{\n\t// check if cache file exists, not - generate it\n\tif (!file_exists(FORUM_CACHE_DIR.'cache_om_warnings_types.php'))\n\t\tom_warnings_generate_types_cache();\n\n\trequire FORUM_CACHE_DIR.'cache_om_warnings_types.php';\n\treturn $om_warnings_types;\n}", "function enforce_special_type ($var, $type) {\n global $enforceable_data_types, $recognised_SQL_types;\n switch ($type) {\n case 'type':\n if (!in_array ($var, $enforceable_data_types)) {\n if (substr ($var, 0, 4) != 'eval') {\n $var = false;\n }\n }\n break;\n \n case 'sqltype':\n $found = false;\n foreach ($recognised_SQL_types as $group => $sql_types) {\n foreach ($sql_types as $sql_type) {\n if ($sql_type == $var) {\n $found = true;\n break 2;\n }\n }\n }\n if (!$found) {\n $var = false;\n }\n break;\n \n default:\n $var = false;\n }\n //echo \"Result: $var<br>\\n\";\n return $var;\n}", "function apc_bin_dump($files = null, $user_vars = null) {}", "function apc_clear_cache ($cache_type = null) {}", "function Zend_Server_Reflection_FunctionTest_function($var1, $var2, $var3 = null)\n{\n}", "function suggest_functions_to_fully_qualify_usage(int $status): void\n{\n global $argv;\n $program = $argv[0];\n fwrite($status != 0 ? STDERR : STDOUT, <<<EOT\nUsage: $program [options]\n\nDumps a stub that can be used to instrument the codebase for functions that should be changed to be fully qualified.\n\nOptions:\n -h, --help: Print this help message to stdout.\n\nEOT\n );\n exit($status);\n}", "function duplicateTypeInUnion( int | string /*comment*/ | INT $var) {}", "public function typeHinting(): string;", "function xmlrpc_get_type($value){}", "function op_opcode_array($d) {\n if (!$d) {\n return;\n }\n global $classname;\n $this->init_opcode = unserialize(serialize($d));\n $this->function_name = $d['FUNCTION_NAME'];\n $this->_out2(\"\",TRUE);\n $this->_out2(\"PHP_FUNCTION({$classname}_\".$d['FUNCTION_NAME']. \")\\n{\");\n \n \n \n## TODO = the base_function stuff needs sorting out - re: pointer or what...\n $out = \"\n /* dummy op codes */\n znode* result= (zend_op*) emalloc(sizeof(znode));\n znode* op1= (zend_op*) emalloc(sizeof(znode));\n znode* op2= (zend_op*) emalloc(sizeof(znode));\n \n zval* result_zv = (zval*) emalloc(sizeof(zval));\n zval* op1_zv = (zval*) emalloc(sizeof(zval));\n zval* op2_zv = (zval*) emalloc(sizeof(zval));\n \n zvalue* result_zvalue = (zval*) emalloc(sizeof(zvalue));\n zvalue* op1_zvalue = (zval*) emalloc(sizeof(zvalue));\n zvalue* op2_zvalue = (zval*) emalloc(sizeof(zvalue));\n int extended_value = 0;\n \n zend_execute_data execute_data;\n zend_function base_function; /* not really sure how this is needed.....*/\n \n \n base_function.type = {$d['TYPE']} ;\n base_function.function_name = \\\"{$d['FUNCTION_NAME']}\\\";\n \n EG(execute_data_ptr) = &execute_data;\n \n /* Initialize execute_data */\n execute_data.fbc = NULL;\n execute_data.object.ptr = NULL;\n execute_data.Ts = (temp_variable *) do_alloca(sizeof(temp_variable)*\".$d['T'].\");\n execute_data.original_in_execution=EG(in_execution);\n \n EG(in_execution) = 1;\n \n \n /* EG(opline_ptr) = &execute_data.opline; */\n \n execute_data.function_state.function = base_function;\n EG(function_state_ptr) = &execute_data.function_state;\n \n \";\n \n \n \n $this->_out2($out);\n \n \n if (@$this->args) {\n $out = \" if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\n \\\"\";\n $start_optional = FALSE;\n foreach($this->args as $d) {\n //print_r($d);\n \n if ($d['OPCODE'] == 64) { // RECV_INIT\n \n if (!$start_optional) {\n $out .= \"|\";\n $start_optional = TRUE;\n }\n }\n $out .= \"z\";\n }\n $out .= \"\\\" \";\n foreach($this->args as $d) {\n $out .= \", &\". $this->_get_zval_ptr_ptr(\"RESULT\", $d) ;\n }\n $out .=\")== FAILURE) return;\";\n $this->_out2($out);\n \n /* initialize values */\n foreach($this->args as $d) {\n if ($d['OPCODE'] != 64) { // RECV_INIT\n continue;\n }\n if (($d[\"OP2.u.constant.type\"] == IS_CONSTANT) || \n ($d[\"OP2.u.constant.type\"]==IS_CONSTANT_ARRAY)) {\n\t\t\t\t\t\techo \"NOT SUPPORTED YET\";\n exit;\n } else {\n // lets hope it was a string!\n $this->_out2(\"\n if (ZEND_NUM_ARGS() < {$d['OP1']}) {\n \");\n $this->_assign_zval(\"execute_data.Ts[{$d['RESULT.u.var']}].tmp_var\",$d['OP2.u.constant.val']);\n $this->_out2(\"\n }\n \");\n }\n }\n }\n \n \n }", "function dev_dump($argument,$heading=\"\",$dev=1,$query_trigger=0)\n {\n //print_r($_SERVER);\n //allows the whole lot to be switched off\n $all_off=0;\n //allows every dev dump encountered to be switched on\n $all_on=0;\n if (($dev&&!$all_off)||$all_on)\n {\n if (is_array($argument))\n {\n echo \"<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%; border:1px solid #4242ff; color:#4242ff; border-radius:2px;'>\";\n if ($query_trigger)\n {\n echo \"<span class='dd_q_out full_screen_width bold'><strong>\".$heading.\"</strong></span>\";\n }\n else\n {\n echo \"<span>ARRAY DUMP - <strong>\".$heading.\"</strong></span><br/><br/>\";\n }\n echo \"<span class='dd_a_out full_screen_width'>\";\n print_array(\"\",$argument);\n echo \"</span>\";\n echo \"</div>\";\n }\n else\n {\n if (is_numeric($argument))\n {\n echo \"<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%;border:1px solid #bf42bf; color:#bf42bf; border-radius:2px;'>\";\n $type='NUMBER';\n }\n else\n {\n if (is_null($argument))\n {\n echo \"<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%;border:1px solid #ff4242; color:#ff4242; border-radius:2px;'>\";\n $type='NULL';\n }\n else\n {\n echo \"<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%;border:1px solid #428f42; color:#428f42; border-radius:2px;'>\";\n $type='STRING / OTHER';\n }\n }\n echo \"<span>\".$type.\" DUMP - <strong>\".$heading.\"</strong></span><br/><br/>\";\n echo \"<span style='dd_v_out full_screen_width'>\";\n var_dump($argument);\n echo \"</span>\";\n echo \"</div>\";\n }\n echo \"\\n\\n\";\n if (!$query_trigger) {echo \"<span style='width:100%;height:10px;float:left;'></span>\";}\n }\n }", "function xmlrpc_get_type($value)\n{\n}", "function printOpcacheStatus()\n{\n echo 'Opcache status:'.PHP_EOL;\n print_r(opcache_get_status());\n}", "function syntax_analysis($token_array)\n{\n // Checks opcode and then required arguments types\n switch ($token_array[0]->data)\n {\n // OPCODE <var> <symb>\n case \"MOVE\":\n case \"INT2CHAR\":\n case \"STRLEN\":\n case \"TYPE\":\n case \"NOT\":\n check_params_number($token_array, 2);\n check_variable($token_array[1]);\n check_symbol($token_array[2]);\n break;\n\n // OPCODE\n case \"CREATEFRAME\":\n case \"PUSHFRAME\":\n case \"POPFRAME\":\n case \"RETURN\":\n case \"BREAK\":\n check_params_number($token_array, 0);\n break;\n\n // OPCODE <var>\n case \"DEFVAR\":\n case \"POPS\":\n check_params_number($token_array, 1);\n check_variable($token_array[1]);\n break;\n\n // OPCODE <label>\n case \"CALL\":\n case \"LABEL\":\n case \"JUMP\":\n check_params_number($token_array, 1);\n check_label($token_array[1]);\n break;\n\n // OPCODE <symb>\n case \"PUSHS\":\n case \"WRITE\":\n case \"EXIT\":\n case \"DPRINT\":\n check_params_number($token_array, 1);\n check_symbol($token_array[1]);\n break;\n\n // OPCODE <var> <symb_1> <symb_2>\n case \"ADD\":\n case \"SUB\":\n case \"MUL\":\n case \"IDIV\":\n case \"LT\":\n case \"GT\":\n case \"EQ\":\n case \"AND\":\n case \"OR\":\n case \"STRI2INT\":\n case \"CONCAT\":\n case \"STRLEN\":\n case \"GETCHAR\":\n case \"SETCHAR\":\n check_params_number($token_array, 3);\n check_variable($token_array[1]);\n check_symbol($token_array[2]);\n check_symbol($token_array[3]);\n break;\n\n // OPCODE <var> <type>\n case \"READ\":\n check_params_number($token_array, 2);\n check_variable($token_array[1]);\n check_type($token_array[2]);\n break;\n\n // OPCODE <label> <symb_1> <symb_2>\n case \"JUMPIFEQ\":\n case \"JUMPIFNEQ\":\n check_params_number($token_array, 3);\n check_label($token_array[1]);\n check_symbol($token_array[2]);\n check_symbol($token_array[3]);\n break;\n\n // Unknown OPCODE -> ERROR\n default:\n fwrite(STDERR, \"ERROR:Missing or invalid OPCODE.\\n\");\n exit(22);\n break;\n\n }\n}", "function TableOperation($tablename, $OP){\n global $CONN, $FUNC;\n\n if(!empty($tablename) && ereg(\"^CHECK$|^OPTIMIZE$|^REPAIR$\",$OP)){\n $query\t= \"$OP TABLE `$tablename`\";\n $result\t= $CONN->Execute($query) or $FUNC->ServerError(__FILE__,__LINE__,$CONN->ErrorMsg());\n $result = $result->fields;\n return \"Operation on table '\" . $tablename . \"' Result: <strong>\" . $result['Msg_text'] . \"</strong><br/>\";\n }\n else{\n return \"<strong>Invalid table operation!</strong>\";\n }\n}", "function mymodule_foo_some_type_bar() {\n\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get cache key by token
private function getCacheKey($token) { return sprintf('voucher-%s', $token); }
[ "public function getTokenCacheKey(): string\n {\n return $this->cache_key_token;\n }", "private function getTokenFromCache() {\n return $this->cache->fetch('token');\n }", "public function cacheKey();", "abstract function loadTokenFromCache();", "protected function cacheGet($key)\n {\n $cachedToken = $this->client->get($key);\n return $cachedToken;\n }", "public function findByKey($key, $token);", "public function cacheToken($token)\n {\n return Yii::$app->cache->set($token, $this->getId(), $this->getExpireTime());\n }", "public function getAccessTokenCacheKey()\n {\n return self::CACHE_KEY_ACCESS_TOKEN.$this->appId.$this->getAppId();\n }", "private function fetchToken()\n {\n // fetch it.\n $token = false;\n $hasCache = !is_null($this->cache);\n if ($hasCache) {\n $token = $this->cache->get($this->buildCacheKey(), $this->cacheConfig['lifetime']);\n }\n if (!$token) {\n $token = call_user_func($this->tokenFunc, $this->scopes);\n if ($hasCache) {\n $this->cache->set($this->buildCacheKey(), $token);\n }\n }\n return $token;\n }", "public function get($token);", "public function getCacheKey($key);", "private function extractKey($token)\n {\n return substr(base64_decode($token, true), 0, CSRFHandler::TOKEN_LENGTH);\n }", "protected function tokensCacheKey()\n\t{\n\t\treturn 's1:tokens:' . $this->config->getAuthenticationType() . ':' .\n\t\t $this->config->getAuthenticationActorId() . ':' . $this->customer . ':' .\n\t\t implode('|', $this->accounts);\n\t}", "public function getTokenKey()\n {\n return Mage::getStoreConfig('alliance_fivehundredfriends/access_credentials/token_key');\n }", "public static function getCacheIdentifier();", "protected function cacheKey(): string\n {\n return sha1($this->namespace . $this->getIp());\n }", "public function createTokenHash($token) {\n $hash = hash(Constants::constant('Cache')['HASH_ALGORITHM'], $token);\n return base64_encode($hash);\n }", "abstract function storeTokenToCache(Token $token);", "protected function getKeyForHashToken()\n {\n $key = $this->app['config']['app.key'];\n\n if (Str::startsWith($key, 'base64:')) {\n $key = base64_decode(substr($key, 7));\n }\n\n return $key;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create generic query for finding login history from sys_log
public function getQueryForUserLoginHistory(QueryBuilder $queryBuilder): QueryBuilder { $query = $queryBuilder ->select('sys_log.tstamp as login_date', 'sys_log.IP as login_ip', 'be_users.*') ->from('sys_log') ->join( 'sys_log', 'be_users', 'be_users', $queryBuilder->expr()->eq('be_users.uid', $queryBuilder->quoteIdentifier('sys_log.userId')) ) // Avoid deleted/disabled users ->where( $queryBuilder->expr()->eq('be_users.deleted', 0), $queryBuilder->expr()->eq('be_users.disable', 0) ) // Make sure to query login logs ->andWhere($queryBuilder->expr()->gt('sys_log.userId', 0)) ->andWhere($queryBuilder->expr()->gt('sys_log.tstamp', 0)) ->andWhere($queryBuilder->expr()->eq('sys_log.level', 0)) ->andWhere($queryBuilder->expr()->eq('sys_log.type', self::TYPE_LOGGED_IN)) ->andWhere($queryBuilder->expr()->eq('sys_log.action', self::ACTION_LOG_IN)) // Order by tstamp ->orderBy('sys_log.tstamp', 'desc') // Make sure only one login is shown per user ->groupBy('be_users.uid', 'sys_log.tstamp', 'sys_log.IP'); if (!self::getBackendUserAuthentication()->isAdmin()) { $query->andWhere($queryBuilder->expr()->eq('be_users.admin', 0)); } return $query; }
[ "public function getAuthHistory()\n {\n return $this->conn->getAll(\"SELECT user_name,user_login,user_ip,login_date,login_time FROM ?n LEFT JOIN ?n USING(user_id) ORDER BY login_date,login_time\", $this->history_table, $this->table);\n }", "function getUserLog () {\r\n\t\t$user_id = $_SESSION['user_id'];\r\n\t\t$query = \"SELECT * FROM log_entry WHERE user_id = '$user_id'\";\r\n\t\t$statement = db()->prepare( $query );\r\n\t\t$result = $statement->execute()? $statement->fetchAll( PDO::FETCH_ASSOC ): array();\r\n\t\treturn $result;\r\n\t}", "public function getlastLoginsInfo() {\n $criteria = new CDbCriteria();\n $criteria->compare('user_id', $this->id);\n $criteria->order = 'createTime DESC';\n $criteria->limit = 3;\n return UserLoginHistory::model()->findAll($criteria);\n }", "public function getLoginLog() {\n\ttry{\n\t\t$this->db->select('ll.tblLoginLogId,ll.UserId,ll.LoginType,ll.PanelType,ll.CreatedOn,CONCAT(u.FirstName,\" \",u.LastName) as UserName,ur.RoleName');\n\t\t$this->db->order_by('ll.tblLoginLogId',\"desc\");\n\t\t$this->db->join('tbluser u', 'u.UserId = ll.UserId', 'left');\n\t\t$this->db->join('tblmstuserrole ur', 'ur.RoleId = u.RoleId', 'left');\n\t\t$result = $this->db->get('tblloginlog as ll');\n\t\t$db_error = $this->db->error();\n\t\t\tif (!empty($db_error) && !empty($db_error['code'])) { \n\t\t\t\tthrow new Exception('Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message']);\n\t\t\t\treturn false; // unreachable return statement !!!\n\t\t\t}\t\t\n\t\t$res = array();\n\t\tif($result->result()) {\n\t\t\t$res = $result->result();\n\t\t}\n\t\treturn $res;\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\ttrigger_error($e->getMessage(), E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\t\n\t}", "function get_all_report_log($params) {\n $sql = \"SELECT a.*, b.user_name, b.operator_name, b.user_mail, b.lock_st, c.airlines_id, d.airlines_nm \n FROM com_user_login a \n LEFT JOIN com_user b ON b.user_id = a.user_id \n LEFT JOIN com_user_airlines c ON c.user_id = b.user_id \n LEFT JOIN airlines d ON d.airlines_id = c.airlines_id \n WHERE b.user_st = 'member' AND member_status = 'operator' AND b.operator_name LIKE ? AND d.airlines_nm LIKE ? \n ORDER BY a.login_date DESC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "function get_unread_login_logs($db)\r\n\t{\r\n\t\tif(!is_a($db,\"SQLite3\"))\r\n\t\t{\r\n\t\t\ttrigger_error(\"Handle passed to function get_unread_login_logs is not a valid database.\",E_USER_ERROR);\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\t//Create empty storage array\r\n\t\t$logs=array();\r\n\t\t//Prepare statement for selecting\r\n\t\t$statement=$db->prepare(\"SELECT ip,time,browser,status FROM system WHERE unread = 1\");\r\n\t\tif($statement !== false)\r\n\t\t{\r\n\t\t\t//Execute statement\r\n\t\t\t$result=$statement->execute();\r\n\t\t\tif($result !== false)\r\n\t\t\t{\r\n\t\t\t\t//Loop through all entries\r\n\t\t\t\twhile($entry=$result->fetchArray(SQLITE3_ASSOC))\r\n\t\t\t\t{\r\n\t\t\t\t\t//Setup default\r\n\t\t\t\t\t$logentry=array(\"ip\" => \"127.0.0.1\", \"time\" => 0, \"browser\" => \"ERROR\", \"status\" => 0, \"unread\" => 1);\r\n\t\t\t\t\t//Get data from result\r\n\t\t\t\t\tif(isset($entry[\"IP\"]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$logentry[\"ip\"]=$entry[\"IP\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(isset($entry[\"Time\"]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$logentry[\"time\"]=$entry[\"Time\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(isset($entry[\"Browser\"]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$logentry[\"browser\"]=$entry[\"Browser\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(isset($entry[\"Status\"]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$logentry[\"status\"]=$entry[\"Status\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Make log entry object\r\n\t\t\t\t\t$entryobject=new LoginLogEntry($logentry[\"ip\"],$logentry[\"browser\"],$logentry[\"time\"],$logentry[\"status\"],$logentry[\"unread\"]);\r\n\t\t\t\t\t//Add object to list\r\n\t\t\t\t\t$logs[]=$entryobject;\r\n\t\t\t\t}\r\n\t\t\t\t//Close statement\r\n\t\t\t\t$statement->close();\r\n\t\t\t\tunset($statement);\r\n\t\t\t\treturn $logs;\r\n\t\t\t}\r\n\t\t\t//Failed to execute statement\r\n\t\t\ttrigger_error(\"Failed to execute statement in function get_unread_login_logs.\",E_USER_ERROR);\r\n\t\t\tgoto failure;\r\n\t\t}\r\n\t\t//Failed to create statement\r\n\t\ttrigger_error(\"Failed to create statement in function get_unread_login_logs.\",E_USER_ERROR);\r\n\t\tfailure:\r\n\t\t//Close statement if necessary\r\n\t\tif(isset($statement) && is_a($statement,\"SQLite3Stmt\"))\r\n\t\t{\r\n\t\t\t$statement->close();\r\n\t\t\tunset($statement);\r\n\t\t}\r\n\t\t//Exit\r\n\t\treturn $logs;\r\n\t}", "function event_logging_getlogs($page = 1, $pagelength = 20, $filter = NULL)\n{\n $PHORUM = $GLOBALS[\"PHORUM\"];\n\n settype($page, \"int\");\n settype($pagelength, \"int\");\n settype($loglevel, \"int\");\n\n $offset = ($page-1)*$pagelength;\n\n $where = event_logging_create_where($filter);\n\n $sql = \"SELECT {$PHORUM[\"event_logging_table\"]}.log_id AS log_id,\n {$PHORUM[\"event_logging_table\"]}.source AS source,\n {$PHORUM[\"event_logging_table\"]}.category AS category,\n {$PHORUM[\"event_logging_table\"]}.loglevel AS loglevel,\n {$PHORUM[\"event_logging_table\"]}.message AS message,\n {$PHORUM[\"event_logging_table\"]}.details AS details,\n {$PHORUM[\"event_logging_table\"]}.ip AS ip,\n {$PHORUM[\"event_logging_table\"]}.hostname AS hostname,\n {$PHORUM[\"event_logging_table\"]}.user_id AS user_id,\n {$PHORUM[\"event_logging_table\"]}.datestamp AS datestamp,\n {$PHORUM[\"event_logging_table\"]}.vroot AS vroot,\n {$PHORUM[\"event_logging_table\"]}.forum_id AS forum_id,\n {$PHORUM[\"event_logging_table\"]}.thread_id AS thread_id,\n {$PHORUM[\"event_logging_table\"]}.message_id AS message_id,\n {$PHORUM[\"user_table\"]}.username AS username,\n {$PHORUM[\"user_table\"]}.email AS email,\n {$PHORUM[\"forums_table\"]}.name AS forum\n FROM {$PHORUM[\"event_logging_table\"]}\n LEFT JOIN {$PHORUM[\"user_table\"]}\n ON {$PHORUM[\"user_table\"]}.user_id = {$PHORUM[\"event_logging_table\"]}.user_id\n LEFT JOIN {$PHORUM[\"forums_table\"]}\n ON {$PHORUM[\"forums_table\"]}.forum_id = {$PHORUM[\"event_logging_table\"]}.forum_id\n $where\n ORDER BY log_id DESC\";\n \n if ($pagelength > 0) {\n $sql .= \"\n LIMIT $pagelength\n OFFSET $offset\";\n }\n \n\n return phorum_db_interact(DB_RETURN_ASSOCS, $sql);\n}", "public function getLogs() {\n\t\t$result = [];\n\n\t\tif ($this->getID() == null) { return []; }\n\n\t\t// Get access levels;\n\t\t$query = 'SELECT `time`, `data` FROM `joblogs` WHERE `job_id` = :jobid';\n\t\t$params = [':jobid' => $this->getID()];\n\t\t$statement = $this->getDB()->getPDO()->prepare($query);\n\t\t$statement->execute($params);\n\t\t$sqlresult = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($sqlresult as $row) {\n\t\t\t$result[] = $row;\n\t\t}\n\n\t\treturn $result;\n\t}", "function rlip_get_logs($where = '', $params = array(), $page = 0) {\n global $DB;\n\n //where clause\n $where_clause = '';\n if (!empty($where)) {\n $where_clause = \"WHERE {$where}\";\n }\n //offset, in records\n $offset = $page * RLIP_LOGS_PER_PAGE;\n //retrieve data\n $sql = \"SELECT log.*,\n user.firstname,\n user.lastname\n FROM {\".RLIP_LOG_TABLE.\"} log\n JOIN {user} user\n ON log.userid = user.id\n {$where_clause}\n ORDER BY log.starttime DESC\";\n return $DB->get_recordset_sql($sql, $params, $offset, RLIP_LOGS_PER_PAGE);\n}", "protected function getLogEntries() {\r\n\t\tglobal $TYPO3_DB; /* @var $TYPO3_DB t3lib_db */\r\n\r\n\t\t\t// Initialize result array:\r\n\t\t$resultArray = array(\r\n\t\t\t'message' => $this->cli_help['name'].chr(10).chr(10).$this->cli_help['description'],\r\n\t\t\t'headers' => array(\r\n\t\t\t\t'listing' => array('','',1),\r\n\t\t\t\t'allDetails' => array('','',0),\r\n\t\t\t),\r\n\t\t\t'listing' => array(),\r\n\t\t\t'allDetails' => array()\r\n\t\t);\r\n\r\n\t\t$rows = $TYPO3_DB->exec_SELECTgetRows(\r\n\t\t\t'*',\r\n\t\t\t'sys_log',\r\n\t\t\t'tstamp>' . ($GLOBALS['EXEC_TIME'] - $this->hours * 3600) . ' AND error = ' . $this->logLevel\r\n\t\t);\r\n\r\n\t\tforeach ($rows as $r) {\r\n\t\t\t$l = unserialize($r['log_data']);\r\n\t\t\t$explained = '#' . $r['uid'] . ' ' . t3lib_BEfunc::datetime($r['tstamp']) . ' USER[' . $r['userid'] . ']: '.sprintf($r['details'],$l[0],$l[1],$l[2],$l[3],$l[4],$l[5]);\r\n\t\t\t$resultArray['listing'][$r['uid']] = $explained;\r\n\t\t\t$resultArray['allDetails'][$r['uid']] = array($explained,t3lib_div::arrayToLogString($r,'uid,userid,action,recuid,tablename,recpid,error,tstamp,type,details_nr,IP,event_pid,NEWid,workspace'));\r\n\t\t}\r\n\r\n\t\treturn $resultArray;\r\n\t}", "function get_logs($select, $order='l.time DESC', $limitfrom='', $limitnum='', &$totalcount) {\n global $CFG;\n\n if ($limitfrom !== '') {\n $limit = sql_paging_limit($limitfrom, $limitnum);\n } else {\n $limit = '';\n }\n\n if ($order) {\n $order = 'ORDER BY '. $order;\n }\n\n $selectsql = $CFG->prefix .'log l LEFT JOIN '. $CFG->prefix .'user u ON l.userid = u.id '. ((strlen($select) > 0) ? 'WHERE '. $select : '');\n $countsql = $CFG->prefix.'log l '.((strlen($select) > 0) ? ' WHERE '. $select : '');\n\n $totalcount = count_records_sql(\"SELECT COUNT(*) FROM $countsql\");\n\n return get_records_sql('SELECT l.*, u.firstname, u.lastname, u.picture\n FROM '. $selectsql .' '. $order .' '. $limit);\n}", "public function actionLoginHistory()\n {\n $logModel = AdminUsersLoginLog::findByUserId(Yii::$app->user->identity->getId());\n\n return $this->render('login_history', [\n 'logModel' => $logModel,\n ]);\n }", "public function getUserLoginHistories()\n {\n return $this->hasMany(UserLoginHistory::className(), ['user_id' => 'id']);\n }", "public function getLoginhistory(Request $request)\n {\n $search = $request->search;\n $type = ($request->type == '') ? 'logged_time' : $request->type;\n $param['logged_time'] = ($request->logged_time == 1) ? 'asc' : 'desc';\n $param['staff_id'] = ($request->staff_id == 1) ? 'asc' : 'desc';\n $param['staff_name'] = ($request->staff_name == 1) ? 'asc' : 'desc';\n $param['ipaddress'] = ($request->ipaddress == 1) ? 'asc' : 'desc';\n Log::info('Login History.. ');\n $login_infos = DB::table('admin_login_info');\n if (!empty($search))\n {\n $login_infos = $login_infos->where('staff_name', 'like', '%'.$search.'%');\n }\n $login_infos = $login_infos->orderBy($type, $param[$type])\n ->orderBy('logged_time', $param['logged_time'])\n ->orderBy('staff_id', $param['staff_id'])\n ->orderBy('staff_name', $param['staff_name'])\n ->orderBy('ipaddress', $param['ipaddress']);\n\n $login_infos = $login_infos->paginate(15);\n return view(\"Admin::master.loginhistory\", ['login_infos'=>$login_infos]);\n }", "private static function queryLoginHistories($order = 'asc', $limit = 0) {\n global $wpdb;\n\n $sql = \"SELECT * FROM \" . self::tableName() . \" order by logged_in_at \" . $order;\n if (!empty($limit)) {\n $sql .= \" limit \" . $limit;\n }\n\n return $wpdb->get_results($sql);\n }", "public function getCurrentUserLogs(){\n return $this->em->getRepository(\"CoreBundle:log\")->findByUsername($this->security->getToken()->getUsername());\n }", "function get_system_logs_by_date($db,$start,$end)\r\n\t{\r\n\t\tif(!is_a($db,\"SQLite3\"))\r\n\t\t{\r\n\t\t\ttrigger_error(\"Handle passed to function get_system_logs_by_date is not a valid database.\",E_USER_ERROR);\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\t//Create empty storage array\r\n\t\t$logs=array();\r\n\t\t//Prepare statement for selecting\r\n\t\t$statement=$db->prepare(\"SELECT ip,time,page,text,unread FROM system WHERE time >= ? AND time <= ?\");\r\n\t\tif($statement !== false)\r\n\t\t{\r\n\t\t\t//Bind values to statement\r\n\t\t\t$debug=$statement->bindValue(1,$start,SQLITE3_INTEGER);\r\n\t\t\tif($debug === true)\r\n\t\t\t{\r\n\t\t\t\t$debug=$statement->bindValue(2,$end,SQLITE3_INTEGER);\r\n\t\t\t\tif($debug === true)\r\n\t\t\t\t{\r\n\t\t\t\t\t//Execute statement\r\n\t\t\t\t\t$result=$statement->execute();\r\n\t\t\t\t\tif($result !== false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//Loop through all entries\r\n\t\t\t\t\t\twhile($entry=$result->fetchArray(SQLITE3_ASSOC))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//Setup default\r\n\t\t\t\t\t\t\t$logentry=array(\"ip\" => \"127.0.0.1\", \"time\" => 0, \"page\" => \"ERROR\", \"text\" => \"Failed to obtain information. Drop kick a can of Pepsi Lime.\", \"unread\" => 1);\r\n\t\t\t\t\t\t\t//Get data from result\r\n\t\t\t\t\t\t\tif(isset($entry[\"IP\"]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$logentry[\"ip\"]=$entry[\"IP\"];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(isset($entry[\"Time\"]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$logentry[\"time\"]=$entry[\"Time\"];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(isset($entry[\"Page\"]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$logentry[\"page\"]=$entry[\"Page\"];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(isset($entry[\"Text\"]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$logentry[\"text\"]=$entry[\"Text\"];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//Make log entry object\r\n\t\t\t\t\t\t\t$entryobject=new SystemLogEntry($logentry[\"ip\"],$logentry[\"time\"],$logentry[\"page\"],$logentry[\"text\"],$logentry[\"unread\"]);\r\n\t\t\t\t\t\t\t//Add object to list\r\n\t\t\t\t\t\t\t$logs[]=$entryobject;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Close statement\r\n\t\t\t\t\t\t$statement->close();\r\n\t\t\t\t\t\tunset($statement);\r\n\t\t\t\t\t\treturn $logs;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Failed to execute statement\r\n\t\t\t\t\ttrigger_error(\"Failed to execute statement in function get_system_logs_by_date.\",E_USER_ERROR);\r\n\t\t\t\t\tgoto failure;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Failed to bind values to statement\r\n\t\t\ttrigger_error(\"Failed to bind values to statement in function get_system_logs_by_date.\",E_USER_ERROR);\r\n\t\t\tgoto failure;\r\n\t\t}\r\n\t\t//Failed to create statement\r\n\t\ttrigger_error(\"Failed to create statement in function get_system_logs_by_date.\",E_USER_ERROR);\r\n\t\tfailure:\r\n\t\t//Close statement if necessary\r\n\t\tif(isset($statement) && is_a($statement,\"SQLite3Stmt\"))\r\n\t\t{\r\n\t\t\t$statement->close();\r\n\t\t\tunset($statement);\r\n\t\t}\r\n\t\t//Exit\r\n\t\treturn $logs;\r\n\t}", "function readUserLogs(){\n \n // query to read all user records\n $query = \"SELECT\n *\n FROM \" . $this->table_name . \"\n WHERE user_id = ?\n ORDER BY id DESC\n \";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n $stmt->bindParam(1, $this->user_id);\n\n // execute query\n $stmt->execute();\n \n // return values\n return $stmt;\n }", "public function viewAllLogs()\n\t{\n\t\t$allLogs = array();\n\t\t\n\t\t$stmt=\"SELECT * FROM log ORDER BY log_id;\";\n\t\t$result=pg_query($stmt);\n\t\t\n\t\t//create an instance for every log entry and add it to the array\n\t\twhile($row=pg_fetch_assoc($result))\n\t\t\t$allLogs[] = new Log($row['log_id'], $row['log_date'], $row['log_time'], $row['type'], $row['whereabouts'], $row['username']);\n\t\t//return the array of all log entries\n\t\treturn $allLogs;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Take a entry id and generate row data from it for export.
protected function generate_row_data( $entry ) { $columns = $this->get_column_names(); $row = array(); foreach ( $columns as $column_id => $column_name ) { $column_id = strstr( $column_id, ':' ) ? current( explode( ':', $column_id ) ) : $column_id; $value = ''; if ( isset( $entry->meta[ $column_id ] ) ) { // Filter for entry meta data. $value = $entry->meta[ $column_id ]; if ( is_serialized( $value ) ) { $value = $this->implode_values( maybe_unserialize( $value ) ); } $value = apply_filters( 'everest_forms_html_field_value', $value, $entry->meta[ $column_id ], $entry, 'export-csv' ); } elseif ( is_callable( array( $this, "get_column_value_{$column_id}" ) ) ) { // Handle special columns which don't map 1:1 to entry data. $value = $this->{"get_column_value_{$column_id}"}( $entry ); } $row[ $column_id ] = sanitize_text_field( $value ); } return apply_filters( 'everest_forms_entry_export_row_data', $row, $entry ); }
[ "abstract protected function get_id($entry);", "protected function _getEntryRecordId($id)\n {\n // ensure we have a category id.\n $this->_checkIdSet('get entry record id');\n\n return static::$_storageSubPath\n . '/' . $this->getId()\n . '/' . static::encodeEntryId($id);\n }", "function mrbsGetEntryInfo($id)\n{\n\tglobal $tbl_entry;\n\n\t$sql = \"SELECT start_time, end_time, entry_type, repeat_id, room_id,\n\t timestamp, create_by, name, type, description\n FROM $tbl_entry WHERE (ID = $id)\";\n\t\n\t$res = sql_query($sql);\n\tif (! $res) return;\n\t\n\t$ret = \"\";\n\tif(sql_count($res) > 0)\n\t{\n\t\t$row = sql_row($res, 0);\n\t\t\n\t\t$ret[\"start_time\"] = $row[0];\n\t\t$ret[\"end_time\"] = $row[1];\n\t\t$ret[\"entry_type\"] = $row[2];\n\t\t$ret[\"repeat_id\"] = $row[3];\n\t\t$ret[\"room_id\"] = $row[4];\n\t\t$ret[\"timestamp\"] = $row[5];\n\t\t$ret[\"create_by\"] = $row[6];\n\t\t$ret[\"name\"] = $row[7];\n\t\t$ret[\"type\"] = $row[8];\n\t\t$ret[\"description\"] = $row[9];\n\t}\n\tsql_free($res);\n\t\n\treturn $ret;\n}", "public function entry_data( $reportfield_id,$entry_id,&$entryobj ){\n\t \t//this function will suffix for 90% of plugins who only have one value field (named value) i\n\t \t//in the _ent table of the plugin. However if your plugin has more fields you should override\n\t \t//the function \n\t \t\n\t\t//default entry_data \t\n\t\t$fieldname\t=\t$reportfield_id.\"_field\";\n\t \t\n\t \t\n\t \t$entry\t=\t$this->dbc->get_pluginentry_ddsta($this->tablename,$entry_id,$reportfield_id,true);\n \n\t\tif (!empty($entry)) {\n\t\t \t$fielddata\t=\tarray();\n\n\t\t \t//loop through all of the data for this entry in the particular entry\t\t \t\n\t\t \tforeach($entry as $e) {\n\t\t \t\t$fielddata[]\t=\t$e->parent_id;\n\t\t \t}\n\t\t \t\n\t\t \t//save the data to the objects field\n\t \t\t$entryobj->$fieldname\t=\t$fielddata;\n\t \t}\n\t }", "public function entry_data( $reportfield_id,$entry_id,&$entryobj ){\n //this function will suffice for 90% of plugins who only have one value field (named value) i\n //in the _ent table of the plugin. However if your plugin has more fields you should override\n //the function\n\n //default entry_data\n $fieldname\t=\t$reportfield_id.\"_field\";\n\n $entry\t=\t$this->dbc->get_pluginentry($this->tablename,$entry_id,$reportfield_id,true);\n\n if (!empty($entry)) {\n\n $fielddata\t=\tarray();\n\n //loop through all of the data for this entry in the particular entry\n foreach($entry as $e) {\n $fielddata[$e->parent_id]\t=\t$e->parent_id;\n }\n\n //save the data to the objects field\n $entryobj->$fieldname\t=\t$fielddata;\n }\n\n }", "public function getEntry($id);", "function getEntry($entryId)\r\n {\r\n \r\n }", "protected function getEntryById($id)\n {\n /*\n * Prepare the query and execute it\n */\n $sql = \"SELECT\n id, page, title, subhead, body, img, imgcap, data1, data2,\n data3, data4, data5, data6, data7, data8, author, created\n FROM `\".DB_NAME.\"`.`\".DB_PREFIX.\"entryMgr`\n WHERE id=?\n LIMIT 1\";\n $stmt = $this->mysqli->prepare($sql);\n $stmt->bind_param(\"i\", $id);\n return $this->loadEntryArray($stmt);\n }", "public function ToEntry();", "public function getEntryId();", "public function get_entry( $entry_id ) {\n\t\t/** @var \\wpdb $wpdb */\n\t\tglobal $wpdb;\n\t\t$entry = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->actionscheduler_logs} WHERE log_id=%d\", $entry_id ) );\n\n\t\treturn $this->create_entry_from_db_record( $entry );\n\t}", "abstract protected function convertToData($row);", "public function getExportRow();", "private function _timesheet_row_data($id) {\n $options = array(\"id\" => $id);\n $data = $this->Timesheets_model->get_details($options)->row();\n return $this->_make_timesheet_row($data);\n }", "public static function set_external_atomic_id_to_row($id,$row) {\n\n\t\t$row['external_atomic_id']= $id;\n\t\treturn $row;\n\t}", "public function getEpgEntryById($id) {\r\n\t\t\t$this->stmtGetEntryById->bindParam(1, $id, SQLITE3_INTEGER);\r\n\t\t\t$res = $this->stmtGetEntryById->execute();\r\n\t\t\t$row = $res->fetchArray(SQLITE3_ASSOC);\r\n\t\t\t$res->finalize();\r\n\t\t\treturn getEpgEntryByRow($row);\r\n\t\t}", "function zenbu_get_table_data($entry_ids, $field_ids, $channel_id)\n\t{\n\t\t$output = array();\n\t\t\n\t\t$this->EE->db->from('cartthrob_order_items');\n\t\t$this->EE->db->where_in('order_id', $entry_ids);\n\t\t$this->EE->db->order_by('row_order');\n\t\t$query = $this->EE->db->get();\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$output['order_id_'.$row['order_id']]['row_id_'.$row['row_id']]['entry_id'] = $row['entry_id'];\n\t\t\t\t$output['order_id_'.$row['order_id']]['row_id_'.$row['row_id']]['title'] = $row['title'];\n\t\t\t\t$output['order_id_'.$row['order_id']]['row_id_'.$row['row_id']]['quantity'] = $row['quantity'];\n\t\t\t\t$output['order_id_'.$row['order_id']]['row_id_'.$row['row_id']]['price'] = $row['price'];\n\t\t\t\t$output['order_id_'.$row['order_id']]['row_id_'.$row['row_id']]['extra'] = unserialize(base64_decode($row['extra']));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "public function setEntryId($entryId);", "public function getEntryId() {\n return $this->id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the number of contacts in the system
public function getContactsCount() { return $this->getItemsCount(self::ITEM_CONTACTS); }
[ "public function getNumberContacts()\n {\n global $db_conn;\n\n $this->contacts = array();\n $sql\n = \"SELECT COUNT(*) as number\n FROM user_contacts\n WHERE id_user = '{$this->id}'\";\n if ($result = $db_conn->query($sql)) {\n $row = $result->fetch_assoc();\n return $row['number'];\n } else {\n die(\"Error: \" . $db_conn->error);\n }\n }", "public function getNrContacts()\n {\n\n return $this->nr_contacts;\n }", "public function getContactListCount()\n {\n return $this->count(self::CONTACTLIST);\n }", "public function countPersonContacts()\n {\n\n $db = $this->getDb();\n \n $sql = <<<SQL\nSELECT\n count(contact.rowid) as number\nFROM\n core_contact_r contact\nJOIN core_person_r person\n ON contact.id_person = person.rowid\nWHERE person.type = 1;\n \nSQL;\n \n return $db->select($sql)->getField('number');\n\n }", "public function count()\n {\n return $this->contact->count();\n }", "public static function nbContactsSelected() {\n $total = self::search();\n $selected_contacts = Count($total);\n return $selected_contacts;\n echo $this->templates->render('home');\n }", "public function getContactsNum(){\n //Prepare Query\n $this->db->query('select contactID from contacts');\n\n //Execute\n $this->db->execute();\n \n\n //Fetch One record\n $numRows=$this->db->rowCount();\n \n return $numRows;\n \n }", "public function count()\n {\n return (int) $this->phoneNumbers;\n }", "function get_address_count() {\n\t\t$address_count_query = $this->db->query(\"SELECT count(a.sys_contact_id) FROM contact a LEFT JOIN contact_verified v ON (a.sys_contact_id=v.sys_contact_id) WHERE v.sys_contact_id IS NULL AND a.contact_type='Address' AND a.country='AUSTRALIA' AND a.end_date='infinity';\");\n\t\t\n\t\treturn $address_count_query[0]['count'];\n\t}", "public function contact_count() {\n $userid = $this->session->userdata('aileenuser');\n\n $contition_array = array('not_read' => '2');\n $search_condition = \"((contact_to_id = '$userid' AND status = 'pending') OR (contact_from_id = '$userid' AND status = 'confirm'))\";\n $contactperson = $this->common->select_data_by_search('contact_person', $search_condition, $contition_array, $data = 'count(*) as total', $sortby = 'contact_id', $orderby = '', $limit = '', $offset = '', $join_str = '', $groupby = '');\n\n $contactcount = $contactperson[0]['total'];\n echo $contactcount;\n }", "public function getTotalContactCount() //for all assigned quires\n\t\t{\n\t\t\t\n\t\t\t\t$this->load->model('admin/Users_model', 'users');\n\t\t\t\t$data['queryCount'] = $this->users->getContactTotalCount();\n\t\t\t\techo $data['queryCount'];\n\t\t\t\n\t\t}", "public function getNumberOfImportedContacts()\n {\n $this->addFieldToFilter('email_imported', ['notnull' => true]);\n\n return $this->getSize();\n }", "public function get_unread_contact_messages_count()\n\t{\n\t\t$this->db->where('is_admin_view', 0);\n\t\t$query = $this->db->get('contacts');\n\t\treturn $query->num_rows();\n\t}", "function getContactsAbsCount() {\n return $this->contactsAbsCount;\n }", "public static function get_user_contacts_count($userobject = null) {\n global $USER, $DB, $CFG;\n if (!$userobject) {\n $userobject = $USER;\n }\n\n $userblogcount = count($DB->get_records('message_contacts', array('userid' => $userobject->id)));\n\n return $userblogcount;\n }", "public function getPhoneCount()\n {\n return $this->count(self::phone);\n }", "public function getAssignedContactCount() //for all assigned quires\n\t\t{\n\t\t\t\n\t\t\t\t$this->load->model('admin/Users_model', 'users');\n\t\t\t\t$data['queryCount'] = $this->users->getContactAssignedCount();\n\t\t\t\techo $data['queryCount'];\n\t\t\t\n\t\t}", "public function test_count_contacts() {\n $user1 = self::getDataGenerator()->create_user();\n $user2 = self::getDataGenerator()->create_user();\n $user3 = self::getDataGenerator()->create_user();\n\n $this->assertEquals(0, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::create_contact_request($user1->id, $user2->id);\n\n // Still zero until the request is confirmed.\n $this->assertEquals(0, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::confirm_contact_request($user1->id, $user2->id);\n\n $this->assertEquals(1, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::create_contact_request($user3->id, $user1->id);\n\n // Still one until the request is confirmed.\n $this->assertEquals(1, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::confirm_contact_request($user3->id, $user1->id);\n\n $this->assertEquals(2, \\core_message\\api::count_contacts($user1->id));\n }", "function wd_ac_count_address() {\n\tglobal $wpdb;\n\treturn (int) $wpdb->get_var( \"SELECT count( id ) FROM {$wpdb->prefix}ac_addresses\" );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method used to get a userId from a user's email
private function getUserId($email) { // Get a reference to the database $db = JFactory::getDbo(); // Query the database $query = $db->getQuery(true); $query->select('id') ->from('#__users ') ->where('email = ' . "'". $email . "'" ); $db->setQuery($query); // If the query was not successful if (!$db->query()) { $this->setError($this->_db->getErrorMsg()); return -1; } // Get the result and return the userId $rows = $db->loadObjectList(); $userId = $rows[0]->id; return $userId; }
[ "function authSupportGetUserIdFromEmail($email)\n {\n }", "function getUserIDFromEmail($email){\n $user = getUserFromEmail($email);\n return $user['userID'];\n }", "function getUserId($email) {\n $stmt = $this->conn->prepare(\"select id from users where agentId=3134 and email like :email and type = 1\");\n $stmt->bindValue('email', $email);\n $stmt->execute();\n\n $row = $stmt->fetch(\\PDO::FETCH_ASSOC);\n if (isset($row['id'])) {\n return intval($row['id']);\n }\n\n return 0;\n }", "function user_id_from_email($email) {\n\t\t$email = sanitize($email);\n\t\treturn mysqli_fetch_array(mysqli_query(connection(), \"select User_Id from users where email = '$email'\"));\n\t}", "function get_user_id( $email )\n{\n $db = new Database_handler();\n $command = 'SELECT id FROM t_users WHERE email = \"'.$email.'\"';\n $results = $db->query_table( $command );\n\n return $results[0]['id'];\n}", "function get_user_id($email){\n\t$data = fetch_single('user','id','email',$email);\n\tif($data){\n\t\treturn $data;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "public function getUID(string $email):int;", "protected function userIDEmail ($email)\n {\n \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('email'=>$email),\n )\n ));\n if(!empty($user))\n {\n $id=0;\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n }\n return $id; \n } \n }", "public function obtainIdUser($userMail){\n $user = DB::table('users')->where('email',$userMail)->value('id');\n return $user;\n }", "protected function selectOnIdUser_m($email){\n $sql = \"SELECT `id` FROM `tbl_user` WHERE `email`=:email\";\n $result = $this->pdo->prepare($sql);\n $result->bindParam(\":email\", $email);\n $result->execute();\n return $result->fetch(PDO::FETCH_ASSOC);\n }", "function email_to_id($user)\n\t{\n\t\treturn select(self::$table)->where('user_email = \"'.$user.'\"')->limit(1)->result('user_id');\t\t\n\t}", "public function getUserId(){\n\t\t\t$loginId = $this->loginId;\n\t\t\t$userId = '';\n\t\t\t$query = \"SELECT user_id FROM \" . USERS . \" WHERE email='$loginId' OR mobile='$loginId'\";\n\t\t\t$db = $this->db;\n\t\t\t$resultMap = $db->selectOperation($query);\n\t\t\t// file_put_contents(\"testlog.log\", \"\\n\".print_r($resultMap, true), FILE_APPEND | LOCK_EX);\n\t\t\t$userId = $resultMap['result_data'][0]['user_id'];\n\t\t\treturn $userId;\n\t\t}", "function find_user_id($email){\n\t\t$pdo = PDO2::getInstance();\n\t\t\n\t\t$query = $pdo->prepare(\"SELECT user_id FROM tbl_user WHERE user_mail = :email_addr \");\n\t\t\n\t\t$query->bindValue(':email_addr',$email);\n\t\t\n\t\t$query->execute();\n\t\t\n\t\tif ($result = $query->fetch(PDO::FETCH_ASSOC)) {\n\t\t\n\t\t\t$query->closeCursor();\n\t\t\treturn $result['user_id'];\n\t\t}\n\t\t\treturn false;\n\t}", "public function getIdEmailByEmail($email){\n $row = $this->db->run(\"SELECT id, username, email FROM users WHERE email=? LIMIT 1\", [$email])->fetch();\n return $row;\n }", "public function findId($email_address) {\n\t\t$id = $this->find ( 'first', array (\n\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t'email' => $email_address \n\t\t\t\t),\n\t\t\t\t'fields' => array (\n\t\t\t\t\t\t'id' \n\t\t\t\t) \n\t\t) );\n\t\tif (isset ( $id ['InvitedUser'] )) {\n\t\t\treturn $id ['InvitedUser'] ['id'];\n\t\t}\n\t}", "public function get_user_id();", "function get_user_id_from_string($email_or_login)\n {\n }", "private function getUserId() {\n $request = $this->getRequest();\n return empty($request['uid']) ? $this->getAccount()->uid : $request['uid'];\n }", "public function getExternalUserId($userId);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get season id by serial and season number
public static function getSeasonId($serial_id, $season_number){ $query = "SELECT id FROM item WHERE parent_id={$serial_id} and number={$season_number} and type=3"; $database = new Database(); $season = $database->getOne($query); if($season){ return $season['id']; } return -1; }
[ "public static function getSeriaId($season_id, $seria_number){\n $query = \"SELECT id FROM item WHERE parent_id={$season_id} and number={$seria_number} and type=4\";\n $database = new Database();\n $seria = $database->getOne($query);\n if($seria){\n return $seria['id'];\n }\n return -1;\n }", "public function getIdSeason()\n {\n return $this->id_season;\n }", "function getSeasonId()\n {\n return $this->__seasonid ;\n }", "private function getSeason($idSerie, $seasonNumber)\r\n\t{\r\n\t\t$modelSeasonDB = MyMovieSeason::model()->findByAttributes(array(\r\n\t\t\t\t\t\t\t\t\t\t\t'Id_my_movie_serie_header'=>$idSerie,\r\n\t\t\t\t\t\t\t\t\t\t\t'season_number'=>$seasonNumber,\r\n\t\t));\r\n\t\r\n\t\tif(!isset($modelSeasonDB))\r\n\t\t{\r\n\t\t\t$myMoviesAPI = new MyMoviesAPI();\r\n\t\t\t$response = $myMoviesAPI->LoadSeasonBanners($idSerie, $seasonNumber);\r\n\t\t\t\t\r\n\t\t\tif(!empty($response) && (string)$response['status'] == 'ok')\r\n\t\t\t{\r\n\t\t\t\tforeach($response->Banners->children() as $item)\r\n\t\t\t\t{\r\n\t\t\t\t\tif((string)$item['Number'] == \"1\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$modelMyMovieSeason = new MyMovieSeason;\r\n\t\t\t\t\t\t$modelMyMovieSeason->Id_my_movie_serie_header = $idSerie;\r\n\t\t\t\t\t\t$modelMyMovieSeason->season_number = (string)$item['SeasonNumber'];\r\n\t\r\n\t\t\t\t\t\t//banner\r\n\t\t\t\t\t\t$modelMyMovieSeason->banner_original = (string)$item['File'];\r\n\t\t\t\t\t\t$newFileName = $idSerie .'_'.$seasonNumber;\r\n\t\t\t\t\t\t$modelMyMovieSeason->banner = self::getImage($modelMyMovieSeason->banner_original, $newFileName);\r\n\t\r\n\t\t\t\t\t\tif($modelMyMovieSeason->save())\r\n\t\t\t\t\t\t\treturn $modelMyMovieSeason->Id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\treturn $modelSeasonDB->Id;\r\n\t\r\n\t\treturn null;\r\n\t}", "public function getSeason(): string\n {\n $month = (int) $this->date->format('n');\n\n $season = array_filter($this->seasons, function ($range) use ($month) {\n return in_array($month, $range);\n });\n\n return key($season);\n }", "public function getSeasonIdAttribute()\n {\n $videoIds = $this->id;\n $seasonName = Season::whereHas('videoSeason', function ($query) use ($videoIds) {\n $query->where('video_id', $videoIds);\n })->select('id')->where('is_active', 1)->first();\n\n return !empty($seasonName) ? $seasonName->id : '';\n }", "public function getCurrentSeason()\n {\n $response = $this->seasons()->data();\n $this->clearQuery();\n foreach ($response as $season) {\n if ($season->attributes->isCurrentSeason) {\n $seasonID = $season->id;\n }\n }\n return $seasonID;\n }", "function getActiveSeasonId()\n {\n $query = sprintf('SELECT id FROM %s WHERE season_status = \"%s\"',\n WPST_SEASONS_TABLE, WPST_SEASONS_SEASON_ACTIVE) ;\n\n $this->setQuery($query) ;\n $this->runSelectQuery() ;\n\n\t // Make sure we only have one query result ...\n\n if ($this->getQueryCount() == 1)\n $id = $this->getQueryResult() ;\n else\n $id = array('id' => null) ;\n\n\t return $id['id'] ;\n }", "public function getSeasonNumber()\n {\n return $this->seasonNumber;\n }", "function get_year($idSeason)\n{\n $year = get_year_db($idSeason);\n return $year;\n}", "function getActiveSeasonId()\n {\n return $this->__active_season_id ;\n }", "public function getSeason(){\n\t\treturn $this->getTextualSeason($this->season);\n\t}", "public function getSeason()\n {\n return $this->hasOne(Season::className(), ['id' => 'season_id']);\n }", "function getSaison($id){\n return ORM::for_table('seasons')->find_one($id);\n\n}", "public function getSeason()\r\n {\r\n return $this->season;\r\n }", "public static function season()\n {\n $seasons = array(\"Winter\", \"Spring\", \"Summer\", \"Autumn\");\n\n return $seasons[(int) ((date(\"n\") %12)/3)];\n }", "public function getSeason()\n {\n return $this->season;\n }", "public function getReleaseSeasonNumber()\n {\n return $this->releaseSeasonNumber;\n }", "public function getSeason() {\n return $this->season;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Detects and resolves the types declared by the specified $tagName on the provided $member.
private function parseTagTypes($member, $tagName) { $class = $member->getDeclaringClass(); $typeDeclaration = $this->getTag($member, $tagName); // Split up type declaration $types = explode('|', $typeDeclaration); $result = array(); foreach ($types as $type) { $resolvedType = $this->parser->resolveType($type, $class, $member); // Skip if null if ($resolvedType === null) { continue; } // Validate resolved type if (!class_exists($resolvedType) && !interface_exists($resolvedType)) { throw new InvalidClassException($resolvedType, $member); } // Strip preceding backslash to make a valid FQN $result[] = ltrim($resolvedType, '\\'); } return $result; }
[ "private function getTags($member, $tagName)\n\t{\n\t\tif ($member instanceof ReflectionParameter)\n\t\t{\n\t\t\t// Look for a tag for a specific variable\n\t\t\t$expression = '/@'.preg_quote($tagName).'\\s+([^\\s]+)\\s+\\$'.preg_quote($member->name).'/';\n\t\t\t$docBlock = $member->getDeclaringFunction()->getDocComment();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Generic tag search\n\t\t\t$expression = '/@'.preg_quote($tagName).'\\s+([^\\s]+)/';\n\t\t\t$docBlock = $member->getDocComment();\n\t\t}\n\n\t\treturn preg_match_all($expression, $docBlock, $matches) ? $matches[1] : null;\n\t}", "private function resolve_types()\n {\n foreach ($this->scope->iter(SYM_NS2) as $sym) \n switch ($sym->kind) {\n case SYM_KIND_CLASS:\n $this->resolve_class($sym);\n break;\n case SYM_KIND_TRAIT:\n $this->resolve_trait($sym);\n break;\n case SYM_KIND_IFACE:\n $this->resolve_iface($sym);\n break;\n default:\n assert(0);\n }\n }", "public function walkTypeName(nodes\\TypeName $node);", "public function getTypeByNamespace($uri, $localName);", "public function resolveNamedTypes()\n {\n $toLookup = array();\n foreach ($this->namedTypes as $className => $namedType) {\n assert($namedType instanceof NamedType);\n\n if ($namedType->isResolved()) {\n unset($this->namedTypes[$className]);\n continue;\n }\n\n if (null !== $class = $this->getClass($className, self::LOOKUP_NO_CACHE)) {\n $namedType->setReferencedType($class);\n unset($this->namedTypes[$className]);\n continue;\n }\n\n $toLookup[$className] = true;\n }\n\n $lookedUp = array();\n while ($toLookup) {\n $classes = $this->typeProvider->loadClasses(array_keys($toLookup));\n foreach ($classes as $className => $class) {\n $this->namedTypes[$className]->setReferencedType($class);\n unset($this->namedTypes[$className]);\n }\n\n // The loadClasses call from above might have resulted in new NamedTypes\n // which we now need to also lookup.\n $lookedUp = array_merge($lookedUp, $toLookup);\n $toLookup = array_diff_key($this->namedTypes, $lookedUp);\n }\n }", "private function findType($typeName)\n {\n if (!is_callable(self::$lookUp) || !is_callable(self::$register)) {\n throw \\Exception(\"Please define a registry first\");\n }\n\n return call_user_func_array(self::$lookUp, array($typeName));\n }", "private function _resolveType(PHP_UML_Metamodel_Package &$pkg, &$element, \n array &$pkgDef, PHP_UML_Metamodel_Type &$context)\n {\n // Is it a datatype ?\n $_o = $this->_searchIntoDatatype($element);\n if (!($_o===false)) {\n $element = $_o;\n } else {\n\n // Is there a \"::\" in it ?\n list($pos, $first, $last) = $this->getPackagePathParts($element, false);\n if (!($pos===false)) {\n $tmpPkg = &$this->_getPackageFromPath($first); \n if (is_null($tmpPkg)) {\n $this->_resolutionWarning($element, $context->file->name);\n $element = null;\n } else {\n // Do we know that package?\n $_o = $this->searchTypeIntoPackage($tmpPkg, $last);\n if (!($_o===false)) {\n $element = $_o;\n } else {\n $this->_resolutionWarning($element, $context->file->name);\n $element = null;\n }\n }\n } else {\n\n // Is it in the current package?\n $_o = $this->searchTypeIntoPackage($pkg, $element);\n if (!($_o===false)) {\n $element = $_o;\n } else {\n // Is it in one of the \"default\" packages?\n $found = false;\n foreach ($pkgDef as $itemPkg) {\n $_o = $this->searchTypeIntoPackage($itemPkg, $element);\n if (!($_o===false)) {\n $element = $_o;\n $found = true;\n break;\n }\n }\n if (!$found) {\n $this->_resolutionWarning($element, $context->file->name);\n $element = null;\n }\n }\n }\n }\n }", "function UnionMemberTypes($string)\n{\n [$equals, $substr] = Punctuator($string);\n if ($equals !== '=') {\n return [null, $string];\n }\n\n [$types, $substr] = getRepeating(\n $substr,\n function ($types, $substr) {\n [$pipe, $substr] = Punctuator($substr);\n if (count($types) >= 1 && $pipe !== '|') {\n return null;\n }\n\n [$type, $nextSubstr] = NamedType($substr);\n if ($type === null) {\n return null;\n }\n\n if (isset($types[$type['value']])) {\n Parser::throwInvalid(\n \"Member type `{$type['value']}` is already included.\",\n $substr\n );\n }\n\n $types[$type['value']] = ['name' => $type['value']];\n return [$types, $nextSubstr];\n },\n [],\n 1\n );\n if ($types === null) {\n Parser::throwSyntax('NamedType', $substr);\n }\n\n return [$types, $substr];\n}", "public function visitTypeUnion(Node $node);", "private static function parseSclass($members) {\n\t\t$parser = new SqoolTypeParser($members);\n\n\t\tif( ! $parser->sclass($result)) {\n\t\t\tthrow new cept(\"Couldn't parse sclass: \".$parser->failureTrace(true));\n\t\t}\n\n\t\t$members = array();\n\t\tforeach($result['fieldsInfo'] as $name => &$memberAttributes) {\n\t\t\tself::verifySqoolTypes($memberAttributes['typeParameters']);\n\t\t\tif( ! array_key_exists('sqlName', $memberAttributes)) {\n\t\t\t\t$memberAttributes['sqlName'] = strtolower($name);\t// default sql name\n\t\t\t}\n\n\t\t\t$members[$memberAttributes['sqlName']] = $name;\n\t\t}\n\n\t\t$result['members'] = $members;\n\n\t\t// default id field\n\t\tif( ! array_key_exists('idMember', $result)) {\n\t\t\tif(array_key_exists('id', $result['fieldsInfo'])) {\n\t\t\t\tthrow new cept(\"'id' defined as a non-id member without choosing a replacement id member. Please define an id or change the name for the member 'id'.\");\n\t\t\t}\n\n\t\t\t$result['idMember'] = 'id';\n\t\t\t$result['fieldsInfo']['id'] = array('sqlName'=>'id', 'typeParameters'=>array('id'));\t// add an object id field\n\t\t\t$result['fieldsInfo'] = array_merge(\n\t\t\t\tarray('id'=>array('sqlName'=>'id', 'typeParameters'=>array('id'))),\n\t\t\t\t$result['fieldsInfo']\n\t\t\t);\n\t\t\t$result['members']['id'] = 'id';\n\t\t}\n\n\n\t\treturn $result;\n\t}", "public function getBindingType($typeName, $packageName);", "public function getDataType($member) {\n return $this->data_types[$member];\n }", "public function count_member_types( $member_type = '' ) {\n\t\tglobal $wpdb;\n\t\t$member_types = bp_get_member_types();\n\n\t\tif ( empty( $member_type ) || empty( $member_types[ $member_type ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$count_types = wp_cache_get( 'bpmt_count_member_types', 'bpmt_extended' );\n\n\t\tif ( ! $count_types ) {\n\t\t\tif ( ! bp_is_root_blog() ) {\n\t\t\t\tswitch_to_blog( bp_get_root_blog_id() );\n\t\t\t}\n\n\t\t\t$sql = array(\n\t\t\t\t'select' => \"SELECT t.slug, tt.count FROM {$wpdb->term_taxonomy} tt LEFT JOIN {$wpdb->terms} t\",\n\t\t\t\t'on' => 'ON tt.term_id = t.term_id',\n\t\t\t\t'where' => $wpdb->prepare( 'WHERE tt.taxonomy = %s', $this->taxonomy ),\n\t\t\t);\n\n\t\t\t$count_types = $wpdb->get_results( join( ' ', $sql ) );\n\t\t\twp_cache_set( 'bpmt_count_member_types', $count_types, 'bpmt_extended' );\n\n\t\t\trestore_current_blog();\n\t\t}\n\n\t\t$type_count = wp_filter_object_list( $count_types, array( 'slug' => $member_type ), 'and', 'count' );\n\t\t$type_count = array_values( $type_count );\n\n\t\tif ( empty( $type_count ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn (int) $type_count[0];\n\t}", "protected function applyTypeDefinitionManipulators(): void\n {\n foreach ($this->documentAST->types as $typeDefinition) {\n foreach (\n $this->directiveLocator->associatedOfType($typeDefinition, TypeManipulator::class) as $typeManipulator\n ) {\n $typeManipulator->manipulateTypeDefinition($this->documentAST, $typeDefinition);\n }\n }\n }", "private function _getRestrictionsFromUnion(array $unionelement)\n\t {\n\t\t$restrictions = array();\n\t\t$simpletypes = explode(\" \", $unionelement[\"attributes\"][\"memberTypes\"]);\n\t\tforeach ($simpletypes as $simpletype)\n\t\t {\n\t\t\t$chosensimpletype = null;\n\t\t\tforeach ($this->schemaKeeper[$this->schemaPrefix . \"simpleType\"] as $simpletypecandidate)\n\t\t\t {\n\t\t\t\tif (isset($simpletypecandidate[\"attributes\"][\"name\"]) === true &&\n\t\t\t\t$simpletypecandidate[\"attributes\"][\"name\"] === $simpletype)\n\t\t\t\t {\n\t\t\t\t\t$chosensimpletype = $simpletypecandidate[\"schemakeeperlocation\"];\n\t\t\t\t\tbreak;\n\t\t\t\t }\n\t\t\t } //end foreach\n\n\t\t\tif ($chosensimpletype === null)\n\t\t\t {\n\t\t\t\t$restriction = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t \"type\" => $simpletype,\n\t\t\t\t\t\t \"values\" => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t );\n\n\t\t\t\t$restrictions = $this->_mergeRestrictions($restrictions, $restriction);\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\t$restrictions = $this->_mergeRestrictions($restrictions, $this->_getRestrictionsIterate($chosensimpletype));\n\t\t\t }\n\t\t } //end foreach\n\n\t\treturn $restrictions;\n\t }", "protected function locateDeclarations()\n {\n foreach ($this->tokens as $TID => $token) {\n switch ($token[self::TOKEN_TYPE]) {\n case T_NAMESPACE:\n $this->registerNamespace($TID);\n break;\n\n case T_USE:\n $this->registerUse($TID);\n break;\n\n case T_FUNCTION:\n $this->registerFunction($TID);\n break;\n\n case T_CLASS:\n case T_TRAIT;\n case T_INTERFACE:\n if (\n $this->tokens[$TID][self::TOKEN_TYPE] == T_CLASS\n && isset($this->tokens[$TID - 1])\n && $this->tokens[$TID - 1][self::TOKEN_TYPE] == T_PAAMAYIM_NEKUDOTAYIM\n ) {\n //PHP5.5 ClassName::class constant\n continue;\n }\n\n $this->registerDeclaration($TID, $token[self::TOKEN_TYPE]);\n break;\n\n case T_INCLUDE:\n case T_INCLUDE_ONCE:\n case T_REQUIRE:\n case T_REQUIRE_ONCE:\n $this->hasIncludes = true;\n }\n }\n }", "public static function checkCampaignMemberTag($campaign, $member)\n {\n if (!empty($campaign->promotion['tags'])) {\n if (empty($member->tags)) {\n $msg = Yii::t('product', 'member_tag_empty');\n LogUtil::info(['msg' => $msg, 'memberId' => (string)$member->_id, 'campaignId' => (string)$campaign->_id], self::PROMOTION_LOG);\n return ['campaign' => [], 'status' => self::CODE_STATUS_INVALID, 'message' => $msg];\n }\n $flag = false;\n foreach ($member->tags as $tag) {\n if (in_array($tag, $campaign->promotion['tags'])) {\n $flag = true;\n break;\n }\n }\n if (false === $flag) {\n $msg = Yii::t('product', 'member_tag_limit');\n LogUtil::info(['msg' => $msg, 'memberId' => (string)$member->_id, 'campaignId' => (string)$campaign->_id], self::PROMOTION_LOG);\n return ['campaign' => [], 'status' => self::CODE_STATUS_INVALID, 'message' => $msg];\n }\n }\n return ['campaign' => $campaign];\n }", "public function search(string $name): ?Type\n {\n if (isset($this->types[$name])) {\n return $this->types[$name];\n }\n\n if (isset($this->documentAST->types[$name])) {\n return $this->types[$name] = $this->handle($this->documentAST->types[$name]);\n }\n\n if (isset($this->lazyTypes[$name])) {\n return $this->types[$name] = $this->lazyTypes[$name]();\n }\n\n $standardTypes = Type::getStandardTypes();\n if (isset($standardTypes[$name])) {\n return $this->types[$name] = $standardTypes[$name];\n }\n\n return null;\n }", "private function getEventTypeFromTagName(string $tagName): int\n {\n switch (strtolower($tagName)) {\n case 'nodeadded':\n return EventInterface::NODE_ADDED;\n case 'noderemoved':\n return EventInterface::NODE_REMOVED;\n case 'propertyadded':\n return EventInterface::PROPERTY_ADDED;\n case 'propertyremoved':\n return EventInterface::PROPERTY_REMOVED;\n case 'propertychanged':\n return EventInterface::PROPERTY_CHANGED;\n case 'nodemoved':\n return EventInterface::NODE_MOVED;\n case 'persist':\n return EventInterface::PERSIST;\n default:\n throw new RepositoryException(sprintf(\"Invalid event type '%s'\", $tagName));\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get currect git commit id
public static function getGitCommitId( $repoRoot ){ // Check git exists $whichGit = `which git`; if(empty($whichGit)){ return ''; }; // Check we're in a git repo $gitFolder = str_replace('//','/',$repoRoot.'/.git'); if( ! is_dir($gitFolder) ){ return ''; }; // $test = shell_exec("cd $repoRoot; git rev-parse HEAD;"); return trim($test); }
[ "public function getCommitId();", "function getGitCommitId( $repoRoot ){\n // Check git exists\n $whichGit = `which git`;\n if(empty($whichGit)){ return ''; };\n \n // Check we're in a git repo\n $gitFolder = str_replace('//','/',$repoRoot.'/.git');\n if( ! is_dir($gitFolder) ){ return ''; };\n \n // \n $test = shell_exec(\"cd $repoRoot; git rev-parse HEAD;\");\n return trim($test);\n \n \n}", "public function getCommitId() : string\n {\n return $this->commitId;\n }", "public function getOriginalCommitId() : string\n {\n return $this->originalCommitId;\n }", "public function getGitCommit(): string;", "public function getLastCommitId()\n\t\t{\n\t\t\t$result = $this->run('log', '--pretty=format:%H', '-n', '1');\n\t\t\t$lastLine = $result->getOutputLastLine();\n\t\t\treturn new CommitId((string) $lastLine);\n\t\t}", "public static function getCommit(): string\n {\n $git_head_file = dirname(__DIR__) . \"/.git/HEAD\";\n if (file_exists($git_head_file)) {\n $lines = explode(\"\\n\", trim(file_get_contents($git_head_file)));\n $next_file = dirname(__DIR__) . \"/.git/\";\n foreach ($lines as $line) {\n if (substr($line, 0, 5) == \"ref: \") {\n $next_file .= substr($line, 5);\n break;\n }\n }\n $commit_hash = '';\n if ($next_file === dirname(__DIR__) . \"/.git/\")\n $commit_hash = substr(trim($lines[0]), 0, 7);\n else\n $commit_hash = substr(trim(file_get_contents($next_file)), 0, 7);\n return $commit_hash;\n } else {\n return '';\n }\n }", "function git_hash()\n {\n return exec('git rev-parse HEAD');\n }", "protected function commit()\n {\n return trim(shell_exec('git rev-parse HEAD'));\n }", "private function getGitCommit()\n {\n return $this->getCachedOrShellExecute(\n $this->makeGitHashRetrieverCommand(),\n static::VERSION_CACHE_KEY,\n $this->config('build.length')\n );\n }", "public static function getCurrentCommit() {\n\t\tif (false && file_exists(VZ_DIR . '/.git/HEAD')) {\n\t\t\t$head = file_get_contents(VZ_DIR . '/.git/HEAD');\n\t\t\treturn substr(file_get_contents(VZ_DIR . '/.git/' . substr($head, strpos($head, ' ')+1, -1)), 0, -1);\n\t\t}\n\t\telseif (function_exists(\"shell_exec\")) {\n\t\t\treturn shell_exec('git show --pretty=format:%H --quiet');\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getCommitID(): ?string\n {\n return $this->commitID;\n }", "private function getGitCommitHash(): string\n {\n if (file_exists($this->gitCommitFilePath)) {\n return file_get_contents($this->gitCommitFilePath);\n } else {\n return '';\n }\n }", "public function getLastCommitId()\n\t{\n\t\treturn $this->lastCommitId;\n\t}", "public function getCurrentSha(ProjectRoot $projectRoot): GitCommit;", "public function getGitCommitUrl()\n {\n return $this->git_commit_url;\n }", "public function GetCommit()\n\t{\n\t\treturn $this->GetProject()->GetCommit($this->commitHash);\n\t}", "function get_commit_hash(): ?string\n {\n $commitHash = base_path('.commit_hash');\n\n if (file_exists($commitHash)) {\n return trim(exec(sprintf('cat %s', $commitHash)));\n }\n\n if (is_dir(base_path('.git'))) {\n return trim(exec('git log --pretty=\"%h\" -n1 HEAD'));\n }\n\n return null;\n }", "public function getCommitHash()\n {\n return $this->commitHash;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A flag to indicate if a connection is active. Generated from protobuf field bool is_connection_enabled = 6;
public function getIsConnectionEnabled() { return $this->is_connection_enabled; }
[ "public function setIsConnectionEnabled($var)\n {\n GPBUtil::checkBool($var);\n $this->is_connection_enabled = $var;\n\n return $this;\n }", "public function isConnectionOpen(): bool;", "protected function _isActive() {\n\t\treturn connection_status() === CONNECTION_NORMAL && !connection_aborted();\n\t}", "private function getConnectionStatus() {\n return $this->connectionStatus;\n }", "public function getConnectionStatus()\n\t{\n\t\treturn $this->getAttribute(PDO::ATTR_CONNECTION_STATUS);\n\t}", "public function hasConnectionSettings();", "public function getConnectionStatus()\r\n\t{\r\n\t\t$conn = $this->getConnection();\r\n\t\treturn $conn->getAttribute(constant(\"PDO::ATTR_CONNECTION_STATUS\"));\r\n\t}", "public function getConnectionStatus()\n\t{\n\t\t$conn = $this->getConnection();\n\t\treturn $conn->getAttribute(constant(\"PDO::ATTR_CONNECTION_STATUS\"));\n\t}", "public function getConnectionStatus()\n\t{\n\t\t$conn = $this->getConnection();\n\t\treturn $conn->getAttribute(constant(\"PDO::ATTR_CONNECTION_STATUS\"));\n }", "public function isConnect() : bool;", "public function isConnected()\n {\n return isset($this->socket);\n }", "public function isConnected()\n {\n if ($this->isconnected == 1)\n {\n if ($this->dbhandle != FALSE)\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n return FALSE;\n }\n }", "public function hasConnection(): bool\n {\n return !($this->connection === null);\n }", "public function getEnableConnection()\n {\n if (array_key_exists(\"enableConnection\", $this->_propDict)) {\n return $this->_propDict[\"enableConnection\"];\n } else {\n return null;\n }\n }", "public function isConnected()\n {\n return !is_null($this->user);\n }", "function isConnected()\r\n {\r\n return $this->dao->isConnected();\r\n }", "public function hasConnectionSettings()\n {\n return isset($this->connectionSettings);\n }", "public function isConnected()\r\n {\r\n return $this->_row->isConnected();\r\n }", "public function supports(ConnectionInterface $connection): bool;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply scope in current Query
protected function applyScope() { if (isset($this->scopeQuery) && is_callable($this->scopeQuery)) { $callback = $this->scopeQuery; $this->model = $callback($this->model); } return $this; }
[ "protected function applyScope()\n {\n foreach ($this->scopeQuery as $callback) {\n if (is_callable($callback)) {\n $this->query = $callback($this->query);\n }\n }\n\n // Clear scopes\n $this->scopeQuery = [];\n\n return $this;\n }", "protected function applyScope()\n {\n if (isset($this->scopeQuery) && is_callable($this->scopeQuery)) {\n $callback = $this->scopeQuery;\n $this->query = $callback($this->query);\n }\n return $this;\n }", "protected function applyScope() {\n\t\t\tif(isset($this->scopeQuery) && is_callable($this->scopeQuery)) {\n\t\t\t\t$callback = $this->scopeQuery;\n\t\t\t\t$this->model = $callback($this->model);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function applyScope()\n {\n if (isset($this->scopeQuery) && is_callable($this->scopeQuery)) {\n $callback = $this->scopeQuery;\n $this->model = $callback($this->model);\n }\n\n return $this;\n }", "protected function applyScope()\n {\n if ($this->scopeQueries->count() > 0) {\n foreach ($this->scopeQueries as $scopeQuery) {\n if (is_callable($scopeQuery)) {\n $scopedModel = $scopeQuery($this->model);\n\n if ($scopedModel === null) {\n throw new RepositoryException('Scope query has returned NULL model. Check you code.');\n }\n\n $this->model = $scopedModel;\n }\n }\n }\n\n return $this;\n }", "public function applyScope($scope)\n {\n $this->getSelect()->where('main_table.scope = ?', $scope);\n return $this;\n }", "public static function applyScopes()\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $instance */\n return $instance->applyScopes();\n }", "public static function applyScopes()\n {\n return \\Illuminate\\Database\\Eloquent\\Builder::applyScopes();\n }", "public function applyScopes($query)\n {\n if (!empty($this->scopes)) {\n $scopes = $this->scopes;\n foreach ($scopes as $scope) {\n $scope($query);\n }\n }\n foreach ($this->getFields() as $field) {\n $query = $field->applyScopes($query);\n }\n\n foreach ($this->getPlugins() as $plugin) {\n $pluginResult = $plugin->applyScopes($query);\n if ($pluginResult !== null) {\n $query = $pluginResult;\n }\n }\n\n return $query;\n }", "public function scope(Builder $query, Context $context): void\n {\n }", "public function applyScopes() : Builder\n {\n if (! $this->scopes) {\n return $this;\n }\n\n $builder = clone $this;\n\n foreach ($this->scopes as $scope) {\n $builder->callScope(function (Builder $builder) use ($scope) {\n // If the scope is a Closure we will just go ahead and call the scope with the\n // builder instance. The \"callScope\" method will properly group the clauses\n // that are added to this query so \"where\" clauses maintain proper logic.\n if ($scope instanceof Closure) {\n $scope($builder);\n }\n\n // If the scope is a scope object, we will call the apply method on this scope\n // passing in the builder and the model instance. After we run all of these\n // scopes we will return back the builder instance to the outside caller.\n if ($scope instanceof Scope) {\n $scope->apply($builder, $this->getMapper());\n }\n });\n }\n\n return $builder;\n }", "public function scopeCurrent($query) {\n return $query->where('terms.start_date', '<=', DB::raw('NOW()'))->where('terms.end_date', '>=', DB::raw('NOW()'));\n }", "protected function overwriteCurrentScope() : void\n {\n foreach ($this->currentScope as $index => $currentScope) {\n foreach ($currentScope as $key => $value) {\n if (isset($this->additionalQueryFields[$value['key']])) {\n $this->currentScope[$index][$key] = $this->additionalQueryFields[$value['key']];\n\n //if we overwrite remove\n unset($this->additionalQueryFields[$value['key']]);\n }\n }\n }\n\n //add additional queries if we didn't overwrite\n if (isset($this->currentScope[0])) {\n /**\n * Overwrite the last joiner when combining query and additional params\n * by leaving it blank we use the default query behavior AND.\n */\n $this->currentScope[0][count($this->currentScope[0]) - 1]['joiner'] = '';\n $this->currentScope[0] = (array_values(($this->currentScope[0] + $this->additionalQueryFields)));\n }\n }", "public function scopeActive($query)\n {\n $yqr = YearQuarter::current()->first();\n\n return $this->scopeActiveAsOfYearQuarter($query, $yqr->YearQuarterID);\n /*return $query->where('EffectiveYearQuarterBegin', '<=', $yqr->YearQuarterID)\n ->where('EffectiveYearQuarterEnd', '>=', $yqr->YearQuarterID);*/\n }", "public function scopeActive ($query){\n\n return $query -> where('active',1);\n\n }", "public function scopeCurrent($query)\n {\n return $query->where('start_date', '>=', Carbon::now())\n ->orWhere('end_date', '>=', Carbon::now());\n }", "public function scopeActive($query){\n return $query->where('active',1);\n }", "public function scopePublic(Builder $query);", "public function scopeFeatureType($query);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }