query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Function to get post slider widgets design | function bdpp_post_slider_widget_designs() {
$design_arr = array(
'design-1' => esc_html__('Design 1', 'blog-designer-pack'),
'design-2' => esc_html__('Design 2', 'blog-designer-pack'),
'design-3' => esc_html__('Design 3', 'blog-designer-pack'),
'design-4' => esc_html__('Design 4', 'blog-designer-pack'),
);
return apply_filters( 'bdpp_post_slider_widget_designs', $design_arr );
} | [
"function ss2016_slider_widget() {\n\t\tgenesis_widget_area ( 'slider', array(\n\t'before' => '<aside class=\"slider-container\">',\n\t'after' => '</aside>',));\n}",
"function bdpp_post_scrolling_widget_designs() {\n\t$design_arr = array(\n\t\t'design-1'\t=> esc_html__('Design 1', 'blog-designer-pack'),\n\t\t'design-2'\t=> esc_html__('Design 2', 'blog-designer-pack'),\n\t\t'design-3'\t=> esc_html__('Design 3', 'blog-designer-pack'),\n\t\t'design-4'\t=> esc_html__('Design 4', 'blog-designer-pack'),\n\t);\n\treturn apply_filters( 'bdpp_post_scrolling_widget_designs', $design_arr );\n}",
"function getSliderPanel(){\n\t$return = '';\n\t$return .= '<section class=\"slider-panel container-fluid ' . get_sub_field('background_color') . ' position-' . get_sub_field('text_position') . '\">';\n if(get_sub_field('slideshow_title')){\n\t\t$return .= '<div class=\"slideshow-title\"><h2>' . get_sub_field('slideshow_title') . '</h2></div>';\n\t}\n $return .= ' <div class=\"' . get_sub_field('slideshow_name') . '-carousel owl-carousel columns-' . get_sub_field(\"column_number\") . '\">';\n\t//get requested data for each column\n $slides = get_sub_field('slide');\n foreach ($slides as $slide) {\n\t\t$imageObj = $slide['image'];\n\t\tif(empty($slide['slide_button_text']) && !empty($slide['slide_link'])) {\n\t\t\t$return .= '<a href=\"'. $slide['slide_link'] .'\">';\n\t\t}\n\t\t$return .= ' <div class=\"item slide\">\n\t\t <div class=\"slide-image-section lazyload\" data-bg=\"' . $imageObj['url'] . '\">';\n\t\tif(!empty($slide['slide_title']) && get_sub_field(\"column_number\") > 1 ) {\n\t\t\t$return .= ' <p class=\"slide-title\">' . $slide['slide_title'] . '</p>';\n\t\t}\n\t\tif(!empty($slide['slide_button_text']) && get_sub_field(\"column_number\") > 1 ) {\n\t\t\tif(!empty($slide['slide_link'])) {\n\t\t\t $return .= ' <a href=\"'. $slide['slide_link'] .'\">';\n\t\t }\n\t\t\t$return .= ' <button class=\"btn slide-btn ' . $slide['slide_button_color'] . '\">' . $slide['slide_button_text'] . '</button>';\n\t\t\tif(!empty($slide['slide_link'])) {\n\t\t\t $return .= ' </a>';\n\t\t }\n\t\t}\n\t\t// This section is only for one column slideshows that have description text\n\t\tif( get_sub_field(\"column_number\") == 1 ) {\n\t\t\t$return .= ' </div>\n\t\t\t <div class=\"slide-info-section\">';\n\t\t\tif(!empty($slide['slide_title'])) {\n\t\t\t $return .= ' <p class=\"slide-title\">' . $slide['slide_title'] . '</p>';\n\t\t\t}\n\t\t\tif(!empty($slide['slide_text'])) {\n\t\t\t $return .= ' <p class=\"slide-text\">' . $slide['slide_text'] . '</p>';\n\t\t\t}\n\t\t\tif(!empty($slide['slide_button_text'])) {\n\t\t\t if(!empty($slide['slide_link'])) {\n\t\t\t\t $return .= ' <a href=\"'. $slide['slide_link'] .'\">';\n\t\t\t\t}\n\t\t\t\t$return .= ' <button class=\"btn slide-btn ' . $slide['slide_button_color'] . '\">' . $slide['slide_button_text'] . '</button>';\n\t\t\t\tif(!empty($slide['slide_link'])) {\n\t\t\t\t $return .= ' </a>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$return .= ' </div>\n\t\t </div>';\n\t\tif(!empty($slide['slide_link']) && empty($slide['slide_button_text'])) {\n\t\t\t$return .= '</a>';\n\t\t}\n\t}\n\t$tabletSlides = 1;\n\tif(get_sub_field(\"column_number\") > 1) {\n\t\t$tabletSlides = 2;\n\t}\n\t$return .= ' </div>\n\t </section>\n\t\t\t\t\t\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t jQuery(document).ready(function() {\n\t\t\t\t\t \t// slideshow carousel\n\t\t\t\t\t\t\tjQuery(\".' . get_sub_field('slideshow_name') . '-carousel.owl-carousel\").owlCarousel({\n\t\t\t\t\t\t\t loop: true,\n\t\t\t\t\t\t\t margin: 15,\n\t\t\t\t\t\t\t nav: true,\n\t\t\t\t\t\t\t navText: [\n\t\t\t\t\t\t\t\t \"<i class=\\'fa fa-caret-left\\'></i>\",\n\t\t\t\t\t\t\t\t \"<i class=\\'fa fa-caret-right\\'></i>\"\n\t\t\t\t\t\t\t ],\n\t\t\t\t\t\t\t autoplay: true,\n\t\t\t\t\t\t\t autoplayHoverPause: true,\n\t\t\t\t\t\t\t responsive: {\n\t\t\t\t\t\t\t\t 0: {\n\t\t\t\t\t\t\t\t\titems: 1\n\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t 600: { \n\t\t\t\t\t\t\t\t items: ' . $tabletSlides . '\n\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t 1000: {\n\t\t\t\t\t\t\t\t\titems: ' . get_sub_field(\"column_number\") . '\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>\n\t\t\t\t\t';\n\treturn $return;\n}",
"abstract protected function get_widget();",
"function pluton_posts_slider() {\n\tget_template_part( 'partials/posts-slider' );\n}",
"function cpt_slider_settings_content($post) {\r\n\t$num_slides = get_post_meta($post->ID, 'sa_num_slides', true);\r\n\t$sa_pro_version = validate_slide_anything_pro_registration();\r\n\r\n\techo \"<div id='sa_slider_settings'>\\n\";\r\n\t// NONCE TO PREVENT CSRF SECURITY ATTACKS\r\n\twp_nonce_field(basename(__FILE__), 'nonce_save_slider');\r\n\r\n\t// HIDDEN FIELD - NUMBER OF SLIDES\r\n\tif ($num_slides == '') {\r\n\t\t// new slider is being created\r\n\t\techo \"<input type='hidden' id='num_slides_id' name='sa_num_slides' value='3'/>\\n\";\r\n\t} else {\r\n\t\t// existing slider\r\n\t\t$num_slides = intval($num_slides);\r\n\t\techo \"<input type='hidden' id='num_slides_id' name='sa_num_slides' value='\".esc_attr($num_slides).\"'/>\\n\";\r\n\t}\r\n\t// HIDDEN FIELD - SLIDE ADDED INDICATOR\r\n\techo \"<input type='hidden' id='sa_info_added' name='sa_info_added' value='0'/>\\n\";\r\n\t// HIDDEN FIELD - SLIDE DELETED INDICATOR\r\n\techo \"<input type='hidden' id='sa_info_deleted' name='sa_info_deleted' value='0'/>\\n\";\r\n\t// HIDDEN FIELD - SLIDE DUPLICATED INDICATOR\r\n\techo \"<input type='hidden' id='sa_info_duplicated' name='sa_info_duplicated' value='0'/>\\n\";\r\n\t// HIDDEN FIELD - SLIDE MOVED UP INDICATOR\r\n\techo \"<input type='hidden' id='sa_info_moved' name='sa_info_moved' value='0'/>\\n\";\r\n\t// HIDDEN FIELD - DUPLICATE SLIDE NUMBER\r\n\techo \"<input type='hidden' id='sa_duplicate_slide' name='sa_duplicate_slide' value='0'/>\\n\";\r\n\t// HIDDEN FIELD - MOVE SLIDE UP (SLIDE NUMBER)\r\n\techo \"<input type='hidden' id='sa_move_slide_up' name='sa_move_slide_up' value='0'/>\\n\";\r\n\t// HIDDEN FIELD - PRO VERSION\r\n\tif ($sa_pro_version) {\r\n\t\techo \"<input type='hidden' id='sa_pro_version' name='sa_pro_version' value='1'/>\\n\";\r\n\t} else {\r\n\t\techo \"<input type='hidden' id='sa_pro_version' name='sa_pro_version' value='0'/>\\n\";\r\n\t}\r\n\t// SLIDE DURATION\r\n\t$slide_duration = get_post_meta($post->ID, 'sa_slide_duration', true);\r\n\tif ($slide_duration == '') {\r\n\t\t$slide_duration = 5;\r\n\t}\r\n\techo \"<div class='sa_slider_value'><span>Slide Duration:</span>\";\r\n\techo \"<input type='text' id='sa_slide_duration' name='sa_slide_duration' readonly value='\".esc_attr($slide_duration).\"'><em>seconds</em>\";\r\n\techo \"<em class='sa_tooltip' href='' title='Set to 0 to disable slider autoplay (manual slider navigation only)'></em></div>\\n\";\r\n\techo \"<div class='jquery_ui_slider' id='jq_slider_duration'></div><hr/>\\n\";\r\n\t// SLIDE TRANSITION\r\n\t$slide_transition = get_post_meta($post->ID, 'sa_slide_transition', true);\r\n\tif ($slide_transition == '') {\r\n\t\t$slide_transition = 0.2;\r\n\t}\r\n\techo \"<div class='sa_slider_value'><span>Slide Transition:</span>\";\r\n\techo \"<input type='text' id='sa_slide_transition' name='sa_slide_transition' readonly value='\".esc_attr($slide_transition).\"'><em>seconds</em>\\n\";\r\n\techo \"<em class='sa_tooltip' href='' title='The time it takes to change from one slide to the next slide'></em></div>\\n\";\r\n\techo \"<div class='jquery_ui_slider' id='jq_slider_transition'></div><hr/>\\n\";\r\n\t// SLIDE BY\r\n\t$slide_by = get_post_meta($post->ID, 'sa_slide_by', true);\r\n\tif ($slide_by == '') {\r\n\t\t$slide_by = 1;\r\n\t}\r\n\techo \"<div class='sa_slider_value'><span>Slide By:</span>\";\r\n\techo \"<input type='text' id='sa_slide_by' name='sa_slide_by' readonly value='\".esc_attr($slide_by).\"'><em>slides</em>\";\r\n\techo \"<em class='sa_tooltip' href='' title='The number of slides to slide per transition'></em></div>\\n\";\r\n\techo \"<div class='jquery_ui_slider' id='jq_slider_by'></div><hr/>\\n\";\r\n\techo \"<div class='half_width_column'>\\n\";\r\n\t// LOOP SLIDER\r\n\t$loop_slider = get_post_meta($post->ID, 'sa_loop_slider', true);\r\n\tif ($loop_slider == '') {\r\n\t\t$loop_slider = '1';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Loop Slider:</span>\";\r\n\tif ($loop_slider == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_loop_slider' name='sa_loop_slider' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_loop_slider' name='sa_loop_slider' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' href='' title='Only applies when slide duration is NOT zero (loops back to first slide after last slide is displayed)'></em>\";\r\n\techo \"</div>\\n\";\r\n\t// STOP ON HOVER\r\n\t$stop_hover = get_post_meta($post->ID, 'sa_stop_hover', true);\r\n\tif ($stop_hover == '') {\r\n\t\t$stop_hover = '1';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Stop on Hover:</span>\";\r\n\tif ($stop_hover == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_stop_hover' name='sa_stop_hover' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_stop_hover' name='sa_stop_hover' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' href='' title='Only applies when slide duration is NOT zero (slideshow is paused when hovering over a slide)'></em>\";\r\n\techo \"</div>\\n\";\r\n\t// RANDOM ORDER\r\n\t$random_order = get_post_meta($post->ID, 'sa_random_order', true);\r\n\tif ($random_order == '') {\r\n\t\t$random_order = '0';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Random Order:</span>\";\r\n\tif ($random_order == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_random_order' name='sa_random_order' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_random_order' name='sa_random_order' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' title='When checked slides will be randomly re-ordered whenever the slider is displayed'></em>\";\r\n\techo \"</div>\\n\";\r\n\t// REVERSE ORDER\r\n\t$reverse_order = get_post_meta($post->ID, 'sa_reverse_order', true);\r\n\tif ($reverse_order == '') {\r\n\t\t$reverse_order = '0';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Reverse Order:</span>\";\r\n\tif ($reverse_order == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_reverse_order' name='sa_reverse_order' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_reverse_order' name='sa_reverse_order' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' title='When checked your slides will be shown in the reverse order (i.e. last slide first)'></em>\";\r\n\techo \"</div>\\n\";\r\n\t// ALLOW SHORTCODES\r\n\t$shortcodes = get_post_meta($post->ID, 'sa_shortcodes', true);\r\n\tif ($shortcodes == '') {\r\n\t\t$shortcodes = '0';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Allow Shortcodes:</span>\";\r\n\tif ($shortcodes == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_shortcodes' name='sa_shortcodes' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_shortcodes' name='sa_shortcodes' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' href='' title='Include WordPree shorcodes within slide content. NOTE: Running shortcodes in Slide Anything may cause issues with some Wordpress Page Builders'></em>\\n\";\r\n\techo \"</div>\\n\";\r\n\techo \"</div>\\n\";\r\n\techo \"<div class='half_width_column'>\\n\";\r\n\t// NAVIGATE ARROWS\r\n\t$nav_arrows = get_post_meta($post->ID, 'sa_nav_arrows', true);\r\n\tif ($nav_arrows == '') {\r\n\t\t$nav_arrows = '1';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Navigate Arrows:</span>\";\r\n\tif ($nav_arrows == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_nav_arrows' name='sa_nav_arrows' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_nav_arrows' name='sa_nav_arrows' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' href='' title='Display the \\\"next slide\\\" amd \\\"previous slide\\\" buttons'></em>\\n\";\r\n\techo \"</div>\\n\";\r\n\t// SHOW PAGINATION\r\n\t$pagination = get_post_meta($post->ID, 'sa_pagination', true);\r\n\tif ($pagination == '') {\r\n\t\t$pagination = '1';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Show Pagination:</span>\";\r\n\tif ($pagination == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_pagination' name='sa_pagination' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_pagination' name='sa_pagination' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' href='' title='Display slider pagination below the slider'></em>\\n\";\r\n\techo \"</div>\\n\";\r\n\r\n\t// MOUSE DRAG\r\n\t$mouse_drag = get_post_meta($post->ID, 'sa_mouse_drag', true);\r\n\tif ($mouse_drag == '') {\r\n\t\t$mouse_drag = '1';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Mouse Drag:</span>\";\r\n\tif ($mouse_drag == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_mouse_drag' name='sa_mouse_drag' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_mouse_drag' name='sa_mouse_drag' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' href='' title='Allow navigation to previous/next slides by holding down left mouse button and dragging left/right'></em>\\n\";\r\n\techo \"</div>\\n\";\r\n\t// TOUCH DRAG\r\n\t$touch_drag = get_post_meta($post->ID, 'sa_touch_drag', true);\r\n\tif ($touch_drag == '') {\r\n\t\t$touch_drag = '1';\r\n\t}\r\n\techo \"<div class='sa_setting_checkbox'><span>Touch Drag:</span>\";\r\n\tif ($touch_drag == '1') {\r\n\t\techo \"<input type='checkbox' id='sa_touch_drag' name='sa_touch_drag' value='1' checked/>\";\r\n\t} else {\r\n\t\techo \"<input type='checkbox' id='sa_touch_drag' name='sa_touch_drag' value='1'/>\";\r\n\t}\r\n\techo \"<em class='sa_tooltip' href='' title='Allow navigation to previous/next slides on mobile devices by touching screen and dragging left/right'></em>\\n\";\r\n\techo \"</div>\\n\";\r\n\techo \"</div>\\n\";\r\n\techo \"<div style='clear:both; float:none; width:100%; height:1px;'></div>\\n\";\r\n\techo \"</div>\\n\";\r\n}",
"function best_it_slider_display(){\nif (get_theme_mod('best-it-slider-info-display') == 'Yes') { \n// get slider category\n$slider_category=get_theme_mod('best-it-slider-category-display');\n// get slider number\n$slider_number=get_theme_mod('best-it-slider-number-display');\n?>\n<div class=\"slider-area\">\n\t<div class=\"slider-wrapper owl-carousel\">\n\t\t<?php\n\t\t // The Query\n\t\t $the_slider = new WP_Query( array( \n\t\t \t'post_type' => 'slider', \n\t\t \t'order' => 'DSC',\n\t\t 'post_status' => 'publish',\n\t\t 'posts_per_page' => $slider_number,\n\t\t 'tax_query' => array(\n array(\n 'taxonomy' => 'slider-category',\n 'field' => 'slug',\n 'terms' => $slider_category\n )\n )\n\t\t ) );\n\t\t // The Loop for slider \n\t\t if ( $the_slider->have_posts() ) {\n\t\t\t while ( $the_slider->have_posts() ) {\n\t\t\t\t $the_slider->the_post();\n\t\t\t\t $slider_meta = get_post_meta( get_the_ID() );\n\t\t;?>\n\t\t<div class=\"slider-item text-center home-one-slider-otem slider-item-four\" style=\"background-image:url('<?php \n\t\t\tif(has_post_thumbnail()){\n\t\t\techo esc_url(the_post_thumbnail_url());\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo esc_url(get_home_url().\"/wp-content/themes/best-it/uploads/slider_02.jpg\");\n\t\t\t}\n\t\t\t?>')\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"slider-content-area\">\n\t\t\t\t\t\t<div class=\"slide-text\">\n\t\t\t\t\t\t\t<h1 class=\"homepage-three-title\"><span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t// slider title\n\t\t\t\t\t\t\t\tif (the_title()) {\n\t\t\t\t\t\t\t\t\tthe_title();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</span></h1>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t// slider sub title\n\t\t\t\t\t\t\t\tif (isset($slider_meta['slider_sub_title'][0])){\n\t\t\t\t\t\t\t\techo \"<h2>\".$slider_meta['slider_sub_title'][0].\"</h2>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"slider-content-btn\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t// slider button 01\n\t\t\t\t\t\t\t\tif (isset($slider_meta['slider_button_01_text'][0])) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<a class=\"button btn btn-light btn-radius btn-brd\" href=\"<?php echo esc_url($slider_meta['slider_button_01_link'][0]); ?>\"><?php echo $slider_meta['slider_button_01_text'][0];?></a>\n\t\t\t\t\t\t\t\t<?php }?>\n\t\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t\t// slider button 02\n\t\t\t\t\t\t\t\tif (isset($slider_meta['slider_button_02_text'][0])){\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<a class=\"button btn btn-light btn-radius btn-brd\" href=\"<?php echo esc_url($slider_meta['slider_button_02_link'][0]); ?>\"><?php echo $slider_meta['slider_button_02_text'][0];?></a>\n\t\t\t\t\t\t\t\t<?php }?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php\n\t\t\t\t\t}\n\t\t }\n\t\t /* Restore original slider Post Data */\n\t\t wp_reset_postdata(); \n\t\t?>\n\n\t</div>\n</div>\n<?php \n\n}\n\n}",
"function bjorn_blog_slider_show() {\n\n $bjorn_theme_options = bjorn_get_theme_options();\n\n // Revolution slider\n if(isset($bjorn_theme_options['blog_enable_revolution_slider']) && $bjorn_theme_options['blog_enable_revolution_slider']) {\n echo '<div class=\"bjorn-revolution-slider\">'.do_shortcode(\"[rev_slider alias='BLOG_SLIDER']\").'</div>';\n } else {\n // Theme slider\n // Demo settings\n if ( defined('DEMO_MODE') && isset($_GET['blog_homepage_slider_fullwidth']) ) {\n if($_GET['blog_homepage_slider_fullwidth'] == 1) {\n $bjorn_theme_options['blog_homepage_slider_fullwidth'] = 1;\n }\n if($_GET['blog_homepage_slider_fullwidth'] == 0) {\n $bjorn_theme_options['blog_homepage_slider_fullwidth'] = 0;\n }\n }\n\n if ( defined('DEMO_MODE') && isset($_GET['blog_homepage_slider_post_details_layout']) ) {\n $bjorn_theme_options['blog_homepage_slider_post_details_layout'] = $_GET['blog_homepage_slider_post_details_layout'];\n }\n\n if ( defined('DEMO_MODE') && isset($_GET['blog_enable_homepage_merge_slider']) ) {\n if($_GET['blog_enable_homepage_merge_slider'] == 1) {\n $bjorn_theme_options['blog_enable_homepage_merge_slider'] = true;\n }\n if($_GET['blog_enable_homepage_merge_slider'] == 0) {\n $bjorn_theme_options['blog_enable_homepage_merge_slider'] = false;\n }\n }\n\n if ( defined('DEMO_MODE') && isset($_GET['blog_enable_homepage_center_slide']) ) {\n if($_GET['blog_enable_homepage_center_slide'] == 1) {\n $bjorn_theme_options['blog_enable_homepage_center_slide'] = true;\n }\n if($_GET['blog_enable_homepage_center_slide'] == 0) {\n $bjorn_theme_options['blog_enable_homepage_center_slide'] = false;\n }\n }\n\n if ( defined('DEMO_MODE') && isset($_GET['blog_homepage_slider_items']) ) {\n $bjorn_theme_options['blog_homepage_slider_items'] = $_GET['blog_homepage_slider_items']; \n }\n\n if ( defined('DEMO_MODE') && isset($_GET['blog_enable_readmore']) ) {\n if($_GET['blog_enable_readmore'] == 1) {\n $bjorn_theme_options['blog_enable_readmore'] = true;\n }\n if($_GET['blog_enable_readmore'] == 0) {\n $bjorn_theme_options['blog_enable_readmore'] = false;\n }\n }\n\n if ( defined('DEMO_MODE') && isset($_GET['blog_disable_homepage_slider_description']) ) {\n if($_GET['blog_disable_homepage_slider_description'] == 1) {\n $bjorn_theme_options['blog_disable_homepage_slider_description'] = true;\n }\n if($_GET['blog_disable_homepage_slider_description'] == 0) {\n $bjorn_theme_options['blog_disable_homepage_slider_description'] = false;\n }\n }\n \n $posts_per_page = 100;\n\n $args = array(\n 'posts_per_page' => $posts_per_page,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'meta_key' => '_post_featured_value',\n 'meta_value' => 'on',\n 'post_type' => 'post',\n 'post_status' => 'publish',\n 'suppress_filters' => 0 \n );\n\n $posts = get_posts( $args );\n\n $total_posts = sizeof($posts);\n\n if($total_posts > 0) {\n\n if(isset($bjorn_theme_options['blog_homepage_slider_autoplay'])) {\n $slider_autoplay = $bjorn_theme_options['blog_homepage_slider_autoplay'];\n } else {\n $slider_autoplay = 3000;\n }\n\n if($slider_autoplay > 0) {\n $slider_autoplay_bool = 'true';\n } else {\n $slider_autoplay_bool = 'false';\n }\n\n if(isset($bjorn_theme_options['blog_enable_homepage_center_slide']) && $bjorn_theme_options['blog_enable_homepage_center_slide']) {\n $homepage_center_slide = 'true';\n } else {\n $homepage_center_slide = 'false';\n }\n\n if(isset($bjorn_theme_options['blog_enable_homepage_merge_slider']) && $bjorn_theme_options['blog_enable_homepage_merge_slider']) {\n $homepage_merge_slider = 'true';\n } else {\n $homepage_merge_slider = 'false';\n }\n\n if($slider_autoplay == 1) {\n $slider_autoplay_class = ' autoplay ';\n } else {\n $slider_autoplay_class = ' ';\n }\n\n if(isset($bjorn_theme_options['blog_homepage_slider_navigation'])) {\n $slider_navigation = $bjorn_theme_options['blog_homepage_slider_navigation'];\n } else {\n $slider_navigation = 1;\n }\n\n if(isset($bjorn_theme_options['blog_homepage_slider_margin'])) {\n $slider_margin = $bjorn_theme_options['blog_homepage_slider_margin'];\n } else {\n $slider_margin = 30;\n }\n\n if(isset($bjorn_theme_options['blog_enable_homepage_transparent_header'])&&$bjorn_theme_options['blog_enable_homepage_transparent_header']) {\n $slider_margin = 0;\n }\n\n if(isset($bjorn_theme_options['blog_homepage_slider_pagination'])) {\n $slider_pagination = $bjorn_theme_options['blog_homepage_slider_pagination'];\n } else {\n $slider_pagination = 'false';\n }\n\n if($slider_navigation == 1) {\n $slider_navigation = 'true';\n } else {\n $slider_navigation = 'false';\n }\n\n if(isset($bjorn_theme_options['blog_homepage_slider_post_details_layout'])) {\n $post_details_layout = $bjorn_theme_options['blog_homepage_slider_post_details_layout'];\n } else {\n $post_details_layout = 'horizontal';\n }\n\n echo '<div class=\"bjorn-post-list-wrapper '.esc_attr($slider_autoplay_class).'clearfix\">';\n \n echo '<div id=\"bjorn-post-list\" class=\"bjorn-post-list\">';\n\n echo '<div class=\"owl-carousel\">';\n\n $i = 0;\n $j = 0;\n\n foreach($posts as $post) {\n\n setup_postdata($post);\n\n $limit = 21;\n \n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt).'...';\n } else {\n $excerpt = implode(\" \",$excerpt);\n } \n\n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n\n if((isset($bjorn_theme_options['blog_homepage_slider_fullwidth'])&&$bjorn_theme_options['blog_homepage_slider_fullwidth'])) {\n $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full');\n } else {\n $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'bjorn-blog-thumb');\n }\n\n if(has_post_thumbnail( $post->ID )) {\n $image_bg ='background-image: url('.$image[0].');';\n }\n else {\n $image_bg = '';\n }\n\n $categories_list = get_the_category_list(', ', 0, $post->ID); // This variable is Safe and does not need esc functions\n\n if($homepage_merge_slider == 'true') {\n if($j == 0) {\n $data_merge = 2;\n }\n if($j == 1) {\n $data_merge = 1;\n }\n if($j == 2) {\n $data_merge = 1;\n $j = -1;\n }\n } else {\n $data_merge = 0;\n }\n\n $post_comments = get_comments_number($post->ID);\n\n if((isset($bjorn_theme_options['blog_homepage_slider_readmore'])&&$bjorn_theme_options['blog_homepage_slider_readmore'])) {\n $read_more_button_html = '<a class=\"btn alt\" href=\"'.esc_url(get_permalink($post->ID)).'\">'.esc_html__('Read more', 'bjorn').'</a>';\n } else {\n $read_more_button_html = '';\n }\n \n $bjorn_post_classes = ' bjorn-post-layout-'.$post_details_layout;\n\n echo '<div class=\"bjorn-post'.esc_attr($bjorn_post_classes).' bjorn-theme-block\" data-merge=\"'.esc_attr($data_merge).'\">';\n\n echo '<div class=\"bjorn-post-image\" data-style=\"'.esc_attr($image_bg).'\">';\n\n // Post details\n echo '<div class=\"bjorn-post-details\">\n <div class=\"bjorn-post-category\">'.wp_kses_post($categories_list).'</div>\n <div class=\"bjorn-post-title\"><a href=\"'.esc_url(get_permalink($post->ID)).'\"><h2 class=\"lined\">'.esc_html($post->post_title).'</h2></a></div>';\n\n // Hide post description\n if(isset($bjorn_theme_options['blog_homepage_slider_description']) && $bjorn_theme_options['blog_homepage_slider_description']) {\n\n echo '<div class=\"bjorn-post-description\">'.esc_html($excerpt).'</div>';\n\n }\n\n // Post details\n if(isset($bjorn_theme_options['blog_homepage_slider_details']) && $bjorn_theme_options['blog_homepage_slider_details']) {\n\n ob_start();\n do_action('bjorn_post_views', $post);\n $post_views = ob_get_clean();\n\n $post_info_html = '<span class=\"bjorn-post-comments\"><a href=\"'.get_comments_link( $post->ID ).'\"><i class=\"fa fa-comment\" aria-hidden=\"true\"></i>'.$post_comments.'</a></span><span class=\"bjorn-post-views\"><i class=\"fa fa-eye\" aria-hidden=\"true\"></i>'.$post_views.'</span>';\n } else {\n $post_info_html = '';\n }\n\n echo '<div class=\"bjorn-post-date\">'.get_the_time( get_option( 'date_format' ), $post->ID ).wp_kses_post($post_info_html).'</div>\n '.wp_kses_post($read_more_button_html).'</div>';\n\n echo '</div>';\n\n echo '</div>';\n\n $i++;\n $j++;\n\n } \n\n wp_reset_postdata();\n\n\n echo '</div>';\n echo '</div>';\n\n echo '</div>';\n \n // Slider items per row\n if(!isset($bjorn_theme_options['blog_homepage_slider_items'])) {\n $bjorn_theme_options['blog_homepage_slider_items'] = 2;\n }\n\n $slider_slides = $bjorn_theme_options['blog_homepage_slider_items'];\n\n wp_add_inline_script( 'bjorn-script', '(function($){\n $(document).ready(function() {\n\n var owlpostslider = $(\"#bjorn-post-list .owl-carousel\").owlCarousel({\n loop: true,\n items:'.esc_js($slider_slides).',\n center:'.esc_js($homepage_center_slide ).',\n merge:'.esc_js($homepage_merge_slider ).',\n autoplay:'.esc_js($slider_autoplay_bool).',\n autowidth: false,\n autoplayTimeout:'.esc_js($slider_autoplay).',\n autoplaySpeed: 1000,\n navSpeed: 1000,\n nav: '.esc_js($slider_navigation).',\n dots: '.esc_js($slider_pagination).',\n navText: false,\n margin: '.esc_js($slider_margin).',\n responsive: {\n 1199:{\n items:'.esc_js($slider_slides).'\n },\n 979:{\n items:1\n },\n 768:{\n items:1\n },\n 479:{\n items:1\n },\n 0:{\n items:1\n }\n }\n })\n\n });})(jQuery);');\n\n // Add slider pagination\n wp_add_inline_script( 'bjorn-script', '(function($){\n $(document).ready(function() { var slider_pagination_width = 100/$(\".bjorn-post-list .owl-item:not(.cloned)\").length;\n\n$(\".bjorn-blog-posts-slider .bjorn-post-list .owl-theme .owl-dots .owl-dot\").css(\"width\", slider_pagination_width+\"%\");});})(jQuery);');\n\n\n \n \n }\n }\n \n}",
"function pexeto_get_slider_type() {\r\n\t\tglobal $post;\r\n\t\t$slider_type = null;\r\n\r\n\t\tif ( !empty( $post ) ) {\r\n\t\t\t$page_settings = pexeto_get_post_meta( $post->ID, array( 'slider', 'blog_layout' ) );\r\n\t\t\tif ( !empty( $page_settings['slider'] ) ) {\r\n\t\t\t\t$slider = PexetoCustomPageHelper::get_slider_data_parts( $page_settings['slider'] );\r\n\t\t\t\t$slider_type = $slider[0];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $slider_type;\r\n\t}",
"public function getWidgets();",
"function flotheme_get_sliders() {\n\treturn array(\n\t\t// uncomment if you want to use sliders\n\t\t// 'sneak-peek' => array(\n\t\t// \t'title'\t\t=> 'Sneak Peek',\n\t\t// ),\n\t);\n}",
"function ts_get_slider_items_for_theme_options() {\r\n\tglobal $wpdb;\r\n\r\n\t$slider_items[] = array(\r\n\t\t'value' => '',\r\n\t\t'label' => __('Choose', 'framework'),\r\n\t\t'src' => ''\r\n\t);\r\n\t//FlexSlider\r\n\t$sliders = $wpdb->get_results($q = \"\r\n\t\tSELECT\r\n\t\t\t*\r\n\t\tFROM\r\n\t\t\t\" . $wpdb->prefix . \"fs_sliders\r\n\t\tORDER BY\r\n\t\t\tname\r\n\t\tLIMIT\r\n\t\t\t100\");\r\n\r\n\t// Iterate over the sliders\r\n\tforeach ($sliders as $key => $item) {\r\n\r\n\t\t$slider_items[] = array(\r\n\t\t\t'value' => 'flexslider-' . $item->slider_id,\r\n\t\t\t'label' => 'FlexSlider - ' . stripslashes($item->name),\r\n\t\t\t'src' => ''\r\n\t\t);\r\n\t}\r\n\r\n\t//LayerSlider\r\n\tif (function_exists('ts_get_layer_slider_items_for_theme_options'))\r\n\t{\r\n\t\t$a = ts_get_layer_slider_items_for_theme_options();\r\n\t\tif (is_array($a)) {\r\n\t\t\tforeach ($a as $val) {\r\n\t\t\t\t$slider_items[] = $val;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//Revolution Slider\r\n\tif (is_plugin_active('revslider/revslider.php')) {\r\n\t\t$sliders = $wpdb->get_results($q = \"\r\n\t\t\tSELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\t\" . $wpdb->prefix . \"revslider_sliders\r\n\t\t\tORDER BY\r\n\t\t\t\tid\r\n\t\t\tLIMIT\r\n\t\t\t\t100\");\r\n\r\n\t\t// Iterate over the sliders\r\n\t\tforeach ($sliders as $key => $item) {\r\n\r\n\t\t\t$slider_items[] = array(\r\n\t\t\t\t'value' => 'revslider-' . $item->alias,\r\n\t\t\t\t'label' => 'Revolution Slider - ' . stripslashes($item->title),\r\n\t\t\t\t'src' => ''\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//Banner builder\r\n\tif (function_exists('ts_get_banners_list')) {\r\n\t\t$banners = ts_get_banners_list();\r\n\t\tif ($banners) {\r\n\t\t\t// Iterate over the sliders\r\n\t\t\tforeach ($banners as $key => $item) {\r\n\r\n\t\t\t\t$slider_items[] = array(\r\n\t\t\t\t\t'value' => 'banner-builder-' . $item['id'],\r\n\t\t\t\t\t'label' => __('Banner Builder', 'framework').' - ' . $item['title'],\r\n\t\t\t\t\t'src' => ''\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $slider_items;\r\n}",
"function alchem_get_page_slider($slider_type,$alchem_css_class=\"\"){\n\t global $alchem_page_meta;\n\t\n\t $return = '';\n\t switch($slider_type){\n\t\t case \"layer\":\n\t\t if(isset($alchem_page_meta['layer_slider']) && is_numeric($alchem_page_meta['layer_slider']) && $alchem_page_meta['layer_slider']>0 )\n\t\t $return .= do_shortcode('[layerslider id=\"'.$alchem_page_meta['layer_slider'].'\"]');\n\t\t break;\n\t\t case \"rev\":\n\t\t \n\t\t if(isset($alchem_page_meta['rev_slider']) && $alchem_page_meta['rev_slider'] !=\"\" )\n\t\t $return .= do_shortcode('[rev_slider '.$alchem_page_meta['rev_slider'].']');\n\t\t break;\n\t\t case \"magee_slider\":\n\t\t if(isset($alchem_page_meta['magee_slider']) && is_numeric($alchem_page_meta['magee_slider']) && $alchem_page_meta['magee_slider']>0 )\n\t\t $return .= do_shortcode('[ms_slider id=\"'.$alchem_page_meta['magee_slider'].'\"]');\t \n\t\t break;\n\t\t default:\n\t\t return;\n\t\t break;\n\t\t }\n\t echo '<div class=\"slider-wrap\"><div class=\"page-top-slider '.$alchem_css_class.'\">'.$return.'</div></div>';\n\t }",
"public function metaBoxSliderRender($post)\n\t{\n\t\t$slider = get_post_meta($post->ID, 'slider', true);\t\t\n\t\twp_nonce_field( 'slider_box', 'slider_box_nonce' );\n\n\t\t?>\t\n\t\t<div class=\"gcslider\">\n\t\t\t<p>\n\t\t\t\t<label for=\"slider_precent\"><?php _e('Precent'); ?>:</label>\n\t\t\t\t<input type=\"text\" name=\"slider[precent]\" id=\"slider_precent\" value=\"<?php echo $slider['precent']; ?>\" class=\"w100\">\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label for=\"slider_prev_text\"><?php _e('Previous text'); ?>:</label>\n\t\t\t\t<textarea name=\"slider[prev_text]\" id=\"slider_prev_text\" cols=\"25\" rows=\"10\" class=\"w100\"><?php echo $slider['prev_text']; ?></textarea>\n\t\t\t</p>\t\n\t\t\t<p>\n\t\t\t\t<label for=\"slider_next_text\"><?php _e('Next text'); ?>:</label>\n\t\t\t\t<textarea name=\"slider[next_text]\" id=\"slider_next_text\" cols=\"25\" rows=\"10\" class=\"w100\"><?php echo $slider['next_text']; ?></textarea>\n\t\t\t</p>\t\n\t\t</div>\t\n\t\t<?php\n\t}",
"function slider_init()\r\n{\r\n\r\n $labels = array(\r\n 'name' => 'Slider',\r\n 'singular_name' => 'Slider',\r\n 'menu_name' => 'Slide',\r\n 'name_admin_bar' => 'Slider',\r\n 'add_new' => 'Add New',\r\n 'add_new_item' => 'Add New Slide',\r\n 'new_item' => 'New Slide',\r\n 'edit_item' => 'Edit Slide',\r\n 'view_item' => 'View Slide',\r\n 'all_items' => 'All Slides',\r\n 'search_items' => 'Search Slides',\r\n 'parent_item_colon' => 'Parent Slides:',\r\n 'not_found' => 'No slides found.',\r\n 'not_found_in_trash' => 'No slides found in Trash.'\r\n );\r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => 'slider'),\r\n 'capability_type' => 'post',\r\n 'has_archive' => true,\r\n 'menu_position' => null,\r\n 'supports' => array('title', 'thumbnail')\r\n );\r\n\r\n register_post_type('slider', $args);\r\n\r\n}",
"function custom_bootstrap_slider() {\n\t$labels = array(\n\t\t'name' => _x( 'Slider', 'post type general name'),\n\t\t'singular_name' => _x( 'Slide', 'post type singular name'),\n\t\t'menu_name' => _x( 'Bootstrap Slider', 'admin menu'),\n\t\t'name_admin_bar' => _x( 'Slide', 'add new on admin bar'),\n\t\t'add_new' => _x( 'Add New', 'Slide'),\n\t\t'add_new_item' => __( 'Name'),\n\t\t'new_item' => __( 'New Slide'),\n\t\t'edit_item' => __( 'Edit Slide'),\n\t\t'view_item' => __( 'View Slide'),\n\t\t'all_items' => __( 'All Slide'),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'search_items' => __( 'Search Slide'),\n\t\t'parent_item_colon' => __( 'Parent Slide:'),\n\t\t'not_found' => __( 'No Slide found.'),\n\t\t'not_found_in_trash' => __( 'No Slide found in Trash.'),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'menu_icon'\t => 'dashicons-star-half',\n \t'description' => __( 'Description.'),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => true,\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'hierarchical' => true,\n\t\t'menu_position' => null,\n\t\t'supports' => array('title','editor','thumbnail')\n\t);\n\n\tregister_post_type( 'slider', $args );\n}",
"function themeprefix_slider_widget() {\r\n\tif( is_front_page() ) {\r\n\t\tgenesis_widget_area ( 'slider', array(\r\n\t\t'before' => '<aside class=\"slider-container\">',\r\n\t\t'after' => '</aside>',));\r\n\t}\r\n}",
"protected function _getSlider()\r\n\t{\r\n\t\treturn Mage::registry('slider');\r\n\t}",
"function beaver_extender_get_widgets() {\r\n\t\r\n\t$custom_widgets = get_option( 'beaver_extender_custom_widget_areas' );\r\n\r\n\tif ( ! empty( $custom_widgets ) ) {\r\n\t\t\r\n\t\tforeach( $custom_widgets as $k => $v ) {\r\n\t\t\t\r\n\t\t\t$custom_widgets[$k]['conditionals'] = explode( '|', $v['conditionals'] );\r\n\t\t\t$custom_widgets[$k]['description'] = stripslashes( $custom_widgets[$k]['description'] );\r\n\t\t\t\r\n\t\t}\r\n\t\t$custom_widgets = beaver_extender_array_sort( $custom_widgets, 'widget_name' );\t\r\n\t\treturn $custom_widgets;\r\n\t\t\r\n\t} else {\r\n\t\t\r\n\t\treturn false;\r\n\t\t\r\n\t}\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function testAllContentTypesExists(). Verify if all content types listed in the config file, are currently registered in the system. | public function testAllContentTypesExists() {
$content_types = array_keys($this->contentTypes['test']);
foreach ($content_types as $type) {
try {
$this->assertArrayHasKey(
$type,
$this->contentTypes['system'],
"Failed asserting that {$type} exists in the system."
);
}
catch (Exception $e) {
$this->handleAssertException($e);
}
}
// Verify if all types passed the test.
$this->checkAllAssertionsPassedWholeTest();
} | [
"public function testContentTypesFunction()\n {\n $rels = simplexml_load_string(\n $this->package->getFromName('[Content_Types].xml')\n );\n $testRels = simplexml_load_string(\n $this->package3->getFromName('[Content_Types].xml')\n );\n $rels = objectsIntoArray($rels);\n $testRels = objectsIntoArray($testRels);\n $diff = array_diff($rels, $testRels);\n $this->assertTrue(\n empty($diff) ? true : false,\n 'SetContentTypes is not set correctly'\n );\n }",
"public function testContentTypesLists()\n {\n $this->contentTypeItemTest('products');\n $this->contentTypeItemTest('blogs');\n $this->contentTypeItemTest('app_flows');\n $this->contentTypeItemTest('lists');\n $this->contentTypeItemTest('user_reviews');\n $this->contentTypeItemTest('boards');\n }",
"public function testContentTypesItem()\n {\n $this->contentTypeListTest('products');\n $this->contentTypeListTest('blogs');\n $this->contentTypeListTest('app_flows');\n $this->contentTypeListTest('lists');\n $this->contentTypeListTest('user_reviews');\n $this->contentTypeListTest('boards');\n }",
"public function testGetContentTypeList()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->get($this->url('content-types'));\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'data' => [\n [\n 'school_id',\n 'name',\n 'type'\n ]\n ]\n ]);\n }",
"public function testValidContentTypes()\n {\n $tests = [\n 'text/html'\n , 'text/json'\n , 'application/pdf'\n ];\n\n foreach ($tests as $test)\n {\n $params = ['mime' => $test];\n\n $this->unit->addScenario([ 'request' => ['path' => '/asserts/content-types.php', 'params' => $params ] ]);\n\n $this->assertEquals(200, $this->unit->getResponse()->getStatusCode(), \"Should be 200. Given '{$this->unit->getResponse()->getStatusCode()}'\");\n $this->assertEquals(true, $this->unit->assertContentType($test), \"Should be $test. Given '{$this->unit->getResponse()->getContentType()}'\");\n }\n }",
"public function testAllContentTypesNamesAreNotIncorrect() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $name = $this->contentTypes['test'][$type]['name'] . uniqid('_', TRUE);\n try {\n $this->assertNotEquals(\n $name,\n $this->contentTypes['system'][$type]['name'],\n \"Failed asserting that {$type} name is not wrong.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n // Verify if all content types name passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"public function pluralContentTypes()\n {\n return $this->configAssert('contenttypes', false);\n }",
"public function register_content_types() {\n\t\tforeach ( $this->content_types as $content_type_class ) {\n\t\t\t$this->register_content_type( new $content_type_class() );\n\t\t}\n\t}",
"public function testFakeFieldsInContentTypesDoesNotExist() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $field = uniqid('field_', TRUE);\n try {\n $this->assertArrayNotHasKey(\n $field,\n $this->contentTypes['system'][$type]['fields'],\n \"Failed asserting that {$type}:{$field} field does not exist.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n // Verify if all fields in content types passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"private function getAllowedContenttypes()\n {\n\n // App\n $app = $this->getContainer();\n\n // Get configs\n $all_contenttypes = $app['config']->get('contenttypes');\n $config_contenttypes = $this->getConfigValue('contenttypes');\n\n // Use all contenttypes\n $allowed_contenttypes = $all_contenttypes;\n\n if (!empty($config_contenttypes)) {\n // If config has been defined, remove any that are not included\n foreach ($all_contenttypes as $key => $type) {\n if (!in_array($key, $config_contenttypes)) {\n unset($allowed_contenttypes[$key]);\n }\n }\n }\n\n $this->allowed_contenttypes = $allowed_contenttypes;\n\n return $this->allowed_contenttypes;\n }",
"public function viewAllContentTypesTest(\\AcceptanceTester $I)\n {\n $I->wantTo('make sure the admin user can view all content types');\n\n // Set up the browser\n $this->setLoginCookies($I);\n $I->amOnPage('/bolt');\n\n // Pages\n $I->see('Pages', Locator::href('/bolt/overview/pages'));\n $I->see('View Pages', Locator::href('/bolt/overview/pages'));\n $I->see('New Page', Locator::href('/bolt/editcontent/pages'));\n\n // Entries\n $I->see('Entries', Locator::href('/bolt/overview/entries'));\n $I->see('View Entries', Locator::href('/bolt/overview/entries'));\n $I->see('New Entry', Locator::href('/bolt/editcontent/entries'));\n\n // Showcases\n $I->see('Showcases', Locator::href('/bolt/overview/showcases'));\n $I->see('View Showcases', Locator::href('/bolt/overview/showcases'));\n $I->see('New Showcase', Locator::href('/bolt/editcontent/showcases'));\n\n // Resources\n $I->see('Resources', Locator::href('/bolt/overview/resources'));\n $I->see('View Resources', Locator::href('/bolt/overview/resources'));\n $I->see('New Resource', Locator::href('/bolt/editcontent/resources'));\n }",
"protected function checkDefaultContentTypes() {\n\t\t$contentTypes = $this->zip->getFromName('[Content_Types].xml');\n\t\t$this->types = new \\DOMDocument();\n\t\t$this->types->loadXML($contentTypes);\n\t\t$defaults = $this->types->getElementsByTagName('Default');\n\t\tforeach ($defaults as $item) {\n\t\t\t$extension = $item->getAttribute('Extension');\n\t\t\tif ($extension == 'jpeg') {\n\t\t\t\t$this->jpeg = true;\n\t\t\t} elseif ($extension == 'png') {\n\t\t\t\t$this->png = true;\n\t\t\t} elseif ($extension == 'gif') {\n\t\t\t\t$this->gif = true;\n\t\t\t}\n\t\t}\n\t}",
"public function testMimeTypeAdditions()\n {\n // $extensions = get_option('file_extension_whitelist');\n // $mimes = get_option('file_mime_type_whitelist');\n // $this->assertContains('xml', $extensions);\n // $this->assertContains('application/xml', $mimes);\n }",
"public function testGetSubTypeList() {\n\t\t$this->assertEquals(12, count(MimeType::getSubTypeList('archive')));\n\t\t$this->assertEquals(14, count(MimeType::getSubTypeList('spreadsheet')));\n\t\t$this->assertEquals(9, count(MimeType::getSubTypeList('document')));\n\n\t\ttry {\n\t\t\tMimeType::getSubTypeList('foobar');\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\t}",
"public function testGetContentFilesExist()\n {\n $content = $this->fileResolverService->getContent('en');\n\n $this->assertEquals(static::$englishValues, $content);\n }",
"function test_models_post_type_exists(){\n\n do_action('init');\n $this->assertTrue(post_type_exists('book'), 'Verify if post type \"book\" has been registered');\n $this->assertTrue(post_type_exists('magazine'), 'Verify if post type \"magazine\" has been registered');\n\n }",
"public function getAllContentTypeObjects()\n {\n /**\n * If all of the content type objects haven't been initialized, iterate\n * through them and initialize each.\n */\n if (!$this->_allContentTypeObjectsInitialized)\n {\n $contentTypeKeys = array_keys(sfConfig::get('app_sympal_config_content_types', array()));\n\n foreach ($contentTypeKeys as $contentTypeKey)\n {\n $this->getContentTypeObject($contentTypeKey);\n }\n\n $this->_allContentTypeObjectsInitialized = true;\n }\n\n return $this->_contentTypeObjects;\n }",
"function setupContentTypes() {\n\t\tglobal $gLibertySystem, $gBitSmarty, $gBitSystem;\n\t\tforeach( $gLibertySystem->mContentTypes as $cName => $cType ) {\n\t\t\tif ( $gBitSystem->isPackageActive( $cType['handler_package'] ) ) {\n\t\t\t\t$contentTypes[$cType['content_type_guid']] = $gLibertySystem->getContentTypeName( $cType['content_type_guid'] );\n\t\t\t}\n\t\t}\n\t\tasort($contentTypes);\n\t\t$gBitSmarty->assign( 'calContentTypes', $contentTypes );\n\t}",
"public function testAllFormatsExists() {\n $formats = $this->formats['test'];\n foreach ($formats as $format => $config) {\n try {\n $this->assertArrayHasKey(\n $format,\n $this->formats['system'],\n \"Failed asserting that {$format} is a format in the system.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n // Verify if all formats passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for product types availability. Product types (snack & drink) should never be deleted from the database. So if product types aren't available, generate error and then ask user to restore them by deactivating then reactivating the plugin. | public function product_types_exist() {
$current_screen = get_current_screen();
$valid_screen = $current_screen->id === $this->screens['product_edit']
|| $current_screen->id === $this->screens['product_list']
|| $current_screen->id === $this->screens['product_category'];
if ( ! $valid_screen ) {
return;
}
$default_product_types = jpid_default_product_types();
foreach ( $default_product_types as $product_type => $slug ) {
if ( ! term_exists( $product_type, 'jpid_product_type' ) ) {
$message = '<p class="error">';
$message .= __( 'Can\'t find product type: ' . $product_type . '. You might\'ve accidentally replaced or removed them from the database. Please deactivate then reactivate <i>' . JPID_SLUG . '</i> plugin to restore them.', 'jpid' );
$message .= '</p>';
$message .= '<p style="font-style: italic;">Plugin: ' . JPID_SLUG . '<br />Version: ' . JPID_VERSION . '</p>';
wp_die( $message );
}
}
} | [
"public function getAvailableProductTypes();",
"public function validateProductType(): bool\n {\n if ($this->_productTypeId) {\n $productTypeId = $this->_productTypeId;\n $app = $this->app;\n $query = \"SELECT idproduct_type_master FROM product_type_master WHERE idproduct_type_master = '$productTypeId' AND deleted_at IS NULL\";\n if (!empty($query = $app['db']->fetchAssoc($query))) {\n return true;\n }\n } \n\n return false;\n }",
"public function testProductType() {\n $product_type = ProductType::load('t_shirt');\n $this->assertNotNull($product_type);\n $product_variation_type = ProductVariationType::load('t_shirt');\n $this->assertNotNull($product_variation_type);\n }",
"public function checkProductsList() {\n if (!is_array($this->products) || !count($this->products)) {\n $this->logger->info(\"No \".$this->type.\" found in DST.\");\n }\n $this->logger->info(\"Checking products List\");\n foreach ($this->products as $sku => $product) {\n $errors = $this->pimhelper->check_one_reference($this->type, $product->getData());\n if ($errors > 0) {\n $this->logger->info($errors.\" Fields are missing in product : \".$sku);\n die;\n }\n }\n $this->logger->info(\"Fields were created in every products\");\n return true;\n }",
"public function getProductTypesForSimpleProductSync();",
"public static function check_supported_post_type_update_errors() {\n\t\t$builtin_support = AMP_Post_Type_Support::get_builtin_supported_post_types();\n\t\t$supported_types = self::get_option( 'supported_post_types', array() );\n\t\tforeach ( AMP_Post_Type_Support::get_eligible_post_types() as $name ) {\n\t\t\t$post_type = get_post_type_object( $name );\n\t\t\tif ( empty( $post_type ) || in_array( $post_type->name, $builtin_support, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$post_type_supported = post_type_supports( $post_type->name, amp_get_slug() );\n\t\t\t$is_support_elected = in_array( $post_type->name, $supported_types, true );\n\n\t\t\t$error = null;\n\t\t\t$code = null;\n\t\t\tif ( $is_support_elected && ! $post_type_supported ) {\n\t\t\t\t/* translators: %s: Post type name. */\n\t\t\t\t$error = __( '\"%s\" could not be activated because support is removed by a plugin or theme', 'amp' );\n\t\t\t\t$code = sprintf( '%s_activation_error', $post_type->name );\n\t\t\t} elseif ( ! $is_support_elected && $post_type_supported ) {\n\t\t\t\t/* translators: %s: Post type name. */\n\t\t\t\t$error = __( '\"%s\" could not be deactivated because support is added by a plugin or theme', 'amp' );\n\t\t\t\t$code = sprintf( '%s_deactivation_error', $post_type->name );\n\t\t\t}\n\n\t\t\tif ( isset( $error, $code ) ) {\n\t\t\t\tadd_settings_error(\n\t\t\t\t\tself::OPTION_NAME,\n\t\t\t\t\t$code,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t$error,\n\t\t\t\t\t\tisset( $post_type->label ) ? $post_type->label : $post_type->name\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"function getProductTypes(){\n }",
"public function checkFieldStatus()\n {\n $helper = $this->helper;\n $product = $this->coreRegistry->registry('product');\n $productType = $product->getTypeId();\n $allowedsProducts = explode(',', $helper->getAllowedProductType());\n if (in_array($productType, $allowedsProducts)) {\n return true;\n }\n return false;\n }",
"public function getAvailableProductTypes()\n {\n return $this->_dataContainer->get('order/available_product_types');\n }",
"public function redirect_non_supported_product_types() : void\n {\n }",
"public function testGettingProductType()\n {\n // Hardback\n $this->assertSame('Hardback', $this->groschen->getProductType());\n\n // ePub 3\n $groschen = new Groschen('9789510441374');\n $this->assertSame('ePub3', $groschen->getProductType());\n\n // Downloadable audio file\n $groschen = new Groschen('9789510423783');\n $this->assertSame('Downloadable audio file', $groschen->getProductType());\n }",
"private function _selectProductType()\n {\n $types = Mage::helper('skroutz/data')->getProductType();\n foreach ($types as $type) {\n $prod_types[] = $type;\n }\n return $prod_types;\n }",
"protected function anyExistingProduct($type = \"simple\"){\n $productSearch = $this->loadDataSet('Product', 'product_search', array('product_type' => ucfirst($type) . \" Product\"));\n $this->_prepareDataForSearch($productSearch);\n $xpathTR = $this->search($productSearch, 'product_grid');\n return !empty($xpathTR);\n }",
"public function build_product_types() {\n $this->accept_product_types = apply_filters( 'mje_checkout_product_types', array( 'mjob_order', 'mje_claims' ) );\n }",
"public function checkProduct()\n {\n }",
"public static function get_allowed_product_types() {\n\t\t$product_types = self::append_product_data(\n\t\t\tarray(\n\t\t\t\t'physical' => array(\n\t\t\t\t\t'label' => __( 'Physical products', 'woocommerce' ),\n\t\t\t\t\t'default' => true,\n\t\t\t\t),\n\t\t\t\t'downloads' => array(\n\t\t\t\t\t'label' => __( 'Downloads', 'woocommerce' ),\n\t\t\t\t),\n\t\t\t\t'subscriptions' => array(\n\t\t\t\t\t'label' => __( 'Subscriptions', 'woocommerce' ),\n\t\t\t\t\t'product' => 27147,\n\t\t\t\t),\n\t\t\t\t'memberships' => array(\n\t\t\t\t\t'label' => __( 'Memberships', 'woocommerce' ),\n\t\t\t\t\t'product' => 958589,\n\t\t\t\t),\n\t\t\t\t'bookings' => array(\n\t\t\t\t\t'label' => __( 'Bookings', 'woocommerce' ),\n\t\t\t\t\t'product' => 390890,\n\t\t\t\t),\n\t\t\t\t'product-bundles' => array(\n\t\t\t\t\t'label' => __( 'Bundles', 'woocommerce' ),\n\t\t\t\t\t'product' => 18716,\n\t\t\t\t),\n\t\t\t\t'product-add-ons' => array(\n\t\t\t\t\t'label' => __( 'Customizable products', 'woocommerce' ),\n\t\t\t\t\t'product' => 18618,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\treturn apply_filters( 'woocommerce_admin_onboarding_product_types', $product_types );\n\t}",
"public function available_item_types() {}",
"public function check_availability() {\n\n $config = get_config('local_shop');\n\n // Check if product has handler and is available.\n if ($this->enablehandler) {\n $handler = $this->get_handler();\n if ($handler && !$handler->is_available($this)) {\n /*\n * TODO : defer this check at a shop instance level, using\n * global config key as default setting.\n */\n if ($config->hideproductswhennotavailable) {\n return;\n } else {\n $this->available = false;\n }\n }\n }\n return true;\n }",
"private function isAllowedLoading(): bool\n {\n $productType = $this->getProductType();\n //====================================================================//\n // Filter Virtual Products\n if (empty(Configuration::get(\"SPLASH_SYNC_VIRTUAL\")) && (\"virtual\" == $productType)) {\n return false;\n }\n //====================================================================//\n // Setup Pack Products Filters\n if (empty(Configuration::get(\"SPLASH_SYNC_PACKS\")) && (\"pack\" == $productType)) {\n return false;\n }\n\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation keyCreateWithHttpInfo Create a key | public function keyCreateWithHttpInfo($project_id, $key_create_parameters, $x_phrase_app_otp = null)
{
$request = $this->keyCreateRequest($project_id, $key_create_parameters, $x_phrase_app_otp);
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() ? (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,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 201:
if ('\Phrase\Model\TranslationKeyDetails' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\Phrase\Model\TranslationKeyDetails', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\Phrase\Model\TranslationKeyDetails';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Phrase\Model\TranslationKeyDetails',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function createPrivateKeyWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\Key';\n $request = $this->createPrivateKeyRequest();\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 (!in_array($returnType, ['string', 'integer', 'bool'])) {\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 '\\Reepay\\Model\\Key',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createAPIKey($keyId, $request)\n {\n return $this->start()->uri(\"/api/api-key\")\n ->urlSegment($keyId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"public static function newCreatingApiKeyRequest(): CreatingApiKeyRequest {\n return new CreatingApiKeyRequest();\n }",
"public function createLicenseKeyWithHttpInfo($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\LicenseKeyModel';\n $request = $this->createLicenseKeyRequest($id, $x_avalara_client, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\LicenseKeyModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testCreateKey(): void\n {\n $token = $this->getToken(array(\n 'email' => 'test_full@gmail.com',\n 'password' => 'testfullpassword'\n ));\n $response = static::createClientWithCredentials()->request(\n 'POST',\n '/api/keys',\n ['body' => json_encode([\n 'keyCode' => 'test.key',\n 'description' => 'test description'\n ])]\n );\n $this->assertResponseIsSuccessful();\n $this->assertJsonContains([\n 'keyCode' => 'test.key',\n 'description' => 'test description'\n ]);\n $this->assertMatchesResourceItemJsonSchema(Key::class);\n }",
"protected function keyCreateRequest($project_id, $key_create_parameters, $x_phrase_app_otp = null)\n {\n // verify the required parameter 'project_id' is set\n if ($project_id === null || (is_array($project_id) && count($project_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_id when calling keyCreate'\n );\n }\n // verify the required parameter 'key_create_parameters' is set\n if ($key_create_parameters === null || (is_array($key_create_parameters) && count($key_create_parameters) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $key_create_parameters when calling keyCreate'\n );\n }\n\n $resourcePath = '/projects/{project_id}/keys';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_phrase_app_otp !== null) {\n $headerParams['X-PhraseApp-OTP'] = ObjectSerializer::toHeaderValue($x_phrase_app_otp);\n }\n\n // path params\n if ($project_id !== null) {\n $resourcePath = str_replace(\n '{' . 'project_id' . '}',\n ObjectSerializer::toPathValue($project_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($key_create_parameters)) {\n $_tempBody = $key_create_parameters;\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function createKey($name);",
"public static function createKey(): ApiKey\n {\n $apiKey = new self([\n 'key' => self::generateKey(),\n ]);\n\n $apiKey->save();\n\n return $apiKey;\n }",
"public function createUserKey(Request $request){\n return $this->createNewApiKey(true); \n }",
"public function keyCreate($project_id, $key_create_parameters, $x_phrase_app_otp = null)\n {\n list($response) = $this->keyCreateWithHttpInfo($project_id, $key_create_parameters, $x_phrase_app_otp);\n return $response;\n }",
"public function createPublicKeyAsyncWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\Key';\n $request = $this->createPublicKeyRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function testCreateKey(): void\n {\n $apiKey = $this->createApiManager(\n [\n 'created_at' => '2019-02-25T23=>36=>48Z',\n 'key' => 'PNYH33ZHKVX3HBAT',\n 'target_user' => [\n 'created_at' => '2019-02-24T23=>34=>11Z',\n 'email' => 'examples@user.test',\n 'id' => 'external-user-ids',\n 'updated_at' => '2019-02-24T23=>34=>11Z',\n ],\n 'updated_at' => '2019-02-25T23=>36=>48Z',\n 'user' => [\n 'created_at' => '2019-02-12T22=>08=>30Z',\n 'email' => 'payments@eoneopay.com',\n 'updated_at' => '2019-02-12T22=>08=>30Z',\n ],\n ],\n 201\n )\n ->create(\n (string)\\getenv('PAYMENTS_API_KEY'),\n new ApiKey(['user' => new User(['id' => 'external-user-id'])])\n );\n\n self::assertIsString(($apiKey instanceof ApiKey) ? $apiKey->getKey() : null);\n self::assertInstanceOf(User::class, ($apiKey instanceof ApiKey) ? $apiKey->getUser() : null);\n }",
"function create()\n {\n $createKeyResponse = $this->keyVaultKey->create($this->name, $this->key_type, $this->key_size);\n\n if ($createKeyResponse[\"responsecode\"] == 200) {\n\n //Extract the modulus \"n\" amd exponent \"e\" of the public key\n $this->public_key_n = $createKeyResponse['data']['key']['n'];\n $this->public_key_e = $createKeyResponse['data']['key']['e'];\n\n //Extract the possible key operations as an array\n $this->key_ops = json_encode( $createKeyResponse['data']['key']['key_ops']);\n\n //Extract the key key reference in Azure\n $this->key_version = $createKeyResponse['data']['key']['kid'];\n\n //Generate a unique random ID for the Keys ID column\n $this->id = uniqid(rand(),false);\n\n //Usage is \"General\" for the \"Create Key\" request\n $this->usage = \"General\";\n\n $this->vault_id = '1320b3cb-860b-4ea4-8a60-a01e138834ff';\n\n /*Insert Key and attributes into Database\n */\n $query = \"INSERT INTO \n \".$this->table_name.\"\n (`id`, `name`, `user_id`, `use`, `public_key_n`,`vault_id`,`public_key_e`, `key_ops`,`key_type`, `key_size`,`key_version`) \n VALUES \n ('$this->id','$this->name','$this->user_id','$this->usage', '$this->public_key_n','$this->vault_id','$this->public_key_e','$this->key_ops','$this->key_type','$this->key_size','$this->key_version')\";\n\n\n //prepare query\n $stmt = $this->conn->prepare($query);\n\n try{\n if( $stmt->execute())\n return true;\n\n } catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n\n return false;\n }\n\n else{\n return false;\n }\n\n }",
"private function createKey() {\n $ts = time();\n $hash = md5($ts . $this->_privatekey . $this->_publickey);\n $key = 'ts=' . $ts . '&apikey=' . $this->_publickey . \n '&hash=' . $hash;\n return $key;\n }",
"public function createApikey()\n\t{\n\t\treturn false;\n\t}",
"public function createAdvertiserApiKey($parameters = [])\n {\n return $this->get('createAdvertiserApiKey', $parameters);\n }",
"public function createNewApiKeyAsyncWithHttpInfo($creation_request)\n {\n $returnType = '\\Bluerain\\ID4iClient\\Model\\ApiKeyPresentation';\n $request = $this->createNewApiKeyRequest($creation_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public static function makeApiKey($key)\n {\n return new RegisterKey($key);\n }",
"public function postRecordingLocalkeysWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\EncryptionKey';\n $request = $this->postRecordingLocalkeysRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\EncryptionKey',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup the database schema. Does not add data. | static function setUpSchema() {
$sql = file_get_contents(__DIR__ . '/Test/test.sql');
self::$box->db()->exec($sql);
$build = self::$box->builder();
$build->updatePropel();
self::$box->enable();
$build->loadAllClasses();
} | [
"protected static function _setUpDatabase()\n {\n\n Db::buildSchema()->table(static::$_table)\n ->autoId()\n ->varChar('name')\n ->varChar('email')\n ->varChar('code')\n ->timestamp()\n ->create();\n\n }",
"public function setUp(): void\n {\n $this->db_adapter->begin();\n\n $this->db_adapter->execute(\"\n CREATE SCHEMA exodus_tmp;\n \");\n }",
"protected function setUp() : void {\n $this->ensureTable(new Users($this->site->db));\n $this->ensureTable(new Members($this->site->db));\n $this->ensureTable(new ReviewAssignments($this->site->db));\n $this->ensureTable(new Reviews($this->site->db));\n $this->ensureTable(new Submissions($this->site->db));\n }",
"protected function setUp()\n {\n $this->db = new Db(new ArrayToObject([\n \"databaseDir\" => __DIR__ . \"/../database\"\n ]));\n\n $this->db->createTable(new Table('Users', [\n new Column('id', Column::INT_TYPE, [Column::INCREMENT_FLAG]),\n new Column('firstName', Column::STRING_TYPE),\n new Column('lastName', Column::STRING_TYPE),\n new Column('DoB', Column::DATE_TYPE),\n ]));\n\n $this->db->createTable(new Table('Hats', [\n new Column('id', Column::INT_TYPE, [Column::INCREMENT_FLAG]),\n new Column('user_id', Column::INT_TYPE),\n new Column('name', Column::STRING_TYPE),\n ], [\n new BelongsTo('Users', 'id', 'user_id')\n ]));\n }",
"private function createDatabase(): void\n {\n $em = $this->entityManager;\n $metadata = $em->getMetadataFactory()->getAllMetadata();\n\n $schemaTool = new SchemaTool($em);\n $schemaTool->createSchema($metadata);\n }",
"public static function setup_db()\n {\n static::_setup_db();\n }",
"protected function setUpDatabase(): void\n {\n include_once __DIR__ . '/../database/migrations/CreateDummyModelsTable.php';\n\n (new \\CreateDummyModelsTable())->up();\n }",
"protected function _setupMetadata() {\n $this->_schema = Zend_Registry::get('config')->resources->db->params->dbname;\n parent::_setupMetadata();\n }",
"protected function _initialize_schema()\n {\n $this->set_database($this->_database_group);\n\n $this->_fetch_table();\n $this->_fetch_primary_key();\n\n if($this->primary_key == null && $this->is_base_model_instance()) {\n return;\n }\n\n $this->_fields = $this->get_fields();\n\n $this->_guess_is_soft_deletable();\n $this->_guess_is_blamable();\n $this->_guess_is_timestampable();\n\n }",
"protected function prepareDatabase()\n {\n if (! $this->migrator->repositoryExists()) {\n $this->call('migrate:install', array_filter([\n '--database' => $this->option('database'),\n ]));\n }\n\n if (! $this->migrator->hasRunAnyMigrations() && ! $this->option('pretend')) {\n $this->loadSchemaState();\n }\n }",
"public function setSchema() {\n\t\t$this->table = $this->db->prefix . $this->table;\n\t\t \n\t\t$sql = \"CREATE TABLE \" . $this->table . \" (\n\t\t\tid int(11) NOT NULL AUTO_INCREMENT,\n\t\t\tname VARCHAR(50) NOT NULL,\n\t\t\ttext text NOT NULL,\n\t\t\tslug VARCHAR(50) DEFAULT '' NOT NULL,\n\t\t\tPRIMARY KEY (id),\n\t\t\tINDEX name_idx (name),\n\t\t\tINDEX slug_idx (slug)\n\t\t);\";\n\n\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\tdbDelta($sql);\n\n\t\tupdate_option($this->optName, $this->dbVersion);\n\t}",
"function InitializeSchema()\n\t{\n\t\tif ($this->ListOfTable)\n\t\t\treturn ;\n\t\t$Query = $this->GetSchemaSQL();\n\t\t$Queries = explode ( \";\", $Query );\n\t\tforeach ( $Queries as $Q )\n\t\t\t$this->query ( $Q );\n\t}",
"protected function _initDbSchema() {\n\t\tif (!empty($this->schema)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: feed\n\t\t#\n\t\t\n\t\t$this->schema['feed']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `feed` (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\turl VARCHAR(255) UNIQUE,\n\ttitle VARCHAR(255),\n\t\n\ttype VARCHAR(1),\n\tstatus VARCHAR(1),\n\tcreated DATETIME,\n\tlastUpdated DATETIME,\n\n\tlastPolled DATETIME,\n\tnextPoll DATETIME\n);\nSQL;\n\n\t\t$this->schema['feed']['add'] = <<<SQL\nINSERT INTO `feed` \n(id, url, title, type, status, created, lastUpdated, lastPolled, nextPoll)\nVALUES\n(NULL, :url, :title, :type, :status, \n :created, :lastUpdated, :lastPolled, :nextPoll);\nSQL;\n\n\t\t$this->schema['feed']['updatePoll'] = <<<SQL\nUPDATE `feed` \nSET\n\tlastUpdated = :lastUpdated,\n\tlastPolled = :lastPolled\nWHERE\n\tid = :id\nSQL;\n\n\t\t$this->schema['feed']['getAll'] = <<<SQL\nSELECT * FROM `feed`;\nSQL;\n\n\t\t$this->schema['feed']['getById'] = <<<SQL\nSELECT * FROM `feed`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['feed']['getByUrl'] = <<<SQL\nSELECT * FROM `feed`\nWHERE\n\turl = :url;\nSQL;\n\n\t\t$this->schema['feed']['deleteById'] = <<<SQL\nDELETE FROM `feed`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['feed']['deleteByUrl'] = <<<SQL\nDELETE FROM `feed`\nWHERE\n\turl = :url;\nSQL;\n\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: author\n\t\t#\n\n\t\t$this->schema['author']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `author` (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tname VARCHAR(255),\n\turl VARCHAR(255),\n\temail VARCHAR(255),\n\t\n\tUNIQUE(name, url)\n);\nSQL;\n\n\t\t$this->schema['author']['add'] = <<<SQL\nINSERT INTO `author`\n(id, name, url, email)\nVALUES\n(NULL, :name, :url, :email)\nSQL;\n\n\t\t$this->schema['author']['getAll'] = <<<SQL\nSELECT * FROM `author`;\nSQL;\n\n\t\t$this->schema['author']['getByName'] = <<<SQL\nSELECT * FROM `author`\nWHERE\n\tname = :name;\nSQL;\n\n\t\t$this->schema['author']['getById'] = <<<SQL\nSELECT * FROM `author`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['author']['deleteByName'] = <<<SQL\nDELETE FROM `author`\nWHERE\n\tname = :name;\nSQL;\n\n\t\t$this->schema['author']['deleteById'] = <<<SQL\nDELETE FROM `author`\nWHERE\n\tid = :id;\nSQL;\n\n\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: entry\n\t\t#\n\t\t\n\t\t$this->schema['entry']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `entry` (\n\trow_id INTEGER PRIMARY KEY AUTOINCREMENT,\n\turl VARCHAR(255),\n\ttitle VARCHAR(255),\n\tid VARCHAR(255) UNIQUE,\n\tauthor_id INTEGER,\n\tsummary TEXT,\n\tcontent TEXT,\n\tpublished DATETIME,\n\tupdated DATETIME\n\n);\nSQL;\n\n\t\t$this->schema['entry']['add'] = <<<SQL\nINSERT INTO `entry`\n(row_id, url, title, id, author_id, summary, content, published, updated)\nVALUES\n(NULL, :url, :title, :id, :author_id, :summary, :content, :published, :updated)\nSQL;\n\n\t\t$this->schema['entry']['getAll'] = <<<SQL\nSELECT * FROM `entry`;\nSQL;\n\n\t\t// TODO: Add join for author id\n\t\t$this->schema['entry']['getById'] = <<<SQL\nSELECT * FROM `entry`\nWHERE\n\trow_id = :row_id;\nSQL;\n\n\t\t// TODO: Add join for author id\n\t\t$this->schema['entry']['getByAtomId'] = <<<SQL\nSELECT * FROM `entry`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['entry']['deleteById'] = <<<SQL\nDELETE FROM `entry`\nWHERE\n\trow_id = :row_id;\nSQL;\n\n\t\t$this->schema['entry']['deleteByAtomId'] = <<<SQL\nDELETE FROM `entry`\nWHERE\n\tid = :id;\nSQL;\n\n\n\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: feedentry\n\t\t#\n\t\t\n\t\t$this->schema['feedentry']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `feedentry` (\n\tfeed_id INTEGER,\n\tentry_id INTEGER,\n\tcreated DATETIME,\n\n\tPRIMARY KEY(feed_id, entry_id)\t\n);\nSQL;\n\n\t$this->schema['feedentry']['add'] = <<<SQL\nINSERT INTO `feedentry`\n(feed_id, entry_id, created)\nVALUES\n(:feed_id, :entry_id, :created)\nSQL;\n\n\t$this->schema['feedentry']['getByFeedUrl'] = <<<SQL\nSELECT \n\trow_id, entry.url, entry.title, entry.id, \n\tauthor_id, summary, content,\n\tentry.published, entry.updated\nFROM entry\nLEFT JOIN feedentry ON entry.row_id = feedentry.entry_id\nLEFT JOIN feed ON feedentry.feed_id = feed.id\nWHERE\n\tfeed.url = :feed_url\nORDER BY entry.published DESC\nSQL;\n\n\n\t}",
"public function creatDatabase() {\n\n $tool = new SchemaTool($this->emanager);\n $classes = array(\n $this->emanager->getClassMetadata(Market::class),\n $this->emanager->getClassMetadata(Issuer::class),\n $this->emanager->getClassMetadata(Currency::class),\n $this->emanager->getClassMetadata(PriceHistory::class),\n $this->emanager->getClassMetadata(DocumentType::class),\n $this->emanager->getClassMetadata(Document::class),\n $this->emanager->getClassMetadata(Certificate::class),\n $this->emanager->getClassMetadata(BonusCertificate::class),\n $this->emanager->getClassMetadata(GuaranteeCertificate::class)\n );\n $tool->createSchema($classes);\n }",
"protected function createSchema() : Schema {}",
"public function testInitializeCreatesSchema()\n {\n $connection = ConnectionManager::get('test');\n $stmt = $connection->execute('DROP TABLE IF EXISTS panels');\n $stmt->closeCursor();\n\n $stmt = $connection->execute('DROP TABLE IF EXISTS requests');\n $stmt->closeCursor();\n\n TableRegistry::get('DebugKit.Requests');\n TableRegistry::get('DebugKit.Panels');\n\n $schema = $connection->getSchemaCollection();\n $this->assertContains('requests', $schema->listTables());\n $this->assertContains('panels', $schema->listTables());\n }",
"public function schema()\n {\n $this->useRecordSchema();\n }",
"private function setupDatabase()\n {\n $sql = $this->getSql();\n $connection = $this->getDatabase();\n\n foreach ($sql as $file) {\n $connection->exec(file_get_contents(__DIR__ . '/../../resources/sql/' . $file));\n }\n }",
"public function testInitializeCreatesSchema()\n {\n $connection = ConnectionManager::get('test');\n $stmt = $connection->execute('DROP TABLE IF EXISTS panels');\n $stmt->closeCursor();\n\n $stmt = $connection->execute('DROP TABLE IF EXISTS requests');\n $stmt->closeCursor();\n\n $this->fetchTable('DebugKit.Requests');\n $this->fetchTable('DebugKit.Panels');\n\n $schema = $connection->getSchemaCollection();\n $this->assertContains('requests', $schema->listTables());\n $this->assertContains('panels', $schema->listTables());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a newly created resource in storage. POST /financial_accounts | public function store()
{
$input = Request::all();
$validator = Validator::make($input, FinancialAccount::getCreateRules());
if($validator->fails()) {
return ApiResponse::validation($validator);
}
try {
$financialAccount = $this->repo->createFinancialAccount($input['name'], $input['account_type'], $input['account_sub_type'], $input);
Event::fire('JobProgress.Events.FinancialAccountCreated', new FinancialAccountCreated($financialAccount));
return ApiResponse::success([
'message' => trans('response.success.created', ['attribute' => 'Financial Account']),
'data' => $this->response->item($financialAccount, new FinancialAccountTransformer)
]);
} catch(FinancialSubAccountMaxLimitExceedException $e){
return ApiResponse::errorGeneral($e->getMessage());
} catch(ParentAccountTypeNotSameException $e){
return ApiResponse::errorGeneral($e->getMessage());
} catch(ModelNotFoundException $e) {
return ApiResponse::errorNotFound('Financial Account Type Not Found.');
} catch(Exception $e) {
return ApiResponse::errorInternal(trans('response.error.internal'), $e);
}
} | [
"public function save()\n {\n\n $this->accounts_repository->create([\n 'type' => $this->type,\n 'account_number' => $this->account_number,\n 'customer_id' => $this->customer_id,\n 'branch_id' => $this->branch_id,\n 'balance' => $this->balance\n ]);\n }",
"public function save()\n {\n $this->accounts_repository->create([\n 'account_number' => $this->accountNumber,\n 'type' => $this->type,\n 'branch_id' => $this->branch_id,\n 'customer_id' => $this->customer_id,\n 'balance' => $this->balance,\n ]);\n }",
"public function store(CreateFloatBalanceRequest $request)\n {\n $input = $request->all();\n// dd($input);\n\n $amount= FloatBalance::sum('amount');\n $prev_running_balance = FloatBalance::orderBy('floattransactionid', 'desc')->first();\n\n $input['runningbal'] = $prev_running_balance->runningbal;\n\n\n $floatBalance = $this->floatBalanceRepository->create($input);\n\n\n //initiating the approval request\n $approval = new FloatBalance();\n $approval->addApproval($floatBalance);\n\n Flash::success('Float Balance saved successfully.');\n\n return redirect(route('floatBalances.index'));\n }",
"public function store(CreateFinanceChargeRequest $request)\n\t{\n\t\t$input = $request->all();\n\n\t\t$financeCharge = $this->financeChargeRepository->create($input);\n\n\t\tFlash::success('FinanceCharge saved successfully.');\n\n\t\treturn redirect(route('financeCharges.index'));\n\t}",
"public function save() {\n $transaction = $this->transaction;\n $transaction->changed = REQUEST_TIME;\n\n $transaction_array = array(\n 'transaction_id' => $transaction->transactionId,\n 'uid' => $transaction->uid,\n 'cashier' => $transaction->cashier,\n 'order_id' => $transaction->orderId,\n 'type' => $transaction->type,\n 'data' => $transaction->data,\n 'register_id' => $transaction->registerId,\n 'changed' => $transaction->changed,\n 'created' => $transaction->created,\n 'completed' => $transaction->completed,\n );\n\n if ($transaction->transactionId) {\n $primary_keys = 'transaction_id';\n }\n else {\n $primary_keys = array();\n }\n\n drupal_write_record($transaction::TABLE_NAME, $transaction_array, $primary_keys);\n $transaction->transactionId = $transaction_array['transaction_id'];\n unset($transaction_array);\n }",
"public function store(FiscalRequest $request)\n {\n $this->fiscalRepository->create($request->all());\n\n $html = $this->renderizarTabela();\n \n return response(['msg' => trans('alerts.registro.created'), 'status' => 'success', 'html'=> $html]); \n }",
"public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}",
"public function store(CreateRateRequest $request)\n {\n $input = $request->all();\n\n $rate = $this->rateRepository->create($input);\n\n Flash::success(__('pwweb::localisation.tax.rates.saved'));\n\n return redirect(route('localisation.tax.rates.index'));\n }",
"public function store(CreateRefundMoneyRequest $request)\n {\n $input = $request->all();\n\n $refundMoney = $this->refundMoneyRepository->create($input);\n\n Flash::success('Refund Money saved successfully.');\n\n return redirect(route('refundMoneys.index'));\n }",
"public function store()\n\t{\n\t\t$this->transaction->save(Input::all());\n\t}",
"public function save(Account $account);",
"public function store(CreateFinanciacionRequest $request)\n {\n $input = $request->all();\n\n $financiacion = $this->financiacionRepository->create($input);\n\n Flash::success('Financiacion saved successfully.');\n\n return redirect(route('financiacions.index'));\n }",
"public function store(CreatePeriodRequest $request)\n\t{\n $input = $request->all();\n\n\t\t$period = Period::create($input);\n\n\t\tAlert::success('Periodo guardado exitosamente')->persistent('Cerrar');\n\n\t\treturn redirect(route('periods.index'));\n\t}",
"public function store()\n\t{\n\t\t$carrier = new $this->repo;\n\n\t\tif ($carrier->save()) {\n\t\t\treturn $this->rest->response(201, $carrier);\n\t\t}\n\n\t\treturn $this->response->errorBadRequest($carrier->errors());\n\t}",
"public function store(CreateContractRequest $request){\n\n \t$current_user=auth()->guard('admin')->user();\n \t//system generated contract code\n \t$contract_code='CONT'.Carbon::now()->timestamp;\n \t$start_date=Carbon::createFromFormat('d/m/Y', $request->start_date)->format('Y-m-d');\n \t$end_date=Carbon::createFromFormat('d/m/Y', $request->end_date)->format('Y-m-d');\n\n $default_contract_status=Status::where('status_for','contract')->where('is_default_status',true)->first();\n if(!$default_contract_status){\n return redirect()->back()->with('error','No default status found for contract. Please add default status for contract.');\n }\n\n $contract=Contract::create([\n 'code'=>$contract_code,\n 'title'=>$request->title,\n 'description'=>$request->description,\n 'property_id'=>$request->property,\n 'service_provider_id'=>$request->service_provider,\n 'start_date'=>$start_date,\n 'end_date'=>$end_date,\n 'status_id'=>$default_contract_status->id,\n 'created_by'=>$current_user->id,\n 'updated_by'=>$current_user->id\n ]);\n\n \treturn redirect()->route('admin.contracts.services',$contract->id);\n\n }",
"public function store()\n\t{\n\n\t\t$data = Input::all();\n $validator = Validator::make($data, array('f_member_name' => 'required', 'patient_relation' => 'required', 'gender' => 'required', 'age' => 'required'));\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n $data['clinic_id'] = Auth::user()->clinic_id;\n\n\t\tFamilyhistory::create($data);\n\n\t\treturn Redirect::to('familyhistories?id='.$data['patient_id']);\n\t}",
"public function store(CreateAccount_transactionsRequest $request)\n {\n $input = $request->all();\n\n $accountTransactions = $this->accountTransactionsRepository->create($input);\n\n Flash::success('Account Transactions saved successfully.');\n\n return redirect(route('accounting.accountTransactions.index'));\n }",
"public function store(CreateBalanceRequest $request)\n {\n $rows = $request->except(['date','_token']);\n $user_id = Auth::id();\n $accounts = Account::select('id')->get()->pluck('id');\n $date = $request->get('date');\n\n Balance::where('user_id', $user_id)->update(['latest'=> false]);\n Balance::where('date', $date)->delete();\n\n foreach ($rows as $row) {\n //check this users owns this account\n if ($accounts->contains($row['account_id']) && !is_null($row['amount'])) {\n $row['user_id'] = $user_id;\n $row['latest'] = true;\n $row['date'] = $date;\n $balance = Balance::create($row);\n $balance->save();\n } else {\n dd($row['account_id'], \"not matched\", $accounts->keys());\n }\n }\n\n Flash::success('Balance saved successfully.');\n\n return redirect(route('dashboard'));\n }",
"public function store(CreatePagoRelFacturaRequest $request)\n {\n $input = $request->all();\n $input['user_id'] = Auth::id();\n\n $pagoRelFactura = $this->pagoRelFacturaRepository->create($input);\n\n Flash::success('Pago Rel Factura registrado correctamente.');\n\n return redirect(route('pagoRelFacturas.index'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the block message that the blocked user sees | public function blockMessage()
{
$translate = $this->getTranslate();
$blocker = $this->findParentRow('\Ppb\Db\Table\Users');
$type = $this->getData('type');
$value = $this->getData('value');
$blockReason = $this->getData('block_reason');
$showReason = $this->getData('show_reason');
$message = sprintf(
$translate->_('Your %s (%s) has been blocked from %s by %s.'),
self::$blockTypes[$type],
$value,
$this->getBlockedActions(', '),
($blocker) ? $blocker['username'] : $translate->_('the administrator'));
if ($showReason && !empty($blockReason)) {
$message .= '<br>' . sprintf($translate->_('Block Reason: %s'), $blockReason);
}
return $message;
} | [
"public function getMsgsBlock(){\n\t\treturn $this->msgs_block;\n\t}",
"public function getBlocked()\n {\n return $this->getValue('blocked');\n }",
"public function getBlockUser()\n {\n return $this->block_user;\n }",
"function userBlockedMessage( Block $block ) {\n\t\tglobal $wgOut;\n\n\t\t# Let's be nice about this, it's likely that this feature will be used\n\t\t# for blocking large numbers of innocent people, e.g. range blocks on\n\t\t# schools. Don't blame it on the user. There's a small chance that it\n\t\t# really is the user's fault, i.e. the username is blocked and they\n\t\t# haven't bothered to log out before trying to create an account to\n\t\t# evade it, but we'll leave that to their guilty conscience to figure\n\t\t# out.\n\n\t\t$wgOut->setPageTitle( wfMsg( 'cantcreateaccounttitle' ) );\n\n\t\t$block_reason = $block->mReason;\n\t\tif ( strval( $block_reason ) === '' ) {\n\t\t\t$block_reason = wfMsg( 'blockednoreason' );\n\t\t}\n\n\t\t$wgOut->addWikiMsg(\n\t\t\t'cantcreateaccount-text',\n\t\t\t$block->getTarget(),\n\t\t\t$block_reason,\n\t\t\t$block->getBlocker()->getName()\n\t\t);\n\n\t\t$wgOut->returnToMain( false );\n\t}",
"public function blockCurrentUser()\n\t{\n\t\t//show block message via wp_die\n\t\t$blockTime = $this->configuration->getOptionValue(NextADInt_Adi_Configuration_Options::BLOCK_TIME);\n\t\t\n\t\t$this->showBlockMessage($blockTime);\n\t}",
"public function blocked()\n\t{\n\t\treturn $this->user()->getBlockedFriendships()->load(['sender', 'recipient']);\n\t}",
"public function blocked()\n\t{\n\t\t// callables to fetch user data\n\t\t$fetchUsers = function($start, $pageSize) {\n\t\t\tlist($totalUsers, $users) = qa_db_select_with_pending(\n\t\t\t\tqa_db_selectspec_count(qa_db_users_with_flag_selectspec(QA_USER_FLAGS_USER_BLOCKED)),\n\t\t\t\tqa_db_users_with_flag_selectspec(QA_USER_FLAGS_USER_BLOCKED, $start, $pageSize)\n\t\t\t);\n\n\t\t\treturn array($totalUsers['count'], $users);\n\t\t};\n\t\t$userLevel = function($user) {\n\t\t\treturn qa_html(qa_user_level_string($user['level']));\n\t\t};\n\n\t\t$qa_content = $this->rankedUsersContent($fetchUsers, $userLevel);\n\n\t\t$qa_content['title'] = empty($qa_content['ranking']['items'])\n\t\t\t? qa_lang_html('users/no_blocked_users')\n\t\t\t: qa_lang_html('users/blocked_users');\n\n\t\t$qa_content['ranking']['sort'] = 'level';\n\n\t\treturn $qa_content;\n\t}",
"public function getUniqueBlocked()\n\t\t{\n\t\t\treturn $this->unique_blocked;\n\t\t}",
"function fellow_block_user( $user, $username, $password ) \n\t{\n\t\tif (!empty($username) && !empty($password)) {\n\t\t\t$action= get_user_meta($user->ID,\"action\");\n\t\t\t// echo $action[0];\n\t\t\tif($action[0]==\"block\"){\n\t\t\t\techo \"<h4 class='block_msg'>Your account is blocked</h4></br>\";\n\t\t\t}else{\n\t\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\t}",
"public function getLockedMessage()\n\t{\n\t\treturn Loc::getMessage('LANDING_HOOK_HEADBLOCK_LOCKED');\n\t}",
"public function getBlockChat()\n {\n if (array_key_exists(\"blockChat\", $this->_propDict)) {\n return $this->_propDict[\"blockChat\"];\n } else {\n return null;\n }\n }",
"public function blockUser();",
"public function block() \n\t{\t\n\t\t$this->auth->restrict('Member.Content.Block');\n\n\t\t$id = $this->uri->segment(5);\n\t\n\t\tif (!empty($id))\n\t\t{\t\n\t\t\tif ($this->member_model->block($id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->auth->user_id(), lang('member_act_block_record').': ' . $id . ' : ' . $this->input->ip_address(), 'member');\n\t\t\t\t\t\n\t\t\t\tTemplate::set_message(lang('member_block_success'), 'success');\n\t\t\t} else\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('member_block_failure') . $this->member_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\t\n\t\tredirect(SITE_AREA .'/content/member/blocked');\n\t}",
"public function getBotBlock()\n {\n return $this->botBlock;\n }",
"public function getEmailblocked()\n\t{\n\t\treturn $this->emailblocked;\n\t}",
"function getCannedBlockedMsgExplanation()\n {\n $msg = ev_gettext(\"WARNING: This message was blocked because the sender was not allowed to send emails to the associated issue.\") . \" \";\n $msg .= ev_gettext(\"Only staff members listed in the assignment or authorized replier fields can send emails.\") . \"\\n\";\n $msg .= str_repeat('-', 70) . \"\\n\\n\";\n return $msg;\n }",
"public function getMessageBlocks()\n {\n return $this->messageBlocks;\n }",
"public function blocker() {\n return $this->blocker;\n }",
"function getUserBlock($pk)\n\t{\n\t\t$_blocked_infos\t\t\t=\tarray();\n\t\t$blocked\t\t\t\t=\tarray();\n\t\t\n\t\tif($pk != '')\n\t\t{\n\t\t\tinclude(\"_mysql.php\");\n\t\t\t\n\t\t\t$_sql\t\t\t\t=\t\"SELECT benutzer_blocked,blocked_until FROM main_clients WHERE pk_client='\" . $pk . \"' LIMIT 1\";\n\t\t\t\n\t\t\tif (($data = $databaseConnection->query($_sql)) !== false)\n\t\t\t{\n\t\t\t\tif ($data->rowCount() > 0)\n\t\t\t\t{\n\t\t\t\t\t$result \t\t\t\t\t\t= \t$data->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\n\t\t\t\t\tforeach($result AS $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$blocked \t\t\t\t\t= \t$row;\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t$_blocked_infos['blocked']\t\t=\t$blocked['benutzer_blocked'];\n\t\t\t\t\t$_blocked_infos['until']\t\t=\t$blocked['blocked_until'];\n\t\t\t\t\t\n\t\t\t\t\treturn $_blocked_infos;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_blocked_infos['blocked']\t\t=\t\"false\";\n\t\t\t\t\t$_blocked_infos['until']\t\t=\t0;\n\t\t\t\t\t\n\t\t\t\t\treturn $_blocked_infos;\n\t\t\t\t};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twriteInLog(2, \"getUserBlock (SQL Error):\".$databaseConnection->errorInfo()[2]);\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_blocked_infos['blocked']\t\t=\t\"true\";\n\t\t\t$_blocked_infos['until']\t\t=\t0;\n\t\t\t\n\t\t\treturn $_blocked_infos;\n\t\t};\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of artista | public function getArtista()
{
return $this->artista;
} | [
"public function getId_Artista()\n {\n return $this->id_artista;\n }",
"public function getArticulo()\n {\n return $this->articulo;\n }",
"public function getNombre_Art()\n {\n return $this->nombre_art;\n }",
"public function getArtiste()\r\n {\r\n return $this->artiste;\r\n }",
"public function getPres_art()\r\n\t{\r\n\t\treturn($this->pres_art);\r\n\t}",
"public function getId_art()\n {\n return $this->id_art;\n }",
"function getAltura() {\n return $this->altura;\n }",
"public function getAltura()\n {\n return $this->altura;\n }",
"public function getAsistenciaValue()\n {\n return $this->asistenciaValue;\n }",
"public function getArt()\n\t{\n\t\tif ($this->_art == null) {\n\t\t\t$this->_art = Art::model()->findByPk($this->resource_id);\n\t\t\tif ($this->_art == null) { // return an empty art if not found\n\t\t\t\t$this->_art = new Art;\n\t\t\t}\n\t\t}\n\t\treturn $this->_art;\n\t}",
"public function getArt_title()\n {\n return $this->art_title;\n }",
"public function getValorTarifa();",
"public function getIdArtAnterior() {\n\t\treturn $this->idArtAnterior;\n\t}",
"static function getArticulos(){\r\n\t\tself::initialize();\r\n\t\treturn self::$articulos;\r\n\t}",
"public function getArtAttribute() {\n\t\treturn Common::toTime($this->attributes['art']);\n\t}",
"public function getArtID()\n {\n return $this->artID;\n }",
"function get_value() {\n if (isset($this->value))\n return $this->value;\n \n $Tainacan_Item_Metadata = \\Tainacan\\Repositories\\Item_Metadata::get_instance();\n return $Tainacan_Item_Metadata->get_value($this);\n }",
"public function getTalla()\n {\n return $this->talla;\n }",
"public function getArtist();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List of templates to render this S3File | protected function defaultTemplate()
{
return array('S3File');
} | [
"function templates()\n {\n return [];\n }",
"public function getTemplates();",
"public function toTwigCollection()\r\n {\r\n $templates = array();\r\n foreach ($this->toArray() as $template) {\r\n $templates[$template->getName()] = $template->getFile()->read();\r\n }\r\n\r\n return $templates;\r\n }",
"function list_templates() {\n\n $files = array();\n foreach ($this->dirkeys as $key => $dirname) \n $files = array_merge($files, $this->_list_files($key, $dirname));\n\n return $files;\n }",
"function templates()\n {\n return[];\n }",
"private function templates() {\n\t\t\t\n\t\t\t$templates = array();\n\t\t\t\n\t\t\t//preg_match_all(\"#(\". preg_quote(\"{{\", \"#\") .\")(.*?)(\". preg_quote(\"}}\", \"#\") .\")#si\", $this->text, $matches);\n\t\t\t$text_templates = $this->_find_sub_templates($this->text);\n\t\t\t\n\t\t\tforeach($text_templates[0] as $text_template) {\n\t\t\t\tpreg_match(\"#^\\{\\{([^\\|]+)(.*?)\\}\\}$#si\", $text_template, $match);\n\t\t\t\t\n\t\t\t\t$template_name = trim($match[1]); // wikisyntax is very case sensitive, so don't use strtolower or similar\n\t\t\t\t\n\t\t\t\tif(!empty($this->options['ignore_template_matches'])) {\n\t\t\t\t\tforeach($this->options['ignore_template_matches'] as $ignore_template_match_regex) {\n\t\t\t\t\t\tif(preg_match($ignore_template_match_regex, $template_name)) {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$template_attributes = trim(ltrim(trim($match[2]), \"|\")); // remove trailing spaces and starting pipe\n\t\t\t\t\n\t\t\t\t$template = array(\n\t\t\t\t\t 'original'\t\t=> $text_template\n\t\t\t\t\t,'template'\t\t=> $template_name\n\t\t\t\t\t,'attributes'\t=> false\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif(strlen($template_attributes) > 0) {\n\t\t\t\t\t$template['attributes']\t= $template_attributes;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//$sub_templates = $this->_find_sub_templates($template['original']); // eventually...\n\t\t\t\t\n\t\t\t\t$templates[] = $template;\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($templates)) {\n\t\t\t\t$this->cargo['templates'] = $templates;\n\t\t\t}\n\t\t}",
"public function getTemplateJavascriptFiles();",
"public static function getAllTemplateUsed() {\n return self::pluck('template')->all();\n }",
"function renderFiles_byFormat($files, $template, $PA) {\n\t\t$uploadPaths = $PA['uploadPaths'];\n\t\t$lConf = $PA['lConf'];\n\t\tforeach ($files as $file) {\n\t\t\t$markers = array();\n\t\t\t$pictoItems .= $this->renderFiles_item($file, $template, $markers, $lConf);\n\t\t}\n\t\treturn $pictoItems;\n\t}",
"public function getTemplateList() {\n\t\t$aArgs = func_get_args();\n\t\t$aRet = call_user_func_array( array( $this, 'getTemplates' ), $aArgs );\n\t\treturn implode( '|', $aRet );\n\t}",
"protected function loadTemplates() {\n $templates = [];\n\n foreach (new \\DirectoryIterator(\"./assets/templates\") as $fileInfo) {\n if ($fileInfo->getExtension() === \"html\") {\n $templates[$fileInfo->getBasename(\".html\")] = file_get_contents($fileInfo->getRealPath());\n }\n }\n\n return $templates;\n }",
"public function fileresponsesimplifiedfilemanager_js_templates() {\n $class_methods = get_class_methods($this);\n $templates = array();\n foreach ($class_methods as $method_name) {\n if (preg_match('/^fm_js_template_(.*)$/', $method_name, $matches))\n $templates[$matches[1]] = $this->$method_name();\n }\n return $templates;\n }",
"public static function lists()\r\n {\r\n $defaultTemplates = Directory::listAssocContents(app_path('Modules/Templates/Views/templates/invests'));\r\n\r\n $customTemplates = Directory::listAssocContents(base_path('custom/templates/invest_templates'));\r\n\r\n return $defaultTemplates + $customTemplates;\r\n }",
"public static function getAllTemplates () {\n return file::getFileList(conf::pathHtdocs() . \"/templates\", array ('dir_only' => true));\n }",
"function sa_templates_available(){\n\t\t\t$sa_files = glob(S_BASE_PATH.'/flot-admin/themes/'.$this->settings->theme.'/*.html');\n\n\t\t\tforeach ($sa_files as $key => $file) {\n\t\t\t\t$sa_files[$key] = substr($file, strrpos($file, '/')+1, strlen($file));\n\t\t\t}\n\t\t\treturn $sa_files;\n\t\t}",
"public function filepicker_js_templates() {\n $class_methods = get_class_methods($this);\n $templates = array();\n foreach ($class_methods as $method_name) {\n if (preg_match('/^fp_js_template_(.*)$/', $method_name, $matches))\n $templates[$matches[1]] = $this->$method_name();\n }\n return $templates;\n }",
"function get_templates()\n {\n $reallist = array();\n $list = load_class('Filesystem', 'library')->list_folders(APP_PATH . DS . 'templates');\n foreach($list as $file)\n {\n $reallist[] = $file;\n }\n return $reallist;\n }",
"public function handlebar_templates() {\n\t\t?>\n\t\t\t\n\t\t\t<script id=\"searchitem-template-generic\" type=\"text/x-handlebars-template\">\n\t\t\t\t<?php printf($this->item_template(), '{{type}}', '{{url}}', get_icon('alignleft'), '{{{title}}}', '{{type_label}}', 'Uppdaterad {{modified}}' ); ?>\n\t\t\t</script>\n\t\t\t\n\t\t\t<script id=\"searchitem-template-posts\" type=\"text/x-handlebars-template\">\n\t\t\t\t<?php printf($this->item_template(), '{{type}}', '{{url}}', get_icon('alignleft'), '{{{title}}}', '{{type_label}}', 'Uppdaterad {{modified}}' ); ?>\n\t\t\t</script>\n\n\t\t\t<script id=\"searchitem-template-attachments\" type=\"text/x-handlebars-template\">\n\t\t\t\t<?php printf($this->item_template(), '{{type}}', '{{url}}', get_icon('alignleft'), '{{{title}}}', '{{file_type}}', 'Uppdaterad {{modified}}' ); ?>\n\t\t\t</script>\n\n\t\t\t<script id=\"searchitem-template-contacts\" type=\"text/x-handlebars-template\">\n\t\t\t\t<?php printf($this->item_template(), '{{type}}', '{{url}}', '{{{thumbnail}}}', '{{{title}}}', '{{type_label}}', 'Uppdaterad {{modified}}' ); ?>\n\t\t\t</script>\n\t\t<?php\n\t}",
"public function templateOptions() {\n $controls = Frx::Controls();\n $templates = array();\n foreach ($controls as $control) {\n if (method_exists($control, 'generate') && isset($control->templateName)) {\n $templates[get_class($control)] = $control->templateName;\n }\n }\n asort($templates);\n return $templates;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if the temporary watermark directory is set by parseConfig | public function testSetGetWatermarkTmpDir()
{
$this->assertEquals(realpath('./data/tmpWatermark/') . DIRECTORY_SEPARATOR, $this->obj->getWatermarkTmpDir());
} | [
"public function isTemporaryFile(): bool\n {\n return $this->context === app(MediaService::class)->config('temp.context', '__temp__');\n }",
"public function isTmp()\n {\n if ($this->path == env('FILE_TMP_DIRECTORY')) {\n return true;\n }\n\n return false;\n }",
"public function getWatermarkTmpDir() \n {\n \treturn $this->watermarkTmpDir;\n }",
"public function temporary(): bool\n {\n return !$this->isTemporaryFile() &&\n $this->disk === app(MediaService::class)->config('temp.disk', 'public') &&\n $this->disk !== app(MediaService::class)->config('disk', 'public');\n }",
"public function isTemp()\n {\n // Only get the first 100 characters of the string,\n // as it could be a full hex representation of a file\n $string = substr($this->getPathname(), 0, 100);\n\n return (bool) preg_match(static::TEMP_WRAPPER_REGEX, $string);\n }",
"function watermark_file() {\n if ( file_exists( BASEDIR . \"/images/photo_watermark.png\" ) )\n return BASEURL . \"/images/photo_watermark.png\";\n else\n return false;\n }",
"protected function checkBitrixTempPath()\n\t{\n\t\t$io = CBXVirtualIo::GetInstance();\n\n\t\t$path = CTempFile::GetAbsoluteRoot();\n\t\t$path = $io->CombinePath($path);\n\n\t\t$documentRoot = self::getParam(\"DOCUMENT_ROOT\", $_SERVER[\"DOCUMENT_ROOT\"]);\n\t\t$documentRoot = $io->CombinePath($documentRoot);\n\n\t\tif (strpos($path, $documentRoot) === 0)\n\t\t{\n\t\t\t$this->addUnformattedDetailError(\n\t\t\t\t\t\"SECURITY_SITE_CHECKER_BITRIX_TMP_DIR\",\n\t\t\t\t\tCSecurityCriticalLevel::MIDDLE,\n\t\t\t\t\tgetMessage(\"SECURITY_SITE_CHECKER_BITRIX_TMP_DIR_ADDITIONAL\", array(\n\t\t\t\t\t\t\t\"#DIR#\" => $path\n\t\t\t\t\t))\n\t\t\t);\n\n\t\t\treturn static::STATUS_FAILED;\n\t\t}\n\n\t\treturn static::STATUS_PASSED;\n\t}",
"function tempFolder() {\n\t\t$tempLoc = $this->tempFolder;\n\t\tif (!file_exists($tempLoc)) @mkdir($tempLoc);\n\t\tif (file_exists($tempLoc) && is_writeable($tempLoc)) return true;\n\t\treturn false;\n\t}",
"private static function ensureLocalTmp() {\n if(empty(getenv(\"SOURCE_IS_LOCAL\")) && empty(getenv(\"DEST_IS_LOCAL\"))) {\n if(empty(getenv(\"LOCAL_TMP\"))) throw new ConfigException(\"LOCAL_TMP must be provided for remote to remote syncs.\");\n }\n }",
"public function assertDefaultPhpTempPathWritable() {\n\t\t$result = false;\n\t\t$path = $this->getDefaultPhpTempPath() . DIRECTORY_SEPARATOR . 'ssreqcheck-test';\n\t\t$result = @mkdir($path);\n\t\tif($result) rmdir($path);\n\t\treturn $result;\n\t}",
"function isTmpFile($file) \r\n\t{\r\n\t\t$len = strlen($this->config['tmp_prefix']);\r\n\t\tif(substr($file,0,$len)==$this->config['tmp_prefix'])\r\n\t\t\tReturn true;\r\n\t\telse\r\n\t\t\tReturn false;\t \t\r\n\t}",
"protected function assertTemporaryDirectoryNotExists(): void\n {\n static::assertFalse(file_exists(storage_path('app/_backup-temp')));\n }",
"function w3_is_preview_config() {\n return file_exists(W3TC_CONFIG_PREVIEW_PATH);\n}",
"function getTempDir()\n {\n global $conf;\n\n /* If one has been specifically set, then use that */\n if (!empty($conf['tmpdir'])) {\n $tmp = $conf['tmpdir'];\n }\n\n /* Next, try Util::getTempDir(). */\n if (empty($tmp)) {\n $tmp = Util::getTempDir();\n }\n\n /* If it is still empty, we have failed, so return false;\n * otherwise return the directory determined. */\n return empty($tmp) ? false : $tmp;\n }",
"protected function _getWatermarkFilePath()\n {\n $file = $this->_getFullMediaPath() . $this->getWatermarkFile();\n return file_exists($file) ? $file : false;\n }",
"function getTemporaryDirectory()\n\t{\n\t\t$config = Zend_Registry::get('config');\n\n\t\treturn getResourceLocation($config->temp_dir, false);\n\t}",
"public function testOptionTempDir(): void\n {\n $temp_dir_path = self::getTempDirPath();\n\n // Check directory contents. The reader should have created files in it.\n clearstatcache();\n $file_list = @scandir($temp_dir_path, SCANDIR_SORT_NONE);\n\n // 2 entries will always exist: ., ..; We expect there to be MORE entries than that, if the reader used the directory.\n self::assertGreaterThan(\n 2,\n count($file_list),\n 'The configured TempDir [' . $temp_dir_path . '] was not used by the reader.'\n );\n }",
"public function testGetTempFilenameDefaultTempDirectory(): void\n {\n $filename = File::getTempFilename();\n $this->assertTrue($filename !== '');\n if (File::exist($filename)) {\n File::delete($filename);\n }\n }",
"public function getDefaultUploadTemporaryFolder() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set PersonUUID 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 setPersonUUID(?string $personUUID = null): self
{
// validation for constraint: string
if (!is_null($personUUID) && !is_string($personUUID)) {
throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($personUUID, true), gettype($personUUID)), __LINE__);
}
// validation for constraint: choice(PersonUUID, PersonCPR)
if ('' !== ($personUUIDChoiceErrorMessage = self::validatePersonUUIDForChoiceConstraintFromSetPersonUUID($personUUID))) {
throw new InvalidArgumentException($personUUIDChoiceErrorMessage, __LINE__);
}
// validation for constraint: minLength(1)
if (!is_null($personUUID) && mb_strlen((string) $personUUID) < 1) {
throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be greater than or equal to 1', mb_strlen((string) $personUUID)), __LINE__);
}
// validation for constraint: pattern([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})
if (!is_null($personUUID) && !preg_match('/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/', $personUUID)) {
throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/', var_export($personUUID, true)), __LINE__);
}
if (is_null($personUUID) || (is_array($personUUID) && empty($personUUID))) {
unset($this->PersonUUID);
} else {
$this->PersonUUID = $personUUID;
}
return $this;
} | [
"public function setUUID($uuid);",
"public function setUUID();",
"public function setDeviceUuidAttribute($value){\n $this->attributes['device_uuid'] = hex2bin($value);\n }",
"public function setUuid(Uuid $uuid)\n {\n $this->uuid = $uuid;\n }",
"public function setIdPersonAttribute($value)\n {\n $this->attributes['id_person'] = $value;\n }",
"function setPersonID( $value )\n {\n if( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->PersonID = $value;\n }",
"public function setPerson(Person $person)\r\n {\r\n $this->person = $person;\r\n }",
"public function beforeSave() {\n $this->owner->{$this->attribute} = $this->owner->getDb()->createCommand(\"SELECT UUID()\")->queryScalar();\n }",
"function setUuid($value) {\n\t\treturn $this->setColumnValue('uuid', $value, Model::COLUMN_TYPE_VARCHAR);\n\t}",
"public function useUUID() : void\n {\n $this->useUUID = true;\n }",
"public function parseUuid(): void\n {\n $this->type = self::TYPE_STRING;\n $this->example = $this->faker->uuid;\n }",
"public function setGuid($guid) {$this->guid = $guid;}",
"public function setGuid($value) {\n\t\t\t$this->guid=$value;\n\t\t}",
"public function set_person_id($person_id)\n {\n $this->set_default_property(self::PROPERTY_PERSON_ID, $person_id);\n }",
"public function setUuidDriver(Uuid $uuid)\n {\n $this->uuid = $uuid;\n }",
"function removePerson(PersonalKey $person): void;",
"private function _setUID()\n {\n $this->uid = uniqid();\n $this->setAttribute('id', $this->uid);\n }",
"public function setRecipientUserId(?string $value): void {\n $this->getBackingStore()->set('recipientUserId', $value);\n }",
"public function testSetGuid()\n {\n $cut = new BlockchainWalletOptions();\n $value = '123123123';\n\n $cut->setGuid($value);\n\n $this->assertEquals($value, $cut->getGuid());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn debug mode on | public function turnOnDebug()
{
$this->debug = true;
} | [
"public function enableDebugMode() {}",
"public function enableDebug() {}",
"public function enableDebugFunctionality()\n {\n $this->debug = true;\n }",
"public function SetDebugMode() {\n\n\t}",
"public function enableDebug();",
"public function enableDebug() {\n $this->_debug = TRUE;\n }",
"public function turn_debug($on=true)\n {\n $this->debug = true;\t\n }",
"static function enable_debug_mode()\n {\n s::set('debug', true);\n s::on('debug', 'stitches_debug_message');\n }",
"private function inDebugMode() {\n\n }",
"public function debugMode();",
"public function setDebugMode($debug = false)\r\n\t{\r\n\t\t$this->debug = true;\r\n\t}",
"function setDebug()\n{\n $this->flag_debug = 1;\n}",
"function debug_mode($debug=true){\n\t\t$this->debug=$debug;\n\t}",
"private function setDebug()\n {\n $ambience = Conf::get(\"App.online\", false);\n\n $debug = !$ambience;\n\n if ($this->configuration->offsetExists(\"debug\"))\n $debug = $this->configuration->debug;\n\n Conf::set(\"App.debug\", $debug);\n }",
"public function setDebugMode($value){\n $this->_debug = $value;\n }",
"public function isDebugModeEnabled();",
"public function set_debug(bool $debug);",
"public function isDebugMode();",
"function toggleDebug($on=true) {\n \tif($on) {\n \t\t$this->_debug = true;\n \t} else {\n \t\t$this->_debug = false;\n \t}\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Float validator: is each value of tag of control value float number? | public static function validateFloat(TextBase $control)
{
foreach ($control->getValue() as $tag) {
if (!Strings::match($tag, '/^-?[0-9]*[.,]?[0-9]+$/')) {
return FALSE;
}
}
return TRUE;
} | [
"public static function validateFloat(TextBase $control)\r\n\t{\r\n\t\tforeach ($control->getValue() as $tag) {\r\n\t\t\tif (!Strings::match($tag, '/^-?[0-9]*[.,]?[0-9]+$/')) {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn TRUE;\r\n\t}",
"public function validFloats() {}",
"public function validateFloat($attribute, $value){ \n return preg_match('/^\\d+([\\,.]\\d{1,2})?$/', $value);\n }",
"function validate_float ( $sValue )\n{\n return is_numeric($sValue) and ($sValue == (float) $sValue);\n}",
"public static function validateFloat(IControl $control): bool\n\t{\n\t\t$value = str_replace([' ', ','], ['', '.'], $control->getValue());\n\t\tif (Validators::isNumeric($value)) {\n\t\t\t$control->setValue((float) $value);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static function validateFloat(TextBase $control)\n\t{\n\t\treturn Validators::isNumeric(static::filterFloat($control->getValue()));\n\t}",
"private function testFloat()\n {\n if (!filter_var($this->data[$this->currentKey], FILTER_VALIDATE_FLOAT)) {\n $this->failedRules[] = \"Feld {$this->currentKey} ist keine Gleitkommazahl\";\n\n return false;\n }\n\n return true;\n }",
"function o_isFloat($value) {\n\t\t\treturn Obj::singleton()->isFloat($value);\n\t\t}",
"function isFloat ($x){\n\treturn preg_match('~^[\\-]?[0-9\\,]+\\.[0-9]+$~',$x);\n}",
"public function validate(){\n\t\treturn preg_match('/^[+-]?[0-9]*\\.[0-9]{' . $this->options['precision'] . '}$/', $this->value);\n\t}",
"public function allowFloats() {\n return $this->allowFloat;\n }",
"public function testFloat() {\n $this->assertEquals(100.25, Sanitize::float('1array(0)0.25'));\n $this->assertEquals(-125.55, Sanitize::float('-abc125.55'));\n $this->assertEquals(1203.11, Sanitize::float('+1203.11'));\n }",
"public function testThatParseTypeCorrectlyTranslatesFloat()\n {\n $value = (float)(mt_rand() / mt_getrandmax());\n\n $fieldParser = new FieldParser();\n\n $actual = $fieldParser->parseType($value);\n\n $this->assertTrue(is_float($actual));\n $this->assertEquals($value, $actual);\n }",
"public function testVal_returnsFloat_ifVarIsAStringFloat()\n\t {\n\t\t return $this->assertEquals(Num::val('1.0'), 1.0);\n\t }",
"protected function validate_float_value( $value ) {\n\n\t\treturn is_int( $value ) || is_float( $value );\n\t}",
"function test_float($val)\r\n{\r\n if(is_float(floatval($val)))\r\n {\r\n return $val;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}",
"public function validateFloat($value)\n {\n if ($this->objManager->validateBlank($value)) {\n return ! $this->objManager->getRequire();\n }\n\n if (is_float($value)) {\n return true;\n }\n\n // otherwise, must be numeric, and must be same as when cast to float \n return is_numeric($value) && $value == (float) $value;\n }",
"static function isFloat( $val ) {\n\t\treturn is_numeric( $val ) && !preg_match( '/[^\\d.+\\-e]/', $val );\n\t}",
"protected function validateAddErrorNoFloat () {\n\t\t$min = $this->min === NULL \n\t\t\t? (defined('PHP_FLOAT_MIN') ? PHP_FLOAT_MIN : floatval('-1.79e308'))\n\t\t\t: (string) $this->min;\n\t\t$max = $this->max === NULL \n\t\t\t? (defined('PHP_FLOAT_MAX') ? PHP_FLOAT_MAX : floatval('1.79e308'))\n\t\t\t: (string) $this->max;\n\t\t$this->field->AddValidationError(\n\t\t\tstatic::GetErrorMessage(self::ERROR_FLOAT, [$min, $max])\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether a user has downvoted this | public function userDownvoted($user = false)
{
if(!$user) $user = App::getLoggedInUser();
if(!$user) return false;
$vote = TopicVoteModel::getTopicVoteByUser($this, $user);
return (bool)$vote && !$vote->isUpvote();
} | [
"public function isDownvotedBy(User $user) {\n return (bool) $this->upvotes()->where(['user_id' => $user->id, 'upvoted' => false])->count();\n }",
"function snax_has_user_downvotes( $user_id = 0 ) {\n\t$has_downvotes = snax_has_user_votes( snax_get_downvote_value(), $user_id );\n\n\treturn apply_filters( 'snax_has_user_downvotes', $has_downvotes, $user_id );\n}",
"function hasDownvoted($story, $user) {\r\n $db = Database::getInstance()->getDB();\r\n\r\n try {\r\n\t $stmt = $db->prepare('SELECT *\r\n FROM STORYDOWNVOTE\r\n WHERE storyId = ? AND userId = ?\r\n ');\r\n $stmt->execute(array($story, $user));\r\n $downvote = $stmt->fetch();\r\n\r\n if($downvote !== false)\r\n return true;\r\n else\r\n return false;\r\n }catch(PDOException $e) {\r\n return false;\r\n }\r\n }",
"public function isDownvotedBy($user)\n {\n return Interaction::isRelationExists($this, 'downvoters', $user);\n }",
"public function isDownvotedBy($user)\n {\n return Follow::isRelationExists($this, 'downvoters', $user);\n }",
"public function estaDownvoteado()\n {\n return $this->getVotos()->where(['usuario_id' => Yii::$app->user->id, 'positivo' => false])->one() !== null;\n }",
"protected function get_is_upvoted() {\n global $dbh, $CURRENT_USER;\n \n if (!$CURRENT_USER) {\n return false;\n }\n \n $query = \"\n SELECT 1 FROM `upvotes`\n WHERE `post_id` = :post_id\n AND `user_id` = :user_id\";\n $sth = $dbh->prepare($query);\n $sth->bindValue('post_id', $this->id);\n $sth->bindValue('user_id', $CURRENT_USER->id);\n $sth->execute();\n return (bool)$sth->fetchColumn();\n }",
"function has_voted($user){\n\t\treturn in_array($user, get_voted_users()); \n\t}",
"private function downVotedBefore($item_name) {\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t$query = \"SELECT * FROM {$this->votes_table} WHERE `ip` = '$ip' AND `item_name` = '$item_name' AND `vote_value` = -1\";\n\t\t$result = mysql_query($query);\n\t\tif(mysql_num_rows($result)>0){ // already voted\n\t\t\treturn true;\n\t\t} elseif(mysql_num_rows($result)==0){ // haven't voted\n\t\t\treturn false;\n\t\t}\n\t}",
"public function member_can_vote_down()\n {\n $this->signIn();\n\n $model = create($this->getModel());\n\n $this->post($this->getVoteDownRoute($model))\n ->assertStatus(201);\n\n $this->assertCount(1, $this->downVotes($model));\n }",
"public function test_message_can_be_downvoted() {\n\n $user = User::create('bar@email.com', 'secret', 'Jane Doe');\n $this->message->downvote($user);\n $this->assertEquals(1, $this->message->getDownvotes());\n\n }",
"function hasVoted() {\n\t\treturn $this->voteHandler->hasVoted();\n\t}",
"function hasUserAlreadyVoted() {\n\t\t$dbr = wfGetDB( DB_REPLICA );\n\t\t$s = $dbr->selectRow(\n\t\t\t'Vote',\n\t\t\t[ 'vote_value' ],\n\t\t\t[\n\t\t\t\t'vote_page_id' => $this->PageID,\n\t\t\t\t'vote_actor' => $this->User->getActorId()\n\t\t\t],\n\t\t\t__METHOD__\n\t\t);\n\t\tif ( $s === false ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn $s->vote_value;\n\t\t}\n\t}",
"public function getDownvotes()\n {\n return $this->downvotes;\n }",
"public function hasNegativeVote()\n {\n if ($this->vote != 'n') {\n return false;\n }\n\n return true;\n }",
"public function testVoteDown()\n {\n\n // get list of entries\n $entries = $this->getEntries( array( 'excludeVotes' => 'true' ) );\n\n $entryToVote = $entries[0]->entry;\n\n // vote down entry\n $this->voteEntry( $entryToVote->id, 'down' );\n\n // check that downvoted entry disappear from feed\n // renew list of entries\n $entries = $this->getEntries( array( 'excludeVotes' => 'true' ) );\n\n // get list of entries ids\n $entryIds = $this->getEntryIds( $entries );\n\n // check that downvoted entry is not in the list\n $this->assertFalse( in_array( $entryToVote->id, $entryIds ) );\n\n // check that voted down entry is not shown in TALENT CONNECT/MY VOTES ( GET /vote?user=<votedup user> )\n // get voted up entries of the user\n $upvotedEntries = $this->getUserUpVotedEntries();\n\n $this->assertFalse( in_array( $entryToVote->id, $this->getEntryIds( $upvotedEntries ) ) );\n }",
"function Downvote(){\n\t\t$reel = Reel::FindById($_POST['reel_id']);\n\t\t$reel->Downvote();\t\t\n\t}",
"public function estaUpvoteado()\n {\n return $this->getVotos()->where(['usuario_id' => Yii::$app->user->id, 'positivo' => true])->one() !== null;\n }",
"public function hasVoted() {\n\t\treturn (bool) Cookie::get(self::COOKIE_PREFIX . $this->getPoll()->ID);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function SearchVarsAsHiddens, Parameter list: Creates hiddens according to search vars defined. | function SearchVarsAsHiddens()
{
$hiddens=array();
foreach ($this->MyMod_Items_Search_Vars() as $data)
{
if ($this->MyMod_Data_Access($data)>=1)
{
$rdata=$this->GetSearchVarCGIName($data);
$value=$this->GetSearchVarCGIValue($data);
if ($value!="" && !is_array($value) && !preg_match('/^0$/',$value))
{
array_push($hiddens,$this->MakeHidden($rdata,$value));
}
}
}
array_push
(
$hiddens,
$this->MakeHidden
(
$this->CGI2IncludeAllKey(),
$this->CGI2IncludeAll()
)
);
return $hiddens;
} | [
"function MyMod_Search_Vars_Where($searchvars=array())\n {\n $values=$this->MyMod_Search_Vars_Pre_Where();\n if (count($searchvars)==0)\n {\n $searchvars=array_keys($values);\n }\n\n $wheres=array();\n foreach ($searchvars as $id => $data)\n {\n $where=$this->MyMod_Search_Var_Where($data,$values[ $data ]);\n if (!empty($where))\n {\n $where=preg_replace('/^'.$data.'=?\\s+/',\"\",$where);\n }\n \n $rdata=$this->MyMod_Search_Var_Data($data);\n\n $wheres[ $rdata ]=$where;\n }\n\n \n\n return $wheres;\n }",
"function SearchVarsAsURL()\n {\n $hiddens=array();\n foreach ($this->MyMod_Items_Search_Vars() as $data)\n {\n if ($this->MyMod_Data_Access($data)>=1)\n {\n $rdata=$this->GetSearchVarCGIName($data);\n $value=$this->GetSearchVarCGIValue($data);\n\n if ($value!=\"\" && (!preg_match('/^0$/',$value)))\n {\n array_push($hiddens,$rdata.\"=\".$value);\n }\n }\n }\n\n return join(\"&\",$hiddens);\n }",
"function sf_build_search_vars($stuff)\n{\n\tglobal $sfvars;\n\n\tif(isset($_GET['forum']))\n\t{\n\t\t# means searching all\n\t\t$sfvars['forumslug'] = sf_syscheckstr($_GET['forum']);\n\t} else {\n\t\t# searching single forum\n\t\tif(!empty($stuff[1]))\n\t\t{\n\t\t\t$sfvars['forumslug'] = $stuff[1];\n\t\t}\n\n\t\t# (2) topic\n\t\tif(!empty($stuff[2]))\n\t\t{\n\t\t\t$parts = explode(\"&\", $stuff[2]);\n\t\t\t$sfvars['topicslug'] = $parts[0];\n\t\t}\n\t}\n\treturn;\n}",
"function culturefeed_saved_searches_preprocess_culturefeed_saved_searches_list(&$vars) {\n\n $searches = $vars['searches'];\n $items = array();\n\n $vars['total_searches'] = count($searches);\n\n foreach ($searches as $search) {\n $item = array(\n 'title' => check_plain($search->name),\n 'search_url' => url('agenda/search', array('query' => culturefeed_search_get_search_url_query($search->query))),\n );\n $items[] = $item;\n }\n\n $vars['items'] = $items;\n\n}",
"function job_search_register_query_vars( $vars ) {\n $vars[] = 'role-type';\n $vars[] = 'salary-min';\n $vars[] = 'working-pattern';\n $vars[] = 'location';\n $vars[] = 'radius';\n $vars[] = 'locations-relevant';\n\n\n return $vars;\n}",
"function MyMod_Search_Vars_Add_2_List($datas)\n {\n if (count($this->MyMod_Search_Res_Vars)>0)\n { \n return array_merge($datas,$this->MyMod_Search_Res_Vars);\n }\n\n $searchvars=$this->MyMod_Search_Vars_Hash();\n\n $ressearchvars=array();\n foreach ($searchvars as $data => $value)\n {\n if (!preg_grep('/^'.$data.'$/',$datas))\n {\n if (empty($this->ItemData[ $data ][ \"SqlMethod\" ]))\n {\n array_push($datas,$data);\n array_push($ressearchvars,$data);\n }\n }\n }\n\n $this->MyMod_Search_Res_Vars=$ressearchvars;\n\n return $datas;\n }",
"function MyMod_Search_Vars_Pre_Where()\n {\n $searchvars=array();\n foreach ($this->MyMod_Search_Vars() as $data)\n {\n $wheres=array();\n if ($this->MyMod_Data_Access($data)>=1)\n {\n $rdata=$this->MyMod_Search_CGI_Name($data);\n $value=$this->MyMod_Search_CGI_Value($data);\n\n if (!empty($value))\n {\n $where=$this->MyMod_Search_Var_Where($data,$value);\n if (!empty($where))\n {\n array_push($wheres,$where);\n }\n\n $searchjoined=$this->ItemData($data,\"Search_Joined\");\n\n if (is_array($searchjoined))\n {\n foreach ($searchjoined as $rdata)\n {\n if (!empty($this->ItemData[ $rdata ]))\n {\n array_push\n (\n $wheres,\n $this->MyMod_Search_Var_Where($data,$value,$rdata)\n );\n }\n }\n }\n\n $searchvars[ $data ]=\"(\".join(\" OR \",$wheres).\")\";\n }\n }\n \n }\n\n return $searchvars;\n }",
"function gavern_opensearch_query_vars($vars) {\n\t$vars[] = 'opensearch_description';\n\treturn $vars;\n}",
"function MyMod_Search_Vars($datas=array())\n {\n if (empty($this->ModuleName)) { return $this->SearchVars; }\n if (empty($this->SearchVars))\n {\n $this->SearchVars=array();\n\n if (empty($datas)) { $datas=array_keys($this->ItemData()); }\n\n foreach ($datas as $data)\n {\n if ($this->MyMod_Data_Field_Is_Search($data))\n {\n if ($this-> MyMod_Search_Var_Access($data))\n {\n array_push($this->SearchVars,$data);\n }\n }\n }\n }\n\n return $this->SearchVars;\n }",
"public function getSearchVars() {\n\t\t\t$search = parent::getSearchVars();\n\t\t\t$search['tags'] = array();\n\t\t\t$search['tags']['value'] = getRequest('tags');\n\t\t\t$search['content'] = array();\n\t\t\t$search['content']['value'] = getRequest('content');\n\t\t\treturn $search;\n\t\t}",
"public function get_searchwords()\n {\n $SWORD_PARAMS = '';\n if (is_array($this->sword_array)) {\n foreach ($this->sword_array as $key => $val) {\n $SWORD_PARAMS .= '&sword_list[]=' . rawurlencode($val['sword']);\n }\n }\n return $SWORD_PARAMS;\n }",
"function query_vars($vars) {\n $vars[] = 'hcard_url';\n\n return $vars;\n }",
"function hum_query_vars( $vars ) {\n $vars[] = 'hum';\n return $vars;\n}",
"public function register_query_vars( $vars )\n {\n $vars[] = 'envato-id';\n $vars[] = 'envato-term';\n $vars[] = 'envato-site';\n $vars[] = 'envato-page';\n\n $vars[] = 'livetime-suite-hash';\n\n return $vars;\n }",
"function swiftype_search_params_filter( $params ) {\r\n $params['facets[posts]'] = array( 'category', 'emc_content_format', 'emc_grade_level', 'emc_tax_found', 'emc_tax_common_core' );\r\n return $params;\r\n}",
"function query_vars($vars) {\n $vars[] = 'hcard_mapper_url';\n\n return $vars;\n }",
"function search_split_query($q) {\n if (!isset($q)) {\n return;\n }\n $w = array();\n $stripped = pnVarPrepForStore($q);\n $qwords = preg_split('/ /', $stripped, -1, PREG_SPLIT_NO_EMPTY);\n foreach($qwords as $word) {\n $w[] = '%' . $word . '%';\n }\n return $w;\n}",
"private function searchWildcards() {\n \t// Figure out all the variables used in the condition\n \t// Check if any of them contains WILDCARDx in their names where x is an integer\n \t// Add such variable names with wildcard names to $this->wildcards array\n \tpreg_match_all('/(\\$[_\\d\\w]*WILDCARD\\d+[_\\d\\w]*)/', $this->condition, $matches);\n \t\n \t$this->wildcards = array_unique($matches[0]);\n }",
"public function creer_definition_hostids_sans_champ_hostid_ws() {\n\t\t$this ->onDebug ( __METHOD__, 1 );\n\t\t$liste_id = array ();\n\t\tforeach ( $this ->getListeHost () as $host ) {\n\t\t\t$liste_id [count ( $liste_id )] = $host ->getHostId ();\n\t\t}\n\t\t\n\t\treturn $liste_id;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the survey response is in final state (screenout, complete, etc.) but on the wrong URL this method redirects client to the proper location and stops further event propagation | public function handleFinishedResponse(RequestEvent $event)
{
if (!$this->responseHandler->hasResponse()) {
return;
}
$this->logger->debug(__FUNCTION__);
$redirect = $this->responseSession->isFinishedButLost($this->surveyHandler->getSurvey(), $event->getRequest());
if ($redirect) {
$event->setResponse($redirect);
}
} | [
"public function handle_redirects() {\n global $CFG, $SESSION;\n require_once(__DIR__.'/../../signuplib.php');\n\n if(isset($SESSION->cancel) and $SESSION->cancel == 1) {\n $SESSION->cancel = 0;\n redirect($CFG->wwwroot);\n } elseif($this->page_number != convert_progressstring_to_progressnum($this->applicantprogress)) {\n force_signup_flow($this->page_number);\n }\n return true;\n }",
"protected function RedirectOnError() {\n\t\tif($this->ajax) {\n\t\t\techo AjaxRequest::$app_act_sep.'window.location.href = \"'.$this->app_web_link.'\";';\n\t\t} else {\n\t\t\theader('Location:'.$this->app_web_link);\n\t\t}//if($this->ajax)\n\t\texit();\n\t}",
"private function checkUrl() {\n if ($this->route !== strtolower($this->route)) {\n http_response_code(301);\n header('location: ' . strtolower($this->route));\n }\n }",
"public function checkForRedirect() {\n $url = $this->formit->postHooks->getRedirectUrl();\n if (!empty($url) && !$this->formit->inTestMode) {\n $this->modx->sendRedirect($url);\n }\n }",
"public function checkRedirectUrl(FilterResponseEvent $event) {\n $response = $event->getResponse();\n if ($response instanceof RedirectResponse) {\n $request = $event->getRequest();\n\n // Let the 'destination' query parameter override the redirect target.\n // If $response is already a SecuredRedirectResponse, it might reject the\n // new target as invalid, in which case proceed with the old target.\n $destination = $request->query->get('destination');\n if ($destination) {\n // The 'Location' HTTP header must always be absolute.\n $destination = $this->getDestinationAsAbsoluteUrl($destination, $request->getSchemeAndHttpHost());\n try {\n $response->setTargetUrl($destination);\n }\n catch (\\InvalidArgumentException $e) {\n }\n }\n\n // Regardless of whether the target is the original one or the overridden\n // destination, ensure that all redirects are safe.\n if (!($response instanceof SecuredRedirectResponse)) {\n try {\n $host = parse_url($response->getTargetUrl(), PHP_URL_HOST);\n if (strpos($this->config->get('frontend_base_url'), $host) !== FALSE) {\n $safe_response = TrustedRedirectResponse::createFromRedirectResponse($response);\n $safe_response->setRequestContext($this->requestContext);\n }\n else {\n // SecuredRedirectResponse is an abstract class that requires a\n // concrete implementation. Default to LocalRedirectResponse, which\n // considers only redirects to within the same site as safe.\n $safe_response = LocalRedirectResponse::createFromRedirectResponse($response);\n $safe_response->setRequestContext($this->requestContext);\n }\n }\n catch (\\InvalidArgumentException $e) {\n // If the above failed, it's because the redirect target wasn't\n // local. Do not follow that redirect. Display an error message\n // instead. We're already catching one exception, so trigger_error()\n // rather than throw another one.\n // We don't throw an exception, because this is a client error rather than a\n // server error.\n $message = 'Redirects to external URLs are not allowed by default, use \\Drupal\\Core\\Routing\\TrustedRedirectResponse for it.';\n trigger_error($message, E_USER_ERROR);\n $safe_response = new Response($message, 400);\n }\n $event->setResponse($safe_response);\n }\n }\n }",
"public function onRequestSent(Event $event)\n {\n $response = $event['response']; /* @var $response Response */\n $request = $event['request']; /* @var $request RequestInterface */\n\n // Only act on redirect requests with Location headers\n if (!$response || $request->getParams()->get(RedirectPlugin::DISABLE)) {\n return;\n }\n\n // Our API returns a location redirect but not a 3xx status code, which guzzle won't process\n // Also don't include the body on the redirect\n if (!$response->isRedirect() && $response->hasHeader('Location')) {\n $response->setStatus(302);\n }\n }",
"public function redirectVerification() {\n Mage::app()->getResponse()->setRedirect( 'accountverification' );\n }",
"public function addCheckToUrl(ResponseEvent $event) {\n $response = $event->getResponse();\n if ($response instanceof RedirectResponse && $event->getRequest()->hasSession()) {\n if ($event->getRequest()->getSession()->has('check_logged_in')) {\n $event->getRequest()->getSession()->remove('check_logged_in');\n $url = $response->getTargetUrl();\n $options = UrlHelper::parse($url);\n $options['query']['check_logged_in'] = '1';\n $url = $options['path'] . '?' . UrlHelper::buildQuery($options['query']);\n if (!empty($options['#fragment'])) {\n $url .= '#' . $options['#fragment'];\n }\n // In the case of trusted redirect, we have to update the list of\n // trusted URLs because here we've just modified its target URL\n // which is in the list.\n if ($response instanceof TrustedRedirectResponse) {\n $response->setTrustedTargetUrl($url);\n }\n $response->setTargetUrl($url);\n }\n }\n }",
"public function mustRedirect();",
"private function _redirect_if_required(){\n if($this->subj->current_phase !== 'payoff'){\n $this->_redirect($this->subj);\n }\n\n return true;\n }",
"public function startRedirectHalting() {\n\t\tadd_filter( 'wp_redirect', array( $this, 'haltRedirect' ), 1, 2 );\n\t}",
"public function confirmLandlordsConsentAction()\n {\n $request = $this->getRequest();\n\n if ($this->getRequest()->isPost())\n {\n // Redirect request\n if ($request->getParam('formsubmit') == 'Continue')\n {\n // Go forward\n $this->_redirect\n (\n $this->getRequest()->getControllerName() .\n '/renew-policy?policynumber=' . $request->getParam('policynumber')\n );\n\n return;\n }\n else if ($request->getParam('formsubmit') == 'Back')\n {\n // Go back\n $this->_redirect\n (\n $this->getRequest()->getControllerName() .\n '/renewals'\n );\n\n return;\n }\n }\n }",
"function redirect_decidir_requests(){\n global $wp_query;\n if(!isset($wp_query->query_vars[$this->decidir_endpoint]))\n return;\n\n $this->process_decidir_request();\n }",
"public function redirectToPageNotFound()\n {\n $norouteUrl = $this->_url->getUrl('noroute');\n $response = $this->_actionContext->getResponse();\n $response->setRedirect($norouteUrl);\n }",
"protected function _referer_fail()\n\t{\n\t\treturn;\n\n\t\t//\n\t\t// Derived adapters may override this to alter post-referer-failure\n\t\t// behavior of the crawler.\n\t\t//\n\t}",
"public function redirectsAreNotFollowedIfSwitchedOff()\n {\n $this->browser->setFollowRedirects(false);\n $response = $this->browser->request('http://localhost/test/http/redirecting');\n self::assertStringNotContainsString('arrived.', $response->getBody()->getContents());\n self::assertEquals(303, $response->getStatusCode());\n self::assertEquals('http://localhost/test/http/redirecting/tohere', $response->getHeaderLine('Location'));\n }",
"function send_to_cancel_url() {\n\t\tif ( $url = $this->get_cancel_url() ) {\n\t\t\twp_redirect( $url );\n\t\t\tappthemes_exit( 'send_to_cancel_url' );\n\t\t}\n\t\treturn false;\n\t}",
"protected function checkRedirect() {\n if (is_string($this->getConfig()['forceRedirectUrl'])) {\n $this->getSite()->setRedirectUrl($this->getConfig()['forceRedirectUrl']);\n $this->getSite()->redirect();\n }\n }",
"public function testRedirectsToFailsIfResponseRedirectsToUnexpectedUrl()\n {\n $this->assertFailure();\n $this->response->setRedirect('/test/url');\r\n $this->assertions->redirectsTo('/another/url');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes an HTML attribute. | public function removeAttribute($name)
{
if (isset($this->htmlAttributes[$name])) {
unset($this->htmlAttributes[$name]);
}
} | [
"function removeAttribute($attribute);",
"function remove_attribute($attrib) \r\n\t{\r\n \tunset($this->attributes[strtolower($attrib)]);\r\n\t}",
"public function removeAttribute(string $attribute);",
"function remove_attribute($name)\n\t{\n\t\tunset($this->attributes[$name]);\n\t}",
"public function removeAttribute($attribute);",
"public function removeAttributes(){\r\n\t\twhile($this->domNode->hasAttributes()) $this->domNode->removeAttributeNode($this->domNode->attributes->item(0));\r\n }",
"final public function removeAttribute($attr){\nif(!self::isAttributeSpecial($attr)){\n$this->validateAttributeValue($attr,$value=null);\n}\nunset($this->attributes[$attr]);\nreturn $this;\n}",
"public function removeMetadataAttr($attr)\n {\n phpQuery::pq('meta[content=\"sitecake\"]', $this->evaluated)->removeAttr('data-' . $attr);\n }",
"function removeAttribute($attrdef) { /* {{{ */\n\t\t$db = $this->_repo->getDB();\n\t\tif (!$this->_attributes) {\n\t\t\t$this->getAttributes();\n\t\t}\n\t\tif(isset($this->_attributes[$attrdef->getId()])) {\n\t\t\tswitch(get_class($this)) {\n\t\t\t\tcase $this->_repo->getClassname('document'):\n\t\t\t\t\t$queryStr = \"DELETE FROM `tblDocumentAttributes` WHERE `document`=\".$this->_id.\" AND `attrdef`=\".$attrdef->getId();\n\t\t\t\t\tbreak;\n\t\t\t\tcase $this->_repo->getClassname('documentcontent'):\n\t\t\t\t\t$queryStr = \"DELETE FROM `tblDocumentContentAttributes` WHERE `content`=\".$this->_id.\" AND `attrdef`=\".$attrdef->getId();\n\t\t\t\t\tbreak;\n\t\t\t\tcase $this->_repo->getClassname('folder'):\n\t\t\t\t\t$queryStr = \"DELETE FROM `tblFolderAttributes` WHERE `folder`=\".$this->_id.\" AND `attrdef`=\".$attrdef->getId();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$res = $db->getResult($queryStr);\n\t\t\tif (!$res)\n\t\t\t\treturn false;\n\n\t\t\tunset($this->_attributes[$attrdef->getId()]);\n\t\t}\n\t\treturn true;\n\t}",
"public function removeAttr($attribute)\n {\n array_map([$this, 'attr'], func_get_args(), array_fill(0, func_num_args(), null));\n }",
"public function __unset($attribute)\n {\n $this->unset($attribute);\n }",
"public function delAttribute()\n {\n list($response) = $this->delAttributeWithHttpInfo();\n return $response;\n }",
"public function removeHashable($attribute);",
"public function unsetAttribute($index)\n {\n unset($this->attribute[$index]);\n }",
"public function removeData($attribute)\n {\n if (isset($this->attributes['data-' . $attribute])) {\n unset($this->attributes['data-' . $attribute]);\n }\n }",
"public function removeAttributes()\n\t{\n\t\tforeach ($this->argsArray(func_get_args()) as $a) {\n\t\t\t$this->removed_attrs[] = $a;\n\t\t}\n\t}",
"public function removeItemAttr($name)\n {\n unset($this->itemAttr[$name]);\n }",
"public function removeAttributes() {\n $this->attributes = [];\n }",
"function attr_remove($key=NULL,$pos=NULL){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
controlSwitch is the core function of the system. Its behavior is established by the controller passed by the HTML's get method. Returns False if body has not been calcolated | public function controlSwitch() {
$VHome=Usingleton::getInstance('VHome');
$action=$VHome->get('control');
switch ($action) {
case 'VisitBooking':
$CVisitBooking= USingleton::getInstance('CVisitBooking');
return $CVisitBooking->getContent();
case 'login':
$CLogin=USingleton::getInstance('CLogin');
$result=$CLogin->manageLogin();
if ( $result==false ){
$message="Username o password errati";
$body=$VHome->getErrorMessage($message);
return array("body" => $body);
}
else {
return FALSE; // vedere bene.. secondo me ritorna html di home
}
case 'logout':
$CLogin=USingleton::getInstance('CLogin');
$CLogin->logout();
return FALSE; //come sopra
case 'manageDB':
return array("body" => $this->checkUser());
case 'Services':
return $VHome->getServicesContent();
case 'Registration':
$CRegistration= USingleton::getInstance('CRegistration');
return array("body" => $CRegistration->newUser());
case 'Contacts':
return $VHome->getContactsContent();
case 'ajaxCall':
USingleton::getInstance('CAjaxSwitcher');
break;
default:
return $VHome->getHomeContent();
}
} | [
"static public function load_Control()\r\n\t\t{\r\n\t\t\t//\r\n\t\t\t// This file already exists, it was checked by the RequestHandler\r\n\t\t\t//\r\n\t\t\trequire_once(self::$control_file);\r\n\r\n\t\t\t//\r\n\t\t\t// The reason we check is because, for static files, it's logical\r\n\t\t\t// to just have a blank control file. If it's blank, then there\r\n\t\t\t// won't be a Control class, else there will be.\r\n\t\t\t//\r\n\t\t\tif(self::$use_control = class_exists('Control', false))\r\n\t\t\t{\r\n\t\t\t\t// If $silence is set to true inside the Control, then we\r\n\t\t\t\t// don't need to display a page. This skips the rendering\r\n\t\t\t\t// process (as it would be overhead).\r\n\t\t\t\tif(isset(Control::$silence) && Control::$silence === true)\r\n\t\t\t\t{\r\n\t\t\t\t\tself::$blockFutureRequests = true;\r\n\r\n\t\t\t\t\tif(NGen::$configs['use_onload'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tself::OnLoad();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$control = new Control();\r\n\t\t\t\t\t\tif(method_exists($control, 'execute'))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$control->execute();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}catch(Exception $ex){ self::getInstance2()->display_error($ex); die(); }\r\n\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}",
"function twc_view_switch()\n{\n\t//initializing variables\n\t$current_screen = twc_get_current_screen();\n\t\n\t//reasons to fail\n\tif ((!$GLOBALS['TWCAUTH']) && (twc_list_style_twc() \n\t|| $current_screen->parent_base != 'widgets')) return false;\n\t\n\techo '<div>'.twc_get_show_view('twc-view-switch').'</div>';\n\t\n}",
"public function switchOn();",
"public function is_control() {\n return $this->experiment()->control()->name === $this->name;\n }",
"public function SwitchState()\n {\n // Check Brightness\n if ($this->ReadPropertyInteger(\"BrightnessVariable\") <> 0) {\n $bv = GetValue($this->ReadPropertyInteger(\"BrightnessVariable\"));\n $tv = $this->ReadPropertyInteger(\"ThresholdValue\");\n if ($tv != 0 && $bv > $tv) {\n $this->SendDebug('SwitchState', 'Oberhalb Schwellwert: ' . $bv . '(Schwellwert: ' . $tv . ')', 0);\n return; // nix zu tun\n }\n $this->SendDebug('SwitchState', 'Immer oder unterhalb Schwellwert:' . $bv . '(Schwellwert: ' . $tv . ')', 0);\n }\n // Variable schalten \n if ($this->ReadPropertyInteger(\"SwitchVariable\") <> 0) {\n $sv = $this->ReadPropertyInteger(\"SwitchVariable\");\n if($this->ReadPropertyBoolean(\"OnlyBool\") == true) {\n SetValueBoolean($sv, true);\n }\n else {\n $pid = IPS_GetParent($sv); \n HM_WriteValueBoolean($pid, \"STATE\", true); //Gerät einschalten\n }\n $this->SendDebug('SwitchState', \"Variable (#\" . $sv . \") auf true geschalten!\" , 0);\n }\n // Script ausführen\n if ($this->ReadPropertyInteger(\"ScriptVariable\") <> 0) {\n if (IPS_ScriptExists($this->ReadPropertyInteger(\"ScriptVariable\"))) {\n $sr = IPS_RunScript($this->ReadPropertyInteger(\"ScriptVariable\"));\n $this->SendDebug('SwitchState', 'Script Return Value: '. $rs, 0);\n }\n }\n }",
"public function canControl(): bool;",
"public function switchView()\n {\n if ( !$this->ownerLoggedIn() )\n {\n $this->redirect(\"index.php\");\n\n }\n \n require_once('views/SwitchView.class.php'); \n \n $site = new SiteContainer($this->db);\n \n $sv = new SwitchView();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $sv->printHtml($this->businesses);\n $site->printFooter(); \n \n \n }",
"protected function handleHttpRequest() \n {\n $pagevar = $this->getPage();\n $page = $this->pageController($this->helper->specChars($pagevar));\n if ($page)\n {\n $page->show();\n }\n else\n {\n echo \"Gnomes have stolen the webpage, we apologize for their natural behaviour\";\n }\n }",
"public static function handleOnOff(){\n\t\t//\n\t}",
"protected function isControlStructure()\n\t{\n\t\treturn $this->stream->isAny([T_ELSE, T_ELSEIF, T_FOR, T_FOREACH, T_IF, T_WHILE]);\n\t}",
"private function isInvokedControllerMain()\n {\n $get = $_GET;\n $url = isset($get['url']) ? $get['url'] : null;\n if (!empty($url)) {\n $currentSubsystem = Loader::getCurrentSubSystem($url);\n if (!empty($currentSubsystem))\n $url = str_replace($currentSubsystem . \"/\", \"\", $url);\n $this->subSystem = $currentSubsystem;\n }\n if (empty($url)) {\n return true;\n } else {\n $urlSegments = explode(\"/\", $url);\n if (isset($urlSegments[1])) {\n return false;\n } else {\n return true;\n }\n }\n }",
"private function checkCtrl(){\n $requestURL = substr($this->request, 0, -38); //az utolso 38 karakter a CTRL paraméter\n $hashInput = strlen($requestURL).$requestURL;\n\t\n if ($_GET['ctrl'] == $this->hmac($this->secretKey, $hashInput)) {\n return true;\n } else {\n return false;\n }\n }",
"public function switchAction(): void\n {\n if (isset($_POST['ajax'])) {\n $_SESSION['ajax_switch_off'] = '1';\n }\n }",
"public function switchBwc()\n {\n $this->spin(function (FeatureContext $context) {\n $context->getSession()->getDriver()->switchToIFrame('bwc-frame');\n return boolval($context->getSession()->getPage()->findById('main'));\n }, 20);\n }",
"public static function hasController()\n {\n return false;\n }",
"public function hasController();",
"public static function handleRequestForSlaveServerControl()\n {\n if (empty($_REQUEST['sr_slave_control_parm'])) {\n $_REQUEST['sr_slave_control_parm'] = null;\n }\n if ($_REQUEST['sr_slave_action'] == 'reset') {\n $qStop = Replication::slaveControl(\"STOP\");\n $qReset = $GLOBALS['dbi']->tryQuery(\"RESET SLAVE;\");\n $qStart = Replication::slaveControl(\"START\");\n\n $result = ($qStop !== false && $qStop !== -1 &&\n $qReset !== false && $qReset !== -1 &&\n $qStart !== false && $qStart !== -1);\n } else {\n $qControl = Replication::slaveControl(\n $_REQUEST['sr_slave_action'],\n $_REQUEST['sr_slave_control_parm']\n );\n\n $result = ($qControl !== false && $qControl !== -1);\n }\n\n return $result;\n }",
"public function buildPage() {\n $content=$this->controlSwitch();\n $VHome=USingleton::getInstance('VHome');\n //!content= need to show homepage\n if(!$content){$content=$VHome->getHomeContent();}\n \n $this->setPage($content);\n //$this->addLoginBox();\n //$VHome->assign('loginBox',NULL); //lato client\n }",
"private static function checkController(): void\n {\n Debug::setBacklog();\n\n /**\n * First, it defines the route controller name. If there is a specific controller set with\n * the 'controller' parent parameter in the route configuration, then it is set.\n *\n * However, if there is no specific controller defined, it sets the controller name based on\n * a base namespace (it can be the default namespace app/controller or a namespace defined\n * with the 'namespace' route parameter) and the namespace that follows the URL until the\n * parent node. The parent node is the controller class itself, and all the url nodes before\n * forms the namespace.\n */\n $controllerNamespace = Route::getControllerNamespace();\n\n if ($nodeController = Parameters::getController()) {\n $routeControllerName = $nodeController;\n } else {\n $baseNodeNamespace = Parameters::getNamespace() ?: self::DEFAULT_NODE_NAMESPACE;\n $routeControllerName = $baseNodeNamespace . implode($controllerNamespace);\n }\n\n /**\n * Checks if there is an output set in the route configuration. If there is, checks if the\n * defined output requires a controller to work.\n */\n if (Parameters::getOutput() !== null) {\n self::$controllerIsRequired = self::{Parameters::getOutput().'RequiresController'}();\n }\n\n /**\n * Next, it checks if the class exists.\n *\n * if the class exists, then its name is set in the $routeControllerName property and the\n * next method called is the checkControllerExtendsCore.\n */\n if (class_exists($routeControllerName)) {\n self::$routeControllerName = $routeControllerName;\n\n PerformanceAnalysis::flush(PERFORMANCE_ANALYSIS_LABEL);\n\n self::checkControllerExtendsCore();\n\n } else {\n /**\n * However, when the route controller doesn't exists, if the given output do not\n * requires a controller to work, it will jump to the checkOutputIsSet method and no\n * error will occur.\n */\n if (self::$controllerIsRequired === false) {\n self::checkOutputIsSet();\n return;\n }\n\n /**\n * However, if it requires a controller, then an exception is thrown.\n */\n $workingController = explode('\\\\', $routeControllerName);\n\n $notFoundClass = str_replace('\\\\', '', array_pop($workingController));\n $notFoundNamespace = implode('/', $workingController);\n\n throw new Exception(self::CONTROLLER_NOT_FOUND[1], self::CONTROLLER_NOT_FOUND[0], [$routeControllerName, $notFoundClass, $notFoundNamespace]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Schedule the event to run quarterly. | public function quarterly()
{
return $this->setCronTimeExpression('0 0 1 */3');
} | [
"function test_schedule_event() {\n\t\t$hook = __FUNCTION__;\n\t\t$recur = 'hourly';\n\t\t$timestamp = strtotime( '+1 hour' );\n\n\t\t$scheduled = wp_schedule_event( $timestamp, $recur, $hook );\n\t\t// It's scheduled for the right time.\n\t\t$this->assertSame( $timestamp, wp_next_scheduled( $hook ) );\n\t\t// It's a recurring event.\n\t\t$this->assertSame( $recur, wp_get_schedule( $hook ) );\n\t}",
"public function run( $args ) {\n\t\tITSEC_Core::get_scheduler()->run_recurring_event( $args[0] );\n\t}",
"public static function quarter($datetime)\n {\n }",
"public function runOnceInQuarters(int $quarters): CronTask\n {\n return $this->registerSingular('quarter', $quarters);\n }",
"function test_schedule_event() {\n\t\t$hook = rand_str();\n\t\t$recur = 'hourly';\n\t\t$timestamp = strtotime('+1 hour');\n\n\t\twp_schedule_event( $timestamp, $recur, $hook );\n\t\t// it's scheduled for the right time\n\t\t$this->assertEquals( $timestamp, wp_next_scheduled($hook) );\n\t\t// it's a recurring event\n\t\t$this->assertEquals( $recur, wp_get_schedule($hook) );\n\t}",
"public function insertQuarter()\n {\n if ($this->state == self::HAS_QUARTER) {\n echo \"You cannot insert another quarter\\n\";\n } elseif ($this->state == self::NO_QUARTER) {\n //at this point, we accept the quarter and transtion to HAS_QUARTER state\n $this->state = self::HAS_QUARTER;\n echo \"You have inserted a quarter\\n\";\n } elseif ($this->state == self::SOLD_OUT) {\n echo \"You cannot insert a quarter, bcoz the machine is sold out\\n\";\n } elseif ($this->state == self::SOLD) {\n //if the customer just bought a gumball he needs to wait until the \n //transaction is complete before inserting another quarter.\n echo \"Please wait, we are already giving you a gumball\\n\";\n }\n }",
"public function setQuarter($quarter)\r\n\t\t{\r\n\t\t\t$this->quarter = $quarter;\r\n\t\t}",
"function advertising_quarter() {\r\n\t\t$advertising_quarter = $this->get_option( 'advertising_quarter' );\r\n\r\n\t\tif ( in_array( $advertising_quarter, array( 1, 2, 3 ) ) ) {\r\n\t\t\t$advertising_quarter ++;\r\n\t\t} else {\r\n\t\t\t$advertising_quarter = '1';\r\n\t\t}\r\n\r\n\t\t$this->update_option( 'advertising_quarter', $advertising_quarter );\r\n\t}",
"protected static function schedule_sync() {\n\t\t$start_time = mktime( 0, 0, 0, date( 'n' ), date( 'j' ) + 1 );\n\t\twp_schedule_event( $start_time, 'daily', 'wc_rs_sync' );\n\t}",
"public function startQuarter(): static\n {\n $month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1;\n\n return $this->setDateTime($this->year, $month, 1, 0, 0);\n }",
"public function prepareExecuteScheduleEvent(){\n\t\tif ( ! wp_next_scheduled( 'queue_fire_event') ) {\n\t\t\twp_schedule_event(time(), 'every_queue_interval_seconds', 'queue_fire_event');\n\t\t}\n\t\tadd_action( 'queue_fire_event', [$this, 'runScheduleEvent'] );\n\t}",
"public function quarter() {\n\treturn floor(($this->date->format(\"n\") - 1) / 3) + 1;\n }",
"public function firstDayOfQuarter() {\n\t\treturn $this->firstDayOfMonth()->subtractMonths((date('m', $this->ts) - 1) % 3);\n\t}",
"public function endOfQuarter();",
"function wdsl_cron_setup() {\n if( !wp_next_scheduled( 'wdsl_daily_stock_hook' ) ) {\n wp_schedule_event( wdsl_get_midnight(), 'daily', 'wdsl_daily_stock_hook' );\n }\n add_action( 'wdsl_daily_stock_hook', 'wdsl_cron_exec' );\n}",
"public function snapToQuarter(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->quarter()->startDate(),\n DatePoint::fromDate($this->endDate)->quarter()->endDate(),\n $this->bounds\n );\n }",
"public function setQuarter($var)\n {\n GPBUtil::checkString($var, True);\n $this->quarter = $var;\n\n return $this;\n }",
"public function addQuarter() {\n\t\treturn $this->add(1, DateTime::QUARTER);\n\t}",
"public function shedule_cron_events() {\n\t\t\t$plugin_version = $this->get_plugin_version();\n\t\t\t$option_version = $this->get_option_version();\n\n\t\t\tif ( $plugin_version !== $option_version ) {\n\t\t\t\t/* dashboard cron */\n\t\t\t\tif ( ! wp_next_scheduled( 'helpful/dashboard/build_cache' ) ) {\n\t\t\t\t\twp_schedule_event( time(), 'twicedaily', 'helpful/dashboard/build_cache' );\n\t\t\t\t}\n\n\t\t\t\t/* refresh version in database */\n\t\t\t\t$this->refresh_option_version();\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Erstellt einen Newsfeed im Atom format | function createAtomFeed($url, $text, $topic, $height, $nofitems, $tempo, $utf8, $showSummary) {
$atomfeed = new Newsfeed($url, $text, $topic, $height, $nofitems, $tempo, $utf8);
$atomfeed->makeAtom($showSummary);
return $atomfeed;
} | [
"function parseAtom($feedXml) \n {\n $data = array();\n\n $data['title'] = $feedXml->title . '';\n foreach ($feedXml->link as $link) {\n $data['link'] = $link['href'] . '';\n break;\n }\n\n $data['description'] = $feedXml->subtitle . '';\n $data['parser'] = __CLASS__;\n $data['type'] = 'atom';\n\n foreach ($feedXml->entry as $item) {\n foreach ($item->link as $link) {\n $itemLink = $link['href'] . '';\n break;\n }\n\n $categories = array();\n foreach ($item->category as $category) {\n $categories[] = $category['term'] . '';\n }\n\n $data['items'][] = array(\n 'title' => $item->title . '',\n 'link' => $itemLink . '',\n 'date' => date('Y-m-d h:i:s A', strtotime($item->published . '')),\n 'description' => $item->summary . '',\n 'content' => $item->content . '',\n 'categories' => $categories,\n 'author' => array('name' => $item->author->name . '', 'url' => $item->author->uri . ''),\n 'extra' => array('contentType' => $item->content['type'] . '', 'descriptionType' => $item->summary['type'] . '')\n );\n }\n\n return $data;\n }",
"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}",
"private function getATOM()\n\t{\n\t\t$this->trace(\"getATOM\");\n\n\t\t$cache_id=\"loremblogum-feed-\".$this->feed->feed_id;\n\t\t$raw=$this->getCurl($this->feed->url,$cache_id);\n\n\t\tif(trim($raw)=='')\n\t\t{\n\t\t\t$this->feed->title=\"[Connection error -- feed can not be fetched.]\";\n\t\t\t$this->feed->log['trace']=$this->feed->url.\" ==> \".$this->feed->title;\n\t\t\treturn false;\n\t\t}\n\n\t\tlibxml_use_internal_errors(true);\n\t\ttry {\n\t\t\t$xml = new \\SimpleXmlElement($raw, LIBXML_NOCDATA);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\t/* */\n\t\tif (!isset($xml)||!isset($xml->entry)) {\n\t\t\t$errors = libxml_get_errors();\n\t\t\tlibxml_clear_errors();\n\t\t\t$this->feed->title=\"[Connection error -- feed invalid.]\";\t\n\t\t\t$this->trace($this->feed->url.\" ==> \".var_export($errors,true).\"\");\n\t\t\treturn false;\n\t\t}\n\n\t\t/* */\n\t\t$this->feed->type='ATOM';\n\t\t$this->feed->title=trim((string)$xml->title);\n\t\t$this->feed->published_at=(string)$xml->updated;\n\t\t$this->feed->author=(string)$xml->author;\n\n\t\t$this->feed_items=[];\n\t\t$links=[];\n\t\t$count = count($xml->entry);\n\t\t$this->feed->log['feed_item_raw_count']=$count;\n\n\t\tfor($i=0; $i<$count; $i++)\n\t\t{\n\t\t\t$item=$xml->entry[$i];\n\t\t\t$this->feed->log['feed_items_title'][]=trim(wp_strip_all_tags((string)$item->title));\n\t\t\t$this->feed->log['feed_items_url'][]=trim(wp_strip_all_tags((string)$item->link['href']));\n\t\t}\n\n\t\t$this->new_item_count=0;\n\t\t$this->rejects=0;\n\t\t$skip=false;\n\t\tfor($i=0; $i<$count; $i++)\n\t\t{\n\t\t\t$item=$xml->entry[$i];\n\n\t\t\t$this->feed_item=new \\loremblogumFeedItems();\n\t\t\t$this->feed_item->feed_id=$this->feed->feed_id;\n\t\t\t$this->feed_item->url=trim((string)$item->link['href']);\n\t\t\t$this->feed_item->title=trim(wp_strip_all_tags((string)$item->title));\n\t\t\t$this->feed_item->published_at=date(\"Y-m-d h:m:s\",strtotime((string)$item->updated));\n\t\t\t$this->feed_item->content=\"\";\n\n\t\t\t$this->cleanFeedItemCategories($item->category);\n\n\t\t\t$this->computePredefine();\n\t\t\tif($this->feed->predefine!=null)\n\t\t\t{\n\t\t\t\tif($this->postItem())\n\t\t\t\t{\n\t\t\t\t\tif($this->new_item_count>=$this->maximum_imports_per_call)\n\t\t\t\t\t{\n\t\t\t\t\t\t$skip=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($this->rejects>=$this->maximum_rejects_per_call)\n\t\t\t\t\t{\n\t\t\t\t\t\t$skip=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->feed_items[]=$this->feed_item;\n\n\t\t\tif($skip) break;\n\t\t}\n\n\t\treturn true;\n\t}",
"function do_feed_rss() {}",
"public static function getFeeds()\n\t{\n\t\t$rssUrl = Yii::app()->user->getState('rss_url');\n\t\t$rawFeed = file_get_contents($rssUrl);\n\t\tif($rawFeed!='') {\n\t\t\t// give an XML object to be iterate\n\t\t\t$xml = new SimpleXMLElement($rawFeed);\n\t\t\t$criteria = new CDbCriteria();\n\t\t\t$criteria->condition = 't.company_id=:company_id';\n\t\t\t$criteria->params = array(':company_id'=>Yii::app()->user->getState('globalId'));\n\t\t\t$rss_notification = RssNotification::model()->find($criteria);\n\t\t\t\n\t\t\t$post_pubDate = \"\";\n\t\t\t$post_url = \"\";\n\t\t\t$post_title = \"\";\n\t\t\t$data = '';\n\t\t\tforeach($xml->channel->item as $item)\n\t\t\t{\n\t\t\t\t$post_pubDate = $item->pubDate;\n\t\t\t\t$post_url = self::strip_cdata($item->link);\n\t\t\t\t$post_title = self::strip_cdata($item->title);\n\t\t\t\tif(strtotime($post_pubDate)>strtotime($rss_notification->last_post_pubDate)) {\n\t\t\t\t\t$data.= $post_pubDate;\n\t\t\t\t\t$data.= \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$info = new Info();\n\t\t\t\t\t$info->user_id = Yii::app()->user->getState('userId');\n\t\t\t\t\t$info->company_id = Yii::app()->user->getState('globalId');\n\t\t\t\t\t$info->access_level_id = 1;\n\t\t\t\t\t$info->info_type_id = 2;\n\t\t\t\t\t$info->title = $post_title; \n\t\t\t\t\t$info->content = $post_url;\n\t\t\t\t\t$info->date_create = date('Y-m-d H:i:s', strtotime($post_pubDate));\n\t\t\t\t\t$info->save();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update the last post date time to now\n\t\t\tRssNotification::model ()->updateByPk ( $rss_notification->id, array (\n\t\t\t\t'last_post_pubDate' => date('Y-m-d H:i:s')\n\t\t\t) );\n\t\t\techo $data;\n\t\t}\n\t}",
"function wd_news() {\n\t\t\tinclude_once( ABSPATH . WPINC . '/feed.php' );\n\t\t\tif ( $rssobj = fetch_feed( 'https://webdesires.co.uk/feed/' ) ) {\n\t\t\t\t\n\t\t\t\t$content = '<ul>';\n\t\t\t\t$maxitems = $rssobj->get_item_quantity( 5 ); \n\n\t\t\t\t// Build an array of all the items, starting with element 0 (first element).\n\t\t\t\t$rss = $rssobj->get_items( 0, $maxitems );\n\t\t\t\t\n\t\t\t\tforeach ( $rss as $item ) {\n\t\t\t\t\t$content .= '<li class=\"schema\">';\n\t\t\t\t\t$content .= '<a class=\"rsswidget\" href=\"'.clean_url( $item->get_permalink(), $protocolls=null, 'display' ).'\">'. htmlentities($item->get_title()) .'</a> ';\n\t\t\t\t\t$content .= '</li>';\n\t\t\t\t}\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', $content);\n\t\t\t} else {\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', 'Nothing to say...');\n\t\t\t}\n\t\t}",
"public function rssFeedsAction()\r\n {\r\n $feed = new \\Zend\\Feed\\Writer\\Feed;\r\n $feed->setTitle('My Newsstand');\r\n $feed->setLink('http://my.news.app');\r\n $feed->setFeedLink('http://my.news.app', 'atom');\r\n $feed->addAuthor(array(\r\n 'name' => 'Test',\r\n 'email' => 'test@gmail.com',\r\n 'uri' => BASE_URL,\r\n ));\r\n $feed->setDateModified(time());\r\n $feed->addHub(BASE_URL);\r\n \r\n $entry = $feed->createEntry();\r\n $entry->setTitle('Top 10 Latest News');\r\n $entry->setLink(BASE_URL);\r\n $entry->addAuthor(array(\r\n 'name' => 'Test',\r\n 'email' => 'test@gmail.com',\r\n 'uri' => BASE_URL,\r\n ));\r\n $entry->setDateModified(time());\r\n $entry->setDateCreated(time());\r\n $entry->setDescription('This RSS feed includes latest 10 news articles');\r\n $entry->setContent(\r\n 'I am not writing the article. The example is long enough as is ;).'\r\n );\r\n $feed->addEntry($entry);\r\n \r\n $out = $feed->export('atom');\r\n \r\n echo $out;\r\n }",
"public function testParseAtomFeed()\n {\n $this->assertTrue(false);\n }",
"function rss($channel=[],$items=[],$rss=[]){\r\n//nx: $rss.type=atom,...\r\n if(empty($rss['ver']))$rss['ver']='2.0';\r\n $x='<?xml version=\"1.0\" encoding=\"UTF-8\" ?>'.(!empty($rss['css'])?'<?xml-stylesheet type=\"text/css\" href=\"'.$rss['css'].'\" ?>':'').'<rss version=\"'.$rss['ver'].'\" xmlns:atom=\"http://www.w3.org/2005/Atom\">'.PHP_EOL;\r\n $x.='<channel><title>'.$channel[0].'</title><link>'.$channel[1].'</link><description>'.$channel[2].'</description>'.(!empty($rss['link'])?'<atom:link href=\"'.$rss['link'].'\" rel=\"self\" type=\"application/rss+xml\"/>':'').PHP_EOL;\r\n\r\n foreach($items as $item){ //$item['GMT']=+0200\r\n if(empty($item['guid']))$item['guid']=$item['link'];\r\n if(!is_array($item['img']))$item['img']=[$item['img']];\r\n if(empty($item['img'][1]))$item['img'][1]='1024';\r\n if(empty($item['img'][2]))$item['img'][2]='image/jpeg';\r\n if(empty($item['GMT']))if(!empty($rss['GMT']))$item['GMT']=$rss['GMT'];else $item['GMT']='GMT';\r\n $x.='<item><title><![CDATA[ '.$item['title'].' ]]></title><link>'.$item['link'].'</link><guid>'.$item['guid'].'</guid><pubDate>'.date('D, d M Y H:i:s',($item['time'])).' '.$item['GMT'].'</pubDate><description><![CDATA[ '.(!empty($item['img'][0])?'<img src=\"'.$item['img'][0].'\" />':'').'<br />'.$item['description'].'<a href=\"'.$item['link'].'\" target=\"_blank\" '.(!empty($item['rel'])?'rel=\"'.$item['rel'].'\"':'').'>'.$item['link'].'</a>'.' ]]></description>'.(!empty($item['img'][0])?'<enclosure url=\"'.$item['img'][0].'\" length=\"'.$item['img'][1].'\" type=\"'.$item['img'][2].'\" />':'').'</item>'.PHP_EOL;\r\n }\r\nreturn $x.'</channel></rss>';\r\n}",
"public function atomAction() {\n header(\"Content-Type: application/xml;\");\n $out = $this->feed->export('atom');\n\n echo $out;\n exit;\n }",
"function news() {\r\n\t\tinclude_once(ABSPATH . WPINC . '/feed.php');\r\n\t\t$rss = fetch_feed('http://feeds2.feedburner.com/ivankristianto');\r\n\t\t$rss_items = $rss->get_items( 0, $rss->get_item_quantity(5) );\r\n\t\t$content = '<ul>';\r\n\t\tif ( !$rss_items ) {\r\n\t\t\t$content .= '<li class=\"ivankristianto\">no news items, feed might be broken...</li>';\r\n\t\t} else {\r\n\t\t\tforeach ( $rss_items as $item ) {\r\n\t\t\t\t$content .= '<li class=\"ivankristianto\">';\r\n\t\t\t\t$content .= '<a class=\"rsswidget\" href=\"'.esc_url( $item->get_permalink(), $protocolls=null, 'display' ).'\">'. htmlentities($item->get_title()) .'</a> ';\r\n\t\t\t\t$content .= '</li>';\r\n\t\t\t}\r\n\t\t}\t\t\t\t\t\t\r\n\t\t$content .= '<li class=\"rss\"><a href=\"http://feeds2.feedburner.com/ivankristianto\">Subscribe with RSS</a></li>';\r\n\t\t//$content .= '<li class=\"email\"><a href=\"http://ivankristianto.com/email-blog-updates/\">Subscribe by email</a></li>';\r\n\t\t$content .= '</ul>';\r\n\t\t$this->postbox('ivankristiantolatest', 'Latest from IvanKristianto.com', $content);\r\n\t}",
"function my_custom_rss_render() {\n add_feed( 'marko', 'myRssFeed' ); \n}",
"public function rssFeedAction()\n {\n $rss = new RssReader('http://www.vg.no/rss/nyfront.php?frontId=1');\n $rss->fetchData();\n $rss->sortDataByDate();\n\n $this->view->articles = $rss->getData();\n }",
"protected abstract function formatFeed(string $content): NewsReaderItemList;",
"public function rss() {\n $rss = new RSSFeed($this->Children(), $this->Link(), 'Latest News');\n $rss->outputToBrowser();\n }",
"public function newsAction()\n {\n $feed = array(\n 'title' => 'St. John News',\n 'description' => '',\n 'link' => 'http://www.stjohncalgary.com',\n 'charset' => 'utf8',\n 'entries' => array()\n );\n\n $newsService = new \\Service\\News();\n $news = $newsService->getActiveNews()->get();\n foreach ($news['message'] as $article) {\n $feed['entries'][] = array(\n 'title' => $article->title . ' - ' . $article->created->format('M. d, Y g:ia'),\n 'description' => $article->body,\n 'link' => 'http://www.stjohncalgary.com'\n );\n }\n \n echo Zend_Feed::importArray($feed, 'rss')->send();\n }",
"public function rss_updates()\n\t{\n\t\t$info = array(\n\t\t\t'title' \t\t=> 'Chocobo Riding - Mises à jour',\n\t\t\t'link'\t\t\t=> 'http://chocobo-riding.menencia.com',\n\t\t\t'description' \t=> \"Fil RSS des mises à jour de Chocobo Riding.\");\n\t\t$items = array();\n\t\t\n\t\t$topics = ORM::factory('topic')\n\t\t\t->where('theme_id', 1)\n\t\t\t->where('status', 0)\n\t\t\t->orderby('created', 'desc')\n\t\t\t->find_all(20);\n\t\t\n\t\tforeach ($topics as $topic)\n\t\t{\n\t\t \t$comment = $topic->comments[0];\n\t\t \t\n\t\t \t$items[] = array(\n\t\t \t\t'title'\t\t\t=> $topic->title,\n\t\t \t'link' \t\t\t=> 'http://chocobo-riding.menencia.com/topic/view/'.$topic->id,\n\t\t \t'guid' \t\t\t=> 'http://chocobo-riding.menencia.com/topic/view/'.$topic->id,\n\t\t \t'description' \t=> nl2br($comment->content),\n\t\t \t//'author' \t\t=> $post->user->username,\n\t\t \t'pubDate' \t=> date('D\\, j M Y H\\:i\\:s ', $topic->created).\"+0400\"\n\t\t );\n\t\t}\n\t\t\n\t\techo feed::create($info, $items);\n\t\t$this->profiler = null;\n $this->auto_render = false;\n header(\"content-type: application/xml\");\n\t}",
"private function makeRSS() {\r\n\t\t//header('Content-Type: application/rss+xml; charset=ISO-8859-1');\r\n\t\theader('Content-Type: text/xml; charset=ISO-8859-1');\r\n\r\n\t\t//header\r\n\t\t$this->feed = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>'.PHP_EOL;\r\n\t\t$this->feed.= '<!-- generator=\"open[qoob]\" -->'.PHP_EOL;\r\n\t\t$this->feed.= '<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">'.PHP_EOL;\r\n\t\t//channel\r\n\t\t$this->feed.= ' <channel>'.PHP_EOL;\r\n\t\t$this->feed.= ' <title>'.$this->title.'</title>'.PHP_EOL;\r\n if($this->descriptionHtml){\r\n\t\t\t$this->feed.= ' <description><![CDATA['.$this->description.']]></description>'.PHP_EOL;\r\n\t\t} else {\r\n\t\t\t$this->feed.= ' <description>'.$this->description.'</description>'.PHP_EOL;\r\n\t\t}\r\n\t\t$this->feed.= ' <link>'.$this->link.'</link>'.PHP_EOL;\r\n $this->feed.= ' <lastBuildDate>'.date(\"r\", time()).'</lastBuildDate>'.PHP_EOL;\r\n $this->feed.= ' <generator>open[qoob]</generator>'.PHP_EOL;\r\n $this->feed.= ' <atom:link href=\"'.RAW_URL.'\" rel=\"self\" type=\"application/rss+xml\" />'.PHP_EOL;\r\n //body\r\n for($i=0; $i<count($this->posts); $i++) {\r\n \t$this->feed.= ' <item>'.PHP_EOL;\r\n \t$this->feed.= ' <title>'.$this->posts[$i]['title'].'</title>'.PHP_EOL;\r\n \t$this->feed.= ' <link>'.$this->posts[$i]['link'].'</link>'.PHP_EOL;\r\n \t$this->feed.= ' <guid>'.$this->posts[$i]['link'].'</guid>'.PHP_EOL;\r\n\t if($this->posts[$i]['descriptionHtml']){\r\n\t\t\t\t$this->feed.= ' <description><![CDATA['.$this->posts[$i]['description'].']]></description>'.PHP_EOL;\r\n\t\t\t} else {\r\n\t\t\t\t$this->feed.= ' <description>'.$this->posts[$i]['description'].'</description>'.PHP_EOL;\r\n\t\t\t}\r\n\t\t\t$this->feed.= ' <author>'.$this->posts[$i]['author'].'</author>'.PHP_EOL;\r\n\t\t\t//$this->feed.= ' <category>technology</category>'.PHP_EOL;\r\n\t\t\t$this->feed.= ' <pubDate>'.date(\"r\", $this->posts[$i]['date']).'</pubDate>'.PHP_EOL;\r\n \t$this->feed.= ' </item>'.PHP_EOL;\r\n }\r\n //footer\r\n\t\t$this->feed.= ' </channel>'.PHP_EOL;\r\n\t\t$this->feed.= '</rss>'.PHP_EOL;\r\n\t}",
"function lastnews(){\n\t$url = \"https://github.com/andrearufo/PrototySite/commits/master.atom\";\n\t$xml = simplexml_load_file($url);\n\t$entry = $xml->entry;\n\t\n\t$titolo = \t$entry -> title;\n\t$data\t=\timplode(\".\", array_reverse(explode(\"-\", substr($entry -> updated, 0, 10))));\n\t$testo\t=\tstrip_tags($entry -> content);\n\t\n\treturn \"<h1>$titolo</h1>\n\t<p><a href=\\\"https://github.com/andrearufo/PrototySite\\\" target=\\\"_blank\\\"><strong>$data</strong> $testo</a></p>\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of product that matches the search query string. | public function searchProduct()
{
return $this->productService->getAllSearchWithPagination();
} | [
"public static function searchProducts($search){\n if(!empty($search)){\n // check for multiple search terms\n if(strpos($search,' ') !== false){\n $searchArray = explode(\" \", $search);\n $firstSearch = '%'.array_shift($searchArray).'%';\n } else {\n $firstSearch = '%'.$search.'%';\n }\n $params = array(\n \"lower(name) LIKE lower(:s:)\n OR description LIKE :s:\",\n \"bind\" => array(\n \"s\" => $firstSearch\n )\n );\n } else {\n $params = null;\n }\n $products = \\Multiple\\Models\\Product::find($params);\n if(!empty($searchArray)){\n $products = $products->filter(function($product) use ($searchArray){\n foreach($searchArray as $s){\n if (stripos($product->name,$s) ||\n stripos($product->description,$s)) {\n return $product;\n }\n }\n });\n }\n if($products){\n return $products->toArray();\n } else {\n return false;\n }\n }",
"public function getProductList(Request $request){\n $products=[];\n if($request->has('searchTerm') && $request->searchTerm !== ''){\n $searchTerm= trim($request->searchTerm);\n \n if(EcommerceIntegrationHelper::hasActivePlatform()){\n $products= EcommerceIntegrationHelper::getResourceList($searchTerm, \"product\");\n }\n else{\n $products= Product::where('name','like',\"%\" .$searchTerm .\"%\")\n ->orWhere('sku','like',\"%\" .$searchTerm .\"%\")\n ->orWhere('ean','like',\"%\" .$searchTerm .\"%\")\n ->get();\n\n // add images to the filtered list of products\n $this->_addImagesToProducts($products);\n }\n } \n \n return $products;\n }",
"public function searchProduct(Request $request)\n\t{\n\t\t$client_id = $request->get('client_id');\n\t\t$products = Product::where('client_id', $client_id)->get();\n\t\treturn $products;\n\t}",
"public static function search($query) {\n return Database::get_products_like($query);\n }",
"function get_products_search($s){\n $results = array();\n $all = get_products_all();\n foreach ($all as $product) {\n if (stripos($product['name'], $s) !== false OR stripos($product['sku'], $s) !== false) {\n $results[] = $product;\n }\n }\n return $results;\n }",
"public function searchProduct($filters);",
"public function getSearch()\n {\n $products = $this->product->getExecuteFormSearch();\n $products->load('variants', 'brand');\n\n $this->theme->breadcrumb()->add('Product Search Result', URL::to('products/search'));\n $this->theme->setTitle('Product Search Result');\n\n $view_data = compact('products');\n\n return $this->theme->of('products.search', $view_data)->render();\n }",
"public function product_by_search() {\n $CI = & get_instance();\n $CI->load->model('manufacturers');\n $manufacturers_list = $CI->manufacturers->product_search_item($manufacturer_id);\n $i = 0;\n foreach ($manufacturers_list as $k => $v) {\n $i++;\n $manufacturers_list[$k]['sl'] = $i;\n }\n $data = array(\n 'title' => display('manage_manufacturer'),\n 'manufacturers_list' => $manufacturers_list\n );\n $manufacturerList = $CI->parser->parse('manufacturer/manufacturer', $data, true);\n return $manufacturerList;\n }",
"function searchProduct($param) {\n\t$oshop = new OOOnlineShop();\n $res['method'] = \"searchProduct\";\n\t$res['search'] = htmlentities($param['search']);\n\t\n $products['method'] = \"getProductsList\";\n\t$param['from'] = \"\";\n\t$param['limit'] = \"\";\n\t$param['cat'] = \"\";\n\t$products = $oshop->getProductsList($param);\n\t$search = \"\";\n\t$count = count($products);\n\t$x = 0;\n\n\tfor ($i = 0; $i <= $count; $i++) {\n\t\tif (stristr($products[$i]['description'], $res['search'])) {\n\t\t\t$search[$x] = $products[$i];\n\t\t}\n\t}\n\n\t$res['data'] = $search;\n\t\n\techo json_encode($res);\t\t\n}",
"public function getProductsByKeywords($keywords)\n {\n $result = array();\n\n // Detect products names in keywords\n $products_by_name = $this->findProductNameInString($keywords);\n\n // Detect brand names in keywords\n $brand_by_name = $this->findBrandNameInString($keywords);\n\n // Detect weight property in keywords\n $weight = $this->findWeightPropertyInString($keywords);\n\n // Detect capacity property in keywords\n $capacity = $this->findCapacityPropertyInString($keywords);\n\n foreach ($products_by_name as $product_name => $weighting) {\n\n // If in $keywords typed in search field, we found strings matched with a brand name,\n // we search products ON product name AND brand name\n if (count($brand_by_name) > 0) {\n foreach ($brand_by_name as $brand_names) {\n foreach ($brand_names as $brand_name) {\n $products = $this->em->getRepository($this->productClassName)->findProductsByNameAndBrandContains($product_name, $brand_name);\n foreach ($products as $product) {\n $result[$product->getId()] = $product;\n }\n }\n }\n\n // Else if just product name, we search products by name\n } else {\n $products = $this->em->getRepository($this->productClassName)->findProductsByNameContains($product_name);\n foreach ($products as $product) {\n $result[$product->getId()] = $product;\n }\n }\n\n if (count($result) == 0) {\n continue;\n }\n\n if (!is_null($weight) && !is_null($capacity)) {\n $wc_products = array();\n foreach ($result as $product) {\n if ($product->getWeight() == $weight && $product->getCapacity() == $capacity) {\n $wc_products[] = $product;\n }\n }\n $result = $wc_products;\n } elseif (!is_null($weight) && is_null($capacity)) {\n $weight_products = array();\n foreach ($result as $product) {\n if ($product->getWeight() == $weight) {\n $weight_products[] = $product;\n }\n }\n $result = $weight_products;\n } elseif (is_null($weight) && !is_null($capacity)) {\n $capacity_products = array();\n foreach ($result as $product) {\n if ($product->getCapacity() == $capacity) {\n $capacity_products[] = $product;\n }\n }\n $result = $capacity_products;\n }\n }\n\n return $result;\n }",
"public function searchProduct(String $name){\n $builder = $this->db->table('products');\n $builder->like(\"product_name\", \"%\".$name.\"%\");\n $query = $builder->get();\n return $query->getResult();\n }",
"public function getProducts (Request $request)\n {\n // Results to return\n $results = array ();\n\n // Seperate query by spaces and search for each word\n $words = explode (\" \", $request->input('query'));\n foreach ($words as $w)\n {\n // Getting DB result\n $db_result = array();\n\n // search Products\n if($request->input('type') == \"product\") \n {\n // Find the all products that match a given pattern and are published\n // There are published by the admin account.\n $db_result = DB::table('products')\n -> select('*')\n -> where('prod_name', 'LIKE', \"%{$w}%\")\n -> where('isPublished', '=', '1')\n -> get();\n }\n\n // search Categories\n else if($request->input('type') == \"category\") \n {\n // Getting DB result\n $db_result = DB::table('products')\n -> join('categories', 'products.prod_category', '=', 'categories.category_id')\n -> select('products.*','categories.category_name', 'products.prod_id')\n -> where('category_name', 'LIKE', \"%{$w}%\")\n -> where('isPublished', '=', '1')\n -> get();\n }\n\n // search Brands\n else if($request->input('type') == \"brand\") \n {\n // Getting DB result\n $db_result = DB::table('products')\n -> join('brands', 'products.prod_brand', '=', 'brands.brand_id')\n -> select('products.*','brands.brand_name')\n -> where('brand_name', 'LIKE', \"%{$w}%\")\n -> where('isPublished', '=', '1')\n -> get();\n }\n\n // Unioning this search result with other results\n foreach ($db_result as $product){\n $product->url = \"/products/{$product->prod_id}\";\n $results[$product->prod_id] = $product;\n }\n }\n\n // Return search results view\n return view('search_results')->with(\n [\n 'results' => $results,\n 'query' => $request->input('query'),\n 'type' => $request->input('type')\n ]\n );\n }",
"function searchProducts($args = array()) {\n extract($args);\n if(!isset($pattern)) {\n $pattern = '/(' . implode('|', $queries) . ')/i';\n }\n\n if(checkWords($pattern, 'produkt_id', $product) || checkWords($pattern, 'produkt_namn', $product) || checkWords($pattern, 'kategori_namn', $product) > 0) {\n $weight = 0;\n\n //-------------------------------------------------------------\n // Here we add a weight value to each product found. The weight\n // is used for sorting the array. The more keywords that are\n // found in the product name = higher weight\n //-------------------------------------------------------------\n $splitProductName = explode(' ', $product['produkt_namn']);\n foreach($splitProductName as $key => $name) {\n $name = explode(' ', strtolower($name));\n foreach($queries as $q) {\n if(in_array($q, $name)) {\n $weight++;\n }\n }\n }\n\n $product['weight'] = $weight;\n return $product;\n }\n}",
"function productSearch($searchTerm)\n\t{\n\t\t$returnString = \"\";\n\t\t$numItemsFound = 0;\n\t\t$q = \"SELECT \".TBL_PRODUCTS.\".id AS productID, \n\t\t\t\".TBL_PRODUCTS.\".name, \n\t\t\t\".TBL_PRODUCTS.\".brandID AS productBrandID, \n\t\t\t\".TBL_BRANDS.\".id AS brandID, \n\t\t\t\".TBL_BRANDS.\".name AS brandName \n\t\tFROM \".TBL_PRODUCTS.\", \".TBL_BRANDS.\"\n\t\tWHERE \n\t\t(\".TBL_PRODUCTS.\".name LIKE \\\"%$searchTerm%\\\" OR\n\t\t\".TBL_BRANDS.\".name LIKE \\\"%$searchTerm%\\\") AND\n\t\t\".TBL_BRANDS.\".id = \".TBL_PRODUCTS.\".brandID\";\n\t\t//\"SELECT products.id, products.name AS name FROM products WHERE products.name LIKE \\\"%$searchTerm%\\\" LIMIT 0,10\";\n\t\t\n\t\tif(DEBUG_MODE){$_SESSION['debug_info'] .= \"<p>Searching products @ database.php</p>\\n\";}\n\t\tif(DEBUG_MODE){$_SESSION['debug_info'] .= \"<p><code>$q</code></p>\\n\";}\n\t\t$result = mysql_query($q);\n\t\tif(mysql_num_rows($result) == 0)\n\t\t{\n\t\t\treturn \"No results found.\";\n\t\t}\n\t\twhile($dbArray = mysql_fetch_assoc($result))\n\t\t{\n\t\t\t$numItemsFound++;\n\t\t\t$returnString .= \"<div class=\\\"search-result\\\">\\n\n\t\t\t\t\t<div class=\\\"search-item-name\\\"><span class=\\\"brand\\\">\".strtolower($dbArray['brandName']).\" </span>\".strtolower($dbArray['name']).\"</div>\n\t\t\t\t\t<a class=\\\"icon-plus add-item\\\" id=\\\"\".$dbArray['productID'].\"\\\" title=\\\"\".strtolower($dbArray['name']).\"\\\">Add Item</a>\n\t\t\t\t\t</div>\";\n\t\t}\n\t\treturn $returnString;\n\t}",
"public function product_by_search(){\n\t\t$CI =& get_instance();\n\t\t$CI->load->model('dashboard/Suppliers');\n\t\t$suppliers_list = $CI->Suppliers->product_search_item($supplier_id);\n\t\t$i=0;\n\t\tforeach($suppliers_list as $k=>$v){$i++;\n $suppliers_list[$k]['sl']=$i;\n\t\t}\n\t\t$data = array(\n\t\t\t\t'title' => 'Suppliers Search Items',\n\t\t\t\t'suppliers_list' => $suppliers_list\n\t\t\t);\n\t\t$supplierList = $CI->parser->parse('supplier/supplier',$data,true);\n\t\treturn $supplierList;\n\t}",
"function get_products_search($s){\n\n require(ROOT_PATH . \"inc/database.php\");\n try {\n $results = $db->prepare(\"\n SELECT name, price, img, sku, paypal \n FROM products \n WHERE name LIKE ? \n ORDER BY sku\");\n $results->bindValue(1,\"%\" . $s . \"%\");\n $results->execute();\n } catch (Exception $e) {\n echo \"Not possible to run the query...\";\n exit();\n }\n\n $matches = $results->fetchAll(PDO::FETCH_ASSOC);\n\n return $matches;\n }",
"public function getMatchingProduct($request);",
"public function getAllProductsBySearchText($text_param) {\n $productIds = array();\n $productCollection = array();\n $storeId = Mage::app()->getStore()->getStoreId();\n $products = Mage::getResourceModel('catalog/product_collection')\n ->addStoreFilter($storeId)\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('status', 1)\n ->addAttributeToFilter('visibility', 4)\n ->addAttributeToFilter('name', array('like' => '%'.$text_param.'%'))\n ->load();\n\n foreach ($products as $product) {\n array_push($productIds, $product->getId());\n }\n\n foreach ($productIds as $productId) {\n $product = Mage::getModel('catalog/product')->load($productId);\n array_push($productCollection, $product);\n }\n\n $this->setSwatchesProductCollection($productCollection);\n }",
"public function getProductSearchResults()\n {\n return $this->product_search_results;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all SocialNetwork entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('OrchestraOrchestraBundle:SocialNetwork')->findAll();
return $this->render('OrchestraOrchestraBundle:SocialNetwork:index.html.twig', array(
'entities' => $entities,
));
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('PortfolioLaureBundle:SocialNetwork')->findAll();\n\n return $this->render('PortfolioLaureBundle:SocialNetwork:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function getAll()\n {\n \n $sql = \"SELECT * FROM tb_social_networks\";\n \n \n $stmt = $this->connection->prepare($sql);\n \n $resultSet = $stmt->executeQuery();\n \n $arrSocialNetworks = array();\n \n while($row = $resultSet->fetchAssociative())\n {\n $socialNetwork = new SocialNetworks();\n $socialNetwork->setName($row['name']);\n $arrSocialNetworks[] = $socialNetwork;\n }\n \n return $arrSocialNetworks;\n }",
"public function allAction()\n {\n $this->denyAccessUnlessGranted('ROLE_MODERATOR', null, 'Unable to access this page!');\n\n $em = $this->getDoctrine()->getManager();\n\n $nurls = $em->getRepository('AppBundle:Nurl')->findAll();\n\n return $this->render('nurl/all.html.twig', array(\n 'nurls' => $nurls,\n ));\n }",
"public static function getAvailableSocialNetworks()\n {\n $db = DB::get('users');\n $query = \"SELECT DISTINCT `name`, NULL AS `url` FROM `\" . Settings::getInstance()->TABLES['LM_AGENTS_SOCIAL_NETWORKS'] . \"`\";\n $stmt = $db->prepare($query);\n $stmt->execute();\n\n $networks = static::processSocialNetworks($stmt);\n\n $stmt->closeCursor();\n\n return $networks;\n }",
"public function index(Request $request)\n {\n $this->socialNetworkRepository->pushCriteria(new RequestCriteria($request));\n $socialNetworks = $this->socialNetworkRepository->all();\n\n return view('social_networks.index')\n ->with('socialNetworks', $socialNetworks);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $entities = $em->getRepository('RegistroAcademicoBundle:ServicioSocial')->findAll();\n\n return array(\n 'entities' => $entities\n \n );\n }",
"public function getAllEntities()\n {\n return $this->getRepository()->findAll();\n }",
"public function getAllAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('MiwClubPadelBundle:Users')->findAll();\n return $entities;\n }",
"public function getPageList()\n {\n $companyNetwork = $this->repo->token(CompanyNetwork::FACEBOOK);\n if (empty($companyNetwork)) {\n throw new NetworkNotExistException(\"Company not connected to facebook network.\");\n }\n $this->facebook = $this->setAdapter($companyNetwork->token, 'facebook');\n $appsecretProof = hash_hmac('sha256', 'access_token', config('hybridauth.providers.Facebook.keys.secret'));\n $response = $this->facebook->apiRequest($this->facebookAPIURL.'me/accounts?fields=name,picture,access_token,category,id', $appsecretProof, 'GET');\n\n return json_decode(json_encode($response), true);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $statutSocials = $em->getRepository('MainBundle:StatutSocial')->findAll();\n\n return $this->render('statutsocial/index.html.twig', array(\n 'statutSocials' => $statutSocials,\n ));\n }",
"public function getSocialAccounts()\n {\n return $this->hasMany(SocialAccount::className(), ['user_id' => 'id']);\n }",
"public function actionIndex () {\n $searchModel = new SocialServiceManagerSearch();\n $dataProvider = $searchModel->search (Yii::$app->request->queryParams);\n\n return $this->render ('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function listNetworks() {\n $params = $this->_p;\n $params['controller'] = 'NCNetworks';\n $params['action'] = 'listNetworks';\n return $this->_caller->sendRequest($params);\n }",
"public function userSocialNetwork()\n {\n return $this->hasMany('App\\Models\\Core\\UserSocialNetwork');\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('ACInst3Bundle:Node')->findAll();\n\n return $this->render('ACInst3Bundle:Node:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"public function get_social_links() {\n\t\t\treturn $this->links;\n\t\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $query = $em->getRepository('LFSMAdminBundle:StatutSocial')->myFindAllQuery();\n\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $query, $this->get('request')->query->get('page', 1)/* page number */, 10/* limit per page */\n );\n\n $totalPages = ceil($pagination->getTotalItemCount() / $pagination->getItemNumberPerPage());\n\n return array(\n 'totalPages' => $totalPages,\n 'pagination' => $pagination,\n );\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"function displaySocialNetworks ($settings) {\n\tforeach ($settings->site_social as $network) {\n\t\techo \"<a href='{$network->link}'><i class='fab fa-{$network->icon}'></i><span>{$network->title}</span></a>\";\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends value to '_oppo_heroes' list | public function appendOppoHeroes(Msg_Hero $value)
{
return $this->append(self::_OPPO_HEROES, $value);
} | [
"public function appendOppoHeroes(Bcdown_Hero $value)\n {\n return $this->append(self::_OPPO_HEROES, $value);\n }",
"public function appendHeroes($value)\n {\n return $this->append(self::_HEROES, $value);\n }",
"public function appendHero(\\PB_Hero $value)\n {\n return $this->append(self::HERO, $value);\n }",
"public function appendHeroes(Down_Hero $value)\n {\n return $this->append(self::_HEROES, $value);\n }",
"public function appendNewHeroes(Down_Hero $value)\n {\n return $this->append(self::_NEW_HEROES, $value);\n }",
"public function appendReleaseHeroes($value)\n {\n return $this->append(self::_RELEASE_HEROES, $value);\n }",
"public function appendHireHero($value)\n {\n return $this->append(self::_HIRE_HERO, $value);\n }",
"public function appendStHeroIdList($value)\n {\n return $this->append(self::STHEROIDLIST, $value);\n }",
"public function appendSelfHeroes(Bcdown_Hero $value)\n {\n return $this->append(self::_SELF_HEROES, $value);\n }",
"public function appendSelfHeroes(Msg_Hero $value)\r\n {\r\n return $this->append(self::_SELF_HEROES, $value);\r\n }",
"public function appendHeroes(Down_TbcSelfHero $value)\n {\n return $this->append(self::_HEROES, $value);\n }",
"public function appendHeroSkills($value)\n {\n return $this->append(self::HERO_SKILLS, $value);\n }",
"public function appendSelfHeroes(Down_Hero $value)\n {\n return $this->append(self::_SELF_HEROES, $value);\n }",
"public function appendHp($value)\n {\n return $this->append(self::_HP, $value);\n }",
"public function setGetAllHeroes($value)\n {\n return $this->set(self::_GET_ALL_HEROES, $value);\n }",
"private function add_to_oe_sums(array $oe): void {\n $this->oe_sum['hp'][] = ($oe['hp']) ? 1 : 0;\n $this->oe_sum['attack'][] = ($oe['attack']) ? 1 : 0;\n $this->oe_sum['defense'][] = ($oe['defense']) ? 1 : 0;\n $this->oe_sum['speed'][] = ($oe['speed']) ? 1 : 0;\n $this->oe_sum['spatk'][] = ($oe['spatk']) ? 1 : 0;\n $this->oe_sum['spdef'][] = ($oe['spdef']) ? 1 : 0;\n return;\n }",
"public function append($value)\n {\n $this->items[] = $value;\n }",
"public function getOppoHeroesCount()\r\n {\r\n return $this->count(self::_OPPO_HEROES);\r\n }",
"public function getOppoHeroesCount()\n {\n return $this->count(self::_OPPO_HEROES);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\brief Function for handling labels and types Also function writes down to XML corresponding text \param[in] input_code Code of operation \param[in] i position of current argument \param[in] xw XML writer \param[in] jumps Variable for parameter jumps \param[in] label Variable for parameter labels \param temp_arr Array for writing down all labels | function label_type($input_code, $i, $xw, $jumps, $label, $temp_arr){
global $jumps;
global $labels;
global $temp_arr;
if (preg_match('/\s*\S*@\S*/', $input_code[$i])) {
fwrite(STDERR, "Expecting label, but got symbol ". $input_code[$i]."\n");
return 23;
}
switch (strtoupper($input_code[0])){
case 'LABEL':
if($label != -1){
array_push($temp_arr, $input_code[$i]);
}
$xw->addElement('arg'.$i, array('type'=>'label'));
$xw->text($input_code[$i]);
$xw->closeElement();
return 0;
case 'JUMP':
case 'JUMPIFEQ':
case 'JUMPIFNEQ':
case 'CALL':
if($jumps != -1){
$jumps++;
}
$xw->addElement('arg'.$i, array('type'=>'label'));
$xw->text($input_code[$i]);
$xw->closeElement();
return 0;
case 'READ':
$xw->addElement('arg'.$i, array('type'=>'type'));
$xw->text($input_code[$i]);
$xw->closeElement();
return 0;
}
} | [
"function print_output_xml_file_to_stdout()\r\n{\r\n $xml_name = func_get_arg(0);\r\n $add_XML_instruction = global_variables_main::$output->createElement('instruction');\r\n global_variables_main::$xml_count ++;\r\n $add_XML_instruction->setAttribute('order', global_variables_main::$loc_counter);\r\n $add_XML_instruction->setAttribute('opcode', $xml_name);\r\n $int_i = 1;\r\n while( $int_i < func_num_args() )\r\n {\r\n $xml_arg_token_argument = func_get_arg($int_i);\r\n switch ($xml_arg_token_argument->keyword)\r\n {\r\n case \"var\":\r\n case \"label\":\r\n case \"type\":\r\n $argument = switch_add_to_XML($xml_arg_token_argument, $int_i);\r\n break;\r\n case \"symbol\":\r\n if($xml_arg_token_argument->arbiter === \"int\")\r\n {\r\n $edited_token_string = substr($xml_arg_token_argument->str, 4);\r\n global_variables_main::$xml_count ++;\r\n $argument = global_variables_main::$output->createElement(\"arg$int_i\", $edited_token_string);\r\n $argument->setAttribute('type', 'int');\r\n }\r\n elseif ($xml_arg_token_argument->arbiter === \"string\")\r\n {\r\n $edited_token_string = substr($xml_arg_token_argument->str, 7);\r\n global_variables_main::$xml_count--;\r\n $argument = global_variables_main::$output->createElement(\"arg$int_i\", $edited_token_string);\r\n $argument->setAttribute('type', 'string');\r\n }\r\n elseif($xml_arg_token_argument->arbiter === \"bool\")\r\n {\r\n $edited_token_string = substr($xml_arg_token_argument->str, 5);\r\n global_variables_main::$xml_count ++;\r\n $argument = global_variables_main::$output->createElement(\"arg$int_i\", $edited_token_string);\r\n $argument->setAttribute('type', 'bool');\r\n }\r\n else\r\n {\r\n end_with_error(\"Internal XML error\", 99);\r\n }\r\n break;\r\n\r\n default:\r\n end_with_error(\"Internal XML error\", 99);\r\n }\r\n $add_XML_instruction->appendChild($argument);\r\n $int_i++;\r\n }\r\n global_variables_main::$output_program->appendChild($add_XML_instruction);\r\n}",
"function arg_num_2($xw, $ins_order, $ins_name, $ins_type_1, $ins_type_2, $comment_1, $comment_2){\r\n\r\n xmlwriter_start_element($xw, 'instruction');\r\n xmlwriter_start_attribute($xw, 'order');\r\n xmlwriter_text($xw, $ins_order);\r\n xmlwriter_start_attribute($xw,'opcode');\r\n xmlwriter_text($xw, $ins_name);\r\n xmlwriter_end_attribute($xw);\r\n\r\n xmlwriter_start_element($xw, 'arg1');\r\n xmlwriter_start_attribute($xw, 'type');\r\n xmlwriter_text($xw, $ins_type_1);\r\n xmlwriter_end_attribute($xw);\r\n xmlwriter_text ($xw, $comment_1);\r\n xmlwriter_end_element($xw);\r\n\r\n xmlwriter_start_element($xw, 'arg2');\r\n xmlwriter_start_attribute($xw, 'type');\r\n xmlwriter_text($xw, $ins_type_2);\r\n xmlwriter_end_attribute($xw);\r\n xmlwriter_text($xw, $comment_2);\r\n xmlwriter_end_element($xw);\r\n xmlwriter_end_element($xw);\r\n\r\n}",
"function generate_label_xml($tid, $currenttemplate, $coun_lang_id, $findline='')\n {\n $arguments = array($tid,$currenttemplate,$coun_lang_id);\n $this->debug_obj->WriteDebug($class=\"TemplateFunctions.class\", $function=\"generate_label_xml\", $file=$findline['file'], $this->debug_obj->FindFunctionCalledline('generate_label_xml', $findline['file'], $findline['line']), $arguments);\n\n //Get all home captions.\n $args[\"tablename\"]=\"tbl_template_captions\";\n $args[\"whereCon\"]='p1te_id ='.$tid.' and p1tc_type = 1 and p1colg_id = '.$coun_lang_id.' order by p1tc_id asc';\n $debug = array('file'=>'templatefunctions.class.php', 'line'=>'gethomelabels');\n $homeallcaptions = $this->templates_obj->get_all($args,$debug);/*gethomelabels*/\n\n //Get all mobile captions\n $args1[\"tablename\"]=\"tbl_template_captions\";\n $args1[\"whereCon\"]='p1te_id ='.$tid.' and p1tc_type = 2 and p1colg_id = '.$coun_lang_id.' order by p1tc_id asc';\n $debug = array('file'=>'templatefunctions.class.php', 'line'=>'getmobilelabels');\n $moballcaptions = $this->templates_obj->get_all($args1,$debug);/*getmobilelabels*/\n\n //Get all anyphone captions\n $args1[\"tablename\"]=\"tbl_template_captions\";\n $args1[\"whereCon\"]='p1te_id ='.$tid.' and p1tc_type = 3 and p1colg_id = '.$coun_lang_id.' order by p1tc_id asc';\n $debug = array('file'=>'templatefunctions.class.php', 'line'=>'getanyphonelabels');\n $anyphonecaptions = $this->templates_obj->get_all($args1,$debug);/*getanyphonelabels*/\n\n $dom = new DOMDocument(\"1.0\");//Coding for xml file creation\n $dom->encoding = \"utf-8\";\n $gendetails = $dom->createComment('Generated by PaymentOne.com');// Create a comment\n $dom->appendChild($gendetails);\n //$tempdetails = $dom->createComment('label details for '.$currenttemplate->get_Name().' template');\n $tempdetails = $dom->createComment('label details for PaymentOne Template');\n $dom->appendChild($tempdetails);\n\n $root1 = $dom->createElement(\"PaymentOne\");\n $attrb = $dom->createAttribute(\"country_code\");// create country node\n $root1->appendChild($attrb);\n $value = $dom->createTextNode($_SESSION['temp_country_code']);\n $attrb->appendChild($value);\n $attrb = $dom->createAttribute(\"language_code\");// create language node\n $root1->appendChild($attrb);\n $value = $dom->createTextNode($_SESSION['temp_language_code']);\n $attrb->appendChild($value);\n $dom->appendChild($root1);\n $dom->formatOutput=true;\n\n $root = $dom->createElement(\"Home\");\n $dom->appendChild($root);\n $dom->formatOutput=true;\n $root1->appendChild( $root );\n foreach( $homeallcaptions as $hlabels ) {\n $name = $dom->createElement( \"homelabel\" );\n $attrb = $dom->createAttribute(\"for\");// create attribute node\n $name->appendChild($attrb);\n $value = $dom->createTextNode($hlabels['p1tc_title']);// create attribute value node\n $attrb->appendChild($value);\n $name->appendChild(\n $dom->createTextNode( $hlabels['p1tc_value'] )\n );\n $root->appendChild( $name );\n }\n\n $root = $dom->createElement(\"Mobile\");\n $dom->appendChild($root);\n $dom->formatOutput=true;\n $root1->appendChild( $root );\n foreach( $moballcaptions as $mlabels ) {\n $name = $dom->createElement( \"mobilelabel\" );\n $attrb = $dom->createAttribute(\"for\");// create attribute node\n $name->appendChild($attrb);\n $value = $dom->createTextNode($mlabels['p1tc_title']);// create attribute value node\n $attrb->appendChild($value);\n $name->appendChild(\n $dom->createTextNode( $mlabels['p1tc_value'] )\n );\n $root->appendChild( $name );\n }\n\n $root = $dom->createElement(\"Anyphone\");\n $dom->appendChild($root);\n $dom->formatOutput=true;\n $root1->appendChild( $root );\n foreach( $anyphonecaptions as $anylabels ) {\n $name = $dom->createElement( \"anyphonelabel\" );\n $attrb = $dom->createAttribute(\"for\");// create attribute node\n $name->appendChild($attrb);\n $value = $dom->createTextNode($anylabels['p1tc_title']);// create attribute value node\n $attrb->appendChild($value);\n $name->appendChild(\n $dom->createTextNode( $anylabels['p1tc_value'] )\n );\n $root->appendChild( $name );\n }\n\n $filename = \"../data/xml/templates/template_\".$tid.\"/\";\n $country_path = $filename.$_SESSION['temp_country_code'].\"/\";\n $template_path = $country_path.'labels_'.$_SESSION['temp_language_code'].'.xml';\n if(file_exists($country_path)) {\n chmod($country_path, 0777);\n if(file_exists($template_path)){\n $dom->save($template_path);// save tree to file\n chmod($template_path, 0777);\n }\n else {\n fopen($template_path, \"w\");\n chmod($template_path, 0777);\n $dom->save($template_path);// save tree to file\n chmod($template_path, 0777);\n }\n }\n else {\n mkdir($country_path, 0777);\n chmod($country_path, 0777);\n fopen($template_path, \"w\");\n chmod($template_path, 0777);\n $dom->save($template_path);// save tree to file\n chmod($template_path, 0777);\n }\n }",
"function generate_arg($xw, $type, $arg, $attr)\n{\n // <arg1\n xmlwriter_start_element($xw, $arg);\n\n //type=\"label\">\n xmlwriter_start_attribute($xw, 'type');\n xmlwriter_text($xw, $type);\n xmlwriter_end_attribute($xw);\n\n // >end< //text\n xmlwriter_text($xw, $attr);\n\n // </arg1>\n xmlwriter_end_element($xw);\n}",
"function check_instruction($line, $xml_buffer, $order){\n #instructions without operands\n $zero_op = array(\"CREATEFRAME\",\"PUSHFRAME\",\"POPFRAME\",\"RETURN\",\"BREAK\");\n #operand pattern: <label>\n $one_op_label = array(\"CALL\", \"LABEL\", \"JUMP\");\n #operand pattern: <var>\n $one_op_var = array(\"DEFVAR\", \"POPS\");\n #operand pattern: <symb>\n $one_op_symb = array(\"PUSHS\", \"WRITE\", \"EXIT\", \"DPRINT\");\n #operand pattern: <var> <symb>\n $two_op_symb = array(\"MOVE\",\"INT2CHAR\",\"STRLEN\",\"TYPE\", \"NOT\");\n #\n #DONT FORGET READ <var> <type>\n #\n #operand pattern: <var> <symb1> <symb2>\n $three_op_var = array(\"ADD\",\"SUB\",\"MUL\",\"IDIV\",\"LT\",\"GT\",\"EQ\",\"AND\",\"OR\",\"STRI2INT\",\"CONCAT\",\"GETCHAR\",\"SETCHAR\");\n #operand pattern: <label> <symb1> <symb2>\n $three_op_symb = array(\"JUMPIFEQ\", \"JUMPIFNEQ\");\n\n #seperate input line to words\n $instruction = explode(\" \", $line);\n #handle instruction case insensitivity\n $instruction[0] = strtoupper($instruction[0]);\n\n #write XML instruction\n $xml_buffer -> startElement('instruction');\n $xml_buffer -> writeAttribute('order', $order);\n $xml_buffer -> writeAttribute('opcode', $instruction[0]);\n\n #finds loaded instruction in instruction arrays, checks operands and writes XML\n if(in_array($instruction[0], $zero_op)){\n #check operand count\n params_count_check($instruction, 0);\n }\n else if(in_array($instruction[0], $one_op_label)){\n #check operand count\n params_count_check($instruction, 1);\n #checks operand validity\n check_label($instruction[1]);\n #writes operand to XML\n writeOperandElement('label', 1, $instruction[1], $xml_buffer);\n }\n else if(in_array($instruction[0], $one_op_var)){\n #check operand count\n params_count_check($instruction, 1);\n #checks operand validity\n check_var($instruction[1]);\n #writes operand to XML\n writeOperandElement('var', 1, $instruction[1], $xml_buffer);\n }\n else if(in_array($instruction[0], $one_op_symb)){\n #check operand count\n params_count_check($instruction, 1);\n #checks symbol validity and writes XML\n check_symb_and_generate(1, $instruction[1], $xml_buffer);\n }\n else if(in_array($instruction[0], $two_op_symb)){\n #check operand count\n params_count_check($instruction, 2);\n #checks operand validity\n check_var($instruction[1]);\n #writes operand to XML\n writeOperandElement('var', 1, $instruction[1], $xml_buffer);\n #checks symbol validity and writes XML\n check_symb_and_generate(2, $instruction[2], $xml_buffer);\n }\n else if ($instruction[0] == \"READ\"){\n #check operand count\n params_count_check($instruction, 2);\n #checks operand validity\n check_var($instruction[1]);\n writeOperandElement('var', 1, $instruction[1], $xml_buffer);\n #checks operand validity\n check_type($instruction[2]);\n #writes operand to XML\n writeOperandElement('type', 2, $instruction[2], $xml_buffer);\n }\n else if(in_array($instruction[0], $three_op_var)){\n #check operand count\n params_count_check($instruction, 3);\n #checks operand validity\n check_var($instruction[1]);\n #writes operand to XML\n writeOperandElement('var', 1, $instruction[1], $xml_buffer);\n #checks symbol validity and writes XML\n check_symb_and_generate(2, $instruction[2], $xml_buffer);\n check_symb_and_generate(3, $instruction[3], $xml_buffer);\n }\n else if(in_array($instruction[0], $three_op_symb)){\n #check operand count\n params_count_check($instruction, 3);\n #checks operand validity\n check_label($instruction[1]);\n #writes operand to XML\n writeOperandElement('label', 1, $instruction[1], $xml_buffer);\n #checks symbol validity and writes XML\n check_symb_and_generate(2, $instruction[2], $xml_buffer);\n check_symb_and_generate(3, $instruction[3], $xml_buffer);\n }\n #instuction not found in arrays, error\n else{\n message_die(\"ERROR: Syntax error: Unknown instruction.\", 22);\n }\n\n #write XML end instruction\n $xml_buffer -> endElement();\n}",
"private function add_labels(&$store,&$descriptors,$lang_out='')\n\t {\n\t \tif ($this->getSrcDebug()) \n\t\t{\n\t\t\tprint \"<hr>add_labels called with lang_out=$lang_out and with descriptors: <br>\"; var_dump($descriptors);\n\t\t}\n\t\t\n\t\t \t$labels=$new_descriptors=array();\n\t \t\tforeach($descriptors as $desc)\n\t\t\t{\n\t \t\n\t\t\t$QUERY=<<<EOQ\n\tprefix gnd2: <http://d-nb.info/standards/elementset/gnd#>\n\tselect ?x\n\t{\n\t\t{\n\t\t\t<$desc> gnd2:preferredNameForTheCorporateBody ?x .\n\t\t}\n\t\tUNION\n\t\t{\n\t\t\t<$desc> gnd2:variantNameForTheCorporateBody ?x .\n\t\t}\n\t}\nEOQ;\n\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\tprint \"<br><br>add_labels QUERY: <br>\".str_replace(\"\\n\",\"<br>\",htmlentities($QUERY));\n\t\t\t\t\n\n\t\t\t\tif (($rows = $store->query($QUERY, 'rows'))) \n\t\t\t\t{\n\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t{\n\t\t\t\t\t\tprint \"<br>add_labels ($desc) ROWS: <br>\"; var_dump($rows);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$candidate_label_lang='';\n\t\t\t\t\tforeach($rows as $row) \t\n\t\t\t\t\t{\n\t\t\t\t\t\t$candidate_label=$this->cleanupLabel($row['x']); // YES WE MUST DO IT HERE SO: GND CACHES <expressions> in labels\n\t\t\t\t\t\tif ($lang_out) $candidate_label_lang = detect_language($candidate_label);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($lang_out)\n\t\t\t\t\t\t\t{ //Check lang info in data:\n\t\t\t\t\t\t\t\tif (!$row['x lang']) print \"<br>!!!! NO LANG INFO for \".$candidate_label;\n\t\t\t\t\t\t\t\tprint \"<br> Lang=\".$row['x lang'].\" for \".$candidate_label.\" (lang_out=$lang_out)\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprint \"<br>label($desc) = \".$candidate_label; //FRI: Pickup concept descr for survista call\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//In case a lang-out is set\n\t\t\t\t\t\t//compute language and see if it coresponds\n\t\t\t\t\t\tif ($lang_out=='' || ($candidate_label_lang==$lang_out))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($candidate_label)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$labels[]= $candidate_label;\n\t\t\t\t\t\t\t\t$new_descriptors[]=$desc;\n\t\t\t\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\t\t\tprint \" TAKE LABEL! \";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\t\t\tprint \" SKIP LABEL! \";\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} // foreach ($rows)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\tprint \"<br>add_labels ($desc) NO LABLES ROWS !!! \";\n\t\t\t\t}\n\t\t\t} // foreach($descriptors as $desc)\n\t\t\t\n\t\t\t//Return aligned pair ov vectors:\n\t\t\treturn array($new_descriptors,$labels);\t \t\t\t\n\t \t\t\n\t }",
"function generate_xml($token_array, $xml, $xml_program_node)\n{\n // Generate instruction in format <instruction order=\"$ORDER\" opcode=\"$OPCODE\"></instruction>\n $xml_instruction = $xml_program_node->appendChild($xml->createElement(\"instruction\"));\n $xml_instruction->setAttribute(\"order\", ++$GLOBALS['instruction_order']);\n $xml_instruction->setAttribute(\"opcode\", $token_array[0]->data);\n\n // Generate arguments in format <arg$NUMBER type=\"$TYPE\">$DATA</arg$NUMBER>\n foreach($token_array as $key => $value)\n {\n // Loop through token array without first index (OPCODE)\n if($key < 1)\n {\n continue;\n }\n\n // Constant must be split by '@' into type (left from '@') and value (right from '@')\n // htmlspecialchars() is used for converting problematic chars as &, <, >, \", ' into &, <, >, ", '\n if($value->type == \"const\")\n {\n $parts = preg_split(\"/@/\", $value->data, 2);\n $xml_argument = $xml_instruction->appendChild($xml->createElement(\"arg$key\", htmlspecialchars($parts[1], ENT_QUOTES, 'UTF-8')));\n $xml_argument->setAttribute(\"type\", $parts[0]);\n }\n else\n {\n $xml_argument = $xml_instruction->appendChild($xml->createElement(\"arg$key\", htmlspecialchars($value->data)));\n $xml_argument->setAttribute(\"type\", $value->type);\n }\n }\n}",
"function getLabelXML() \n {\n $xmlList = new XMLObject(RowManager_MultilingualLabelManager::XML_NODE_NAME );\n \n $labelKey = RowManager_MultilingualLabelManager::XML_ELEMENT_NAME;\n \n foreach( $this->labels as $key=>$value) {\n \n $label = $this->getLabel($key, $this->languageID);\n $xmlList->addElement($labelKey, $label, array('key'=>$key) );\n }\n\n//echo $xmlList->getXML();\n return $xmlList->getXML();\n }",
"function twoArgsXML($opcode, $type1, $type2, $arg1, $arg2) {\n global $xml, $program, $instruction, $instrCnt;\n // new instruction\n $instruction = $xml->createElement(\"instruction\");\n $instruction->setAttribute(\"order\", $instrCnt);\n $instruction->setAttribute(\"opcode\", $opcode);\n $arg1XML = $xml->createElement(\"arg1\", $arg1);\n $arg2XML = $xml->createElement(\"arg2\", $arg2);\n $arg1XML->setAttribute(\"type\", $type1);\n $arg2XML->setAttribute(\"type\", $type2);\n // append instruction and argument to XML\n $program->appendChild($instruction); \n $instruction->appendChild($arg1XML);\n $instruction->appendChild($arg2XML);\n $instrCnt++;\n}",
"function zeroArgXML($opcode) {\n global $xml, $program, $instruction, $instrCnt;\n // new instruction\n $instruction = $xml->createElement(\"instruction\");\n $instruction->setAttribute(\"order\", $instrCnt);\n $instruction->setAttribute(\"opcode\", $opcode);\n // append instruction to XML\n $program->appendChild($instruction);\n $instrCnt++;\n}",
"function processLine($instruction, $arguments)\r\n{\r\n global $root, $order, $labels, $jumpCount, $labels, $jumpInstructions, $xmlOut, $instructionList;\r\n\r\n if (!array_key_exists($instruction, $instructionList)) {\r\n fprintf(STDERR, \"$order: LEX ERROR in name of instruction\\n\");\r\n exit(22);\r\n }\r\n\r\n if (count($instructionList[$instruction]) != (count($arguments))) {\r\n fprintf(STDERR, \"$order: $instruction , missmatch in number of arguments\\n\");\r\n exit(23);\r\n }\r\n\r\n if ($instruction === \"LABEL\")\r\n if (count($arguments) > 0)\r\n $labels[$arguments[0]] = $order;\r\n\r\n if (preg_match('/^CALL$|^RETURN$|^JUMP$|^JUMPIFEQ$|^JUMPIFNEQ$/', $instruction)) {\r\n $jumpCount++;\r\n if (count($arguments) > 0) {\r\n $jumpInstructions[$order] = [$instruction, $arguments[0]];\r\n }\r\n }\r\n\r\n $inst = $xmlOut->createElement('instruction');\r\n $inst->setAttribute(\"order\", $order++);\r\n $inst->setAttribute(\"opcode\", $instruction);\r\n for ($j = 0; $j < count($arguments); $j++) {\r\n [$type, $value] = parseArgument($arguments[$j], $instructionList[$instruction][$j]);\r\n $arg = $xmlOut->createElement('arg' . ($j + 1), $value);\r\n $arg->setAttribute(\"type\", $type);\r\n $inst->appendChild($arg);\r\n }\r\n $root->appendChild($inst);\r\n}",
"function code_labels($v, $tb, $otb){\n\t$v0 = $v;\n\t$v = varlist_ereg4(kontrolliere($v, 1), $tb);\t\n\t$fe = explode(\",\", $v);\n\t$t = $tb.\"_tmp\";\n\tmyq(\"drop table if exists $t\"); myq(\"create table $t (l text) type myisam\");\n\tfor ($i = 0; $i < count($fe); ++$i){\n\t\t$n = $fe[$i];\n\t\tmyq(\"insert into $t select $n from $tb group by $n\", 0);\n\t}\n\tmyq(\"drop table if exists $otb\");\n\tmyq(\"create table if not exists $otb (l text, n int, c int) type myisam\");\n\t$rs = mysql_query(\"select l, count(l) from $t where l <> '' group by l\");\t\n\t$z = 1000;\t\n\twhile($row = mysql_fetch_row($rs)){\n\t\t$r0 = $row[0]; $r1 = $row[1];\t\n\t\t$a = recwert(\"select l from $otb where l = '$r0' limit 1\");\n\t\tif ($a == \"\") {\n\t\t\t++$z;\n\t\t\tmyq(\"insert into $otb (l, n, c) values ('$r0', $r1, $z)\"); \n\t\t\trecode3($v0, $tb, array(\"'$r0'=$z\"));\n\t\t}\n\t}\n\tmyq(\"drop table $t\");\t\n}",
"function gd_generate_custom_xml($custom_xml_structure, $g_template, $num_rows)\n{\n global $LANG;\n\n $xml = \"\";\n\n // first, add the chunk of markup between the records tag. Note the \"is\" bit. That tells\n // the regexp parser to let . match newline characters and that it should be case\n // insensitive\n preg_match(\"/(.*)\\{records\\}(.*)\\{\\/records\\}(.*)/is\", $custom_xml_structure, $matches);\n\n if (count($matches) < 2)\n {\n \techo \"<error>{$LANG[\"invalid_custom_xml\"]}</error>\";\n \treturn;\n }\n\n $xml_start = $matches[1];\n $row_markup = $matches[2];\n $xml_end = $matches[3];\n\n // now loop through the {records} and replace the appropriate placeholders with their rows\n $xml_rows = \"\";\n for ($row=1; $row<=$num_rows; $row++)\n {\n $placeholders = array();\n while (list($order, $data_types) = each($g_template))\n {\n foreach ($data_types as $data_type)\n {\n $order = $data_type[\"column_num\"];\n $data_type_folder = $data_type[\"data_type_folder\"];\n $data_type_func = \"{$data_type_folder}_generate_item\";\n $data_type[\"random_data\"] = $data_type_func($row, $data_type[\"options\"], $row_data);\n\n if (is_array($data_type[\"random_data\"]))\n $placeholders[\"ROW{$order}\"] = $data_type[\"random_data\"][\"display\"];\n else\n $placeholders[\"ROW{$order}\"] = $data_type[\"random_data\"];\n }\n }\n reset($g_template);\n\n $row_markup_copy = $row_markup;\n while (list($placeholder, $value) = each($placeholders))\n {\n $row_markup_copy = preg_replace(\"/\\{$placeholder\\}/\", $value, $row_markup_copy);\n }\n\n $xml_rows .= $row_markup_copy;\n }\n\n $final_xml = $xml_start . $xml_rows . $xml_end;\n\n return $final_xml;\n}",
"protected abstract function externalLabels();",
"public function printXML(){\n echo \"\\t<instruction order=\\\"$this->order\\\" opcode=\\\"$this->opcode\\\">\\n\";\n for($i = 0; $i < $this->argCount; $i++){\n $index = $i + 1;\n echo \"\\t\\t<arg$index type=\\\"{$this->argType[$i]}\\\">{$this->args[$i]}</arg$index>\\n\";\n }\n echo \"\\t</instruction>\\n\";\n }",
"function createFPGAConfigurationXML($arrayForFPGAdeviceModelid,$storingLocation,$simNum){\r\n\r\n\t//$FinalSortedNeuronsFPGAArray = unserialize(file_get_contents(\"SimulationXML/\".$userLogged . \"/FinalSortedNeuronsFPGAArray_\" . $userID . \".bin\"));\r\n\r\n\t//Once, we have the array with FPGA number and model id, we can generate packet to program the FPGA\r\n\t$data = new DOMDocument;\r\n\t$data ->formatOutput = true;\r\n\t$dom=$data->createElement(\"sUploadSof\");\r\n\r\n\r\n\r\n\tfor ($i=0; $i < count($arrayForFPGAdeviceModelid) ; $i++) { \r\n\t\t# code...\r\n\t\t$packet=$data->createElement(\"packet\");\r\n\t\t$destdev=$data->createElement(\"destdevice\",65535); //Destined for IM \r\n\t\t$packet->appendChild($destdev);\r\n\t\t$sourcedev=$data->createElement(\"sourcedevice\",65532); // Needs to specify the source; is the NC??\r\n\t\t$packet->appendChild($sourcedev);\r\n\t\t$simID = $data->createElement(\"simID\", $simNum);\r\n\t\t$packet->appendChild($simID);\r\n\t\t$command=$data->createElement(\"command\",30);\r\n\t\t$packet->appendChild($command);\r\n\t\t$timestamp=$data->createElement(\"timestamp\",0);\r\n\t\t$packet->appendChild($timestamp);\r\n\t\t$targetfpga=$data->createElement(\"targetfpga\",$arrayForFPGAdeviceModelid[$i][0]); //select the FPGA id\r\n\t\t$packet->appendChild($targetfpga);\r\n\r\n\t\t//lets get url and filename for the model\r\n\r\n\t\techo \"<br>----------------MODEL ID----------->\".$arrayForFPGAdeviceModelid[$i][1].\"<br>\";\r\n\t\techo \"<br>----------------Filename------------>\".getModelURLandFilenameForFPGA($arrayForFPGAdeviceModelid[$i][1]).\"<br>\";\r\n\t\techo \"<br>----------------Location------------>\".getModelURLandFilenameForFPGA($arrayForFPGAdeviceModelid[$i][0]).\"<br>\";\r\n\r\n\t\t$arrayStoringUrlFilename = getModelURLandFilenameForFPGA($arrayForFPGAdeviceModelid[$i][1]); // since, model id is stored at second index i.e.1\r\n\t\t//the function returns an array of two elements, [0] = location url, [1] = filename\r\n\r\n\t\t$filename=$data->createElement(\"filename\",$arrayStoringUrlFilename[1]);\t//stores filename for model assigned for this particular FPGA\r\n\t\t$packet->appendChild($filename);\r\n\t\t$url=$data->createElement(\"url\",$arrayStoringUrlFilename[0]); // Same logic as earlier part\r\n\t\t$packet->appendChild($url);\r\n\r\n\t\t$dom->appendChild($packet);\r\n\t}\r\n\t$data->appendChild($dom);\r\n\t$data->save($storingLocation);\r\n}",
"protected function buildXML() {\n\t\t$stype = $this->getType($this->src);\n\t\t$this->xml = '<'.'?xml version=\"1.0\"?'\n\t\t\t.\">\\n\".'<!DOCTYPE xmltl PUBLIC \"-//NRR//XMLTL//EN\"'\n\t\t\t.' \"http://rushmoreradio.net/public/xmltl.dtd\">'\n\t\t\t.\"\\n\".'<xmltl bt=\"'.$stype.'\">';\n\t\tif($stype == 'a') {\n\t\t\tforeach($this->src as $v) {\n\t\t\t\t$this->xml .= $this->getTag($v);\n\t\t\t}\n\t\t}\n\t\telse if($stype == 'h') {\n\t\t\tforeach($this->src as $k => $v) {\n\t\t\t\t$this->xml .= $this->getTag($v, $k);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->xml .= $this->getTagData($this->src);\n\t\t}\n\t\t$this->xml .= \"\\n</xmltl>\";\n\t}",
"function printLabel() {\n /**\n * <PAGE></PAGE>:\n * Pagination, used to support the printing of multiple different label pages (up to 10 sheets), not using this label means that all elements are only printed on one label page\n *\n * <SIZE>width,height</SIZE>:\n * Set label paper width and height, width label paper width (excluding backing paper), height label paper height (excluding backing paper), unit mm, such as<SIZE>40,30</SIZE>\n *\n * <TEXT x=\"10\" y=\"100\" w=\"1\" h=\"2\" r=\"0\">Text content</TEXT>:\n * Print the text, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the text width magnification ratio 1-10 (default is 1)\n * Attribute h is text height magnification 1-10 (default is 1)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC128 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC128>:\n * Print code128 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 1)\n * The attribute r is the text rotation angle (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC39 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC39>:\n * Print code39 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 2)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <QR x=\"20\" y=\"20\" w=\"160\" e=\"H\">QR code content</QR>:\n * Print the QR code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the width of the QR code (default is 160)\n * Attribute e is the error correction level: L 7% M 15% Q 25% H 30% (the default is H)\n * The label content is a QR code value, and the maximum cannot exceed 256 characters\n * Note: A single order can only print one QR code\n */\n\n //Set size of label paper\n$printContent= <<<EOF\n<SIZE>40,30</SIZE>\nEOF;\n\n \n //print the first label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"1/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Golden Fried Rice\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ;\n\n //print the second label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"2/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Cucumber salad\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print the third label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"3/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Boston Lobster\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print a barcode\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a barcode: \"\n .\"</TEXT>\"\n .\"<BC128 x=\\\"16\\\" y=\\\"32\\\" h=\\\"32\\\" s=\\\"1\\\" n=\\\"2\\\" w=\\\"2\\\" r=\\\"0\\\">\"\n .\"12345678\"\n .\"</BC128>\"\n .\"</PAGE>\"\n ; \n\n //print a QR code. The minimum width is 128, it will not be able to be scanned if lower than 128\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a QR code: \"\n .\"</TEXT>\"\n .\"<QR x=\\\"16\\\" y=\\\"32\\\" w=\\\"128\\\">\"\n .\"https://www.xpyun.net\"\n .\"</QR>\"\n .\"</PAGE>\"\n ; \n\n $request = new PrintRequest();\n $request->generateSign();\n\n //*Required*: The serial number of the printer\n $request->sn=OK_PRINTER_SN;\n\n //*Required*: The content to be printed can’t exceed 12288 bytes.\n $request->content=$printContent;\n\n //The number of printed copies is 1 by default.\n $request->copies=1;\n\n $result = xpYunPrintLabel($request);\n print $result->content->code.\"\\n\";\n print $result->content->msg.\"\\n\";\n\n //resp.data: Return to order No. correctly \n print $result->content->data.\"\\n\";\t\n}",
"function write_xml_header($xw){\r\n xmlwriter_set_indent($xw, 1);\r\n xmlwriter_set_indent_string($xw, ' ');\r\n xmlwriter_start_document($xw, '1.0', 'UTF-8');\r\n\r\n xmlwriter_start_element($xw, 'program');\r\n xmlwriter_start_attribute($xw,'language');\r\n xmlwriter_text($xw, 'IPPcode20');\r\n xmlwriter_end_attribute($xw);\r\n\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the num uniq. | public function getNumUniq() {
return $this->numUniq;
} | [
"public function getNumUniqEcr() {\n return $this->numUniqEcr;\n }",
"public function getNumUniq(): ?int {\n return $this->numUniq;\n }",
"public function getUniqNumber($key = null) {\n // generate uniq number\n $uniqNumber = crc32(rand());\n\n echo PHP_EOL . \"* generate class <i>\" . get_class($this) . \"</i> some uniq number: \" . $uniqNumber;\n\n return $uniqNumber;\n }",
"public function getNumUniqEcr(): ?int {\n return $this->numUniqEcr;\n }",
"public function getBudgetNumUniq() {\n return $this->budgetNumUniq;\n }",
"function genNumbers(){\r\n\r\n\r\n\r\n$num1 = mt_rand(1,500);\r\n$num2 = mt_rand(1,500);\r\n$num3 = mt_rand(1,500);\r\n$num4 = mt_rand(1,500);\r\n$num5 = mt_rand(1,500);\r\n\r\n\t$numSet=[$num1, $num2, $num3, $num4, $num5];\r\n\t$GLOBALS['unique'] = $unique = array_unique($numSet);\r\n\r\n\t//print_r($unique);\r\n\treturn $unique;\r\n\tunset($numSet);\r\n}",
"function count_num()\n {\n return 1;\n }",
"public function getUniqId() {\n return $this->uniqId;\n }",
"function unique() {\n\t return uniqid();\n\t}",
"function getSameNum($num){\n global $dbconn;\n // ---- Get sql query\n $sql = \" SELECT count(feedback_num) FROM $this->tablename where 1 = 1 and feedback_num = \".$num.\" order by feedback_id desc limit 1\";\n // ---- Execute SQL\n $result = $dbconn->Execute($sql);\n\t\treturn $result->fields[0];\n }",
"function getUnique()\n\t{\n\t\treturn $this->unique;\n\t}",
"function getSameNum($num){\n global $dbconn;\n // ---- Get sql query\n $sql = \" SELECT count(docreply_num) FROM $this->tablename where 1 = 1 and docreply_num = \".$num.\" order by docreply_id desc limit 1\";\n // ---- Execute SQL\n $result = $dbconn->Execute($sql);\n\t\treturn $result->fields[0];\n }",
"public static function getUniqId()\n\t{\n\t\t// NOTE: Casting to int will overflow on 32-bit PHP (for Windows) without giving 19-digit value\n\t\treturn sprintf('%.0f%03d', 10000000*microtime(true), mt_rand(1, 999));\n\t}",
"public function getNum()\r\n {\r\n return $this->num;\r\n }",
"public function testSetNumUniq() {\n\n $obj = new RepertoireCol();\n\n $obj->setNumUniq(10);\n $this->assertEquals(10, $obj->getNumUniq());\n }",
"protected function uniqueTicketNo()\r\n {\r\n $number = str_pad(mt_rand(1, 999) . substr(time(), -6) . mt_rand(1, 999), 12, mt_rand(1, 99999), STR_PAD_BOTH);\r\n\r\n if (BookingTickets::where('ticket_no', $number)->first())\r\n return $this->uniqueTicketNo();\r\n\r\n return $number;\r\n }",
"public function get_duplicate_count() {\n return null;\n }",
"public function generate_uniqid_numeric(){\n $salt = $this->numeric_randomizer();\n $data = (($this->abs)?abs(crc32(uniqid($salt))):crc32(uniqid($salt)));\n $pad = (10 - strlen($data));\n if($pad > 0){\n $leading = \"\";\n for ($i=1;$i<=$pad;$i++){\n $leading .= '0';\n }\n return $this->prefix.str_replace('-','00',str_pad($data, 10, $leading, STR_PAD_LEFT)).$this->suffix;\n }\n return $this->prefix.str_replace('-','0',$data).$this->suffix;\n }",
"public function getUniqueSize(){\n\t\t//Return the count of the array when done\n\t\treturn count($this->uniqueTags);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes a job from the job scheduler | function remove( $name ) {
$this->modify_job($name,'remove');
return !$this->error();
} | [
"function job_queue_remove($id_job){\n\tinclude_spip('inc/queue');\n\treturn queue_remove_job($id_job);\n}",
"public function remove() {\n if(isset($this->job_number)) {\n Wrapper::removeJob((int)$this->job_number);\n }\n }",
"public function deleteJob(Enlight_Components_Cron_Job $job);",
"public function delete()\n {\n $this->job->delete();\n }",
"public function delete()\n {\n parent::delete();\n\n $this->job->delete();\n\n // $this->database->deleteReserved($this->queue, $this->getJobId());\n }",
"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 }",
"public function removeMe()\n {\n return $this->striveJobs->removeJobs( ( array ) $this->jobId );\n }",
"public function remove($job)\n {\n $this->adapter->lock($job);\n\n try {\n $this->adapter->delete($job);\n } finally {\n $this->adapter->unlock($job);\n }\n }",
"public function delete()\r\r\n {\r\r\n parent::delete();\r\r\n $this->queueInstance->deleteReserved($this->queue, $this->job);\r\r\n }",
"public function deletePendingJobs(){\n\t\tMage::getModel('customweb_subscription/schedule')->getResource()->deleteBySubscription($this->getSubscription()->getId());\n\t}",
"function CRON_rmJob($identifier)\n{\n\tSERVER_delLineFromFile(\"/etc/crontab\",$identifier);\n\tCRON_reloadConfig();\n}",
"function remove($job = false)\n {\n $this->_reset();\n\n if (!$job) {\n return $this->raiseError('No job specified');\n }\n\n $queue = $this->show();\n\n if (!isset($queue[$job]) ) {\n return $this->raiseError('Job ' . $job . ' does not exist');\n }\n\n $exec = sprintf(\"%s -d %s\",\n $this->AT_PROG,\n $job\n );\n\n $this->_doexec($exec);\n\n /* this is required since the shell command doesn't return anything on success */\n\n $queue = $this->show();\n return !isset($queue[$job]);\n\n }",
"public function delete()\n {\n parent::delete();\n Log::info(\"Delete Job[{$this->getJobId()}]\");\n $my_queue = $this->client->get_queue($this->queue);\n $my_queue->delete_message($this->job->receiptHandle);\n Log::info(\"Delete Job[{$this->getJobId()}] success\");\n }",
"function nmu_queue_delete_job($job_id) {\n\tglobal $wpdb;\n\n\t$table = NMU_QUEUE_JOBS_TABLE;\n\t$sql = \"delete from {$table} where job_id = %d\";\n\t$result = $wpdb->query($wpdb->prepare($sql, $job_id));\n\n\tif ($result === 1) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function deleteJob($filename);",
"public static function unschedule_job_pruning() {\n\t\twp_clear_scheduled_hook( 'jobswp_scheduled_job_pruning' );\n\t}",
"function PKG_rmNormalJob($client, $packageName, $priority = 25)\n{\n\tPKG_addStatusJob($client,\"m23normalRemove\",$priority,$packageName,\"waiting\");\n}",
"public function delete()\n {\n $this->deleted = true;\n\n $this->database->deleteReserved($this->job->getQueue(), $this->getJobId());\n }",
"function cron_drush_delete($job) {\n \\Drupal::service('cron_delete_command')->execute($job);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get cities for country and region | public function getCities($country_id, $region_id) {
if ($country_id && $region_id) {
$query = $this->db->table('cities');
$query->where('country_id', intval($country_id))
->where('region_id', intval($region_id));
$query->select("id, title_{$this->locale}, area_{$this->locale}")
->orderBy('important', 'DESC')
->orderBy("title_{$this->locale}", 'asc');
if ($items = $query->get()->getResultArray()) {
// get important cities before region
$important = $this->db
->table('cities')
->select("id, title_{$this->locale}, area_{$this->locale}")
->where('country_id', intval($country_id))
->where('important', 1)
->orderBy('id', 'ASC')
->orderBy("title_{$this->locale}", 'ASC')
->get()->getResultArray();
return $important + $items;
}
}
return false;
} | [
"public function cities()\n\t{\n\t\treturn $this->_address->city->collections($this->_address->subject->code.$this->_address->district->code);\n\t}",
"public function getCities($country)\n {\n $query = $this->getEntityManager()\n ->createQuery(\"SELECT c.id_ci, c.cityName, r.id_re, r.regionName\n FROM GeographyCitiesBundle:Cities c\n JOIN c.cityRegion r\n WHERE r.regionCountry = :country\n ORDER BY c.cityName ASC \")\n ->setParameter('country', $country); \n return $query->getResult();\n }",
"public function getCities()\n {\n if (Cache::has(self::DPD_CITIES_CACHE_NAME)) {\n $cities = collect(Cache::get(self::DPD_CITIES_CACHE_NAME));\n }\n else {\n $cities = Cache::remember(self::DPD_CITIES_CACHE_NAME, $this->client->cacheLifeTimeInMinutes, function () {\n $client = new \\SoapClient($this->client->url.\"geography2?wsdl\",\n [\n 'trace' => true,\n 'keep_alive' => false\n ]\n );\n\n $data['auth'] = $this->client->getAuthData();\n\n $request['request'] = $data; //помещаем наш масив авторизации в масив запроса request.\n $result = $client->getCitiesCashPay($request); //обращаемся к функции getCitiesCashPay и получаем список городов.\n $result = self::stdToArray($result);\n return collect($result['return']);\n });\n }\n\n return $cities;\n }",
"public function getCities($country){\n $sql = \"SELECT * FROM cities WHERE country_id = '$country'\";\n return $this->fetchAll($sql);\n }",
"public function getRegionCities()\n {\n return $this->hasMany(RegionCity::className(), ['province_id' => 'id']);\n }",
"public function getCity();",
"public static function cities()\n {\n // generate regions/cities array\n $citiesArray = array(\n '0' => 'Please select'\n );\n \n $regions = Region::with(array('cities' => function ($city) {\n $city->orderBy('name');\n }))\n ->orderBy('name')\n ->get();\n \n foreach ($regions as $region) {\n $citiesArray[$region->name] = $region->cities->lists('name', 'id');\n }\n \n return $citiesArray;\n }",
"public function allCities()\n {\n return $this->city->with(['province'])->get();\n }",
"public function get_cities_from_region($region = null) {\n\t\t$this->layout = 'ajax';\n\t\t$this->autoRender = false;\n\t\tif ($region != null) {\n\t\t\t$citiesResult = $this->Store->find('all', array('conditions' => array('Store.region'=> $region), 'group' => 'Store.city'));\n\t\t\t$cities = array();\n\t\t\tforeach($citiesResult as $c) {\n\t\t\t\t$city = $c['Store']['city'];\n\t\t\t\t$cities[$city] = $city;\n\t\t\t}\n\t\t\techo json_encode($cities);\n\t\t}\n\t}",
"public function getCountriesPerRegion();",
"function get_country_cities($country, $ordered = 'Population') {\n //$result[0] = array( 'name' => 'Zaragoza', 'district' => 'Aragon', 'population' => 768000);\n\n\t\t$result = $this->query('select * from City order by '. $ordered . ' asc');\n \n return $result; \n }",
"public function getCities($searchterm, $start, $limit, $limit_iso=array(), $limit_population=0) {\n \n if (strlen($searchterm) < 3) return array();\n \n $conn = $this->getEntityManager()->getConnection();\n \n $q = 'SELECT n.id, ga.name name, c.name cname,\n IF(ga.name IS NULL, n.name, ga.name) city_name \n FROM geo__name n\n LEFT JOIN geo__country c on (c.id = n.country_id) \n LEFT JOIN geo__alternate_names_v2 ga ON (ga.geoname_id = n.id AND ga.language = \"de\") \n WHERE (ga.name LIKE :searchterm OR n.name LIKE :searchterm) \n AND n.feature_class = \"P\" ';\n \n if (count($limit_iso) > 0) $q .= 'AND n.country_code IN (\"' . implode('\",\"', $limit_iso) . '\") '; \n \n if ($limit_population) $q .= 'AND n.population > ' . $limit_population . ' ';\n \n ' ';\n \n $q .= 'GROUP BY n.country_id, city_name \n ORDER BY n.population DESC \n LIMIT ' . $start . \", \" . $limit;\n \n \n \n $stmt = $conn->prepare($q);\n $stmt->execute(array('searchterm' => $searchterm . \"%\"));\n \n $data = $stmt->fetchAll();\n \n return $data;\n \n }",
"public function getCityList()\n {\n return Mage::getResourceModel('stores/stores')->getCityList();\n }",
"public function getCityData()\n {\n $cities = [\n ['Abbeville',31.566367,-85.251300],\n ['Adamsville',33.590411,-86.949166],\n ['Addison',34.200042,-87.177851],\n ['Akron',32.876425,-87.740978],\n ['Alabaster',33.231162,-86.823829],\n ['Albertville',34.265362,-86.211261],\n ['Alexander',32.933157,-85.936008],\n ['Alexandria',33.766072,-85.884389],\n ['Aliceville',33.126276,-88.154427],\n ['Allgood',33.904216,-86.516428],\n ['Altoona',34.029259,-86.320687],\n ['Andalusia',31.309321,-86.479468],\n ['Anderson',34.920029,-87.270358],\n ['Anniston',33.663003,-85.826664],\n ['Arab',34.327863,-86.498613],\n ['Ardmore',34.987052,-86.843228],\n ['Argo',33.700210,-86.512357],\n ['Ariton',31.598204,-85.718761],\n ['Arley',34.081499,-87.210768],\n ['Ashford',31.184032,-85.235286],\n ['Ashland',33.272206,-85.836925],\n ['Ashville',33.843737,-86.266274],\n ['Athens',34.789602,-86.969424],\n ['Atmore',31.023183,-87.492067],\n ['Attalla',34.009818,-86.098413],\n ['Auburn',32.597684,-85.480823],\n ['Autaugaville',32.432410,-86.653370],\n ['Avon',31.189409,-85.279156],\n ['Babbie',31.300460,-86.319293],\n ['Baileyton',34.267139,-86.603018],\n ['Banks',31.813464,-85.840281],\n ['Bay Minette',30.883446,-87.777183],\n ['Bayou La Batre',30.403253,-88.248117],\n ['Bear Creek',34.272400,-87.703374],\n ['Beatrice',31.733178,-87.206773],\n ['Beaverton',33.932813,-88.020374],\n ['Belk',33.645856,-87.930934],\n ['Benton',32.306248,-86.817551],\n ['Berry',33.657836,-87.606084],\n ['Bessemer',33.391343,-86.956569],\n ['Billingsley',32.660416,-86.711247],\n ['Birmingham',33.524755,-86.812740],\n ['Black',31.011112,-85.744365],\n ['Blountsville',34.081911,-86.588778],\n ['Blue Mountain',33.688619,-85.837577],\n ['Blue Ridge',32.486744,-86.190823],\n ['Blue Springs',31.664330,-85.495919],\n ['Boaz',34.202793,-86.160457],\n ['Boligee',32.763768,-88.025968],\n ['Bon Air',33.263798,-86.333650],\n ['Branchville',33.648029,-86.436895],\n ['Brantley',31.584365,-86.256651],\n ['Brent',32.940240,-87.174982],\n ['Brewton',31.117706,-87.071164],\n ['Bridgeport',34.947303,-85.718966],\n ['Brighton',33.438958,-86.945442],\n ['Brilliant',34.022764,-87.767372],\n ['Brookside',33.631867,-86.913068],\n ['Brookwood',33.239110,-87.319746],\n ['Brundidge',31.719218,-85.818119],\n ['Butler',32.091526,-88.220684],\n ['Bynum',33.605985,-85.963308],\n ['Cahaba Heights',33.459256,-86.732086],\n ['Calera',33.107572,-86.749964],\n ['Camden',31.998851,-87.295743],\n ['Camp Hill',32.799285,-85.652902],\n ['Carbon Hill',33.890690,-87.524307],\n ['Cardiff',33.645384,-86.932965],\n ['Carolina',31.231521,-86.520607],\n ['Carrollton',33.260858,-88.094452],\n ['Castleberry',31.297899,-87.025027],\n ['Cedar Bluff',34.220606,-85.595999],\n ['Center Point',33.639302,-86.680437],\n ['Centre',34.159181,-85.674742],\n ['Centreville',32.950000,-87.134708],\n ['Chalkville',33.667902,-86.649643],\n ['Chatom',31.461656,-88.248051],\n ['Chelsea',33.329116,-86.650845],\n ['Cherokee',34.758297,-87.968549],\n ['Chickasaw',30.764987,-88.083713],\n ['Childersburg',33.275187,-86.353166],\n ['Citronelle',31.092653,-88.244315],\n ['Clanton',32.839810,-86.628188],\n ['Clay',33.700037,-86.623032],\n ['Clayhatchee',31.237743,-85.712679],\n ['Clayton',31.877504,-85.449024],\n ['Cleveland',33.992035,-86.576062],\n ['Clio',31.709922,-85.606708],\n ['Coaling',33.169442,-87.345859],\n ['Coffee Springs',31.166736,-85.910634],\n ['Coffeeville',31.761262,-88.089150],\n ['Coker',33.246283,-87.679221],\n ['Collinsville',34.265432,-85.861523],\n ['Colony',33.945011,-86.899465],\n ['Columbia',31.292283,-85.112123],\n ['Columbiana',33.183545,-86.609365],\n ['Concord',33.469092,-87.038163],\n ['Coosada',32.504197,-86.334120],\n ['Cordova',33.760106,-87.187083],\n ['Cottonwood',31.053646,-85.302409],\n ['County Line',33.819645,-86.729287],\n ['Courtland',34.668457,-87.310821],\n ['Cowarts',31.199575,-85.306272],\n ['Creola',30.895465,-88.014760],\n ['Crossville',34.286752,-85.990814],\n ['Cuba',32.433782,-88.371776],\n ['Cullman',34.177508,-86.844996],\n ['Dadeville',32.832059,-85.764288],\n ['Daleville',31.302496,-85.711083],\n ['Daphne',30.631289,-87.886440],\n ['Dauphin Island',30.256429,-88.125231],\n ['Daviston',33.055251,-85.639164],\n ['Dayton',32.349733,-87.641247],\n ['Deatsville',32.593958,-86.393454],\n ['Decatur',34.580992,-86.983392],\n ['Demopolis',32.509465,-87.837265],\n ['Detroit',34.025859,-88.171810],\n ['Dodge',34.052144,-86.882790],\n ['Dora',33.729476,-87.087013],\n ['Dothan',31.227225,-85.407258],\n ['Double Springs',34.151642,-87.404390],\n ['Douglas',34.171631,-86.319967],\n ['Dozier',31.495233,-86.366592],\n ['Dutton',34.607639,-85.915563],\n ['East Brewton',31.092408,-87.053174],\n ['Eclectic',32.641285,-86.038571],\n ['Edgewater',33.523106,-86.956525],\n ['Edwardsville',33.707182,-85.510560],\n ['Elba',31.417263,-86.077442],\n ['Elberta',30.413640,-87.599352],\n ['Eldridge',33.919774,-87.621138],\n ['Elkmont',34.930155,-86.977086],\n ['Elmore',32.542314,-86.315455],\n ['Emelle',32.729882,-88.314333],\n ['Enterprise',31.327476,-85.844484],\n ['Epes',32.690497,-88.124182],\n ['Ethelsville',33.413563,-88.215516],\n ['Eufaula',31.889370,-85.153774],\n ['Eunola',31.038766,-85.845415],\n ['Eutaw',32.840680,-87.889037],\n ['Eva',34.325209,-86.747722],\n ['Evergreen',31.435025,-86.954905],\n ['Excel',31.427308,-87.340587],\n ['Fairfield',33.476908,-86.916842],\n ['Fairhope',30.526394,-87.895687],\n ['Fairview',34.248717,-86.687761],\n ['Falkville',34.371919,-86.908381],\n ['Faunsdale',32.459221,-87.593251],\n ['Fayette',33.692068,-87.832358],\n ['Five Points',33.017189,-85.351208],\n ['Flomaton',31.008921,-87.255746],\n ['Florala',31.007712,-86.324957],\n ['Florence',34.820287,-87.662860],\n ['Foley',30.405594,-87.681509],\n ['Forestdale',33.574305,-86.902937],\n ['Forkland',32.647702,-87.867236],\n ['Fort Deposit',31.987872,-86.571249],\n ['Fort Payne',34.453829,-85.706648],\n ['Fort Rucker',31.343654,-85.707995],\n ['Franklin',32.455388,-85.802884],\n ['Frisco',31.433769,-87.402120],\n ['Fruithurst',33.731103,-85.431759],\n ['Fulton',31.790456,-87.732929],\n ['Fultondale',33.615202,-86.801293],\n ['Fyffe',34.446899,-85.906590],\n ['Gadsden',34.010147,-86.010356],\n ['Gainesville',32.817317,-88.158026],\n ['Gantt',31.407503,-86.483577],\n ['Gantts Quarry',33.152570,-86.295539],\n ['Garden',34.009211,-86.748159],\n ['Gardendale',33.660492,-86.811648],\n ['Gaylesville',34.267994,-85.558244],\n ['Geiger',32.868543,-88.306061],\n ['Geneva',31.038181,-85.876677],\n ['Georgiana',31.640087,-86.739442],\n ['Geraldine',34.353654,-86.004002],\n ['Gilber',31.876676,-88.320907],\n ['Glen Allen',33.899470,-87.730388],\n ['Glencoe',33.953148,-85.935868],\n ['Glenwood',31.667771,-86.174962],\n ['Goldville',33.083617,-85.784391],\n ['Good Hope',34.108777,-86.867164],\n ['Goodwater',33.059988,-86.053043],\n ['Gordo',33.321461,-87.903729],\n ['Gordon',31.143171,-85.096114],\n ['Gordonville',32.152335,-86.714338],\n ['Goshen',31.719715,-86.125861],\n ['Grand Bay',30.474055,-88.341836],\n ['Grant',34.502899,-86.255378],\n ['Grayson Valley',33.648728,-86.636513],\n ['Graysville',33.626955,-86.962255],\n ['Greensboro',32.702340,-87.596216],\n ['Greenville',31.831273,-86.627567],\n ['Grimes',31.302270,-85.451042],\n ['Grove Hill',31.706137,-87.774274],\n ['Guin',33.973135,-87.916711],\n ['Gulf Shores',30.267797,-87.701468],\n ['Guntersville',34.348197,-86.294523],\n ['Gurley',34.700164,-86.376469],\n ['Gu-Win',33.949505,-87.871921],\n ['Hackleburg',34.271460,-87.830826],\n ['Haleburg',31.408960,-85.136035],\n ['Haleyville',34.230131,-87.618978],\n ['Hamilton',34.135305,-87.988980],\n ['Hammondville',34.569414,-85.638305],\n ['Hanceville',34.063463,-86.760908],\n ['Harpersville',33.325848,-86.426121],\n ['Hartford',31.103664,-85.694544],\n ['Hartselle',34.440383,-86.940385],\n ['Harvest',34.852827,-86.748047],\n ['Hayden',33.893399,-86.756983],\n ['Hayneville',32.182365,-86.580468],\n ['Hazel Green',34.923712,-86.567206],\n ['Headland',31.353410,-85.339793],\n ['Heath',31.358154,-86.470193],\n ['Heflin',33.643754,-85.582701],\n ['Helena',33.279715,-86.856060],\n ['Henagar',34.633700,-85.742921],\n ['Highland Lake',33.884271,-86.422151],\n ['Hillsboro',34.638029,-87.188287],\n ['Hobson',33.618497,-85.843425],\n ['Hodges',34.330242,-87.927394],\n ['Hokes Bluff',33.993449,-85.865118],\n ['Holly Pond',34.174657,-86.617004],\n ['Hollywood',34.716960,-85.965689],\n ['Holt',33.230467,-87.486303],\n ['Homewood',33.468306,-86.808146],\n ['Hoover',33.386435,-86.804938],\n ['Horn Hill',31.240456,-86.319172],\n ['Huey',33.437709,-86.997579],\n ['Huguley',32.838003,-85.233139],\n ['Huntsville',34.712341,-86.596296],\n ['Hurtsboro',32.240102,-85.415377],\n ['Hytop',34.904816,-86.086634],\n ['Ider',34.703941,-85.673983],\n ['Indian Springs Village',33.368021,-86.741176],\n ['Irondale',33.531939,-86.686816],\n ['Jackson',31.521685,-87.891113],\n ['Jacksons Gap',32.881670,-85.818582],\n ['Jacksonville',33.815766,-85.760467],\n ['Jasper',33.842347,-87.277174],\n ['Jemison',32.958831,-86.743567],\n ['Kansas',33.903168,-87.556716],\n ['Kennedy',33.580683,-87.983830],\n ['Killen',34.861586,-87.529374],\n ['Kimberly',33.771163,-86.795280],\n ['Kinsey',31.291688,-85.345487],\n ['Kinston',31.220503,-86.170782],\n ['Ladonia',32.465666,-85.089046],\n ['La Fayette',32.898572,-85.400784],\n ['Lake Purdy',33.428571,-86.693028],\n ['Lakeview',34.392298,-85.973244],\n ['Lake View',33.279933,-87.138667],\n ['Lanett',32.863424,-85.199684],\n ['Langston',34.534817,-86.082169],\n ['Leeds',33.545592,-86.557388],\n ['Leesburg',34.182624,-85.768986],\n ['Leighton',34.699642,-87.530699],\n ['Lester',34.984304,-87.147909],\n ['Level Plains',31.313659,-85.767307],\n ['Lexington',34.966115,-87.372892],\n ['Libertyville',31.243844,-86.459962],\n ['Lincoln',33.593156,-86.138879],\n ['Linden',32.301154,-87.792650],\n ['Lineville',33.312534,-85.752576],\n ['Lipscomb',33.427308,-86.922475],\n ['Lisman',32.172216,-88.289352],\n ['Littleville',34.590933,-87.675599],\n ['Livingston',32.587332,-88.188161],\n ['Loachapoka',32.604844,-85.596890],\n ['Lockhart',31.011435,-86.350652],\n ['Locust Fork',33.896526,-86.630569],\n ['Louisville',31.780309,-85.557397],\n ['Lowndesboro',32.273118,-86.609915],\n ['Loxley',30.623500,-87.754732],\n ['Luverne',31.714427,-86.263323],\n ['Lynn',34.040688,-87.540827],\n ['McDonald Chapel',33.520706,-86.936858],\n ['Macedonia',33.402421,-88.239832],\n ['McIntosh',31.265979,-88.031473],\n ['McKenzie',31.542801,-86.719772],\n ['McMullen',33.149131,-88.173919],\n ['Madison',34.715065,-86.739644],\n ['Madrid',31.034941,-85.397222],\n ['Malvern',31.143981,-85.523382],\n ['Maplesville',32.781889,-86.875517],\n ['Margaret',33.675957,-86.467641],\n ['Marion',32.632838,-87.317284],\n ['May',33.553498,-86.994471],\n ['Meadowbrook',33.403788,-86.690758],\n ['Memphis',33.133678,-88.297023],\n ['Mentone',34.572360,-85.580283],\n ['Meridianville',34.869312,-86.578373],\n ['Midfield',33.455874,-86.927044],\n ['Midland',31.307945,-85.490606],\n ['Midway',32.074404,-85.520238],\n ['Mignon',33.182929,-86.264456],\n ['Millbrook',32.497626,-86.368545],\n ['Millport',33.560275,-88.080262],\n ['Millry',31.631309,-88.318972],\n ['Minor',33.539656,-86.940000],\n ['Mobile',30.679523,-88.103280],\n ['Monroeville',31.518075,-87.327543],\n ['Montevallo',33.104927,-86.862817],\n ['Montgomery',32.361538,-86.279118],\n ['Moody',33.592469,-86.496369],\n ['Moores Mill',34.830662,-86.520538],\n ['Mooresville',34.626931,-86.881091],\n ['Morris',33.747374,-86.807023],\n ['Mosses',32.173120,-86.677296],\n ['Moulton',34.482307,-87.285621],\n ['Moundville',32.998521,-87.626006],\n ['Mountainboro',34.147665,-86.131765],\n ['Mountain Brook',33.486972,-86.740465],\n ['Mount Olive',33.684191,-86.875139],\n ['Mount Vernon',31.093170,-88.011209],\n ['Mulga',33.553562,-86.975374],\n ['Munford',33.533494,-85.954242],\n ['Muscle Shoals',34.750788,-87.650278],\n ['Myrtlewood',32.247254,-87.947141],\n ['Napier Field',31.315265,-85.454340],\n ['Natural Bridge',34.091713,-87.604523],\n ['Nauvoo',33.988571,-87.487814],\n ['Nectar',33.969124,-86.636256],\n ['Needham',31.986338,-88.338795],\n ['Newbern',32.594818,-87.535431],\n ['New Brockton',31.381138,-85.924339],\n ['New Hope',34.538194,-86.412129],\n ['New Market',34.906295,-86.426170],\n ['New Site',33.030281,-85.786721],\n ['Newton',31.344452,-85.592702],\n ['Newville',31.421841,-85.336434],\n ['North Bibb',33.201248,-87.150242],\n ['North Courtland',34.676370,-87.307914],\n ['North Johns',33.366880,-87.101486],\n ['Northport',33.253917,-87.592352],\n ['Notasulga',32.560821,-85.667631],\n ['Oak Grove',33.189772,-86.303163],\n ['Oak Hill',31.925246,-87.082645],\n ['Oakman',33.713594,-87.386111],\n ['Odenville',33.681762,-86.399295],\n ['Ohatchee',33.803040,-86.036629],\n ['Oneonta',33.942303,-86.478774],\n ['Onycha',31.221515,-86.277694],\n ['Opelika',32.647183,-85.389404],\n ['Opp',31.283083,-86.254661],\n ['Orange Beach',30.291503,-87.561985],\n ['Orrville',32.305584,-87.245378],\n ['Owens Cross Roads',34.586071,-86.458561],\n ['Oxford',33.597105,-85.838881],\n ['Ozark',31.448169,-85.642009],\n ['Paint Rock',34.660172,-86.328018],\n ['Parrish',33.732477,-87.279291],\n ['Pelham',33.304581,-86.784620],\n ['Pell',33.570907,-86.273845],\n ['Pennington',32.203669,-88.052495],\n ['Petrey',31.850329,-86.207212],\n ['Phenix',32.472822,-85.020121],\n ['Phil Campbell',34.351505,-87.707414],\n ['Pickensville',33.230693,-88.272554],\n ['Piedmont',33.926005,-85.613137],\n ['Pike Road',32.269660,-86.140167],\n ['Pinckard',31.312803,-85.545713],\n ['Pine Apple',31.867882,-86.987624],\n ['Pine Hill',31.986332,-87.592131],\n ['Pine Ridge',34.445939,-85.779069],\n ['Pinson',33.686301,-86.681913],\n ['Pisgah',34.685022,-85.846575],\n ['Pleasant Grove',33.492400,-86.972927],\n ['Pleasant Groves',34.741295,-86.190445],\n ['Point Clear',30.496807,-87.909858],\n ['Pollard',31.027340,-87.172342],\n ['Powell',34.533483,-85.894598],\n ['Prattville',32.459135,-86.451305],\n ['Priceville',34.521001,-86.879678],\n ['Prichard',30.748038,-88.100384],\n ['Providence',32.348986,-87.778309],\n ['Ragland',33.743415,-86.142268],\n ['Rainbow',33.943964,-86.061546],\n ['Rainsville',34.492258,-85.845316],\n ['Ranburne',33.525372,-85.343257],\n ['Red Bay',34.439898,-88.138208],\n ['Red Level',31.407735,-86.610377],\n ['Redstone Arsenal',34.684166,-86.654031],\n ['Reece',34.074446,-86.030630],\n ['Reform',33.380835,-88.015022],\n ['Rehobeth',31.135245,-85.436008],\n ['Repton',31.408991,-87.239326],\n ['Ridgeville',34.057110,-86.103232],\n ['River Falls',31.351948,-86.536680],\n ['Riverside',33.614465,-86.200678],\n ['Riverview',31.058641,-87.056688],\n ['Roanoke',33.148830,-85.369784],\n ['Robertsdale',30.554454,-87.705566],\n ['Rock Creek',33.475884,-87.079003],\n ['Rockford',32.888181,-86.219575],\n ['Rock Mills',33.160348,-85.290469],\n ['Rogersville',34.823444,-87.285693],\n ['Rosa',33.989810,-86.511938],\n ['Russellville',34.510344,-87.728248],\n ['Rutledge',31.733103,-86.309619],\n ['St. Florian',34.872753,-87.625117],\n ['Saks',33.708202,-85.844326],\n ['Samson',31.112574,-86.047865],\n ['Sand Rock',34.232532,-85.770421],\n ['Sanford',31.300683,-86.391734],\n ['Saraland',30.825186,-88.091932],\n ['Sardis',34.173967,-86.121319],\n ['Satsuma',30.854518,-88.054415],\n ['Scottsboro',34.651368,-86.042570],\n ['Section',34.578155,-85.988114],\n ['Selma',32.416416,-87.024733],\n ['Selmont-West Selmont',32.378494,-87.006659],\n ['Sheffield',34.759721,-87.694592],\n ['Shiloh',34.465555,-85.877311],\n ['Shorter',32.401397,-85.943326],\n ['Silas',31.771625,-88.330991],\n ['Silverhill',30.545264,-87.750517],\n ['Sipsey',33.823108,-87.086127],\n ['Skyline',34.802946,-86.123494],\n ['Slocomb',31.108541,-85.594307],\n ['Smiths',32.539259,-85.098703],\n ['Smoke Rise',33.874074,-86.826012],\n ['Snead',34.115970,-86.391512],\n ['Somerville',34.469961,-86.798782],\n ['Southside',33.903597,-86.026105],\n ['South Vinemont',34.233641,-86.862916],\n ['Spanish Fort',30.668723,-87.922179],\n ['Springville',33.768950,-86.471037],\n ['Steele',33.940172,-86.199523],\n ['Stevenson',34.869442,-85.831829],\n ['Sulligent',33.894807,-88.131920],\n ['Sumiton',33.747213,-87.046716],\n ['Summerdale',30.487630,-87.701121],\n ['Susan Moore',34.081838,-86.419513],\n ['Sweet Water',32.097781,-87.865416],\n ['Sylacauga',33.178360,-86.251068],\n ['Sylvania',34.558304,-85.796154],\n ['Sylvan Springs',33.512650,-87.020636],\n ['Talladega',33.434728,-86.101299],\n ['Talladega Springs',33.120713,-86.445266],\n ['Tallassee',32.539402,-85.893061],\n ['Tarrant',33.587546,-86.766219],\n ['Taylor',31.168331,-85.468016],\n ['Theodore',30.550690,-88.180878],\n ['Thomaston',32.269495,-87.624865],\n ['Thomasville',31.911296,-87.740037],\n ['Thorsby',32.916992,-86.715956],\n ['Tillmans Corner',30.583293,-88.197876],\n ['Town Creek',34.671518,-87.408311],\n ['Toxey',31.913644,-88.308468],\n ['Trafford',33.818957,-86.746581],\n ['Triana',34.587456,-86.736251],\n ['Trinity',34.603808,-87.086137],\n ['Troy',31.801960,-85.967317],\n ['Trussville',33.621623,-86.596404],\n ['Tuscaloosa',33.206540,-87.534607],\n ['Tuscumbia',34.730839,-87.702854],\n ['Tuskegee',32.431506,-85.706781],\n ['Underwood-Petersville',34.872469,-87.692776],\n ['Union',32.994164,-87.905313],\n ['Union Grove',34.400088,-86.446049],\n ['Union Springs',32.140113,-85.712804],\n ['Union',32.448984,-87.512287],\n ['Valley',32.811387,-85.177938],\n ['Valley Head',34.565301,-85.616426],\n ['Vance',33.164521,-87.231718],\n ['Vernon',33.756414,-88.111409],\n ['Vestavia Hills',33.433057,-86.778894],\n ['Vina',34.374874,-88.053498],\n ['Vincent',33.385719,-86.409919],\n ['Vredenburgh',31.826518,-87.320686],\n ['Wadley',33.123327,-85.566350],\n ['Waldo',33.393674,-86.032763],\n ['Walnut Grove',34.063983,-86.279254],\n ['Warrior',33.813607,-86.811455],\n ['Waterloo',34.916795,-88.064210],\n ['Waverly',32.735658,-85.574371],\n ['Weaver',33.755701,-85.808541],\n ['Webb',31.260358,-85.283533],\n ['Wedowee',33.308603,-85.485447],\n ['West Blocton',33.118733,-87.122875],\n ['West End-Cobb',33.650903,-85.869487],\n ['West Jefferson',33.649773,-87.071222],\n ['West Point',34.241338,-86.943126],\n ['Wetumpka',32.540972,-86.207726],\n ['White Hall',32.313866,-86.714019],\n ['Wilsonville',33.234924,-86.486283],\n ['Wilton',33.081799,-86.879458],\n ['Winfield',33.928258,-87.807990],\n ['Woodland',33.373655,-85.395700],\n ['Woodville',34.626775,-86.274832],\n ['Yellow Bluff',31.959922,-87.482175],\n ['York',32.493221,-88.297845],\n ];\n return $cities;\n }",
"public static function cities(){\n return City::all();\n }",
"public function getCityregions()\n {\n return $this->hasMany(Cityregion::className(), ['subject_kod' => 'federal_subject_id']);\n }",
"function getCinemaCities()\n {\n\n return $this->distinct()->orderBy(self::CITY)->groupBy(self::CITY)->get(self::CITY)->pluck(self::CITY);\n }",
"public function countriesForCities()\n {\n $countries = $this->getOptimizedCountriesData();\n\n return array_map(function ($item) {\n return $item['country_name'];\n }, $countries);\n }",
"function get_all_cities_from_country( $country_id ) {\n $cities_list = array();\n\n $terms = get_terms( 'ubicacion',\n array(\n 'parent' => $country_id,\n 'orderby' => 'slug',\n 'hide_empty' => false,\n )\n );\n\n foreach ( $terms as $term ) {\n $city = array(\n 'id' => $term->term_id,\n 'name' => $term->name,\n );\n $cities_list[] = $city;\n }\n\n return $cities_list;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the special collection menue. | public function getSpecialCollectionMenue()
{
return $this->specialCollectionMenue;
} | [
"function collections_submenu_items() {\n\n\t$user = elgg_get_logged_in_user_entity();\n\n\telgg_register_menu_item('page', array(\n\t\t'name' => 'friends:view:collections',\n\t\t'text' => elgg_echo('friends:collections'),\n\t\t'href' => \"collections/$user->username\",\n\t));\n}",
"public function getPromouterMenu()\n {\n }",
"public function getCategoryOptionForMenuBuilder() : SupportCollection;",
"public function getCollection()\n {\n return $this->getToolbar()->getCollection();\n }",
"abstract public function getMenus();",
"public function getAddCollection() {\n // on instancie la varibale $type avec la class Type\n $type = new Type();\n // on instancie la varibale $users avec la class Profil\n $users = new Profil();\n // Si l'utilisateur n'a pas le rang 3 minimun la page ne s'affiche pas.\n if($users->hasRank(3)){\n // on affiche la page d'ajout des mangas.\n $this->render('manga/addCollection', ['genres' => $type->showType()]);\n } else {\n $this->security->safeLocalRedirect('default');\n }\n }",
"public function Collections () {\r\n\t\t$this->load->model(\"collections\");\r\n\t\t$collections = $this->collections->Find($this->ui_helper->language);\r\n\t\t$this->load->view(\"collections_view\",$this->ui_helper->ControllerInfo());\r\n\t}",
"function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"Manage\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=manage\",\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"Add New Article\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=add\",\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"Comments to my articles\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=search_comments\",\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}",
"public function get_menu()\n {\n return '';\n }",
"public function showCollection()\n {\n return $this->show(auth()->user()->collection);\n }",
"function getMenuItems()\n {\n }",
"protected function getMenu()\n {\n }",
"public function getMenuCollection()\n {\n $this->isLoaded();\n\n return $this->menuCollection;\n }",
"public function getAdminMenus() { return array(); }",
"function tainacan_the_collection_description() {\n\techo tainacan_get_the_collection_description();\n}",
"function _atrium_groups_menu_default_items() {\n $items = array();\n\n $items[] = array(\n 'title' => 'Groups',\n 'path' => 'og',\n 'weight' => '0',\n 'description' => 'Provides a group management feature',\n );\n // Translatables\n array(\n t('Groups'),\n t('Provides a group management feature'),\n );\n\n\n return $items;\n}",
"function modMenu() {\n\t\treturn array();\n\t}",
"function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> ucfirst($_GET[\"object\"]).\" main\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"Add\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=add\",\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}",
"public function documentationItems()\n {\n return Configure::read('Site.menu.items.documentation');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copies an existing file to create a layout file. | function copyToLayoutFile($fileId, $revision = null) {
return $this->copyAndRenameFile($fileId, $revision, ARTICLE_FILE_LAYOUT);
} | [
"function copyToLayoutFile($fileId, $revision = null) {\n\t\treturn $this->copyAndRenameFile($fileId, $revision, PAPER_FILE_LAYOUT);\n\t}",
"protected function copyLayoutTemplate()\n {\n $override_dir = resource_path('views/vendor/nova');\n $override_path = $override_dir . '/layout.blade.php';\n $default_path = base_path('vendor/laravel/nova/resources/views/layout.blade.php');\n\n if (! File::isDirectory($override_dir)) {\n File::makeDirectory($override_dir);\n }\n\n if (! File::exists($override_path)) {\n File::copy($default_path, $override_path);\n }\n }",
"final public function createBladeFile()\n {\n $this->viewName = $this->assignViewName();\n $this->setTemplatePath();\n $this->setDestinationPath();\n $this->copyFile();\n $this->content = $this->prepareContent();\n $this->writeContent();\n }",
"public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}",
"public function copyLayouts()\n {\n $this->TwbsAssets->copyLayouts();\n }",
"private function CloneBaseLayoutFolder(){\n\n $status = $this->copyFileToDir('extra/Layouts/'.$this->baseLayout,$this->PathDist.'/'.$this->baseLayout);\n\n if($status){\n $basePath = $this->PathDist.\"/BaseStrateLayout.php\";\n CreteElement::RegisterModuleIntoRegisterBase($basePath);\n }\n\n }",
"public function copy($file, $new_file);",
"private function createParsedLayout()\n {\n $unparsed_contents = @file_get_contents($this->unparsed_layout);\n $parsed_contents = $this->parseCode($unparsed_contents);\n return FileSystem::put_file($this->parsed_layout, $parsed_contents);\n }",
"protected function makeYamlCopy() {\n if ($this->yamlCopyRequired) {\n file_put_contents(\n $this->yamlDocsFile, (new YamlDumper(2))->dump(json_decode(file_get_contents($this->docsFile), true), 20)\n );\n }\n }",
"protected function _copySkeleton()\n {\n $this->_source = dirname(ROOT) . DS . 'ThePhpLeague' . DS . 'skeleton';\n $this->_destination = dirname(ROOT) . DS . 'Packages' . DS . 'Plain' . DS . $this->params['directory'];\n $folder = new Folder();\n $folder->copy([\n 'to' => $this->_destination,\n 'from' => $this->_source,\n 'mode' => 0755,\n 'skip' => ['.git', '.gitattributes', '.gitignore'],\n 'scheme' => Folder::SKIP,\n ]);\n }",
"abstract function copyFile($source_file, $dest_file);",
"public function copy($filepath);",
"public function copy() {\n $Copy = $this->getEntity(\"File\");\n foreach ($this->schema[\"fields\"] as $key => $field)\n $Copy->set($key, $this->get($key));\n $info = pathinfo($Copy->get(\"uri\"));\n $path = ($Copy->get(\"dir\") == \"private\" ? PRIVATE_PATH : PUBLIC_PATH).BASE_PATH;\n $uri = $info[\"dirname\"].\"/\";\n $name = $Copy->get(\"name\");\n $ext = $Copy->get(\"extension\");\n for ($fname = $name.\"-0.\".$ext, $i = 1; file_exists($path.$uri.$fname); $fname = $name.\"-\".$i.\".\".$ext, $i++);\n if (file_exists($this->path())) {\n if (!copy($this->path(), $path.$uri.$fname)) {\n setmsg(\"Failed to copy file: \".$this->path().\" to \".$path.$uri.$fname, \"error\");\n return false;\n }\n }\n $Copy->set(\"uri\", $uri.$fname);\n if (!$Copy->save())\n return false;\n return $Copy;\n }",
"public function copyFile( $source, $destination );",
"protected function makeYamlCopy(): void\n {\n if ($this->yamlCopyRequired) {\n file_put_contents(\n $this->yamlDocsFile,\n (new YamlDumper(2))->dump(\n json_decode(file_get_contents($this->docsFile), true),\n 20,\n 0,\n Yaml::DUMP_OBJECT_AS_MAP ^ Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE\n )\n );\n }\n }",
"private function copyConfigFile()\n {\n $path = $this->getConfigPath();\n\n // if generatords config already exist\n if ($this->files->exists($path) && $this->option('force') === false) {\n $this->error(\"{$path} already exists! Run 'generate:publish-stubs --force' to override the config file.\");\n die;\n }\n\n File::copy(__DIR__ . '/../config/config.php', $path);\n }",
"public function _duplicateLayout($source_path, $dest_path) {\n // assets\n $this->_duplicateDir($source_path.$this->assets_dir, $dest_path.$this->assets_dir);\n // views\n $this->_duplicateDir($source_path.'view/', $dest_path.'view/');\n }",
"public function generate()\n {\n $content = file_get_contents($this->sourceFile);\n $content = str_replace('$(top_srcdir)/../', '$(top_srcdir)/../../', $content);\n file_put_contents($this->outputFile, $content);\n }",
"function copyFile($source,$target,$text_to_insert=''){\n\tif (file_exists($source)) {\n\t\t$file = pathinfo($target,PATHINFO_FILENAME).'.'.pathinfo($target,PATHINFO_EXTENSION);\n\t\tif ($text_to_insert) {\n\t\t\ttoLog(cot_rc('mplug_log',array(sizeCounter(file_put_contents($target, $text_to_insert.file_get_contents($source))), $file)));\n\t\t} elseif (copy($source,$target)) {\n\t\t\ttoLog(cot_rc('mplug_log',array(sizeCounter(filesize($target)), $file)));\n\t\t}\n\t} else {\n\t\ttoLog(cot_rc('mplug_nofile',array('file'=>$source)));\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all HanziSplit models. | public function actionIndex()
{
$searchModel = new HanziSplitSearch();
$currentPage = isset(Yii::$app->request->queryParams['page']) ? (int)Yii::$app->request->queryParams['page'] : 1;
$authority = HanziTask::checkPagePermission(Yii::$app->user->id, $currentPage, HanziTask::TYPE_SPLIT);
$dataProvider = $searchModel->search(Yii::$app->request->queryParams, true);
$dataProvider->pagination->pageSize = Yii::$app->get('keyStorage')->get('frontend.task-per-page', null, false);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'authority' => $authority
]);
} | [
"public function splits()\n {\n return $this->hasMany(Split::class);\n }",
"public function getModels();",
"public function listModels()\n\t{\n\t\t$classes = \\SeanMorris\\Ids\\Linker::classes('SeanMorris\\Ids\\Model');\n\n\t\t$classes = array_map(\n\t\t\tfunction($class)\n\t\t\t{\n\t\t\t\treturn str_replace('\\\\', '/', $class);\n\t\t\t}\n\t\t\t, $classes\n\t\t);\n\n\t\tprint implode(PHP_EOL, $classes) . PHP_EOL;\n\t}",
"function _listAll()\n {\n $this->_getTables();\n $this->out('');\n $this->out('Possible Models based on your current database:');\n $this->hr();\n $this->_modelNames = array();\n $i=1;\n foreach ($this->__tables as $table) {\n $this->_modelNames[] = $this->_modelName($table);\n $this->out($i++ . \". \" . $this->_modelName($table));\n }\n }",
"public function actionIndex()\n {\n $searchModel = new HanziSetSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAllModels(){\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n $autoModel = AutoModels::model()->findAll();\n\n $this->sendResponse([\"success\" => 1, \"data\" => $autoModel]);\n exit();\n }",
"public function getModels()\r\n {\r\n $query = $this->getQuery();\r\n $models = $query->all();\r\n return $models;\r\n }",
"private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\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 static function get_splits_list()\n {\n return self::$splits_list;\n }",
"public function getHarborObjects();",
"public function splitShard(AliyunLogModelsSplitShardRequest $request) {\n $params = array();\n $headers = array();\n $project = $request->getProject()!==null?$request->getProject():'';\n $logstore = $request->getLogstore()!==null?$request->getLogstore():'';\n $shardId = $request -> getShardId()!== null ? $request -> getShardId():-1;\n $midHash = $request -> getMidHash()!= null?$request -> getMidHash():\"\";\n\n $resource='/logstores/'.$logstore.'/shards/'.$shardId;\n $params[\"action\"] = \"split\";\n $params[\"key\"] = $midHash;\n list($resp,$header) = $this->send(\"POST\",$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 AliyunLogModelsListShardsResponse ( $resp, $header );\n }",
"public function models()\n {\n $this->_display('models');\n }",
"public function listHL(){\n $model = new PosterHoleLineDefine();\n $type = 'hole-line-define';\n $getList = new IndexController();\n $result = $getList->tableList($model,$type);\n return $result;\n }",
"function GetAllModels()\n\t{\n\t}",
"public function actionList()\n {\n $searchModel = new BusinessSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public static function getAll() {\r\n $result = db_select(\"{md_megamenu_tabs}\", \"mt\")\r\n ->fields(\"mt\")\r\n ->execute()\r\n ->fetchAll(PDO::FETCH_CLASS, \"MDMegaTab\");\r\n\r\n foreach ($result as &$tab) {\r\n if ($tab instanceof stdClass)\r\n $tab = _megamenu_recast(\"MDMegaTab\", $tab);\r\n $tab->initialize();\r\n }\r\n\r\n return $result;\r\n }",
"private function __getAllShardingModels($where)\n {\n $models = array();\n foreach ( $this->shardings as $mpath ) {\n $mObj = model($mpath);\n $this->resetModelAttr($mObj);\n $this->lastAcitveModel = $mObj;\n $this->activeModels[$mpath] = $mObj;\n $models[] = array(\n 'model' => $mObj,\n 'where' => $where\n );\n }\n\n return $models;\n }",
"public function getModels(){\r\n\t\treturn $this->models;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the upload emoticon form | public function emoticonsUpload()
{
/* INI */
$overwrite = 1;
$uploaded = 0;
/* Check the request for uploads */
$directories = array();
$first_dir = '';
foreach( $this->request as $key => $value )
{
if( preg_match( "/^dir_(.*)$/", $key, $match ) )
{
if( $this->request[ $match[0] ] == 1 )
{
$directories[] = $match[1];
}
}
}
/* Can't upload to default */
if ( ! count( $directories ) )
{
$this->registry->output->global_message = $this->lang->words['emo_pickanother'];
$this->emoticonsOverview();
return;
}
/* Remove default from the directories list */
if ( ! in_array( 'default', $directories ) )
{
array_push( $directories, 'default' );
}
/* Get the first directory */
$first_dir = array_shift( $directories );
/* Loop through the dirs */
$emodirs = array( 0 => '' );
try
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file )
{
if( ! $file->isDot() && $file->isDir() )
{
/* Add to emoticon list */
if( $file->getFilename() == 'default' )
{
$emodirs[0] = $file->getFilename();
}
else
{
$emodirs[] = $file->getFilename();
}
}
}
} catch ( Exception $e ) {}
/* Loop through each form upload field */
foreach( array( 1,2,3,4 ) as $i )
{
/* Upload Data */
$field = 'upload_'.$i;
$FILE_NAME = $_FILES[$field]['name'];
$FILE_SIZE = $_FILES[$field]['size'];
$FILE_TYPE = $_FILES[$field]['type'];
//-----------------------------------------
// Naughty Opera adds the filename on the end of the
// mime type - we don't want this.
//-----------------------------------------
$FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE );
//-----------------------------------------
// Naughty Mozilla likes to use "none" to indicate an empty upload field.
// I love universal languages that aren't universal.
//-----------------------------------------
if ( $_FILES[$field]['name'] == "" or ! $_FILES[$field]['name'] or ($_FILES[$field]['name'] == "none") )
{
continue;
}
//-----------------------------------------
// Make sure it's not a NAUGHTY file
//-----------------------------------------
$file_extension = preg_replace( '#^.*\.(.+?)$#si', "\\1", strtolower( $_FILES[ $field ]['name'] ) );
if ( ! in_array( $file_extension, $this->allowed_files ) )
{
$this->registry->output->global_message = $this->lang->words['emo_mimes']; // The screams of angst from Emo Mimes are silent...
$this->emoticonsOverview();
return;
}
//-----------------------------------------
// Copy the upload to the uploads directory
//-----------------------------------------
if ( ! @move_uploaded_file( $_FILES[ $field ]['tmp_name'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME) )
{
$this->registry->output->global_message = "The upload failed, sorry!";
$this->emoticonsOverview();
return;
}
else
{
@chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, IPS_FILE_PERMISSION );
//-----------------------------------------
// Copy to other folders
//-----------------------------------------
if ( is_array( $directories ) and count( $directories ) )
{
foreach ( $directories as $newdir )
{
if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) )
{
if ( $overwrite != 1 OR $newdir == 'default' )
{
continue;
}
}
if ( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) )
{
@chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION );
}
}
}
// Let's make sure this 'image' is available in all directories too
if ( is_array( $emodirs ) and count( $emodirs ) )
{
foreach ( $emodirs as $newdir )
{
if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) )
{
continue;
}
if( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" .$FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) )
{
@chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION );
}
}
}
$uploaded++;
}
}
if( !$uploaded )
{
$this->registry->output->global_message = $this->lang->words['no_emo_selected'];
}
else
{
$this->registry->output->global_message = $this->lang->words['emo_complete'];
}
$this->emoticonsOverview();
} | [
"public function emoticonsAdd()\n\t{\n\t\t$image = str_replace( '---', '.', trim( $this->request['emo_image'] ) );\n\t\t$set = trim( $this->request['id'] );\n\t\t$typed = $this->_getNameFromImg( $image, $set );\n\t\t$position = $this->_getNextPosition( $set );\n\t\t\n\t\t/* Check the id */\n\t\tif ( empty( $set ) )\n\t\t{\n\t\t\t$this->registry->output->global_message = $this->lang->words['emo_nogid'];\n\t\t\t$this->emoticonsOverview();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* Can only upload to the default directory */\n\t\tif( $this->request['id'] != \"default\" )\n\t\t{\n\t\t\t$this->registry->output->global_message = $this->lang->words['emo_onlydothis'];\n\t\t\t$this->emoticonsOverview();\n\t\t\treturn;\n\t\t}\t\t\t\n\t\t\n\t\tif ( ! $image OR ! $typed )\n\t\t{\n\t\t\t$this->registry->output->global_message = $this->lang->words['emo_nogid'];\n\t\t\t$this->emoticonsOverview();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* Insert the emo record */\n\t\t// as per http://community.invisionpower.com/tracker/issue-34269-emoticon-imports - add to all records rather than\n\t\t// just the default. In future version, will hopefully rewrite emoticon management and make this process less mental\n\t\tforeach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $_emoticon )\n\t\t{\n\t\t\tif ( $_emoticon->isDir() AND ! $_emoticon->isDot() AND $_emoticon->getFilename() != '.svn' )\n\t\t\t{\n\t\t\t\tif ( is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $_emoticon ) )\n\t\t\t\t{\n\t\t\t\t\t$this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $_emoticon->getFilename(), 'emo_position' => $position ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Emoticon list */\n\t\t$emodirs = array( 0 => '');\n\t\t\n\t\t/* Loop through all the emoticons */\n\t\ttry\n\t\t{\n\t\t\tforeach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file )\t\t\t\t \t\t\n \t\t\t{\n \t\t\t\tif ( ! $file->isDot() && $file->isDir() && strpos( $file->getFilename(), '.' ) != 0 )\n \t\t\t\t{\n\t\t\t\t\tif( $file->getFilename() == 'default' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$emodirs[0] = $file->getFilename();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$emodirs[] = $file->getFilename();\n\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n\t\t} catch ( Exception $e ) {}\n\t\t\n \t\t/* Add this emoticon to the other sets */\t\t\t\t \t\t\n \t\tforeach( $emodirs as $directory )\n \t\t{\n\t \t\tif ( $directory == $set )\n\t \t\t{\n\t\t \t\tcontinue;\n\t \t\t}\n\t \t\t\n\t \t\tif ( empty( $directory ) )\n\t \t\t{\n\t \t\t\tcontinue;\n\t \t\t}\n\t \t\t\n\t \t\t$this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $directory, 'emo_position' => $position ) );\n \t\t}\n\t\t\n\t\t/* Rebuild the cache and bounce */\n\t\t$this->emoticonsRebuildCache();\n\t\t\n\t\t$this->registry->output->global_message = $this->lang->words['emo_updated'];\t\n\t\t$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code . '&do=emo_manage&id=' . $this->request['id'] );\n\t}",
"function media_upload_form_handler()\n {\n }",
"public function upload_form_handler()\n {\n }",
"function formUpload() {\n\t\t$we_button = new we_button();\n\t\t$uploadButton = $we_button->create_button(\"upload\", \"javascript:we_cmd('editor_uploadFile')\", true,150,22,\"\",\"\",false,true,\"\",true);\n\t\t$fs = $GLOBALS[\"we_doc\"]->getFilesize();\n\t\t$fs = $GLOBALS[\"l_metadata\"][\"filesize\"].\": \".round(($fs / 1024),2).\" KB\";\n\t\t$_metaData = $this->getMetaData();\n\t\t$_mdtypes = array();\n\n\t\tif ($_metaData) {\n\t\t\tif (isset($_metaData[\"exif\"]) && count($_metaData[\"exif\"])) {\n\t\t\t\t$_mdtypes[] = \"Exif\";\n\t\t\t}\n\t\t\tif (isset($_metaData[\"iptc\"]) && count($_metaData[\"iptc\"])) {\n\t\t\t\t$_mdtypes[] = \"IPTC\";\n\t\t\t}\n\n\t\t}\n\n\t\t$filetype = $GLOBALS[\"l_metadata\"][\"filetype\"].\": \";\n\t\tif(!empty($this->Extension)) {\n\t\t\t$filetype .= substr($this->Extension,1);\n\t\t}\n\n\t\tif ($_SESSION[\"we_mode\"] == \"seem\") {\n\t\t\t$md = \"\";\n\t\t} else {\n\t\t\t$md = $GLOBALS[\"l_metadata\"][\"supported_types\"].\": \";\n\t\n\t\t\tif(count($_mdtypes) > 0) {\n\t\t\t\t$_mdTypesTxt = implode(\", \", $_mdtypes);\n\t\t\t} else {\n\t\t\t\t$_mdTypesTxt = $GLOBALS[\"l_metadata\"][\"none\"];\n\t\t\t}\n\t\n\t\t\t$md .= '<a href=\"javascript:parent.frames[0].setActiveTab(\\'tab_2\\');we_cmd(\\'switch_edit_page\\',2,\\''.$GLOBALS['we_transaction'].'\\');\">';\n\t\t\t$md.= $_mdTypesTxt;\n\t\t\t$md .= '</a>';\n\t\t}\n\t\t\n\t\t$foo = '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"500\">\n\t\t';\n\t\t\t$foo .= '<tr style=\"vertical-align:top;\">\n\t\t\t\t\t\t<td class=\"defaultfont\">' .\n\t\t\t\t\t\t$uploadButton . '<br />' .\n\t\t\t\t\t\t$fs . '<br />' .\n\t\t\t\t\t\t$filetype . '<br />'.\n\t\t\t\t\t\t$md . '</td>\n\t\t\t\t\t\t<td width=\"100px\" style=\"text-align:right;\">';\n\t\t\t\t\t\t\t$foo.=$this->getThumbnail();\n\t\t\t$foo .= '</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>' . getPixel(2, 20) . '</td>\n\t\t\t\t\t\t\t<td>' . getPixel(2, 20) . '</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>';\n\t\t\tif($GLOBALS[\"we_doc\"]->getFilesize() != 0){\n\t\t\t\t\t$foo .= '<td colspan=\"2\" class=\"defaultfont\">' . htmlAlertAttentionBox($GLOBALS['l_we_class'][\"upload_will_replace\"],1,508) . '</td>';\n\t\t\t} else {\n\t\t\t\t\t$foo .= '<td colspan=\"2\" class=\"defaultfont\">' . htmlAlertAttentionBox($GLOBALS['l_we_class'][\"upload_single_files\"],1,508) . '</td>';\n\t\t\t}\n\t\t\t$foo .= '</tr>';\n\n\n\t\t$foo .= '</table>';\n\n\t\treturn $foo;\n\t}",
"protected function add_attachments_form()\n {\n\n }",
"function media_upload_text_after() {}",
"public function emoticonsEdit()\n\t{\n\t\t/* Check ID */\n\t\tif( $this->request['id'] == '' )\n\t\t{\n\t\t\t$this->registry->output->global_error = $this->lang->words['emo_nogid'];\n\t\t\treturn $this->emoticonsOverview();\n\t\t}\n\t\t\n\t\t/* Loop through the request and pull out emoticons */\n\t\tforeach( $this->request as $key => $value )\n\t\t{\n\t\t\t/* Check to see if its an emoticon */\n\t\t\tif ( preg_match( '/^emo_id_(\\d+)$/', $key, $match ) )\n\t\t\t{\n\t\t\t\tif ( $match[0] )\n\t\t\t\t{\n\t\t\t\t\t/* INI */\n\t\t\t\t\t$typed = '';\n\t\t\t\t\t\n\t\t\t\t\t/* Format type for default set */\n\t\t\t\t\tif( $this->request['id'] == 'default' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$typed = str_replace( '"', \"\", $this->request[ 'emo_type_' . $match[1] ] );\n\t\t\t\t\t\t$typed = str_replace( '\', \"\", $typed );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* Check clickable */\n\t\t\t\t\t$click = $this->request[ 'emo_click_' . $match[1] ];\n\t\t\t\t\t\n\t\t\t\t\t/* Update the emoticon */\n\t\t\t\t\tif ( $match[1] )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( $typed )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* Get the original name */\n\t\t\t\t\t\t\t$orig_typed = $this->DB->buildAndFetch( array( 'select' => 'typed', 'from' => 'emoticons', 'where' => 'id=' . intval( $match[1] ) ) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Update to new name */\n\t\t\t\t\t\t\t$this->DB->update( 'emoticons', array( 'clickable' => intval( $click ), 'typed' => $typed ), 'id=' . intval( $match[1] ) );\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->DB->update( 'emoticons', array( 'typed' => $typed ), \"typed='\" . $this->DB->addSlashes($orig_typed['typed']) . \"'\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* Just update clickable */\n\t\t\t\t\t\t\t$this->DB->update( 'emoticons', array( 'clickable' => intval( $click ) ), 'id=' . intval( $match[1] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Recache and bounce */\n\t\t$this->emoticonsRebuildCache();\n\t\t\n\t\t$this->registry->output->global_message = $this->lang->words['emo_updated'];\t\n\t\t$this->emoticonsManageDirectory();\t\n\t}",
"public function renderUploadForm() {}",
"public function add_enctype () {\n echo ' enctype=\"multipart/form-data\"';\n }",
"public function ckupload(){\n\t\t\t$data['Attachment'] = [\n\t\t\t\t'model'=>'CKEDITOR',\n\t\t\t\t'foreign_key'=>0,\n\t\t\t\t'file'=>$_FILES['upload']\n\t\t\t];\n\t\t\t//debug($data); exit;\n\t\t\tif($this->Attachment->save($data)){\n\t\t\t\t$image_name = $this->Attachment->field('img');\n\t\t\t\techo '<script type=\"text/javascript\">window.parent.CKEDITOR.tools.callFunction('.$this->params->query['CKEditorFuncNum'].', \"'.$image_name.'\");</script>';\n\t\t\t\texit;\n\t\t\t}else{\n\t\t\t\techo '<div style=\"height:100px; width:200px;\">Something went wrong while uploading</div>';\n\t\t\t\texit;\n\t\t\t}\n\n\t\t}",
"function set_submit_multipart()\n {\n }",
"function instant_ide_file_editor_upload_form() {\n\n?>\n <div id=\"instant-ide-file-editor-upload-form-overlay\" style=\"display:none;\"></div>\n <div id=\"instant-ide-file-editor-upload-form-container\" style=\"display:none;\">\n <form id=\"instant-ide-file-editor-upload-form\" action=\"/\" method=\"POST\">\n <i class=\"fa fa-times-circle\" aria-hidden=\"true\"></i>\n <div id=\"instant-ide-file-upload-wrap\">\n <p>Select file to upload: <input type=\"file\" id=\"instant-ide-file-upload\" name=\"uploads[]\" multiple=\"\"/></p>\n </div>\n <button id=\"instant-ide-upload-button\" type=\"submit\">Upload</button>\n <img class=\"instant-ide-ajax-save-spinner\" src=\"<?php echo IIDE_URL; ?>assets/css/images/ajax-save-in-progress.gif\" />\n <div id=\"instant-ide-file-upload-progress\"></div>\n </form>\n </div>\n<?php\n\t\n}",
"function TOPIC_iconUpload($tid)\n{\n global $_CONF, $_TABLES, $LANG27;\n\n $upload = new upload();\n if (!empty ($_CONF['image_lib'])) {\n\n $upload->setAutomaticResize (true);\n if (isset ($_CONF['debug_image_upload']) &&\n $_CONF['debug_image_upload']) {\n $upload->setLogFile ($_CONF['path'] . 'logs/error.log');\n $upload->setDebug (true);\n }\n }\n $upload->setAllowedMimeTypes (array ('image/gif' => '.gif',\n 'image/jpeg' => '.jpg,.jpeg',\n 'image/pjpeg' => '.jpg,.jpeg',\n 'image/x-png' => '.png',\n 'image/png' => '.png',\n 'image/svg+xml' => '.svg',\n ) );\n if (!$upload->setPath ($_CONF['path_images'] . 'topics')) {\n $display = COM_siteHeader ('menu', $LANG27[29]);\n $display .= COM_showMessageText($upload->printErrors (false),$LANG27[29],true);\n $display .= COM_siteFooter ();\n echo $display;\n exit; // don't return\n }\n $upload->setFieldName('newicon');\n\n $filename = '';\n\n // see if user wants to upload a (new) icon\n $newicon = $_FILES['newicon'];\n if (!empty ($newicon['name'])) {\n $pos = strrpos ($newicon['name'], '.') + 1;\n $fextension = substr ($newicon['name'], $pos);\n $filename = 'topic_' . $tid . '.' . $fextension;\n }\n\n // do the upload\n if (!empty ($filename)) {\n\n $upload->setFileNames ($filename);\n $upload->setPerms ('0644');\n if (($_CONF['max_topicicon_width'] > 0) &&\n ($_CONF['max_topicicon_height'] > 0)) {\n $upload->setMaxDimensions ($_CONF['max_topicicon_width'],\n $_CONF['max_topicicon_height']);\n } else {\n $upload->setMaxDimensions ($_CONF['max_image_width'],\n $_CONF['max_image_height']);\n }\n if ($_CONF['max_topicicon_size'] > 0) {\n $upload->setMaxFileSize($_CONF['max_topicicon_size']);\n } else {\n $upload->setMaxFileSize($_CONF['max_image_size']);\n }\n $upload->uploadFiles ();\n\n if ($upload->areErrors ()) {\n $display = COM_siteHeader ('menu', $LANG27[29]);\n $display .= COM_showMessageText($upload->printErrors (false),$LANG27[29],true);\n $display .= COM_siteFooter ();\n echo $display;\n exit; // don't return\n }\n $filename = '/images/topics/' . $filename;\n }\n\n return $filename;\n}",
"public function upload()\n {\n $callback = 'null';\n $url = '';\n $get = array();\n\n // for form action, pull CKEditorFuncNum from GET string. e.g., 4 from\n // /form/upload?CKEditor=content&CKEditorFuncNum=4&langCode=en\n // Convert GET parameters to PHP variables\n $qry = $_SERVER['REQUEST_URI'];\n parse_str(substr($qry, strpos($qry, '?') + 1), $get);\n\n if (!isset($_POST) || !isset($get['CKEditorFuncNum'])) {\n $msg = 'CKEditor instance not defined. Cannot upload image.';\n } else {\n $callback = $get['CKEditorFuncNum'];\n\n try {\n $url = $this->_move_image($_FILES['upload']);\n $msg = \"File uploaded successfully to: {$url}\";\n\n // Persist additions to file manager CMS here.\n\n } catch (Exception $e) {\n $url = '';\n $msg = $e->getMessage();\n }\n }\n\n $output = '<html><body><script type=\"text/javascript\">' .\n 'window.parent.CKEDITOR.tools.callFunction(' .\n $callback .\n ', \"' .\n $url .\n '\", \"' .\n $msg .\n '\");</script></body></html>';\n\n echo $output;\n }",
"function get_emoticon_chooser($field_name='post')\n\t{\n\t\trequire_code('comcode_text');\n\t\t$emoticons=$GLOBALS['SITE_DB']->query('SELECT * FROM '.$GLOBALS['SITE_DB']->get_table_prefix().'f_emoticons WHERE e_relevance_level=0');\n\t\t$em=new ocp_tempcode();\n\t\tforeach ($emoticons as $emo)\n\t\t{\n\t\t\t$code=$emo['e_code'];\n\n\t\t\t$em->attach(do_template('EMOTICON_CLICK_CODE',array('_GUID'=>'0b51492b6e170db4466be74fdf312260','FIELD_NAME'=>$field_name,'CODE'=>$code,'IMAGE'=>apply_emoticons($code))));\n\t\t}\n\n\t\treturn $em;\n\t}",
"public function the_file_upload() {\n $text = isset( self::$data[self::$handout_file['notes']] ) ? self::$data[self::$handout_file['notes']] : '';\n\t\t?>\n \n\t\t\t<div class=\"uploader handout-file\">\n\t\t\t\t<p><label><?php echo self::$handout_file['name']; ?>:</label></p>\n\t\t\t\t<?php $attachment_id = isset( self::$data[self::$handout_file['id']] ) ? self::$data[self::$handout_file['id']] : null;?>\n\t\t\t\t<?php $attachment_url = wp_get_attachment_url( $attachment_id ); ?>\n\t\t\t\t<input class=\"ctlt-espresso-upload-button button\" type=\"button\" name=\"<?php echo self::$handout_file['id'] . '_button'; ?>\" id=\"<?php echo self::$handout_file['id'] . '_button'; ?>\" value=\"Upload\" />\n\t\t\t\t\t<input class=\"ctlt-espresso-upload\" type=\"text\" value=\"<?php echo $attachment_url !== false ? $attachment_url : null; ?>\" />\n\t\t\t\t\t<input class=\"ctlt-espresso-target-attachment-id\" type=\"hidden\" name=\"<?php echo self::$handout_file['id']; ?>\" id=\"<?php echo self::$handout_file['id']; ?>\" value=\"<?php echo $attachment_id; ?>\"/>\n\t\t\t</div>\n\n <div class=\"uploader display-public\">\n\t <p>\n\t <?php $checked = isset( self::$handout_policy['id'] ) ? self::$data[self::$handout_policy['id']] : ''; ?>\n\t <label for=\"<?php echo self::$handout_policy['id']; ?>\"><?php echo self::$handout_policy['checkbox_label']; ?></label><br />\n\t <input type=\"<?php echo self::$handout_policy['type']; ?>\" name=\"<?php echo self::$handout_policy['id']; ?>\" id=\"<?php echo self::$handout_policy['id']; ?>\" <?php checked( $checked, 'yes' ); ?>>\n\t </p>\n </div>\n \n\t\t\t<div class=\"uploader sign-file\">\n\t\t\t\t<p><label><?php echo self::$sign_file['name']; ?>:</label></p>\n\t\t\t\t<?php $attachment_id = isset( self::$data[self::$sign_file['id']] ) ? self::$data[self::$sign_file['id']] : null;?>\n\t\t\t\t<?php $attachment_url = wp_get_attachment_url( $attachment_id ); ?>\n\t\t\t\t<input class=\"ctlt-espresso-upload-button button\" type=\"button\" name=\"<?php echo self::$sign_file['id'] . '_button'; ?>\" id=\"<?php echo self::$sign_file['id'] . '_button'; ?>\" value=\"Upload\" />\n\t\t\t\t\t<input class=\"ctlt-espresso-upload\" type=\"text\" value=\"<?php echo $attachment_url !== false ? $attachment_url : null; ?>\" />\n\t\t\t\t\t<input class=\"ctlt-espresso-target-attachment-id\" type=\"hidden\" name=\"<?php echo self::$sign_file['id']; ?>\" id=\"<?php echo self::$sign_file['id']; ?>\" value=\"<?php echo $attachment_id; ?>\"/>\n\t\t\t</div>\n\n \n <div class=\"uploader handout-notes ctlt-espresso-controls-textarea\">\n <p><label>Handouts and Signs Notes:</label></p>\n <textarea class=\"ctlt-full-width\" rows=\"2\" name=\"<?php echo self::$handout_file['notes'] ?>\" id=\"<?php echo self::$handout_file['notes'] ?>\"><?php echo $text; ?></textarea>\n </div>\n\t\t<?php\n\t}",
"public function uploadSmileyObject()\n\t{\n\t\tglobal $rbacsystem, $ilCtrl, $tpl, $lng;\n\n\t\tif(!$rbacsystem->checkAccess('write', $this->gui->ref_id))\n\t\t{\n\t\t\t$this->ilias->raiseError(\n\t\t\t\t$lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE\n\t\t\t);\n\t\t}\n\n\t\t$this->initSmiliesForm();\n\n\t\tinclude_once \"Modules/Chatroom/classes/class.ilChatroomSmilies.php\";\n\t\tinclude_once('./Services/Form/classes/class.ilPropertyFormGUI.php');\n\n\t\t//$this->form_gui = new ilPropertyFormGUI();\n\n\t\t$this->form_gui->setValuesByPost();\n\n\t\t$keywords = ilChatroomSmilies::_prepareKeywords(\n\t\t\tilUtil::stripSlashes($_REQUEST[\"chatroom_smiley_keywords\"])\n\t\t);\n\n\t\t$keywordscheck = count($keywords) > 0;\n\n\t\tif(!$this->form_gui->checkInput())\n\t\t{\n\t\t\t$tpl->setContent($this->form_gui->getHtml());\n\t\t\treturn $this->view();\n\t\t}\n\n\t\t$pathinfo = pathinfo($_FILES[\"chatroom_image_path\"][\"name\"]);\n\t\t$target_file = md5(time() + $pathinfo['basename']) . \".\" . $pathinfo['extension'];\n\n\t\tmove_uploaded_file(\n\t\t\t$_FILES[\"chatroom_image_path\"][\"tmp_name\"],\n\t\t\tilChatroomSmilies::_getSmiliesBasePath() . $target_file\n\t\t);\n\n\t\tilChatroomSmilies::_storeSmiley(join(\"\\n\", $keywords), $target_file);\n\n\t\t$ilCtrl->redirect($this->gui, \"smiley\");\n\t}",
"function open_badges_images_form_submit($form, &$form_state) {\n $op = $form_state['clicked_button']['#value'];\n // Save uploaded files.\n if ($op == t('Upload')) {\n $file = $form_state['values']['file_image'];\n //dpm($file, \"open_badges_images_form_submit: The uploaded file\");\n file_set_status($file, FILE_STATUS_PERMANENT);\n }\n elseif ($op == t('Delete')) {\n foreach ($form_state['values']['images'] as $path => $is_removed) {\n if ($is_removed) {\n $to_delete[] = $path;\n }\n }\n if (is_array($to_delete)) {\n open_badges_image_delete($to_delete);\n }\n }\n}",
"public function uploadSmileyObject()\n {\n\tglobal $rbacsystem, $ilCtrl, $tpl, $lng;\n\n\tif( !$rbacsystem->checkAccess( 'write', $this->gui->ref_id ) )\n\t{\n\t $this->ilias->raiseError(\n\t\t$lng->txt( 'msg_no_perm_write' ), $this->ilias->error_obj->MESSAGE\n\t );\n\t}\n\n\t$this->initSmiliesForm();\n\n\tinclude_once \"Modules/Chatroom/classes/class.ilChatroomSmilies.php\";\n\tinclude_once('./Services/Form/classes/class.ilPropertyFormGUI.php');\n\n\t//$this->form_gui = new ilPropertyFormGUI();\n\n\t$this->form_gui->setValuesByPost();\t\n\t \n\t$keywords = ilChatroomSmilies::_prepareKeywords(\n\t ilUtil::stripSlashes( $_REQUEST[\"chatroom_smiley_keywords\"] )\n\t);\n\n\t$keywordscheck = count( $keywords ) > 0;\n\n\tif( !$this->form_gui->checkInput() )\n\t{\n\t $tpl->setContent( $this->form_gui->getHtml() );\n\t return $this->view();\n\t}\n\n\t$pathinfo = pathinfo( $_FILES[\"chatroom_image_path\"][\"name\"] );\n\t$target_file = md5( time() + $pathinfo['basename'] ) . \".\" . $pathinfo['extension'];\n\n\tmove_uploaded_file(\n\t $_FILES[\"chatroom_image_path\"][\"tmp_name\"],\n\t ilChatroomSmilies::_getSmiliesBasePath() . $target_file\n\t);\n\n\tilChatroomSmilies::_storeSmiley( join( \"\\n\", $keywords ), $target_file );\n\n\t$ilCtrl->redirect( $this->gui, \"smiley\" );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get departments name by id | function getDepartmentsName($id = null) {
// import department db
App::import('Model','Department');
$this->Department = & new Department();
# fetch list of active departments
$departments_name = $this->Department->find('all',array('conditions'=>array('Department.status'=>'1' , 'Department.id'=>$id),'fields'=>array('id','name')));
return $departments_name;
} | [
"public function getDepartmentName($id=NULL){\n\t\treturn $this->mysql_query(\"SELECT `dep_name_en`, `dep_name_fr` FROM career_employers\".(isset($id) ? \" WHERE id = '$id'\" : ''));\n\t}",
"public function get_department_name($id){\n\t\tglobal $con;\n\t\t$department_name=\"\";\n\t\t$query=\"SELECT name FROM system_departments\n\t\t\t\tWHERE id=\\\"$id\\\"\n\t\t\t\tLIMIT 1\";\n\t\t$result=array();\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$department_name=$value['name'];\n\t\t}\n\n\t\treturn $department_name;\n\t}",
"function get_department(int $id) : string\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->db->select('name');\n\t\t$CI->db->from('departements');\n\t\t$CI->db->where('id', $id);\n\t\treturn $CI->db->get()->row()->name;\n\t}",
"public function getDepartmentNameById($id)\n {\n $adapter = $this->getConnection();\n $select = $adapter->select()\n ->from($this->getMainTable(), 'name')\n ->where('entity_id = :entity_id');\n $binds = ['entity_id' => (int)$id];\n return $adapter->fetchOne($select, $binds);\n }",
"function getNameByDepartmentID($id){\n\t\tcheckConnectivity1();\n\n\t\t$query =sprintf(\"select name from department where ID = %s\",$id);\n\t\t$result =mysqli_query($GLOBALS['connection_link'],$query);\n\t\tif ($row = mysqli_fetch_assoc($result)) {\n\t\t\treturn $row['name'];\n\t\t}\n\t\treturn false;\n\t}",
"function getDepartmentName($department_id = null) {\n\t\t$result = $this->find('first', array('conditions' => array('Department.id' => $department_id , 'Department.status'=>1),'fields'=>array('Department.name')));\n\t\treturn $result['Department']['name'];\n\t}",
"function oos_get_ticket_department_name($ticket_department_id, $lang_id = '') {\n\n if ($ticket_department_id < 1) return TEXT_DEFAULT;\n if (!$lang_id) $lang_id = $_SESSION['language_id'];\n\n // Get database information\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $ticket_departmenttable = $oostable['ticket_department'];\n $query = \"SELECT ticket_department_name\n FROM $ticket_departmenttable\n WHERE ticket_department_id = '\" . $ticket_department_id . \"'\n AND ticket_languages_id = '\" . intval($lang_id) . \"'\";\n $result =& $dbconn->Execute($query);\n\n $ticket_department_name = $result->fields['ticket_department_name'];\n\n // Close result set\n $result->Close();\n\n return $ticket_department_name;\n }",
"public function getDepartmentByField($id, $field_name);",
"function obtener_nombre_departamento_por_id($id)\n {\n $departamento = new Departamento();\n $departamento->get_by_id($id);\n return $departamento->nombre_departamento;\n }",
"public function getDeptName()\n {\n $query = $this->db->select('name')\n ->where('id', $this->department)\n ->get('department');\n foreach ($query->result() as $row) {\n return $row->name;\n }\n }",
"public function getDepartment()\n\t{\n\t\t$this->load->database();\n\t\t$info = $this->db->query(\"Select department_name FROM departments WHERE department_id = \". $this->department_id);\n\t\treturn $info->row_array();\n\t}",
"public function getDepartmentByID($id) {\n\t\treturn $this->getAll()->where('id', $id)->firstOrFail();\n\t}",
"public function get_dept($division_id)\n\t{\n\t\t$this->db->select('department_id, dept_name');\n\t\t$this->db->from('department');\n\t\tif ($division_id == 'All') {}\n\t\telse{\n\t\t\t$this->db->where('division_id', $division_id);\n\t\t}\n\t\t$query = $this->db->get();\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getDepartmentId();",
"public function getDepartment(){\n\t\t\t$sql = \"select * from \".self::departmentTable;\n\t\t\t$rows = $this->executeGenericDQLQuery($sql);\n\t\t\t$department = array();\n\t\t\tfor($i = 0; $i < sizeof($rows); $i ++){\n\t\t\t\t$department[$i]['id'] = $rows[$i]['dep_id'];\n\t\t\t\t$department[$i]['name'] = $rows[$i]['dep_name'];\n\t\t\t}\n\t\t\t$this->sendResponse(200,$this->messages['dataFetched'],$department);\n\t\t}",
"public function get_department($department_id) {\n global $connection;\n\n $department_id_param = $connection->escape_string($department_id);\n $sql = \"SELECT * FROM departments WHERE department_id='$department_id_param' LIMIT 1\";\n\n $result = $this->query($sql);\n\n return $result[0]; \n }",
"public function getDepartment($id)\n {\n // If not found - returns default \"General department\"\n\n $model = Mage::getModel('helpdeskultimate/department');\n\n if ($id) {\n $model->load($id);\n }\n return $model;\n }",
"public function getDepartmentNameLegal();",
"function getDepotName($depot_id)\n\t{\n\t\treturn $this->newQuery()->where('depot_id','=',$depot_id)\n\t\t\t\t\t\t->getVal('name');\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a new namespaced payout gateway class | public function register($class)
{
if (!in_array($class, $this->payoutGateways)) {
$this->payoutGateways[] = $class;
}
} | [
"function psts_register_gateway($class_name, $name, $description, $demo = false) {\r\n global $psts_gateways;\r\n \r\n if (!is_array($psts_gateways)) {\r\n\t\t$psts_gateways = array();\r\n\t}\r\n\t\r\n\tif (class_exists($class_name)) {\r\n\t\t$psts_gateways[$class_name] = array($name, $description, $demo);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}",
"function edd_payza_register_gateway( $gateways ) {\r\n $gateways['payza'] = array( 'admin_label' => 'Payza', 'checkout_label' => __( 'Payza', 'eddap' ) );\r\n return $gateways;\r\n}",
"function edd_payza_register_gateway( $gateways ) {\n\t$gateways['payza'] = array( 'admin_label' => 'Payza', 'checkout_label' => __( 'Payza', 'eddap' ) );\n\treturn $gateways;\n}",
"function paybyte_init_gateway_class(){\n\t// it means WooCommerce is not installed on the site\n\t// so do nothing\n\tif ( ! class_exists( 'WC_Payment_Gateway' ) ) return;\n\t\n\t// If we made it this far, then include our Gateway Class\n\tinclude_once( 'woocommerce-paybyte-gateway.php' );\n\n\t// Now that we have successfully included our class,\n\t// Lets add it too WooCommerce\n\tadd_filter( 'woocommerce_payment_gateways', 'add_custom_gateway_class' );\n\tfunction add_custom_gateway_class( $methods ) {\n\t $methods[] = 'WC_Gateway_PayByte'; \n\t return $methods;\n\t}\n}",
"private function register()\n {\n add_filter('edd_payment_gateways', array($this, 'register_gateway'), 1, 1);\n }",
"abstract public function createSubscriptionGateway();",
"function midtrans_offinstallment_register_gateway($gateways) {\n\tglobal $edd_options;\n\t$checkout_label_offinstallment = 'Credit Card Installment for any Bank via Midtrans';\n\t//check checkout label field from backend, then set if not null and not empty string\n\tif(isset($edd_options['mt_checkout_label_offinstallment']) and $edd_options['mt_checkout_label_offinstallment'] != ''){\n\t\t$checkout_label_offinstallment = $edd_options['mt_checkout_label_offinstallment'];\n\t}\n\t$gateways['midtrans_offinstallment'] = array(\n\t\t'admin_label' => 'Midtrans Offline Installment',\n\t\t'checkout_label' => __($checkout_label_offinstallment, 'midtrans_offinstallment')\n\t);\n\treturn $gateways;\n}",
"function set_gateway($gateway_slug, $args) {\n\n // Set payments gateway\n md_set_gateway($gateway_slug, $args);\n \n }",
"function piratepay_add_to_gateways( $gateways ) {\n\t$gateways[] = 'PiratePay_WC_Gateway';\n\treturn $gateways;\n}",
"function sn_wc_mobilpay_init() {\r\n\t// it means WooCommerce is not installed on the site\r\n\t// so do nothing\r\n\tif ( ! class_exists( 'WC_Payment_Gateway' ) ) return;\r\n\tDEFINE ('SN_PLUGIN_DIR', plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) . '/' );\r\n\r\n\t// If we made it this far, then include our Gateway Class\r\n\tinclude_once( 'wc-mobilpay-gateway.php' );\r\n\r\n\t// Now that we have successfully included our class,\r\n\t// Lets add it too WooCommerce\r\n\tadd_filter( 'woocommerce_payment_gateways', 'sn_add_mobilpay_gateway' );\r\n\tfunction sn_add_mobilpay_gateway( $methods ) {\r\n\t\t$methods[] = 'SN_WC_MobilPay';\r\n\t\treturn $methods;\r\n\t}\r\n}",
"function spyr_BNG_Gateway_Emulator_init() {\n // it means WooCommerce is not installed on the site\n // so do nothing\n if ( ! class_exists( 'WC_Payment_Gateway' ) ) return;\n \n // If we made it this far, then include our Gateway Class\n include_once( 'woocommerce-bng.php' );\n \n // Now that we have successfully included our class,\n // Lets add it too WooCommerce\n add_filter( 'woocommerce_payment_gateways', 'spyr_add_BNG_Gateway_Emulator_gateway' );\n function spyr_add_BNG_Gateway_Emulator_gateway( $methods ) {\n $methods[] = 'SPYR_BNG_Gateway_Emulator';\n return $methods;\n }\n}",
"function add_topgroupshops_test_gateway( $methods )\n{\n $methods[ ] = 'WC_Gateway_TGS_Gateway_Test';\n return $methods;\n}",
"function add_123x_gateway($methods)\n{\n $methods[] = 'WC_Gateway_123x';\n return $methods;\n}",
"function gateway_init()\n{\n // it means WooCommerce is not installed on the site\n // so do nothing\n if (! class_exists('WC_Payment_Gateway'))\n return;\n\n // If we made it this far, then include our Gateway Class\n include_once ('alphagateway_class.php');\n include_once ('alphagatewaymasterpass_class.php');\n\n // Now that we have successfully included our class,\n // Lets add it too WooCommerce\n add_filter('woocommerce_payment_gateways', 'add_mygateway');\n\n function add_mygateway($methods)\n {\n $methods[] = 'WC_Gateway_Alpha';\n $methods[] = 'WC_Gateway_Alpha_Masterpass';\n return $methods;\n }\n}",
"function cornerstone_register_integration( $name, $class_name ) {\n\tCS()->integrations()->register( $name, $class_name )\n}",
"function wc_veruspay_add_to_gateways( $gateways ) {\n\t$gateways[] = 'WC_Gateway_VerusPay';\n\treturn $gateways;\n}",
"function wc_secipay_add_to_gateways( $gateways ) {\n\t$gateways[] = 'WC_Gateway_Secipay';\n\treturn $gateways;\n}",
"function rcp_register_webmoney_payment_gateway($gateways)\n{\n\treturn array_merge(array('webmoney' => array('label' => 'WebMoney', 'admin_label' => 'WebMoney', 'class' => 'RCP_Payment_Gateway_WebMoney')), $gateways);\n}",
"public static function register($name, $className)\n {\n if (array_key_exists($name, self::$gateways)) {\n throw GatewayException::gatewayAlreadyRegistered($name);\n }\n self::$gateways[$name] = $className;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the datagrids and the reports | private function parse()
{
// parse datagrids
if(!empty($this->datagrids)) $this->tpl->assign('datagrids', $this->datagrids);
} | [
"protected function parse()\n {\n // parse datagrids\n if (!empty($this->dataGrids)) {\n $this->tpl->assign('dataGrids', $this->dataGrids);\n }\n }",
"abstract protected function processDatagrid();",
"public function evaluate()\n\t{\n\t\t// Evaluate Form Name\t\t\n\t\tif($this->withform === false)\n\t\t{\n\t\t\tif(strlen(trim($this->formname)) <= 0)\n\t\t\t{\n\t\t\t\tthrow new \\Exception('valor [formname] es obligatorio con withform = false para generar Toxty_DataGrid');\t\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t\n\t\t// Evaluate control paginable data grid\n\t\tif($this->paginable===false)\n {\n \tif((is_array($this->data) && count($this->data)!=0))\n\t\t\t{\n\t\t\t\t$this->tamano = count($this->data);\n\t\t\t\t$this->gridcount = count($this->data);\n\t\t\t\t$this->pagecount = ceil($this->gridcount/$this->tamano);\n\t\t\t}\n }\n\t\t\n\t\tif($this->paginable===true)\n\t \t{\t\n\t\t\tif(!$this->urlpost){\n\t\t\t\tthrow new \\Exception('valor [url] es obligatorio para generar paginable Toxty_DataGrid');\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\tif(!is_array($this->data) || (is_array($this->data) && count($this->data)==0))\n\t\t\t{\n\t\t\t\t$this->paginable = false;\n\t\t\t\t$this->paginablefooter = false;\n\t\t\t}\n\t \t\t\t\t\t\t\t\n\t\t\tif(!$this->pagecount){\n\t\t\t\tif($this->pagecount==0){\n\t\t\t\t\t$this->pagecount = 1;\t\t\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tthrow new \\Exception('valor [pagecount] es indefinido para generar Toxty_DataGrid');\n\t\t\t\t}\t\t\n\t\t\t}\t\t\t\t\n\t\t\n\t\t\tif (is_numeric($this->tamanoperpage) && !array_key_exists($this->tamanoperpage, $this->perpage)) {\n\t \t\t$this->perpage[$this->tamanoperpage] = $this->tamanoperpage; \n\t\t\t\tksort($this->perpage);\n\t\t\t}\n\t\t\t\n\t\t\tif(!is_numeric($this->tamano)){\n\t\t\t\tthrow new \\Exception('valor [tamano] debe ser definido para generar Toxty_DataGrid');\n\t\t\t}\n\t\t\t\n\t\t\tif(!is_numeric($this->gridcount)){\n\t\t\t\tthrow new \\Exception('valor [gridcount] debe ser definido para generar Toxty_DataGrid');\n\t\t\t}\n\t\t\t$this->pagecount = ceil($this->gridcount/$this->tamano);\n\t\t}\n\t\t\n\t\t// Evaluate total count items in headers\n\t\tif(!is_array($this->data) || (is_array($this->data) && count($this->data)==0))\n\t\t{\n\t\t\t$this->countheader = false;\n\t\t}\t\n\t\t\n\t\t// Evaluate numerable and functnumerable\n\t\tif($this->numerable === true)\n\t\t{\n\t\t\tif($this->functnumerable && !is_array($this->functnumerable)){\n\t\t\t\tthrow new \\Exception('valor [functnumerable] debe ser array para generar column numerable Toxty_DataGrid');\n\t\t\t} \t\n\t\t\t\n\t\t\tif(is_array($this->functnumerable)){\t\t\t\t\t\n\t\t\t\t$arNumerable = array('enumerable' => array('_event' => $this->functnumerable));\t\t\t\t\t\n\t\t\t\t$this->headers = array_merge($arNumerable, $this->headers);\n\t\t\t}\t\n\t\t} \n\t\t\n\t\t// Evaluate delete \n\t\tif($this->delete === true)\n\t\t{\n\t\t\tif(!is_array($this->primarykey) || (is_array($this->primarykey) && count($this->primarykey)==0))\n\t\t\t{\n\t\t\t\tthrow new \\Exception('valor [primarykey] debe ser definido para generar column delete Toxty_DataGrid');\t\n\t\t\t}\n\t\t}\t\n\t\treturn true;\t\t\n\t}",
"public function getDataGrid()\n {\n $gridNode = $this->_html->findOneOrFail('xpath', '//div[@class=\"grid\"]');\n\n //Extract the column names\n $columnNames = $this->_html->findAllOrFailFromNode($gridNode, 'xpath', '//table/thead/tr[@class=\"headings\"]/th');\n $columnNames = array_map(function(NodeElement $node) {\n return $node->getText();\n }, $columnNames);\n\n //Extract the content\n $rows = $this->_html->findAllOrFailFromNode($gridNode, 'xpath', '//table/tbody/tr');\n $mappedCells = array_map(function(NodeElement $node) use ($columnNames) {\n\n //Extract the cells\n $cells = $node->findAll('css', 'td');\n\n //Sanity check the number of cells\n if(count($columnNames) !== count($cells))\n {\n throw new \\Exception('Cell and header count mismatch');\n }\n\n $result = [];\n /** @var NodeElement $cell */\n foreach($cells as $index => $cell)\n {\n $column = $columnNames[$index];\n $result[$column] = $cell->getText();\n }\n\n return $result;\n }, $rows);\n\n return new AdminDataGrid($columnNames, $mappedCells);\n }",
"public function loadReports() {\r\n \r\n //define variables\r\n $isSuccess = FALSE;\r\n $message = \"\";\r\n $data = array();\r\n $code = SuccessClass::$CODE_SUCCESSFUL;\r\n try\r\n { \r\n $message = '';\r\n $isSuccess = TRUE; \r\n\r\n //initialize an instance from success class\r\n $success = SuccessClass::initialize($isSuccess);\r\n\r\n if( $isSuccess )\r\n {\r\n //default settings for uigrid\r\n $page = 1;\r\n $size = 25;\r\n $order = '';\r\n $field = '';\r\n $params = array();\r\n \r\n //intialize uigrid request params\r\n if ($this->input->get('page')) {\r\n $page = $this->input->get('page');\r\n $size = $this->input->get('size');\r\n $field = $this->input->get('field') != '' ? $this->input->get('field') : $field;\r\n $order = $this->input->get('order') != '' ? $this->input->get('order') : $order;\r\n }\r\n\r\n //get customerid\r\n $customerid =$this->session->userdata('raptor_customerid');\r\n \r\n //intialize start page for uigrid\r\n $start = ($page - 1) * $size;\r\n \r\n //get Report Data\r\n $reportData = $this->reportclass->getReports($size, $start, $field, $order);\r\n \r\n $trows = $reportData['trows'];\r\n $data = $reportData['data'];\r\n \r\n $success -> setData($data);\r\n $success -> setTotal($trows);\r\n \r\n }\r\n }\r\n catch( Exception $e ) {\r\n \r\n $success = SuccessClass::initialize(FALSE);\r\n $message = $e->getMessage();\r\n $message = $message . \" - \" . $e->getTraceAsString(); \r\n //log the exception\r\n $this->logClass->log(\"exception : \", $message);\r\n $code = SuccessClass::$CODE_EXCEPTION_OCCURED;\r\n }\r\n\r\n //set the variables\r\n $success -> setMessage($message);\r\n $success -> setCode($code);\r\n $success -> setData($data);\r\n \r\n //convert response array to json and set output\r\n $this->output\r\n ->set_content_type('application/json')\r\n ->set_output(json_encode($success));\r\n }",
"public function main(){\r\n\t\t\t\t\t\r\n\t\t\r\n\t\tglobal $USER, $CFG, $SESSION, $PARSER;\r\n\t\t$conn = quickdb::get_connection();\r\n\t\tif(0){\r\n\t\t\t//turn off this block on production systems !\r\n\t\t\t$trunccount = $this->trunc_ilp_tables( $conn );\r\n\t\t\t$s = ( 1 == $trunccount ) ? '' : 's' ;\r\n\t\t\t$this->disp( \"$trunccount table$s truncated\" );\r\n\t\t}\r\n //$info will just contain user messages about the running of this script - does not affect the data writing\r\n\t\t$info = array( 'reportlist' => array(), \r\n\t\t\t\t'warninglist' => array(), \r\n\t\t\t\t'elementlist' => array()\r\n\t\t);\r\n\t\t\r\n\t\t$predefinedreports\t=\t$this->get_report_list();\r\n\t\t\r\n\t\tforeach($predefinedreports as $report ){\r\n\t\t\r\n //$outfile = $this->reports_dir . DIRECTORY_SEPARATOR . 'report' . $report[ 'title' ] . '.xml';\r\n //file_put_contents( $outfile, $this->generate_xml( $report ) );\r\n\t\t\t$report_title = $report[ \"title\" ];\r\n\t\t\t$report_description = $report[ \"description\" ];\r\n $report_type = isset($report[ \"type\" ]) ? $report[ \"type\" ] : null;\r\n\r\n\t\t\t$report_id = $this->create_report( $report_title, $report_description, $report_type );\r\n\t\t\tif( !empty($report_id )) {\r\n\t\t\t//if(1){\r\n\t\t\t\t$info[ 'reportlist' ][] = $report_title;\r\n\t\t\t\tforeach( $report[ \"fieldlist\" ] as $element ){\r\n\t\t\t\t\t$plugin_id = $this->get_element_type_id_from_control_type( $element[ \"type\" ] );\r\n\t\t\t\t\tif( $plugin_id ){\r\n\t\t\t\t\t\t$label = $element[ \"label\" ];\r\n\t\t\t\t\t\t$description = $element[ \"description\" ];\r\n\t\t\t\t\t\t$req = $element[ \"req\" ];\r\n\t\t\t\t\t\t//everything ok - add the element to the report\r\n\t\t\t\t\t\tif( $element_id = $this->apply_to_report( $conn, $report_id, $plugin_id, $label, $description, $req, $element ) ){\r\n\t\t\t\t\t\t\t$info[ 'elementlist' ][] = \"added $label to $report_title\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$info[ 'warninglist' ][] = \"Report already exists: $report_title\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $info;\r\n\t}",
"private function _data_parser() {\n\t\t$this->_set_cal_id();\n\t\t\n\t\tforeach ($this->data as $blockname => $block) {\n\t\t\tif (array_key_exists($blockname,self::$objectTranslation)) {\n\t\t\t\t$this->_store_objects($block,self::$objectTranslation[$blockname]);\n\t\t\t} else {\n\t\t\t\t//STUB\n\t\t\t}\n\t\t}\n }",
"public function formatToJgrid($data, $querytype) {\n\n //add and check specefic needed fields\n foreach ($data as $singleobject) {\n\n $f = (array) $singleobject;\n\n if ($querytype == 'timetablemonitor') {\n\n $fromdate = str_replace(\"-\", \"/\", $f[\"day\"]);\n\n $f['Id'] = \"<a class='expandwindow' href='/viewer/iconnex/protected/extensions/reportico/run.php?xmlin=timetabbyid.xml&execute_mode=EXECUTE&target_format=HTML&target_show_body=1&project=rti&MANUAL_id=\" . $f['id'] . \"&MANUAL_date_FROMDATE=\" . $fromdate . \"&MANUAL_date_TODATE=\" . $fromdate . \"' target='_blank'> </a>\";\n $f['operating'] = \"blank\";\n\n if ($f['duty_no'] == \"NODUTY\") {\n\n $f['duty_no'] = 'None';\n $n[] = $f;\n }\n if ($f['runningno'] == \"NOBLK\") {\n\n $f['duty_no'] = 'None';\n $n[] = $f;\n }\n } else {\n $f['Equipped'] = \"\";\n $f['activity_status'] = \"Unequipped\";\n\n if (empty($f['build_code'])) {\n\n $f['Equipped'] = 'Unequipped';\n $n[] = $f;\n }\n if (!empty($f['Build code'])) {\n $f['Equipped'] = 'Equipped';\n $n[] = $f;\n }\n if (($f['Build code']) && ( ($f['last_active_hour']) > 1 || !($f['Message time']) )) {\n $f['activity_status'] = 'offline';\n $n[] = $f;\n }\n if (($f['Build code']) && ($f['Message time']) && ($f['last_active_hour']) <= 1) {\n $f['activity_status'] = 'online';\n $n[] = $f;\n }\n }\n }\n\n //get the array key for the first array\n //the array keys represent the columnnames\n $colnamesarray = array_keys($data[0]);\n\n //counting the columns names\n $countcolnames = count($colnamesarray);\n\n\n //loop through each array\n foreach ($n as $key => $row) {\n\n //fullfill the new array as the format needed\n $rows[] = array(\n \"id\" => $key,\n \"cell\" => array(\n $row['route_code'],\n $row['Trip'],\n $row['start_time'],\n $row['event_code'],\n $row['day'],\n $row['duty_no'],\n $row['operator_code'],\n $row['Service'],\n $row['id'],\n $row['operating'],\n )\n );\n }\n\n //build the required part of the json\n $gridmodel = array(\n \"total\" => 1,\n \"page\" => 1,\n \"records\" => 1000000,\n \"rows\" => $rows,\n );\n\n\n\n //build the required part of the json with the columne names\n for ($i = 0; $i < $countcolnames; $i++) {\n\n //fulfill a new array\n $colmodelarray[] = array(\n \"name\" => $colnamesarray[$i],\n \"index\" => $colnamesarray[$i],\n \"editable\" => false,\n \"edittype\" => \"text\",\n \"sorttype\" => \"text\",\n \"stype\" => \"text\",\n \"jsonmap\" => $colnamesarray[$i],\n \"width\" => \"80\",\n );\n }\n\n //if the query is timetable remove those rows\n if (!empty($colnamesarray['holiday_op'])) {\n unset($colnamesarray['org_working_op']);\n unset($colnamesarray['org_working_noop']);\n unset($colnamesarray['org_holiday_op']);\n unset($colnamesarray['org_holiday_noop']);\n unset($colnamesarray['special_days_op']);\n unset($colnamesarray['special_days_noop']);\n }\n\n //build the final object needed\n $finaljson = array(\n \"JSON\" => \"success\",\n \"viewname\" => \"\",\n \"colmodel\" => $colmodelarray,\n \"colnames\" => $colnamesarray,\n \"minihide\" => array(),\n \"graphopt\" => false,\n \"buttons\" => array(),\n \"timestamp\" => date(\"Y-m-d h:m:s\"),\n \"gridmodel\" => $gridmodel,\n );\n\n\n\n return $finaljson;\n }",
"private function fillData()\n {\n $this->loadPrinters();\n $this->loadCartridges();\n $this->loadSituatedPrinters();\n $this->loadDepartments();\n }",
"private function parse_report_html()\n\t{\n\t\tob_start();\n\t\tinclude(LAYOUTS_DIR . $this->report_layout); //render page content as html into a variable\n\t\t$page_html = ob_get_contents();\n\t\tob_end_clean();\n\t\t// fix ampersand and angle brackets\n\t\t// decode HTML entity\n\t\t$page_html = str_replace(array('<', '>', '&'), array('_lt_', '_gt_', '_amp_'), $page_html);\n\t\t$page_html = html_entity_decode($page_html, ENT_QUOTES, 'UTF-8');\n\t\t$page_html = str_replace('&', '&', $page_html);\n\t\t$page_html = str_replace(array('_lt_', '_gt_', '_amp_'), array('<', '>', '&'), $page_html);\n\t\t// Load DOM\n\t\t$orignalLibEntityLoader = libxml_disable_entity_loader(true);\n\t\t$doc = new \\DOMDocument();\n\t\t@$doc->loadHTML($page_html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_NOEMPTYTAG);\n\t\tlibxml_disable_entity_loader($orignalLibEntityLoader);\n\t\t//extract only the report part\n\t\t$page_body = $doc->getElementById(\"page-report-body\");\n\t\tif (!empty($page_body)) {\n\t\t\t$xpath = new DOMXPath($page_body->ownerDocument);\n\t\t\t$hide_columns = 'contains(attribute::class, \"td-btn\") or contains(attribute::class, \"td-checkbox\")';\n\t\t\tif (!$this->report_list_sequence) {\n\t\t\t\t$hide_columns .= ' or contains(attribute::class, \"td-sno\")';\n\t\t\t}\n\t\t\tif (!empty($this->report_hidden_fields)) {\n\t\t\t\tforeach ($this->report_hidden_fields as $fieldname) {\n\t\t\t\t\t$hide_columns .= \" or contains(attribute::class, 'td-$fieldname')\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$hide_columns = \"//*[$hide_columns]\";\n\t\t\t//remove the unwanted table cell\n\t\t\t$remove_tags = $xpath->query($hide_columns);\n\t\t\tif (!empty($remove_tags)) {\n\t\t\t\tforeach ($remove_tags as $e) {\n\t\t\t\t\t$e->parentNode->removeChild($e); // Delete this node\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->report_links == true) {\n\t\t\t\t//this will remove the href from the links\n\t\t\t\t$links = $xpath->query(\"//td/a\");\n\t\t\t\tif (!empty($links)) {\n\t\t\t\t\tforeach ($links as $link) {\n\t\t\t\t\t\t$link->removeAttribute('href'); //remove link href attribute\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$report_body = $this->innerHTML($page_body);\n\t\t\t//now we are done with manipulating the report body\n\t\t\t//place the report body inside the report layout\n\t\t\t$layout_body = $doc->getElementById(\"report-body\");\n\t\t\t$this->setInnerHTML($layout_body, $report_body);\n\t\t\t$docf = $doc->saveHTML();\n\t\t\treturn html_entity_decode($docf); //get the html of the report\n\t\t}\n\t\treturn null;\n\t}",
"public function getForm() {\n $this->initializeForm();\n\n $filters = array();\n $fieldInfos = array();\n\n $queries = $this->xml->xpath(\"/rapi:report/rapi:query\");\n\n $tables = $this->xml->xpath(\"/rapi:report/rapi:table\");\n\n /// Filters and sorting.\n foreach ($tables as $table) {\n $numConcatFields = 0;\n $fields = $table->xpath(\"/rapi:report/rapi:table[@name='{$table[\"name\"]}']/rapi:fields/rapi:field\");\n $labels = $table->xpath(\"/rapi:report/rapi:table[@name='{$table[\"name\"]}']/rapi:fields/rapi:field/@label\");\n $filters = new TableLayout(count($fields) + 1, 5);\n\n $filters\n ->add(Element::create(\"Label\", \"Field\")->addCssClass(\"header-label\"), 0, 0)\n ->add(Element::create(\"Label\", \"Options\")->addCssClass(\"header-label\"), 0, 1)\n ->add(Element::create(\"Label\", \"Exclude\")->addCssClass(\"header-label\"), 0, 4)\n ->resetCssClasses()\n ->addCssClass(\"filter-table\")\n ->setRenderer(\"default\");\n\n $sortingField = new SelectionList(\"Sorting Field\", \"{$table[\"name\"]}_sorting_field\");\n $grouping1 = new SelectionList();\n\n $i = 1;\n\n foreach ($fields as $key => $field) {\n if (isset($field[\"labelsField\"]))\n continue;\n\n if (count(explode(\",\", (string) $field)) == 1) {\n $fieldInfo = Model::resolvePath((string) $field);\n $model = Model::load($fieldInfo[\"model\"]);\n $fieldName = $fieldInfo[\"field\"];\n $fieldInfo = $model->getFields(array($fieldName));\n $fieldInfo = $fieldInfo[0];\n $fields[$key] = (string) $field;\n\n $sortingField->addOption(str_replace(\"\\\\n\", \" \", $fieldInfo[\"label\"]), $model->getDatabase() . \".\" . $fieldInfo[\"name\"]);\n $grouping1->addOption(str_replace(\"\\\\n\", \" \", $field[\"label\"]), (string) $field);\n\n if (array_search($model->getKeyField(), $this->referencedFields) === false || $fieldInfo[\"type\"] == \"double\" || $fieldInfo[\"type\"] == \"date\") {\n switch ($fieldInfo[\"type\"]) {\n case \"integer\":\n case \"double\":\n $filters\n ->add(Element::create(\"Label\", str_replace(\"\\\\n\", \" \", (string) $field[\"label\"])), $i, 0)\n ->add(Element::create(\"SelectionList\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_option\")\n ->addOption(\"Equals\", \"EQUALS\")\n ->addOption(\"Greater Than\", \"GREATER\")\n ->addOption(\"Less Than\", \"LESS\")\n ->addOption(\"Between\", \"BETWEEN\")\n ->setValue(\"BETWEEN\"), $i, 1)\n ->add(Element::create(\"TextField\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_start_value\")->setAsNumeric(), $i, 2)\n ->add(Element::create(\"TextField\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_end_value\")->setAsNumeric(), $i, 3);\n //->add(Element::create(\"Checkbox\",\"\",\"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_ignore\",\"\",\"1\"),$i,4);\n break;\n\n case \"date\":\n case \"datetime\":\n $filters\n ->add(Element::create(\"Label\", str_replace(\"\\\\n\", \" \", (string) $field[\"label\"])), $i, 0)\n ->add(Element::create(\"SelectionList\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_option\")\n ->addOption(\"Before\", \"LESS\")\n ->addOption(\"After\", \"GREATER\")\n ->addOption(\"On\", \"EQUALS\")\n ->addOption(\"Between\", \"BETWEEN\")\n ->setValue(\"BETWEEN\"), $i, 1)\n ->add(Element::create(\"DateField\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_start_date\")->setId(\"{$table[\"name\"]}_{$fieldInfo[\"name\"]}_start_date\"), $i, 2)\n ->add(Element::create(\"DateField\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_end_date\")->setId(\"{$table[\"name\"]}_{$fieldInfo[\"name\"]}_end_date\"), $i, 3);\n //->add(Element::create(\"Checkbox\",\"\",\"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_ignore\",\"\",\"1\"),$i,4);\n break;\n\n case \"enum\":\n $enum_list = new SelectionList(\"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_value\");\n $enum_list->setMultiple(true);\n foreach ($fieldInfo[\"options\"] as $value => $label) {\n $enum_list->addOption($label, $value);\n }\n if (!isset($field[\"value\"])) {\n $filters\n ->add(Element::create(\"Label\", str_replace(\"\\\\n\", \" \", (string) $field[\"label\"])), $i, 0)\n ->add(Element::create(\"SelectionList\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_option\")\n ->addOption(\"Is any of\", \"INCLUDE\")\n ->addOption(\"Is none of\", \"EXCLUDE\")\n ->setValue(\"INCLUDE\"), $i, 1)\n ->add($enum_list, $i, 2);\n }\n //->add(Element::create(\"Checkbox\",\"\",\"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_ignore\",\"\",\"1\"),$i,4);\n break;\n\n case \"string\":\n case \"text\":\n $filters\n ->add(Element::create(\"Label\", str_replace(\"\\\\n\", \" \", (string) $field[\"label\"])), $i, 0)\n ->add(Element::create(\"SelectionList\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_option\")\n ->addOption(\"Is exactly\", \"EXACTLY\")\n ->addOption(\"Contains\", \"CONTAINS\")\n ->setValue(\"CONTAINS\"), $i, 1)\n ->add(Element::create(\"TextField\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_value\"), $i, 2);\n //->add(Element::create(\"Checkbox\",\"\",\"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_ignore\",\"\",\"1\"),$i,4);\n break;\n }\n if (isset($field[\"hide\"])) {\n $filters->add(Element::create(\"HiddenField\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_ignore\", \"1\"), $i, 4);\n } else {\n $filters->add(Element::create(\"Checkbox\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_ignore\", \"\", \"1\"), $i, 4);\n }\n } else {\n $enum_list = new ModelSearchField();\n $enum_list->setName(\"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_value\");\n $enum_list->setModel($model, $fieldInfo[\"name\"]);\n $enum_list->addSearchField($fieldInfo[\"name\"]);\n $enum_list->boldFirst = false;\n $filters\n ->add(Element::create(\"Label\", str_replace(\"\\\\n\", \" \", (string) $field[\"label\"])), $i, 0)\n ->add(Element::create(\"SelectionList\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_option\")\n ->addOption(\"Is any of\", \"IS_ANY_OF\")\n ->addOption(\"Is none of\", \"IS_NONE_OF\")\n ->setValue(\"IS_ANY_OF\"), $i, 1)\n ->add(Element::create(\"MultiFields\")->setTemplate($enum_list), $i, 2)\n ->add(Element::create(\"Checkbox\", \"\", \"{$table[\"name\"]}.{$fieldInfo[\"name\"]}_ignore\", \"\", \"1\"), $i, 4);\n }\n } else {\n $grouping1->addOption(str_replace(\"\\\\n\", \" \", $field[\"label\"]), $field);\n $filters\n ->add(Element::create(\"Label\", str_replace(\"\\\\n\", \" \", (string) $field[\"label\"])), $i, 0)\n ->add(Element::create(\"SelectionList\", \"\", \"{$table[\"name\"]}_concat_{$numConcatFields}_option\")\n ->addOption(\"Is exactly\", \"EXACTLY\")\n ->addOption(\"Contains\", \"CONTAINS\")\n ->setValue(\"CONTAINS\"), $i, 1)\n ->add(Element::create(\"TextField\", \"\", \"{$table[\"name\"]}_concat_{$numConcatFields}_value\"), $i, 2)\n ->add(Element::create(\"Checkbox\", \"\", \"{$table[\"name\"]}_concat_{$numConcatFields}_ignore\", \"\", \"1\"), $i, 4);\n $numConcatFields++;\n }\n $i++;\n }\n\n $grouping1->setName(\"{$table[\"name\"]}_grouping[]\")->setLabel(\"Grouping Field 1\");\n $g1Paging = new Checkbox(\"Start on a new page\", \"grouping_1_newpage\", \"\", \"1\");\n $g1Logo = new Checkbox(\"Repeat Logos\", \"grouping_1_logo\", \"\", \"1\");\n $g1Summarize = new Checkbox(\"Summarize\", \"grouping_1_summary\", \"\", \"1\");\n\n $grouping2 = clone $grouping1;\n $grouping2->setName(\"{$table[\"name\"]}_grouping[]\")->setLabel(\"Grouping Field 2\");\n $g2Paging = new Checkbox(\"Start on a new page\", \"grouping_2_newpage\", \"\", \"1\");\n $g2Logo = new Checkbox(\"Repeat Logos\", \"grouping_2_logo\", \"\", \"1\");\n\n $grouping3 = clone $grouping1;\n $grouping3->setName(\"{$table[\"name\"]}_grouping[]\")->setLabel(\"Grouping Field 3\");\n $g3Paging = new Checkbox(\"Start on a new page\", \"grouping_3_newpage\", \"\", \"1\");\n $g3Logo = new Checkbox(\"Repeat Logos\", \"grouping_3_logo\", \"\", \"1\");\n\n $sortingField->setLabel(\"Sorting Field\");\n $sortingField->setName($table[\"name\"] . \"_sorting\");\n\n $groupingTable = new TableLayout(3, 4);\n\n $groupingTable->add($grouping1, 0, 0);\n $groupingTable->add($g1Paging, 0, 1);\n $groupingTable->add($g1Logo, 0, 2);\n $groupingTable->add($g1Summarize, 0, 3);\n\n $groupingTable->add($grouping2, 1, 0);\n /* $groupingTable->add($g2Paging, 1, 1);\n $groupingTable->add($g2Logo, 1, 2); */\n $groupingTable->add($grouping3, 2, 0);\n\n $container = new FieldSet($table[\"name\"]);\n $container->setId(\"{$table[\"name\"]}_options\");\n $container->add(\n Element::create(\"FieldSet\", \"Filters\")->add($filters)->setId(\"table_{$table['name']}\"), Element::create(\"FieldSet\", \"Sorting & Limiting\")->add(\n $sortingField, Element::create(\"SelectionList\", \"Direction\", \"{$table[\"name\"]}.sorting_direction\")->addOption(\"Ascending\", \"ASC\")->addOption(\"Descending\", \"DESC\"), Element::create('TextField', 'Limit', \"{$table['name']}.limit\")->setAsNumeric()\n )->setId(\"{$table['name']}_sorting_fs\"), Element::create(\"FieldSet\", \"Grouping\")->\n setId(\"{$table['name']}_grouping_fs\")->\n add($groupingTable)\n );\n $sortingField->setName($table[\"name\"] . \"_sorting\");\n $this->form->add($container);\n }\n\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\", Application::getLink($this->path . \"/generate\"));\n $this->form->addAttribute(\"target\", \"blank\");\n\n return $this->form;\n }",
"protected function parse()\n {\n $data = [];\n\n foreach ($this->data as $key => $value) {\n\n if (count($value) === 8) {\n $data[] = $this->parseEntity($value);\n }\n\n if (count($value) === 10) {\n $data[] = $this->parseIndividual($value);\n }\n\n }\n\n $this->data = $data;\n }",
"public function prepareParsing()\n {\n $this->saverHelper->createFirstSheet();\n }",
"function demographicreport(){\n\t\t// city\n\t\t$this->countHelper('City','locationCityName','City','locationCityArray' );\n\t\t// state\n\t\t$this->countHelper('State','locationStateName','State','locationStateArray' );\n\t\t// gender\n\t\t$this->countHelper('gender','genderName','gender','genderArray' );\n\t\t// yearborn\n\t\t$this->countHelper('yearborn','yearBornName','yearborn','yearBornArray' );\n\t\t//education\n\t\t$this->countHelper('education','educationName','education','educationArray' );\n\t\t// income\n\t\t$this->countHelper('income','incomeName','income','incomeArray' );\n\t\t// martial\n\t\t$this->countHelper('maritalstatus','maritalName','maritalstatus','maritalArray' );\n\t\t// family\n\t\t$this->countHelper('familystatus','familyName','familystatus','familyArray' );\n\t\t$this->passOverviewData();\n\n\t}",
"private function parseTextReport()\n {\n $lines = file($this->pathToReport, FILE_IGNORE_NEW_LINES);\n $loadReport = NULL;\n\t\tif (is_array($lines))\n\t\t{\n\t\t\t$section = \"batch_summary\";\n\t\t\tforeach ($lines as $line)\n\t\t\t{\n\t\t\t\tif ($section == \"batch_summary\") \n\t\t\t\t{\n \tif (strpos($line, self::BATCH_ID_LINE_PREFIX) === 0)\n \t{\n \t// BATCH ID\n \t$batchID = trim(substr($line, strlen(self::BATCH_ID_LINE_PREFIX)));\n \t$this->setBatchID($batchID);\n \t} \n \telseif (strpos($line, self::BATCH_DIRECTORY_LINE_PREFIX) === 0)\n \t{\n \t// BATCH DIRECTORY NAME\n \t$batchDir = trim(substr($line, strlen(self::BATCH_DIRECTORY_LINE_PREFIX)));\n \t$this->setBatchDirectoryName($batchDir);\n \t} \n \telseif (strpos($line, self::BATCH_NAME_LINE_PREFIX) === 0)\n \t{\n \t// BATCH NAME\n \t$batchName = trim(substr($line, strlen(self::BATCH_NAME_LINE_PREFIX)));\n \t$this->setBatchName($batchName);\n \t} \n \telseif (strpos($line, self::OWNER_LINE_PREFIX) === 0)\n \t{\n \t// OWNERS\n \t$owner = trim(substr($line, strlen(self::OWNER_LINE_PREFIX)));\n \t$this->setOwner($owner);\n \t} \n \telseif (strpos($line, $this->getFileListSectionPrefix()) === 0)\n \t{\n \t// done with batch summary section -\n \t// entering the file list section\n \t$section = \"file_list\";\n \t} \n \t} \n \telseif ($section == \"file_list\")\n \t{ \n \tif (strpos($line, self::RELATION_LIST_SECTION_LINE_PREFIX) === 0){\n \t// done with file list section -\n \t// entering the relationship list section\n \t$section = \"rel_list\";\n \t} \n \telse \n \t{\n \t\t\n \t\t// treat it as a file line\n \t$fields= explode(\"\\t\", $line);\n \t\n \tif (count($fields) > 11)\n \t{\n \t\tif (!$this->isDescriptor($fields))\n \t\t{\n \t\t\tif ($this->drsVersion == DRSDropperConfig::DRS)\n \t\t\t{\n\t \t\t\t$reportFile = $this->getDRSLoadReportFile($fields);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$reportFile = $this->getDRS2LoadReportFile($fields);\n \t\t\t}\n\t\t\t\t\t\t\t\t$this->addFile($reportFile);\n \t\t}\n \t} \n } \n }\n elseif ($section == \"rel_list\")\n {\n \t//Don't need this area\n \tbreak;\n }\n\t\t\t}\n\t\t}\n return $loadReport;\n }",
"private function _getDeliveryReport(){\n\t\t/* $Widget\t= new Widget($this->_objDataOperation, $this->getCompanyCode());\n\t\t$Widget->setBackUpTableTrigger('server_list_3');exit; */\n\t\t/* variable initialization */\n\t\t$strWhereArr \t\t\t= $strQueryArr\t= $strFormattedArr = $strDeliveryDateArr = array();\n\t\t$intFromMonth\t\t\t= (date('m')-3);\n\t\t$intToMonth\t\t\t\t= (date('m')+3);\n\t\t$strStatusArr\t\t\t= (array)json_decode(STATUS_GROUP_ARR);\n\t\t\n\t\t$intFromDate\t\t\t= getDates(-90,8).'01';\n\t\t$intToDate\t\t\t\t= getDates(90,8).'31';\n\t\t\n\t\t/* Get the dates */\n\t\t$strPrevioisDateRangArr\t= getDatesIntervalByQauter(getQauter($intFromMonth),$intFromMonth);\n\t\t$this->_strDateRangArr\t= getDatesIntervalByQauter(getQauter($intToMonth),$intToMonth);\n\t\t\n\t\t/* if previous date found then do needful */\n\t\tif(isset($strPrevioisDateRangArr['from'])){\n\t\t\t/* set the from date */\n\t\t\t$this->_strDateRangArr['from']\t= $strPrevioisDateRangArr['from'];\n\t\t}\n\t\t\n\t\t/* if status error is not empty then do needful */\n\t\tif(!empty($strStatusArr)){\n\t\t\t/* setting default values */\n\t\t\t$intDiffColumnName\t= '';\n\t\t\t$intDateColumnName\t= '';\n\t\t\t\n\t\t\t/* iterating the status loop */\n\t\t\tforeach($strStatusArr as $strStatusArrKey => $strStatusArrValues){\n\t\t\t\t/* based on the case do needful */\n\t\t\t\tswitch($strStatusArrKey){\n\t\t\t\t\tcase 'dev':\n\t\t\t\t\t\t$intDiffColumnName = 'dev_diff';\n\t\t\t\t\t\t$intDateColumnName = '`dev-closure-date`';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'it_uat':\n\t\t\t\t\t\t$intDiffColumnName = 'it_uat_diff';\n\t\t\t\t\t\t$intDateColumnName = '`uat-released-date`';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'biz_uat':\n\t\t\t\t\t\t$intDiffColumnName = 'biz_uat_diff';\n\t\t\t\t\t\t$intDateColumnName = '`biz-uat-release-date`';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'live':\n\t\t\t\t\t\t$intDiffColumnName = 'live_diff';\n\t\t\t\t\t\t$intDateColumnName = '`go-live-date`';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Hold/Drop':\n\t\t\t\t\tcase 'Dev Not Started':\n\t\t\t\t\t\t$intDiffColumnName = '-10000.00';\n\t\t\t\t\t\t$intDateColumnName = '`go-live-date`';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Creating query array */\n\t\t\t\t$strQueryArr\t= array(\n\t\t\t\t\t\t\t\t\t\t\t'table'=>array($this->_strSecondayTableName,$this->_strWorkItemTableName),\n\t\t\t\t\t\t\t\t\t\t\t'join' =>array('', $this->_strSecondayTableName.'.`devops-user-story-id` = '.$this->_strWorkItemTableName.'.user_story_id'),\n\t\t\t\t\t\t\t\t\t\t\t'column'=>array($this->_strSecondayTableName.'.`delivery-leader-spoc-`',$this->_strSecondayTableName.'.`system-vertical`',$this->_strSecondayTableName.'.status','count('.$this->_strSecondayTableName.'.id) as total_delivery','AVG('.$intDiffColumnName.') as avg_diff', 'year('.$this->_strSecondayTableName.'.'.$intDateColumnName.') as delivery_year', 'month('.$this->_strSecondayTableName.'.'.$intDateColumnName.') as delivery_month','date_format('.$this->_strSecondayTableName.'.'.$intDateColumnName.',\"%Y%m28\") as delivery_date'),\n\t\t\t\t\t\t\t\t\t\t\t'where'=>array($this->_strSecondayTableName.'.type'=>array(23), $this->_strSecondayTableName.'.'.$intDateColumnName.' >='=>$this->_strDateRangArr['from'],$this->_strSecondayTableName.'.'.$intDateColumnName.' <='=>$this->_strDateRangArr['to'],'status'=>$strStatusArrValues),\n\t\t\t\t\t\t\t\t\t\t\t'group'=>array($this->_strSecondayTableName.'.`delivery-leader-spoc-`',$this->_strSecondayTableName.'.`system-vertical`',$this->_strSecondayTableName.'.status','year('.$this->_strSecondayTableName.'.'.$intDateColumnName.')','month('.$this->_strSecondayTableName.'.'.$intDateColumnName.')'),\n\t\t\t\t\t\t\t\t\t\t\t'order'=>array('month('.$this->_strSecondayTableName.'.'.$intDateColumnName.')'=>'asc')\n\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t/* executing the query */\n\t\t\t\t$strDataSetArr \t= $this->_objDataOperation->getDataFromTable($strQueryArr);\n\t\t\t\t\n\t\t\t\t/* if data array found then do needful */\n\t\t\t\tif(!empty($strDataSetArr)){\n\t\t\t\t\t/* iterating the loop */\n\t\t\t\t\tforeach($strDataSetArr as $strDataSetArrKey => $strDataSetArrValue){\n\t\t\t\t\t\t/* Set the value */\n\t\t\t\t\t\t$strFormattedArr[]\t= array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'user_code'=>$strDataSetArrValue['delivery-leader-spoc-'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'vertical_code'=>$strDataSetArrValue['system-vertical'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'status_code'=>$strDataSetArrValue['status'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'avarage_tat'=>$strDataSetArrValue['avg_diff'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'total_delivery_count'=>$strDataSetArrValue['total_delivery'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'delivery_year'=>$strDataSetArrValue['delivery_year'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'delivery_month'=>$strDataSetArrValue['delivery_month'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'delivery_date'=>$strDataSetArrValue['delivery_date'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'record_date'=>date('Ymd')\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t/* Set the delivery date */\n\t\t\t\t\t\t$strDeliveryDateArr[$strDataSetArrValue['delivery_date']]\t= $strDataSetArrValue['delivery_date'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* removed the used variable */\n\t\t\t\tunset($strQueryArr['where'],$strQueryArr['column'], $strDataSetArr);\n\t\t\t}\n\t\t\t\n\t\t\t/* if data found then do needful */\n\t\t\tif(!empty($strFormattedArr)){\n\t\t\t\t/* delete the older data */\n\t\t\t\t$this->_objDataOperation->getDirectQueryResult(\"DELETE FROM trans_quarter_delivery_count WHERE delivery_date in(\".implode(\",\",$strDeliveryDateArr).\")\");\n\t\t\t\t/* Insert data */\n\t\t\t\t$this->_objDataOperation->setBulkInset(array('table'=>' trans_quarter_delivery_count','data'=>$strFormattedArr));\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* removed used variable */\n\t\tunset($strWhereArr,$strQueryArr,$strFormattedArr);\n\t}",
"function get_response_data($reports){\n\n for ( $reportIndex = 0; $reportIndex < count( $reports ); $reportIndex++ ) {\n $report = $reports[ $reportIndex ];\n $header = $report->getColumnHeader();\n $dimensionHeaders = $header->getDimensions();\n $rows = $report->getData()->getRows();\n\n $data['Dimension'] = array();\n $data['Metric'] = array();\n\n\n for ( $rowIndex = 0; $rowIndex < count($rows); $rowIndex++) {\n $row = $rows[ $rowIndex ];\n $dimensions = $row->getDimensions();\n $metrics = $row->getMetrics();\n for ($i = 0; $i < count($dimensionHeaders) && $i < count($dimensions); $i++) {\n \n if('date' == $_POST['api_data']['dimension']['format'])\n $d = date('d M', strtotime($dimensions[$i]) );\n else\n $d = $dimensions[$i];\n \n array_push($data['Dimension'], $d );\n }\n\n for ($j = 0; $j < count($metrics); $j++) {\n $values = $metrics[$j]->getValues();\n for ($k = 0; $k < count($values); $k++) {\n $entry = $metricHeaders[$k];\n array_push($data['Metric'], $values[$k]);\n }\n }\n }\n }\n\n return $data;\n }",
"public function loadJobReports() {\r\n \r\n //define variables\r\n $isSuccess = FALSE;\r\n $message = \"\";\r\n $data = array();\r\n $code = SuccessClass::$CODE_SUCCESSFUL;\r\n try\r\n { \r\n $jobid = $this->input->get('jobid');\r\n \r\n if( !isset($jobid) )\r\n $message = 'jobid cannot be null.';\r\n\r\n $isSuccess = ( $message == \"\" ); \r\n\r\n //initialize an instance from success class\r\n $success = SuccessClass::initialize($isSuccess);\r\n\r\n if( $isSuccess )\r\n {\r\n //default settings for uigrid\r\n $page = 1;\r\n $size = 25;\r\n $order = 'desc';\r\n $field = 'doctype, dateadded';\r\n $params = array();\r\n\r\n //intialize uigrid request params\r\n if ($this->input->get('page')) {\r\n $page = $this->input->get('page');\r\n $size = $this->input->get('size');\r\n $field = $this->input->get('field') != '' ? $this->input->get('field') : $field;\r\n $order = $this->input->get('order') != '' ? $this->input->get('order') : $order;\r\n }\r\n \r\n //intialize start page for uigrid\r\n $start = ($page - 1) * $size;\r\n \r\n $editReport = $this->sharedclass->getFunctionalSecurityAccess($this->session->userdata('raptor_contactid'), 'EDIT_REPORT');\r\n \r\n //get document data\r\n $documentDate = $this->documentclass->getJobReports($size, $start, $field, $order, $jobid);\r\n \r\n $trows = $documentDate['trows'];\r\n $data = $documentDate['data'];\r\n \r\n //format data for uigrid\r\n foreach ($data as $key => $value) {\r\n\r\n $docname = $value['docname'];\r\n $reportid = '';\r\n if($docname != '' && $editReport == \"1\") {\r\n $docnameArr = explode(\".\", $docname);\r\n $docnameArr = explode(\"_\", $docnameArr[0]);\r\n if(isset($docnameArr[1]) && $docnameArr[1] != '') {\r\n $reportid = (int)$docnameArr[1];\r\n }\r\n }\r\n //$data[$key]['docurl'] = $this->config->item('document_path').$value['documentid'].'.'.$value['docformat']; \r\n $data[$key]['dateadded'] = format_date($value['dateadded'], RAPTOR_DISPLAY_DATEFORMAT);\r\n $data[$key]['reportid'] = $reportid;\r\n $data[$key]['edit_report'] = $editReport;\r\n }\r\n $success -> setData($data);\r\n $success -> setTotal($trows);\r\n \r\n }\r\n }\r\n catch( Exception $e ) {\r\n \r\n $success = SuccessClass::initialize(FALSE);\r\n $message = $e->getMessage();\r\n $message = $message . \" - \" . $e->getTraceAsString(); \r\n //log the exception\r\n $this->logClass->log(\"exception : \", $message);\r\n $code = SuccessClass::$CODE_EXCEPTION_OCCURED;\r\n }\r\n\r\n //set the variables\r\n $success -> setMessage($message);\r\n $success -> setCode($code);\r\n $success -> setData($data);\r\n \r\n //convert response array to json and set output\r\n $this->output\r\n ->set_content_type('application/json')\r\n ->set_output(json_encode($success));\r\n }",
"public function Reports() {\n\t\t$processedReports = array();\n\t\t$subClasses = ClassInfo::subclassesFor('SSReport');\n\t\t\n\t\tif($subClasses) {\n\t\t\tforeach($subClasses as $subClass) {\n\t\t\t\tif($subClass != 'SSReport') {\n\t\t\t\t\t$processedReports[] = new $subClass();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$reports = new DataObjectSet($processedReports);\n\t\t\n\t\treturn $reports;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retourne l'objet currency en euro | public function getEuroCurrency()
{
return mage::getModel('directory/currency')->load('EUR');
} | [
"public function getCurrency();",
"public function getToCurrency();",
"public function getCurrency()\n {\n }",
"public function getAmountCurrency();",
"public function getCurrency(): string\n {\n return $this->currency;\n }",
"public function getProductCurrency();",
"public function currency()\n {\n return $this->currency;\n }",
"public static function get_currency():string { return self::$currency; }",
"public function getCurrency()\n {\n return $this->get('currency');\n }",
"public function getBaseCurrency();",
"public function getCurrencyCode();",
"public static function getValorEuro()\n {\n return self::getCotacao('euro');\n }",
"public function getGiftCardCurrency();",
"public function display_currency()\n\t{\n\t\treturn $this->get_insist('purchase')->display_currency();\n\t}",
"public function Currency()\n {\n $currency = EcommercePayment::site_currency();\n return $currency;\n }",
"public function getCurrency()\r\n\t{\r\n\t\treturn $this->getTransaction()->getCurrency();\r\n\t}",
"public function getPriceCurrency()\n {\n return $this->priceCurrency;\n }",
"public function getDefaultCurrency(): string;",
"public function getOrderPriceCurrency(): string\n {\n return $this->_data->price->currency;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the readmore button should display | function wpex_has_readmore() {
// Display by default
$bool = true;
// Disable if posts are set to display full content
if ( 'post' == get_post_type()
&& ! strpos( get_the_content(), 'more-link' )
&& ! wpex_get_mod( 'blog_exceprt', true ) ) {
$bool = false;
}
// Don't show for password protected posts
if ( post_password_required() ) {
$bool = false;
}
// Apply filters
$bool = apply_filters( 'wpex_has_readmore', $bool );
// Return bool
return $bool;
} | [
"function suitbuilder_implement_read_more( $more ) {\n global $suitbuilder_customizer_all_values;\n\n $flag_apply_excerpt_read_more = apply_filters( 'suitbuilder_filter_excerpt_read_more', true );\n if ( true !== $flag_apply_excerpt_read_more ) {\n return $more;\n }\n\n $output = $more;\n\n if( 1 == $suitbuilder_customizer_all_values['suitbuilder-latest-blog-enable-button'] ){\n $read_more_text = esc_html__('Read more','suitbuilder');\n }\n if ( ! empty( $read_more_text ) ) {\n $output = ' <div class=\"read-more-text\"><a href=\"' . esc_url( get_permalink() ) . '\" class=\"read-more\">' . $read_more_text . '</a></div>';\n $output = apply_filters( 'suitbuilder_filter_read_more_link' , $output );\n }\n return $output;\n\n }",
"function chandelier_elated_read_more_button($option = '', $class = '') {\r\n\t\tif($option != '') {\r\n\t\t\t$show_read_more_button = chandelier_elated_options()->getOptionValue($option) == 'yes';\r\n\t\t}else {\r\n\t\t\t$show_read_more_button = 'yes';\r\n\t\t}\r\n\t\tif($show_read_more_button && !chandelier_elated_post_has_read_more() && !post_password_required()) {\r\n\t\t\techo chandelier_elated_get_button_html(array(\r\n\t\t\t\t'link' => get_the_permalink(),\r\n\t\t\t\t'text' => esc_html__('Read More', 'chandelier'),\r\n\t\t\t\t'custom_class' => $class . ' eltd-read-more',\r\n\t\t\t\t'type'\t\t\t=> 'transparent',\r\n\t\t\t\t'icon_pack'\t\t=> 'font_elegant',\r\n\t\t\t\t'fe_icon'\t\t=> 'arrow_right',\r\n\t\t\t\t'font_weight'\t=> '700'\r\n\t\t\t));\r\n\t\t}\r\n\t}",
"function affinity_mikado_read_more_button($option = '', $class = '') {\n\t\tif ($option != '') {\n\t\t\t$show_read_more_button = affinity_mikado_options()->getOptionValue($option) == 'yes';\n\t\t} else {\n\t\t\t$show_read_more_button = 'yes';\n\t\t}\n\t\tif ($show_read_more_button && !affinity_mikado_post_has_read_more() && !post_password_required()) {\n\t\t\techo affinity_mikado_get_button_html(array(\n\t\t\t\t'size' => 'small',\n\t\t\t\t'link' => get_the_permalink(),\n\t\t\t\t'text' => esc_html__('Read More', 'affinity'),\n\t\t\t\t'custom_class' => $class\n\t\t\t));\n\t\t}\n\t}",
"function athen_has_readmore() {\n\n // Display by default\n $bool = true;\n\n // Disable if posts are set to display full content\n if ( 'post' == get_post_type()\n && ! strpos( get_the_content(), 'more-link' )\n && ! athen_get_mod( 'blog_exceprt', true ) ) {\n $bool = false;\n }\n\n // Don't show for password protected posts\n if ( post_password_required() ) {\n $bool = false;\n }\n\n // Apply filters\n $bool = apply_filters( 'athen_has_readmore', $bool );\n\n // Return bool\n return $bool;\n\n}",
"function flow_elated_post_has_read_more() {\n\t\tglobal $post;\n\n\t\treturn strpos($post->post_content, '<!--more-->');\n\t}",
"function eltd_post_has_read_more() {\n\t\tglobal $post;\n\n\t\treturn strpos($post->post_content, '<!--more-->');\n\t}",
"function eltd_read_more_button($option = '', $class = '') {\n\t\tglobal $eltd_options;\n\n\t\t$show_read_more_button = 'yes';\n\n\t\tif(isset($eltd_options[$option]) && $eltd_options[$option] !== '') {\n\t\t\t$show_read_more_button = $eltd_options[$option];\n\t\t}\n\n\t\tif($show_read_more_button == 'yes' && !eltd_post_has_read_more() && !post_password_required()) {\n\t\t\techo apply_filters(\n\t\t\t\t'eltd_read_more_button',\n\t\t\t\t'<a href=\"'.get_the_permalink().'\" target=\"_self\" class=\"qbutton small read_more_button '.$class.'\">'.__(\"Read More\", \"eltd\").'</a>',\n\t\t\t\t$option,\n\t\t\t\t$class\n\t\t\t);\n\t\t}\n\t}",
"public function willShowMoreLink() {\n return $this->showMore ? true : false;\n }",
"function kloe_qodef_post_has_read_more() {\n\t\tglobal $post;\n\n\t\treturn strpos($post->post_content, '<!--more-->');\n\t}",
"function voyage_mikado_post_has_read_more() {\n global $post;\n\n return strpos($post->post_content, '<!--more-->');\n }",
"function chandelier_elated_post_has_read_more() {\r\n\t\tglobal $post;\r\n\r\n\t\treturn strpos($post->post_content, '<!--more-->');\r\n\t}",
"function aton_qodef_post_has_read_more() {\n\t\tglobal $post;\n\n\t\treturn strpos($post->post_content, '<!--more-->');\n\t}",
"function mixtape_qodef_post_has_read_more() {\n\t\tglobal $post;\n\n\t\treturn strpos($post->post_content, '<!--more-->');\n\t}",
"public static function read_more() {\n\t\treturn '<a class=\"more-link dt\" href=\"' . get_permalink() . '\">' . esc_html__( 'Читать дальше', 'wr-nitro' ) . '<span class=\"dib ts-03\">→</span></a>';\n\t}",
"function the_automobile_excerpt_more( $more ) {\n\n\t\t$flag_apply_excerpt_read_more = apply_filters( 'the_automobile_filter_excerpt_read_more', true );\n\t\tif ( true !== $flag_apply_excerpt_read_more ) {\n\t\t\treturn $more;\n\t\t}\n\n\t\t$output = $more;\n\t\t$read_more_text = esc_html__('Read More','the-automobile');\n\t\tif ( ! empty( $read_more_text ) ) {\n\t\t\t$output = ' <a href=\"'. esc_url( get_permalink() ) . '\" class=\"read-more\">' . esc_html( $read_more_text ) . '</a>';\n\t\t\t$output = apply_filters( 'the_automobile_filter_read_more_link' , $output );\n\t\t}\n\t\treturn $output;\n\n\t}",
"function quasar_read_more($target='_self'){\n\tglobal $post;\n\n\tif(!$post || (!$post->ID)) return;\n\t\n\t$return = ' <a href=\"'.get_permalink().'\" target=\"'.$target.'\">'.__('read more','quasar').' <i class=\"fa-angle-double-right\"></i></a>';\n\t\n\treturn $return;\n}",
"function all_business_slider_post_more($cmsmasters_id, $show = true) {\r\n\t$cmsmasters_post_read_more = get_post_meta($cmsmasters_id, 'cmsmasters_post_read_more', true);\r\n\t\r\n\t\r\n\tif ($cmsmasters_post_read_more == '') {\r\n\t\t$cmsmasters_post_read_more = esc_attr__('Continue reading', 'all-business');\r\n\t}\r\n\t\r\n\t\r\n\t$out = '<a class=\"cmsmasters_post_read_more\" href=\"' . esc_url(get_permalink($cmsmasters_id)) . '\">' . esc_html($cmsmasters_post_read_more) . '</a>';\r\n\t\r\n\t\r\n\tif ($show) {\r\n\t\techo $out;\r\n\t} else {\r\n\t\treturn $out;\r\n\t}\r\n}",
"function agriflex_continue_reading_link() {\n\n\treturn ' <span class=\"read-more\"><a href=\"' . get_permalink() . '\">' .\n\t__( 'Read More →', 'agriflex' ) . '</a></span>';\n\n}",
"function cyprus_readmore() {\n\t?>\n\t<div class=\"readMore\">\n\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title_attribute(); ?>\"><?php esc_html_e( 'Read More', 'cyprus' ); ?></a>\n\t</div>\n\t<?php\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the fixtures to always load when preparing the test fixtures. | protected function getAlwaysLoadingFixtures() : array
{
return [];
} | [
"private function getFixtures()\n {\n $fixtures = [\n 'AppBundle\\DataFixtures\\ORM\\LoadCountryData',\n 'AppBundle\\DataFixtures\\ORM\\LoadLocalityData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightTypeData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightData',\n 'AppBundle\\DataFixtures\\ORM\\LoadUserData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightReviewData',\n ];\n\n $this->loadFixtures($fixtures);\n }",
"private function getFixtures()\n {\n $fixtures = [\n 'AppBundle\\DataFixtures\\ORM\\LoadCountryData',\n 'AppBundle\\DataFixtures\\ORM\\LoadLocalityData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightTypeData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightTourData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightTicketData',\n 'AppBundle\\DataFixtures\\ORM\\LoadUserData',\n ];\n\n $this->loadFixtures($fixtures);\n }",
"private function getLoadedFixtures()\n {\n if (null === $this->loaded) {\n $conn = $this->em->getConnection();\n\n if (!$conn->getSchemaManager()->tablesExist(['fixtures'])) {\n $columns = [\n 'name' => new Column('name', Type::getType('string'), [\n 'length' => 255\n ]),\n ];\n\n $table = new Table('fixtures', $columns);\n $table->setPrimaryKey(['name']);\n\n $conn->getSchemaManager()->createTable($table);\n }\n\n $this->loaded = array_map(function ($r) {\n return $r['name'];\n }, $conn->fetchAll('SELECT name FROM fixtures'));\n }\n\n return $this->loaded;\n }",
"protected function loadDataFixtures()\n {\n $fixtures = array(\n 'TeamManager\\PlayerBundle\\DataFixtures\\ORM\\LoadPlayerData',\n 'TeamManager\\TeamBundle\\DataFixtures\\ORM\\LoadTeamData',\n 'TeamManager\\EventBundle\\DataFixtures\\ORM\\LoadGameData',\n 'TeamManager\\EventBundle\\DataFixtures\\ORM\\LoadGameFriendlyData',\n 'TeamManager\\EventBundle\\DataFixtures\\ORM\\LoadTrainingData',\n 'TeamManager\\ActionBundle\\DataFixtures\\ORM\\LoadCardData',\n 'TeamManager\\ActionBundle\\DataFixtures\\ORM\\LoadGoalData',\n 'TeamManager\\ActionBundle\\DataFixtures\\ORM\\LoadInjuryData',\n 'TeamManager\\ActionBundle\\DataFixtures\\ORM\\LoadPlayTimeData'\n );\n return $fixtures;\n }",
"protected function getFixtures()\n {\n return [];\n }",
"private function fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::className(),\n 'dataFile' => codecept_data_dir() . 'debt/user.php',\n ],\n 'contact' => [\n 'class' => ContactFixture::className(),\n 'dataFile' => codecept_data_dir() . 'debt/contact.php',\n ],\n 'debt_redistribution' => [\n 'class' => DebtRedistributionFixture::className(),\n 'dataFile' => codecept_data_dir() . 'debt/debt_redistribution.php',\n ],\n 'debt' => [\n 'class' => DebtFixture::className(),\n 'dataFile' => codecept_data_dir() . 'debt/debt.php',\n ],\n ];\n }",
"abstract protected function getFixtures();",
"protected function loadFixtures()\n {\n $fixtures = FixtureSet::createFixtures(base_path($this->getFixturePath()), $this->fixtureSetsToLoad, $this->fixtureClassNames, []);\n $byName = [];\n foreach ($fixtures as $fixture) {\n $byName[$fixture->getName()] = $fixture;\n }\n return $byName;\n }",
"public static function loadDataFixtures()\n {\n static::loadWebsiteFixtures();\n }",
"protected function getFixtures()\n {\n return [__DIR__.'/alice.yml'];\n }",
"public function loadFixtures()\n {\n $fixtures = $this->getProperty($this->fixtureManager, '_fixtureMap');\n\n foreach (array_keys($fixtures) as $fixture) {\n parent::loadFixtures($fixture);\n }\n }",
"protected function setUpFixtures()\n {\n $this->modelCache = [];\n\n $clz = get_class($this);\n if (!empty(static::$alreadyLoadedFixtures[$clz])) {\n $this->loadedFixtures = static::$alreadyLoadedFixtures[$clz];\n } else {\n $this->loadedFixtures = $this->loadFixtures();\n static::$alreadyLoadedFixtures[$clz] = $this->loadedFixtures;\n }\n }",
"protected static function loadFixtures()\n {\n $entityManager = static::$container->get('doctrine')->getManager();\n $loader = new Loader();\n\n static::addFixtures($loader, static::getFixtures());\n\n $purger = new ORMPurger($entityManager);\n $executor = new ORMExecutor($entityManager, $purger);\n $executor->execute($loader->getFixtures());\n }",
"protected function loadFixtures()\n {\n $this->manager = $this->getContainer()->get('sulu_document_manager.document_manager');\n\n $this->hotel1 = $this->createSnippet(\n 'hotel',\n [\n 'en' => [\n 'title' => 'Le grande budapest (en)',\n ],\n 'de' => [\n 'title' => 'Le grande budapest',\n ],\n ]\n );\n\n $this->hotel2 = $this->createSnippet(\n 'hotel',\n [\n 'de' => [\n 'title' => 'L\\'Hôtel New Hampshire',\n ],\n ]\n );\n\n $page = new PageDocument();\n $page->setTitle('Hotels Page');\n $page->setStructureType('hotel_page');\n $page->setResourceSegment('/hotels');\n $page->getStructure()->bind([\n 'hotels' => [\n $this->hotel1->getUuid(),\n $this->hotel2->getUuid(),\n ],\n ]);\n\n $this->manager->persist($page, 'de', [\n 'path' => '/cmf/sulu_io/contents/hotels',\n ]);\n\n $page->setTitle('Hotels');\n $page->setShadowLocaleEnabled(true);\n $page->setShadowLocale('de');\n $page->getStructure()->bind([\n 'hotels' => [],\n ]);\n\n $this->manager->persist($page, 'en', [\n 'path' => '/cmf/sulu_io/contents/hotels',\n ]);\n\n $this->car1 = $this->createSnippet('car', ['de' => ['title' => 'C car']]);\n $this->createSnippet('car', ['de' => ['title' => 'B car']]);\n $this->createSnippet('car', ['de' => ['title' => 'A car']]);\n\n $this->manager->flush();\n }",
"protected function loadBundlesFixtures()\n {\n return array(\n 'AxstradTestPageExtensionBundle',\n );\n }",
"public function getModelFixtures()\n {\n $fixturesPath = realpath(dirname(__FILE__). '/../fixtures');\n $fixtures = Yaml::parse(file_get_contents($fixturesPath. '/'. $this->getModelFile(). '.yml'));\n\n return $fixtures;\n }",
"public function loadFixtures()\n {\n // Using Live Environment?\n \n if ($this->loadFixturesDisabled()) {\n return;\n }\n \n // Initialise:\n \n $errored = false;\n \n // Load Fixture Files:\n \n foreach ($this->config()->fixtures as $file) {\n \n try {\n \n // Attempt Fixture Loading:\n \n YamlFixture::create($file)->writeInto($this->factory);\n \n } catch (Exception $e) {\n \n $errored = true;\n \n $message = $e->getMessage();\n \n if (strpos($message, 'YamlFixture::') === 0 && strpos($message, 'not found') !== false) {\n $message = sprintf('Cannot load fixture file: %s', $file);\n }\n \n DB::alteration_message(\n sprintf(\n 'App fixture loading failed with exception: \"%s\"',\n $message\n ),\n 'error'\n );\n \n }\n \n }\n \n if (!$errored) {\n \n // Update App Status:\n \n $this->FixturesLoaded = true;\n \n // Record App Status:\n \n $this->write();\n \n }\n }",
"protected static function getFixtures()\n {\n return new ArrayCollection([\n new EavTypeFixture(),\n new EavAttributeFixture(),\n ]);\n }",
"protected function loadCachedFixture() {\n\t\t$this->fixture_loaded = false;\n\t\t$base_cmd = dirname(__FILE__).\"/fixtures.sh\";\n\t\t$ret = 0;\n\t\tpassthru(\"$base_cmd --exists {$this->fixture}\", $ret); ob_flush();\n\t\tif ($ret != 0) {\n\t\t\t# wait until the test starts (with a valid Selenium session) to generate the fixture\n\t\t} else {\n\t\t\tpassthru(\"$base_cmd {$this->fixture}\", $ret); ob_flush();\n\t\t\tif ($ret != 0)\n\t\t\t\tdie(\"Error running: $base_cmd {$this->fixture}\");\n\t\t\t$this->fixture_loaded = true;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if a method is passed in the $_GET Url parameter example url[0] = the controller url[1] = the method url[2] = parameter url[3] = parameter url[4] = parameter calling the methods | private function _callControllerMethod()
{
$length = count($this->_url);
if($length > 1)
{
if(!method_exists($this->_controller, $this->_url[1]))
{
$this->_error();
}
}
switch ($length) {
case 5:
//controller->method(param1,param2,param3)
$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4]);
break;
case 4:
//controller->method(param1,param2)
$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3]);
break;
case 3:
//controller->method(param1)
$this->_controller->{$this->_url[1]}($this->_url[2]);
break;
case 2:
//controller->method(param1,param2,param3)
$this->_controller->{$this->_url[1]}();
break;
default:
$this->_controller->index();
break;
}
} | [
"private function _method_to_load() {\n\n //if(count($this->_url) > 3) {\n // $this->_error();\n //}\n\n if(isset($this->_url[1]) && method_exists($this->controller, $this->_url[1])) {\n $method = strtolower($this->_url[1]);\n\n if(isset($this->_url[2]) && !empty($this->_url[2])) {\n $param = $this->_url[2];\n $this->controller->$method($param);\n } else {\n $this->controller->$method();\n }\n\n } elseif(empty($this->_url[1])) {\n $this->controller->index();\n\n } else {\n $this->_error();\n }\n }",
"public function isMethodGET();",
"public static function isGET(){return self::$method==='GET';}",
"private function url()\n {\n //check that there is query string entered in url or not\n if (!empty($_SERVER['QUERY_STRING']))\n {\n //explode()---> convert string into array\n $url=explode(\"/\",$_SERVER['QUERY_STRING']);\n //filled the value of controller with the first element of array\n $this->controller=isset($url[0])?$url[0].\"controller\":\"homecontroller\";\n //filled the value of method with the second element of array\n $this->method=isset($url[1])?$url[1]:\"index\";\n //unset()----> Delete the first two element in the array (controller,method)\n unset($url[0],$url[1]);\n //array_values()---->Make the array index begins from zeroBased again\n $this->params=array_values($url);\n // echo \"<pre>\";\n // print_r($this->params);\n }\n else\n {\n $this->controller = 'homecontroller';\n $this->method = 'index';\n }\n\n }",
"function is_get_method() {\n\t\t\treturn $_SERVER['REQUEST_METHOD'] === 'GET';\n\t\t}",
"private function _loadControllerMethods()\n\t\t{\n\t\t\t$lenght = count($this->_url);\n\t\t\tif ($lenght > 1) {\n\t\t\t\tif (!method_exists($this->_controller, $this->_url[1])) {\n\t\t\t\t\t$this->_loadNotFound();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch ($lenght) {\n\t\t\t\tcase 5:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4],$this->_url[5]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->_controller->index();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"private function setControllerMethod()\r\n {\r\n if(!$this->route) return;\r\n\r\n $currentRoute = $this->routes[$this->routeKey];\r\n\r\n $methods = isset($currentRoute['methods']) ? $currentRoute['methods'] : array();\r\n\r\n if(!$methods) return;\r\n\r\n foreach($methods AS $requestType => $requestMethods)\r\n {\r\n foreach($requestMethods AS $method)\r\n {\r\n if(is_array($method))\r\n {\r\n if($this->route[0] == $method[0])\r\n {\r\n $this->method = array_shift($this->route);\r\n\r\n $this->numOfArgs--;\r\n\r\n $this->expectedArgs = $method[1];\r\n\r\n if(strtoupper($requestType) == 'POST')\r\n {\r\n $this->requestShouldBePost = true;\r\n }\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n if($this->route[0] == $method)\r\n {\r\n $this->method = array_shift($this->route);\r\n\r\n $this->numOfArgs--;\r\n\r\n if(strtoupper($requestType) == 'POST')\r\n {\r\n $this->requestShouldBePost = true;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }",
"private function _detect_method()\n {\n \t$method = strtolower($this->input->server('REQUEST_METHOD'));\n \tif(in_array($method, array('get', 'delete', 'post', 'put')))\n \t{\n\t \treturn $method;\n \t}\n\n \treturn 'get';\n }",
"public function setMethod()\n {\n if (isset($this->url[1])) {\n if (method_exists($this->controller, $this->url[1])) {\n $this->method = $this->url[1];\n }\n unset($this->url[1]);\n }\n }",
"private function isValidMethod() { \n\n\t $method = $this->method; \n\t if (!$method || $method == \"\") { return FALSE; } \n\t\telse { \n\t $meth = strtolower($method); \n\t if ($meth==\"post\" || $meth==\"get\") { return TRUE; } \n\t\t\telse { return FALSE; } \n\t } \n\t}",
"function CompareUrl(string $url,string $Route,string $method){\n if($url != '/'){$url = rtrim($url,\"/\");}\n $fetshedUrlData = fetshUrlRoute($url,$Route);\n if($fetshedUrlData['state'] == 1){\n if($_SERVER['REQUEST_METHOD'] == $method){\n return array(\n \"state\" => 1,\n \"params\" => $fetshedUrlData[\"params\"]\n );\n }else{\n return array(\n \"state\" => 0,\n \"params\" => \"\"\n );\n }\n }else{\n return array(\n \"state\" => 0,\n \"params\" => \"\"\n );\n }\n}",
"public function getMethod() {\r\n\t\tif (isset($_GET[$this->config->get('methodParam')]))\r\n\t\t\treturn urldecode($_GET[$this->config->get('methodParam')]);\r\n\t\telse\r\n\t\t\treturn $this->config->get('defaultMethod');\r\n\t}",
"public function getAndUseUrlParams()\n {\n // Get params\n $this->params = $this->url ? array_values($this->url) : [null];\n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }",
"public function isGet(){ return ($_SERVER['REQUEST_METHOD'] == \"GET\"); }",
"public static function detectGETParameters() {\t\t\n\t\tereg($_GET[self::$app->getGPPageName()] . \"(.*)\", self::$app->getPathInfo(), $matches);\n\t\t$params = explode('/', $matches[1]);\n\t\t$length = count($params);\n\t\tfor($i = 1; $i < $length - 1; $i += 2) {\n\t\t\t$_REQUEST[$params[$i]] = $_GET[$params[$i]] = self::decodeParam($params[$i + 1]);\n\t\t}\n\t}",
"private function getUrlData()\n {\n if (isset($_GET['path'])) {\n\n $path = $_GET['path'];\n\n $path = rtrim($path, '/');\n $path = filter_var($path, FILTER_SANITIZE_URL);\n $path = explode('/', $path);\n\n $this->controller = ucfirst(chk_array($path, 0));\n $this->action = chk_array($path, 1);\n\n if (chk_array($path, 2)) {\n unset($path[0]);\n unset($path[1]);\n\n $this->parameters = array_values($path);\n }\n }\n }",
"private function _parse_url_params ()\n { \n // Check if the URL is like any of the route options of this application. Uses REST. Done with a regex.\n if ( isset( $this->_routes[$_SERVER['REQUEST_METHOD']] ) )\n {\n foreach ( $this->_routes[$_SERVER['REQUEST_METHOD']] as $route )\n {\n // If there is a match, stop looking for more\n $uri = explode( '?', str_replace( API_PATH, '/', $_SERVER['REQUEST_URI'] ) );\n if ( preg_match( '@^'.preg_replace( '@:([^/]+)@si', '(?P<\\1>[^/]+)', \"/{$this->_api_name}\".$route[0] ).'$@', $uri[0], $this->_params ) )\n {\n array_shift( $this->_params );\n return $route;\n }\n }\n }\n\n // If the route is not set in the router variables\n $this->redirect( 404 );\n }",
"private function doRequest() {\r\n // Only continue if we are dealing with the correct types of method-types\r\n if ($_GET['method'] == 'get' || $_GET['method'] == 'post' || $_GET['method'] == 'put' || $_GET['method'] == 'delete') {\r\n // We're good to go, continuing the request. Checking if the method exsists #1\r\n if (array_key_exists($this->method_url['real'], $this->path)) {\r\n $method_name = strtolower($_GET['method']).'_'.$this->path[$this->method_url['real']];\r\n\r\n // Checking if the method exsists #2\r\n if (method_exists($this->className,$method_name)) {\r\n // Check to see if we have the required number of arguments represented\r\n $ReflectionClass = new ReflectionClass($this->className);\r\n if ($ReflectionClass->getMethod($method_name)->getNumberOfParameters() == count($this->method_url['args'])) {\r\n // Setting the rest of the response-codes\r\n $this->setReponseState(200, 'ok');\r\n\r\n // The request goes into the response-element\r\n $this->response['response'] = call_user_func_array(array($this, $method_name), $this->method_url['args']);\r\n }\r\n else {\r\n // We're missing arguments for the function\r\n $this->setReponseState(114, 'Required arguments missing'); \r\n } \r\n }\r\n else {\r\n $this->setReponseState(115, 'Unknown method');\r\n }\r\n }\r\n else {\r\n $this->setReponseState(101, 'Unknown method');\r\n }\r\n }\r\n else {\r\n $this->setReponseState(113, 'No such call method');\r\n }\r\n }",
"public function getUrl()\n {\n if(isset($_GET['url'])){\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n return $url;\n }else{\n return $url = [$this->currentController, $this->currentMethod];\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the specified availability. | public function show(Availability $availability)
{
//
} | [
"public static function display($availability) {\n if ($availability == 0) {\n echo \"Out of Stock\";\n } else if ($availability == 1) {\n echo \"In Stock\";\n }\n }",
"private static function echo_availability() {\n\n // Get the base Availability field.\n $availability = self::get_meta( 'availability' );\n\n // If it's set to custom, check the custom availability value.\n if( 'Custom' == $availability ) {\n\n $value = self::get_meta( 'custom-availability' );\n\n // Was a custom availability set?\n if( $value ) {\n\n // Yes, convert it to the valid date format.\n $availability = date( 'Y-m-d', strtotime( $value ));\n }\n\n }\n\n // Finally, if we have an availability date, use it.\n if( $availability ) { ?>\n <Availability><?php echo esc_html( $availability ); ?></Availability>\n <?php }\n }",
"public function availabilityAction()\n {\n // Append breadcrumbs\n $this->view->getBreadcrumbBag()->addOne('Cars', 'Rentcar:Admin:Car@indexAction')\n ->addOne('Bookings', 'Rentcar:Admin:Booking@indexAction')\n ->addOne('Availability graph');\n\n // Use datetime from query string if available, otherwise use current date and time\n $datetime = $this->request->getQuery('datetime', TimeHelper::getNow());\n\n return $this->view->render('booking/availability', [\n 'cars' => $this->getModuleService('bookingService')->fetchCars($datetime),\n 'datetime' => $datetime\n ]);\n }",
"public function getMyAvailability(){\n\n\t\t$this->layout->content = View::make('lotto.availability.home')->with(array(\n\n\t\t\t'user' => Auth::user(), \n\t\t\t'userAvailability' => Auth::user()->availability,\n\t\t\tSession::all()\n\n\t\t));\n\n\t}",
"public function getAvailability()\n {\n return $this->availability;\n }",
"public function getAvailability()\n\t{\n\t\treturn $this->availability;\n\t}",
"public function setAvailability($availability)\n {\n $this->availability = $availability;\n }",
"public static function getAvailabilityText($availability) {\n switch ($availability) {\n case '1':\n return 'В наличии';\n break;\n case '0':\n return 'Под заказ';\n break;\n }\n }",
"public function printRoomAvailability($room)\n\t{\n\t\techo \"<table border='1' class='roomAvailabilityList'>\n\t\t\t<tr>\n\t\t\t\t<th>Room Number</th>\n\t\t\t\t<th>Capacity</th>\n\t\t\t\t<th>Residents</th>\n\t\t\t\t<th>Available Slots</th>\n\t\t\t</tr>\";\n\t\tfor($ctr=0; $ctr<count($room); $ctr++)\n\t\t{\n\t\t\techo \"<tr>\n\t\t\t\t<td>\".$room[$ctr][0].\"</td>\n\t\t\t\t<td>\".$room[$ctr][1].\"</td>\n\t\t\t\t<td>\".$room[$ctr][2].\"</td>\n\t\t\t\t<td>\".$room[$ctr][3].\"</td>\n\t\t\t</tr>\";\n\t\t}\n\t\techo \"</table>\";\n\t}",
"public function availability(){return $this->availability;}",
"function availabilityColor($available) {\n\tif ($available == 'available') { \n\t\treturn \"<font color='green'><i>Available.</i></font>\";\n\t\t} else {\n\t\treturn \"<font color='red'><i>Not Available.</i></font>\";\n\t\t}\n }",
"public function getAvailabilityStatus()\n {\n return $this->availabilityStatus;\n }",
"public function getBeauticianAvailability() {\n $user = \\Auth::user();\n $arePaymentDetailsSet = !empty($user->stripe_bank_account_id)?1:0;\n return view('beautician.availability')->with('arePaymentDetailsSet',$arePaymentDetailsSet);\n }",
"public function availability_get()\n {\n $this->load->model('Availability');\n $availability = NULL;\n $user = get_user();\n\n if ($user->user_type_id == USER_TYPE_COUNSELOR) {\n $timeslots = $this->Availability->get_by_user($user->id);\n } else {\n $counselor = get_counselor($user->id);\n if ($counselor) {\n $counselor_id = $this->User->get_id($counselor->uuid);\n $timeslots = $this->Availability->get_by_user($counselor_id);\n }\n }\n\n if ($timeslots) {\n $availability = new stdClass;\n $availability->timeslots = decorate_availabilities($timeslots, $user);\n\n $this->response($availability);\n exit;\n }\n\n $this->response(array());\n }",
"public function getAvailabilitySystemName() {}",
"public function getAvailabilitySl()\n {\n return (string) request()->user()->tutor->availableLive;\n }",
"public function availability($availability, $IdItem) {\r\n\t\t$this->relateEntityWithConcept ( $availability, $IdItem, 'pangea:hasAvailability', 'skosxl:prefLabel', 'pangea:Availability' );\r\n\t}",
"public function create()\n\t{\n\t\treturn View::make('avail.availability');\n\t}",
"public function getAvailability(): int\n {\n return $this->availability;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the count of occurences for a given raw facet value, possibly in the result set corresponding to a given reference search ID. | public function getFacetValueCount($indexName, $rawFacetValue, $searchId = null)
{
// Search for the raw value in the reference search result set
// (the third parameter to "initQuery" below) to get an
// occurence count.
$value = wcmBizsearch::escapeQuery($rawFacetValue);
$queryString = $indexName . ':' . wcmBizsearch::quoteQueryValue($value, true);
$result = $this->initQuery($queryString, null, $searchId);
if ($result === null)
return 0;
list($nativeQuery, $queryString) = $result;
$count = $this->database->executeScalar($nativeQuery['queryCount']);
if ($count === null)
{
$this->lastErrorMsg = $this->database->getErrorMsg();
$this->project->logger->logError($this->lastErrorMsg);
return 0;
}
return $count;
} | [
"public function getfacetCount() {\n \n $solrVars = array(\n 'indent' => $this->indent,\n 'version' => $this->version,\n 'fq' => $this->fq,\n 'start' => $this->start,\n 'rows' => 0,//$this->rows,\n 'fl' => $this->fl,\n //'qt' => $this->qt,\n 'wt' => $this->wt,\n 'explainOther'=> $this->explainOther,\n 'hl.fl' => $this->hl_fl,\n 'facet'\t\t=> 'true',\n 'facet.field' => 'keyword',\n 'facet.sort' => 'true',\n 'facet.offset' => 0,\n 'facet.limit' => -1,\n 'facet.mincount' => $this->facetCount,\n 'q' => trim($this->queryString,'+')\n );\n\n $solrVarsStr = '';\n foreach($solrVars as $key => $val) {\n $solrVarsStr .= $key.'='.trim($val).'&';\n }\n\n //this is final query\n $finalUrl = rtrim($this->solrUrl.'select?'.$solrVarsStr,'&'); \n\n //$data = file_get_contents($finalUrl);\n try {\n $obj = new Utility_SolrQueryAnalyzer($finalUrl,__FILE__.' at line '.__LINE__);\n $data = $obj->init();\n } catch (Exception $e) {\n trigger_error($e->getMessage());\n }\n \n \n if(!empty($data)) {\n $xmlData = simplexml_load_string($data);\n $search = array();\n $counter = 0;\n $dataArray = $xmlData->lst[1]->lst[1]->lst->int;\n return count($dataArray);\n } \n }",
"public function count() {\n\t\treturn count($this->_facets) ;\n\t}",
"function s4w_get_facet_result_count($fqitms, $searchtxt=\"\") {\n $output = new stdclass();\n $output->status = FALSE; \n //if no facet items have been supplied return appropriate msg\n if(count($fqitms)>0) {\n //if no qry is given send wildcard (\"*\") as the search txt\n $qry = (strlen($qry)>0)?$searchtxt:\"*\";\n //order the result by post date DESC\n $sort = \"postdate desc\";\n //query solr\n $results = s4w_query($qry, 0, 0, $fqitms, $sort);\n if ($results) {\n $output->status = TRUE; \n $output->itemsfound = $results->response->numFound;\n $output->time = $results->responseHeader->QTime/1000;\n }\n else { // no result returned\n $output->msg = \"No result\";\n }\n }\n else { //no facet items provided\n $output->msg = 'No query facets provided';\n }\n return $output;\n}",
"public function Count() \r\n\t{\r\n\t\t$i = 0;\r\n\t\tforeach (array_keys($this->arr_search_object) as $k) {\r\n\t\t\tif ($this->arr_search_object[$k] instanceof ConceptSearchTermCollection) {\r\n\t\t\t\t$i += $this->arr_search_object[$k]->Count();\r\n\t\t\t} else {\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $i;\r\n\t}",
"function count()\n\t{\n\t\tif( $statement = \\DatabaseManager\\prepare('SELECT COUNT(id) AS count FROM reference_value') )\n\t\t{\n\t\t\tif( \\DatabaseManager\\execute($statement) )\n\t\t\t{\n\t\t\t\tif( $count = $statement->fetch() )\n\t\t\t\t{\n\t\t\t\t\treturn (int)$count['count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public function getFacetCounts()\n {\n return $this->facetCounts;\n }",
"function get_count($parsed_data) {\r\n switch ($this->api) {\r\n case 'Primo':\r\n $count = (int) $parsed_data->info->total;\r\n break;\r\n case 'XService':\r\n if (is_array($parsed_data)) {\r\n $count = count($parsed_data->JAGROOT->RESULT->QUERYTRANSFORMS->QUERYTRANSFORM);\r\n }\r\n break;\r\n default:\r\n $count = 0;\r\n break;\r\n }\r\n return $count;\r\n }",
"public function getSearchResultCount(SearchQueryInterface $search);",
"function equipeer_get_search_counter() {\n //global $wpdb;\n // ----------------------------------\n // Initialize args\n // ----------------------------------\n $_meta_query_arg = array();\n //$_meta_query_arg[] = array( 'key' => 'sold', 'value' => '0', 'compare' => '=' );\n //$_meta_query_arg[] = array( 'key' => 'sold', 'value' => '1', 'compare' => '=' );\n // ----------------------------------\n $_args = array(\n 'post_type' => 'equine'\n ,'post_status' => array( 'publish' )\n ,'perm' => 'readable' // Beware of setting the 'post_status' to anything other than 'public', as it can easily lead to an information disclosure vulnerability\n ,'nopaging' => true // Display all posts by disabling pagination\n //,'cache_results' => true\n //,'posts_per_page' => $_posts_per_page\n //,'paged' => $paged\n ,'meta_query' => array(\n $_meta_query_arg\n )\n );\n // ----------------------------------\n // --- REQUEST with ARGS\n // ----------------------------------\n $_query_ajax = new WP_Query( $_args );\n $_count_total = $_query_ajax->found_posts;\n $_last_query = $_query_ajax->last_query;\n $_last_request = $_query_ajax->request;\n // ----------------------------------\n echo $_count_total;\n \n wp_die();\n }",
"public function getCount()\n {\n $rawData = $this->getProviderRawData()->getRawDataAllArray();\n\n return isset($rawData['response']['numFound']) ?\n (int) $rawData['response']['numFound'] : null;\n }",
"public function faceCount()\n {\n return $this->setRightOperand(PVar::FACE_COUNT);\n }",
"function equipeer_get_search_counter() {\n\t//global $wpdb;\n\t// ----------------------------------\n\t// Initialize meta query\t\t\t\n\t$meta_query_arg = array();\n\t$meta_query_arg[] = array( 'key' => 'sold', 'value' => '0', 'compare' => '=' );\n\t// ----------------------------------\n\t$args = array(\n\t\t 'post_type' => 'equine'\n\t\t,'post_status' => array( 'publish' )\n\t\t,'cache_results' => true\n\t\t,'orderby' => 'date'\n\t\t,'order' => 'DESC'\n\t\t,'perm' => 'readable' // Beware of setting the 'post_status' to anything other than 'public', as it can easily lead to an information disclosure vulnerability\n\t\t,'nopaging' => true // Display all posts by disabling pagination\n\t\t,'meta_query' => array(\n\t\t\t$meta_query_arg\n\t\t)\n\t);\n\t// ----------------------------------\n\t// --- REQUEST with ARGS\n\t// ----------------------------------\n\t$query = new WP_Query( $args );\n\t$count_total = $query->found_posts;\n\t$last_query = $query->last_query;\n\t$last_request = $query->request;\n\t// ----------------------------------\n\treturn $count_total;\n}",
"public function getNumFacets() {\n return $this->numFacets;\n }",
"public function count()\n {\n if ($this->queryShouldBeStopped) {\n return 0;\n }\n\n $queryType = 'SectionQuery::count';\n $filter = $this->normalizeFilter();\n $callback = function() use ($filter) {\n return (int) $this->bxObject->getCount($filter);\n };\n\n return $this->handleCacheIfNeeded(compact('queryType', 'filter'), $callback);\n }",
"private function ts_countHits()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n if ( $this->count_hits[ $this->curr_tableField ] != null )\n {\n return $this->count_hits[ $this->curr_tableField ];\n }\n\n\n // Short var\n $count_hits = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'count_hits' ];\n switch ( $count_hits )\n {\n case( true ):\n $this->count_hits[ $this->curr_tableField ] = true;\n break;\n default:\n $this->count_hits[ $this->curr_tableField ] = false;\n break;\n }\n\n // RETURN\n return $this->count_hits[ $this->curr_tableField ];\n }",
"function get_result_count( $params = [] ) {\n $text_of = __( 'of', 'fwp-front' );\n\n $page = (int) $params['page'];\n $per_page = (int) $params['per_page'];\n $total_rows = (int) $params['total_rows'];\n\n if ( $per_page < $total_rows ) {\n $lower = ( 1 + ( ( $page - 1 ) * $per_page ) );\n $upper = ( $page * $per_page );\n $upper = ( $total_rows < $upper ) ? $total_rows : $upper;\n $output = \"$lower-$upper $text_of $total_rows\";\n }\n else {\n $lower = ( 0 < $total_rows ) ? 1 : 0;\n $upper = $total_rows;\n $output = $total_rows;\n }\n\n return apply_filters( 'facetwp_result_count', $output, [\n 'lower' => $lower,\n 'upper' => $upper,\n 'total' => $total_rows,\n ] );\n }",
"function the_facets() {\n\t\treturn $this->facet_counts;\n\t}",
"function total_numb_results($search_array, $api){\n\t$search_array['count_only'] = true;\n\tif(array_key_exists('limit', $search_array)) unset($search_array['limit']);\n\tif(array_key_exists('page', $search_array)) unset($search_array['page']);\n\t$obj = json_decode($api->get_json_from_assoc($search_array));\n\treturn $obj->count;\n}",
"public function videogoogleadsensecount( $searchBtn , $searchValue ){\n\t\t\t$query = 'SELECT count(*) FROM ' . $this->_videoadtable;\n\t\t\tif( isset ( $searchBtn ) ) {\n\t\t\t\t$query .= ' WHERE googleadsense_details LIKE %s';\n\t\t } \n\t\t\tif( isset ( $searchBtn) ) { \n\t\t\t $query = $this->_wpdb->prepare($query , '%'.$searchValue.'%' );\n\t\t\t} else {\n\t\t\t\t$query = $query;\n\t\t\t}\n\t\t\t$countgoogleadsense = $this->_wpdb->get_var( $query );\n\t\t\t\n\t\t\treturn $countgoogleadsense;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testSaveAllNotDeepValidateOnly tests the validate methods to not validate deeper recursive data | public function testSaveAllNotDeepValidateOnly() {
$this->loadFixtures('Article', 'Comment', 'User', 'Attachment');
$TestModel = new Article();
$TestModel->hasMany['Comment']['order'] = array('Comment.created' => 'ASC');
$TestModel->hasAndBelongsToMany = array();
$TestModel->Comment->Attachment->validate['attachment'] = 'notBlank';
$TestModel->Comment->validate['comment'] = 'notBlank';
$data = array(
'Article' => array('id' => 2, 'body' => ''),
'Comment' => array(
array('comment' => 'First new comment', 'published' => 'Y', 'User' => array('user' => '', 'password' => 'newuserpass')),
array('comment' => 'Second new comment', 'published' => 'Y', 'user_id' => 2)
)
);
$result = $TestModel->saveAll($data, array('validate' => 'only', 'deep' => false));
$this->assertFalse($result);
$result = $TestModel->validateAssociated($data, array('deep' => false));
$this->assertFalse($result);
$expected = array('body' => array('This field cannot be left blank'));
$result = $TestModel->validationErrors;
$this->assertSame($expected, $result);
$data = array(
'Article' => array('id' => 2, 'body' => 'Ignore invalid user data'),
'Comment' => array(
array('comment' => 'First new comment', 'published' => 'Y', 'User' => array('user' => '', 'password' => 'newuserpass')),
array('comment' => 'Second new comment', 'published' => 'Y', 'user_id' => 2)
)
);
$result = $TestModel->saveAll($data, array('validate' => 'only', 'deep' => false));
$this->assertTrue($result);
$result = $TestModel->validateAssociated($data, array('deep' => false));
$this->assertTrue($result);
$data = array(
'Article' => array('id' => 2, 'body' => 'Ignore invalid user data'),
'Comment' => array(
array('comment' => 'First new comment', 'published' => 'Y', 'User' => array('user' => '', 'password' => 'newuserpass')),
array('comment' => 'Second new comment', 'published' => 'Y', 'user_id' => 2)
)
);
$expected = array(
'Article' => true,
'Comment' => array(
true,
true
)
);
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => false));
$this->assertSame($expected, $result);
$result = $TestModel->validateAssociated($data, array('atomic' => false, 'deep' => false));
$this->assertSame($expected, $result);
$data = array(
'Article' => array('id' => 2, 'body' => 'Ignore invalid attachment data'),
'Comment' => array(
array('comment' => 'Third new comment', 'published' => 'Y', 'user_id' => 5),
array('comment' => 'Fourth new comment', 'published' => 'Y', 'user_id' => 2, 'Attachment' => array('attachment' => ''))
)
);
$result = $TestModel->saveAll($data, array('validate' => 'only', 'deep' => false));
$this->assertTrue($result);
$result = $TestModel->validateAssociated($data, array('deep' => false));
$this->assertTrue($result);
$data = array(
'Article' => array('id' => 2, 'body' => 'Ignore invalid attachment data'),
'Comment' => array(
array('comment' => 'Third new comment', 'published' => 'Y', 'user_id' => 5),
array('comment' => 'Fourth new comment', 'published' => 'Y', 'user_id' => 2, 'Attachment' => array('attachment' => ''))
)
);
$expected = array(
'Article' => true,
'Comment' => array(
true,
true
)
);
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => false));
$this->assertSame($expected, $result);
$result = $TestModel->validateAssociated($data, array('atomic' => false, 'deep' => false));
$this->assertSame($expected, $result);
$expected = array();
$result = $TestModel->validationErrors;
$this->assertSame($expected, $result);
$data = array(
'Attachment' => array(
'attachment' => 'deepsave insert',
),
'Comment' => array(
'comment' => 'First comment deepsave insert',
'published' => 'Y',
'user_id' => 5,
'Article' => array(
'title' => 'First Article deepsave insert ignored',
'body' => 'First Article Body deepsave insert',
'User' => array(
'user' => '',
'password' => 'magic'
),
),
)
);
$result = $TestModel->Comment->Attachment->saveAll($data, array('validate' => 'only', 'deep' => false));
$this->assertTrue($result);
$result = $TestModel->Comment->Attachment->validateAssociated($data, array('deep' => false));
$this->assertTrue($result);
$result = $TestModel->Comment->Attachment->validationErrors;
$expected = array();
$this->assertSame($expected, $result);
$expected = array(
'Attachment' => true,
'Comment' => true
);
$result = $TestModel->Comment->Attachment->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => false));
$this->assertEquals($expected, $result);
$result = $TestModel->Comment->Attachment->validateAssociated($data, array('atomic' => false, 'deep' => false));
$this->assertEquals($expected, $result);
$data['Comment']['Article']['body'] = '';
$result = $TestModel->Comment->Attachment->saveAll($data, array('validate' => 'only', 'deep' => false));
$this->assertTrue($result);
$result = $TestModel->Comment->Attachment->validateAssociated($data, array('deep' => false));
$this->assertTrue($result);
$result = $TestModel->Comment->Attachment->validationErrors;
$expected = array();
$this->assertSame($expected, $result);
$expected = array(
'Attachment' => true,
'Comment' => true
);
$result = $TestModel->Comment->Attachment->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => false));
$this->assertEquals($expected, $result);
$result = $TestModel->Comment->Attachment->validateAssociated($data, array('atomic' => false, 'deep' => false));
$this->assertEquals($expected, $result);
} | [
"public function testRecursiveValidate() {\n $entity = EntityTest::create();\n $adapter = EntityAdapter::createFromEntity($entity);\n // This would trigger the ValidReferenceConstraint due to EntityTest\n // defaulting uid to 1, which doesn't exist. Ensure that we don't get a\n // violation for that.\n $this->assertCount(0, \\Drupal::typedDataManager()->getValidator()->validate($adapter, $adapter->getConstraints()));\n }",
"public function testValidateManyAtomicFalseDeepTrueWithErrors() {\n\t\t$this->loadFixtures('Comment', 'Article', 'User');\n\t\t$Article = ClassRegistry::init('Article');\n\t\t$Article->Comment->validator()->add('comment', array(\n\t\t\tarray('rule' => 'notBlank')\n\t\t));\n\n\t\t$data = array(\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'user_id' => 1,\n\t\t\t\t\t'title' => 'Foo',\n\t\t\t\t\t'body' => 'text',\n\t\t\t\t\t'published' => 'N'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'user_id' => 1,\n\t\t\t\t\t\t'comment' => 'Baz',\n\t\t\t\t\t\t'published' => 'N',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'user_id' => 1,\n\t\t\t\t\t'title' => 'Bar',\n\t\t\t\t\t'body' => 'text',\n\t\t\t\t\t'published' => 'N'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'user_id' => 1,\n\t\t\t\t\t\t'comment' => '',\n\t\t\t\t\t\t'published' => 'N',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$Article->validateMany($data, array('atomic' => false, 'deep' => true));\n\n\t\t$result = $Article->validationErrors;\n\t\t$expected = array(\n\t\t\t1 => array(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t0 => array(\n\t\t\t\t\t\t'comment' => array(\n\t\t\t\t\t\t\t0 => 'This field cannot be left blank',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testValidatesWithModelsAndSaveAll() {\n\t\t$this->loadFixtures('Something', 'SomethingElse', 'JoinThing');\n\t\t$data = array(\n\t\t\t'Something' => array(\n\t\t\t\t'id' => 5,\n\t\t\t\t'title' => 'Extra Fields',\n\t\t\t\t'body' => 'Extra Fields Body',\n\t\t\t\t'published' => '1'\n\t\t\t),\n\t\t\t'SomethingElse' => array(\n\t\t\t\tarray('something_else_id' => 1, 'doomed' => '')\n\t\t\t)\n\t\t);\n\t\t$Something = new Something();\n\t\t$JoinThing = $Something->JoinThing;\n\n\t\t$JoinThing->validate = array('doomed' => array('rule' => 'notBlank'));\n\t\t$expectedError = array('doomed' => array('This field cannot be left blank'));\n\n\t\t$Something->create();\n\t\t$result = $Something->saveAll($data, array('validate' => 'only'));\n\t\t$this->assertFalse($result);\n\t\t$result = $Something->validateAssociated($data);\n\t\t$this->assertFalse($result);\n\t\t$this->assertEquals($expectedError, $JoinThing->validationErrors);\n\t\t$result = $Something->validator()->validateAssociated($data);\n\t\t$this->assertFalse($result);\n\n\t\t$Something->create();\n\t\t$result = $Something->saveAll($data, array('validate' => 'first'));\n\t\t$this->assertFalse($result);\n\t\t$this->assertEquals($expectedError, $JoinThing->validationErrors);\n\n\t\t$count = $Something->find('count', array('conditions' => array('Something.id' => $data['Something']['id'])));\n\t\t$this->assertSame(0, $count);\n\n\t\t$joinRecords = $JoinThing->find('count', array(\n\t\t\t'conditions' => array('JoinThing.something_id' => $data['Something']['id'])\n\t\t));\n\t\t$this->assertEquals(0, $joinRecords, 'Records were saved on the join table. %s');\n\t}",
"function fixtures_drush_validate_all() {\n /* @var $dic ContainerInterface */\n $dic = drupal_dic();\n /** @var $providerChain FixtureProviderChainInterface */\n $providerChain = $dic->get('fixture_provider_chain');\n\n if (TRUE == $result = $providerChain->validateAll()) {\n drush_log('Validated all fixtures.', 'success');\n }\n else {\n drush_log(\n 'Error validating all fixtures: ' . $result,\n 'error'\n );\n }\n}",
"public function testIsSaveAllWithMultiRecordData() {\n\t\t\n\t\t$data = array(\n\t\t\tarray(\n\t\t\t\t'key' => 'value'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'value'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$result = $this->InputData->isSaveAll($data);\n\t\t\n\t\t$this->assertTrue($result);\n\t\t\n\t\t$this->InputData->Controller->request->data = $data;\n\t\t\n\t\t$result = $this->InputData->isSaveAll();\n\t\t\n\t\t$this->assertTrue($result);\n\t\t\n\t}",
"public function testErrorsWithNestedFields(): void\n {\n $validator = new Validator();\n $user = new Validator();\n $user->add('username', 'letter', ['rule' => 'alphanumeric']);\n\n $comments = new Validator();\n $comments->add('comment', 'letter', ['rule' => 'alphanumeric']);\n\n $validator->addNested('user', $user);\n $validator->addNestedMany('comments', $comments);\n\n $data = [\n 'user' => [\n 'username' => 'is wrong',\n ],\n 'comments' => [\n ['comment' => 'is wrong'],\n ],\n ];\n $errors = $validator->validate($data);\n $expected = [\n 'user' => [\n 'username' => ['letter' => 'The provided value is invalid'],\n ],\n 'comments' => [\n 0 => ['comment' => ['letter' => 'The provided value is invalid']],\n ],\n ];\n $this->assertEquals($expected, $errors);\n }",
"public function testSaveAll() {\n Functions\\stubs(\n [\n 'update_option' => function ($name, $val) {\n return is_array($val) || is_string($val) || is_float($val) || is_int($val) || is_bool($val) ?\n true :\n false;\n }\n ]\n );\n\n $this->_options->setMode('serialized');\n\n //array\n $this->assertTrue(\n $this->_options->saveAll(['a' => 'b']),\n 'Should be truely by save an array');\n //string\n $this->assertTrue(\n $this->_options->saveAll('test'),\n 'Should be truely by save an string');\n //float\n $this->assertTrue(\n $this->_options->saveAll(234.25),\n 'Should be truely by save an float');\n //int\n $this->assertTrue(\n $this->_options->saveAll(234),\n 'Should be truely by save an int');\n //bool\n $this->assertTrue(\n $this->_options->saveAll(true),\n 'Should be truely by save an boolean');\n //object\n $this->assertFalse(\n $this->_options->saveAll(new Object_(null)),\n 'Should be falsy by save an object');\n }",
"public function testErrorsWithNestedManySomeInvalid(): void\n {\n $validator = new Validator();\n\n $comments = new Validator();\n $comments->add('comment', 'letter', ['rule' => 'alphanumeric']);\n $validator->addNestedMany('comments', $comments);\n\n $data = [\n 'comments' => [\n 'a string',\n ['comment' => 'letters'],\n ['comment' => 'more invalid'],\n ],\n ];\n $errors = $validator->validate($data);\n $expected = [\n 'comments' => [\n '_nested' => 'The provided value is invalid',\n ],\n ];\n $this->assertEquals($expected, $errors);\n }",
"public function testNormalizeSaveAll() {\n\t\t\n\t\t$data = array(\n\t\t\tarray(\n\t\t\t\t'id' => 1,\n\t\t\t\t'name' => 'Name',\n\t\t\t\t'ApiInputDataComponentStuff' => array(\n\t\t\t\t\t'fname' => 'First',\n\t\t\t\t\t'lname' => 'Last'\n\t\t\t\t),\n\t\t\t\t'tags' => array('one', 'two', 'three')\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'Name',\n\t\t\t\t'ApiInputDataComponentStuff' => array(\n\t\t\t\t\t'fname' => 'First',\n\t\t\t\t\t'lname' => 'Last'\n\t\t\t\t),\n\t\t\t\t'tags' => array('one', 'two', 'three')\n\t\t\t),\n\t\t);\n\t\t\n\t\t$this->InputData->Controller->request->data = $data;\n\t\t\n\t\t$this->InputData->forModel('ApiInputDataComponentThing');\n\t\t\n\t\t$this->InputData->normalize();\n\t\t\n\t\t$test = $this->InputData->Controller->request->data;\n\t\t\n\t\t$expected = array();\n\t\t\n\t\tforeach ($data as $row) {\n\t\t\t$expected[] = array('ApiInputDataComponentThing' => $row);\n\t\t}\n\t\t\n\t\t$this->assertEqual($expected, $test);\n\t\t\n\t}",
"public function testNestedValid() {\n $schema = $this->getNestedSchema();\n\n $validData = [\n 'id' => 123,\n 'name' => 'Todd',\n 'addr' => [\n 'street' => '414 rue McGill',\n 'city' => 'Montreal',\n ]\n ];\n\n $isValid = $schema->isValid($validData);\n $this->assertTrue($isValid);\n }",
"function testSaveAllWithFailedResult() {\n $data = array(\n array(\n 'User' => array(\n 'id' => 0,\n 'username' => 'notonlist1',\n 'email' => 'noonlist1@example.com',\n 'first_name' => 'Not',\n 'last_name' => 'Onlist1',\n 'student_no' => '',\n ),\n 'Role' => array('RoleUser' => array('role_id' => 3)),\n ),\n array(\n 'User' => array(\n 'id' => 0,\n 'username' => 'redshirt0001',\n 'email' => 'onlist1@example.com',\n 'first_name' => 'On',\n 'last_name' => 'list1',\n 'student_no' => '',\n ),\n 'Role' => array('RoleUser' => array('role_id' => 5)),\n ),\n array(\n 'User' => array(\n 'id' => 0,\n 'username' => 'notonlist2',\n 'email' => 'noonlist2@example.com',\n 'first_name' => 'Not',\n 'last_name' => 'Onlist2',\n 'student_no' => '',\n ),\n 'Role' => array('RoleUser' => array('role_id' => 5)),\n ),\n );\n\n $result = $this->User->saveAll($data, array('atomic' => false));\n $this->assertTrue($result[0]);\n $this->assertTrue($result[2]);\n $this->assertFalse($result[1]);\n $this->assertEqual($this->User->validationErrors, array(1 => array(\n 'username' => 'Duplicate Username found. Please select another.'\n )));\n\n $usernames = Set::extract($data, '/User/username');\n $sbody = $this->User->find('all', array(\n 'conditions' => array('username' => $usernames),\n 'fields' => array('User.id', 'username', 'last_name', 'first_name'),\n 'contain' => false,\n ));\n\n $this->assertEqual(count($sbody), 3);\n }",
"public function testNestedInvalid() {\n $schema = $this->getNestedSchema();\n\n $invalidData = [\n 'id' => 123,\n 'name' => 'Toddo',\n 'addr' => [\n 'zip' => 'H2Y 2G1'\n ]\n ];\n\n try {\n $schema->validate($invalidData);\n $this->fail(\"The data should not be valid.\");\n } catch (ValidationException $ex) {\n $validation = $ex->getValidation();\n $this->assertFalse($validation->isValidField('addr/city'), \"addr.street should be invalid.\");\n $this->assertFalse($validation->isValidField('addr/zip'), \"addr.zip should be invalid.\");\n }\n }",
"public function testClassAttributesValidation()\n\t{\n\t\t// 1. validate all models\n\n\t\t// validation will fail because 'Torvalds' string is too long\n\t\t$user1=new User('scenario');\n\t\t$user1->group=new Group();\n\t\t$user1->group->name='Linux Kernel Team';\n\t\t$user1->attributes=array('firstName'=>'Linus1','lastName'=>'Torvalds','name'=>'ignoredString');\n\t\t$result=$user1->withRelated->save(true,array('group','firstName','lastName','name','group_id'));\n\n\t\t$this->assertFalse($result);\n\t\t$this->assertEmpty($user1->group->errors);\n\t\t$this->assertNotEmpty($user1->errors);\n\t\t$this->assertFalse(User::model()->exists('name=\"Linus1 Torvalds\"'));\n\n\t\t// validation will be successful because 'Morton' string is short enough\n\t\t$user2=new User('scenario');\n\t\t$user2->group=new Group();\n\t\t$user2->group->name='Linux Kernel Team';\n\t\t$user2->attributes=array('firstName'=>'Andrew1','lastName'=>'Morton','name'=>'ignoredString');\n\t\t$result=$user2->withRelated->save(true,array('group','firstName','lastName','name','group_id'));\n\n\t\t$this->assertTrue($result);\n\t\t$this->assertEmpty($user2->group->errors);\n\t\t$this->assertEmpty($user2->errors);\n\t\t$this->assertTrue(User::model()->exists('name=\"Andrew1 Morton\"'));\n\n\t\t// 2. skip models validation\n\n\t\t// validation will be successful because 'Torvalds' string is not validated\n\t\t// note: validation disabled by passing false value as first argument to the WithRelatedBehavior::save() method\n\t\t$user3=new User('scenario');\n\t\t$user3->group=new Group();\n\t\t$user3->group->name='Linux Kernel Team';\n\t\t$user3->attributes=array('firstName'=>'Linus2','lastName'=>'Torvalds','name'=>'ignoredString');\n\t\t$result=$user3->withRelated->save(false,array('group','firstName','lastName','name','group_id'));\n\n\t\t$this->assertTrue($result);\n\t\t$this->assertEmpty($user3->group->errors);\n\t\t$this->assertEmpty($user3->errors);\n\t\t$this->assertTrue(User::model()->exists('name=\"Linus2 Torvalds\"'));\n\n\t\t// validation will be successful because 'Morton' string is not validated\n\t\t// note: validation disabled by passing false value as first argument to the WithRelatedBehavior::save() method\n\t\t$user4=new User('scenario');\n\t\t$user4->group=new Group();\n\t\t$user4->group->name='Linux Kernel Team';\n\t\t$user4->attributes=array('firstName'=>'Andrew2','lastName'=>'Morton','name'=>'ignoredString');\n\t\t$result=$user4->withRelated->save(false,array('group','firstName','lastName','name','group_id'));\n\n\t\t$this->assertTrue($result);\n\t\t$this->assertEmpty($user4->group->errors);\n\t\t$this->assertEmpty($user4->errors);\n\t\t$this->assertTrue(User::model()->exists('name=\"Andrew2 Morton\"'));\n\n\t\t// 3. validate all models but don't validate class attributes\n\n\t\t// validation will be successful because 'Torvalds' string is not validated\n\t\t// note: 'Linus3 Torvalds' string saved to the database since $firstName and $lastName attributes are safe\n\t\t$user5=new User('scenario');\n\t\t$user5->group=new Group();\n\t\t$user5->group->name='Linux Kernel Team';\n\t\t$user5->attributes=array('firstName'=>'Linus3','lastName'=>'Torvalds','name'=>'ignoredString');\n\t\t$result=$user5->withRelated->save(true,array('group','name','group_id'));\n\n\t\t$this->assertTrue($result);\n\t\t$this->assertEmpty($user5->group->errors);\n\t\t$this->assertEmpty($user5->errors);\n\t\t$this->assertTrue(User::model()->exists('name=\"Linus3 Torvalds\"'));\n\n\t\t// validation will be successful because 'Morton' string is not validated\n\t\t// note: 'Andrew3 Morton' string saved to the database since $firstName and $lastName attributes are safe\n\t\t$user6=new User('scenario');\n\t\t$user6->group=new Group();\n\t\t$user6->group->name='Linux Kernel Team';\n\t\t$user6->attributes=array('firstName'=>'Andrew3','lastName'=>'Morton','name'=>'ignoredString');\n\t\t$result=$user6->withRelated->save(true,array('group','name','group_id'));\n\n\t\t$this->assertTrue($result);\n\t\t$this->assertEmpty($user6->group->errors);\n\t\t$this->assertEmpty($user6->errors);\n\t\t$this->assertTrue(User::model()->exists('name=\"Andrew3 Morton\"'));\n\n\t\t// 4. validate real class attributes validation of the related models\n\n\t\t// validation will fail because 'Linux Kernel Team' string is too long to pass Group model validation rules\n\t\t$user7=new User('scenario');\n\t\t$user7->group=new Group('scenario');\n\t\t$user7->group->attributes=array('otherName'=>'Linux Kernel Team','name'=>'ignoredString');\n\t\t$user7->attributes=array('firstName'=>'Alan1','lastName'=>'Cox','name'=>'ignoredString');\n\t\t$result=$user7->withRelated->save(true,array('group'=>array('otherName','name'),'firstName','lastName','name','group_id'));\n\n\t\t$this->assertFalse($result);\n\t\t$this->assertNotEmpty($user7->group->errors);\n\t\t$this->assertEmpty($user7->errors);\n\t\t$this->assertFalse(User::model()->exists('name=\"Alan1 Cox\"'));\n\n\t\t// validation will be successful because 'Linux' string is short enough to fit Group model validation rules\n\t\t$user8=new User('scenario');\n\t\t$user8->group=new Group('scenario');\n\t\t$user8->group->attributes=array('otherName'=>'Linux','name'=>'ignoredString');\n\t\t$user8->attributes=array('firstName'=>'Alan2','lastName'=>'Cox','name'=>'ignoredString');\n\t\t$result=$user8->withRelated->save(true,array('group'=>array('otherName','name'),'firstName','lastName','name','group_id'));\n\n\t\t$this->assertTrue($result);\n\t\t$this->assertEmpty($user8->group->errors);\n\t\t$this->assertEmpty($user8->errors);\n\t\t$this->assertTrue(User::model()->exists('name=\"Alan2 Cox\"'));\n\t}",
"protected function validateSave () {}",
"public function testValidateAssociatedAtomicFalseDeepTrueWithErrors() {\n\t\t$this->loadFixtures('Comment', 'Article', 'User', 'Attachment');\n\t\t$Attachment = ClassRegistry::init('Attachment');\n\t\t$Attachment->Comment->validator()->add('comment', array(\n\t\t\tarray('rule' => 'notBlank')\n\t\t));\n\t\t$Attachment->Comment->User->bindModel(array(\n\t\t\t'hasMany' => array(\n\t\t\t\t'Article',\n\t\t\t\t'Comment'\n\t\t\t)),\n\t\t\tfalse\n\t\t);\n\n\t\t$data = array(\n\t\t\t'Attachment' => array(\n\t\t\t\t'attachment' => 'text',\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'comment' => '',\n\t\t\t\t\t'published' => 'N',\n\t\t\t\t\t'User' => array(\n\t\t\t\t\t\t'user' => 'Foo',\n\t\t\t\t\t\t'password' => 'mypassword',\n\t\t\t\t\t\t'Comment' => array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'comment' => ''\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$result = $Attachment->validateAssociated($data, array('atomic' => false, 'deep' => true));\n\n\t\t$result = $Attachment->validationErrors;\n\t\t$expected = array(\n\t\t\t'Comment' => array(\n\t\t\t\t'comment' => array(\n\t\t\t\t\t0 => 'This field cannot be left blank',\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'Comment' => array(\n\t\t\t\t\t\t0 => array(\n\t\t\t\t\t\t\t'comment' => array(\n\t\t\t\t\t\t\t\t0 => 'This field cannot be left blank',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function test_check_before_save_without_required_fields()\n {\n $mock_object = $this->prepare_mock_object_for_check_before_save_tests(true, true, true);\n \n $this->assertFalse($this->invoke_check_before_save($mock_object));\n }",
"public function testSaveSeedsValidateTrue() {\n\t\t$this->_createProcessorMock(array('_getModel'));\n\t\t$seeds = array('seeds');\n\t\t$model = $this->getMock('Apple', array('saveAll'));\n\t\t$options = array(\n\t\t\t'validate' => true\n\t\t);\n\n\t\t$this->_seeder->expects($this->at(0))->method('getValidateSeeding')->will($this->returnValue('true'));\n\t\t$this->_processor->expects($this->at(0))->method('_getModel')->will($this->returnValue($model));\n\t\t$model->expects($this->at(0))->method('saveAll')->with(\n\t\t\t$this->equalTo($seeds),\n\t\t\t$this->equalTo($options)\n\t\t)->will($this->returnValue(true));\n\n\t\t$this->_seeder->expects($this->never())->method('out');\n\n\t\t$this->_processor->saveSeeds($seeds);\n\t}",
"public function testNestedValidatorCreate(): void\n {\n $validator = new Validator();\n $inner = new Validator();\n $inner->add('username', 'email', ['rule' => 'email', 'on' => 'create']);\n $validator->addNested('user', $inner);\n $this->assertNotEmpty($validator->validate(['user' => ['username' => 'example']], true));\n $this->assertEmpty($validator->validate(['user' => ['username' => 'a']], false));\n }",
"public function testModelWithNestedAttributesCanSaveWithoutFillableArraySet()\n {\n $this->modelWithoutFillable->fill($this->payload);\n\n $this->assertEquals([\n 'model_bar' => ['text' => 'bar'],\n 'model_foos' => [\n ['text' => 'foo1'],\n ['text' => 'foo2']\n ]\n ], $this->modelWithoutFillable->getAcceptNestedAttributesFor());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[!] Method is generated. Executes dragAndDrop and retries on failure. Retry number and interval set by $I>retry(); | public function retryDragAndDrop($source, $target) {
$retryNum = isset($this->retryNum) ? $this->retryNum : 1;
$retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200;
return $this->getScenario()->runStep(new \Codeception\Step\Retry('dragAndDrop', func_get_args(), $retryNum, $retryInterval));
} | [
"private function retry()\n {\n $current = time();\n\n foreach ($this->waiting as $id => $item) {\n\n /**\n * @var Message $message\n */\n list ($message, $time) = $item;\n\n $diff = $current - $time;\n\n if ($diff > 5) {\n syslog(LOG_WARNING, sprintf(\"Message can't be delivered '%s'\", $message->getPayload()));\n unset($this->waiting[$id]);\n } else if ($diff > 1) {\n $this->publish($message);\n }\n }\n }",
"private function retryWebhook()\n {\n ($this->attempts() < $this->tries)\n ? $this->release($this->retryInterval * 60)\n : $this->fail();\n }",
"public function ondrag($script);",
"function proceedDragDrop()\n\t{\n\t\tglobal $ilCtrl;\n\n//\t\t$this->slm_object->executeDragDrop($_POST[\"il_hform_source_id\"], $_POST[\"il_hform_target_id\"],\n//\t\t\t$_POST[\"il_hform_fc\"], $_POST[\"il_hform_as_subitem\"]);\n//\t\t$ilCtrl->redirect($this, \"showOrganization\");\n\t}",
"public function ondragstart($script);",
"public function testDragAndDrop() {\n $this->state->set('tabledrag_test_table', array_flip(range(1, 3)));\n $this->drupalGet('tabledrag_test');\n\n $session = $this->getSession();\n $page = $session->getPage();\n\n $weight_select1 = $page->findField(\"table[1][weight]\");\n $weight_select2 = $page->findField(\"table[2][weight]\");\n $weight_select3 = $page->findField(\"table[3][weight]\");\n\n // Check that initially the rows are in the correct order.\n $this->assertOrder(['Row with id 1', 'Row with id 2', 'Row with id 3']);\n\n // Check that the 'unsaved changes' text is not present in the message area.\n $this->assertSession()->pageTextNotContains('You have unsaved changes.');\n\n $row1 = $this->findRowById(1)->find('css', 'a.tabledrag-handle');\n $row2 = $this->findRowById(2)->find('css', 'a.tabledrag-handle');\n $row3 = $this->findRowById(3)->find('css', 'a.tabledrag-handle');\n\n // Drag row1 over row2.\n $row1->dragTo($row2);\n\n // Check that the 'unsaved changes' text was added in the message area.\n $this->assertSession()->waitForText('You have unsaved changes.');\n\n // Check that row1 and row2 were swapped.\n $this->assertOrder(['Row with id 2', 'Row with id 1', 'Row with id 3']);\n\n // Check that weights were changed.\n $this->assertGreaterThan($weight_select2->getValue(), $weight_select1->getValue());\n $this->assertGreaterThan($weight_select2->getValue(), $weight_select3->getValue());\n $this->assertGreaterThan($weight_select1->getValue(), $weight_select3->getValue());\n\n // Now move the last row (row3) in the second position. row1 should go last.\n $row3->dragTo($row1);\n\n // Check that the order is: row2, row3 and row1.\n $this->assertOrder(['Row with id 2', 'Row with id 3', 'Row with id 1']);\n }",
"public function testNetworkDownUpDuringRetry(): void\n {\n $this->createLargeTable(self::LARGE_TABLE_ROWS, self::LARGE_TABLE_NAME);\n $proxy = $this->createToxiproxyToDb();\n\n // Network is down\n $toxic = $this->simulateNetworkDown($proxy);\n\n // Extractor process is started\n $process = $this->createProcess($proxy);\n $process->start();\n\n // Network is up - 2 seconds after the process started\n sleep(2);\n $proxy->delete($toxic);\n\n // Extractor process ended, network is up\n // It should be successful, because retry mechanism\n $process->wait();\n\n // Process is successful\n $output = $process->getOutput();\n $errorOutput = $process->getErrorOutput();\n Assert::assertTrue($process->isSuccessful());\n Assert::assertSame(0, $process->getExitCode());\n\n // Connect is successfully retried\n Assert::assertStringContainsString('MySQL server has gone away. Retrying... [1x]', $output);\n Assert::assertStringNotContainsString('Error connecting to DB:', $errorOutput); // not\n\n // Extraction is successful\n $this->assertOutputCsvValid();\n }",
"public function retry()\n {\n $syncCollection = $this->_syncCollectionFactory->create();\n $groupedRows = $this->getGroupedRows($syncCollection->getRowsForSync('RETRY')->getData());\n\n $this->sendUpdatesToApp($groupedRows, true);\n }",
"function proceedDragDrop()\n\t{\n\t\tglobal $ilCtrl;\n\n\t\t$this->slm_object->executeDragDrop($_POST[\"il_hform_source_id\"], $_POST[\"il_hform_target_id\"],\n\t\t\t$_POST[\"il_hform_fc\"], $_POST[\"il_hform_as_subitem\"]);\n\t\t$ilCtrl->redirect($this, \"showOrganization\");\n\t}",
"public function dragAndDrop($source, $target) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('dragAndDrop', func_get_args()));\n }",
"public function retryReloadPage() {\n $retryNum = isset($this->retryNum) ? $this->retryNum : 1;\n $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200;\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Retry('reloadPage', func_get_args(), $retryNum, $retryInterval));\n }",
"public function admin_drop() {\n\t\t$this->Move->dropItem();\n\t}",
"abstract public function setRetry(int $retry): void;",
"public function submit_boat_image_drag_drop(){\r\n\t\tif(($_REQUEST['fcapi'] == \"mupload\")){\r\n\t\t\tglobal $db, $cm, $frontend, $fle;\r\n\t\t\t$frontend->go_to_login();\r\n\t\t\t$iiid = round($_POST[\"ms\"], 0);\r\n\t\t\t$crop_option = round($_POST[\"crop_option\"], 0);\r\n\t\t\t$rotateimage = round($_POST[\"rotateimage\"], 0);\r\n\t\t\tif($_SERVER['REQUEST_METHOD'] == \"POST\"){\r\n\t\t\t\r\n\t\t\t\t$filename = $_FILES['file']['name'];\r\n\t\t\t\t$wh_ok = $fle->check_file_ext($cm->allow_image_ext, $filename);\r\n\t\t\t\tif ($wh_ok == \"y\"){\r\n\t\t\t\t\t$listing_no = $this->get_yacht_no($iiid);\r\n\t\t\t\t\t$i_rank = $db->total_record_count(\"select max(rank) as ttl from tbl_yacht_photo where yacht_id = '\". $iiid .\"'\") + 1;\r\n\t\t\t\t\t$i_iiid = $cm->get_unq_code(\"tbl_yacht_photo\", \"id\", 10);\r\n\t\t\t\t\t$sql = \"insert into tbl_yacht_photo (id, yacht_id, rank, status_id) values ('\". $i_iiid .\"', '\". $iiid .\"', '\". $i_rank .\"', 1)\";\r\n\t\t\t\t\t$db->mysqlquery($sql);\r\n\t\t\t\r\n\t\t\t\t\t$filename_tmp = $_FILES['file']['tmp_name'];\r\n\t\t\t\t\t$filename = $fle->uploadfilename($filename);\r\n\t\t\t\t\t$filename1 = $i_iiid.\"yacht\".$filename;\r\n\t\t\t\r\n\t\t\t\t\t$target_path_main = \"yachtimage/\" . $listing_no . \"/\";\r\n\t\t\t\r\n\t\t\t\t\t//thumbnail image\r\n\t\t\t\t\t$r_width = $cm->yacht_im_width_t;\r\n\t\t\t\t\t$r_height = $cm->yacht_im_height_t;\r\n\t\t\t\t\t$target_path = $target_path_main;\r\n\t\t\t\t\tif ($crop_option == 1){\r\n\t\t\t\t\t\t$fle->new_image_fixed($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$fle->new_image_box($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\t//big image\r\n\t\t\t\t\t$r_width = $cm->yacht_im_width_b;\r\n\t\t\t\t\t$r_height = $cm->yacht_im_height_b;\r\n\t\t\t\t\t$target_path = $target_path_main . \"big/\";\r\n\t\t\t\t\tif ($crop_option == 1){\r\n\t\t\t\t\t\t$fle->new_image_fixed($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$fle->new_image_box($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\t//bigger image\r\n\t\t\t\t\t$r_width = $cm->yacht_im_width;\r\n\t\t\t\t\t$r_height = $cm->yacht_im_height;\r\n\t\t\t\t\t$target_path = $target_path_main . \"bigger/\";\r\n\t\t\t\t\tif ($crop_option == 1){\r\n\t\t\t\t\t\t$fle->new_image_fixed($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$fle->new_image_box($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//slider image\r\n\t\t\t\t\t$r_width = $cm->yacht_im_width_sl;\r\n\t\t\t\t\t$r_height = $cm->yacht_im_height_sl;\r\n\t\t\t\t\t$target_path = $target_path_main . \"slider/\";\r\n\t\t\t\t\tif ($crop_option == 1){\r\n\t\t\t\t\t\t$fle->new_image_fixed($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$fle->new_image_box($filename_tmp, $r_width, $r_height, $target_path, $cm->filtertextdisplay($filename1), $rotateimage);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//original image store\r\n\t\t\t\t\t$target_path = $target_path_main . 'original/';\r\n\t\t\t\t\t$target_path = $target_path . $cm->filtertextdisplay($filename1);\r\n\t\t\t\t\t$fle->fileupload($filename_tmp, $target_path);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//rotate original image\r\n\t\t\t\t\tif ($rotateimage > 0){\r\n\t\t\t\t\t\t$im = @ImageCreateFromJPEG ($target_path);\r\n\t\t\t\t\t\t$im = imagerotate($im, $rotateimage, 0);\r\n\t\t\t\t\t\t@ImageJPEG ($im, $target_path, 100);\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\t//$fle->filedelete($filename_tmp);\r\n\t\t\t\t\t$sql = \"update tbl_yacht_photo set imgpath = '\".$cm->filtertext($filename1).\"' where id = '\". $i_iiid .\"'\";\r\n\t\t\t\t\t$db->mysqlquery($sql);\r\n\t\t\t\t\techo($_POST['index']);\r\n\t\t\t\t}\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function fail()\n {\n\t\t$this->send_tries++;\n\t}",
"public function testRetries()\n {\n $pdb = $this->getMock('PDB_mysql', array('reconnect', 'getDefaultPDO'),\n array($this->dsn, $this->username, $this->password),\n '', false);\n $pdb->expects($this->exactly(4))->method('reconnect');\n\n $pdo = $this->getMock('PDO', array('prepare'),\n array('sqlite::memory:', '', ''));\n $msg = \"2006 MySQL server has gone away\";\n $pdo->expects($this->exactly(4))->method('prepare')\n ->will($this->throwException(new PDB_Exception($msg, 2006)));\n\n $pdb->expects($this->any())->method('getDefaultPDO')\n ->will($this->returnValue($pdo));\n $this->assertSame($pdb->getDefaultPDO(), $pdo);\n $this->assertSame($pdb->getPDO(), $pdo);\n\n $pdb->setAttribute(PDB::RECONNECT, true);\n $pdb->query('SELECT * FROM foo');\n }",
"public function runFailed();",
"abstract public function attempt();",
"public function dragAndDropTo(ElementInterface $target)\n {\n $this->getSortHandle()->dragAndDrop($target);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
write data to specified name | public function write($name, $data, $extension = null); | [
"function write(array $data, $name, $group = null);",
"final protected function writeObject( $name, $data )\n {\n $this->openMount();\n $result = $this->streamAdapter->write( $name, $data );\n $this->closeMount();\n return $result;\n }",
"public function write($data) {}",
"protected function storeData(string $name, $data)\n {\n $this->{\"_{$name}\"} = $data;\n }",
"public function write($filename, $data);",
"public static function write($name, $value)\n {\n $settingsObj = self::getInstance();\n $settingsObj->data = ArrayUtils::setValue($settingsObj->data, $name, $value);\n }",
"public function writeToFile($data){\t\n\t\tfwrite($this->fptr,$data);\n\t}",
"public function write($file, $data) {}",
"public function write();",
"static function SaveLog($name, $data)\n\t{\t\t\n\t\treturn self::Write(BIT . 'Logs' . DS . $name, $data);\n\t}",
"abstract public function on_store_data($name, $data);",
"protected function _write_value ($name, $value)\n {\n if ($this->storage_enabled)\n {\n $this->_app->storage->set_value ($this->_stored_name ($name), $value);\n $this->_record (\"Wrote [$name] = [$value]\");\n }\n }",
"abstract function _on_store_data($name, $data);",
"public function write($name, $value)\n {\n $_SESSION[$name] = $value;\n }",
"public function downloadData($data, $name) {\n header(\"Content-Description: File Transfer\");\n header('Content-type: text/plain; name=' . $name);\n header('Content-Disposition: attachment; filename=\"' . $name .'\"');\n header(\"Content-Length: \".strlen($data));\n header('Content-transfer-encoding: 8bit');\n header('Expires: 0');\n header('Cache-Control: private');\n header('Pragma: cache'); \n \n $this->end($data);\n }",
"abstract public function write(string $key, $data): void;",
"abstract function write();",
"public function writeData($data) {\n if ($this->f) {\n fputs($this->f, $data);\n } else {\n throw new pdoMap_Parsing_Mapping_Exceptions_Write('not already opened'); \n }\n }",
"public function set_data($name, $value)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for checking that the value of a volcano ID is correct Returns nothing Input: $cb_ids: an array of cb_ids e.g.: cb_ids=[17, 90, 13] $row_id: the id of the row of data InOutput: $msgs: an array of error messages | function check_cb_ids($cb_ids, $row_id, &$msgs) {
// Database functions
require_once "php/funcs/db_funcs.php";
// Check necessary variables
if (empty($cb_ids)) {
return;
}
// Explode cb_ids to array
$cb_ids_array=explode(",", $cb_ids);
// Loop on cb_ids_array
foreach ($cb_ids_array as $cb_id) {
// SELECT cb_id FROM cb WHERE cb_id=cb_id
$query_sql="SELECT cb_id FROM cb WHERE cb_id='".$cb_id."' LIMIT 1";
$query_results=array();
$query_error="";
if (!db_sql($query_sql, $query_results, $query_error)) {
// Database error
$_SESSION['errors'][0]=array();
$_SESSION['errors'][0]['code']=1120;
$_SESSION['errors'][0]['message']=$query_error." [check_cb_ids -> db_sql(query_sql=$query_sql)]";
$_SESSION['l_errors']=1;
// Redirect user to system error page
header('Location: '.$url_root.'system_error.php');
exit();
}
if (empty($query_results)) {
array_push($msgs, $row_id." - Incorrect value (cb_id=".$cb_id."): unexisting bibliographic information for that cb_id");
return;
}
}
} | [
"function valcheck($id)\r\n { \r\n global $rightdata3;\r\n if(in_array($id,$rightdata3))\r\n return 0;\r\n else\r\n\treturn 1;\t \r\n }",
"function CheckValidatePartiRegId($reg_id){\n global $ConnectingDB;\n $sql = \"SELECT r_id FROM arena_comp WHERE r_id = :EmaIl\";\n $stmt = $ConnectingDB->prepare($sql);\n $stmt->bindValue(':EmaIl',$reg_id);\n $stmt->execute();\n $Result = $stmt->rowCount();\n if ($Result==1) {\n return true;\n }else{\n return false;\n }\n }",
"function validauction($item_id){\n $checkstring = \"SELECT itemId FROM AuctionItems WHERE itemId =\".$item_id;\n global $conn;\n $results = sqlsrv_query($conn, $checkstring);\n $foundId = sqlsrv_fetch_array($results)['itemId'];\n sqlsrv_free_stmt($results);\n if(isset($foundId)){\n return true;\n }\n else{\n return false;\n }\n }",
"function checkCandidate()\n{\n\tglobal $flag, $Rec_ID, $CID, $conn;\n\t$check_id_sql = \"SELECT * FROM recruitercandidate WHERE Rec_ID = $Rec_ID AND Cand_ID =$CID\";\n\t$check_list = mysqli_query($conn, $check_id_sql);\n\t\n\tif(mysqli_num_rows($check_list) == 1)\n\t{\n\t\treturn false;\n\t}\n\telse \n\t{\n\t\t//echo \"TRUE INSIDE FUNCTION\";\n\t\treturn true;\n\t} \n\t\n}",
"private function validate($rows, $expected_id, $expected_value) {\n $this->assertCount(1, $rows);\n $result = $rows[0];\n $this->assertEquals($expected_id, $result[\"id\"]);\n $this->assertEquals($expected_value, $result[\"value\"]);\n }",
"function fValidarRUC()\n{\n //global $fiscompras;\n\t//echo \"<br> 1<br>\";\n $idProv = fGetParam('pIdProv', '0');\n $rucProv = fGetParam('pRucProv', '0');\n $idProvFact = fGetParam('pIdProvFact', '0');\n $rucProvFact = fGetParam('pRucProvFact', '0');\n \n $mensaje = \"\";\n $blRcode = fValidaRuc($rucProv, \"R\");\n //echo \"<br> 2<br>\".$rucProv.\"<br>\".$rucProvFact.\"<br>\";\n if($blRcode < 0 ) {\n\t//echo \"<br> pr: $blRcode <br>\";\n\t//$mensaje = \"RUC DE PROVEDOR CONTABLE INVALIDO (\" . $blRcode . \"). \";\n\t$mensaje = \"RUC DE PROVEDOR CONTABLE INVALIDO (\" . $rucProv . \"). \";\n }\n $blRcode2 = fValidaRuc($rucProvFact, \"R\");\n //echo \"<br> 3 / $blRcode2 <br>\";\n if($blRcode2 < 0) {\n\t//echo \"<br> fa: $blRcode <br>\";\n\t$mensaje .= \"RUC DE PROVEEDOR FISCAL INVALIDO (\" . $blRcode2 . \")\";\n }\n return (array(\"success\"=>true,\"totalRecords\"=>0,\"msg\"=>$mensaje,\"prov\"=>$blRcode,\"provFact\"=>$blRcode2));\n}",
"function validate_client_id($evv_id){\n\t\t\n\t\tswitch(strlen($evv_id)){\n\t\t\t\t\n\t\t\tcase 11:\n\t\t\t\t\n\t\t\t\t$is_id_input_correct = ((!is_numeric(substr($evv_id, 0, 7))) || ($evv_id[7] != \"-\") || (substr($evv_id, -3) != \"MCD\")) ? false : true;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t$is_id_input_correct = false;\n\t\t\n\t\t}\n\t\t\n\t\treturn $is_id_input_correct;\n\t\t\t\t\n\t}",
"function globallink_fieldable_panels_check_status($ids_arr) {\r\n $status = TRUE;\r\n\r\n $query = db_select('globallink_core_fieldable_panels', 'tcfp')\r\n ->fields('tcfp', array('id'))\r\n ->condition('status', array('Sent for Translations', 'Error'), 'IN');\r\n\r\n $results = $query->execute();\r\n $rows = array();\r\n\r\n foreach ($results as $item) {\r\n $rows[$item->id] = $item->id;\r\n }\r\n\r\n foreach ($ids_arr as $val) {\r\n if (!in_array($val, $rows)) {\r\n unset($ids_arr[$val]);\r\n $status = FALSE;\r\n }\r\n }\r\n\r\n if (!$status) {\r\n drupal_set_message(t('Cannot cancel documents that have been cancelled in Globallink.'), 'warning', NULL);\r\n }\r\n\r\n return $ids_arr;\r\n}",
"function check_exist_comb($conn,$comp,$sec,$bu,$loc,$wrkgrp,$what){\r\n\t\r\n\t$data = $conn->query(\"select * from tbl_combination where company='\".$comp.\"' and section='\".$sec.\"' and business_unit='\".$bu.\"' and location='\".$loc.\"' and workgroup='\".$wrkgrp.\"' and what='\".$what.\"'\");\r\n\t$result = $data->fetch_object();\r\n\tif($data->num_rows > 0){\r\n\t\treturn $result->id;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}",
"function verify_batch() {\n global $db;\n \n $batch=$this->cfd['batch'];\n $query=\"SELECT batch FROM polcard_cfcd WHERE format=? AND batch=? LIMIT 1\";\n $prepared_query=$db->PrepareQuery($query);\n if ($prepared_query) {\n $db->QuerySetText($prepared_query,1,\"C\");\n $db->QuerySetText($prepared_query,2,$batch);\n $result=$db->ExecuteQuery($prepared_query);\n if ($result!=0) {\n $num_rows=$db->NumberOfRows($result);\n if ($num_rows>0) {\n print \"Received: [\".$this->cfd['posid'].\",\".$this->cfd['batch'].\"]\\n\";\n return true;\n } else return false;\n } else die ($db->Error());\n } else die ($db->Error());\n \n return false;\n }",
"public function test_validate_row_id_invalid()\n {\n\t\t// Genders is a small table so it's fast to test.\n \t$actual = $this->obj->validate_row_id(\"genders\", $this->invalid_id_int);\n\t\t$expected = FALSE;\n $this->assertEquals($expected, $actual);\n }",
"function validateCompIDs() {\n\t\t$compids = processInputVar('compids', ARG_MULTINUMERIC);\n\t\t$resources = getUserResources(array($this->restype . \"Admin\"), array(\"administer\"), 0, 1);\n\t\t$usercomps = $resources[$this->restype];\n\t\t$noaccess = array();\n\t\tforeach($compids as $id) {\n\t\t\tif(! array_key_exists($id, $usercomps))\n\t\t\t\t$noaccess[] = $usercomps[$id];\n\t\t}\n\t\tif(count($noaccess)) {\n\t\t\t$ret = array('error' => 1);\n\t\t\t$ret['msg'] = \"Access denied to these computers:<br><br>\" . implode('<br>', $noaccess) . \"<br><br>\";\n\t\t\treturn $ret;\n\t\t}\n\t\treturn $compids;\n\t}",
"function validV_id() {\n\n\n global $vehicleId;\n\n\n if ( isset($_POST['submit']) AND ($_POST['submit'] == \"Show m. items for vehicle\") ) {\n\n if (isset($_POST['theID'])) {\n $vehicleId = $_POST['theID'];\n } else {\n $vehicleId = \"\";\n }\n\n // If magic quotes is on I'll stripslashes.\n if ( get_magic_quotes_gpc() ) {\n $vehicleId = stripslashes($vehicleId);\n }\n\n if ( strlen($vehicleId) > 12 ) { return false; }\n if ( strlen($vehicleId) < 1 ) { return false; }\n\n // Verify numeric data is numeric.\n if ( strlen($vehicleId) > 0 and !is_numeric($vehicleId)) { return false; }\n\n // addslashes not necessary or desired for specific reason\n\n // make sure it is in the system\n $isInSystem = isThere($vehicleId);\n return $isInSystem;\n } else {\n die('Script aborted #12580. -Programmer.');\n }\n}",
"function verify_user_ids($user_ids) {\n global $conn;\n\n $int_user_ids = array_map('intval', $user_ids);\n $user_ids_string = implode(\",\", $int_user_ids);\n\n $query = <<<SQL\nSELECT id FROM users WHERE id IN ({$user_ids_string})\nSQL;\n $result = $conn->query($query);\n $verified_user_ids = array();\n while ($row = $result->fetch_assoc()) {\n $verified_user_ids[] = (int)$row['id'];\n }\n return $verified_user_ids;\n}",
"function validainstituciones($db, $id)\n{\n $contraprestacion = \"select IdContraprestacion from Contraprestaciones where ConvenioId ='\".$id.\"'\";\n $resultcontra = $db->GetRow($contraprestacion);\n \n //si no exiete inguna contrapresacion entra a validar si existen carreras o programas creadas\n if($resultcontra['IdContraprestacion']== null)\n {\n //valida si el convenio tiene carreras asigandas actualmente.\n $carreras = \"select idconveniocarrera from conveniocarrera where ConvenioId ='\".$id.\"'\";\n $resultcarrera = $db->GetRow($carreras);\n \n //si no existen carreras creadas para el convenio entra a mostrar la lista de instituciones para posibles cambios.\n if($resultcontra['IdContraprestacion']== null)\n {\n $valida = true;\n \n }else\n {\n $valida = false;\n }\n }else\n {\n $valida = false;\n }\n return $valida;\n}",
"function check_bid_valid($project_id, $contractor_id, $bid_id ) {\n\t$project = get_field('project', $bid_id )->ID;\n\t$contractor = get_field('bidder', $bid_id)->ID;\n\t$ok = false;\n\tif(intval($project) == intval($project_id) && intval($contractor) == intval($contractor_id)){\n\t\t$ok = true;\n\t}\n\n\treturn $ok; \n\n}",
"function validateVatId() {\n\t\t\n\t\t// Obtain the checker class\n\t\trequire_once(t3lib_extMgm::siteRelPath($this->extKey) . \"classes/euvatchecker_class.php\");\n\n\t\t// Creating object of checker class\n\t\t$vat = new EUVATChecker(t3lib_extMgm::siteRelPath($this->extKey) . \"res/data_vat.xml\", t3lib_extMgm::siteRelPath($this->extKey) . \"res/error_vat.xml\", t3lib_extMgm::siteRelPath($this->extKey) . \"res/ok_vat.xml\", \"en\");\n\t\t// Initializing variables\n\t\t$vatIdSubmitted = $_SESSION['tx_netzrezepteaddress_ust_id_no'];\n\n\t\tif($vatIdSubmitted != '') {\n\t\t\t$response = \nfile_get_contents('http://www.apilayer.net/api/validate?access_key='.$this->vatlayerAPIKEY.'&vat_number='.$vatIdSubmitted.'&format=1'); \n\t\t\t$vatlayer = json_decode($response);\n\t\t\tif($vatlayer->valid == 1){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif($vat->check($vatIdSubmitted)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif($vat->getLastError() == 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}",
"function check_user_apply_cv($data = array()){\n $use_id = isset($data['uid'])? intval($data['uid']) : 0;\n $job_id = isset($data['jid'])? intval($data['jid']) : 0;\n \n if($use_id <= 0 || $job_id <= 0) return 0;\n \n \n $status = 0;\n $table_apply_cv = 'apply_cv_' . intval($use_id % VL_TABLE_APPLY_CV);\n $db_app = new db_query(\"SELECT * FROM \" . $table_apply_cv . \" WHERE apc_use_id = \" . intval($use_id) . \" AND apc_job_id = \". intval($job_id) .\" LIMIT 1\", __FILE__ . \" LINE: \" . __LINE__);\n if($rapp = mysqli_fetch_assoc($db_app->result)){\n $status = 1;\n }\n \n unset($db_app);\n \n return $status;\n }",
"function checkBlockParam($blockId)\n{\n require \"config.php\";\n if (empty($blockId)) {\n sendError(\"Parameter 'bid' is required\");\n return false;\n }\n if (!in_array($blockId, $installedModules)) {\n sendError(\"Parameter 'bid' does not indicate a valid block\");\n return false;\n }\n return true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the premium categories that this group has access to | public function get_premium_access() {
if ( ! $access = groups_get_groupmeta( $this->id, '_sc_premium_access', true ) ) {
$access = [];
}
return apply_filters( 'sc_get_premium_access', $access, $this );
} | [
"protected function _getCategories() {\n\t\treturn Mage::getModel('catalog/category')->getCollection()->addAttributeToFilter('is_active',array('1'))->load();\n\t}",
"public function availableCategories()\n {\n return $this->_categories;\n }",
"function community_groups_get_categories() {\n\treturn array('support', 'plugins', 'language', 'developers');\n}",
"public function getCategories();",
"public function getExpensesCategories() {\n\n\t\t$userID = $this->setUserID();\n\n\t\t$sql = \"SELECT ec.name, ec.id, ec.limit_category\n FROM expenses_category_assigned_to_users AS ec\n WHERE ec.user_id = $userID\";\n\n\t\t$db = static::getDB();\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->execute();\n\n\t\t$expensesCategories = $stmt->fetchAll();\n\n\t\treturn $expensesCategories;\n }",
"public function getAdultCategories() {\n\t\treturn $this->arrPorncategories;\n\t}",
"public function getAll() {\n\n return Auth::user()->categories;\n }",
"private function getCategories()\n {\n return Category::with(['groups'])\n ->orderBy('name')\n ->get();\n }",
"protected function get_vendor_allowed_categories() {\n $vendor_subscription = dokan()->vendor->get( dokan_get_current_user_id() )->subscription;\n if ( ! $vendor_subscription ) {\n return [];\n }\n $allowed_categories = $vendor_subscription->get_allowed_product_categories();\n\n return $allowed_categories;\n }",
"public static function list(): array\n {\n $category_results = static::select([\n 'level_1',\n 'level_2',\n 'level_3',\n ])->whereHas('prices', static function ($query) {\n $query->where('customer_code', auth()->user()->customer->code);\n })->doesntHave('notSoldProducts')->groupBy('level_1', 'level_2', 'level_3')->get();\n\n $categories = [];\n\n foreach ($category_results as $category) {\n if (trim($category->level_1) !== '') {\n $categories[strtoupper(trim($category->level_1))]\n [trim($category->level_2)]\n [trim($category->level_3)] = [];\n }\n }\n\n return $categories;\n }",
"public function getAccessibleCategories()\n {\n $categories = [];\n\n /**\n * @var \\Lyssal\\BlogBundle\\Entity\\Category $category\n */\n foreach ($this->categories as $category) {\n if ($category->isAccessible()) {\n $categories[] = $category;\n }\n }\n\n return $categories;\n }",
"public function getBuiltinCategories()\n {\n $output = $this->querySabnzbd('mode=queue&output=json');\n $response = json_decode($output, true);\n\n $categories = $response['queue']['categories'];\n\n $result = [];\n $result['readonly'] = true;\t// inform the GUI to not allow adding of adhoc categories\n $result['categories'] = $categories;\n\n return $result;\n }",
"public function create_premium_category() {\n \\Elementor\\Plugin::instance()->elements_manager->add_category(\n 'premium-elements',\n array(\n 'title' => Helper_Functions::get_category()\n ),\n 1);\n }",
"public function getInsightTabCategory()\n {\n $categories = DB::table('reports_category')\n ->where('parent_category_id', 8)\n ->get();\n\n return $categories;\n }",
"protected function getActiveCategories()\n {\n return Mage::getModel('catalog/category')\n ->getCollection()\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('is_active', 1);\n }",
"public static function getEnabledCategories()\n\t{\n\t\t$query = self::where(['status' => self::STATUS_ENABLED]);\n\t\treturn $query;\n\t}",
"public function categories()\n {\n $builder = static::groupBy('category');\n\n try {\n if (!dev()) {\n $builder = $builder->whereNotIn(\"category\", ['upstream', 'invisible']);\n }\n }\n catch (\\Exception $e) {\n }\n\n return $builder;\n }",
"public function getCategories()\n {\n }",
"private function _getDisabledCategoriesCollection()\n {\n return Mage::getResourceModel('catalog/category_collection')\n ->addAttributeToFilter('is_active', array('eq' => 0));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==============total no of claimed company=======// | function get_claimNo($table) {
$this->db->where('status', '1');
$this->db->group_by('company_id');
$query = $this->db->get($table);
$num = $query->num_rows();
return $num;
} | [
"public function liTotalCompanies()\n {\n try {\n return LinkedinController::companies()['_total'];\n } catch (\\Exception $e) {\n return 'N/A';\n }\n }",
"public function Getallactiveclientcompaniescount()\n {\n \t\n \t$all_companies = TblAcaCompanies::find()\n \t->joinWith('client')\n \t->joinWith('client.user')\n \t->where(['tbl_aca_clients.is_deleted'=>0])\n \t//->andwhere(['tbl_aca_users.is_active'=>1])\n \t->andwhere(['tbl_aca_users.is_deleted'=>0])\n \t->All();\n \t\n \treturn count($all_companies);\n }",
"public function paidPersonalCollages(): int {\n return $this->info()['collages'];\n }",
"public static function getCompanycustomCount()\n\t{\n\t\treturn self::getItemsCount('company_custom');\n\t}",
"function countOverdue($company = null) {\n $today = new DateValue(time() + get_user_gmt_offset());\n if ($company) {\n return Invoices::count(array('status = ? AND due_on < ? AND company_id = ?', INVOICE_STATUS_ISSUED, $today, $company->getId()));\n } else {\n return Invoices::count(array('status = ? AND due_on < ?', INVOICE_STATUS_ISSUED, $today));\n } // if\n }",
"public function getCompaniesCount()\n {\n return $this->getItemsCount(self::ITEM_COMPANIES);\n }",
"function Get_Expired_Companies_Num(){\n\n\t\t$query = \"select count(id) as number from payment_status\n\t\t\t\t\twhere Expiration_Date < curdate()\";\n\t\t$result = mysqli_query($this->getDbc(),$query);\n\t\t$res = mysqli_fetch_array($result,MYSQLI_ASSOC);\n\n\t\t$number = $res['number'];\n\n\t\tif($result){\n\t\t\treturn $number;\n\t\t}\n\t\telse{\n\t\t\treturn 0;\n\t\t}\n\n\n\t}",
"public function getTotalOrganization(){\n return $count = $this->count();\n }",
"function Get_Officially_Registered_Companies(){\n\t\t$query = \"select count(id) as number from payment_status\n\t\t\t\twhere Registration_Type != 'NOT_OFFICIAL'\";\n\n\t\t$result = mysqli_query($this->getDbc(),$query);\n\t\t$res = mysqli_fetch_array($result,MYSQLI_ASSOC);\n\n\t\t$number = $res['number'];\n\n\t\tif($result){\n\t\t\treturn $number;\n\t\t}\n\t\telse{\n\t\t\treturn 0;\n\t\t}\n\n\t}",
"function Get_Total_Company(){\n\n\t\t$query = \"select count(id) as number from company\";\n\t\t$result = mysqli_query($this->getDbc(),$query);\n\t\t$res = mysqli_fetch_array($result,MYSQLI_ASSOC);\n\n\t\t$number = $res['number'];\n\n\t\tif($result){\n\t\t\treturn $number;\n\t\t}\n\t\telse{\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function getNumberOfAttorneys() {\n $id = $this->id;\n if ($id) {\n $query = db_select('field_data_field_company', 'c');\n $query->join('field_data_field_status', 's', 'c.entity_id = s.entity_id');\n $query->condition('field_company_target_id', $id, '=');\n $query->condition('field_status_value', '1', '=');\n $query->fields('u', array('field_company_target_id'));\n\n return $query->countQuery()->execute()->fetchField();\n }\n return 0;\n }",
"public static function getCompaniesCount(){\n return DB::table('table_companies')\n ->select('table_companies.company_id')\n ->count();\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 allowedPersonalCollages(): int {\n return $this->paidPersonalCollages() + $this->personalDonorCollages();\n }",
"abstract protected function get_local_renewals_count();",
"public function getTotalOccupiedLots() {}",
"public function getContractorsCount()\n {\n return $this->count(self::contractors);\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 get_count(){return $count = count($this->account_count);}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Business Profile store code of this location. This is synced from the Business Profile account. Generated from protobuf field string store_code = 2; | public function getStoreCode()
{
return $this->store_code;
} | [
"public function setStoreCode($var)\n {\n GPBUtil::checkString($var, True);\n $this->store_code = $var;\n\n return $this;\n }",
"public function getStoreCode()\n\t{\n\t\treturn $this->store_code;\n\t}",
"public function getStoreCode(): string\n {\n return $this->storeManager->getStore()->getCode();\n }",
"public function getBusinessLocationCode()\n {\n return $this->businessLocationCode;\n }",
"private function getStorePostcode()\n {\n return $this->_scopeConfig->getValue('general/store_information/postcode');\n }",
"public function getStoreCode()\n {\n return $this->hasOne(Store::className(), ['code' => 'store_code']);\n }",
"public function getCurrentStoreCode()\n {\n return $this->_storeManager->getStore()->getCode();\n }",
"public function getLocationCode()\n {\n return $this->location_code;\n }",
"public function getLocationCode()\n {\n return $this->locationCode;\n }",
"public function getCompanyCode($store = null){\n return Mage::getStoreConfig(self::ORDER_PROCESSING_XML_PATH.'company_code', $store);\n }",
"public function getStoreAddress()\n {\n return $this->store_address;\n }",
"public function getStoreIdByStoreCode($storeCode)\n {\n $storeId = Mage::getModel('core/store')->loadConfig($storeCode)->getId();\n if (!$storeId) {\n $storeId = Mage::getModel('core/store')->load($storeCode, 'code')->getId();\n }\n\n return $storeId;\n }",
"public function getLocationcode()\n {\n\n return $this->locationcode;\n }",
"public function getStoreByCode($store)\n {\n $this->_initStores();\n if (isset($this->_stores[$store])) {\n return $this->_stores[$store];\n }\n return false;\n }",
"public function getActiveStoreByCode($code);",
"public function getLocationCode()\n {\n if ($this->location) {\n return $this->location->getCode();\n }\n\n return '';\n }",
"public function getStoreNumber()\n {\n return $this->storeNumber;\n }",
"public function getLocationCode();",
"public function getStoreAddress()\n {\n return $this->_getData(self::STORE_ADDRESS);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a straight linestring and persist it in database. Line is created with three aligned points: (0 0) (2 2) (5 5). | protected function createStraightLineString(): LineStringEntity
{
return $this->createLineString([
new Point(0, 0),
new Point(2, 2),
new Point(5, 5),
]);
} | [
"protected function persistGeometryStraightLine(): GeometryEntity\n {\n try {\n $straightLineString = new LineString([\n [1, 1],\n [2, 2],\n [5, 5],\n ]);\n } catch (InvalidValueException $e) {\n static::fail(sprintf('Unable to create linestring Y (1 1, 2 2, 5 5): %s', $e->getMessage()));\n }\n\n return $this->persistGeometry($straightLineString);\n }",
"protected function createLineStringA(): LineStringEntity\n {\n return $this->createLineString([\n new Point(0, 0),\n new Point(10, 10),\n ]);\n }",
"protected function createLineStringA(): LineString\n {\n try {\n return new LineString([\n new Point(0, 0),\n new Point(10, 10),\n ]);\n } catch (InvalidValueException $e) {\n static::fail(sprintf('Unable to create linestring A (0 0, 10 10): %s', $e->getMessage()));\n }\n }",
"protected function persistNodeLineString(): LineStringEntity\n {\n return $this->persistLineString($this->createNodeLineString());\n }",
"public function createLine() {\n\t\treturn $this->objectManager->get('Tx_Sfsvgapi_Domain_Model_Line');\n\t}",
"protected function persistLineStringB(): LineStringEntity\n {\n return $this->persistLineString($this->createLineStringB());\n }",
"public static function factory(array $points)\n {\n foreach ($points as $point) {\n if (! $point instanceof Point) {\n throw GeometryException::unexpectedGeometryType(Point::class, $point);\n }\n }\n\n self::getDimensions($points, $is3D, $isMeasured, $srid);\n\n if (count($points) < 2) {\n throw new GeometryException('A LineString must have at least 2 points.');\n }\n\n $lineString = new LineString(false, $is3D, $isMeasured, $srid);\n $lineString->points = array_values($points);\n\n return $lineString;\n }",
"public function toLine() : LineEntity {\n\n $side = $this->getSide();\n $store = $this->getSale()->getStore();\n\n $line = new LineEntity();\n $line->setStore($store);\n $line->setOdds($this->getOdds());\n //$line->setInverseOdds($this->getInverseOdds());\n $line->setSide($side);\n $line->setCreatedAt(Carbon::now());\n $line->setUpdatedAt(Carbon::now());\n\n // 0 out cached aggregated values.\n $line->setRollingInventory(0);\n $line->setRollingAmount(0);\n $line->setRollingAmountMax(0);\n $line->setRealTimeInventory(0);\n $line->setRealTimeAmount(0);\n $line->setRealTimeAmountMax(0);\n\n foreach($this->predictions as $prediction) {\n\n $newPrediction = $prediction->toStandardPrediction();\n $newPrediction->setLine($line);\n $line->addPrediction($newPrediction);\n\n }\n\n return $line;\n\n }",
"public function makeLineString(...$pointSpecs)\n {\n $iterator = new \\ArrayIterator($pointSpecs);\n $points = [];\n while ($iterator->valid()) {\n $x = $iterator->current();\n $iterator->next();\n $y = $iterator->current();\n $iterator->next();\n\n array_push($points, new Point($x, $y));\n }\n return new LineString(...$points);\n }",
"function drawLineString($pointlist, $stroke='black', $fill='transparent', $stroke_width=2) {\r\n// echo \"StoredDrawing::drawLineString(pointlist, stroke=$stroke, fill=$fill, stroke_width=$stroke_width)<br>\\n\";\r\n $this->store[] = $this->drawing->drawLineString($pointlist, $stroke, $fill, $stroke_width);\r\n }",
"public function polyline( $points, $attributes = array( ) ) \n { \n //Create the polyline element \n $polyline = $this->DOMDocument->createElement( 'polyline' ); \n\n //Add the element's attributes \n $polyline->appendChild( $this->DOMAttribute( 'points', $points ) ); \n\n //Add the optional DOMElement attributes to the element by reference \n $this->DOMAttributes( $polyline, $attributes ); \n\n //Append the polyline element to the document \n $this->root_element->appendChild( $polyline ); \n }",
"function generateLineString($pages)\n{\n foreach ($pages as $page) {\n if ($location = $page->location()->yaml()) {\n $coords[] = [\n $location['lon'],\n $location['lat']\n ];\n }\n }\n\n $lineString = [\n 'type' => 'LineString',\n 'coordinates' => $coords\n ];\n\n return $lineString;\n}",
"public function polyline()\n {\n if ( empty($this->attributes['stroke-width']) ) {\n $this->attributes['stroke-width'] = 1;\n }\n\n imagesetthickness($this->image, $this->attributes['stroke-width']);\n $color = $this->color->allocate($this->attributes['stroke'], $this->image, $this->getOpacity('stroke'));\n \n $points = explode(' ', $this->attributes['points']);\n foreach ( $points AS $key => $once ) {\n if ( empty($points[$key + 1]) ) {\n break;\n }\n \n list($x1, $y1) = explode(',', $once, 2);\n list($x2, $y2) = explode(',', $points[$key + 1], 2);\n \n imageline($this->image, $x1, $y1, $x2, $y2, $color);\n }\n }",
"public function createBottomLineString() {\n\n //start it, baby!\n $bottomLineString = \"\";\n\n //EZS with amount or not?\n if($this->ezs_amount == 0){\n $bottomLineString .= \"042>\";\n }else{\n $amountParts = explode(\".\", $this->ezs_amount);\n $bottomLineString .= \"01\";\n $bottomLineString .= str_pad($amountParts[0], 8 ,'0', STR_PAD_LEFT);\n $bottomLineString .= str_pad($amountParts[1], 2 ,'0', STR_PAD_RIGHT);\n $bottomLineString .= $this->modulo10($bottomLineString);\n $bottomLineString .= \">\";\n }//if\n\n //add reference number\n $bottomLineString .= $this->createCompleteReferenceNumber();\n $bottomLineString .= \"+ \";\n\n //add banking account\n $bankingAccountParts = explode(\"-\", $this->ezs_bankingAccount);\n $bottomLineString .= str_pad($bankingAccountParts[0], 2 ,'0', STR_PAD_LEFT);\n $bottomLineString .= str_pad($bankingAccountParts[1], 6 ,'0', STR_PAD_LEFT);\n $bottomLineString .= str_pad($bankingAccountParts[2], 1 ,'0', STR_PAD_LEFT);\n $bottomLineString .= \">\";\n\n //done!\n return $bottomLineString;\n\n }",
"public function create(IDataStruct $struct = null)\r\n\t{\r\n\t\t$linestring = new Linestring($this->getDomainDataProvider());\r\n\t\t$struct = is_null($struct) ? new LinestringStruct() : $struct;\r\n\t\t$linestring->setDataStruct($struct);\r\n\t\treturn $linestring;\r\n\t}",
"protected function drawLine(){\n $this->SetLineStyle(array('width' => 0.85 / $this->getScaleFactor(), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(220, 220, 220)));\n $this->MultiCell(0, 0, '', 'T', 0, 'C');\n }",
"static private function toLineString(array $coordinates)\n {\n $positions = array();\n foreach ($coordinates as $position)\n {\n $positions[] = self::toPoint($position);\n }\n return new LineString($positions);\n }",
"public function drawLine($x1, $y1, $x2, $y2)\n {\n $this->_addProcSet('PDF');\n\n $x1Obj = new InternalType\\NumericObject($x1);\n $y1Obj = new InternalType\\NumericObject($y1);\n $x2Obj = new InternalType\\NumericObject($x2);\n $y2Obj = new InternalType\\NumericObject($y2);\n\n $this->_contents .= $x1Obj->toString() . ' ' . $y1Obj->toString() . \" m\\n\"\n . $x2Obj->toString() . ' ' . $y2Obj->toString() . \" l\\n S\\n\";\n\n return $this;\n }",
"public function drawLine($x1, $y1, $x2, $y2)\n {\n $this->_addProcSet('PDF');\n\n $x1Obj = new Zend_Pdf_Element_Numeric($x1);\n $y1Obj = new Zend_Pdf_Element_Numeric($y1);\n $x2Obj = new Zend_Pdf_Element_Numeric($x2);\n $y2Obj = new Zend_Pdf_Element_Numeric($y2);\n\n $this->_contents .= $x1Obj->toString() . ' ' . $y1Obj->toString() . \" m\\n\"\n . $x2Obj->toString() . ' ' . $y2Obj->toString() . \" l\\n S\\n\";\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Schedules the invoice content change event. | abstract protected function scheduleInvoiceContentChangeEvent(Model\InvoiceInterface $invoice); | [
"private function closedInvoiceNotification() {\n $this->setCommonInvoiceFields();\n // manual notification can be identified by collection_method key.\n $this->saveInvoiceData();\n }",
"public function setSimulationEventsContent(?SimulationEventsContent $value): void {\n $this->getBackingStore()->set('simulationEventsContent', $value);\n }",
"function SaveDetails()\n\t{\n\t\t// Check permissions\n\t\tAuthenticatedUser()->CheckAuth();\n\t\tAuthenticatedUser()->PermissionOrDie(PERMISSION_ADMIN);\n\n\t\t// Load the automatic invoice run events for the invoice run\n\t\t$strWhere = \"invoice_run_id = <INVOICE_RUN_ID>\";\n\t\t$arrWhere = array('INVOICE_RUN_ID' => DBO()->InvoiceRun->Id->Value);\n\t\tDBL()->current_automatic_invoice_run_event->SetTable('automatic_invoice_run_event');\n\t\tDBL()->current_automatic_invoice_run_event->Where->Set($strWhere, $arrWhere);\n\t\tDBL()->current_automatic_invoice_run_event->Load();\n\n\t\tTransactionStart();\n\n\t\tforeach (DBL()->current_automatic_invoice_run_event as $dboAutomaticInvoiceRunEvent)\n\t\t{\n\t\t\t// Get the submitted version\n\t\t\t$name = 'automatic_invoice_run_event_' . $dboAutomaticInvoiceRunEvent->id->Value;\n\t\t\t$submitted = DBO()->{$name};\n\n\t\t\t// Check to see if the value is set\n\t\t\tif ($dboAutomaticInvoiceRunEvent->id->Value == $submitted->Id->Value)\n\t\t\t{\n\t\t\t\t// Parse the submitted datetime (expected format h:i:s d/m/Y)\n\t\t\t\tif (!$submitted->scheduled_datetime || !$submitted->scheduled_datetime->Value)\n\t\t\t\t{\n\t\t\t\t\t$scheduledDatetime = NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$scheduledDatetime = trim($submitted->scheduled_datetime->Value);\n\t\t\t\t\t$parts = array();\n\t\t\t\t\t$gap = \"(?:[^0-9]+)\";\n\t\t\t\t\t$dig0 = \"([0-9]{0,2})\";\n\t\t\t\t\t$dig2 = \"([0-9]{1,2})\";\n\t\t\t\t\t$dig4 = \"([0-9]{4,4})\";\n\t\t\t\t\t$regExp = \"/^{$dig2}{$gap}{$dig2}{$gap}(?:{$dig2}{$gap}|){$dig2}{$gap}{$dig2}{$gap}{$dig4}$/\";\n\t\t\t\t\tif (!preg_match($regExp, $scheduledDatetime, $parts) || !($mktime = mktime(intval($parts[1]), intval($parts[2]), intval($parts[3]), intval($parts[5]), intval($parts[4]), intval($parts[6]))))\n\t\t\t\t\t{\n\t\t\t\t\t\tAjax()->AddCommand(\"Alert\", \"The expected date/time format is hour:minute:seconds day/month/year (e.g. \" . date(\"H:i:s d/m/Y\") . \"). You entered $scheduledDatetime\");\n\t\t\t\t\t\tAjax()->AddCommand(\"SetFocus\", \"automatic_invoice_run_event_\" . $submitted->Id->Value . \".scheduled_datetime\");\n\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t}\n\t\t\t\t\t$scheduledDatetime = date('Y-m-d H:i:s', $mktime);\n\t\t\t\t}\n\n\t\t\t\t// Get the previous scheduled datetime\n\t\t\t\tif (!$dboAutomaticInvoiceRunEvent->scheduled_datetime || !$dboAutomaticInvoiceRunEvent->scheduled_datetime->Value)\n\t\t\t\t{\n\t\t\t\t\t$previousDatetime = NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$previousDatetime = $dboAutomaticInvoiceRunEvent->scheduled_datetime->Value;\n\t\t\t\t}\n\n\t\t\t\t// Check to see if the value has been changed\n\t\t\t\tif ($scheduledDatetime != $previousDatetime)\n\t\t\t\t{\n\t\t\t\t\t// Update the value and change it\n\t\t\t\t\t$dboAutomaticInvoiceRunEvent->SetColumns(array('scheduled_datetime', 'update_user_id', 'update_datetime'));\n\t\t\t\t\t$dboAutomaticInvoiceRunEvent->Id = $dboAutomaticInvoiceRunEvent->id->Value;\n\t\t\t\t\t$dboAutomaticInvoiceRunEvent->scheduled_datetime = $scheduledDatetime;\n\t\t\t\t\t$dboAutomaticInvoiceRunEvent->update_user_id = AuthenticatedUser()->GetUserId();\n\t\t\t\t\t$dboAutomaticInvoiceRunEvent->update_datetime = date('Y-m-d H:i:s');\n\n\t\t\t\t\tif (!$dboAutomaticInvoiceRunEvent->Save())\n\t\t\t\t\t{\n\t\t\t\t\t\tTransactionRollback();\n\t\t\t\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Saving changes to the scheduled times failed.\");\n\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Fire the OnCustomerGroupDetailsUpdate Event\n\t\tTransactionCommit();\n\t\tAjax()->FireEvent('OnInvoiceRunEventsUpdate', array());\n\t\treturn TRUE;\n\t}",
"private function pvtUpdateInvoice()\n {\n $paymentToken = $this->getRequestedValue('paymenttoken');\n $invoiceId = $this->getRequestedValue('MNT_OPERATION_ID');\n $invoiceStatus = self::STATUS_FINISHED;\n\n $updateInvoiceData = array('invoiceId' => $invoiceId, 'invoiceStatus' => $invoiceStatus, 'tokenHash' => MonetaSdkUtils::getGUID(),\n 'paymentToken' => $paymentToken, 'dateNotify' => MonetaSdkUtils::getDateWithModification($this->getSettingValue('regular_payments_notify_period')),\n 'dateTarget' => MonetaSdkUtils::getDateWithModification($this->getSettingValue('regular_payments_pay_period')));\n\n $storage = $this->getStorageService();\n $storage->updateInvoice($updateInvoiceData);\n\n }",
"public function setEventContent($content)\r\n {\r\n return parent::setData(self::ENTITY_CONTENT, $content);\r\n }",
"public function onPostSync(OrderItemEvent $event)\n {\n $this->dispatcher->dispatch(OrderEvents::CONTENT_CHANGE, $event);\n }",
"function _c4m_user_notifications_dispatch_content_update($node) {\n _c4m_user_notifications_notify_subscribe_content($node);\n}",
"public function jobExpiringInvoiceNotifyAction(){\r\n $em = $this->entityManager;\r\n $generalService = $this->generalService;\r\n $clientGeneralService = $this->clientGeneralService;\r\n $expiringInvoice = $em->getRepository(\"Transactions\\Entity\\Invoice\")->findJobExpiringInvoice();\r\n foreach ($expiringInvoice as $invoice){\r\n $template = array(\r\n \"var\"=>array(\r\n \"logo\"=>$clientGeneralService->loginPageLogo($invoice->getCustomer()->getCustomerBroker()->getBroker()->getId()),\r\n \"brokerName\"=>$invoice->getCustomer()->getCustomerBroker()->getBroker()->getCompanyName(),\r\n \"invoice\"=>$invoice,\r\n ),\r\n \"template\"=>\"general-customer-invoice-expiring\", // TODO design the mail \r\n );\r\n $messagePointers = array(\r\n \"to\" => $invoice->getCustomer()->getUser()->getEmail(),\r\n \"fromName\" => $invoice->getCustomer()->getCustomerBroker()->getBroker()->getCompanyName(),\r\n \"subject\" => \"Expiring Invoice\"\r\n );\r\n $this->generalService->sendMails($messagePointers, $template);\r\n }\r\n return $this->getResponse()->setContent(NULL);\r\n }",
"public function testUpdateReferencesToContent()\n {\n $content = Phake::mock(ContentInterface::class);\n $contentEvent = Phake::mock(ContentEvent::class);\n Phake::when($contentEvent)->getContent()->thenReturn($content);\n\n $this->subscriber->updateReferencesToContent($contentEvent);\n\n Phake::verify($this->referenceManager)->updateReferencesToEntity($content);\n }",
"public static function pendingContentListener(Zikula_Event $event)\n {\n parent::pendingContentListener($event);\n }",
"public static function invoiceCreated($callback)\n {\n static::registerModelEvent('invoiceCreated', $callback);\n }",
"public function setInvoiceDate($invoiceDate);",
"private function setDueDate($invoice)\n {\n if (!$invoice instanceof Invoice) {\n return;\n }\n\n $invoiceDate = $invoice->getInvoiceDate();\n $dueDate = clone $invoiceDate;\n $dueDate->add(new \\DateInterval('P30D'));\n\n $invoice->setDueDate($dueDate);\n }",
"function wc_trigger_stock_change_notifications($order, $changes)\n {\n }",
"private function processingInvoiceNotification() {\n return true;// not needed currently as payment using bank account is not integrated. Only card payments are allowed currently.\n $this->setCommonInvoiceFields();\n // manual notification can be identified by collection_method key.\n $this->saveInvoiceData();\n }",
"function updateInvoicePaymentView() {\n $invPage = $_SESSION['PAYMENT_HISTORY_INV_CONTROLLER'];\n $invPage->doViewReloadTable($_POST['include_acknowledged'] == 'true');\n echo $invPage->toHtml();\n }",
"public function updated(Invoice $invoice)\n {\n if ($invoice->isDirty('date') || $invoice->isDirty('due_date')) {\n\n $date_to_send = $invoice->getNextReminderDateToSend();\n\n if (!empty($date_to_send)) {\n $invoice->date_to_send = $date_to_send;\n $invoice->saveQuietly();\n }\n }\n }",
"protected function sendChangedEvent()\n {\n // TODO: Split into separate events\n $dispatcher = ProjectConfiguration::getActive()->getEventDispatcher();\n $dispatcher->notify(new sfEvent($this, 'cartProduct.changed'));\n }",
"public function handle_scheduled_resync_action() {\n\n\t\t$this->sync_all_fb_products_using_feed();\n\n\t\t$resync_offset = $this->get_scheduled_resync_offset();\n\n\t\t// manually schedule the next product resync action if possible\n\t\tif ( null !== $resync_offset && $this->is_product_sync_enabled() && ! $this->is_resync_scheduled() ) {\n\t\t\t$this->schedule_resync( $resync_offset );\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new database notification collection instance. | public function newCollection(array $models = []) {
return new DatabaseNotificationCollection($models);
} | [
"public function newCollection(array $models = [])\n {\n return new DatabaseNotificationCollection($models);\n }",
"public function createNotifications()\n {\n MessageNotification::make($this->message, $this->message->conversation);\n }",
"protected function createDatabaseNotifier()\n {\n return $this->app->make('Inoplate\\Notifier\\DatabaseNotifier');\n }",
"public function createNotif() {\n\n $notif = new Notification();\n $notif->getFromDBByCrit(['event' => 'alert_' . $this->getID()]);\n\n if ($notif->isNewItem()) {\n $notif->check(-1, CREATE);\n $notif->add(['name' => __('Saved search') . ' ' . $this->getName(),\n 'entities_id' => $_SESSION[\"glpidefault_entity\"],\n 'itemtype' => SavedSearch_Alert::getType(),\n 'event' => 'alert_' . $this->getID(),\n 'is_active' => 0,\n 'datate_creation' => date('Y-m-d H:i:s')\n ]);\n\n Session::addMessageAfterRedirect(__('Notification has been created!'), INFO);\n }\n }",
"protected function createNotifications()\n {\n $notifications = $this->blueprint->getNotifications();\n\n // Use Faker to generate some fake data.\n $faker = \\Faker\\Factory::create();\n\n // Generate process notifications content.\n foreach ($notifications as $notification) {\n ProcessNotification::create([\n 'process_definition_id' => $this->processDefinition->id,\n 'name_key' => $notification['name_key'] ?? kebab_case($notification['name_en']),\n 'name_en' => $notification['name_en'],\n 'name_fr' => $notification['name_fr'],\n 'subject_en' => $notification['subject_en'] ?? $notification['name_en'],\n 'subject_fr' => $notification['subject_fr'] ?? $notification['name_fr'],\n 'body_en' => str_replace('\\n', PHP_EOL, $notification['body_en'] ?? $faker->paragraph),\n 'body_fr' => str_replace('\\n', PHP_EOL, $notification['body_fr'] ?? $faker->paragraph),\n 'created_by' => auth()->user()->id,\n 'updated_by' => auth()->user()->id,\n ]);\n }\n }",
"public function created(Collection $collection)\n {\n //\n }",
"protected function createTestCollection(): void\n {\n $context = $this->getContext();\n\n $database = $context->getDatabase();\n $database->createCollection($context->collectionName, $context->defaultWriteOptions);\n }",
"public static function create( array $info ) {\n\t\t$obj = new Notification();\n\t\tstatic $validFields = [ 'event', 'user' ];\n\n\t\tforeach ( $validFields as $field ) {\n\t\t\tif ( isset( $info[$field] ) ) {\n\t\t\t\t$obj->$field = $info[$field];\n\t\t\t} else {\n\t\t\t\tthrow new InvalidArgumentException( \"Field $field is required\" );\n\t\t\t}\n\t\t}\n\n\t\tif ( !$obj->user instanceof User ) {\n\t\t\tthrow new InvalidArgumentException( 'Invalid user parameter, expected: User object' );\n\t\t}\n\n\t\tif ( !$obj->event instanceof Event ) {\n\t\t\tthrow new InvalidArgumentException( 'Invalid event parameter, expected: Event object' );\n\t\t}\n\n\t\t// Notification timestamp should be the same as event timestamp\n\t\t$obj->timestamp = $obj->event->getTimestamp();\n\t\t// Safe fallback\n\t\tif ( !$obj->timestamp ) {\n\t\t\t$obj->timestamp = wfTimestampNow();\n\t\t}\n\n\t\t// @Todo - Database insert logic should not be inside the model\n\t\t$obj->insert();\n\n\t\treturn $obj;\n\t}",
"protected function getNotification_MethodCollectionService()\n {\n $this->services['notification.method_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('notification.method.board');\n $instance->add('notification.method.email');\n $instance->add('notification.method.jabber');\n\n return $instance;\n }",
"protected function createCollection()\n {\n return $this->_setUpNewNode(\n new Collection()\n );\n }",
"public function collectionInstance()\n {\n $factory = $this->getCollectionFactory();\n if (!$factory) {\n\n // use a default collection class to store the data\n $class = static::DEFAULT_COLLECTION_CLASS;\n return new $class;\n }\n\n return $factory->instance($this->getCollectionName());\n }",
"abstract public function sendCreateCollectionRequest(BillplzCollectionMessage $collection);",
"protected function getNotification_MethodCollectionService()\n {\n $this->services['notification.method_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('notification.method.email');\n $instance->add('notification.method.jabber');\n\n return $instance;\n }",
"function create_collection(){\n if (!empty($this->title)) {\n // required parameter\n $this->data['title'] = $this->title;\n // optional parameter\n if (isset($this->split_payment['email'])) $this->data['split_payment[email]'] = $this->split_payment['email'];\n if (isset($this->split_payment['fixed_cut'])) $this->data['split_payment[fixed_cut]'] = $this->split_payment['fixed_cut'];\n if (isset($this->split_payment['split_header'])) $this->data['split_payment[split_header]'] = $this->split_payment['split_header'];\n }else{\n $this->error = \"Title is a required parameter\";\n return $this->error;\n }\n return $this->callAPI(\"POST\",\"collections\",$this->data);\n }",
"protected function maybe_create_notification() {\n\t\tif ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) {\n\t\t\t$notification = $this->notification();\n\t\t\t$this->notification_helper->restore_notification( $notification );\n\t\t\t$this->notification_center->add_notification( $notification );\n\t\t}\n\t}",
"protected function createEmptyCollection(): Collection\n {\n return new Collection($this->db);\n }",
"public function initNotifications($overrideExisting = true)\n {\n if (null !== $this->collNotifications && !$overrideExisting) {\n return;\n }\n $this->collNotifications = new PropelObjectCollection();\n $this->collNotifications->setModel('Notification');\n }",
"public function created(Notification $notification)\n {\n SendNotification::dispatch($notification);\n }",
"protected function _initCollection()\n {\n $entity = ucfirst($this->_getRequestData('entity'));\n $className = str_replace(self::ENTITY_PLACEHOLDER, $entity, self::COLLECTION_CLASS_TEMPLATE);\n $collection = new $className($this->_getDataContainer(self::DC_MODEL));\n $this->_addDataContainer(self::DC_COLLECTION, $collection);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of Mobile | public function getMobile(){
return $this->Mobile;
} | [
"public function getMobile()\n {\n return $this->mobile;\n }",
"public function getMobileForVerification()\n {\n return $this->mobile;\n }",
"function mobile()\n\t{\n\t\tif ($this->mobileNumber) {\n\t\t\treturn null;\n\t\t}\n\t\t$mobile = new Users_Mobile();\n\t\t$mobile->number = $this->mobileNumber;\n\t\treturn $mobile->retrieve();\n\t}",
"public function getMobilephone()\n {\n return $this->mobilephone;\n }",
"public function getMobilephone()\n\t{\n\t\treturn $this->mobilephone;\n\t}",
"public function getMemberMobile()\n {\n return $this->MemberMobile;\n }",
"public function getMobilePhone() {\n return $this->getCommunicationFieldText(\n $this->get('mobile_phone')->getString(),\n 'communication_mobile'\n );\n }",
"public function getMobilePhone()\n {\n return $this->mobile_phone;\n }",
"public function getCmobile()\n {\n return $this->cmobile;\n }",
"public function getUserMobileNumber()\n\t\t\t\t{\n\t\t\t\t\t\t\t\tif(isset($this->userMobileNumber))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\treturn $this->userMobileNumber;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}",
"public function getMobilePhone()\n\t{\n\t\treturn $this->mobile_phone;\n\t}",
"public function getWindows10Mobile()\n {\n if (array_key_exists(\"windows10Mobile\", $this->_propDict)) {\n return $this->_propDict[\"windows10Mobile\"];\n } else {\n return null;\n }\n }",
"public function getMobileNumber()\n {\n return $this->mobileNumber;\n }",
"public function getReqMobilePhone()\n\t{\n\t\treturn $this->req_mobile_phone;\n\t}",
"public function getMobilePhone()\n {\n if (array_key_exists(\"mobilePhone\", $this->_propDict)) {\n return $this->_propDict[\"mobilePhone\"];\n } else {\n return null;\n }\n }",
"public function getShow_mobile() {\n return $this->_show_mobile;\n }",
"private function getMobileField(): string\n {\n return config('mobile_verifier.mobile_column', 'mobile');\n }",
"public function getReqmobilephone()\n\t{\n\t\treturn $this->reqmobilephone;\n\t}",
"public function getMobileDeviceConstant()\n {\n return $this->mobile_device_constant;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the af duree. | public function getAfDuree() {
return $this->afDuree;
} | [
"public function getBaseAf() {\n return $this->baseAf;\n }",
"public function getAfDuree(): ?float {\n return $this->afDuree;\n }",
"public function getAfType() {\n return $this->afType;\n }",
"public function getAfiliacion()\n {\n return $this->afiliacion;\n }",
"public function getADesa()\n {\n return $this->a_desa;\n }",
"public function getAdDuree() {\n return $this->adDuree;\n }",
"public function setAfDuree($afDuree) {\n $this->afDuree = $afDuree;\n return $this;\n }",
"public function getAfAmortAnterieur() {\n return $this->afAmortAnterieur;\n }",
"public function getAfsluitenDetail() {\n\t\treturn $this->afsluitenDetail;\n\t}",
"public function getFallecido()\r\n\t{\r\n\t\treturn($this->fallecido);\r\n\t}",
"public function getOuvriereEauForet()\n {\n return $this->ouvriereEauForet;\n }",
"public function getDecalageFermetureAuto() {\n return $this->decalageFermetureAuto;\n }",
"public function getDuree()\n {\n return $this->duree;\n }",
"private function getAfdelingen() {\n if (count($this->afdelingen) == 0) {\n $afdelingen = $this->api('Contact', 'get', [\n 'contact_sub_type' => 'SP_Afdeling',\n 'option.limit' => 1000,\n ]);\n if ($afdelingen['is_error']) {\n return FALSE;\n }\n\n $this->afdelingen = $afdelingen['values'];\n }\n\n return $this->afdelingen;\n }",
"public function getDsUf()\n {\n return $this->ds_uf;\n }",
"public function getFUR()\n {\n return $this->FUR;\n }",
"public function get_adeudo()\n {\n return $this->adeudo;\n }",
"public function getAorD()\n {\n return $this->AorD;\n }",
"public function getForfait()\n {\n return $this->forfait;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a factory of parameter declaration clause doubles. | private function createParameterDeclarationClauseDoubleFactory(): ParameterDeclarationClauseDoubleFactory
{
return new ParameterDeclarationClauseDoubleFactory($this);
} | [
"private function createIdExpressionDoubleFactory(): IdExpressionDoubleFactory\n {\n return new IdExpressionDoubleFactory($this);\n }",
"public static function createDouble(): self\n {\n $stSpec = new self();\n $stSpec->type = self::ST_DOUBLE;\n \n return $stSpec;\n }",
"public abstract function createParameter(array $cols, DateTime $date, DWDStation $station, Coordinate $coordinate): DWDAbstractParameter;",
"public function parseParameterDeclarationClause(): ParameterDeclarationClause\n {\n $prmDeclClause = new ParameterDeclarationClause();\n \n if (!$this->tokenIsSimpleTypeSpecifier() && \n !$this->tokenIs(Tag::PN_ELLIPSIS)) {\n return $prmDeclClause;\n }\n \n if (!$this->tokenIs(Tag::PN_ELLIPSIS)) {\n $prmDeclList = $this->parseParameterDeclarationList();\n $prmDeclClause->setParameterDeclarationList($prmDeclList);\n }\n\n if ($this->tokenIs(Tag::PN_COMMA) && \n $this->lookAhead(1)->getTag() == Tag::PN_ELLIPSIS) {\n // Connsume the comma and the ellipsis.\n $this->move();\n $this->move();\n\n $prmDeclClause->addEllipsis();\n } elseif ($this->moveIf(Tag::PN_ELLIPSIS)) {\n $prmDeclClause->addEllipsis();\n }\n \n return $prmDeclClause;\n }",
"protected function createParameterDriver()\n {\n $determiner = new Determiners\\Parameter(\n $this->app['config']['localize-middleware']['parameter']\n );\n\n $determiner->setFallback($this->app['config']['app']['fallback_locale']);\n\n return $determiner;\n }",
"public function createParameter(): Parameter\n {\n return (new Parameter('query', $this->ref, $this->name))\n ->setDescription($this->description)\n ->setRequired($this->isRequired)\n ->setDeprecated($this->isDeprecated)\n ->setStyle($this->style)\n ->setExplode($this->explode)\n ->setExample($this->example)\n ->setAllowEmptyValue($this->allowEmptyValue)\n ->setSchema(\n (new Schema())\n ->setType($this->type)\n ->setEnum($this->enum)\n ->setFormat($this->format)\n );\n }",
"public static function Double(&$position, $length, $decimals, $signed = false)\n {\n $type = new DataType(self::DOUBLE, $position, $length);\n $type->decimals = $decimals;\n $type->signed = $signed;\n return $type;\n }",
"public static function float()\n {\n $param = new Parameter();\n\n $param->addConstraint(function($value, ParameterConstraintViolationCollection $violations) {\n if ($value === null) {\n $violations->add(new MissingParameterViolation(''));\n } else if (!is_float($value)) {\n $violations->add(new InvalidTypeViolation($value, 'float'));\n }\n });\n\n return $param;\n }",
"public static function create_competency_parameters() {\n $structure = competency_exporter::get_create_structure();\n $params = array('competency' => $structure);\n return new external_function_parameters($params);\n }",
"private function createParameterInstance(array $parameters)\n {\n return new Parameters($this->definitions, $parameters);\n }",
"public function testCreateDoubleReturnsNewInstanceSimpleTypeSpecifier(): void\n {\n $stSpec1 = SimpleTypeSpecifier::createDouble();\n $stSpec2 = SimpleTypeSpecifier::createDouble();\n self::assertNotSame($stSpec1, $stSpec2);\n }",
"private function initParameters()\n {\n $parameters = array();\n\n $formalParameters = $this->getFirstChildOfType(\n 'PDepend\\\\Source\\\\AST\\\\ASTFormalParameters'\n );\n\n $formalParameters = $formalParameters->findChildrenOfType(\n 'PDepend\\\\Source\\\\AST\\\\ASTFormalParameter'\n );\n\n foreach ($formalParameters as $formalParameter) {\n $parameter = new ASTParameter($formalParameter);\n $parameter->setDeclaringFunction($this);\n $parameter->setPosition(count($parameters));\n\n $parameters[] = $parameter;\n }\n\n $optional = true;\n foreach (array_reverse($parameters) as $parameter) {\n if ($parameter->isDefaultValueAvailable() === false) {\n $optional = false;\n }\n $parameter->setOptional($optional);\n }\n\n $this->parameters = $parameters;\n }",
"public static function createNew() : ParameterRecord\n {\n $object = new ParameterRecord();\n $object->id = \\Programster\\PgsqlObjects\\Utils::generateUuid();\n $object->m_isSavedInDatabase = false;\n return $object;\n }",
"public static function factory(php_miner_statement $stmt) {\n\t\t$tmptokens = $stmt->tokens;\n\t\t$is_abstract = false;\n\t\t$scope = \"public\";\n\t\t$name = false;\n\n\t\t/* @var $tmptokens php_miner_token[] */\n\t\twhile ( count( $tmptokens ) >= 1 && ! $tmptokens[0]->is_token( T_FUNCTION ) ) {\n\t\t\t$prefix = array_shift( $tmptokens );\n\t\t\t/* @var $prefix php_miner_token */\n\t\t\tif ($prefix->is_token( T_ABSTRACT ))\n\t\t\t\t$is_abstract = true;\n\t\t\tif ($prefix->is_token( T_PRIVATE )) {\n\t\t\t\t$scope = \"private\";\n\t\t\t}\n\t\t\tif ($prefix->is_token( T_PUBLIC )) {\n\t\t\t\t$scope = \"public\";\n\t\t\t}\n\t\t\tif ($prefix->is_token( T_PROTECTED )) {\n\t\t\t\t$scope = \"protected\";\n\t\t\t}\n\t\t}\n\t\tif (count( $tmptokens ) >= 2 && $tmptokens[1]->is_token( T_STRING )) {\n\t\t\t$name = $tmptokens[1]->string;\n\t\t}\n\n\t\tif ($name !== false)\n\t\t\treturn new self( $stmt, $name, $scope, $is_abstract );\n\n\t\treturn false;\n\t}",
"public static function create_plan_parameters() {\n return new external_function_parameters(array(\n 'plan' => new external_single_structure(array(\n 'name' => new external_value(PARAM_TEXT, 'Plan name', VALUE_OPTIONAL),\n 'description' => new external_value(PARAM_RAW, 'Plan description', VALUE_OPTIONAL),\n 'descriptionformat' => new external_value(PARAM_INT, 'Plan description format', VALUE_OPTIONAL),\n 'username' => new external_value(core_user::get_property_type('username'), 'Username', VALUE_REQUIRED),\n 'competencies' => new external_multiple_structure(new external_single_structure(array(\n 'idnumber' => new external_value(PARAM_RAW, 'Competency idnumber')\n ), 'competency', VALUE_REQUIRED), 'Competency list', VALUE_REQUIRED)\n ))\n ));\n }",
"private function handleDouble(float $parameter): Value\n {\n return new Value(new DoubleV($parameter));\n }",
"public function testAdditionalFailureDescriptionReturnsConstraintDescriptionAndFailureReasonWhenCreateDouble(): void\n {\n $sut = DeclarationSpecifierConstraint::createDouble();\n \n $pattern = \\sprintf(\n \"`^\\n\".\n \"Declaration specifier\\n\".\n \" Simple type specifier \\\"double\\\"\\n\".\n \"\\n\".\n \"Declaration specifier: .+ is not an instance of %s\\\\.$`\", \n \\str_replace('\\\\', '\\\\\\\\', DeclarationSpecifier::class)\n );\n self::assertRegExp($pattern, $sut->additionalFailureDescription(NULL));\n }",
"public function testMatchesReturnsFalseWhenCreateDoubleAndNotSimpleTypeSpecifierDouble(\n DeclarationSpecifier $declSpec\n ): void\n {\n $sut = DeclarationSpecifierConstraint::createDouble();\n self::assertFalse($sut->matches($declSpec));\n }",
"public function createFloatSimpleTypeSpecifier(): ProphecySubjectInterface\n {\n $prophecy = $this->prophesizeSubject();\n \n $stSpec = ConceptDoubleBuilder::createSimpleTypeSpecifier($this->getTestCase())\n ->buildIsInt(FALSE)\n ->buildIsFloat(TRUE)\n ->buildIsBool(FALSE)\n ->buildIsChar(FALSE)\n ->buildIsWCharT(FALSE)\n ->buildIsShort(FALSE)\n ->buildIsLong(FALSE)\n ->buildIsSigned(FALSE)\n ->buildIsUnsigned(FALSE)\n ->buildIsDouble(FALSE)\n ->buildIsIdentifier(FALSE)\n ->buildGetIdentifier()\n ->buildIsQualifiedIdentifier(FALSE)\n ->buildGetNestedNameSpecifier()\n ->getDouble();\n \n $this->buildSimpleTypeSpecifierGetDefiningTypeSpecifier($prophecy, $stSpec);\n \n return $prophecy->reveal();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update milestone on edit submission called via AJAX | public function update_milestone($milestone_id)
{
$data = $this->input->post();
$update = $this->milestone_model->update($milestone_id, $data);
if ( ! $update )
{
$this->json['status'] = 'error';
$this->json['message'] = 'There were errors when attempting to update the milestone.';
return $this->edit_milestone($milestone_id);
}
return $this->ajax_response();
} | [
"public function put_milestone()\n\t{\n\t\t$data = $this->input->post();\n\t\t$insert_id = $this->milestone_model->insert($data);\n\t\t\n\t\tif ( ! $insert_id )\n\t\t{\n\t\t\t$this->json['status'] = 'error';\n\t\t\t$this->json['message'] = 'There were errors when attempting to add the milestone.';\n\t\t\treturn $this->add_milestone($data['timeline_workstream_id']);\n\t\t}\n\t\t\n\t\t$this->json['insert_id'] = $insert_id;\n\t\t\n\t\treturn $this->ajax_response();\n\t}",
"function tasks_milestones_edit( int $milestone_id = 0 ,\n array $contents = array() ) : void\n{\n // Only administrators can run this action\n user_restrict_to_administrators();\n\n // Sanitize the task milestone id\n $milestone_id = sanitize($milestone_id, 'int', 0);\n\n // Stop here if the task milestone doesn't exist\n if(!database_row_exists('dev_tasks_milestones', $milestone_id))\n return;\n\n // Sanitize and prepare the data\n $order = sanitize_array_element($contents, 'order', 'int', min: 0, default: 0);\n $title_en = sanitize_array_element($contents, 'title_en', 'string');\n $title_fr = sanitize_array_element($contents, 'title_fr', 'string');\n $body_en = sanitize_array_element($contents, 'body_en', 'string');\n $body_fr = sanitize_array_element($contents, 'body_fr', 'string');\n $archived = sanitize_array_element($contents, 'archived', 'string', default: 'false');\n $archived = ($archived === 'true') ? 1 : 0;\n\n // Update the task milestone\n query(\" UPDATE dev_tasks_milestones\n SET dev_tasks_milestones.is_archived = '$archived' ,\n dev_tasks_milestones.sorting_order = '$order' ,\n dev_tasks_milestones.title_en = '$title_en' ,\n dev_tasks_milestones.title_fr = '$title_fr' ,\n dev_tasks_milestones.summary_en = '$body_en' ,\n dev_tasks_milestones.summary_fr = '$body_fr'\n WHERE dev_tasks_milestones.id = '$milestone_id' \");\n}",
"public function ajax_get_milestone()\n\t{\n\t\tif(isset($_POST['action']) && $_POST['action'] == \"get_milestone\")\n\t\t{\n\t\t\t$this->response_message = \"Invalid Milestone.\";\n\t\t\tif(\tisset($_POST['m_id']))\n\t\t\t{\n\t\t\t\t$milestone = $this->Milestone_model->get_milestone($_POST['m_id'], $this->organ_id);\n\t\t\t\t\n\t\t\t\tif($milestone){\n\t\t\t\t\t$this->response_code = 0;\t\n\t\t\t\t\t$this->response_message = \"Valid Milestone.\";\t\n\t\t\t\t\t$this->response_data = $milestone;\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tdie(json_encode(array(\n\t\t\t\t\t\"error\"\t\t\t=> $this->response_code,\n\t\t\t\t\t\"message\"\t\t=> $this->response_message,\n\t\t\t\t\t\"milestone\"\t\t=> $this->response_data\n\t\t\t)));\t\n\t\t}\t\n\t\t/* show error page if no POST */\n\t\tshow_404_page(\"404_page\" );\n\t}",
"function quick_add() {\n if(!Milestone::canAdd($this->logged_user, $this->active_project)) {\n \t$this->httpError(HTTP_ERR_FORBIDDEN, lang(\"You don't have permission for this action\"), true, true);\n } // if\n \n $this->skip_layout = true;\n \n $milestone_data = $this->request->post('milestone');\n if (!is_array($milestone_data)) {\n $milestone_data = array(\n 'visibility' => $this->active_project->getDefaultVisibility()\n );\n } // if\n \n $this->smarty->assign(array(\n 'milestone_data' => $milestone_data,\n 'quick_add_url' => assemble_url('project_milestones_quick_add', array('project_id' => $this->active_project->getId())),\n ));\n \n if($this->request->isSubmitted()) {\n db_begin_work();\n \n $this->active_milestone = new Milestone();\n \n $this->active_milestone->setAttributes($milestone_data);\n if(!isset($milestone_data['priority'])) {\n $this->active_milestone->setPriority(PRIORITY_NORMAL);\n } // if\n $this->active_milestone->setProjectId($this->active_project->getId());\n $this->active_milestone->setCreatedBy($this->logged_user);\n $this->active_milestone->setState(STATE_VISIBLE);\n $this->active_milestone->setVisibility(VISIBILITY_NORMAL);\n \n $save = $this->active_milestone->save();\n if($save && !is_error($save)) {\n $subscribers = array($this->logged_user->getId());\n if(is_foreachable(array_var($milestone_data['assignees'], 0))) {\n $subscribers = array_merge($subscribers, array_var($milestone_data['assignees'], 0));\n } else {\n $subscribers[] = $this->active_project->getLeaderId();\n } // if\n Subscriptions::subscribeUsers($subscribers, $this->active_milestone);\n \n db_commit();\n $this->active_milestone->ready();\n \n $this->smarty->assign(array(\n 'active_milestone' => $this->active_milestone,\n 'milestone_data' => array('visibility' => $this->active_project->getDefaultVisibility()),\n 'project_id' => $this->active_project->getId()\n ));\n \n $this->skip_layout = true;\n } else {\n db_rollback();\n $this->httpError(HTTP_ERR_OPERATION_FAILED, $save->getErrorsAsString(), true, true);\n } // if\n } // if\n }",
"function save_milestone() {\n\n $id = $this->input->post('id');\n $project_id = $this->input->post('project_id');\n\n $this->init_project_permission_checker($project_id);\n\n if ($id) {\n if (!$this->can_edit_milestones()) {\n redirect(\"forbidden\");\n }\n } else {\n if (!$this->can_create_milestones()) {\n redirect(\"forbidden\");\n }\n }\n\n $data = array(\n \"title\" => $this->input->post('title'),\n \"description\" => $this->input->post('description'),\n \"project_id\" => $this->input->post('project_id'),\n \"due_date\" => $this->input->post('due_date')\n );\n $save_id = $this->Milestones_model->save($data, $id);\n if ($save_id) {\n echo json_encode(array(\"success\" => true, \"data\" => $this->_milestone_row_data($save_id), 'id' => $save_id, 'message' => lang('record_saved')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => lang('error_occurred')));\n }\n }",
"public function add_project_milestone()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tprint_r($_POST);\r\n\t\t}",
"function milestone_modal_form() {\n $id = $this->input->post('id');\n $view_data['model_info'] = $this->Milestones_model->get_one($this->input->post('id'));\n $project_id = $this->input->post('project_id') ? $this->input->post('project_id') : $view_data['model_info']->project_id;\n\n $this->init_project_permission_checker($project_id);\n\n if ($id) {\n if (!$this->can_edit_milestones()) {\n redirect(\"forbidden\");\n }\n } else {\n if (!$this->can_create_milestones()) {\n redirect(\"forbidden\");\n }\n }\n\n $view_data['project_id'] = $project_id;\n\n $this->load->view('projects/milestones/modal_form', $view_data);\n }",
"protected function onUpdateAjax() {}",
"public function experienceeditAction(){\n\t\tglobal $mySessionFront;\t\n\t\t$db=new Db();\n\t\t$this->_helper->layout()->setLayout('ajaxlayout');\n\t\n\t\t$job_id = $this->_request->getParam('job_id');\n\t\t$position = $this->_request->getParam('position');\n\t\t$company = $this->_request->getParam('company');\n\t\t$location = $this->_request->getParam('location');\n\t\t$employment_period_from = $this->_request->getParam('employment_period_from');\n\t\t$employment_period_to = $this->_request->getParam('employment_period_to');\n\t\t$responsibility = $this->_request->getParam('responsibility');\n\t\t$is_current = $this->_request->getParam('is_current');\n\t\t\t//prd($company.''.$position.''.$company.''.$location.''.$employment_period_from.''.$employment_period_to.''.$responsibility);\n\t\t\t\n\t\t\tif ($this->_request->isPost())\n\t\t\t{\n\t\t\t\t$data='';\n\t\t\t\t$data['position']=$position;\n\t\t\t\t$data['company']=$company;\n\t\t\t\t$data['location']=$location;\n\t\t\t\t$data['employment_period_from']=$employment_period_from;\n\t\t\t\t$data['employment_period_to']=$employment_period_to;\n\t\t\t\t$data['responsibility']=$responsibility;\n\t\t\t\t$data['is_current']=$is_current;\n\t\t\t\t\n\t\t\t\t$modelobj = new Model_Mainmodel();\n\t\t\t\t$condition=\"id='\".$job_id.\"'\";\n\t\t\t\t$modelobj->updateThis('tbl_user_experience',$data,$condition);\n\t\t\t\t$mySessionFront->sucMsg = \"Experience Edit Success...\";\t\n\t\t\t}\n\t\t\t\n\t}",
"function edit_issue_disp($i) {\n\tglobal $page_setting_uri;\n?>\n<div class=\"wrap\">\n\t<div id=\"icon-edit\" class=icon32><br></div>\n\t<h2>Issue</h2>\n\t<form name=\"editissue\" id=\"editissue\" enctype=\"multipart/form-data\" method=\"post\" action=\"<?php echo $page_setting_uri;?>\" class=\"validate\">\n\t\t<input type=\"hidden\" name=\"action\" value=\"update\">\n\t\t<input type=\"hidden\" name=\"id\", value=\"<?php echo $i->id;?>\">\n\t\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<tr class=\"form-field form-required\">\n\t\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"rsch-name\">Name</label></th>\n\t\t\t\t<td><input name=\"issue-name\" id=\"issue-name\" type=\"text\" value=\"<?php echo $i->name; ?>\" size=\"40\" aria-required=\"true\">\n\t\t\t\t<p class=\"description\">The name is how it appears on your site.</p></td>\n\t\t\t</tr>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"issue-intro\">Introduction</label></th>\n\t\t\t\t<td><textarea name=\"issue-intro\" id=\"issue-intro\" rows=\"5\" cols=\"50\" class=\"large-text\"><?php echo $i->intro;?></textarea><br>\n\t\t\t\t<span class=\"description\">The description is not prominent by default; however, some themes may show it.</span></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t</table>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" name=\"submit\" id=\"submit\" class=\"button button-primary\" value=\"Update\">\n\t\t\t</p>\n\t</form>\n</div>\n<?php\n}",
"public function ajaxUpdate()\n {\n try {\n $listKey = array('id', 'start', 'end');\n\n Verify::checkArrayKeyNotEmpty($listKey, $_POST);\n Verify::checkIsDateStartLessThanDateEnd($_POST['start'], $_POST['end']);\n\n $workObject = new Works($_POST['id'], '', $_POST['start'], $_POST['end'], '');\n\n if (!$this->workBloModel->updateWorkByResize($workObject))\n throw new Exception(\"Update Resize Fail\");\n\n $this->view->to('works/index');\n\n } catch (Exception $exception) {\n $data['message'] = $exception->getMessage();\n }\n }",
"function setMilestoneId($value) {\n return $this->setFieldValue('milestone_id', $value);\n }",
"public function addmilestoneAction(){\n\t \ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\tif($request->isPost()){\n\t\t\t\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$current_milestone_id = $posts['current_milestone_id'];\n\t\t\t\t$job_id = $posts['job_id'];\n\t\t\t\t$milestone_type_id = $posts['milestone_type_id'];\n\t\t\t\t\n\t\t\t\t$jobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t\n\t\t\t\tif($jobPacketTable->checkMilestoneCanBeAdded($current_milestone_id)){\n\t\t\t\t\techo $jobPacketTable->addMilestone($current_milestone_id, $job_id, $milestone_type_id);\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\techo 0;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t }",
"function handle_milestone() {\n global $db_conn;\n \n list($version, $os, $lang) \n = array_map( get_request, array('version', 'os', 'lang') );\n $env_id = find_or_add_env($os, $lang, $version);\n \n list($run_count, $first_use_ts, $last_use_ts)\n = array_map(get_request, array('run_count', 'first_use_ts', 'last_use_ts'));\n \n $sql = \"INSERT INTO milestones (env, run_count, first_use_ts, last_use_ts) VALUES ('$env_id', '$run_count', '$first_use_ts', '$last_use_ts')\";\n $db_conn->exec($sql);\n \n $resp = array('type' => 'milestone', 'status' => 'ok');\n \n if ($run_count == 500) {\n $resp['launch_url'] = FEEDBACK_REQUEST_URL;\n }\n \n \n header('Content-Type: application/json');\n echo json_encode($resp);\n die();\n}",
"public function actionAjaxUpdate()\n {\n if ($model = $this->findModel(Yii::$app->request->post('id'))) {\n $this->getPermission($model);\n $model->{Yii::$app->request->post('attribute')} = Yii::$app->request->post('value');\n $model->save();\n }\n }",
"public function actionAjaxUpdate()\n {\n if ($model = $this->findModel(Yii::$app->request->post('id'))) {\n if (!Yii::$app->user->can('editor') && $model->media_author !== Yii::$app->user->id) {\n throw new ForbiddenHttpException(Yii::t('writesdown', 'You are not allowed to perform this action.'));\n }\n $model->{Yii::$app->request->post('attribute')} = Yii::$app->request->post('attribute_value');\n if ($model->save()) {\n echo Yii::t('writesdown', 'Updated, {attribute}: {attribute_value}', [\n 'attribute' => Yii::$app->request->post('attribute'),\n 'attribute_value' => Yii::$app->request->post('attribute_value'),\n ]);\n }\n }\n }",
"function AJAX_material_edit($material_id) {\r\n\t\t$this->load->model('inventory/material_model');\r\n\t\t$value = $this->input->post('value');\r\n\t\t$column = $this->input->post('id');\r\n\t\t\r\n\t\t$this->material_model->AJAX_updateMaterialField($material_id, $column, $value);\r\n\t\techo $value;\r\n\t}",
"public function testAddViewUpdateMilestone()\n {\n \t$property_flip_id = $this->createPropertyFlip('Test address line 1000');\n \t\n \t$milestone_type_description = 'Test Milestone Type 1';\n \t$milestone_type = $this->createTestMilestoneType($milestone_type_description);\n \t\n \t$milestone_type_description2 = 'Test Milestone Type 2';\n \t$milestone_type2 = $this->createTestMilestoneType($milestone_type_description2);\n \t\n \t$this->visit('/')\n \t->visit('/login')\n \t->type('jaco.wk@gmail.com', 'email')\n \t->type('password', 'password')\n \t->press('Login')\n \t->see('Home')\n \t->visit('/search-property')\n \t \n \t->type($property_flip_id, 'property_flip_id')\n \t->press('Search')\n \t->click('View') //View Property\n \t \n \t->click('View') //View Property Flip\n \t->see('View Property Flip')\n \t->see('General')\n \t->see('Investors')\n \n \t->click('milestones-tab')\n \t->see('Milestones')\n \t->press('Add Milestone')\n \t->select($milestone_type->id, 'milestone_type_id')\n \t->type('2016-11-30', 'effective_date')\n \t->press('Add Milestone')\n \n \t->see('View Property Flip')\n \t->see('Milestone')\n \t->see($milestone_type_description)\n \t \n \t->click('view-milestone')\n \t->see('View Milestone')\n \t->see($milestone_type_description)\n \t->press('Update Milestone')\n \t\n \t->see('Update Milestone')\n \t->select($milestone_type2->id, 'milestone_type_id')\n \t->type('2016-12-01', 'effective_date')\n \t->press('Update Milestone')\n \t\n \t->see('View Property Flip')\n \t->see('Milestone')\n \t->see($milestone_type_description2);\n }",
"public function edit($id) {\n $sessionstaff = $this->Session->read('staff');\n //fetch all coupon list of practice for link to milestone\n $options6['conditions'] = array('ProductService.clinic_id' => $sessionstaff['clinic_id'],'ProductService.type'=>3,'ProductService.status'=>1);\n $options6['order'] = array('ProductService.title ASC');\n $ProductServicelist = $this->ProductService->find('all', $options6);\n $this->set('ProductService', $ProductServicelist);\n $Promotions = $this->MilestoneReward->find('first', array('conditions' => array('MilestoneReward.id' => $id)));\n $this->set('MilestoneReward', $Promotions);\n //get current used coupon for calculate earning %\n $optionscu['conditions'] = array('ProductService.id' => $Promotions['MilestoneReward']['coupon_id']);\n $ProductServicecur = $this->ProductService->find('first', $optionscu);\n $this->set('ProductServicecur', $ProductServicecur);\n \n if (isset($this->request->data['MilestoneReward']['action']) && $this->request->data['MilestoneReward']['action'] == 'update') {\n \n $options['conditions'] = array('MilestoneReward.name' => trim($this->request->data['display_name']),'MilestoneReward.id !='=>$this->request->data['id'],'clinic_id'=>$sessionstaff['clinic_id']);\n $ind = $this->MilestoneReward->find('first', $options);\n //condition to check duplicate milestone reward for practice\n if(empty($ind)){\n $proarra['MilestoneReward'] = array('id' => $this->request->data['id'], 'name' => $this->request->data['name'], 'description' => $this->request->data['description'], 'coupon_id' => $this->request->data['coupon_id'], 'points' => $this->request->data['points']);\n if ($this->MilestoneReward->save($proarra)) {\n $this->Session->setFlash('The Milestone Reward has been updated.', 'default', array(), 'good');\n $this->set('MilestoneReward', $this->request->data);\n $this->redirect(array('action' => \"edit/$id\"));\n } else {\n $this->Session->setFlash('The Milestone Reward not updated.', 'default', array(), 'bad');\n return $this->redirect(array('action' => 'index'));\n }\n }else{\n $this->Session->setFlash('Milestone Reward already exists.', 'default', array(), 'bad'); \n }\n }\n \n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
20080615. Added Joe Hunt to get a measure of unit by given stock_id | function get_unit_dec($stock_id)
{
$sql = "SELECT decimals FROM ".TB_PREF."item_units, ".TB_PREF."stock_master
WHERE abbr=units AND stock_id=".db_escape($stock_id)." LIMIT 1";
$result = db_query($sql, "could not get unit decimals");
$row = db_fetch_row($result);
return $row[0];
} | [
"public function getUnitMeasure(){\n $unitModel = new UnitMeasureModel();\n $unit = $unitModel -> find($this->id_unit_measures);\n return $unit;\n }",
"public function getStockUnit() {\n\t\treturn $this->stockUnit;\n\t}",
"abstract protected function getStockUnitFromEvent(ResourceEventInterface $event);",
"public function getMeasure();",
"function get_measure($id) {\r\n global $measures;\r\n global $measures_stop;\r\n if ($measures_stop[$id] == \"\" || $measures_stop[$id] == NULL)\r\n $tFinish = microtime_float();\r\n else\r\n $tFinish = $measures_stop[$id];\r\n return ($tFinish - $measures[$id]);\r\n}",
"public function getMeasuresByUnit($unit)\n {\n return $this->getObjectsByCriteria(array('unit' => $unit));\n }",
"public function testDataElementsGetUnitsOfMeasure()\n {\n }",
"public function getFk_id_measure_unit()\n {\n return $this->fk_id_measure_unit;\n }",
"public function mainMeasurementUnit($productId)\n\t\t{\n\t\t\tglobal $conn;\n\t\t\t$query = $conn->query(\"SELECT * FROM product_unit_measures WHERE productId = \\\"$productId\\\" AND main=1 LIMIT 1 \") or trigger_error(\"Error with product unit $conn->error\");\n\n\t\t\t$data = $query->fetch_assoc();\n\t\t\tif($data){\n\t\t\t\t$ret = $data['measurementUnit'];\n\t\t\t}else{\n\t\t\t\t$ret = '';\n\t\t\t}\n\n\t\t\treturn $ret;\n\t\t}",
"public static function findIDMeasureUnitWith($name_measure_unit)\n {\n $pdo = Database::getPdo();\n $sql = \"SELECT id_measure_unit FROM measure_units WHERE name_measure_unit = '$name_measure_unit'\";\n $result = $pdo->query($sql);\n $result->setFetchMode(PDO::FETCH_ASSOC);\n\n if ($result->rowcount() == 1) {\n $id_measure_unit = $result->fetch();\n } else {\n $id_measure_unit['id_measure_unit'] = null;\n }\n\n Database::disconnect();\n\n return $id_measure_unit['id_measure_unit'];\n }",
"public function getStocks()\n {\n return $this->hasMany(Stock::className(), ['measure_unit_id' => 'id']);\n }",
"public function getUnit();",
"function CWgetSkuQty($sku_id) {\n\n $returnVal = 0;\n $skuQuery = '';\n\n $skuQuery = mysql_query(\"SELECT sku_stock FROM cw_skus WHERE sku_id = \".CWqueryParam($sku_id),$_ENV[\"request.cwapp\"][\"db_link\"]);\n if (mysql_num_rows($skuQuery)) {\n $qd = mysql_fetch_assoc($skuQuery);\n $returnVal = $qd['sku_stock'];\n }\n\n return $returnVal;\n}",
"public function get($stockId);",
"public function testDataElementsGetUnitsOfMeasureSimplified()\n {\n }",
"function getUnitById(){\n\t\treturn $this->executeQuery('', $this->getTblUnit(), ' units_id = '.$this->getId().' AND units_deleted = 0');\n\t}",
"public function getUnitPricingUnit();",
"function get_stock_min($id){\n\t$query=\"select PRODUCTO_STOCKMINIMO from ayahuaska.producto WHERE PRODUCTO_ID={$id}\";\n $result=mysql_query($query);\n $dat=mysql_fetch_array($result);\n return intval($dat['PRODUCTO_STOCKMINIMO']);\n}",
"private function getMeasurement($id)\n {\n $em = $this->getDoctrine()->getManager();\n return $em->getRepository('AppBundle:Measurement')->find($id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Message test setup method | public function setUp(): void
{
$this->message_object = new Message();
} | [
"public function testCreateMessageTemplate()\n {\n }",
"public function testGetTopicMessages()\n {\n }",
"public function testGetMessageItem()\n {\n }",
"public function testAcknowledgeChatMessage()\n {\n }",
"public function testGetVoicemailMeMessages()\n {\n }",
"public function testMessage()\n {\n $Message = new App\\Message;\n\n $Message->setMessage('Hello Ken!');\n $this->assertEquals($Message->getMessage(),'Hello Ken!');\n }",
"public function testGetWebchatGuestConversationMessage()\n {\n }",
"private function initMessageKeys()\n {\n $this->message = array\n (\n 'body' \t=> $this->body,\n 'title'\t=> $this->title,\n );\n }",
"public function testPostMessagesReceive()\n {\n }",
"public function testGetConversationsChatMessage()\n {\n }",
"public function testGetConversationsEmailMessages()\n {\n }",
"public function testPostConversationsEmailMessages()\n {\n }",
"public function testChatPostMessage()\n {\n }",
"public function testPostVoicemailMessages()\n {\n }",
"public function testGetMessages()\n {\n $element = new ApplicationTransportManagers();\n $element->setMessages('messages');\n $this->assertEquals('messages', $element->getMessages());\n }",
"public function testPostConversationsEmailInboundmessages()\n {\n }",
"public function testCompileMessageTemplate()\n {\n }",
"public function testForwardMessage()\n {\n }",
"public function testGetConversation()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main function of the class, parses a user query. To use the class (and it's children) one should call this function ONLY, the rest is done by the parameters in the $_REQUEST array Child clases should contain the 'actions' functions, used to populate the results Handles any errors that occured when trying to populate the response for the user Adds the header 'ContentType: application/json' Ouputs a JSON encoded string, conating: 'error' the text of the error message Throws BaseException if an Exception is caught and returnErrosAsJson is false | public function query()
{
try {
$remainingQueries = $this->getRemainingQueries();
$this->getFiltersFromRequest();
$this->getActionFromRequest();
$this->getMethodFromAction();
if (empty($this->action)) {
throw new Exception("Define action");
}
if (method_exists($this, $this->method)) {
$this->setDefaultPagination();
$returnedResult = $this->{$this->method}();
if (!empty($returnedResult)) {
$this->setResult($returnedResult);
}
unset($returnedResult);
$this->returnResponse($remainingQueries);
}
throw new Exception("Invalid action");
}
catch (Exception $error) {
if ($this->returnErrosAsJson === true) {
header('Content-Type: application/json');
header("Bad Request",1,400);
exit(
json_encode(
array(
'error' => $error->getMessage()
)
)
);
} else {
throw new BaseException($error->getMessage());
}
}
} | [
"function parse(){\n\t\t\n\t\t// parsing criterions\n\t\t$infoNodes = $this->firstNode->getElements('INFO/*');\n\t\t$this->profile = new UserActionProfile();\n\t\tforeach($infoNodes as $node){\n\t\t\t$column = new UserActionColumn($node->nodeName(),$node->valueOf());\n\t\t\tif($column->exists()){ // if is a valid column of a user action, adding it in the set of criterions\n\t\t\t\t$operator = $node->getxSusheeOperator();\n\t\t\t\tif($operator){\n\t\t\t\t\t$column->setOperator($operator);\n\t\t\t\t}\n\t\t\t\t$this->profile->add($column);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// parsing PAGINATE\n\t\t$paginateNode = $this->operationNode->getElement('PAGINATE');\n\t\tif($paginateNode){\n\t\t\t$this->paginate_display = $paginateNode->getAttribute('display');\n\t\t\t$this->paginate_page = $paginateNode->getAttribute('page');\n\t\t\tif(!$this->paginate_page)\n\t\t\t\t$this->paginate_page = 1;\n\t\t\tif(!$this->paginate_display)\n\t\t\t\t$this->paginate_display = 50;\n\t\t}else{\n\t\t\t$this->paginate_page = 1;\n\t\t\t$this->paginate_display = 50;\n\t\t}\n\t\t\n\t\t// parsing RETURN\n\t\t$returnNode = $this->operationNode->getElement('RETURN');\n\t\tif($returnNode){\n\t\t\t$infoNodes = $returnNode->getElements('INFO/*');\n\t\t\tif(count($infoNodes) > 0){\n\t\t\t\t$this->return = new UserActionProfile();\n\t\t\t\tforeach($infoNodes as $node){\n\t\t\t\t\t$column = new UserActionColumn($node->nodeName());\n\t\t\t\t\tif($column->exists()){ // if is a valid column of a user action, adding it in the set of criterions\n\t\t\t\t\t\t$this->return->add($column);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// also allowing to get the user who did the action. e.g. display its firstname and lastname\n\t\t\t$userReturn = $returnNode->getElement('USER');\n\t\t\tif($userReturn){\n\t\t\t\t$this->userReturn = $userReturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"function processuserrequest() {\n try {\n if($_SERVER[\"REQUEST_METHOD\"] == \"GET\" && !isset($_SESSION['username'])) {\n $this->user = new \\app\\models\\FWAUser($this->log);\n $this->user->cheapest_fuel = true;\n }\n else if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $this->user = new \\app\\models\\FWAUser($this->log);\n $this->user->post();\n }\n else if(isset($_SESSION['username']) && $_SERVER[\"REQUEST_METHOD\"] == \"GET\") {\n $this->user = new \\app\\models\\FWARegisteredUser($this->log);\n $favourite_status = $this->user->getfavouriteitems();\n if(!($this->user->favourite())) {\n $this->user->cheapest_fuel = true;\n }\n else {\n $this->user->favourite = true;\n }\n }\n }\n catch (Exception $e) {\n header(\"Location: index.php\"); \n exit;\n }\n }",
"function prepare_query() {\n\n\t\t// == No API type has been specified\n\t\tif(!$this->type) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// urlencode the parameters\n\t\tif(isset($this->params) && is_array($this->params)) {\n\t\t\twhile(list($key, $value) = each($this->params)) {\n\t\t\t\t$this->params[$key]=urlencode($value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// do not get attributes by default\n\t\t$get_attributes = 0;\n\n\t\t\t// These routine prepares the query for each API call\n\t\t\tswitch($this->type) {\n\t\t\t \n\t\t\t\t// ============== register_user api call\n\t\t\t\tcase 'register_user':\n\t\t\t\t\t\t$view_key['email']=(!isset($this->params['email'])) ? '' : \"&email=\".$this->params['email'];\n\t\t\t\t\t\t$view_key['password']=(!isset($this->params['password'])) ? '' : \"&password=\".$this->params['password'];\n\t\t\t\t\t\t// == Prepare the url for view_key api query\n\t\t\t\t\t\t$path = \"/api/register_user\";\n\t\t\t\t\t\t$query = \"api_key={$this->api_key}{$view_key['email']}{$view_key['password']}\";\n\t\t\t\t\t $get_attributes = 1;\n\t\t\t\tbreak;\n\n\t\t\t\t// ============== verify_key api call\n\t\t\t\tcase 'verify_key':\n\t\t\t\t\t\t// == Prepare the url for verify_key api query\n\t\t\t\t\t\t$path = \"/api/verify_key\";\n\t\t\t\t\t\t$query = \"api_key={$this->api_key}\";\n\t\t\t\t\t $get_attributes = 1;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// ============== view_key api call\n\t\t\t\tcase 'view_key':\n\t\t\t\t\t\t$view_key['email']=(!isset($this->params['email'])) ? '' : \"&email=\".$this->params['email'];\n\t\t\t\t\t\t$view_key['password']=(!isset($this->params['password'])) ? '' : \"&password=\".$this->params['password'];\n\t\t\t\t\t\t// == Prepare the url for view_key api query\n\t\t\t\t\t\t$path = \"/api/view_key\";\n\t\t\t\t\t\t$query = \"api_key={$this->api_key}{$view_key['email']}{$view_key['password']}\";\n\t\t\t\t\t $get_attributes = 1;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// ============== list_feed api call\n\t\t\t\tcase 'list_feed':\n\t\t\t\t\t\t// == Prepare the url for list_feed api query\n\t\t\t\t\t\t$path = \"/api/list_feed\";\n\t\t\t\t\t\t$query = \"api_key={$this->api_key}\";\n\t\t\t\tbreak;\n \n\t\t\t\t// ============== add_feed api call\n\t\t\t\tcase 'add_feed':\n\t\t\t\t $add_feed['url']=(!isset($this->params['url'])) ? '' : \"&url=\".$this->params['url'];\n\t\t\t\t // == Prepare the url for add_feed api query\n\t\t\t\t\t$path = \"/api/add_feed\";\n\t\t\t\t $query = \"api_key={$this->api_key}{$add_feed['url']}\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// ============== delete_feeds api call\n\t\t\t\tcase 'delete_feeds':\n\t\t\t\t $delete_feeds['feeds_id']=(!isset($this->params['feeds_id'])) ? '' : \"&feeds_id=\".$this->params['feeds_id'];\n\t\t\t\t // == Prepare the url for delete_feeds api query\n\t\t\t\t\t$path = \"/api/delete_feeds\";\n\t\t\t\t $query = \"api_key={$this->api_key}{$delete_feeds['feeds_id']}\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// ============== edit_tags api call\n\t\t\t\tcase 'edit_tags':\n\t\t\t\t $edit_tags['feed_id']=(!isset($this->params['feed_id'])) ? '' : \"&feed_id=\".$this->params['feed_id'];\n \t\t\t\t$edit_tags['tag_list']=(!isset($this->params['tag_list'])) ? '' : \"&tag_list=\".$this->params['tag_list'];\n\t\t\t\t // == Prepare the url for edit_tags api query\n\t\t\t\t\t$path = \"/api/edit_tags\";\n\t\t\t\t $query = \"api_key={$this->api_key}{$edit_tags['feed_id']}{$edit_tags['tag_list']}\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// ============== edit_avatar api call\n\t\t\t\tcase 'edit_avatar':\n\t\t\t\t $edit_avatar['feed_id']=(!isset($this->params['feed_id'])) ? '' : \"&feed_id=\".$this->params['feed_id'];\n \t\t\t\t$edit_avatar['avatar_url']=(!isset($this->params['avatar_url'])) ? '' : \"&avatar_url=\".$this->params['avatar_url'];\n\t\t\t\t // == Prepare the url for edit_avatar api query\n\t\t\t\t\t$path = \"/api/edit_avatar\";\n\t\t\t\t $query = \"api_key={$this->api_key}{$edit_avatar['feed_id']}{$edit_avatar['avatar_url']}\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// ============== No proper type ?\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t$this->query=$query;\n\t\t$this->path=$path;\n\t\t$this->get_attributes=$get_attributes;\n\t}",
"public function actionParseQuery() {\n if ($action = $this->getQueryActionName()) {\n @header('Content-Type: text-plain');\n try {\n require_once ST_MIGRATIONS_LIB . '/Migration.php';\n if( !$_GET[self::QUERY_BACKEND] )\n\t\t\t\t $this->log('[Action \"' . $this->getQueryAction() . '\" | ' . date('Y-m-d H:i:s') . ']');\n \t$this->$action();\n\t\t\t \n } catch (Strategery_Migrations_Exception $e) {\n global $wp_query;\n $message = 'An error occured while executing action \"' . $this->getQueryAction() . '\":' . \"\\n\\n\";\n $message .= $e->getMessage() . \"\\n\\n-------\\n\\n\";\n $message .= 'Arguments = ';\n $message .= print_r($wp_query->query_vars, true);\n $this->log($message);\n }\n exit;\n }\n }",
"private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t\n\t\t//call appropriate function for the action provided\n\t\t// $lti_id = $this->request->lti_id;\n\t\t// $user_id = $this->request->user_id;\n\n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t//error_log(\"hello has been sent through\");\n\t\t\t\tbreak;\n\t\t\tcase \"getAppSettings\":\n\t\t\t\terror_log(\"getAppSettings has been sent through\");\n\n\t\t\t\t$data = json_decode($this->request->data);\n\t\t\t\t//error_log($data->lti_id);\n\t\t\t\t$this->getAppSettings($data->lti_id);\n\t\t\t\tbreak;\n\t\t\tcase \"setAppSettings\":\n\t\t\t\terror_log(\"setAppSettings has been sent through\");\n\n\t\t\t\t$request = $this->request;\n\t\t\t\t$app_settings = json_decode($request->app_settings, true);\n\n\t\t\t\t$this->setAppSettings($request->lti_id, $app_settings);\n\t\t\t\tbreak;\n\t\t\tcase \"getUserState\":\n\t\t\t\terror_log(\"getUserState has been sent through\");\n\n\t\t\t\t$data = json_decode($this->request->data);\n\t\t\t\t//error_log($data->lti_id);\n\t\t\t\t$this->getUserState($data->lti_id, $data->user_id);\n\t\t\t\tbreak;\n\t\t\tcase \"setUserState\":\n\t\t\t\t//error_log(\"setUserState has been sent through\");\n\t\t\t\tbreak;\n\t\t\tcase \"formSubmit\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->formSubmit($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"getAllEntries\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$data = json_decode($this->request->data);\n\t\t\t\t$this->getAllEntries($data->lti_id);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\t}",
"public function initQueryFormVariables () {\n\n // Check for the query\n if (isset ($_REQUEST['query'])) {\n $this->userQuery = $_REQUEST['query'];\n }\n\n // Check for the schemaGroup (aka catalog )\n if (!empty ($_REQUEST['selectSchema']))\n list ( $this->userSchemaGroup, $this->userSchema) = preg_split(\"/[\\|]/\", $_REQUEST['selectSchema']);\n\n // Check the fast/slow queue\n if (!empty ($_REQUEST['queue']))\n $this->userQueue = $_REQUEST['queue'];\n\n // Check the myDB Table name\n if (!empty ($_REQUEST['myDbTable']))\n $this->userMyDbTable = $_REQUEST['myDbTable'];\n\n // If user selected an example query to load\n if ( isset( $_REQUEST['selectExample'] ))\n $this->selectExample = $_REQUEST['selectExample'];\n else\n $this->selectExample = '';\n\n if ( isset( $_REQUEST['queryName'] ))\n $this->userQueryName = $_REQUEST['queryName'];\n else if ( !isset($_REQUEST['queryName'] ) &&\n isset ($_REQUEST['submitQuery'] ))\n $this->userQueryName = '';\n\n # Assign variables from quick download form\n # Defulat value for file name\n if ( isset($_REQUEST['textDownloadFileName']) )\n $this->downloadFilename = $_REQUEST['textDownloadFileName'];\n else\n $this->downloadFilename = '';\n # Default value for file format\n if ( isset( $_REQUEST['selectDownloadFileFormat'] ) && !empty( $_REQUEST['selectDownloadFileFormat'] ) )\n $this->downloadFileFormat = $_REQUEST['selectDownloadFileFormat'];\n else\n $this->downloadFileFormat = '';\n\n if ( !empty ( $this->userQuery ) and\n !empty ($this->userSchemaGroup ) and\n !empty ( $this->userSchema ) and\n isset ($_REQUEST['submitQuery']) and\n $_REQUEST['submitQuery'] == 'Submit Query' ) {\n\n #$resultSet = $QueryHandle->executeUserQuery( $errorString );\n $this->action = QueryHandleClass::ACTION_EXECUTE_QUERY;\n return;\n }\n // Determine if a quick download is requested.\n else if ( isset ($_REQUEST['submitDownload']) ) {\n $this->action = QueryHandleClass::ACTION_DOWNLOAD_RESULTS;\n return;\n }\n // Determine if a query file upload is requested.\n else if ( isset ($_REQUEST['submitUpload']) ) {\n $this->action = QueryHandleClass::ACTION_UPLOAD_QUERY_FILE;\n return;\n }\n // Determine if load example is requested.\n else if ( isset ($_REQUEST['submitQueryExample']) ) {\n $this->action = QueryHandleClass::ACTION_SHOW_QUERY_EXAMPLE;\n return;\n }\n // Determine if load example is requested.\n else if ( isset ($_REQUEST['ajaxAction']) ) {\n $this->action = QueryHandleClass::ACTION_DO_AJAX;\n return;\n }\n else if ( isset ($_REQUEST['loadQueryAction']) ) {\n $this->action = QueryHandleClass::ACTION_LOAD_QUERY;\n return;\n }\n else\n $this->action = QueryHandleClass::ACTION_DO_NOTHING;\n }",
"function ProcessRequest() {\r\n\t$userid = $_POST[\"userid\"];\r\n\t$usertype = $_POST[\"usertype\"];\r\n\r\n\t# do sanity checks on the userid\r\n\tif (empty($userid)) {\r\n\t\treturn \"Error: Nothing was entered!\";\r\n\t}\r\n\r\n\t# user input user ID but it's not numeric\r\n\tif ($usertype == \"userid\" && !is_numeric($userid)) {\r\n\t\treturn \"Error: osu! user ID must be numeric!\";\r\n\t}\r\n\r\n\t# username/userid existence check\r\n\t$json_url = \"http://osu.ppy.sh/api/get_user?k=\".OSUAPI_KEY.\"&u=\".urlencode($userid);\r\n\t$json = file_get_contents($json_url);\r\n\t$json_output = json_decode($json);\r\n\r\n\t# unexisting username/userid would return nothing from osu!api\r\n\tif (empty($json_output)) {\r\n\t\treturn \"Error: User not found!\";\r\n\t}\r\n\r\n\t# convert username to user ID\r\n\tif ($usertype == \"username\") {\r\n\t\t$userid = $json_output[0]->user_id;\r\n\t}\r\n\r\n\t# get the list of tokens\r\n\t$ids = array();\r\n\tforeach (file(TOKENS) as $line) {\r\n\t\t$line = trim($line);\r\n\t\t$parts = explode(\" \", $line);\r\n\t\tarray_push($ids, $parts[0]);\r\n\t}\r\n\r\n\t# check if userid already exists\r\n\tif (in_array($userid, $ids)) {\r\n\t\treturn \"Error: That user ID already exists in the database!\";\r\n\t}\r\n\r\n\t# save userid in the session\r\n\tsession_start();\r\n\t$_SESSION['userid'] = $userid;\r\n\r\n\t# start processing request\r\n\theader('Location: ./redirect.php'); \r\n}",
"private function _processRequest()\n\t{\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t// get the action\n\t\t$action = $this->request->action;\n\n\t\tif (empty($action)) {\n\t\t\t$message = array('error' => 'No method given.');\n\t\t\t$this->reply($message, 400);\n\t\t} else {\n\t\t\t// call the corresponding method\n\t\t\tif (method_exists($this, $action)) {\n\t\t\t\t$this->$action();\n\t\t\t} else {\n\t\t\t\t$message = array('error' => 'Method not found.');\n\t\t\t\t$this->reply($message, 400);\n\t\t\t}\n\t\t}\n\t}",
"public function process_request(){\n\n $result = new instagram_result();\n\n $this->screenName = $this->uri->part( $this->options['method_index']+1);\n\n\n /* if ( ! isset($this->options['access_token']) ){\n\n $this->error = \"User is either not logged in, or not authorized to Instagram API\";\n\n $this->result = false;\n\n } else {*/\n $method = $this->uri->part((int)$this->options['method_index']);\n\n if ( ! $method ){\n\n $this->error = \"No API method specified in position \".$this->options['method_index'] . \" of URL\";\n\n $this->result = false;\n\n } else {\n\n if ( ! method_exists($this,$method)) {\n\n $this->error = \"$method: No such recognized API method\";\n\n $this->result = false;\n\n } else {\n\n $this->$method( $result, $this->instagram );\n\n }\n\n }\n //}\n $result->result = $this->result?'success':'error';\n\n $result->error = $this->error;\n\n return $result;\n\n }",
"public function __construct() {\r\n\t$this->parseQuery = new ParseQuery('_User');\r\n }",
"public function userdata_get()\n\t{\n\t\t/* Get userid parameter from the query.\n\t\t * CodeIgniter routing rules read anything less than 0 or non-numbers as NULL which routes to users_get().\n\t\t * Which means this must be 0 or more.\n\t\t */\n\t\t$userid = (int) $this->get('userid');\n\t\n\t\t// Get collectionid parameter from the query.\n\t\t$collectionid = $this->get('collectionid');\n\t\t\n\t\t// Get commentid parameter from the query.\n\t\t$commentid = $this->get('commentid');\n\t\t\n\t\t// Get datatype parameter from the query.\n\t\t$datatype = $this->get('datatype');\n\t\t\n\t\t$check = $this->check_for_valid_id(\"User\", $userid);\n\t\tif ($check === TRUE)\n\t\t{\n\t\t\t$userid = (int) $userid;\n\n\t\t\tif ($datatype !== NULL)\n\t\t\t{\n\t\t\t\tswitch ($datatype)\n\t\t\t\t{\n\t\t\t\t\tcase \"collections\":\n\t\t\t\t\t\t$data = $this->r2pdb_model->get_user_collections_short_display($userid);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"comments\":\n\t\t\t\t\t\t$data = $this->r2pdb_model->get_user_comments_display($userid);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reviews\":\n\t\t\t\t\t\t$data = $this->r2pdb_model->get_user_reviews_display($userid);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Theoretically this is not possible.\n\t\t\t\t\t\t$this->response(['status' => FALSE, 'message' => \"This should not have happened, please contact the site administrator.\"], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!empty($data))\n\t\t\t\t{\n\t\t\t\t\t$this->response($data, REST_Controller::HTTP_OK);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->response(['status' => FALSE, 'message' => \"User has no \" . $datatype . \".\"], REST_Controller::HTTP_NOT_FOUND);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If false, check_for_valid_id already set a response.\n\t\t \n\t\t/* CodeIgniter will route the query to users_get() if $userid is NULL, so no NULL check is needed.\n\t\tthe validator function handles other possible values so no else is needed. */\n\t}",
"protected function doRequest()\n {\n $beginTime = microtime(true);\n $this->query->verb = strtoupper($_SERVER['REQUEST_METHOD']);\n\n if ($this->query->verb === 'GET' && isset($_GET['docs']) && $_GET['docs'] === '1') {\n $this->query->selfDocument();\n } else {\n $valid = $this->query->doInputs();\n if (!$valid) {\n $this->query->error = 400;\n $this->query->messages = $this->query->getErrors();\n array_unshift($this->query->messages, 'Request validation failed');\n } else {\n $this->query->run();\n if ($this->query->nResults === null) {\n if (is_scalar($this->query->results)) {\n $this->query->nResults = 1;\n } else {\n $this->query->nResults = count($this->query->results);\n }\n }\n }\n\n if ($this->query->error) {\n $status = $this->query->error . ' ' . self::humanHttpStatus($this->query->error);\n header('HTTP/1.1 ' . $status);\n array_unshift($this->query->messages, $status);\n if (substr($this->query->error, 0, 1) === '4') {\n $this->query->messages[] = $this->query->seeLink(\n null,\n array('docs' => 1),\n 'for this method\\'s documentation.'\n );\n }\n $this->query->error = true;\n } else {\n $this->setCacheing();\n }\n }\n\n $log[] = $this->query->getSummary();\n if ($this->query->nResults) {\n $log[] = 'nR=' . $this->query->nResults;\n }\n $log[] = 'St=' . sprintf('%4.2fms', 1000 * (microtime(true) - $beginTime));\n Yii::log(implode(' ', $log), 'trace', 'api');\n\n $this->query->serverTime = sprintf('%4.2fms', 1000 * (microtime(true) - $beginTime));\n\n header('Content-type: application/json');\n echo json_encode($this->query);\n\n Yii::app()->end();\n }",
"abstract protected function executeRequest();",
"public function query() {\n\t\tglobal $wpdb;\n\n\t\t$this->results = $wpdb->get_col(\"SELECT DISTINCT($wpdb->users.ID)\" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);\n\n\t\tif ( $this->results )\n\t\t\t$this->total_users_for_query = $wpdb->get_var(\"SELECT COUNT(DISTINCT($wpdb->users.ID))\" . $this->query_from . $this->query_where); // no limit\n\t\telse\n\t\t\t$this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));\n\t}",
"public abstract function executeQuery($request_type);",
"public function initResult(){\n $this->setPage();\n $argsQuery = $this->argsQuery;\n $searchResult = array();\n\n // Create array of all the results\n if( !empty( $argsQuery['members'] ) ){\n $searchResult['members'] = get_users( $argsQuery['members'] );\n if( $this->pagination ){\n $tmpArgs = $this->allSearchArgs( $argsQuery['members'] );\n $this->allSearchResult['members'] = get_users( $tmpArgs );\n }\n } else{\n $searchResult['members'] = '';\n $this->insertToLog( 'error' , 'CANT_GET_USERS');\n }\n\n if( !empty( $argsQuery['posts'] ) ){\n $searchResult['posts'] = get_posts( $argsQuery['posts'] );\n if( $this->pagination ){\n $tmpArgs = $this->allSearchArgs( $argsQuery['posts'] );\n $this->allSearchResult['posts'] = get_posts( $tmpArgs );\n }\n } else{\n $searchResult['posts'] = '';\n $this->insertToLog( 'error' , 'CANT_GET_POSTS');\n }\n\n if( !empty( $argsQuery['pages'] ) ){\n $searchResult['pages'] = get_posts( $argsQuery['pages'] );\n if( $this->pagination ){\n $tmpArgs = $this->allSearchArgs( $argsQuery['pages'] );\n $this->allSearchResult['pages'] = get_posts( $tmpArgs );\n }\n } else{\n $searchResult['pages'] = '';\n $this->insertToLog( 'error' , 'CANT_GET_PAGES');\n }\n\n $this->searchData['result'] = $searchResult;\n return $searchResult;\n }",
"protected function _query_all() {\n\t\t\t\t\n\t\t/* set the default query args */\n\t\t$default_queryargs = array();\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\tcase('post'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'post_type' \t\t=> 'post',\t\t\t\n\t\t\t\t\t'posts_per_page'\t=> -1,\n\t\t\t\t\t'post_status'\t\t=> 'publish',\n\t\t\t\t\t'orderby'\t\t\t=> 'ID',\n\t\t\t\t\t'order'\t\t\t\t=> 'ASC',\n\t\t\t\t\t'suppress_filters'\t=> false\t\t\t\t\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('attachment'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'post_type' \t\t=> 'attachment',\t\n\t\t\t\t\t'post_status'\t\t=> 'any',\n\t\t\t\t\t'posts_per_page'\t=> -1,\n\t\t\t\t\t'orderby'\t\t\t=> 'ID',\n\t\t\t\t\t'order'\t\t\t\t=> 'ASC',\n\t\t\t\t\t'suppress_filters'\t=> false\t\t\t\t\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('comment'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'order'\t\t\t\t=> 'ASC',\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'role' => '',\n\t\t\t\t\t'meta_key' => '',\n\t\t\t\t\t'meta_value' => '',\n\t\t\t\t\t'meta_compare' => '',\n\t\t\t\t\t'meta_query' => array(),\n\t\t\t\t\t'include' => array(),\n\t\t\t\t\t'exclude' => array(),\n\t\t\t\t\t'orderby' => 'login',\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t\t'offset' => '',\n\t\t\t\t\t'search' => '',\n\t\t\t\t\t'number' => '',\n\t\t\t\t\t'count_total' => false,\n\t\t\t\t\t'fields' => 'all',\n\t\t\t\t\t'who' => ''\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$this->set_error( 500, 'One Id modelclass is not supported without id, this error cant even run :)');\n\t\t\t\treturn array();\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t/* merge in query args from the request */\n\t\t$queryargs = array_merge($default_queryargs, $this->request_query_vars);\n\t\t\n\t\t/* filter args, add more query args from the extended class if desired */\n\t\t$queryargs = $this->filter_query_args($queryargs);\n\n\t\t// call database\t\n\t\t$found_items = array();\t\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t $wpQuery = new \\WP_Query($queryargs);\n\t\t\t $this->wp_query = $wpQuery;\n\t\t\t if( $wpQuery->have_posts()) {\n \t\t\t\t$found_items = $wpQuery->posts; \t\t\t \n\t\t\t }\t \n\t\t\tbreak;\n\t\t\tcase('comment'):\n\t\t\t\t$found_items = get_comments( $queryargs );\n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t\t$found_items = get_users($queryargs);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif ( empty($found_items) ) {\n\t\t\t//$this->set_error( 500, 'query is empty' );\n\t\t\t//return false;\n\t\t}\n\t\t\n\t\t/* get custom_package data and populate the result */\n\t\t$items = array();\n\t\t\n\t\tfor ( $i = 0; $i < count($found_items); $i++ ) {\n\t\t\t\n\t\t\t$found_items[$i] = $this->filter_found_item($found_items[$i]);\n\t\t\t\n\t\t\tswitch( $this->properties->modelclass ) {\n\t\t\t\tcase('post'):\n\t\t\t\tcase('attachment'):\n\t\t\t\t\t$items[$i]['post'] = $found_items[$i]; \t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase('comment'):\n\t\t\t\t\t$items[$i]['comment'] = $found_items[$i];\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase('user'):\n\t\t\t\t\t$items[$i]['user'] = $found_items[$i];\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t/* get custom data packkages */\n\t\t\t$custom_data = $this->_action_custom_package_data( $found_items[$i] );\t\t\t\n\n\t\t\t/* merge core data_packages with custom_data packages */\n\t\t\t$items[$i] = array_merge($items[$i], $custom_data );\t\t\t\n\t\t}\n\t\t/*\n\t *\tlooks something like this now:\n\t\t *\t$items = array (\n\t\t *\t\t\t\tarray(\n\t\t * \t\t\t\t'post' => array(\n\t\t *\t\t\t\t\t\t\t\t'post_title' => 'My title',\n\t\t *\t\t\t\t\t\t\t\t'post_parent'=> 567,\n\t\t *\t\t\t\t\t\t\t\t),\n\t\t * \t\t\t\t'postmeta'\t\t\t=> array(...),\n\t\t * \t\t\tarray(...),\n\t\t *\t\t\t);\n\t\t */\n\t\t \n\t\t \n\t\t/* when caching is enabled, set the cache */\n\t\tif($this->cache_time) {\n $this->set_cache($items);\n\t\t}\n\t\t\n\t\t/* return */\n\t\t$this->query = $items;\n\t\treturn $items;\n\t}",
"public function rest()\n {\n if (true === $this->error) {\n return false;\n } \n \n header('Content-type: application/json');\n $method = filter_input(INPUT_SERVER, \"REQUEST_METHOD\");\n\n $this->restSwitchCases($method);\n \n try {\n if (!empty($this->forbiddenMethods) &&\n in_array($method, $this->forbiddenMethods)) {\n throw new Exception($this->createJsonMessage('error', \n 'Forbidden http method', 404));\n } else {\n $this->database->params = $this->params;\n echo $this->database->doQuery();\n } \n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }",
"public function processRequest() {\n $curl = curl_init();\n $headers = array('Content-Type: application/json'); \n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC) ;\n curl_setopt($curl, CURLOPT_USERPWD, $this->username.\":\".$this->password);\n if($this->getRequestMethod() == 'POST') {\n curl_setopt ($curl, CURLOPT_POST, true); // Tell curl to use HTTP POST\n curl_setopt ($curl, CURLOPT_POSTFIELDS, $this->getRequestData()); // Tell curl that this is the body of the POST\n }\n curl_setopt($curl, CURLOPT_HEADER, false); // Tell curl not to return headers, but do return the response\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // Return the response\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_URL, $this->getRequestURL());\n $response_data = curl_exec($curl);\n $this->setResponseData($response_data);\n curl_close($curl);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the value of galittProvider. | public function getGalittProvider()
{
return $this->galittProvider;
} | [
"protected function getProvider()\n\t{\n\t\treturn $this->provider;\n\t}",
"protected function getProvider() {\n if (!isset($this->provider)) {\n $this->provider = $this->theme->getCdnProvider();\n }\n return $this->provider;\n }",
"public function getProvider()\n {\n if (array_key_exists(\"provider\", $this->_propDict)) {\n return $this->_propDict[\"provider\"];\n } else {\n return null;\n }\n }",
"public function getHailProvider()\n {\n return $this->providers()->where('name', 'hail')->first();\n }",
"public function setGalittProvider(GalittProvider $galittProvider)\n {\n $this->galittProvider = $galittProvider;\n\n return $this;\n }",
"public function getProvider()\n\t{\n\t\tif( isset( $this->values['plugin.provider'] ) ) {\n\t\t\treturn (string) $this->values['plugin.provider'];\n\t\t}\n\n\t\treturn '';\n\t}",
"public function getCurrentProvider()\n {\n return $this->provider;\n }",
"public static function getProvider() {\n return self::$_idProvider;\n }",
"public function getGigya()\n {\n if (!$this->gigya) {\n $this->gigya = new Gigya(sfConfig::get('app_gigya_api_key'), sfConfig::get('app_gigya_secret_key'), sfConfig::get('app_gigya_partner_id'));\n }\n return $this->gigya;\n }",
"protected function getDefaultProvider()\n {\n return $this->config('provider');\n }",
"public function getProviderGroup(): string;",
"public function getProvider()\n {\n $config = $this->scopeConfig->getValue(\n 'payment/az2009_cielo_bank_slip/provider',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n\n return $config;\n }",
"public function getUserProvider()\n {\n return $this->userProvider;\n }",
"public function gitProvider()\n {\n return $this->provider;\n }",
"public function getUrlProvider(): UrlProviderInterface\n {\n return $this->url;\n }",
"public function getProviderUrl()\n {\n return $this->providerUrl;\n }",
"protected function getGuardUserProvider(): string\n {\n $guard = config('lit.guard');\n\n return config(\"auth.guards.{$guard}.provider\");\n }",
"private function getInternetProvider()\r\n {\r\n foreach ($this->faker->getProviders() as $provider) {\r\n if (strstr(get_class($provider), 'ReflectionClass')) {\r\n return $provider;\r\n }\r\n }\r\n }",
"public function getGenus()\n {\n return $this->genus;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation indexFilesByPoolWithHttpInfo Lists files on root. | public function indexFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)
{
$request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);
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() ? (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,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 200:
if ('\NodeumSDK\Client\Model\NodeumFileCollection' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\NodeumSDK\Client\Model\NodeumFileCollection', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\NodeumSDK\Client\Model\NodeumFileCollection';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\NodeumSDK\Client\Model\NodeumFileCollection',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function indexFilesByPool($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n list($response) = $this->indexFilesByPoolWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n return $response;\n }",
"public function indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\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 indexImportFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexImportFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\ImportFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ImportFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ImportFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexOnTapesFilesByPool($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n list($response) = $this->indexOnTapesFilesByPoolWithHttpInfo($pool_id, $limit, $offset, $name, $type, $size);\n return $response;\n }",
"protected function indexOnTapesFilesByPoolRequest($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexOnTapesFilesByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/on_tapes_files';\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 // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($type)) {\n $type = ObjectSerializer::serializeCollection($type, '', true);\n }\n if ($type !== null) {\n $queryParams['type'] = $type;\n }\n // query params\n if (is_array($size)) {\n $size = ObjectSerializer::serializeCollection($size, '', true);\n }\n if ($size !== null) {\n $queryParams['size'] = $size;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexTapesByFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\TapeCollection';\n $request = $this->indexTapesByFileByPoolRequest($pool_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (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 indexFilesByPoolAsync($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n return $this->indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexTapesByFileByPoolWithHttpInfo($pool_id, $file_id)\n {\n $request = $this->indexTapesByFileByPoolRequest($pool_id, $file_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\TapeCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\TapeCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\TapeCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\TapeCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexFilesByTaskWithHttpInfo($task_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexFilesByTaskRequest($task_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\NodeumFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\NodeumFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\NodeumFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function importFilesChildrenByPoolWithHttpInfo($pool_id, $file_parent_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->importFilesChildrenByPoolRequest($pool_id, $file_parent_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\ImportFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ImportFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ImportFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexFilesAsyncWithHttpInfo($limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $request = $this->indexFilesRequest($limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\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 indexFilesByContainerWithHttpInfo($container_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexFilesByContainerRequest($container_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\NodeumFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\NodeumFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\NodeumFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexTapesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $tape_library_id = null, $barcode = null, $location = null, $type = null, $locked = null, $scratch = null, $cleaning = null, $write_protect = null, $mounted = null, $ejected = null, $known = null, $mount_count = null, $date_in = null, $date_move = null, $free = null, $max = null, $last_size_update = null, $last_maintenance = null, $last_repack = null, $repack_status = null, $hash = null, $force_import_type = null, $need_to_check = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\TapeCollection';\n $request = $this->indexTapesByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $tape_library_id, $barcode, $location, $type, $locked, $scratch, $cleaning, $write_protect, $mounted, $ejected, $known, $mount_count, $date_in, $date_move, $free, $max, $last_size_update, $last_maintenance, $last_repack, $repack_status, $hash, $force_import_type, $need_to_check);\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 indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\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 testIndexFilesByPool()\n {\n }",
"public function actionIndexFiles()\n {\n $manager = new Manager(['module' => $this->module]);\n $manager->indexAll();\n }",
"public function indexNasSharesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $name = null, $path = null, $options = null, $username = null, $nas_id = null)\n {\n $request = $this->indexNasSharesByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $name, $path, $options, $username, $nas_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\NasShareCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\NasShareCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\NasShareCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\NasShareCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_construct() Builder::addXML() Add XML (text) into the specified node. Node can be DOMnode or ID. If TAG not specified XML will be added into the Root node. XML can be outered be TAG or can be added directly. | public function addXML($xml, $tag = '', $extra_attrs = array(), $node = false) {
$node = $this->_getElement($node);
if (!empty($tag)) {
$n = $this->doc->createElement($tag);
foreach ($extra_attrs as $id => $value) {
$n->setAttribute($id, $value);
}
if (!empty($extra_attrs['id'])) {
$n->setIdAttribute('id', true);
}
$node = $node->appendChild($n);
}
$n = new DOMDocument;
$n->loadXML($xml);
$n = $this->doc->importNode($n->documentElement, true);
return $node->appendChild($n);
} | [
"function asXML() {\n $xml = '';\n\n switch ($this->___t) {\n case ISTER_XML_DOCUMENT:\n $xml .= $this->getChildrenXml();\n break;\n case ISTER_XML_TAG:\n // add namespace declarations for root node\n if (($this->___l == 1) && (is_array($this->___ns))) {\n $count = 0;\n foreach ($this->___ns as $id => $uri) {\n if (++$count % 2) {\n if (!$id)\n $this->___a['xmlns'] = $uri;\n else\n $this->___a['xmlns:' . $id] = $uri;\n }\n }\n }\n $xml .= '<';\n if ($this->___ns && (!is_array($this->___ns)))\n $xml .= $this->___ns . ':';\n $xml .= $this->___n;\n if (count($this->___a)) {\n foreach ($this->___a as $name => $value)\n $xml .= ' ' . $name . '=\"' . $value . '\"';\n }\n if (!$this->hasChildren()) {\n $xml .= '/>';\n } else {\n $xml .= '>';\n $xml .= $this->getChildrenXml();\n $xml .= '</' . $this->___n . '>';\n }\n break;\n case ISTER_XML_COMMENT:\n case ISTER_XML_CDATA:\n $xml .= $this->___n;\n break;\n case ISTER_XML_PENTITY:\n case ISTER_XML_ENTITY:\n $xml .= '&' . $this->___n . ';';\n break;\n case ISTER_XML_PI:\n $xml .= '<?' . $this->___ns . ' ' . $this->___n . '?>';\n break;\n default:\n $this->log('unknown node type: ' . $this->___t, E_USER_WARNING, 'asXML');\n }\n\n return $xml;\n }",
"public function addNode(\\DOMNode $node);",
"function add_book ($xmlDoc,$subNode,$nameInput,$pagesInput,$authorInput){\n\n $book=$xmlDoc->createElement('book');\n $subNode->appendChild($book);\n \n $name =$xmlDoc->createElement('name',$nameInput);\n $book->appendChild($name);\n \n $pages=$xmlDoc->createElement('pages',$pagesInput);\n $book->appendChild($pages);\n \n $author =$xmlDoc->createElement('auther',$authorInput);\n $book->appendChild($author);\n \n}",
"function XMLaddnode($paren, $name, $value = null, $attrs = null)\n{\n global $xmldoc;\n\n if ($value === null) {\n $node = $xmldoc->createElement(specialchars($name, ENT_XML1));\n } else {\n $node = $xmldoc->createElement(\n specialchars($name, ENT_XML1),\n specialchars($value, ENT_XML1)\n );\n }\n\n if (count($attrs) > 0) {\n foreach ($attrs as $key => $value) {\n $node->setAttribute(\n specialchars($key, ENT_XML1),\n specialchars($value, ENT_XML1)\n );\n }\n }\n\n $paren->appendChild($node);\n return $node;\n}",
"public function appendXML($data);",
"public function appendChild($node);",
"function add($str) {\n\t $this->xml .= $str;\n\t}",
"function add_XML_value($tag,$value)\n{\n return \"<\".$tag.\">\".XMLStrFormat($value).\"</\".$tag.\">\";\n}",
"function InsertXML($source, $ingestSource)\r\n{\r\n //$node\r\n $source->append_child($node);\r\n\r\n $doc = new DOMDocument;\r\n $domNode = $doc->importNode($source, true);\r\n $doc->appendChild($domNode);\r\n return $doc;\r\n}",
"function &addChildNode( $aTagType = ttUnknown ) {\n\t $tempNode =& new htmlNode( $this, $aTagType );\n\t\t$tempNode->Index = count($this->ChildNodes);\n\t\t$this->ChildNodes[] =& $tempNode;\n\t\treturn $tempNode;\n\t}",
"public function mergeNode(\\DOMElement $node);",
"public function addTag();",
"abstract protected function buildXml();",
"function createElementFromXML($xml) {\n \n // To make thing easy and make sure namespaces work properly, we add the root namespace delcarations if it is not declared\n $namespaces = $this->ns;\n $xml = preg_replace_callback('/<[^\\?^!].+?>/s', function($root_match) use ($namespaces) {\n preg_match('/<([^ <>]+)[\\d\\s]?.*?>/s', $root_match[0], $root_tag);\n $new_root = $root_tag[1];\n if (strpos($new_root, ':')) {\n $parts = explode(':', $new_root);\n $prefix = $parts[0]; \n if (isset($namespaces[$prefix])) {\n if (!strpos($root_match[0], \"xmlns:$prefix\")) {\n $new_root .= \" xmlns:$prefix='\" . $namespaces[$prefix] . \"'\"; \n }\n }\n }\n return str_replace($root_tag[1], $new_root, $root_match[0]);\n }, $xml, 1);\n \n $dom = new BetterDOMDocument($xml, $this->auto_ns);\n if (!$dom->documentElement) {\n trigger_error('BetterDomDocument Error: Invalid XML: ' . $xml);\n }\n $element = $dom->documentElement;\n \n // Merge the namespaces\n foreach ($dom->getNamespaces() as $prefix => $url) {\n $this->registerNamespace($prefix, $url);\n }\n \n return $this->importNode($element, true);\n }",
"public static function CreateDocumentFromNode($node)\r\n\t{\r\n\t\t$xmldoc = self::CreateXmlDocument();\r\n\t\t$root = $xmldoc->importNode($node, true);\r\n\t\t$xmldoc->appendChild($root);\r\n\t\treturn $xmldoc;\r\n\t}",
"abstract function buildXml();",
"public function GetXML()\n {\n //Start a new line, indent by the number indicated in $this->parents, add a <, and add the name of the tag\n //$out = \"\\n\".str_repeat(\"\\t\", $this->tagParents).'<'.$this->tagName;\n $out = \"\\n\".'<'.$this->tagName;\n\n //For each attribute, add attr=\"value\"\n foreach($this->tagAttrs as $attr => $value)\n $out .= ' '.$attr.'=\"'.$this->SafeValue($value).'\"';\n \n //If there are no children and it contains no data, end it off with a />\n if(empty($this->tagChildren) && empty($this->tagData))\n $out .= \" />\";\n \n //Otherwise...\n else\n { \n //If there are children\n if(!empty($this->tagChildren))\n {\n //Close off the start tag\n $out .= '>';\n \n //For each child, call the GetXML function (this will ensure that all children are added recursively)\n foreach($this->tagChildren as $child)\n $out .= $child->GetXML();\n\n //Add the newline and indentation to go along with the close tag\n $out .= \"\\n\".str_repeat(\"\\t\", $this->tagParents);\n }\n \n //If there is data, close off the start tag and add the data\n elseif(!empty($this->tagData))\n $out .= '>'.$this->tagData;\n \n //Add the end tag \n $out .= '</'.$this->tagName.'>';\n }\n \n //Return the final output\n return $out;\n }",
"public function appendXml($data)\n {\n $this->node->appendXML($data);\n }",
"public abstract function appendChild($node, $brother = null) ;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Register a provider for QQ. | public function registerQQ()
{
$this->app->make('Laravel\Socialite\Contracts\Factory')->extend('qq', function ($app) {
$config = $app['config']['services.qq'];
return new QQProvider(
$app['request'], $config['client_id'],
$config['client_secret'], $config['redirect']
);
});
} | [
"public function register($provider);",
"public function register(ProviderInterface $provider);",
"protected function registerSearchQueryProvider()\n {\n $this->app->singleton('scorpio_sphinx_search.search_query_provider', function ($app) {\n return new SearchManager($app['scorpio_sphinx_search.server.settings']);\n });\n }",
"private function registerProviderFactory()\n {\n $this->nb_provider_factory = CNabuProviderFactory::getFactory();\n $this->nb_provider_factory->scanProvidersFolder();\n }",
"public function registerProvider(string $class): self;",
"public function registerDeferredProvider($provider)\r\n {\r\n return $this->register($provider);\r\n }",
"protected function registerRequestProvider()\n {\n $this->app['sentinel.addons.social.request'] = $this->app->share(function ($app) {\n return new IlluminateRequestProvider($app['request']);\n });\n }",
"public function addServiceProvider($provider);",
"public function registerProvider(string $provider) :void\n {\n $provider = $this->directory->class($provider);\n\n if (! class_exists($provider)) {\n return;\n }\n\n $this->registry->providers = (array) $provider;\n }",
"public function registerBackendProvider(IBackendProvider $provider) {\n\t\t$this->backendProviders[] = $provider;\n\t}",
"public function setProvider($provider);",
"static function register_class ($provider) {\n\t\tassert( is_object($provider) );\n\t\tforeach( get_class_methods($provider) AS $method ) {\n\t\t\t$method = strtolower($method);\n\t\t\t$prefix = 'provide_';\n\t\t\tif( substr($method, 0, strlen($prefix)) != $prefix ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$what = substr($method, strlen($prefix));\n\t\t\tself::register_callback([$what], array($provider, $method));\n\t\t}\n\t}",
"protected function registerExtensionProvider(): void\n {\n $this->app->singleton('orchestra.extension.provider', static function (Container $app) {\n return \\tap(new ProviderRepository($app, $app->make('events'), $app->make('files')), static function ($provider) {\n $provider->loadManifest();\n });\n });\n }",
"public function addProvider($code);",
"public function provider( $provider ) {\n\n\t\tif ( is_string( $provider ) ) {\n\t\t\t$provider = $this->resolveProvider( $provider );\n\t\t}\n\n\t\t$this->providers[] = $provider;\n\t}",
"public function injectWithProviderClass() {\n $binder = new Binder();\n $binder->bind('net.xp_framework.unittest.ioc.helper.Answer')->toProviderClass('net.xp_framework.unittest.ioc.helper.AnswerProvider');\n $question = $binder->getInjector()->getInstance('net.xp_framework.unittest.ioc.helper.ExtendedQuestion');\n $this->assertInstanceOf('ExtendedQuestion', $question);\n $this->assertInstanceOf('Answer', $question->getAnswer());\n }",
"public function registerSMSProvider(string $name, SMSProvider $provider)\n {\n $this->smsProviders[$name] = $provider;\n }",
"public function registerEventProvider()\n\t{\n\t\t$this->register(new EventServiceProvider($this));\n\t}",
"protected function registerEventProvider()\n {\n $this->register(new EventServiceProvider($this));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a FileStream object. | public function file(FileInterface $file): FileStream; | [
"public function stream()\n {\n $stream = fopen($this->file, 'r');\n\n $stream || $stream = null;\n\n return new Stream($stream);\n }",
"public function stream(){\n return new pFileStream($this->pathname);\n }",
"public function getStream(): StreamInterface\n {\n $this->ensureUploadedFileIsValid();\n\n if ($this->stream !== null) {\n return $this->stream;\n }\n\n try {\n if ($this->file === null) {\n throw new RuntimeException(\"Unknown file path, unable to create stream.\");\n }\n\n $stream = new Stream($this->file, \"r\");\n } catch (InvalidArgumentException $e) {\n throw new RuntimeException(\"Unable to create stream: \" . $e->getMessage(), $e->getCode(), $e);\n }\n\n return $stream;\n }",
"private function openStream()\n {\n return fopen($this->fileLocation, self::STREAM_MODE_READ);\n }",
"public function getStream() {\n\n if (!$this->stream) {\n\n if ($this->movedName) {\n $this->stream = new Stream($this->movedName);\n }\n else {\n $this->stream = new Stream($this->info['tmp_name']);\n }\n }\n return $this->stream;\n }",
"public function getStream()\n {\n if ($this->isMoved) {\n throw new \\RuntimeException('Cannot get uploaded file as stream');\n }\n\n if (!$this->stream) {\n $this->stream = new Stream($this->tempName, 'r');;\n }\n \n return $this->stream;\n }",
"public function getStream(): StreamInterface\n {\n if ($this->errorCode !== UPLOAD_ERR_OK) {\n throw new \\RuntimeException('Cannot retrieve stream due to upload error');\n }\n\n if ($this->isMoved) {\n throw new \\RuntimeException('Cannot retrieve stream after it has already been moved');\n }\n\n if ($this->stream instanceof StreamInterface) {\n return $this->stream;\n }\n\n $this->stream = new Stream($this->file);\n\n return $this->stream;\n }",
"public function getStream()\n {\n if ($this->hasMoved()) {\n throw new RuntimeException(sprintf('Uploaded file \"%s\" has already moved', $this->file));\n }\n\n if (null === $this->stream) {\n $this->stream = new Stream(fopen($this->file, 'r'));\n }\n\n return $this->stream;\n }",
"public function getStream(File $file);",
"public function getStream()\n {\n if ($this->moved) {\n $message = 'Cannot retrieve stream after it has already been moved.';\n throw new Exception\\RuntimeException($message);\n }\n\n if ($this->stream instanceof StreamInterface) {\n return $this->stream;\n }\n\n $this->stream = new Stream($this->file);\n return $this->stream;\n }",
"protected function createProcessingStream(): FileStreamInterface\n {\n return FileStream::openTemporary(\n 'r+b',\n $this->maxMemory()\n );\n }",
"public function getStream(): FileStreamInterface & Detectable\n {\n $data = $this->attachment();\n if (!isset($data)) {\n throw new RuntimeException('Missing an attachment, unable to create file stream');\n }\n\n // Resolve stream using custom callback, if available.\n $callback = $this->getResolveStreamCallback();\n if (isset($callback)) {\n return $callback($data, $this);\n }\n\n // Otherwise, resolve it using the following...\n return match (true) {\n is_resource($data) => FileStream::make($data),\n $data instanceof FileStreamInterface => $data,\n $data instanceof StreamInterface => FileStream::makeFrom($data),\n $data instanceof SplFileInfo => FileStream::open($data->getRealPath(), 'r'),\n is_string($data) && file_exists($data) => FileStream::open($data, 'r'),\n default => throw new RuntimeException('Unable to resolve file stream from attachment')\n };\n }",
"public function createStreamFromResource($resource): StreamInterface\n {\n return new Stream($resource);\n }",
"public function readStream()\n {\n return $this->filesystem->readStream($this->path);\n }",
"public function createStreamFromResource($resource)\n {\n return new Stream($resource);\n }",
"public function getStream() : StreamInterface\n {\n if ($this->moved) {\n throw new RuntimeException('Cannot retrieve stream as it was moved');\n }\n\n return $this->stream;\n }",
"public function getBinaryStream()\n {\n $binaryStream = fread($this->file,filesize($this->path));\n return $binaryStream;\n }",
"public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface;",
"public function createStreamFromResource($resource) : StreamInterface\n {\n return new Stream($resource);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if middleware class implemented Middleware interface or not in order to execute | public function checkClassImplementedMiddlewareInstance(object $middleware)
{
if(!$middleware instanceof MiddlewareInterface)
{
die("Included Middleware Doesnt implemented middleware instance");
}
} | [
"public function has(MiddlewareInterface $middleware): bool;",
"public function hasMiddleware(): bool\n {\n return ! empty($this->middleware);\n }",
"protected function hasMiddleware(): bool\n {\n return !empty($this->middleware);\n }",
"public function testValidMiddleware()\n {\n if (is_callable($this->middleware)) {\n $callable = $this->middleware;\n $returnObject = $callable($this->request, $this->response, $this->middlewareQueue);\n $validResponse = $returnObject instanceof ResponseInterface; \n } else {\n $validResponse = false;\n }\n \n $this->assertTrue($validResponse);\n }",
"public function has(string $middleware) : bool;",
"public function shouldSkipMiddleware()\n {\n }",
"public function hasMiddlewareNameCollection(): bool;",
"public function hasMiddlewares()\n {\n return count($this->middlewares) > 0;\n }",
"public function hasMiddlewares()\n\t{\n\t\treturn count($this->middlewares) > 0;\n\t}",
"public function hasMiddlewares()\n {\n\n if( FileSystem::getFilesInDirectory( Settings::getSetting('middlewares_location') ) == null )\n {\n\n return false;\n }\n\n return true;\n }",
"abstract function middleware(): void;",
"public function shouldSkipMiddleware(): bool\n {\n return true;\n }",
"protected function routeAlreadyHasStaffMiddleware(): bool\n {\n return collect($this->event->route->middleware())->flip()->has(Authenticate::class);\n }",
"public function hasMiddleware(string $middlewareClassOrIdentifier): bool\n {\n return $this->hasMiddlewareInList($this->middlewares, $middlewareClassOrIdentifier);\n }",
"public static function shouldSkipMiddleware()\n {\n /** @var \\Illuminate\\Foundation\\Application $instance */\n return $instance->shouldSkipMiddleware();\n }",
"public function shouldSkipMiddleware()\n {\n return true;\n }",
"private function middleware() {\n // validate request\n $this->validateOrFail();\n\n // route request\n $this->routeOrFail();\n }",
"private function isPassportScopeMiddleware(DataObjects\\Middleware $middleware) {\n $resolver = $this->getMiddlewareResolver($middleware->name());\n return $resolver === CheckScopes::class || CheckForAnyScope::class;\n }",
"public function add(MiddlewareInterface $Middleware, /* MiddlewareInterface|string|null */ $BeforeMiddleware = null): bool\n {\n if ($this->has_middleware($Middleware)) {\n return false;\n }\n if ($BeforeMiddleware) {\n if (!$this->has_middleware($BeforeMiddleware)) {\n throw new RunTimeException(sprintf(t::_('The $BeforeMiddleware instance of class %s is not found in the middlewares list.'), is_object($BeforeMiddleware) ? get_class($BeforeMiddleware) : $BeforeMiddleware));\n }\n $middlewares = [];\n if (is_string($BeforeMiddleware)) {\n foreach ($this->middlewares as $AddedMiddleware) {\n if (get_class($AddedMiddleware) === $BeforeMiddleware) {\n $middlewares[] = $Middleware;\n }\n $middlewares[] = $AddedMiddleware;\n }\n } elseif ($BeforeMiddleware instanceof MiddlewareInterface) {\n foreach ($this->middlewares as $AddedMiddleware) {\n if ($AddedMiddleware === $BeforeMiddleware) {\n $middlewares[] = $Middleware;\n }\n $middlewares[] = $AddedMiddleware;\n }\n } else {\n throw new InvalidArgumentException(sprintf(t::_('An unsupported type %s was provided to $BeforeMiddleware argument of %s().'), gettype($BeforeMiddleware), __METHOD__));\n }\n $this->middlewares = $middlewares;\n } else {\n $this->middlewares[] = $Middleware;\n }\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a string containing an address into a google maps link. | function cd_map_link( $address, $city, $state, $zip ) {
$address = (string)$address;
$city = (string)$city;
$state = (string)$state;
$zip = (string)$zip;
$address = preg_replace('/\s+/', '+', $address);
$city = preg_replace('/\s+/', '+', $city);
$state = preg_replace('/\s+/', '+', $state);
$zip = preg_replace('/\s+/', '+', $zip);
$href = $address . '+' . $city . '+' . $state . '+' . $zip;
return $href;
} | [
"public function createGoogleMapsUrl($address) {\n $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=';\n $url .= $this->getAddressQuery($address);\n $url .= '&key=' . $this->googleMapsKey;\n return $url;\n }",
"public function getAddressUrl(AddressInterface $address) {\n return Url::fromUri('https://www.bing.com/maps', ['query' => ['where1' => $this->addressString($address)]]);\n }",
"function gmaps_link( $string, $echo = true ) {\r\n $string = urlencode( esc_html( $string ) );\r\n \r\n if( empty( $string ) )\r\n return;\r\n \r\n $link_template =\r\n '<a href=\"http://maps.google.com/maps?q=%s\">' .\r\n self::get_image( 'map_go.png', false ) .\r\n '</a>';\r\n \r\n if( $echo )\r\n return printf( $link_template, $string );\r\n else\r\n sprintf( $link_template, $string );\r\n }",
"function Link() {\n if ($this->latitude != \"\" && $this->longitude != \"\") {\n return \"http://maps.google.com/maps?q=\" . $this->latitude . \",\" . $this->longitude;\n } else {\n return \"\";\n }\n }",
"public function getAddressUrl(AddressInterface $address) {\n return Url::fromUri('https://www.mapquest.com/', ['query' => ['q' => $this->addressString($address)]]);\n }",
"function google_maps_link($lat, $lon){\n return \"<a target=_blank href='https://www.google.com/maps/search/$lat,$lon?hl=es&source=opensearch'>$lat, $lon</a>\";\n }",
"public function getGoogleMapUrlAttribute($value): string\n {\n if (!is_null($value)) {\n return $value;\n }\n\n return google_map_url($this->address_latitude, $this->address_longitude);\n }",
"function gmap_make_map($addr=array(), $anzahl='')\n\t{\n\t\t//Daten rausholen\n\t\t$map_can = $anzahl == 'no' ? 'map_canvas' : 'map_canvas' . $anzahl;\n\n\t\t$sql = sprintf(\"SELECT * FROM %s\",\n\t\t\t$this->cms->tbname['papoo_google_maps_tabelle']\n\t\t);\n\t\t$result = $this->db->get_results($sql, ARRAY_A);\n\t\t//$adar=explode(\",\",$addr['link']);\n\n\t\t$ad=\"<address>\";\n\n\t\t$ad.=$addr['link'];\n\n\t\t$ad.=\"</address>\";\n\n\t\t//Map zusammensetzen\n\t\t$this->map=$ad.'<div id=\"'.$map_can.'\" style=\"width: '.$result['0']['gmap_breite'].'px; height: '.$result['0']['gmap_hoehe'].'px\"></div><br />';\n\n\t\t#$addr['link']=\"Bonner Talweg 26, 53113 Bonn\";\n\t\t$result['0']['gmap_apikey']=trim($result['0']['gmap_apikey']);\n\t\t$result['0']['gmap_apikey_2']=trim($result['0']['gmap_apikey_2']);\n\n\t\t//{$pluginload}\n\t\t$this->content->template['pluginload']=\"initialize(); \";\n\n\t\t//Skript zusammensetzen\n\t\t$this->content->template['plugin_header'] .=\n\t\t\t'<script type=\"text/javascript\">\n let geocoder;\n let map;\n\n function initialize() {\n\n let myOptions = {\n zoom: '.$result['0']['gmap_zoom'].',\n mapTypeId: google.maps.MapTypeId.'.$result['0']['gmap_typ'].'\n }\n\n let map = new google.maps.Map(document.getElementById(\"'.$map_can.'\"), myOptions);\n\n let contentString = \\''.$addr['link'].'<br /><a href=\"https://maps.google.de/maps?daddr='.strip_tags($addr['link']).'&geocode=&dirflg=&saddr=&f=d&sspn=0.00846,0.017273&ie=UTF8&z=16\" target=\"_blank\"><u>Route</u></a>\\';\n\t\t\t\t\n \tlet infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n geocoder = new google.maps.Geocoder();\n let address = \"'.strip_tags($addr['link']).'\";\n geocoder.geocode( { \\'address\\': address}, function(results, status) {\n \n if (status == google.maps.GeocoderStatus.OK) {\n \tlet center = results[0].geometry.location;\n map.setCenter(center);\n let marker = new google.maps.Marker({\n map: map,\n position: results[0].geometry.location,\n title:\"'.$addr['link'].'\"\n });\n marker.addListener(\"click\", function() {\n \tinfowindow.open(map, marker);\n\t\t\t\t\t});\n } else {\n alert(\"Geocode was not successful for the following reason: \" + status);\n }\n });\n\n }\n google.maps.event.addDomListener(window, \\'load\\', initialize);\n </script>\n ';\n\n\t\t//Zweiter API-Key\n\t\tif (!empty($result['0']['gmap_apikey'])) {\n\t\t\t$this->content->template['plugin_header_2'] = 'nodecode:\n\t\t\t<script src=\"https://maps.googleapis.com/maps/api/js?libraries=places&key='.$result['0']['gmap_apikey'].'\" type=\"text/javascript\"></script>';\n\t\t}\n\t\telse {\n\t\t\t$this->content->template['plugin_header_2'] = 'nodecode:\n\t\t\t<script type=\"text/javascript\" src=\"https://maps.google.com/maps/api/js?sensor=false\"></script>';\n\t\t}\n\n\t\t// Wenn keine Api Keys gegeben sind wird die Map auch nicht ausgegeben.\n\t\tif (empty($result['0']['gmap_apikey'])) {\n\t\t\t$this->content->template['plugin_header'] = \"\";\n\t\t}\n\n\t\t$this->js_skript_ausgabe=str_ireplace(\"nodecode:\", \"\", ($this->content->template['plugin_header_2'] ?? '') . ($this->content->template['plugin_header'] ?? ''));\n\n\t\tIfNotSetNull($this->content->template['pluginload']);\n\t}",
"public function glink_shortcode( $atts, $content = NULL ){\n\n\t\tglobal $post;\n\n\t\t$geodata = self::get_options( $post->ID );\n\n\t\t// maybe no geodata are available for this post\n\t\tif( FALSE !== ( $nogeo = $this->check_no_geodata( $geodata ) ) )\n\t\t\treturn $nogeo;\n\n\t\t// setup defaults\n\t\t$atts =\n\t\tshortcode_atts(\n\t\t\t\tarray(\n\t\t\t\t\t\t'text'\t\t=> 'GoogleMaps',\n\t\t\t\t\t\t'zoom'\t\t=> self::get_options( 'def_mapzoom' ),\n\t\t\t\t\t\t'maptype'\t=> 'street',\n\t\t\t\t),\n\t\t\t\t$atts\n\t\t);\n\n\n\t\t// get the urlencoded address (if available)\n\t\t$atts['addr'] = $this->get_urlencoded_address( $geodata );\n\n\t\tif( ! empty( $atts['addr'] ) )\n\t\t\t$atts['addr'] = '&q=' . $atts['addr'];\n\n\n\t\t// get the urlencoded geo-location (if available)\n\t\t$atts['latlon'] = $this->get_urlencoded_latlon( $geodata );\n\n\t\t$switch = sprintf( '%b%b', empty( $atts['addr'] ), empty( $atts['latlon'] ) );\n\n\t\tswitch( $switch ){\n\n\t\t\t// empty latlon\n\t\t\tcase '01':\n\t\t\t\t$atts['latlon'] = '';\n\t\t\t\tbreak;\n\n\t\t\t\t// empty address\n\t\t\tcase '10':\n\t\t\t\t$atts['latlon']\t= '&q=' . $atts['latlon'];\n\t\t\t\t$atts['addr']\t= '';\n\t\t\t\tbreak;\n\n\t\t\t\t// address and latlon NOT empty\n\t\t\tcase '00':\n\t\t\t\t$atts['latlon'] = '&ll=' . $atts['latlon'];\n\t\t\t\tbreak;\n\n\t\t\t\t// both empty -> error\n\t\t\tcase '11':\n\t\t\tdefault:\n\t\t\t\treturn __( '[<strong>GeoCoder Error</strong>: Unable to convert address and/or geo-location]', self::LANG );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// prepare link-text for output\n\t\t$atts['text'] = esc_html( $atts['text'] );\n\n\n\t\t// convert the maptype from cleartext to url-param\n\t\t$atts['maptype'] = $this->get_urlencoded_maptype( $atts['maptype'] );\n\n\n\t\t// get the blog-language\n\t\t$atts['language'] = $this->get_language_att();\n\n\n\t\t//$base_url = 'https://maps.google.de/maps?';\n\t\t$base_url = rtrim( self::GOOGLE_MAPS_LINK_URL, '?' ) . '?';\n\n\t\t$atts['href'] = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t\t'f'\t\t=> 'q',\n\t\t\t\t\t\t'hl'\t=> $atts['language'],\n\t\t\t\t\t\t't'\t\t=> $atts['maptype'],\n\t\t\t\t\t\t'z'\t\t=> $atts['zoom'],\n\t\t\t\t\t\t'om'\t=> 1,\n\t\t\t\t\t\t'ie'\t=> 'UTF8',\n\n\t\t\t\t),\n\t\t\t\t$base_url\n\t\t);\n\n\t\t$atts['href'] .= $atts['addr'] . $atts['latlon'];\n\n\n\t\treturn self::$view->get_view( 'glink', $atts );\n\n\n\t}",
"function tf_business_address_clean() {\n\n // concatenate address\n $new_address = get_option('tf_address_street') . ', ' . get_option('tf_address_locality') . ', ' . get_option('tf_address_postalcode') . ' ' . get_option('tf_address_region') . ' ' . get_option('tf_address_country');\n\n // check if old address\n if (get_option('tf_address_street') . get_option('tf_address_country') !== '')\n {\n $valid_address = $new_address;\n } else {\n $valid_address = get_option('tf_business_address');\n }\n\n // clean address\n $address_url = preg_replace('![^a-z0-9]+!i', '+', $valid_address);\n\n return 'http://maps.google.com/maps?q=' . $address_url;\n}",
"public function FormatStringWithLink($string) {\n\t\tif(preg_match('/[a-zA-Z]+:\\/\\/[0-9a-zA-Z;.\\/?:@=_#&%~,+$]+/', $string, $matches)) {\n\t\t\tforeach ($matches as $match) {\n\t\t\t\t$string = str_replace($match, \"<a href='\" . $match . \"'>\" . $match . \"</a>\", $string);\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $string;\t\t\n\t}",
"function event_google_map_link( $postId = null, $extraArgs = \"\", $location = \"\" ) {\n\t\techo get_event_google_map_link( $postId, $extraArgs, $location );\n\t}",
"function Display_google_map($Nom, $Adresse) {\n\n\n}",
"public function getGoogleMapsApiUrl() {\n $parameters = [];\n foreach ($this->getGoogleMapsApiParameters() as $parameter => $value) {\n $parameters[$parameter] = is_array($value) ? implode(',', $value) : $value;\n }\n $url = Url::fromUri(static::$GOOGLEMAPSAPIURL, [\n 'query' => $parameters,\n 'https' => TRUE,\n ]);\n return $url->toString();\n }",
"public function DirectionsLink()\n {\n return \"https://www.google.com/maps/dir//\".urlencode($this->Address);\n }",
"public function getGoogleStaticFullAddressMapUrl($fullAddress)\n {\n // initial/ universal settings\n $configParams = $this->getDefaultMapParams();\n\n // specific style tweaks\n $configParams['style'] = 'element:labels|visibility:off';\n $configParams['maptype'] = 'satellite';\n $configParams['zoom'] = '18';\n\n // set the location\n $configParams['center'] = $this->getFullAddressForMap($fullAddress);\n\n $urlParams = http_build_query($configParams);\n\n return self::GOOGLE_STATIC_MAP_ROOT_URL . $urlParams;\n }",
"function aerospace_event_address($id, $map = false)\n {\n if ('events' === get_post_type()) {\n $address = get_post_meta($id, '_events_address', true);\n\n if ($map) {\n $mapHTML = aerospace_event_google_map($id, false);\n }\n\n $address = nl2br($address);\n printf('<div class=\"entry-address\"><span class=\"meta-label\">' . esc_html('Address', 'aerospace') . '</span>%1$s%2$s</div>', $address, $mapHTML); // WPCS: XSS OK.\n }\n }",
"public function getLink() {\n\t\t$link = str_replace('\\\\', \"/\", $this->address);\n\t\treturn str_replace(GProject::$ADDRESS, \"\", $link);\n\t}",
"function getMapURL($code)\n\t{\n\t $mapurl = 'http://www1.unl.edu/tour/';\n\t return $mapurl.$code;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
edit get taxonomy index data. | function get_taxonomy_index_data( $data = array() ) {
if ( isset( $data['post_id'] ) ) {
$this->db->where( 'post_id', $data['post_id'] );
}
if ( isset( $data['tid'] ) ) {
$this->db->where( 'tid', $data['tid'] );
}
$query = $this->db->get( 'taxonomy_index' );
if ( $query->num_rows() > 0 ) {
return $query->row();
}
// there is no selected taxonomy_index
return null;
} | [
"public function index_terms()\n {\n }",
"function relevanssi_index_taxonomy_terms($post = null, $taxonomy = \"\", $insert_data) {\n\tglobal $wpdb, $relevanssi_variables;\n\t$relevanssi_table = $relevanssi_variables['relevanssi_table'];\n\n\t$n = 0;\n\n\tif (null == $post) return $insert_data;\n\tif (\"\" == $taxonomy) return $insert_data;\n\n\t$min_word_length = get_option('relevanssi_min_word_length', 3);\n\t$ptagobj = get_the_terms($post->ID, $taxonomy);\n\tif ($ptagobj !== FALSE) {\n\t\t$tagstr = \"\";\n\t\tforeach ($ptagobj as $ptag) {\n\t\t\tif (is_object($ptag)) {\n\t\t\t\t$tagstr .= $ptag->name . ' ';\n\t\t\t}\n\t\t}\n\t\t$tagstr = trim($tagstr);\n\t\t$ptags = relevanssi_tokenize($tagstr, true, $min_word_length);\n\t\tif (count($ptags) > 0) {\n\t\t\tforeach ($ptags as $ptag => $count) {\n\t\t\t\t$n++;\n\n\t\t\t\tif ('post_tags' == $taxonomy) {\n\t\t\t\t\t$insert_data[$ptag]['tag'] = $count;\n\t\t\t\t}\n\t\t\t\telse if ('category' == $taxonomy) {\n\t\t\t\t\t$insert_data[$ptag]['category'] = $count;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (isset($insert_data[$ptag]['taxonomy'])) {\n\t\t\t\t\t\t$insert_data[$ptag]['taxonomy'] += $count;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$insert_data[$ptag]['taxonomy'] = $count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($insert_data[$ptag]['taxonomy_detail'])) {\n\t\t\t\t\t$tax_detail = unserialize($insert_data[$ptag]['taxonomy_detail']);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$tax_detail = array();\n\t\t\t\t}\n\t\t\t\tif (isset($tax_detail[$taxonomy])) {\n\t\t\t\t\t$tax_detail[$taxonomy] += $count;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$tax_detail[$taxonomy] = $count;\n\t\t\t\t}\n\t\t\t\t$insert_data[$ptag]['taxonomy_detail'] = serialize($tax_detail);\n\t\t\t}\n\t\t}\n\t}\n\treturn $insert_data;\n}",
"public function importTermMeta() {\n\t\tif ( ! aioseo()->db->tableExists( 'yoast_indexable' ) ) {\n\t\t\taioseo()->transients->delete( 'import_term_meta_yoast_seo' );\n\t\t\treturn;\n\t\t}\n\n\t\t$termsPerAction = 100;\n\t\t$publicTaxonomies = implode( \"', '\", aioseo()->helpers->getPublicTaxonomies( true ) );\n\t\t$timeStarted = gmdate( 'Y-m-d H:i:s', aioseo()->transients->get( 'import_term_meta_yoast_seo' ) );\n\n\t\t$terms = aioseo()->db\n\t\t\t->start( 'yoast_indexable' . ' as yi' )\n\t\t\t->select( 'yi.*' )\n\t\t\t->leftJoin( 'aioseo_terms as at', '`yi`.`object_id` = `at`.`term_id`' )\n\t\t\t->where( 'yi.object_type', 'term' )\n\t\t\t->whereRaw( \"( yi.object_sub_type IN ( '$publicTaxonomies' ) )\" )\n\t\t\t->whereRaw( \"( at.term_id IS NULL OR at.updated < '$timeStarted' )\" )\n\t\t\t->orderBy( 'yi.object_id DESC' )\n\t\t\t->limit( $termsPerAction )\n\t\t\t->run()\n\t\t\t->result();\n\n\t\tif ( ! $terms || ! count( $terms ) ) {\n\t\t\taioseo()->transients->delete( 'import_term_meta_yoast_seo' );\n\t\t\treturn;\n\t\t}\n\n\t\t$mappedMeta = [\n\t\t\t'title' => 'title',\n\t\t\t'description' => 'description',\n\t\t\t'canonical' => 'canonical_url',\n\t\t\t'is_robots_noindex' => 'robots_noindex',\n\t\t\t'is_robots_nofollow' => 'robots_nofollow',\n\t\t\t'is_robots_noarchive' => 'robots_noarchive',\n\t\t\t'is_robots_noimageindex' => 'robots_noimageindex',\n\t\t\t'is_robots_nosnippet' => 'robots_nosnippet',\n\t\t\t'open_graph_title' => 'og_title',\n\t\t\t'open_graph_description' => 'og_description',\n\t\t\t'open_graph_image' => 'og_image_custom_url',\n\t\t\t'open_graph_image_source' => 'og_image_type',\n\t\t\t'open_graph_image_meta' => '',\n\t\t\t'twitter_title' => 'twitter_title',\n\t\t\t'twitter_description' => 'twitter_description',\n\t\t\t'twitter_image' => 'twitter_image_custom_url',\n\t\t\t'twitter_image_source' => 'twitter_image_type',\n\t\t];\n\n\t\tforeach ( $terms as $term ) {\n\t\t\t$meta = [\n\t\t\t\t'term_id' => (int) $term->object_id,\n\t\t\t];\n\n\t\t\tforeach ( $mappedMeta as $name => $mapping ) {\n\t\t\t\tif ( empty( $term->$name ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$value = $term->$name;\n\t\t\t\tswitch ( $name ) {\n\t\t\t\t\tcase 'is_robots_noindex':\n\t\t\t\t\tcase 'is_robots_nofollow':\n\t\t\t\t\tcase 'is_robots_noarchive':\n\t\t\t\t\tcase 'is_robots_noimageindex':\n\t\t\t\t\tcase 'is_robots_nosnippet':\n\t\t\t\t\t\tif ( (bool) $value ) {\n\t\t\t\t\t\t\t$meta[ $mapping ] = ! empty( $value );\n\t\t\t\t\t\t\t$meta['robots_default'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open_graph_image':\n\t\t\t\t\t\t$meta['og_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mapping ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'twitter_image':\n\t\t\t\t\t\t$meta['twitter_use_og'] = false;\n\t\t\t\t\t\t$meta['twitter_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mapping ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open_graph_image_meta':\n\t\t\t\t\t\t$imageMeta = json_decode( $value );\n\t\t\t\t\t\tif ( ! empty( $imageMeta->width ) && intval( $imageMeta->width ) ) {\n\t\t\t\t\t\t\t$meta['og_image_width'] = intval( $imageMeta->width );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! empty( $imageMeta->height ) && intval( $imageMeta->height ) ) {\n\t\t\t\t\t\t\t$meta['og_image_height'] = intval( $imageMeta->height );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'title':\n\t\t\t\t\tcase 'description':\n\t\t\t\t\tcase 'open_graph_title':\n\t\t\t\t\tcase 'open_graph_description':\n\t\t\t\t\t\t$value = aioseo()->importExport->yoastSeo->helpers->macrosToSmartTags( $value, null, 'term' );\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$meta[ $mapping ] = esc_html( wp_strip_all_tags( strval( $value ) ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$aioseoTerm = Models\\Term::getTerm( (int) $term->object_id );\n\t\t\t$aioseoTerm->set( $meta );\n\t\t\t$aioseoTerm->save();\n\t\t}\n\n\t\tif ( count( $terms ) === $termsPerAction ) {\n\t\t\ttry {\n\t\t\t\tas_schedule_single_action( time() + 5, aioseo()->importExport->yoastSeo->termActionName, [], 'aioseo' );\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t// Do nothing.\n\t\t\t}\n\t\t} else {\n\t\t\taioseo()->transients->delete( 'import_term_meta_yoast_seo' );\n\t\t}\n\t}",
"function ag_cpt_tax_change() {\n\tif(!isset($_POST['cpt_tax'])) {die('missing data');}\n\t$cpt_tax = $_POST['cpt_tax'];\n\t\n\trequire_once(AG_DIR . '/functions.php');\n\t\n\techo ag_get_taxonomy_terms($cpt_tax);\n\tdie();\n}",
"public function index_terms() {\n\t\treturn $this->run_indexation_action( $this->term_indexation_action, self::FULL_TERMS_ROUTE );\n\t}",
"function rebuild_index() {\n FWP()->indexer->index();\n exit;\n }",
"function search_api_admin_add_index(array $form, array &$form_state) {\n drupal_set_title(t('Add index'));\n\n $form['#attached']['css'][] = drupal_get_path('module', 'search_api') . '/search_api.admin.css';\n $form['#tree'] = TRUE;\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => t('Index name'),\n '#maxlength' => 50,\n '#required' => TRUE,\n );\n\n $form['machine_name'] = array(\n '#type' => 'machine_name',\n '#maxlength' => 50,\n '#machine_name' => array(\n 'exists' => 'search_api_index_load',\n ),\n );\n\n $form['item_type'] = array(\n '#type' => 'select',\n '#title' => t('Item type'),\n '#description' => t('Select the type of items that will be indexed in this index. ' .\n 'This setting cannot be changed afterwards.'),\n '#options' => array(),\n '#required' => TRUE,\n );\n foreach (search_api_get_item_type_info() as $type => $info) {\n $form['item_type']['#options'][$type] = $info['name'];\n }\n $form['enabled'] = array(\n '#type' => 'checkbox',\n '#title' => t('Enabled'),\n '#description' => t('This will only take effect if the selected server is also enabled.'),\n '#default_value' => TRUE,\n );\n $form['description'] = array(\n '#type' => 'textarea',\n '#title' => t('Index description'),\n );\n $form['server'] = array(\n '#type' => 'select',\n '#title' => t('Server'),\n '#description' => t('Select the server this index should reside on.'),\n '#default_value' => '',\n '#options' => array('' => t('< No server >'))\n );\n $servers = search_api_server_load_multiple(FALSE);\n // List enabled servers first.\n foreach ($servers as $server) {\n if ($server->enabled) {\n $form['server']['#options'][$server->machine_name] = $server->name;\n }\n }\n foreach ($servers as $server) {\n if (!$server->enabled) {\n $form['server']['#options'][$server->machine_name] = t('@server_name (disabled)', array('@server_name' => $server->name));\n }\n }\n $form['read_only'] = array(\n '#type' => 'checkbox',\n '#title' => t('Read only'),\n '#description' => t('Do not write to this index or track the status of items in this index.'),\n '#default_value' => FALSE,\n );\n $form['options']['index_directly'] = array(\n '#type' => 'checkbox',\n '#title' => t('Index items immediately'),\n '#description' => t('Immediately index new or updated items instead of waiting for the next cron run. ' .\n 'This might have serious performance drawbacks and is generally not advised for larger sites.'),\n '#default_value' => FALSE,\n );\n $form['options']['cron_limit'] = array(\n '#type' => 'textfield',\n '#title' => t('Cron batch size'),\n '#description' => t('Set how many items will be indexed at once when indexing items during a cron run. ' .\n '\"0\" means that no items will be indexed by cron for this index, \"-1\" means that cron should index all items at once.'),\n '#default_value' => SEARCH_API_DEFAULT_CRON_LIMIT,\n '#size' => 4,\n '#attributes' => array('class' => array('search-api-cron-limit')),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Create index'),\n );\n\n return $form;\n}",
"public function update_indexables()\n {\n }",
"public function index() {\n\t\t$this->post_indexation->index();\n\t\t$this->term_indexation->index();\n\t\t$this->general_indexation->index();\n\t\t$this->post_type_archive_indexation->index();\n\t\t$this->post_link_indexing_action->index();\n\t\t$this->term_link_indexing_action->index();\n\t\t$this->complete_indexation_action->complete();\n\t}",
"function create_new_topic_index() {\n\t// Add new taxonomy\n $types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_topic_index', $types, array(\n 'hierarchical' => true,\n 'labels' => array(\n 'name' => _x( 'ASN Topic Index', 'taxonomy general name' ),\n 'singular_name' => _x( 'Topic', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Topics' ),\n 'all_items' => __( 'All Topics' ),\n 'parent_item' => __( 'Parent Topic' ),\n 'parent_item_colon' => __( 'Parent Topic:' ),\n 'edit_item' => __( 'Edit Topic' ),\n 'update_item' => __( 'Update Topic' ),\n 'add_new_item' => __( 'Add New Topic' ),\n 'new_item_name' => __( 'New Topic Name' ),\n 'menu_name' => __( 'Topic Index' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'topic_index', \n 'with_front' => false,\n 'hierarchical' => true \n ),\n ));\n}",
"public function reIndexData()\n {\n $manageIndex = Options::get('content_indexing');\n $types = isset($manageIndex['posts']) ? $manageIndex['posts'] : array();\n \n try {\n $indexer = new Indexer();\n } catch (\\Exception $ex) {\n echo json_encode(array('status' => 400, 'msg' => $ex->getMessage()));\n die(); // needs to use this because of wordpress :(\n }\n \n foreach ($types as $type) {\n $args = array(\n 'posts_per_page' => -1,\n 'offset' => 0,\n 'orderby' => 'post_date',\n 'order' => 'ASC',\n 'post_type' => $type,\n 'post_status' => 'publish',\n 'suppress_filters' => true\n );\n \n $posts = get_posts($args);\n \n foreach ($posts as $post) {\n /* Check for categories */\n $category = false;\n $postCategories = wp_get_post_categories($post->ID);\n foreach ($postCategories as $catId) {\n if (in_array($catId, $manageIndex['categories'])) {\n $category = true;\n }\n }\n\n if ($category) {\n $indexer->put($post); // we will update this type of post\n }\n }\n }\n \n echo json_encode(array('status' => 200, 'msg' => 'All data is indexed in elasticsearch index!'));\n \n die(); // needs to use this because of wordpress :(\n }",
"public function index()\n\t{\n return View::make('taxonomies.index', ['taxonomies' => $this->taxonomy->all()]);\n\t}",
"public function edit($index)\n {\n $client \t= new HttpClient;\n $response \t= $client->get( [\n 'url' => Config::get( 'app.api' ) . \"atomic/characteristics/\" . $index,\n 'headers' \t=> ['Content-type: application/json','APIKEY:' . \\Session::get( 'api_token' ) ]\n ] );\n $view \t\t= BeeTools::isError( $response );\n if( $view ){\n return $view;\n }\n $characteristic \t\t= $response->json();\n return View::make( 'characteristics.form', [ 'characteristic' => $characteristic ] );\n }",
"public function edit_taxonomy_fields( $term ) {\n\n\t$thumbnail_id = absint( cc_get_term_meta( $term->term_id, 'thumbnail_id', true ) );\n\t$post_id = cc_get_term_meta( $term->term_id, 'related_post_id', true );\n\n\tif ( $thumbnail_id ) {\n\t\t$image = wp_get_attachment_thumb_url( $thumbnail_id );\n\t} else {\n\t\t$image = cc_placeholder_img_src();\n\t}\n\t?>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\"><label><?php _e( 'Choose Post', 'cc_product_filter' ); ?></label></th>\n\t\t<td>\n\t\t\t<?php $posts = $this->generateAttributePages_CPT(); ?>\n\t\t\t<select name=\"cpt_post_id\">\n\t\t\t\t<option value=\"\"><?php _e(\"Create New Post\",'cc_product_filter')?></option>\n\t\t\t\t<?php foreach($posts as $key => $value): ?>\n\t\t\t\t\t<option value=\"<?php echo $key;?>\" <?php selected($key,$post_id)?> ><?php echo $value?></option>\n\t\t\t\t<?php endforeach;?>\n\t\t\t</select>\n\t\t\t<p class=\"description\"><?php _e(\"If you choose to Create New Post, then it takes Taxonomy name and description in above field as post title and content.\",\"cc_product_filter\");?></p>\n\t\t</td>\n\t</tr>\n\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\"><label><?php _e( 'Thumbnail', 'cc_product_filter' ); ?></label></th>\n\t\t<td>\n\t\t\t<div id=\"product_taxonomy_thumbnail\" style=\"float: left; margin-right: 10px;\"><img src=\"<?php echo esc_url( $image ); ?>\" width=\"60px\" height=\"60px\" /></div>\n\t\t\t<div style=\"line-height: 60px;\">\n\t\t\t\t<input type=\"hidden\" id=\"product_taxonomy_thumbnail_id\" name=\"product_taxonomy_thumbnail_id\" value=\"<?php echo $thumbnail_id; ?>\" />\n\t\t\t\t<button type=\"button\" class=\"upload_image_button button\"><?php _e( 'Upload/Add image', 'cc_product_filter' ); ?></button>\n\t\t\t\t<button type=\"button\" class=\"remove_image_button button\"><?php _e( 'Remove image', 'cc_product_filter' ); ?></button>\n\t\t\t</div>\n\t\t\t<script type=\"text/javascript\">\n\n\t\t\t\t// Only show the \"remove image\" button when needed\n\t\t\t\tif ( '0' === jQuery( '#product_taxonomy_thumbnail_id' ).val() ) {\n\t\t\t\t\tjQuery( '.remove_image_button' ).hide();\n\t\t\t\t}\n\n\t\t\t\t// Uploading files\n\t\t\t\tvar file_frame;\n\n\t\t\t\tjQuery( document ).on( 'click', '.upload_image_button', function( event ) {\n\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// If the media frame already exists, reopen it.\n\t\t\t\t\tif ( file_frame ) {\n\t\t\t\t\t\tfile_frame.open();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create the media frame.\n\t\t\t\t\tfile_frame = wp.media.frames.downloadable_file = wp.media({\n\t\t\t\t\t\ttitle: '<?php _e( \"Choose an image\", \"cc_product_filter\" ); ?>',\n\t\t\t\t\t\tbutton: {\n\t\t\t\t\t\t\ttext: '<?php _e( \"Use image\", \"cc_product_filter\" ); ?>'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmultiple: false\n\t\t\t\t\t});\n\n\t\t\t\t\t// When an image is selected, run a callback.\n\t\t\t\t\tfile_frame.on( 'select', function() {\n\t\t\t\t\t\tvar attachment = file_frame.state().get( 'selection' ).first().toJSON();\n\n\t\t\t\t\t\tjQuery( '#product_taxonomy_thumbnail_id' ).val( attachment.id );\n\t\t\t\t\t\tjQuery( '#product_taxonomy_thumbnail' ).find( 'img' ).attr( 'src', attachment.url );\n\t\t\t\t\t\tjQuery( '.remove_image_button' ).show();\n\t\t\t\t\t});\n\n\t\t\t\t\t// Finally, open the modal.\n\t\t\t\t\tfile_frame.open();\n\t\t\t\t});\n\n\t\t\t\tjQuery( document ).on( 'click', '.remove_image_button', function() {\n\t\t\t\t\tjQuery( '#product_taxonomy_thumbnail' ).find( 'img' ).attr( 'src', '<?php echo esc_js( wc_placeholder_img_src() ); ?>' );\n\t\t\t\t\tjQuery( '#product_taxonomy_thumbnail_id' ).val( '' );\n\t\t\t\t\tjQuery( '.remove_image_button' ).hide();\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t</script>\n\t\t\t<div class=\"clear\"></div>\n\t\t</td>\n\t</tr>\n\t<?php\n}",
"function index_g_and_o_update(){\n\t\t$this->load->model('Da_evs_set_form_g_and_o','dsfg');\n\t\t$index_level = $this->input->post(\"index_level\"); // index level of G&O form\n\t\t$index_ranges = $this->input->post(\"index_ranges\"); // indeax range of G&O form\n\t\t$pos_id = $this->input->post(\"pos_id\"); //position id\n\t\t$year_id = $this->input->post(\"year_id\"); //year id\n\t\t\n\t\t$this->dsfg->sfg_pay_id = $year_id;\n\t\t$this->dsfg->sfg_index_level = $index_level;\n\t\t$this->dsfg->sfg_index_ranges = $index_ranges;\n\t\t$this->dsfg->sfg_pos_id = $pos_id;\n\t\t$this->dsfg->update();\n\n\t}",
"function fetch_taxonomy_data( $_posttaxonomy)\r\n\t{ \r\n\t\t$tax_label = $_posttaxonomy['labels']['name'];\r\n\t\t$tax_desc = (isset($_posttaxonomy['description']))?$_posttaxonomy['description'] :'';\r\n\t\t$tax_category = $_posttaxonomy['taxonomies'][0];\r\n\t\t$tax_tags = $_posttaxonomy['taxonomies'][1];\r\n\t\t$tax_slug = $_posttaxonomy['query_var'];\r\n\t\t\r\n\t\t$edit_url = admin_url(\"admin.php?page=custom_setup&ctab=custom_setup&action=edit-type&post-type=$tax_slug\");\r\n\t\t$meta_data = array(\r\n\t\t\t'title'\t=> '<strong><a href=\"'.$edit_url.'\">'.$tax_label.'</a></strong>',\r\n\t\t\t'tax_desc' \t=> $tax_desc,\r\n\t\t\t'tax_category' => $tax_category,\r\n\t\t\t'tax_tags' \t=> $tax_tags,\r\n\t\t\t'tax_slug' \t=> $tax_slug\r\n\t\t\t);\r\n\t\treturn $meta_data;\r\n\t}",
"function hselect2_taxonomy_field_views_data_alter(array &$data, FieldStorageConfigInterface $field_storage) {\n if ($field_storage->getType() == 'entity_reference' && $field_storage->getSetting('target_type') == 'taxonomy_term') {\n foreach ($data as $table_name => $table_data) {\n foreach ($table_data as $field_name => $field_data) {\n if (isset($field_data['filter']) && $field_name != 'delta') {\n $data[$table_name][$field_name]['filter']['id'] = 'taxonomy_index_tid_hselect';\n }\n }\n }\n }\n}",
"protected function taxonomy() {\n\t\t\n\t\tif( !empty($this->action_vars) ) {\n\t\t\t/*\n\t\t\t * First element of action_vars is action of taxonomy block \n\t\t\t * Second element, if exists, contain \"id\" of taxonomy item \n\t\t\t * ( \".../polls/taxonomy/$taxonomy_action/$taxonomy_id\" )\n\t\t\t */\n\t\t\t$taxonomy_action = $this->action_vars[0];\n\t\t\t$taxonomy_id = $this->action_vars[1];\n\t\t\t\n\t\t\tswitch( $taxonomy_action ) {\n\t\t\t\t//View polls in this taxonomy\n\t\t\t\tcase \"view\":\n\t\t\t\t\t$this->view_taxonomy( $taxonomy_id );\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//Create new taxonomy ( only for category)\n\t\t\t\tcase \"new\":\n\t\t\t\t\t$this->new_category();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//Edit taxonomy \n\t\t\t\tcase \"edit\":\n\t\t\t\t\t$this->edit_taxonomy( $taxonomy_id );\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//List of all taxonomies\t\n\t\t\t\tdefault:\n\t\t\t\t\t$this->list_taxonomy();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->list_taxonomy();\n\t\t}\n\t\t\n\t}",
"public function admin_index()\n {\n $this->data['tags'] = $this->model->getList();\n\n if ($_POST) {\n $this->model->createTag($_POST['tag_name']);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear the instance pool. | public static function clearInstancePool()
{
self::$instances = array();
} | [
"public static function clearInstancePool()\n {\n self::$instances = array();\n }",
"public static function clearInstancePool()\n\t{\n\t\tself::$instances = array();\n\t}",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearInstanceListPool()\n {\n self::$instanceLists = [];\n }",
"public static function clean()\n {\n self::$_pools = array();\n }",
"public static function clearRelatedInstancePool()\n {\n // Invalidate objects in ViewPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n ViewPeer::clearInstancePool();\n }",
"public static function clearRelatedInstancePool()\n {\n // Invalidate objects in BookkPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n BookkPeer::clearInstancePool();\n // Invalidate objects in IncomeDocPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n IncomeDocPeer::clearInstancePool();\n // Invalidate objects in CostDocPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n CostDocPeer::clearInstancePool();\n }",
"public static function purgeInstances() {}",
"public function resetPool()\n {\n $this->urlpool = $this->lastResult = [];\n }",
"final public static function clearAll()\n {\n self::$_instances = [];\n }",
"public static function purgeInstances() {\n\t\tself::$instances = array();\n\t}",
"public static function clearRelatedInstancePool()\n {\n // Invalidate objects in ActionPropertyTimePeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n ActionPropertyTimePeer::clearInstancePool();\n }",
"function flush_pool()\n\t{\n\t\t$this->_pool = array();\n\t}",
"public static function clearRelatedInstancePool()\n {\n // Invalidate objects in \".$this->getClassNameFromBuilder($joinedTableTableMapBuilder).\" instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n EmailManagerHistoryEmailTableMap::clearInstancePool();\n }",
"public function clearCache()\n {\n $this->_instances = array();\n }",
"public function clearInstance()\n {\n //\n }",
"public function clear(): void {\n\t\t$this->instances = [ ];\n\t\t$this->parameters = [ ];\n\t}",
"public static function clearRelatedInstancePool()\n {\n // Invalidate objects in FeatureCvtermPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n FeatureCvtermPeer::clearInstancePool();\n // Invalidate objects in FeatureCvtermPubPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n FeatureCvtermPubPeer::clearInstancePool();\n // Invalidate objects in FeaturePubPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n FeaturePubPeer::clearInstancePool();\n // Invalidate objects in FeatureSynonymPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n FeatureSynonymPeer::clearInstancePool();\n // Invalidate objects in PubDbxrefPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n PubDbxrefPeer::clearInstancePool();\n // Invalidate objects in PubRelationshipPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n PubRelationshipPeer::clearInstancePool();\n // Invalidate objects in PubRelationshipPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n PubRelationshipPeer::clearInstancePool();\n // Invalidate objects in PubauthorPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n PubauthorPeer::clearInstancePool();\n // Invalidate objects in PubpropPeer instance pool,\n // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.\n PubpropPeer::clearInstancePool();\n }",
"public static function clearResolvedInstances(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a level into the breadcrumbs, converting service parameters in the link and extracting a label in help with SQLquery that is preliminary defined by $this>query. | public function addLevel($level, $action, $label=null, $labelNonStatic=false)
{
if($level > 0)
return;
if($labelNonStatic || is_null($label))
{
if(!isset($this->query->command->from) || !isset($this->query->command->select))
throw new AAException(Yii::t('AutoAdmin.errors', 'Breadcrumbs can be generated only after AABreadcrumbs->query->select()->from() initializing. Or use call with static label.'));
if(!$this->query->command->where) //otherwise means a user set where by himself.
{
if($level == 0)
{
$bk = Yii::app()->request->getParam('bk');
}
else
{
$bkp = Yii::app()->request->getParam('bkp');
if(!isset($bkp[abs($level)-1]))
throw new AAException(Yii::t('AutoAdmin.errors', 'Incorrect breadcrumbs level.'));
$bk = $bkp[abs($level)-1];
}
if(is_null($bk) || !is_array($bk))
throw new AAException(Yii::t('AutoAdmin.errors', 'Auto-generation of the breadcrumbs can be done only with the default inside-controller navigation.'));
$where = array('AND');
$params = array();
foreach($bk as $pk=>$pkValue)
{
$where[] = "{$pk}=:{$pk}";
$params[":{$pk}"] = $pkValue;
}
$this->query->where($where, $params);
$this->query->command->limit(1);
}
$newLabel = $this->query->command->queryScalar();
$label = ($label && $labelNonStatic) ? "{$newLabel}. {$label}" : $newLabel;
}
if($level == 0)
{
$this->controller->breadcrumbs[] = $this->controller->pageTitle = AAHelperText::ucfirst($label).'. '.$this->controller->pageTitle;
}
else
{
$params = AAHelperUrl::uriToParamsArray(Yii::app()->request->getRequestUri());
if($params)
{ //Removing GET-params which relate to the current page
$paramsToExclude = array('page', 'sortBy', 'searchBy', 'searchQ', 'msg', 'action', 'bk', 'bkp', 'id', 'foreign');
foreach($paramsToExclude as $param)
{
if(array_key_exists($param, $params))
unset($params[$param]);
if(!$params)
break;
else
{
foreach($params as $key=>$value)
{
if(preg_match("/^{$param}\[/i", $key))
{
unset($params[$key]);
continue 2;
}
}
}
}
}
$link = "../{$action}/";
$bkp = Yii::app()->request->getParam('bkp', array());
if(isset($bkp[0]))
{
foreach($bkp as $pkLevel=>$pk)
{
if($pkLevel < abs($level)-1)
continue;
if($pkLevel==0)
$paramBase = 'bk';
else
$paramBase = 'bkp['.($pkLevel-1).']';
foreach($pk as $keyField=>$keyValue)
{
$params[$paramBase.'['.$keyField.']'] = $keyValue;
}
}
}
if($params)
{
$paramStr = '';
foreach($params as $param=>$value)
$paramStr .= ($paramStr ? '&' : '?').$param.'='.$value;
$link .= $paramStr;
}
$this->insertToPosition((count($this->controller->breadcrumbs)+$level), $label, $link);
}
$this->query->command->reset();
return $label;
} | [
"protected function setBreadcrumbsQuery()\n {\n $this->setQueryController('Molajo//Model//Datasource//Menuitem.xml');\n\n $this->setQueryControllerDefaults(\n $process_events = 1,\n $query_object = 'list',\n $get_customfields = 0,\n $use_special_joins = 1,\n $use_pagination = 0,\n $check_view_level_access = 1,\n $get_item_children = 0\n );\n\n $prefix = $this->query->getModelRegistry('primary_prefix', 'a');\n\n $this->query->setDistinct(true);\n $this->query->from('#__extension_instances', 'current_menu');\n\n $this->query->where('column', 'current_menu.id', '=', 'integer', (int)$this->plugin_data->page->menuitem_id);\n $this->query->where('column', 'current_menu.catalog_type_id', '=', 'column', $prefix . '.catalog_type_id');\n\n $this->query->where('column', $prefix . '.status', '>', 'integer', '0');\n $this->query->where('column', 'current_menu.status', '>', 'integer', '0');\n\n $this->query->where('column', $prefix . '.lft', '<=', 'column', 'current_menu.lft');\n $this->query->where('column', $prefix . '.rgt', '>=', 'column', 'current_menu.rgt');\n $this->query->where('column', $prefix . '.root', '=', 'column', 'current_menu.root');\n\n return $this;\n }",
"function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }",
"public function showBreadcrumb() {\r\n $separator = \" - \";\r\n\r\n if(isset($_REQUEST['page'])) {\r\n $page = $_REQUEST['page'];\r\n\r\n if($page == 'list_collection') {\r\n // Page is displaying all the collections for a gallery.\r\n $gallery_id = $_REQUEST['gallery_id'];\r\n\r\n // Display the gallery name.\r\n $sql = \"SELECT name AS gallery_name FROM galleries WHERE id=?\";\r\n $sql = $this->db_helper->construct_secure_query($sql, $gallery_id);\r\n $result = $this->dbh->query($sql) or die('showBreadcrumb() ERROR: get gallery name failed. ' . $this->dbh->error());\r\n $row = $result->fetch_assoc();\r\n echo $separator . $row['gallery_name'];\r\n }\r\n else if($page == 'list_album') {\r\n // Page is displaying all the albums for a collection.\r\n $gallery_id = $_REQUEST['gallery_id'];\r\n $collection_id = $_REQUEST['collection_id'];\r\n\r\n // Provide a link to the gallery.\r\n $sql = \"SELECT name AS gallery_name FROM galleries WHERE id=?\";\r\n $sql = $this->db_helper->construct_secure_query($sql, $gallery_id);\r\n $result = $this->dbh->query($sql) or die('showBreadcrumb() ERROR: get gallery name failed. ' . $this->dbh->error());\r\n $row = $result->fetch_assoc();\r\n\r\n $qs = \"?page=list_collection&gallery_id=$gallery_id\";\r\n\r\n echo $separator . '<a class=\"iglink2\" href=\"index.php' . $qs . '\">';\r\n echo $row['gallery_name'] . '</a>';\r\n\r\n // Display the collection name.\r\n $sql = \"SELECT name AS collection_name FROM collections WHERE id=?\";\r\n $sql = $this->db_helper->construct_secure_query($sql, $collection_id);\r\n $result = $this->dbh->query($sql) or die('showBreadcrumb() ERROR: get collection name failed. ' . $this->dbh->error());\r\n $row = $result->fetch_assoc();\r\n echo $separator . $row['collection_name'];\r\n }\r\n else if($page == 'list_image') {\r\n // Page is displaying all the images for an album.\r\n $gallery_id = $_REQUEST['gallery_id'];\r\n $collection_id = $_REQUEST['collection_id'];\r\n $album_id = $_REQUEST['album_id'];\r\n\r\n // Provide a link to the gallery.\r\n $sql = \"SELECT name AS gallery_name FROM galleries WHERE id=?\";\r\n $sql = $this->db_helper->construct_secure_query($sql, $gallery_id);\r\n $result = $this->dbh->query($sql) or die('showBreadcrumb() ERROR: get gallery name failed. ' . $this->dbh->error());\r\n\t $row = $result->fetch_assoc();\r\n\r\n $qs = \"?page=list_collection&gallery_id=$gallery_id\";\r\n\r\n echo $separator . '<a class=\"iglink2\" href=\"index.php' . $qs . '\">';\r\n echo $row['gallery_name'] . '</a>';\r\n\r\n // Provide a link to the collection.\r\n $sql = \"SELECT name AS collection_name FROM collections WHERE id=?\";\r\n $sql = $this->db_helper->construct_secure_query($sql, $collection_id);\r\n $result = $this->dbh->query($sql) or die('showBreadcrumb() ERROR: get collection name failed. ' . $this->dbh->error());\r\n $row = $result->fetch_assoc();\r\n\r\n $qs = \"?page=list_album&gallery_id=$gallery_id&collection_id=$collection_id\";\r\n\r\n echo $separator .'<a class=\"iglink2\" href=\"index.php' . $qs . '\">';\r\n echo $row['collection_name'] . '</a>';\r\n\r\n // Display the album name.\r\n $sql = \"SELECT name AS album_name FROM albums WHERE id=?\";\r\n $sql = $this->db_helper->construct_secure_query($sql, $album_id);\r\n\t $result = $this->dbh->query($sql) or die('showBreadcrumb() ERROR: get album name failed. ' . $this->dbh->error());\r\n $row = $result->fetch_assoc();\r\n echo $separator . $row['album_name'];\r\n }\r\n }\r\n }",
"public function setBreadcrumbs()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\tif ($menu = $app->getMenu()->getActive()) {\n\t\t\t$pathway \t= $app->getPathWay();\n\t\t\t$menu\t \t= $menu->query;\n\t\t\n\t\t\tif (!KInflector::isPlural($this->getName()) && $menu['view'] != 'forum') \n\t\t\t\t$pathway->addItem($this->getDocumentSubtitle(), $this->createRoute());\n\t\t}\n\t}",
"public function breadcrumbs()\n {\n }",
"public function breadcrumb();",
"public function addBreadcrumb()\n\t{\n\n\t\t// Knoten in Session speichern\n\t\tif (isset($_GET['node']))\n\t\t{\n\t\t\t$this->Session->set('tl_fernschach_turniere_node', $this->Input->get('node'));\n\t\t\t$this->redirect(preg_replace('/&node=[^&]*/', '', $this->Environment->request));\n\t\t}\n\t\t$cat = $this->Session->get('tl_fernschach_turniere_node');\n\n\t\t// Breadcrumb-Navigation erstellen\n\t\t$breadcrumb = array();\n\t\tif($cat) // Nur bei Unterkategorien\n\t\t{\n\t\t\t// Kategorienbaum einschränken\n\t\t\t$GLOBALS['TL_DCA']['tl_fernschach_turniere']['list']['sorting']['root'] = array($cat);\n\t\t\n\t\t\t// Infos zur aktuellen Kategorie laden\n\t\t\t$objActual = \\Database::getInstance()->prepare('SELECT * FROM tl_fernschach_turniere WHERE published = ? AND id = ?')\n\t\t\t ->execute(1, $cat);\n\t\t\t$breadcrumb[] = '<img src=\"bundles/contaofernschach/images/ordner_gelb.png\" width=\"18\" height=\"18\" alt=\"\"> ' . $objActual->title;\n\t\t\t\n\t\t\t// Navigation vervollständigen\n\t\t\t$pid = $objActual->pid;\n\t\t\twhile($pid > 0)\n\t\t\t{\n\t\t\t\t$objTemp = \\Database::getInstance()->prepare('SELECT * FROM tl_fernschach_turniere WHERE published = ? AND id = ?')\n\t\t\t\t ->execute(1, $pid);\n\t\t\t\t$breadcrumb[] = '<img src=\"bundles/contaofernschach/images/ordner_gelb.png\" width=\"18\" height=\"18\" alt=\"\"> <a href=\"' . \\Controller::addToUrl('node='.$objTemp->id) . '\" title=\"'.specialchars($GLOBALS['TL_LANG']['MSC']['selectNode']).'\">' . $objTemp->title . '</a>';\n\t\t\t\t$pid = $objTemp->pid;\n\t\t\t}\n\t\t\t$breadcrumb[] = '<img src=\"' . TL_FILES_URL . 'system/themes/' . \\Backend::getTheme() . '/images/pagemounts.gif\" width=\"18\" height=\"18\" alt=\"\"> <a href=\"' . \\Controller::addToUrl('node=0') . '\" title=\"'.specialchars($GLOBALS['TL_LANG']['MSC']['selectAllNodes']).'\">' . $GLOBALS['TL_LANG']['MSC']['filterAll'] . '</a>';\n\t\t}\n\t\t$breadcrumb = array_reverse($breadcrumb);\n\n\t\t// Insert breadcrumb menu\n\t\tif($breadcrumb)\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_fernschach_turniere']['list']['sorting']['breadcrumb'] .= '\n\t\t\t<ul id=\"tl_breadcrumb\">\n\t\t\t\t<li>' . implode(' > </li><li>', $breadcrumb) . '</li>\n\t\t\t</ul>';\n\t\t}\n\t}",
"public function _initBreadcrumbs()\n {\n if ($this->asCfg->cfg['breadcrumbs']) {\n $bc = explode(',', $this->asCfg->cfg['breadcrumbs']);\n if (function_exists($bc[0])) {\n $this->asCfg->cfg['bCrumbsInfo']['type'] = 'function';\n } elseif ($this->_snippet_exists($bc[0])) {\n $this->asCfg->cfg['bCrumbsInfo']['type'] = 'snippet';\n } else {\n $this->asCfg->cfg['breadcrumbs'] = false;\n }\n if ($this->asCfg->cfg['breadcrumbs']) {\n $this->asCfg->cfg['bCrumbsInfo']['name'] = array_shift($bc);\n $this->asCfg->cfg['bCrumbsInfo']['params'] = array();\n foreach ($bc as $prm) {\n $param = explode(':', $prm);\n $this->asCfg->cfg['bCrumbsInfo']['params'][$param[0]] = (isset($param[1]) ? $param[1] : 0);\n }\n }\n }\n }",
"protected function breadcrumbForSearch()\n {\n $breadcrumbTree = new ullVentoryBreadcrumbTree();\n $breadcrumbTree->add(__('Advanced search', null, 'common'), 'ullVentory/search');\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }",
"function _breadcrumb__main_link() {\n // The European Commission website is always the root of our breadcrumb.\n // Update case:\n $path = 'https://ec.europa.eu/info/index_[language:language-content:language]';\n $root_title = 'European Commission';\n $menu_name = 'menu-breadcrumb-menu';\n $mlids = db_query(\"SELECT mlid from {menu_links} WHERE menu_name=:menu_name\", array(':menu_name' => $menu_name))->fetchAll();\n if (!empty($mlids)) {\n foreach ($mlids as $record) {\n $menu_item = menu_link_load($record->mlid);\n if ($menu_item['link_title'] == $root_title) {\n if ($menu_item['language'] == 'und' && $menu_item['hidden'] == 0) {\n // Update the link.\n $menu_item['link_path'] = $path;\n $menu_item['menu_token_enabled'] = 1;\n $menu_item['options']['menu_token_link_path'] = $path;\n $root_mlid = menu_link_save($menu_item);\n }\n }\n }\n }\n else {\n // Needs to create item.\n $root_menu_item_default_data = array(\n 'link_title' => $root_title,\n 'link_path' => $path,\n 'menu_name' => $menu_name,\n 'weight' => 0,\n 'expanded' => 0,\n 'menu_token_enabled' => 1,\n 'customized' => 1,\n 'language' => 'und',\n 'options' => array(\n 'menu_token_link_path' => $path,\n 'menu_token_data' => array(),\n 'menu_token_options' => array(\n 'title_localize' => 0,\n 'clear' => 0,\n ),\n 'attributes' => array(\n 'title' => '',\n ),\n ),\n );\n $root_mlid = menu_link_save($root_menu_item_default_data);\n }\n _set_translations(array(\n 'text_original' => $root_title,\n 'context' => 'menu_item',\n 'mlid' => $root_mlid,\n ));\n}",
"public function addBreadcrumb()\n\t{\n\n\t\t// Knoten in Session speichern\n\t\tif (isset($_GET['node']))\n\t\t{\n\t\t\t$this->Session->set('tl_forum_node', $this->Input->get('node'));\n\t\t\t$this->redirect(preg_replace('/&node=[^&]*/', '', $this->Environment->request));\n\t\t}\n\t\t$cat = $this->Session->get('tl_forum_node');\n\n\t\t// Breadcrumb-Navigation erstellen\n\t\t$breadcrumb = array();\n\t\tif($cat) // Nur bei Unterkategorien\n\t\t{\n\t\t\t// Kategorienbaum einschränken\n\t\t\t$GLOBALS['TL_DCA']['tl_forum']['list']['sorting']['root'] = array($cat);\n\t\t\n\t\t\t// Infos zur aktuellen Kategorie laden\n\t\t\t$objActual = \\Database::getInstance()->prepare('SELECT * FROM tl_forum WHERE published = ? AND id = ?')\n\t\t\t\t\t\t\t \t\t\t\t ->execute(1, $cat);\n\t\t\t$breadcrumb[] = '<img src=\"bundles/contaoforum/images/category.png\" width=\"18\" height=\"18\" alt=\"\"> ' . $objActual->title;\n\t\t\t\n\t\t\t// Navigation vervollständigen\n\t\t\t$pid = $objActual->pid;\n\t\t\twhile($pid > 0)\n\t\t\t{\n\t\t\t\t$objTemp = \\Database::getInstance()->prepare('SELECT * FROM tl_forum WHERE published = ? AND id = ?')\n\t\t\t\t\t\t\t\t \t\t\t ->execute(1, $pid);\n\t\t\t\t$breadcrumb[] = '<img src=\"bundles/contaoforum/images/category.png\" width=\"18\" height=\"18\" alt=\"\"> <a href=\"' . \\Controller::addToUrl('node='.$objTemp->id) . '\" title=\"'.specialchars($GLOBALS['TL_LANG']['MSC']['selectNode']).'\">' . $objTemp->title . '</a>';\n\t\t\t\t$pid = $objTemp->pid;\n\t\t\t}\n\t\t\t$breadcrumb[] = '<img src=\"' . TL_FILES_URL . 'system/themes/' . \\Backend::getTheme() . '/images/pagemounts.gif\" width=\"18\" height=\"18\" alt=\"\"> <a href=\"' . \\Controller::addToUrl('node=0') . '\" title=\"'.specialchars($GLOBALS['TL_LANG']['MSC']['selectAllNodes']).'\">' . $GLOBALS['TL_LANG']['MSC']['filterAll'] . '</a>';\n\t\t}\n\t\t$breadcrumb = array_reverse($breadcrumb);\n\n\t\t// Insert breadcrumb menu\n\t\tif($breadcrumb)\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_forum']['list']['sorting']['breadcrumb'] .= '\n\t\t\t<ul id=\"tl_breadcrumb\">\n \t\t\t\t<li>' . implode(' > </li><li>', $breadcrumb) . '</li>\n\t\t\t</ul>';\n\t\t}\n\t}",
"function addCrumb ($name, $link)\n\t{\n\t\t$this->_crumbs[] = array ($name, $link);\n\t}",
"protected function _renderBreadcrumbs() {\n if (!isset($this->options['showBreadcrumbs']) || !empty($this->options['showBreadcrumbs'])) {\n $trail = $this->getBreadcrumbs();\n if (!empty($trail)) {\n if (is_array($trail)) {\n $phs = array_merge($this->scriptProperties,array(\n 'items' => &$trail,\n ));\n $trail = $this->discuss->hooks->load('breadcrumbs',$phs);\n }\n $this->setPlaceholder('trail',$trail);\n }\n }\n }",
"public function trail() {\n\n $breadcrumb = '';\n\n\t /* Allow developers to edit BC items. */\n\t $this->items = apply_filters(\"wbf/breadcrumb_trail/items\",$this->items);\n\n /* Connect the breadcrumb trail if there are items in the trail. */\n if ( !empty( $this->items ) && is_array( $this->items ) ) {\n\n /* Make sure we have a unique array of items. */\n $this->items = array_unique($this->items);\n\n /* Open the breadcrumb trail containers. */\n $breadcrumb = \"\\n\\t\\t\" . '<' . tag_escape($this->args['container']) . ' class=\"breadcrumb-trail breadcrumbs ' . $this->args['additional_classes'] . '\" itemprop=\"breadcrumb\">';\n\n /* Crea Wrapper */\n $breadcrumb .= !empty( $this->args['wrapper_start'] )? $this->args['wrapper_start'] : \"\";\n\n /* If $before was set, wrap it in a container. */\n $breadcrumb .= ( !empty( $this->args['before'] ) ? \"\\n\\t\\t\\t\" . '<span class=\"trail-before\">' . $this->args['before'] . '</span> ' . \"\\n\\t\\t\\t\" : '' );\n\n /* Add 'browse' label if it should be shown. */\n if ( true === $this->args['show_browse'] )\n $breadcrumb .= \"\\n\\t\\t\\t\" . '<span class=\"trail-browse\">' . $this->args['labels']['browse'] . '</span> ';\n\n /* Adds the 'trail-begin' class around first item if there's more than one item. */\n if ( 1 < count( $this->items ) )\n array_unshift( $this->items, '<span class=\"trail-begin\">' . array_shift( $this->items ) . '</span>' );\n\n /* Adds the 'trail-end' class around last item. */\n array_push( $this->items, '<span class=\"trail-end\">' . array_pop( $this->items ) . '</span>' );\n\n /* Format the separator. */\n $separator = ( !empty( $this->args['separator'] ) ? '<span class=\"sep\">' . $this->args['separator'] . '</span>' : '<span class=\"sep\">/</span>' );\n\n /* Join the individual trail items into a single string. */\n $breadcrumb .= join( \"\\n\\t\\t\\t {$separator} \", $this->items );\n\n /* If $after was set, wrap it in a container. */\n $breadcrumb .= ( !empty( $this->args['after'] ) ? \"\\n\\t\\t\\t\" . ' <span class=\"trail-after\">' . $this->args['after'] . '</span>' : '' );\n\n /* Chiude Wrapper */\n $breadcrumb .= !empty( $this->args['wrapper_end'] )? $this->args['wrapper_end'] : \"\";\n\n /* Close the breadcrumb trail containers. */\n $breadcrumb .= \"\\n\\t\\t\" . '</' . tag_escape( $this->args['container'] ) . '>';\n }\n\n /* Allow developers to filter the breadcrumb trail HTML. */\n $breadcrumb = apply_filters( 'breadcrumb_trail', $breadcrumb, $this->args );\n\n if ( true === $this->args['echo'] )\n echo $breadcrumb;\n else\n return $breadcrumb;\n }",
"public function _BuildBreadCrumbs()\n {\n\n // Build the arrays that will contain the category names to build the trails\n $count = 0;\n\n\t\t\t$link_params = $params = $this->searchterms; // assinging the parameters \n\t\t\tunset($link_params['subcategory'],$link_params['series']); // unsetting the subcategory parameter as it not required in link\n\t\t\t$mmy_links = $this->GetYMMLinks($link_params); // getting ymm links\n\t\t\t$mmy_links .= $this->GetOtherLinks($link_params); // getting ymm links\n\n $GLOBALS['BreadCrumbs'] = \"\";\n $breadcrumbitems = \"\";\n \n //$categories = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('RootCategories');\n if(isset($GLOBALS['ISC_SRCH_CATG_NAME'])) {\n \n $GLOBALS['BreadCrumbs'] .= \"<div class='Block Moveable Breadcrumb' id='ProductBreadcrumb'>\";\n \n $GLOBALS['CatTrailLink'] = $GLOBALS['ShopPath'];\n $GLOBALS['CatTrailName'] = GetLang('Home');\n \n $GLOBALS['BreadcrumbItems'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItem\");\n \n $catg_id_selected = $GLOBALS['ISC_SRCH_CATG_ID'];\n $catg_selected = $GLOBALS['ISC_SRCH_CATG_NAME'];\n \n if ($GLOBALS['EnableSEOUrls'] == 1)\n \t//Modify 2010/10/19 Ronnie\n \t//$GLOBALS['CatTrailLink'] = $GLOBALS['ShopPath'].$mmy_links;\n\t\t\t\t\t$GLOBALS['CatTrailLink'] = $GLOBALS['ShopPath'].\"/\".MakeURLSafe(strtolower($GLOBALS['ISC_SRCH_CATG_NAME']));\n\t\t\t\telse\n\t\t\t\t\t$GLOBALS['CatTrailLink'] = $GLOBALS['ShopPath'].\"/search.php?search_query=\".MakeURLSafe(strtolower($GLOBALS['ISC_SRCH_CATG_NAME']));\n\n $GLOBALS['CatTrailName'] = $GLOBALS['ISC_SRCH_CATG_NAME'];\n \n if(isset($params['subcategory']) && !empty($params['subcategory'])) {\n \n $breadcrumbitems .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItem\");\n $GLOBALS['CatTrailName'] = $params['subcategory'];\n /**$query = sprintf(\"SELECT categoryid, catparentid, catname FROM [|PREFIX|]categories WHERE categoryid IN (%s)\", $_REQUEST['sub_category']);\n $result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n $GLOBALS['CatTrailName'] = $row['catname'];\n }**/\n \n $GLOBALS['BreadcrumbItems'] .= $breadcrumbitems.$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItemCurrent\");\n $GLOBALS['BreadCrumbs'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductBreadCrumb\"); \n \n } else {\n \n $GLOBALS['BreadcrumbItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItemCurrent\"); \n $GLOBALS['BreadCrumbs'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductBreadCrumb\"); \n \n }\n \n $GLOBALS['BreadCrumbs'] .= \"</div>\";\n \n }\n\n\n }",
"public function getBreadcrumbs();",
"public static function breadcrumb($title, $link)\n {\n //self::$breadcrumbs[] = [$title => $link];\n array_push(self::$breadcrumbs, [$title => $link]);\n }",
"public function add_crumb($name, $link = '')\n {\n }",
"function printCrumbLine() {/*{{{*/\r\n\t\r\n\t\tfor( $i=0; $i<count($this->crumbline); $i++ )\r\n\t\t{\r\n\t\t\tif( $i != 0 )\r\n\t\t\t{\r\n\t\t\t\techo ' <span CLASS=\"bullet_link\">»</span> ';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo '<a href=\"' . $this->crumbline[$i]['link'] . '\" CLASS=\"bullet_link\">' . $this->crumbline[$i]['name'] . '</a>';\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default page icon (font awesome class) | public function pageIcon() {
return "fa-table";
} | [
"public function plugin_page_icon() {\r\n\t\treturn '';\r\n\t}",
"public function icon() {\n\t\treturn 'menu';\n\t}",
"function fa_icon( $icon = 'user' ) {\n\t\treturn \"<i class=\\\"fa fa-{$icon}\\\"></i>\";\n\t}",
"function menu_icon( $icon = \"dashicons-admin-page\" ) {\n\n\t\tif ( is_string( $icon ) && stripos( $icon, \"dashicons\" ) !== false ) {\n\n\t\t\t$this->options[\"menu_icon\"] = $icon;\n\n\t\t} else {\n\n\t\t\t// Set a default menu icon\n\t\t\t$this->options[\"menu_icon\"] = \"dashicons-admin-page\";\n\t\t}\n\t}",
"function wp_site_icon()\n {\n }",
"public function SetIcon() {\n\n if ($this->icon) {\n echo '<link rel=\"shortcut icon\" href=\"'.$this->icon.'.ico\" />';\n }\n }",
"function GetIcon(){}",
"public function get_icon() {\n\t\treturn 'fa fa-blog';\n\t}",
"function vcex_add_default_icon_prefix( $icon ) {\n\treturn 'ticon ticon-' . sanitize_html_class( $icon );\n}",
"public static function getSelectedPageLinkIcon()\n {\n $linkDetailsArray = self::getRouteByPage();\n $linkIcon = $linkDetailsArray['link_icon'];\n return $linkIcon;\n }",
"static public function base_icon_url()\n\t{\n\t\treturn FUGUE_ICONS_BASE_URL;\n\t}",
"public function addFavIcon()\n\t{\n\t\t$this->html->template->appendHTML('HEAD', $this->getTag('link', ['rel' => 'shortcut icon', 'href' => config('epesi.ui.favicon', url('favicon.png'))]));\n\t}",
"public function Icon()\n {\n switch ($this->Title) {\n case 'Twitter':\n return 'fab fa-twitter-square';\n break;\n case 'Google+':\n return 'fab fa-google-plus-square';\n break;\n case 'Instagram':\n return 'fab fa-instagram';\n break;\n case 'YouTube':\n return 'fab fa-youtube-square';\n break;\n case 'LinkedIn':\n return 'fab fa-linkedin-square';\n break;\n case 'Pinterest':\n return 'fab fa-pinterest-square';\n break;\n case 'SoundCloud':\n return 'fab fa-soundcloud';\n break;\n case 'Tumblr':\n return 'fab fa-tumblr-square';\n break;\n default:\n case 'Facebook':\n return 'fab fa-facebook-square';\n break;\n }\n }",
"public function getDefaultIcon()\n {\n return $this->icon;\n }",
"private function getPageIcon()\n {\n if (strlen($this->pageId) > 0)\n {\n if (strlen($this->pageId) > 1)\n if (isset(BaseConfig::$data['pageId'][$this->pageId])) {\n return BaseConfig::$data['pageId'][$this->pageId]['icon'];\n }\n return array_key_exists($this->pageId, BaseConfig::$data['pageId'][(string)$this->pageId[0]]['submenu'])\n ? BaseConfig::$data['pageId'][$this->pageId[0]]['submenu'][$this->pageId]['icon'] :'';\n\n return array_key_exists($this->pageId, BaseConfig::$data['pageId'])\n ? BaseConfig::$data['pageId'][$this->pageId]['icon'] : '';\n }\n }",
"public function get_icon() {\n\t\treturn 'eicon-image';\n\t}",
"function GetIcon($index){}",
"function getIcon() {return $this->_icon;}",
"public function post_type_icon() {\n\t\t?>\n <style>\n #adminmenu .menu-top.menu-icon-<?php echo self::$seq_post_type;?> div.wp-menu-image:before {\n font-family: FontAwesome !important;\n content: '\\f160';\n }\n </style>\n\t\t<?php\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a path to addon by addon_id | public static function getAddonPathByAddOnId($addOnId)
{
$devel = XenForo_Application::isRegistered('cmfDevelopment') ? XenForo_Application::get('cmfDevelopment') : false;
$addOnId = trim((string) $addOnId);
if ($addOnId && $devel && $devel['addon']['dir'])
{
if (isset(self::$_pathCache['addon'][$addOnId]))
{
return self::$_pathCache['addon'][$addOnId];
}
$path = $devel['addon']['dir'] . '/' . (isset($devel['addon']['map'][$addOnId]) ? $devel['addon']['map'][$addOnId] : utf8_strtolower(preg_replace(array('/\s+/iu', '/[^a-z0-9_-]/iu'), array('_', ''), $addOnId)));
if (@is_readable($path) && @is_dir($path))
{
self::$_pathCache['addon'][$addOnId] = $path;
return $path;
}
}
return '';
} | [
"public function getAddonId()\n {\n return $this->addon_id;\n }",
"function getAddonPath()\n\t{\n\t\t//assert(isset($this->addonData['addon_key']));\n\t\treturn PEAR_ROOT_PATH . PEAR_SYSTEM_SOURCES . PEAR_ADDONS_DIRECTORY . $this->addonData['addon_key'] . '/';\n\t}",
"public function getPath($id) {\n $iid = $this->_interface->getElementPrefix().'_'.$id;\n return $iid.'_program';\n }",
"public function setAddonId($var)\n {\n GPBUtil::checkString($var, True);\n $this->addon_id = $var;\n }",
"public function idToPath($id);",
"public function getAddon() {\n\t\treturn AddonManager::getFromId($this->aid);\n\t}",
"protected function getPath($id) {\r\n $path = $this->location . DS . $id . '.' . $this->format;\r\n return $path;\r\n }",
"public function getPath($id) {\n $iid = $this->_interface->getElementPrefix().'_'.$id;\n return $iid.'_aggregator';\n }",
"protected function id_to_path($lib_id) {\n $parts = explode(\".\", $lib_id);\n $fileName = array_pop($parts);\n $path = Path::build($this->application->root_path, \"library\", \"lib\");\n foreach ($parts as $part) {\n $path = Path::build($path, $part);\n }\n return Path::build($path, Text::format(\"{}.py\", $fileName));\n }",
"public function getPath($id) {\n\t\treturn \\OC\\Files\\Filesystem::getPath($id);\n\t}",
"public function idToPath($id)\n {\n return $id['public_id'] . '.' . $id['format'];\n }",
"function getAddonThumbnail($addonId, $size) {\n\tglobal $configuration;\n\n\t$addonWritePath = $configuration['cache']['pathWrite'] . 'Addons' . DIRECTORY_SEPARATOR . $addonId . DIRECTORY_SEPARATOR;\n\t$addonThumbnailPath = $addonWritePath . 'icon.png';\n\n\tif (!file_exists($addonThumbnailPath)) {\n\t\t$addonThumbnailPath = $configuration['images']['dummy'];\n\t}\n\n\treturn getThumbnailUrl($addonThumbnailPath, $size);\n}",
"function getAddonDownloadLink($addon) {\n\tif ($repo = getRepositoryConfiguration($addon->repository_id)) {\n\t\treturn $repo['dataUrl'] . $addon->id . '/' . $addon->id . '-' . $addon->version . '.zip';\n\t}\n\treturn FALSE;\n}",
"public function getPath($id) {\n return $this->find($id)->current();\n }",
"public static function getPath($article_version_id) {\n $article_nid = self::fromIdentifier($article_version_id, FALSE);\n return drupal_get_path_alias('node/' . $article_nid);\n }",
"private function lookup_resource_path($id) {\n\n\t\tforeach($this->eeck_settings['eeck_resourcetypes'] as $res) {\n\t\t\tif($res['name'] == $id) {\n\t\t\t\t$location = $this->helper->upload_location($res['upload_location'], false);\n\t\t\t\treturn $location;\n\t\t\t}\n\t\t}\n\n\t\treturn '';\n\t}",
"public function getCoreAddonPaths()\n {\n return $this->files->getDirectoryPaths(base_path('app/addons/' . $this->folder));\n }",
"public function path(int $id) : string\n {\n $id = 1000000000 + $id;\n $path = substr($id,1);\n $path = str_split($path,3);\n $path = implode('/', $path).'/';\n return $path;\n }",
"public function getExtension($id)\n \t{\n \t\treturn $this->query(\"Select * From extension WHERE ExtId = $id\");\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This function selects newest 20 trip posts in the database | function searchNewestTripPost() {
global $db;
try {
$stmt = $db->prepare("SELECT t.*, u.username, u.password, u.email
FROM `trips` as t, users as u
WHERE t.user_id = u.user_id ORDER by t.created_date DESC LIMIT 20");
$stmt->execute(array());
$datas = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $datas;
}
catch (PDOException $e) {
print $e-> getMessage();
return null;
}
} | [
"public function getLastPosts(){\n $req = [\n \"fields\" => [\n 'id',\n 'nb_chapter',\n 'title',\n 'SUBSTRING(content,1,300) AS \"post_content\"',\n 'DATE_FORMAT(date_published, \\'%d/%m/%Y\\') AS \"post_date\"'\n ],\n \"from\" => \"posts\",\n \"order\" => \"id DESC\",\n \"where\" => [\"featured = 0\"],\n \"limit\" => 5\n ];\n $data = Model::select($req);\n return $data[\"data\"];\n }",
"function get_recent_post($num){\n $sql = \"SELECT * FROM post ORDER BY post_date DESC LIMIT $num\";\n return $this->query($sql);\n}",
"function get_most_popular_posts($dbh, $count = 10, $from = 0) {\n\n}",
"function _getTopRated(){\n global $objDatabase;\n $query = \" SELECT id, thread_id, category_id, subject, content, keywords, rating\n FROM `\".DBPREFIX.\"module_forum_postings`\n ORDER BY `rating` DESC\";\n $objRS = $objDatabase->SelectLimit($query, $this->_topListLimit);\n return $objRS;\n }",
"public function getFiveLatestRecords();",
"public static function getNewestFreePosts()\r\n {\r\n //--- Get Default Culture ---//\r\n $culture = sfContext::getInstance()->getUser()->getCulture();\r\n\r\n $q = self::getInstance()->createQuery('p')\r\n ->select('p.title,ct.name as catname,pi.image as image,pi.is_cover as is_cover,cnty.currency,c.id')\r\n ->leftJoin('p.Categories c')\r\n ->leftJoin('c.Translation ct')\r\n ->leftJoin('p.PostImages pi')\r\n ->leftJoin('p.Countries cnty')\r\n ->leftJoin('cnty.Translation cntyt')\r\n ->andWhere('p.lang = ?', $culture)\r\n ->addWhere('ct.lang = ?', $culture)\r\n ->addWhere('cntyt.lang = ?', $culture)\r\n ->addWhere('p.is_featured = 0')\r\n ->addWhere('p.status= ?', \"publish\")\r\n ->orderBy('p.created_at DESC')\r\n ->limit(5);\r\n\r\n return $q->execute();\r\n }",
"function get_most_popular_posts($dbh, $count = 10, $from = 0) {\n\t$query = 'SELECT post.* FROM post, vote WHERE post.postid=vote.postid AND post.ts>' . $from . ' GROUP BY post.postid ORDER BY count(*) DESC LIMIT ' . $count;\n\terror_log($query);\n\t$result = pg_query($dbh, $query);\n\t$posts = array();\n\tif ($result){\n\t\twhile ($resultArray = pg_fetch_array($result)){\n\t\t\t$tmp = array(\n\t \t\t'pID' => $resultArray['postid'],\n \t\t\t'username' => $resultArray['username'],\n \t\t\t'title' => $resultArray['title'],\n \t'content' => $resultArray['body'],\n\t \t\t'time' => $resultArray['ts'],\n\t \t\t'coorX' => $resultArray['locationx'],\n \t\t\t'coorY' => $resultArray['locationy'],\n \t\t\t);\n \t\t\tarray_push($posts, $tmp);\n\t\t}\n\t\treturn array('status'=>1, 'posts'=>$posts);\n\t}\n\treturn array('status'=>0, 'posts'=>$posts);\n}",
"function get_recent()\n {\n $this->db->limit(5);\n $this->db->order_by('game_id','desc');\n return $this->db->get($this->table)->result();\n }",
"private function getNewest($count = 5) {\n return Posts::where('status', 'public')->orderBy('id', 'desc')->take($count)->get();\n }",
"public function getRecentPosts()\n\t{\n\t\t$sql = \"SELECT * FROM posts WHERE published = 1 ORDER BY created_at DESC LIMIT 4\";\n\t\treturn $this->findAll($sql, 'obj');\n\t}",
"public function getTenMostRecent()\n {\n return $this->getGateway()->select(function (Select $select) {\n $select\n ->order('created_at DESC')\n ->limit(10);\n });\n }",
"function getLatestPosts($count = -1) {\n $query = new WP_Query([\n 'post_type' => 'post',\n 'posts_per_page' => $count\n ]);\n\n return $query->get_posts();\n}",
"public function getRecentPosts() {\n $sql = \"SELECT * FROM blogpost ORDER BY post_date DESC LIMIT 5\";\n $result = $this->db->query($sql);\n return mysqli_fetch_all($result, MYSQLI_ASSOC);\n }",
"public function getLastTenPosts()\n {\n $sql = 'SELECT *'.\"\\n\".\n 'FROM `posts`'.\"\\n\".\n 'ORDER BY `id` DESC'.\"\\n\".\n 'LIMIT 0, 10';\n\n return DB::query(Database::SELECT, $sql, FALSE)\n ->execute();\n\n }",
"private function getPopularPosts() {\n $query_str = \"\n SELECT Kitchen_Post.id,\n Kitchen_Post.img,\n Kitchen_Post.header,\n Kitchen_Post.create_date\n FROM Kitchen_Post\n ORDER BY Kitchen_Post.likes DESC\n LIMIT 3;\n \";\n\n $db_query = $this->connection->query($query_str);\n $res = Array();\n if( $db_query->num_rows > 0 ) {\n for($i = 0, $len = $db_query->num_rows-1; $i <= $len; $i++) {\n $res[$i] = $db_query->fetch_object();\n }\n }\n return $res;\n }",
"public static function getLastRecipies($num) {\n if (DB::table('posts')->count() <= $num )\n {\n return DB::table('posts')->where('postStatus_id','=', 3)->orderBy('created_at', 'desc')->get();\n } else {\n return DB::table('posts')->where('postStatus_id','=', 3)->orderBy('created_at', 'desc')->take($num)->get();\n }\n }",
"function get_most_popular_posts($dbh, $count = 10, $from = 0) {\n\tif (!$dbh) {\n\t\techo \"Postgres cannot be connected.\\n\";\n\t} else {\n\t\t$query = <<<EOF\n\n\t\tselect p.post_id, p.post_user_name, p.post_title, p.post_body, p.post_timestamp\n\t\tfrom CMU_Post as p inner join CMU_like as l on p.post_id=l.like_id\n\t\twhere p.post_timestamp > to_timestamp('$from')\n\t\tgroup by p.post_id, p.post_user_name, p.post_title, p.post_body, p.post_timestamp\n\t\torder by count(*) desc\n\t\tlimit $count;\n\nEOF;\n\t\t$result = pg_query($dbh, $query);\n\n\t\tif (!$result) {\n\t\t\treturn array('status' => 0,\n\t\t\t\t\t\t 'posts' => NULL);\n\t\t} else {\n\t\t\t$posts = array();\n\t\t\twhile ($row = pg_fetch_row($result)) {\n\t\t\t\t$databean = array('pID' => $row[0],\n\t\t\t\t\t\t\t\t'username' => $row[1],\n\t\t\t\t\t\t\t\t'title' => $row[2],\n\t\t\t\t\t\t\t\t'content' => $row[3],\n\t\t\t\t\t\t\t\t'time' => strtotime($row[4]));\n\t\t\t\t$posts[] = $databean;\n\t\t\t}\n\n\t\t\treturn array('status' => 1,\n\t\t\t\t\t\t 'posts' => $posts);\n\t\t}\n\t}\n}",
"function LatestPosts() {\n\t\treturn Post::get()\n\t\t\t->filter('AuthorID', (int)$this->urlParams['ID'])\n \t\t\t->limit(0,5)\n\t\t\t->sort(\"Created\", \"DESC\")\n\t\t\t->filterByCallback(function($post){\n\t\t\t\treturn $post->canView();\n\t\t\t});\n\t}",
"private function get_recent_articles()\n\t{\n\t\t$result = query(\"SELECT article_id,title, cover_pic FROM article ORDER BY time_published DESC LIMIT 5\");\n\n\t\treturn $result;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create and setup QCubed\Control\Label lblNameEs | public function lblNameEs_Create($strControlId = null)
{
$this->lblNameEs = new \QCubed\Control\Label($this->objParentObject, $strControlId);
$this->lblNameEs->Name = t('Name Es');
$this->lblNameEs->PreferredRenderMethod = 'RenderWithName';
$this->lblNameEs->LinkedNode = QQN::Country()->NameEs;
$this->lblNameEs->Text = $this->objCountry->NameEs;
return $this->lblNameEs;
} | [
"public function creaLabel($label) {\n $this->label = $label;\n }",
"private function addLabel()\n {\n $labelElm = $this->html->createElement('label');\n $labelElm->setAttribute('for', $this->name);\n\n $label = $this->getLabel();\n\n $label = ucwords($label) . ': ';\n\n $labelElm->nodeValue = $label;\n\n $this->container->appendChild($labelElm);\n }",
"public function setLabel() {\n }",
"protected function buildLabel() {\n }",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->lblName->LinkedNode = QQN::Ingredient()->Name;\n\t\t\t$this->lblName->Text = $this->objIngredient->Name;\n\t\t\treturn $this->lblName;\n\t\t}",
"function setLabel();",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->Text = $this->objIssueFieldOption->Name;\n\t\t\t$this->lblName->Required = true;\n\t\t\treturn $this->lblName;\n\t\t}",
"public function lblNameIt_Create($strControlId = null) \n {\n $this->lblNameIt = new \\QCubed\\Control\\Label($this->objParentObject, $strControlId);\n $this->lblNameIt->Name = t('Name It');\n $this->lblNameIt->PreferredRenderMethod = 'RenderWithName';\n $this->lblNameIt->LinkedNode = QQN::Country()->NameIt;\n\t\t\t$this->lblNameIt->Text = $this->objCountry->NameIt;\n return $this->lblNameIt;\n }",
"protected function createDefaultLabel() {\r\n\t \tif(preg_match('/<.*?>/', $this->labelName)) {\r\n\t\t\t// label contains html\r\n\t\t\t$fragNode = $this->convertNode($this->labelName);\r\n\t\t\t$this->labelName = preg_replace('/<.*?>/', '', $this->labelName);\r\n\t\t\t$node = new Larc_Html_Element('label');\r\n\t\t} else {\r\n\t\t\t$node = new Larc_Html_Element('label', $this->labelName);\r\n\t\t}\r\n\t\tif($this->blockTag == 'none') {\r\n\t\t\t$this->labelNode = $this;\r\n\t\t} else if($this->labelNode) {\r\n\t\t\t$this->replaceChild($node, $this->labelNode);\r\n\t\t\t$this->labelNode = $node;\r\n\t\t} else {\r\n\t\t\t$this->labelNode = $this->appendChild($node);\r\n\t\t}\r\n\r\n\t\tif(isset($fragNode)) {\r\n\t\t\t$this->labelNode->appendChild($fragNode);\r\n\t\t}\r\n\t\t$this->labelNode->setAttribute(\"for\", $this->fieldName);\r\n\t\tif(isset($this->fieldNode) && !$this->labelNode->getAttribute(\"id\")) {\r\n\t\t\t$this->labelNode->setAttribute(\"id\", $this->fieldName);\r\n\t\t}\r\n\t\t$this->labelNode->setAttribute(\"title\", $this->titleAttrib);\r\n\t}",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->Text = $this->objPraises->Name;\n\t\t\treturn $this->lblName;\n\t\t}",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->Text = $this->objGrowthGroupStructure->Name;\n\t\t\treturn $this->lblName;\n\t\t}",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->Text = $this->objFormProduct->Name;\n\t\t\treturn $this->lblName;\n\t\t}",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->Text = $this->objReference->Name;\n\t\t\t$this->lblName->Required = true;\n\t\t\treturn $this->lblName;\n\t\t}",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->Text = $this->objGroup->Name;\n\t\t\treturn $this->lblName;\n\t\t}",
"public function lblName_Create($strControlId = null) {\n\t\t\t$this->lblName = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblName->Name = QApplication::Translate('Name');\n\t\t\t$this->lblName->Text = $this->objCharityPartner->Name;\n\t\t\treturn $this->lblName;\n\t\t}",
"protected function createHTMLLabels() {\n\t\tglobal $type;\n\n\t\t$this->tpl->addTemplateData(\n\t\t\t'main',\n\t\t\tarray(\n\t\t\t\t'title' => strtoupper(sm_get_lang('system', 'title')),\n\t\t\t\t'subtitle' => sm_get_lang('system', $type),\n\t\t\t\t'active_' . $type => 'active',\n\t\t\t\t'label_servers' => sm_get_lang('system', 'servers'),\n\t\t\t\t'label_users' => sm_get_lang('system', 'users'),\n\t\t\t\t'label_log' => sm_get_lang('system', 'log'),\n\t\t\t\t'label_config' => sm_get_lang('system', 'config'),\n\t\t\t\t'label_update' => sm_get_lang('system', 'update'),\n\t\t\t\t'label_help' => sm_get_lang('system', 'help'),\n\t\t\t)\n\t\t);\n\t}",
"public function lblNombre_Create($strControlId = null) {\n\t\t\t$this->lblNombre = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNombre->Name = QApplication::Translate('Nombre');\n\t\t\t$this->lblNombre->Text = $this->objEmpleado->Nombre;\n\t\t\t$this->lblNombre->Required = true;\n\t\t\treturn $this->lblNombre;\n\t\t}",
"public function lblNome_Create($strControlId = null) {\n\t\t\t$this->lblNome = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNome->Name = QApplication::Translate('Nome');\n\t\t\t$this->lblNome->Text = $this->objTecido->Nome;\n\t\t\t$this->lblNome->Required = true;\n\t\t\treturn $this->lblNome;\n\t\t}",
"protected function addNamesLabelsValues() {\n foreach ($this->__fields() as $field) {\n $this->$field->__name = $field;\n if (!$this->$field->label && $this->$field->label !== '') $this->$field->label = strtoupper($field[0]) . substr ($field, 1);\n $this->setFieldValue($field);\n $this->$field->setForm($this);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds new FilterItem to filter, overwriting previous column filter if set | public function addFilterItem(FilterItem $filterItem): void
{
$this->filterItems[$filterItem->getColumn()] = $filterItem;
} | [
"final function addFilterItem($a_input_item, $a_optional = false)\n\t{\n\t\t$a_input_item->setParent($this);\n\t\tif (!$a_optional)\n\t\t{\n\t\t\t$this->filters[] = $a_input_item;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->optional_filters[] = $a_input_item;\n\t\t}\n\t\t\n\t\t// restore filter values (from stored view)\n\t\tif($this->restore_filter)\n\t\t{\t\t\t\n\t\t\tif(array_key_exists($a_input_item->getFieldId(), $this->restore_filter_values))\n\t\t\t{\n\t\t\t\t$this->setFilterValue($a_input_item, $this->restore_filter_values[$a_input_item->getFieldId()]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->setFilterValue($a_input_item, null); // #14949\n\t\t\t}\n\t\t}\n\t}",
"public function addFilter(Filter $filter)\n {\n // Start with an empty AND composite filter\n if (!isset($this->filter)) {\n $this->filter = Filter::_and();\n }\n\n $this->checkFilter($filter);\n $this->filter = $this->filter->withAdded($filter);\n }",
"public function addFilter($filter);",
"public function addColumnFilter()\n {\n array_set($this->behaviors, 'column_filters', true);\n return $this;\n }",
"private function addFilter(Filter $filter)\n {\n // Start with an empty AND composite filter\n if (!isset($this->filter)) {\n $this->filter = Filter::_and();\n }\n\n $this->checkFilter($filter);\n $this->filter->add($filter);\n }",
"public function addFilter()\n\t{\n\t\t// Check for request forgeries.\n\t\tFoundry::checkToken();\n\n\t\t// In order to access the dashboard apps, user must be logged in.\n\t\tFoundry::requireLogin();\n\n\t\t$my \t= Foundry::user();\n\n\t\t$view \t= Foundry::view( 'Search' , false );\n\n\t\t$title \t= JRequest::getVar( 'title' );\n\t\t$data \t= JRequest::getVar( 'data' );\n\n\t\t$filter = Foundry::table( 'SearchFilter' );\n\n\t\t$filter->title \t\t= $title;\n\t\t$filter->uid \t\t= $my->id;\n\t\t$filter->element \t= SOCIAL_TYPE_USER;\n\t\t$filter->created_by = $my->id;\n\t\t$filter->filter \t= $data; // as as json string.\n\t\t$filter->created \t= Foundry::date()->toMySQL();\n\n\t\t$filter->store();\n\n\t\t$view->setMessage( JText::_( 'COM_EASYSOCIAL_ADVANCED_SEARCH_FILTER_SAVED' ) , SOCIAL_MSG_SUCCESS );\n\n\t\treturn $view->call( __FUNCTION__, $filter );\n\t}",
"private function addFilters()\n {\n $search = static::$versionTransformer->getSearchValue();\n if ($search != '') {\n $this->addAllFilter($search);\n }\n $this->addColumnFilters();\n return $this;\n }",
"public function addItem(tx_ptlist_filter $filterObj) {\n\n\t\tif (func_num_args() > 1) {\n\t\t\tthrow new tx_pttools_exception('Too many parameters');\n\t\t}\n\n\t\t$key = $filterObj->get_filterIdentifier();\n\n\t\tif ($this->hasItem($key)) {\n\t\t\tthrow new tx_pttools_exception(sprintf('Filter \"%s\" already exists in collection and cannot be overwritten!', $key));\n\t\t}\n\n\t\tparent::addItem($filterObj, $key);\n\n\t}",
"public function addFilter($newFilter)\n {\n // Extract field and value from URL string:\n list($field, $value) = $this->parseFilter($newFilter);\n\n // Check for duplicates -- if it's not in the array, we can add it\n if (!$this->hasFilter($newFilter)) {\n $this->filterList[$field][] = $value;\n }\n }",
"public function addSearchFilter($filterId,$label,$listId,$column = '') {\n\t\t$tmpFilter = new SearchFilter($filterId,$label);\n\t\t$tmpFilter->loadData($listId,$column);\n\t\t$this->filters = $this->filters + array($filterId => $tmpFilter);\n\t}",
"private function processColumnFilters()\n {\n $columns = $this->getColumns();\n\n foreach ($columns as $column) {\n // caso coluna tenha filtro\n if ($column->hasFilter())\n // seto grid com filtro\n $this->setHasFilter(true);\n }\n\n return $this;\n }",
"function addFilter(FilterInterface $filter, $name = NULL);",
"protected function addFilters() {\n\n\t\t}",
"public function addToFilter_criteriaKeys($item)\n {\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new \\InvalidArgumentException(sprintf('The filter_criteriaKeys property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->filter_criteriaKeys[] = $item;\n return $this;\n }",
"private function applyFilter()\n {\n if (isset($this->filterData[$this->getName()])) {\n $value = $this->filterData[$this->getName()];\n\n if ($value) {\n $filter = $this->filterBuilder->setConditionType('eq')\n ->setField('customer_id')\n ->setValue($this->userContext->getUserId())\n ->create();\n\n $this->getContext()->getDataProvider()->addFilter($filter);\n }\n }\n }",
"public function &addInsertFilter($filter) {\n\t\t\tarray_push($this->add_access_filters, $filter);\n\t\t\treturn $this;\n\t\t}",
"public function testAddFilter()\n {\n $this->assertEmpty($this->Search->getConfig('filters'));\n\n $this->Search->addFilter('TestFilter1');\n\n $this->assertArrayHasKey('TestFilter1', $this->Search->getConfig('filters'));\n\n $_settings = [\n 'field' => 'TestFilter1',\n 'column' => 'TestFilter1',\n 'operator' => 'LIKE',\n 'attributes' => [\n 'label' => false,\n 'placeholder' => null\n ],\n 'options' => false\n ];\n\n $this->assertEquals($_settings, $this->Search->getConfig('filters.TestFilter1'));\n\n $this->Search->addFilter('TestFilter2', [\n 'field' => 'customField',\n 'column' => 'customColumn',\n 'operator' => '=',\n 'attributes' => [\n 'placeholder' => 'customPlaceHolder'\n ],\n 'options' => [\n 'Test1',\n 'Test2'\n ]\n ]);\n\n $_settings = [\n 'field' => 'customField',\n 'column' => 'customColumn',\n 'operator' => '=',\n 'attributes' => [\n 'placeholder' => 'customPlaceHolder'\n ],\n 'options' => [\n 'Test1',\n 'Test2'\n ]\n ];\n\n $this->assertEquals($_settings, $this->Search->getConfig('filters.TestFilter2'));\n }",
"public function addFilter(PHP_Depend_Util_FileFilter $filter)\n {\n $this->filter->append($filter);\n }",
"public function addFilters()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
internal function to autoload processors at runtime if required | protected function loadProcessor($class, $name)
{
if (!class_exists($class, false) && !function_exists($class)) {
try {
$this->dwoo->getLoader()->loadPlugin($name);
} catch (Dwoo_Exception $e) {
throw new Dwoo_Exception('Processor '.$name.' could not be found in your plugin directories, please ensure it is in a file named '.$name.'.php in the plugin directory');
}
}
if (class_exists($class, false)) {
return array(new $class($this), 'process');
}
if (function_exists($class)) {
return $class;
}
throw new Dwoo_Exception('Wrong processor name, when using autoload the processor must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Processor_name"');
} | [
"private function autoload()\n {\n global $config;\n foreach( $config['autoload'] as $type => $payload )\n {\n $funcName = 'load' . ucfirst( substr($type, 0, -1) );\n if( is_array($payload) ) {\n foreach($payload as $toLoad)\n {\n if(method_exists($this,$funcName)) {\n if( $type == 'helpers' ) {\n $this->$toLoad = call_user_func(array($this, $funcName), $toLoad);\n } elseif( $type == 'plugins' ) {\n call_user_func(array($this, $funcName), $toLoad);\n }\n }\n }\n }\n }\n }",
"private function load_processors() {\n\t\t/**\n\t\t * Runs before processors are loaded\n\t\t *\n\t\t * Uses \"caldera_forms_get_form_processors\" filter to add processors\n\t\t *\n\t\t * @since 1.3.5.3\n\t\t */\n\t\tdo_action( 'caldera_forms_pre_load_processors' );\n\n\t\t/**\n\t\t * Add processors\n\t\t *\n\t\t * @since 1.3.0\n\t\t *\n\t\t * @param array $processors\n\t\t */\n\t\t$processors = apply_filters( 'caldera_forms_get_form_processors', array() );\n\n\t\t$this->processors = array();\n\t\tif ( is_array( $processors ) && ! empty( $processors ) ){\n\t\t\tforeach ( $processors as $id => $processor ) {\n\t\t\t\t$processor = $this->validate_processor( $processor );\n\t\t\t\tif ( $processor ) {\n\t\t\t\t\t$this->processors[ $id ] = $processor;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Runs after processors are loaded\n\t\t *\n\t\t * Use: $processors = Caldera_Forms_Processor_Load::get_instance()->get_processors(); to get processors\n\t\t *\n\t\t * @since 1.3.5.3\n\t\t */\n\t\tdo_action( 'caldera_forms_post_load_processors' );\n\n\n\t}",
"public function createClassLoaders()\n {\n }",
"public function getProcessorsLoader()\n {\n if ($this->processorsLoader === null)\n {\n $processorsToFilter = $this->parameters['processors'];\n $this->processorsLoader = new PluginLoader(\n 'PieCrust\\\\Baker\\\\Processors\\\\IProcessor',\n PieCrustDefaults::APP_DIR . '/Baker/Processors',\n function ($p1, $p2) { return $p1->getPriority() < $p2->getPriority(); },\n $processorsToFilter == '*' ?\n null :\n function ($p) use ($processorsToFilter) { return in_array($p->getName(), $processorsToFilter); },\n 'SimpleFileProcessor.php'\n );\n foreach ($this->processorsLoader->getPlugins() as $proc)\n {\n $proc->initialize($this->pieCrust);\n }\n }\n return $this->processorsLoader;\n }",
"public function loadForRuntime(): void\n {\n $this->runConfigLoader(true);\n }",
"protected function load_process_classes() {\n\n NF_OnepageCRM::file_include('Comm', 'BuildRequestArray');\n NF_OnepageCRM::file_include('Comm', 'ValidateFields');\n NF_OnepageCRM::file_include('Comm', 'BuildFormattedRequest');\n NF_OnepageCRM::file_include('Comm', 'Create');\n NF_OnepageCRM::file_include('Comm', 'HandleResponse');\n }",
"public static function pre_process()\n\t{\n\t\tself::extract_bases();\n\t}",
"public function getProcessor();",
"protected function overrideLoaders() : void {\n\t\tforeach(spl_autoload_functions() as $func) {\n\t\t\t$this->functions[] = $func;\n\t\t\tspl_autoload_unregister($func);\n\t\t}\n\n\t\tspl_autoload_register([$this, \"autoload\"]);\n\t}",
"public function importAutoLoaders()\n {\n }",
"public function pre_system()\n {\n $GLOBALS['CFG'] =& load_class('Config', 'core');\n $GLOBALS['BM'] =& load_class('Benchmark', 'core');\n }",
"public static function init() {\n\t\t$loaders = spl_autoload_functions();\n\n\t\tforeach ($loaders as &$loader) {\n\t\t\t$loaderToUnregister = $loader;\n\n\t\t\t// Only hook onto SilverStripe's SS_ClassLoader.\n\t\t\tif (is_array($loader) && ($loader[0] instanceof SS_ClassLoader)) {\n\t\t\t\t$originalLoader = $loader[0];\n\n\t\t\t\t// Configure library loader for doctrine annotation loader\n\t\t\t\tAnnotationRegistry::registerLoader(function ($class) use ($originalLoader) {\n\t\t\t\t\t$originalLoader->loadClass($class);\n\n\t\t\t\t\treturn class_exists($class, false);\n\t\t\t\t});\n\t\t\t\t$loader[0] = new AopSilverStripeLoader($loader[0]);\n\t\t\t}\n\t\t\tspl_autoload_unregister($loaderToUnregister);\n\t\t}\n\t\tunset($loader);\n\n\t\tforeach ($loaders as $loader) {\n\t\t\tspl_autoload_register($loader);\n\t\t}\n\t}",
"public function registerAutoloaders() {}",
"function my_autoLoader($class){\r\n require $class . \".php\";\r\n}",
"public function getProcessorPlugins();",
"public static function registerAutoloaders () : void {\n\t\tforeach (self::instance ()->configurations as $conf) {\n\t\t\t$conf->setupAutoloader ();\n\t\t}\n\t\tspl_autoload_register (__CLASS__.'::autoloader');\n\t}",
"final public static function getLoaders()\n {\n return spl_autoload_functions();\n }",
"private function process_class_loader_path() {\n\t\t$i = $this->search_array();\n\t\tif ( false !== $i ) {\n\t\t\tif ( 'Postmedia' === $this->process_path[ $i + 1 ] ) {\n\t\t\t\t$i++;\n\t\t\t\t$cnt = count( $this->process_path );\n\t\t\t\tfor ( $i; $i <= $cnt; $i++ ) {\n\t\t\t\t\t// trim off each library directory, end trimming at the base directory\n\t\t\t\t\tarray_pop( $this->process_path );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function registerAutoloaders($callables){\n foreach ($callables as $callable) {\n spl_autoload_register($callable);\n }\n return spl_autoload_functions();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation invitationTicketsIdTargetTeamGet Fetches belongsTo relation targetTeam. | public function invitationTicketsIdTargetTeamGet($id, $refresh = null)
{
list($response) = $this->invitationTicketsIdTargetTeamGetWithHttpInfo($id, $refresh);
return $response;
} | [
"public function invitationTicketsIdTargetDesignMemberGet($id, $refresh = null)\n {\n list($response) = $this->invitationTicketsIdTargetDesignMemberGetWithHttpInfo($id, $refresh);\n return $response;\n }",
"public function teamMembersIdInvitationTicketsFkGet($id, $fk)\n {\n list($response) = $this->teamMembersIdInvitationTicketsFkGetWithHttpInfo($id, $fk);\n return $response;\n }",
"public function get($teamId);",
"public function invitationTicketsIdTargetPortalMemberGet($id, $refresh = null)\n {\n list($response) = $this->invitationTicketsIdTargetPortalMemberGetWithHttpInfo($id, $refresh);\n return $response;\n }",
"public function getAllTeamJoinRequests($teamId) {\n\t\t$data = $this->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t\"TeamMember.team_id\" => $teamId,\n\t\t\t\t\"TeamMember.status\" => self::STATUS_NOT_APPROVED,\n\t\t\t\t\"TeamMember.invited_by\" => NULL\n\t\t\t)\t\t\t\n\t\t));\n\t\treturn $data;\n\t}",
"public function getTeamId()\n {\n return $this->teamId;\n }",
"public function getTargetEntityId()\n {\n return $this->_targetEntityId;\n }",
"public function getTeamId(){\n\t\treturn($this->teamId);\n\t}",
"public function get_id_team()\n\t{\n\t\treturn $this->id_team;\n\t}",
"public function getMITargetTalentId()\n {\n return $this->get(self::M_ITARGETTALENTID);\n }",
"public function getTeamId()\n {\n return $this->teamid;\n }",
"public function getIdTeam()\n {\n return $this->idTeam;\n }",
"public function getTarget($target_id)\n {\n\t\tif (array_key_exists($target_id, $this->targets))\n\t\t{\n\t\t\treturn $this->targets[$target_id];\n\t\t}\n\t\treturn NULL;\n }",
"public function getTargetId()\n {\n return $this->_targetId;\n }",
"public function getTargetId()\n {\n return $this->target_id;\n }",
"public function getIdTarget()\n {\n return $this->id_target;\n }",
"public function getTargetActor()\n {\n return $this->target_actor;\n }",
"public function get_team($id) {\n foreach($this->data as $record) {\n if($record['id'] == $id) {\n return $record;\n }\n } \n return null;\n }",
"public function getTeamid()\r\n {\r\n return $this->teamid;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for putTranscoderTemplateAppAction . | public function testPutTranscoderTemplateAppAction()
{
} | [
"public function testPutTranscoderTemplateAction()\n {\n\n }",
"public function testPutTranscoderTemplateAppConfigAdv()\n {\n\n }",
"public function testPutTranscoderTemplateConfigAdv()\n {\n\n }",
"public function testGetTranscoderTemplateAppConfig()\n {\n\n }",
"public function testPutTranscoderEncodeAppConfigAdv()\n {\n\n }",
"public function testTemplatesIdReplacePost()\n {\n\n }",
"public function testGetTranscoderOverlayEncodeAppConfig()\n {\n\n }",
"public function testTemplateTagsIdPut()\n {\n\n }",
"public function testGetTranscoderEncodeAppConfig()\n {\n\n }",
"public function testUpdateTemplate()\n {\n }",
"public function testPutTranscoderOverlayEncodeConfig()\n {\n\n }",
"public function testPutSourceControlAction()\n {\n\n }",
"public function testPutTranscoderOverlayDecodeAppConfig()\n {\n\n }",
"public function testUpdateTemplate0()\n {\n }",
"public function testGetIntegrationsActionDraftTemplate()\n {\n }",
"public function testUpdateEntitlementTemplate()\n {\n }",
"public function testDeleteTranscoderOverlayEncodeAppConfig()\n {\n\n }",
"public function testTemplatesIdPermissionPost()\n {\n\n }",
"protected function putTranscoderTemplateAppActionRequest($server_name, $action, $vhost_name, $app_name, $template_name, $dst_entry_name = null)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling putTranscoderTemplateAppAction'\n );\n }\n // verify the required parameter 'action' is set\n if ($action === null || (is_array($action) && count($action) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $action when calling putTranscoderTemplateAppAction'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling putTranscoderTemplateAppAction'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling putTranscoderTemplateAppAction'\n );\n }\n // verify the required parameter 'template_name' is set\n if ($template_name === null || (is_array($template_name) && count($template_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $template_name when calling putTranscoderTemplateAppAction'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/transcoder/templates/{templateName}/actions/{action}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($dst_entry_name !== null) {\n $queryParams['dstEntryName'] = ObjectSerializer::toQueryValue($dst_entry_name);\n }\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($action !== null) {\n $resourcePath = str_replace(\n '{' . 'action' . '}',\n ObjectSerializer::toPathValue($action),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n // path params\n if ($template_name !== null) {\n $resourcePath = str_replace(\n '{' . 'templateName' . '}',\n ObjectSerializer::toPathValue($template_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Registers a game when using a set as class/array | public function __set(string $name, $value) {
if($value instanceof Game) {
if(!isset($this->gamesNames[$name])) {
$result = $this->getMain()->getDatabase()->get("*", ["table" => "Games"]);
$this->games[$result->num_rows] = $value;
$this->gamesNames[$value->getName()] = $result->num_rows;
$this->getMain()->getLogger()->notice("Succefully registered game level {$value->getName()}.");
}
} else {
throw new Exception("Value should be a game.");
}
} | [
"public static function GenerateSet( $game ) {\r\n\t\t$game_id = (integer)$game->Id;\r\n\t\t$sql = \"INSERT INTO `pawnsig`\r\n\t\t\t\t( `game_id`, `status`, `x`, `y`, `pawn_id` )\r\n\t\t\t\tSELECT '$game_id', 1, `startx`, `starty`, `id` FROM `pawns`\";\r\n\t\t\r\n\t\tmysql_query( $sql ) or die( mysql_error() );\r\n\t}",
"public function registerTeams(){\n\n $this->teams = [1 => new Team(1, \"blue\", TextFormat::BLUE, Color::toDecimal(Color::BLUE),$this->plugin),\n 2 => new Team(2, \"red\", TextFormat::RED, Color::toDecimal(Color::RED), $this->plugin),\n 3 => new Team(3, \"yellow\", TextFormat::YELLOW, Color::toDecimal(Color::YELLOW), $this->plugin),\n 4 => new Team(4, \"green\", TextFormat::GREEN, Color::toDecimal(Color::GREEN), $this->plugin)];\n }",
"public function __construct()\n {\n $this->gameArea = array();\n\n for ($row = 0; $row < 10; $row++) {\n\n $temp = array();\n for ($column = 0; $column < 20; $column++) {\n $temp[] = new GameObject(); // Randomize the game object type.\n }\n $this->gameArea[] = $temp;\n }\n\t\t// TODO: collect stats on mine/empty ratio\n }",
"public function defineSets();",
"public function new_game($game)\n {\n $this->game = $game;\n }",
"private function addSoldier()\n {\n switch(rand(0, 19))\n {\n case 0: { array_push($this->_soldiers, new Navy($this)); $this->_stats[\"ship\"]++; break; }\n case 1: \n case 2: { array_push($this->_soldiers, new Helicopter($this)); $this->_stats[\"hellicopter\"]++; break; }\n case 3:\n case 4: \n case 5:\n case 6: { array_push($this->_soldiers, new Tank($this)); $this->_stats[\"tank\"]++; break; }\n case 7: { array_push($this->_soldiers, new Airforce($this)); $this->_stats[\"airplane\"]++; break; }\n default: { array_push($this->_soldiers, new Soldier($this)); $this->_stats[\"soldier\"]++; break; }\n }\n }",
"public function setupGame(): Game;",
"public static function define_set($name, $arr_services) {\r\n\t\tself::$defined_sets[$name] = $arr_services;\r\n\t}",
"function matchSet() {\n self::checkAction( 'match' );\n $traitset = $this->getMatchingCollectedTrait('guesser_identity');\n if ($traitset == null) {\n throw new BgaUserException(self::_(\"No matching set!\"));\n }\n\n $this->scoreSet(GUESSER, $traitset, 2);\n }",
"public function getGame();",
"private function storeGame()\n {\n $_SESSION['game'] = array(\n 'remaining_ships' => $this->remainingShips,\n 'player_turns' => $this->playerTurns,\n 'ships' => $this->ships,\n 'board' => $this->board\n );\n }",
"public function __setIdGame($idGame){\n \t$this->idGame = $idGame;\n }",
"private function generateGames() {\n\t\n\t}",
"public function __setIdGame($idGame){\n\t$this->idGame = $idGame;\n }",
"function createChampion($data)\n {\n //loop trough every set in array\n foreach($data as $key => $val)\n {\n //check if this class has a variable with the same name as the key in the array\n if(property_exists ('champion', $key))\n {\n //if true we set this class variable with that name with the data from the database\n $this->$key = $val;\n }\n }\n }",
"function addSuicide(){\n\t\t\t$this->player_suicides += 1;\n\t\t}",
"protected function register()\n {\n $className = get_class($this);\n self::$_cacheList[$className] = $this;\n }",
"public function buildIt(){\n\t\tfor($i=0;$i<40;$i++){\n\n\t\t\t$this->cardSet[$i] = new Creature(\"black\");\n\t\t}\n\t\tfor($i=40;$i<80;$i++){\n\n\t\t\t$this->cardSet[$i] = new Creature(\"white\");\n\t\t}\n\t\tfor($i=79;$i<120;$i++){\n\n\t\t\t$this->cardSet[$i] = new Creature(\"green\");\n\t\t}\n\t\tfor($i=119;$i<160;$i++){\n\n\t\t\t$this->cardSet[$i] = new Creature(\"red\");\n\t\t}\n\n\t}",
"function stBirths(){\n $this->gamestate->setAllPlayersMultiactive();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the display of the configuration. | public function get_display() {
// return $this->config_backend->view->display_handler;
return $this->config_backend->get_display();
} | [
"public static function configShow()\n {\n $client = self::setClient();\n $response = $client->request('POST', 'config/show');\n $output = htmlentities($response->getBody());\n return $output;\n }",
"function showConf() {\r\n echo \"<pre>\"; print_r($this->conf); echo \"</pre>\\n\";\r\n }",
"function printConfig() {\n\t\techo \"<HR><PRE>\";\n\t\tprint_r($this->config);\n\t\techo \"</PRE>\";\n\t}",
"public function getConfigurationInfo()\n {\n return '';\n }",
"protected function outputConfiguration() {\n\t\t$this->outputNotificationsInCategories();\n\t\t$this->outputNotificationsInSections();\n\t\t$this->outputAvailability();\n\t\t$this->outputMandatory();\n\t\t$this->outputEnabledDefault();\n\t}",
"public static function display_configuration_page() {\n\t\t$api_key = Latestnews::get_api_key();\n\t\t\n\t\t$latestnews = Latestnews::get_latestnews_options();\n\t\t\t\t\t\t\t\n\t\tLatestnews::log( compact( 'stat_totals', 'latestnews' ) );\n\t\tLatestnews::view( 'config', compact( 'latestnews', 'notices' ) );\n\t}",
"public function moduleConfig(){\n $this->display();\n }",
"public static function config_text() {\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 }",
"public function getConfigurationAsString()\n {\n }",
"private function print_config() {\n\t\techo(\"Config\\n\");\n\t\t$this->print_config_item($this->report_missing_file_comments, 'File Comments');\n\t\t$this->print_config_item($this->report_missing_class_comments, 'Class Comments');\n\t\t$this->print_config_item($this->report_missing_interface_comments, 'Interface Comments');\n\t\t$this->print_config_item($this->report_missing_class_var_comments, 'Class Variable Comments');\n\t\t$this->print_config_item($this->report_missing_class_const_comments, 'Class Constant Comments');\n\t\t$this->print_config_item($this->report_missing_constant_comments, 'Constant Comments');\n\t\t$this->print_config_item($this->report_missing_function_comments, 'Function Comments');\t\t\n\t}",
"public static function display_settings_section() {}",
"public function display(){\n\t\t\t\t\t\n\t\t\t// returns all values\n\t\t\treturn $this->_params[\"display\"];\n\t\t\t\n\t\t}",
"public function display_settings_section() {}",
"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}",
"public function displayDemoNotice()\n {\n return Mage::getStoreConfig('design/head/demonotice');\n }",
"public function getConfigs() {\n\t\t$html = \"\";\n\t\tforeach($this -> configs as $config) {\n\t\t\t$html .= $config -> getTableContent();\n\t\t}\n\t\treturn $html;\n\t}",
"public function display(){\n\t\treturn \"<strong>\" . $this->getKey() . \":</strong> \" . $this->getValue();\n\t}",
"public function getDetail() {\n _view('flow/config/detail', $data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get html from doc. | public function getHtml(Doc $doc); | [
"public function html(){\n $content = new Parsedown();\n return $content->text($this->content);\n }",
"function getHTML()\n {\n switch($this->method){\n case \"snoopy\":\n return $this->_getHTMLFromURL_snoopy();\n break;\n case \"file_get_contents\":\n return $this->_getHTMLFromURL_fgc();\n break;\n default:\n return $this->_getHTMLFromURL_fgc();\n\n }\n }",
"protected function getDocument($html = null){\n\t\tif(!$html)\n\t\t\t$html = $this->html;\n\t\t\n\t\t$doc = new \\DomDocument();\n\n\t\tif(extension_loaded('mbstring'))\n\t\t\t$html = \\mb_convert_encoding($html, 'HTML-ENTITIES', \"UTF-8\");\n\t\t\n\t\t$doc->loadHtml($html);\n\t\t$doc->encoding = 'utf-8';\n\t\t\n\t\treturn $doc;\n\t}",
"protected function parseHtml()\n {\n $parser = new Parser($this->htmlStringOrFile);\n $document = $parser->setTableClass($this->tableClass)\n ->setRowClass($this->rowClass)\n ->setCellClass($this->cellClass)\n ->parse();\n\n $this->document = $document;\n\n return $document;\n }",
"private function getHTML($url) {\n return file_get_contents($url);\n }",
"public function getDocument()\n {\n //URL of targeted site\n $ch = curl_init();\n\n // set URL and other appropriate options\n curl_setopt($ch, CURLOPT_URL, $this->url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n\n // grab URL and pass it to the browser\n\n $this->document = curl_exec($ch);\n\n //echo $output;\n\n // close curl resource, and free up system resources\n curl_close($ch);\n\n }",
"public function getHtmlContent()\n {\n $stream = $this->getHtmlStream();\n if ($stream === null) {\n return null;\n }\n return stream_get_contents($stream);\n }",
"private function getDomDoc(){\n\t\t\t\n\t\t\t//LOGIC\n\t\t\t\n\t\t\t// if not exist yet, create the domdoc\n\t\t\tif ( is_null($this->domdoc) ){\n\t\t\t\t$this->domdoc = new DOMDocument();\n\t\t\t\t@$this->domdoc->loadHTMLFile($this->url);\n\t\t\t} \n\t\t\t\n\t\t\treturn $this->domdoc;\n\t\t}",
"public function getHtmlSource();",
"public function load_html() {\n\t\treturn file_get_contents( $this->html_file_path );\n\t}",
"function getDom($html)\n\t{\n\t\t$dom = str_get_html($html);\n\t\treturn $dom;\n\t}",
"private function getDocument() {\n return <<<DOCUMENT\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>%TITLE%</title>\n <style type=\"text/css\">\n dt { font-weight: bold; }\n </style>\n </head>\n <body>\n <h1>%TITLE%</h1>\n %BODY%\n </body>\n</html>\nDOCUMENT;\n }",
"public function getHtml()\n {\n return $this->parser->text($this->getBody());\n }",
"protected function __get_html() {\n\t\t\treturn \\ChickenWire\\Util\\Html::instance();\n\t\t}",
"public function loadHtml()\n\t {\n\t\t$http = new HTTPclient($this->link, [], $this->headers);\n\t\tif ($this->proxy === true)\n\t\t {\n\t\t\t$this->html = $http->getWithProxy();\n\t\t }\n\t\telse\n\t\t {\n\t\t\t$this->html = $http->get();\n\t\t } //end if\n\n\t\tif ($this->gzdecode === true)\n\t\t {\n\t\t\t$this->html = gzdecode($this->html);\n\t\t } //end if\n\n\t\t$this->_xml->newElement(\"html\", base64_encode($this->html));\n\t\t$this->doc = $this->_xml->getDoc();\n\t }",
"protected function getHtmlContent()\n {\n return file_get_contents($this->getFilename());\n }",
"public function loadHTML();",
"public function getHTML() {\n $html_filename = $this->game->directory . $this->html_file;\n \n if(! file_exists($html_filename)) {\n throw new Exception(\"HTML file $html_filename does not exist\");\n }\n \n return file_get_contents($html_filename);\n }",
"public function getHTMLContent() {\n\t\t$html = $this->parseText($this->content);\n\t\treturn $html;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears out the collHbfComandassRelatedByIdUserModified collection This does not modify the database; however, it will remove any associated objects, causing them to be refetched by subsequent calls to accessor method. | public function clearHbfComandassRelatedByIdUserModified()
{
$this->collHbfComandassRelatedByIdUserModified = null; // important to set this to NULL since that means it is uninitialized
} | [
"public function clearHbfPrepagossRelatedByIdUserModified()\n {\n $this->collHbfPrepagossRelatedByIdUserModified = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearCiSettingssRelatedByIdUserModified()\n {\n $this->collCiSettingssRelatedByIdUserModified = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearHbfProductossRelatedByIdUserCreated()\n {\n $this->collHbfProductossRelatedByIdUserCreated = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearContactsRelatedByUpdatedBy()\n {\n $this->collContactsRelatedByUpdatedBy = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearHbfTurnossRelatedByIdUserCreated()\n {\n $this->collHbfTurnossRelatedByIdUserCreated = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearHbfVentassRelatedByIdUserCreated()\n {\n $this->collHbfVentassRelatedByIdUserCreated = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearHbfEgresossRelatedByIdUserCreated()\n {\n $this->collHbfEgresossRelatedByIdUserCreated = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearAudiosRelatedByUserId()\n\t{\n\t\t$this->collAudiosRelatedByUserId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearHbfVasossRelatedByIdUserCreated()\n {\n $this->collHbfVasossRelatedByIdUserCreated = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearHbfComandassRelatedByIdCliente()\n {\n $this->collHbfComandassRelatedByIdCliente = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearCartsRelatedByUserId()\n {\n $this->collCartsRelatedByUserId = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearHbfPrepagossRelatedByIdUserCreated()\n {\n $this->collHbfPrepagossRelatedByIdUserCreated = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearHbfTurnossRelatedByIdAsociado()\n {\n $this->collHbfTurnossRelatedByIdAsociado = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearUserEquipements()\n\t{\n\t\t$this->collUserEquipements = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearContactsRelatedByCreatedBy()\n {\n $this->collContactsRelatedByCreatedBy = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearPermissaosRelatedByCoUsuarioAlteracao()\n\t{\n\t\t$this->collPermissaosRelatedByCoUsuarioAlteracao = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearPicturesRelatedByUserid()\n\t{\n\t\t$this->collPicturesRelatedByUserid = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearMensajesRelatedByUsuarioReceptor()\n {\n $this->collMensajesRelatedByUsuarioReceptor = null; // important to set this to null since that means it is uninitialized\n $this->collMensajesRelatedByUsuarioReceptorPartial = null;\n }",
"public function clearUsersRelatedByUser2Id()\n\t{\n\t\t$this->collUsersRelatedByUser2Id = null; // important to set this to NULL since that means it is uninitialized\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add filter by store views to a collection | public function addStoreFilter($collection)
{
$collection->addStoreFilter($this->_role->getStoreIds());
} | [
"abstract public function addStoreFilter($store, $withAdmin = true);",
"public function addStoreAttributeToFilter($collection)\n {\n $collection->addAttributeToFilter('store_id', ['in' => $this->_role->getStoreIds()]);\n }",
"public function getStoreCollection()\n {\n return Mage::getModel('core/store')\n ->getCollection()\n ->addWebsiteFilter($this->getId());\n }",
"public function addStoreFilter($store, $withAdmin = true)\n { \n if ($store instanceof Mage_Core_Model_Store) {\n $store = array($store->getId());\n }\n\n if (!is_array($store)) {\n $store = array($store);\n }\n\n if ($withAdmin) {\n $store[] = Mage_Core_Model_App::ADMIN_STORE_ID;\n }\n $this->addFilter('store', array('in' => $store), 'public');\n\n return $this;\n }",
"public function storeViews() {\n\t\t$result = array();\n\t\tforeach (Mage::getModel('core/store')->getCollection() as $storeView) {\n\t\t\t$result[] = $storeView->toArray();\n\t\t}\n\t\treturn $result;\n\t}",
"public function addVisibleInSearchFilterToCollection(Mage_Eav_Model_Entity_Collection_Abstract $collection)\n {\n $collection->setVisibility($this->getVisibleInSearchIds());\n //$collection->addAttributeToFilter('visibility', array('in'=>$this->getVisibleInSearchIds()));\n return $this;\n }",
"public function getFilterCollection();",
"public function filter()\n {\n $this->items->filter([$this->filter, 'viewable']);\n }",
"public function setFilters(array $filters): Collection\n {\n }",
"public function addStoreFilter($storeIds){\n\t\t$this->getSelect()->where('main_table.store_id IN (?)', $storeIds);\n\t\treturn $this;\n\t}",
"public function limitStores($collection)\n {\n // Changed from filter by store id bc of case when\n // user creating new store view for allowed store group\n $collection->addGroupFilter(array_merge($this->_role->getStoreGroupIds(), [0]));\n }",
"public function addStoreFilter($store)\n {\n\t\tif (!Mage::app()->isSingleStoreMode()) {\n\t\t\tif ($store instanceof Mage_Core_Model_Store) {\n\t\t\t\t$store = array($store->getId());\n\t\t\t}\n\t\n\t\t\t$this->getSelect()->joinLeft(\n\t\t\t\tarray('store_table' => $this->getTable('store')),\n\t\t\t\t'main_table.post_id = store_table.post_id',\n\t\t\t\tarray()\n\t\t\t)\n\t\t\t->where('store_table.store_id in (?)', array(0, $store));\n\t\n\t\t\treturn $this;\n\t\t}\n\t\treturn $this;\n\t}",
"public function addStoreFilter($store)\n {\n // if (!$this->context->getStoreManager()->isSingleStoreMode()) {\n if ($store instanceof \\Magento\\Store\\Model\\Store) {\n $store = [$store->getId()];\n }\n\n $this->getSelect()\n ->join(\n ['store_table' => $this->getTable('mst_seo_rewrite_store')],\n 'main_table.rewrite_id = store_table.rewrite_id',\n []\n )\n ->where('store_table.store_id in (?)', [0, $store]);\n\n return $this;\n }",
"public function addStoreFilter($storeIds)\n {\n $this->getSelect()->where('main_table.store_id IN (?)', $storeIds);\n return $this;\n }",
"public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }",
"public function addStoreFilter($storeIds)\n {\n $this->addFieldToFilter('main_table.store_id', array('in'=>$storeIds));\n return $this;\n }",
"protected function _applyStoresFilter()\n {\n $nullCheck = false;\n $storeIds = $this->_storesIds;\n if (!is_array($storeIds)) {\n $storeIds = array($storeIds);\n }\n $storeIds = array_unique($storeIds);\n if ($index = array_search(null, $storeIds)) {\n unset($storeIds[$index]);\n $nullCheck = true;\n }\n if ($nullCheck) {\n $this->getSelect()->where('mo.store_id IN(?) OR mo.store_id IS NULL', $storeIds);\n } elseif ($storeIds[0] != '') {\n $this->getSelect()->where('mo.store_id IN(?)', $storeIds);\n }\n return $this;\n }",
"public function filterByView($view, $comparison = null)\n {\n if ($view instanceof View) {\n return $this\n ->addUsingAlias(WorksheetPeer::ID, $view->getWorksheetId(), $comparison);\n } elseif ($view instanceof PropelObjectCollection) {\n return $this\n ->useViewQuery()\n ->filterByPrimaryKeys($view->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByView() only accepts arguments of type View or PropelCollection');\n }\n }",
"protected function _prepareCollection()\r\n {\r\n $collection = Mage::getResourceModel('customer/attribute_collection');\r\n //->addVisibleFilter();\r\n //echo \"<pre>\" . ($collection->getSelect());\r\n $this->setCollection($collection);\r\n return parent::_prepareCollection();\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if something is shown before something else in a given region. Useful for checking if the sorting of a view is working. | public function iShouldSeeBeforeInTheRegion($arg1, $arg2, $region)
{
//Get the text from the region
$regionObj = $this->getRegion($region);
$text = $regionObj->getText();
// get the strong positions of each of the strings given
$strpos_first = strpos($text,$arg1);
$strpos_second = strpos($text,$arg2);
// If the first string is in a higher number position than the second one
// they are in the wrong order.
if ($strpos_first > $strpos_second) {
throw new \Exception(sprintf("%s is not being shown before %s in the %s region",$arg1,$arg2,$region));
}
} | [
"public function isBeforeVat() : bool\n {\n return true;\n }",
"public function isBeforeVat() : bool\n {\n return false;\n }",
"public function validateRegion()\n\t{\n\t\t$region = trim($this->region);\n\t\t\n\t\t$sql = \"SELECT * FROM region WHERE region.title = '\" . $region . \"';\";\n\n\t\t$result = $this->connect()->query($sql);\n\t\tif (!empty($result)) {\n\t\t\t$fetchPrev = $result->fetch_assoc()['title'];\n\t\t\tif ($fetchPrev == $region) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\t\t\n\t\t\n\t}",
"function asu_brand_is_header_visible($elements) {\n $module_name = basename(__FILE__, '.gtm.inc');\n foreach ($elements as $region_key => $region) {\n if (($region_key[0] != '#') && is_array($region)) {\n foreach ($region as $block_key => $block) {\n if ($block_key == $module_name.'_'.ASU_BRAND_HEADER_DELTA) {\n return TRUE;\n }\n }\n }\n }\n return false;\n}",
"public function shouldBeShownLater(): bool\n {\n if (! isset($this->conditions['time']['later'])) {\n return false;\n }\n\n\t return Time::now()->getTimestamp() < $this->conditions['time']['later']['ts'];\n }",
"function pixelgrade_portfolio_items_title_alignment_nearby_control_show() {\n\t$position = pixelgrade_option( 'portfolio_items_title_position' );\n\t// We hide it when displaying as overlay\n\tif ( 'overlay' === $position ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function hasPrevious() {\n return $this->details['curPage'] != $this->details['prevPage'];\n }",
"public function isExactlyAbove($page)\n\t{\n\t\treturn $this->getRight() == $page->getLeft() - 1;\n\t}",
"function pixelgrade_woocommerce_items_title_alignment_nearby_control_show() {\n\t$position = pixelgrade_option( 'woocommerce_items_title_position' );\n\t// We hide it when displaying as overlay\n\tif ( 'overlay' === $position ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function isPlaced() :bool ;",
"public function isBefore($index): bool;",
"public function isArrangeMode()\n {\n /** @var Concrete\\Core\\Page\\Page $instance */\n return $instance->isArrangeMode();\n }",
"function HasGripperTop(){}",
"public function IsRegion(){\n\t\t$region = true;\n\t\tif($this->AddressLine1Visible)\n\t\t\t$region = false;\n\n\t\tif($this->AddressLine2Visible)\n\t\t\t$region = false;\n\n\t\treturn $region;\n\t}",
"static function atTop(): bool\n {\n return Settings::get('pagingmode') == 1 || Settings::get('pagingmode') == 2;\n }",
"public function testRegionChanges() {\n $this->drupalGet('admin/structure/types/manage/article/display');\n $this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());\n $this->assertSession()->optionExists('fields[body][region]', 'content');\n\n \\Drupal::state()->set('field_layout_test.alter_regions', TRUE);\n \\Drupal::service('plugin.cache_clearer')->clearCachedDefinitions();\n\n $this->drupalGet('admin/structure/types/manage/article/display');\n $this->assertEquals(['Foo', 'Disabled'], $this->getRegionTitles());\n $this->assertSession()->optionExists('fields[body][region]', 'hidden');\n }",
"function is_above($line, $locx, $locy) {\n\t\treturn (($line[1]['x'] - $line[0]['x'])*($locy - $line[0]['y']) - ($line[1]['y'] - $line[0]['y'])*($locx - $line[0]['x'])) > 0;\n\t}",
"protected function _isNeedToShow()\n {\n if (!$this->_isModuleEnabled()) {\n return false;\n }\n\n if (!$this->_isParallaxBlockEnabled()) {\n return false;\n }\n\n return true;\n }",
"function region_has_content($region='default' /*...*/) {\n return CAmvc::Instance()->views->RegionHasView(func_get_args());\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as topRatedSellerDetails Contains Top Rated Seller program details for the seller. | public function getTopRatedSellerDetails()
{
return $this->topRatedSellerDetails;
} | [
"public function setTopRatedSellerDetails(array $topRatedSellerDetails)\n {\n $this->topRatedSellerDetails = $topRatedSellerDetails;\n return $this;\n }",
"public function getBusinessSellerDetails()\n {\n return $this->businessSellerDetails;\n }",
"public function getIsTopSeller()\n {\n return $this->isTopSeller;\n }",
"public function sellerdisplay($sellerId, $storeId) {\n $sellerDetail = array ();\n $sellerDetail = Mage::getModel ( 'marketplace/sellerprofile' )->load ( $sellerId, static::SELLER_ID )->getData ();\n \n /**\n * load customer info\n */\n $customerInfo = Mage::getModel ( 'customer/customer' )->load ( $sellerDetail [static::SELLER_ID] );\n // get seller email\n $sellerDetail ['email'] = $customerInfo->getEmail ();\n // get seller name\n $sellerDetail ['name'] = $customerInfo->getName ();\n \n if ($sellerDetail ['country']) {\n $country = Mage::getModel ( 'directory/country' )->loadByCode ( $sellerDetail ['country'] );\n // get country name\n $sellerDetail ['country_name'] = $country->getName ();\n }\n $sellerDetail ['store_logo'] = Mage::getBaseUrl ( 'media' ) . DS . 'marketplace/resized/' . $sellerDetail ['store_logo'];\n $sellerDetail ['store_banner'] = Mage::getBaseUrl ( 'media' ) . DS . 'marketplace/resized/' . $sellerDetail ['store_banner'];\n $sellerDetail ['summary_rating'] = strval ( Mage::getModel ( static::LOGIN_METHODS )->averageRatings ( $sellerId, $storeId ) );\n $sellerDetail [static::RATINGS] = strval ( Mage::getModel ( static::LOGIN_METHODS )->getReviewsCount ( $sellerId, $storeId ) );\n return $sellerDetail;\n }",
"public function get_top_sellers2()\n\t{\n\t\t$this->db->select('vendor.vendor_id, vendor.vendor_store_name')->from('vendor')->where(\"vendor.vendor_status = 1\")->order_by(\"vendor_store_name\", 'ASC');\n\t\t$query = $this->db->get('',10);\n\t\t\n\t\treturn $query;\n\t}",
"public function getSeller()\n {\n return $this->seller;\n }",
"public function getSellerCode()\n {\n return $this->sellerCode;\n }",
"public function getSellerData()\n {\n $sellerId = $this->getCustomerId();\n $model = $this->getSellerCollectionObj($sellerId);\n return $model;\n }",
"public function getBestOfferDetails()\n {\n return $this->bestOfferDetails;\n }",
"public function getSellerId()\n {\n return $this->seller_id;\n }",
"public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }",
"public function getUpdateSellerInfo()\n {\n return $this->updateSellerInfo;\n }",
"public function getResponseSeller()\n {\n return $this->response_seller;\n }",
"public function getSellerName()\n {\n return $this->seller_name;\n }",
"public static function seller(){\n\n return DBHelper::getArrayRow('*', self::$table_seller);\n\n }",
"private function get_top_sellers()\n {\n global $wpdb;\n\n // $query = array();\n // $query['fields'] = \"SELECT SUM( order_item_meta.meta_value ) as qty, order_item_meta_2.meta_value as product_id\n // FROM {$wpdb->posts} as posts\";\n // $query['join'] = \"INNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON posts.ID = order_id \";\n // $query['join'] .= \"INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id \";\n // $query['join'] .= \"INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_2 ON order_items.order_item_id = order_item_meta_2.order_item_id \";\n // $query['where'] = \"WHERE posts.post_type IN ( '\" . implode(\"','\", wc_get_order_types('order-count')) . \"' ) \";\n // $query['where'] .= \"AND posts.post_status IN ('wc-processing','wc-completed') \";\n // $query['where'] .= \"AND order_item_meta.meta_key = '_qty' \";\n // $query['where'] .= \"AND order_item_meta_2.meta_key = '_product_id' \";\n // $query['groupby'] = 'GROUP BY product_id';\n // $query['orderby'] = 'ORDER BY qty DESC';\n // $query['limits'] = 'LIMIT ' . $this->top_seller_limit;\n\n // return $wpdb->get_results(implode(' ', $query));\n\n // $top_sellers = $wpdb->get_results(\n // $wpdb->prepare(\n // \"SELECT p.ID\n // FROM {$wpdb->prefix}posts p\n // INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim\n // ON p.ID = oim.meta_value\n // INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim2\n // ON oim.order_item_id = oim2.order_item_id\n // INNER JOIN {$wpdb->prefix}woocommerce_order_items oi\n // ON oim.order_item_id = oi.order_item_id\n // INNER JOIN {$wpdb->prefix}posts as o\n // ON o.ID = oi.order_id\n // WHERE p.post_type = 'product'\n // AND p.post_status = 'publish'\n // AND o.post_status IN ('wc-processing','wc-completed')\n // AND oim.meta_key = '_product_id'\n // AND oim2.meta_key = '_qty'\n // AND p.ID NOT IN (\n // SELECT DISTINCT object_id\n // FROM {$wpdb->prefix}term_relationships\n // WHERE term_taxonomy_id = %d\n // )\n // GROUP BY p.ID\n // ORDER BY COUNT(oim2.meta_value) * 1 DESC\n // LIMIT %d\",\n // [$this->point_cat, $this->top_seller_limit]\n // )\n // );\n\n $top_sellers = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT p.post_id\n FROM {$wpdb->prefix}postmeta AS p\n WHERE\n p.meta_key = 'total_sales' AND\n p.post_id NOT IN (\n SELECT DISTINCT t.object_id\n FROM {$wpdb->prefix}term_relationships AS t\n WHERE t.term_taxonomy_id = %d\n )\n ORDER BY p.meta_value * 1 DESC\n LIMIT %d\",\n [$this->point_cat, $this->top_seller_limit]\n )\n );\n\n return $top_sellers;\n }",
"public function top_rated_seller()\n {\n \n //Display Order List\n $all_latest_orders = DB::table('orders')\n ->join('users', 'orders.customer_id', '=', 'users.id')\n ->select('orders.*', 'users.name')\n ->get();\n return view('admin.order.top_rated_customer', compact('all_latest_orders'));\n \n }",
"public function getTopSellerProducts() {\n\n\t\t$scope = ['products.*'];\n\n\t\t$filters = [\n\t\t\t'sort' => 'order_detail_count'\n\t\t];\n\n\t\treturn $this->getProductsForFilter($scope, $filters);\n\t}",
"public function getPostalCodeSeller()\n {\n return $this->postal_code_seller;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getNetworkSwitchRoutingMulticastRendezvousPoint' | protected function getNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $rendezvous_point_id)
{
// verify the required parameter 'network_id' is set
if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $network_id when calling getNetworkSwitchRoutingMulticastRendezvousPoint'
);
}
// verify the required parameter 'rendezvous_point_id' is set
if ($rendezvous_point_id === null || (is_array($rendezvous_point_id) && count($rendezvous_point_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $rendezvous_point_id when calling getNetworkSwitchRoutingMulticastRendezvousPoint'
);
}
$resourcePath = '/networks/{networkId}/switch/routing/multicast/rendezvousPoints/{rendezvousPointId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($network_id !== null) {
$resourcePath = str_replace(
'{' . 'networkId' . '}',
ObjectSerializer::toPathValue($network_id),
$resourcePath
);
}
// path params
if ($rendezvous_point_id !== null) {
$resourcePath = str_replace(
'{' . 'rendezvousPointId' . '}',
ObjectSerializer::toPathValue($rendezvous_point_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
if($headers['Content-Type'] === 'application/json') {
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass) {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
// array has no __toString(), so we should encode it manually
if(is_array($httpBody)) {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
}
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');
if ($apiKey !== null) {
$headers['X-Cisco-Meraki-API-Key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function getNetworkSwitchRoutingMulticastRendezvousPointsRequest($network_id)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling getNetworkSwitchRoutingMulticastRendezvousPoints'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/routing/multicast/rendezvousPoints';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function createNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $create_network_switch_routing_multicast_rendezvous_point)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling createNetworkSwitchRoutingMulticastRendezvousPoint'\n );\n }\n // verify the required parameter 'create_network_switch_routing_multicast_rendezvous_point' is set\n if ($create_network_switch_routing_multicast_rendezvous_point === null || (is_array($create_network_switch_routing_multicast_rendezvous_point) && count($create_network_switch_routing_multicast_rendezvous_point) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_network_switch_routing_multicast_rendezvous_point when calling createNetworkSwitchRoutingMulticastRendezvousPoint'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/routing/multicast/rendezvousPoints';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($create_network_switch_routing_multicast_rendezvous_point)) {\n $_tempBody = $create_network_switch_routing_multicast_rendezvous_point;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 }",
"protected function deleteNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $rendezvous_point_id)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling deleteNetworkSwitchRoutingMulticastRendezvousPoint'\n );\n }\n // verify the required parameter 'rendezvous_point_id' is set\n if ($rendezvous_point_id === null || (is_array($rendezvous_point_id) && count($rendezvous_point_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rendezvous_point_id when calling deleteNetworkSwitchRoutingMulticastRendezvousPoint'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/routing/multicast/rendezvousPoints/{rendezvousPointId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n // path params\n if ($rendezvous_point_id !== null) {\n $resourcePath = str_replace(\n '{' . 'rendezvousPointId' . '}',\n ObjectSerializer::toPathValue($rendezvous_point_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getNetworkSwitchRoutingMulticastRequest($network_id)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling getNetworkSwitchRoutingMulticast'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/routing/multicast';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createNetworkSwitchRoutingMulticastRendezvousPointAsyncWithHttpInfo($network_id, $create_network_switch_routing_multicast_rendezvous_point)\n {\n $returnType = 'object';\n $request = $this->createNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $create_network_switch_routing_multicast_rendezvous_point);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function createNetworkSwitchRoutingMulticastRendezvousPointWithHttpInfo($network_id, $create_network_switch_routing_multicast_rendezvous_point)\n {\n $returnType = 'object';\n $request = $this->createNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $create_network_switch_routing_multicast_rendezvous_point);\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 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function updateNetworkSwitchRoutingMulticastRequest($network_id, $update_network_switch_routing_multicast = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkSwitchRoutingMulticast'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/routing/multicast';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_switch_routing_multicast)) {\n $_tempBody = $update_network_switch_routing_multicast;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 }",
"public function getNetworkSwitchRoutingMulticastRendezvousPointsWithHttpInfo($network_id)\n {\n $returnType = 'object';\n $request = $this->getNetworkSwitchRoutingMulticastRendezvousPointsRequest($network_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function route(){\n return new Mapi_Ip_Route($this->param);\n }",
"public function getNetworkSwitchRoutingMulticastRendezvousPointWithHttpInfo($network_id, $rendezvous_point_id)\n {\n $returnType = 'object';\n $request = $this->getNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $rendezvous_point_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listTransitRouterMulticastGroupsWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->clientToken)) {\n $query['ClientToken'] = $request->clientToken;\n }\n if (!Utils::isUnset($request->groupIpAddress)) {\n $query['GroupIpAddress'] = $request->groupIpAddress;\n }\n if (!Utils::isUnset($request->isGroupMember)) {\n $query['IsGroupMember'] = $request->isGroupMember;\n }\n if (!Utils::isUnset($request->isGroupSource)) {\n $query['IsGroupSource'] = $request->isGroupSource;\n }\n if (!Utils::isUnset($request->maxResults)) {\n $query['MaxResults'] = $request->maxResults;\n }\n if (!Utils::isUnset($request->networkInterfaceIds)) {\n $query['NetworkInterfaceIds'] = $request->networkInterfaceIds;\n }\n if (!Utils::isUnset($request->nextToken)) {\n $query['NextToken'] = $request->nextToken;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->peerTransitRouterMulticastDomains)) {\n $query['PeerTransitRouterMulticastDomains'] = $request->peerTransitRouterMulticastDomains;\n }\n if (!Utils::isUnset($request->resourceId)) {\n $query['ResourceId'] = $request->resourceId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->resourceType)) {\n $query['ResourceType'] = $request->resourceType;\n }\n if (!Utils::isUnset($request->transitRouterAttachmentId)) {\n $query['TransitRouterAttachmentId'] = $request->transitRouterAttachmentId;\n }\n if (!Utils::isUnset($request->transitRouterMulticastDomainId)) {\n $query['TransitRouterMulticastDomainId'] = $request->transitRouterMulticastDomainId;\n }\n if (!Utils::isUnset($request->vSwitchIds)) {\n $query['VSwitchIds'] = $request->vSwitchIds;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'ListTransitRouterMulticastGroups',\n 'version' => '2017-09-12',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return ListTransitRouterMulticastGroupsResponse::fromMap($this->callApi($params, $req, $runtime));\n }",
"public function getNetworkSwitchRoutingMulticastRendezvousPointAsyncWithHttpInfo($network_id, $rendezvous_point_id)\n {\n $returnType = 'object';\n $request = $this->getNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $rendezvous_point_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function get_routing_rfc1213()\n {\n $oid = \".1.3.6.1.2.1.4.21\";\n if($this->version<3) $table = snmprealwalk($this->host, $this->community, $oid, $this->timeout, $this->retries);\n if($this->version>2) $table = snmp3_real_walk($this->host, $this->sec_name, $this->sec_level, $this->auth_protocol, $this->auth_passphrase, $this->priv_protocol, $this->priv_passphrase, $oid, $this->timeout, $this->retries);\n while($value = current($table))\n {\n preg_match('/[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$/', key($table), $route_dst);\n $attr = str_replace(\"RFC1213-MIB::\",\"\",key($table));\n $attr = str_replace(\".\" . $route_dst[0],\"\",$attr);\n $val = str_replace(\"INTEGER:\", \"\", $value);\n $val = str_replace(\"IpAddress:\", \"\", $val);\n $val = trim($val);\n $route[$route_dst[0]][$attr] = $val;\n next($table);\n }\n return $route;\n }",
"public function createNetworkSwitchRoutingMulticastRendezvousPointAsync($network_id, $create_network_switch_routing_multicast_rendezvous_point)\n {\n return $this->createNetworkSwitchRoutingMulticastRendezvousPointAsyncWithHttpInfo($network_id, $create_network_switch_routing_multicast_rendezvous_point)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function unicastmessage()\n {\n return view('message.unicastMessage');\n }",
"public function getNetworkSwitchRoutingMulticastRendezvousPointsAsyncWithHttpInfo($network_id)\n {\n $returnType = 'object';\n $request = $this->getNetworkSwitchRoutingMulticastRendezvousPointsRequest($network_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getMStZoneGMCreateMailRequest()\n {\n return $this->get(self::M_STZONE_GMCREATEMAIL_REQUEST);\n }",
"public function updateNetworkSwitchRoutingMulticastRendezvousPointWithHttpInfo($network_id, $rendezvous_point_id, $update_network_switch_routing_multicast_rendezvous_point)\n {\n $returnType = 'object';\n $request = $this->updateNetworkSwitchRoutingMulticastRendezvousPointRequest($network_id, $rendezvous_point_id, $update_network_switch_routing_multicast_rendezvous_point);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createTransitRouterMulticastDomain($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->createTransitRouterMulticastDomainWithOptions($request, $runtime);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reflect all classes (or classlikes) in the given source code. | public function reflectClassesIn(TextDocument $sourceCode, array $visited = []): ReflectionClassLikeCollection
{
return $this->sourceReflector->reflectClassesIn($sourceCode, $visited);
} | [
"public function reflectClassesIn($sourceCode): ReflectionClassCollection;",
"public function reflectClassesIn($sourceCode, array $visited = []): ReflectionClassLikeCollection;",
"public function reflectClassesIn(\n TextDocument $sourceCode,\n array $visited = []\n ): ReflectionClassLikeCollection;",
"private function extractClasses(): array\n {\n $classes = [];\n\n $tokens = $this->tokens->withoutBlocks();\n preg_match_all('/(?<docblock>T_DOC_COMMENT )?(T_FINAL |T_ABSTRACT )*(?<type>T_CLASS |T_INTERFACE |T_TRAIT )(?<name>T_STRING )[^{]*{ } /',\n $tokens->asString(),\n $matches,\n PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n\n foreach ($matches as $match)\n {\n $classTokens = TokenMatchHelper::codeBlock($match, $tokens, $this->tokens);\n $lines = $classTokens->lines();\n\n $classes[] = ['docblock' => TokenMatchHelper::docblockDetails($match, $tokens),\n 'name' => TokenMatchHelper::code('name', $match, $tokens),\n 'start' => $lines['start'],\n 'end' => $lines['end'],\n 'tokens' => $classTokens];\n }\n\n return $classes;\n }",
"final private function _classesInScript ($code = '') {\n\t\t$classes = array();\n\n\t\t// Find tokens that are classes\n\t\t$tokens = token_get_all($code);\n\t\tfor ($i = 2; $i < count($tokens); $i++) {\n\n\t\t\t// Assess tokens to find class declarations of subclasses\n\t\t\tif (\n\t\t\t\t$tokens[$i-2][0] === T_CLASS and\n\t\t\t\t$tokens[$i-1][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i][0] === T_STRING and\n\t\t\t\t$tokens[$i+1][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i+2][0] === T_EXTENDS and\n\t\t\t\t$tokens[$i+3][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i+4][0] === T_STRING\n\t\t\t) {\n\t\t\t\t$inheritedFrom = $tokens[$i+4][1];\n\n\t\t\t\t// See if class extends Unitest\n\t\t\t\tif ($this->_isValidSuiteClass($inheritedFrom)) {\n\t\t\t\t\t$classes[] = $tokens[$i][1];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}",
"private function getAllClasses(): array\n {\n $annotationReader = new SimpleAnnotationReader();\n $annotationManager = new AnnotationManager($annotationReader);\n return $annotationManager->buildClassInfosBasedOnPath($this->sourceDir);\n }",
"private function _loadClasses() \n {\n $classes = $this->_dom->getElementsByTagName(\"class\");\n foreach ($classes as $class) {\n $class->setAttribute(\"validatedName\", \n $this->_validateClassName($class->getAttribute(\"name\")));\n $extends = $class->getElementsByTagName(\"extends\");\n if ($extends->length > 0) {\n $extends->item(0)->nodeValue = \n $this->_validateClassName($extends->item(0)->nodeValue);\n $classExtension = $extends->item(0)->nodeValue;\n } else {\n $classExtension = false;\n }\n $properties = $class->getElementsByTagName(\"entry\");\n foreach ($properties as $property) {\n $property->setAttribute(\"validatedName\", \n $this->_validateNamingConvention($property->getAttribute(\"name\")));\n $property->setAttribute(\"type\", \n $this->_validateType($property->getAttribute(\"type\")));\n }\n \n $sources[$class->getAttribute(\"validatedName\")] = array(\n \"extends\" => $classExtension,\n \"source\" => $this->_generateClassPHP($class)\n );\n }\n \n while (sizeof($sources) > 0)\n {\n $classesLoaded = 0;\n foreach ($sources as $className => $classInfo) {\n if (!$classInfo[\"extends\"] || (isset($this->_classPHPSources[$classInfo[\"extends\"]]))) {\n $this->_classPHPSources[$className] = $classInfo[\"source\"];\n unset($sources[$className]);\n $classesLoaded++;\n }\n }\n if (($classesLoaded == 0) && (sizeof($sources) > 0)) {\n throw new WSDLInterpreterException(\"Error loading PHP classes: \".join(\", \", array_keys($sources)));\n }\n }\n }",
"public function &getClasses();",
"public function load_classes () {\n\t\tglobal $preferences;\n\t\t\n\t\t$symbols = array();\n\t\t$classes = array();\n\t\t$methods = array();\n\t\t\n\t\t// Load all classes into master table\n\t\t$paths = $this->find_symbol_tables();\n\t\tforeach ($paths as $path) {\n\t\t\t$table = $this->load_symbol_table($path);\n\t\t\tforeach ($table as $symbol) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t// Methods\n\t\t\t\tif ($this->methods) {\n\t\t\t\t\tif ($symbol[\"kind\"] == self::SYMBOL_DECLARED_METHOD) $symbols[$symbol[\"parent\"]][\"methods\"][] = $symbol;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Classes\n\t\t\t\tswitch ($symbol[\"kind\"]) {\n\t\t\t\t\tcase self::SYMBOL_CLASS:\n\t\t\t\t\t\tif ($preferences->get_boolean_value(\"class_browser_pascalclass\")) $symbols[$symbol[\"name\"]] = $symbol;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::SYMBOL_CLASS_OBJC:\n\t\t\t\t\t\tif ($preferences->get_boolean_value(\"class_browser_objcclass\")) $symbols[$symbol[\"name\"]] = $symbol;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::SYMBOL_CLASS_PROTOCOL:\n\t\t\t\t\t\tif ($preferences->get_boolean_value(\"class_browser_objcprotocol\")) $symbols[$symbol[\"name\"]] = $symbol;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::SYMBOL_CLASS_CATEGORY:\n\t\t\t\t\t\tif ($preferences->get_boolean_value(\"class_browser_objccategory\")) $symbols[$symbol[\"name\"]] = $symbol;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Build trees\n\t\t$count = 0;\n\t\tforeach ($symbols as $class) {\n\t\t\t$tree = array();\n\t\t\t$this->find_class_tree($class[\"name\"], $symbols, $tree);\n\t\t\t$tree = array_reverse($tree);\n\n\t\t\t// ??? walk each value then add to master array\n\t\t\t$parent = &$classes;\n\n\t\t\tforeach ($tree as $child) {\n\t\t\t\t$name = $child[\"name\"];\n\t\t\t\t//print(\"$name\\n\");\n\t\t\t\t\n\t\t\t\t// Append new class\n\t\t\t\tif (!$parent[$name]) {\n\t\t\t\t\t$parent[$name][\"class\"] = $child;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Append to previous parent\n\t\t\t\t$parent = &$parent[$name][\"child\"];\n\t\t\t}\n\t\t\t\n\t\t\t// DEBUGGING\n\t\t\t$count++;\n\t\t\tif ($count == 2) {\n\t\t\t\t//print_r($classes);\n\t\t\t\t//return $classes;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $classes;\n\t}",
"public function getClasses()\n {\n $classes = [];\n foreach ($this->classes as $class) {\n $classes[] = new ClassReflection($class);\n }\n\n return $classes;\n }",
"public function compile()\r\n {\r\n $directoryIterator = new \\RecursiveDirectoryIterator(realpath(__DIR__));\r\n $fileIterator = new \\RecursiveIteratorIterator($directoryIterator, \\RecursiveIteratorIterator::SELF_FIRST);\r\n $regexIterator = new \\RegexIterator($fileIterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH);\r\n\r\n foreach($regexIterator as $filePath => $fileObject){\r\n $sourceCode = file_get_contents($filePath);\r\n $tokens = token_get_all($sourceCode);\r\n\r\n $namespace = '';\r\n $className = '';\r\n $classNames = array();\r\n foreach($tokens as $key => $token)\r\n {\r\n if(($tokens[$key][0] == T_STRING) && ($tokens[$key-1][0] == T_WHITESPACE)) \r\n {\r\n if($tokens[$key-2][0] == T_NAMESPACE)\r\n {\r\n $namespace = $tokens[$key][1];\r\n\r\n while(($tokens[$key][0] != T_WHITESPACE) && ($tokens[$key] != ';'))\r\n {\r\n $key++;\r\n $namespace .= isset($tokens[$key][1]) ? $tokens[$key][1] : '';\r\n }\r\n } \r\n elseif($tokens[$key-2][0] == T_CLASS)\r\n {\r\n $className .= $namespace . '\\\\' . $tokens[$key][1];\r\n $classNames[] = $className;\r\n $className = '';\r\n }\r\n }\r\n }\r\n $this->addMapping($filePath, $classNames);\r\n }\r\n file_put_contents($this->cacheFile, serialize($this->getClassMap()));\r\n }",
"protected function _get_php_classes($php_code) {\n\t \t$classes = array();\n\t \tif ( empty ( $count ) ) {\n\t \t $tokens = token_get_all($php_code);\n\t \t $count = count($tokens);\n\t \t}\n\t \tfor ($i = 2; $i < $count; $i++) {\n\t \t\tif ( $tokens[$i - 2][0] == T_NAMESPACE\n\t \t\t\t&& $tokens[$i - 1][0] == T_WHITESPACE\n\t \t\t\t&& $tokens[$i][0] == T_STRING) {\n\t \t\t\t$namespace = $this->_get_php_namespace($tokens, $i);\n\t \t\t}\n\t \t\tif ( $tokens[$i - 2][0] == T_CLASS\n\t \t\t\t&& $tokens[$i - 1][0] == T_WHITESPACE\n\t \t\t\t&& $tokens[$i][0] == T_STRING) {\n\t \t\t\t$class_name = $tokens[$i][1];\n\t \t\t\t$classes[] = $namespace.'\\\\'.$class_name;\n\t \t\t}\n\t \t}\n\t \treturn $classes;\n\t }",
"abstract public function processClass (ReflectionClass $class);",
"protected function examineClasses() {\n\t\t$classFiles = $this->phpFilesInPath( $this->getScanDir() );\n\t\t$fileQuery = $this->getFileQuery();\n\n\t\t/** @var \\Symfony\\Component\\Finder\\SplFileInfo $file */\n\t\tforeach ( $classFiles as $file ) {\n\t\t\t/** @var \\ReflectionClass $class */\n\t\t\tforeach ( $fileQuery->find( $file ) as $class ) {\n\t\t\t\t$this->outputClassAndFile( $class->getName(), $file->getPathname() );\n\n\t\t\t\tif ( $class->getParentClass() === false ) {\n\t\t\t\t\t$this->output( ' Non-extending class, skipping' );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$baseName = $class->getParentClass()->getName();\n\t\t\t\t$targetBaseName = 'Base' . $class->getShortName();\n\t\t\t\t$path = '';\n\t\t\t\tif ( $this->namespace !== null ) {\n\t\t\t\t\t//( $this->namespace !== null ? $this->namespace . '\\\\' . $this->folders['output'] . '\\\\' : '' )\n\t\t\t\t\t$namespace = $this->namespace . '\\\\' . $this->getFolderNamespace( 'output' );\n\t\t\t\t\tif ( $file->getRelativePath() != '' ) {\n\t\t\t\t\t\t$namespace .= '\\\\' . str_replace( '/', '\\\\', $file->getRelativePath() );\n\t\t\t\t\t\t$path = $file->getRelativePath() . '/';\n\t\t\t\t\t}\n\n\t\t\t\t\t$targetBaseName = $namespace . '\\\\' . $targetBaseName;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $baseName != $targetBaseName ) {\n\t\t\t\t\t$this->output( ' Non-based class, skipping' );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$templates = array();\n\t\t\t\tif ( ( $docBlock = $class->getDocComment() ) !== false ) {\n\t\t\t\t\t$docBlock = new ReflectionDocblock( $docBlock );\n\t\t\t\t\tforeach ( $docBlock->getTags( 'template' ) as $tag ) {\n\t\t\t\t\t\t$template = $tag->description;\n\t\t\t\t\t\t$this->output( ' Uses ' . $template );\n\t\t\t\t\t\t$templates[] = $template;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->buildBaseClass( 'Base' . $class->getShortName(), $templates, $namespace, $path );\n\t\t\t}\n\t\t}\n\t}",
"public function getClasses();",
"private function extractClassNames($source)\n {\n $matches = [];\n if (!preg_match_all('/[\\\\\\\\\\w]+::/', $source, $matches)) {\n return [];\n }\n\n $classes = [];\n foreach (array_unique($matches[0]) as $match) {\n $class = rtrim($match, '::');\n\n if (in_array($class, ['self', 'static'])) {\n continue;\n }\n\n $classes[] = $class;\n }\n\n return $classes;\n }",
"function fs_src_tree($phpfile){\n\t$src = file_get_contents($phpfile);\n\trequire_once $phpfile;\n\t//file comment\n\tpreg_match_all('/<\\?php\\s*\\/\\*+\\s*(?P<comment>.*?)\\*\\/\\s*/sm', $src, $fdef);\n\t$comment = $fdef['comment'][0];\n\t//classes\n\tpreg_match_all('/^(abstract)*\\s*(class|trait)\\s+(?P<cls>[\\w\\d]+)\\s*/mi', $src, $ma);\n\t$classes = [];\n\tif(!empty($ma['cls'])){\n\t\tforeach ($ma['cls'] as $cls){\n\t\t\t$classes[$cls] =[];\n\t\t\t$cr = new ReflectionClass($cls);\n\t\t\t$classes[$cls]['name'] = $cls;\n\t\t\t//parent\n\t\t\t$parent = $cr->getParentClass();\n\t\t\tif($parent) $classes[$cls]['parent']=$parent->getName();\n\t\t\t//interfaces\n\t\t\t$classes[$cls]['interfaces']=$cr->getInterfaceNames();\n\t\t\t//abstract\n\t\t\t$classes[$cls]['abstract']=$cr->isAbstract();\n\t\t\t//trait\n\t\t\t$classes[$cls]['trait']=$cr->isTrait();\n\t\t\t//class annotations\n\t\t\t$comm = $cr->getDocComment();\n\t\t\tif($comm==$comment) $comment='';\n\t\t\t$classes[$cls]['annotations']=fs_annotations($comm);\n\t\t\t//methods\n\t\t\t$methods = $cr->getMethods();\n\t\t\tforeach ($methods as $mr){\n\t\t\t\t$args = array_map(function($e){return $e->name;}, $mr->getParameters());\n\t\t\t\t$anno = fs_annotations($mr->getDocComment());\n\t\t\t\t$classes[$cls]['methods'][$mr->getName()] = [\n\t\t\t\t'name'\t=> $mr->getName(),\n\t\t\t\t'classname'=>$cls,\n\t\t\t\t'annotations'=>$anno, 'params'=>$args,\n\t\t\t\t'abstract' => $mr->isAbstract(),\n\t\t\t\t'constructor' => $mr->isConstructor(),\n\t\t\t\t'destructor' => $mr->isDestructor(),\n\t\t\t\t'final' => $mr->isFinal(),\n\t\t\t\t'visibility' => $mr->isPrivate()?'private':($mr->isProtected()?'protected':'public'),\n\t\t\t\t'static' => $mr->isStatic()\n\t\t\t\t];\n\t\t\t}\n\t\t\t//properties\n\t\t\t$props = $cr->getProperties();\n\t\t\tforeach ($props as $pr){\n\t\t\t\t$classes[$cls]['properties'][$pr->getName()] = [\n\t\t\t\t'visibility' => $pr->isPrivate()?'private':($pr->isProtected()?'protected':'public'),\n\t\t\t\t'static' => $pr->isStatic()\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t}\n\t//non-class functions\n\tpreg_match_all('/^function\\s+(?P<func>[\\w\\d_]+)\\s*\\(/mi', $src, $ma);\n\t$funcs = [];\n\tif(!empty($ma['func'])){\n\t\tforeach ($ma['func'] as $fn){\n\t\t\t$ref = new ReflectionFunction($fn);\n\t\t\t$args = array_map(function($e){return $e->name;}, $ref->getParameters());\n\t\t\t$comm = $ref->getDocComment();\n\t\t\tif($comm==$comment) $comment='';\n\t\t\t$anno = fs_annotations($comm);\n\t\t\t$funcs[$fn] = ['annotations'=>$anno, 'params'=>$args, 'name'=>$fn];\n\t\t}\n\t}\n\treturn ['annotations' => empty($comment)?[]:fs_annotations($comment),'functions' => $funcs,'classes' => $classes];\n}",
"public function classes() {\n\t\trequire_once($this->get_filepath('classes').'classes-loader.php');\n\t}",
"public function classes() {\n // array for all classnames\n $classes = [];\n // get contents of the file\n $contents = $this->read();\n // tokenize it\n $tokens = token_get_all($contents);\n // for class and namespace building\n $current_ns = ''; $namespace_build=false; $skip_used=false;\n $current_class = ''; $class_build=false;\n // loop through tokens\n foreach($tokens as $token) {\n $end_build=false;\n if(!is_string($token)) {\n if($token[0]===T_NAMESPACE) {\n $current_ns='';\n $namespace_build=true;\n $skip_used=false;\n }\n if(($token[0]===T_CLASS)||($token[0]===T_INTERFACE)||($token[0]===T_TRAIT)) {\n $current_class='';\n $class_build=true;\n $skip_used=false;\n }\n if(($token[0]===T_STRING)||($token[0]===T_NS_SEPARATOR)) {\n if($namespace_build) {\n $current_ns.=$token[1];\n } elseif($class_build) {\n $current_class.=$token[1];\n }\n }\n if($token[0]===T_WHITESPACE) {\n if($skip_used) {\n $end_build=true;\n } else { $skip_used=true; }\n }\n } elseif(($token==';')||($token=='{')) {\n $end_build=true;\n }\n // end build if necessary after ; { or whitespace\n if($end_build) {\n if($class_build) {\n $classes[]=$current_ns.$current_class;\n }\n if($namespace_build) {\n $current_ns.='\\\\';\n }\n $namespace_build=false;\n $class_build=false;\n }\n }\n return $classes;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolve a (relative) IRI reference against this IRI | public function resolve($reference)
{
$reference = new IRI($reference);
$scheme = null;
$authority = null;
$path = '';
$query = null;
$fragment = null;
// The Transform References algorithm as specified by RFC3986
// see: http://tools.ietf.org/html/rfc3986#section-5.2.2
if ($reference->scheme) {
$scheme = $reference->scheme;
$authority = $reference->getAuthority();
$path = self::removeDotSegments($reference->path);
$query = $reference->query;
} else {
if (null !== $reference->getAuthority()) {
$authority = $reference->getAuthority();
$path = self::removeDotSegments($reference->path);
$query = $reference->query;
} else {
if (0 === strlen($reference->path)) {
$path = $this->path;
if (null !== $reference->query) {
$query = $reference->query;
} else {
$query = $this->query;
}
} else {
if ('/' === $reference->path[0]) {
$path = self::removeDotSegments($reference->path);
} else {
// T.path = merge(Base.path, R.path);
if ((null !== $this->getAuthority()) && ('' === $this->path)) {
$path = '/' . $reference->path;
} else {
if (false !== ($end = strrpos($this->path, '/'))) {
$path = substr($this->path, 0, $end + 1);
}
$path .= $reference->path;
}
$path = self::removeDotSegments($path);
}
$query = $reference->query;
}
$authority = $this->getAuthority();
}
$scheme = $this->scheme;
}
$fragment = $reference->fragment;
// The Component Recomposition algorithm as specified by RFC3986
// see: http://tools.ietf.org/html/rfc3986#section-5.3
$result = '';
if ($scheme) {
$result = $scheme . ':';
}
if (null !== $authority) {
$result .= '//' . $authority;
}
$result .= $path;
if (null !== $query) {
$result .= '?' . $query;
}
if (null !== $fragment) {
$result .= '#' . $fragment;
}
return new IRI($result);
} | [
"public function testGetAbsoluteIriOnRelativeIri()\n {\n $iri = new IRI('/relative#with-fragment');\n $iri->getAbsoluteIri();\n }",
"function resolve_uri($id, $parentScope)\n{\n // If there is no parent scope, there is nothing to resolve against.\n if ($parentScope === '') {\n return $id;\n }\n\n return Uri\\resolve($parentScope, $id);\n}",
"abstract public function resolveURL();",
"function resolve(string $uri): URI\n {\n if (strpos($uri, \"//\") === 0 || strpos($uri, \"/\") === 0) {\n return $this->resolvePath($uri);\n } else if (strpos($uri, \"#\") === 0) {\n return $this->resolveFragment($uri);\n } else {\n return $this->resolvePathRelative($uri);\n }\n }",
"public function resolve($reference);",
"public function resolve($ref): Uri\n {\n $uri = ($ref instanceof Uri) ? $ref : new self($ref);\n //\n if ($uri->isAbsolute() || $this->isOpaque()) {\n // [absolute]\n $resolved = $uri;\n } else if ($uri->fragment()\n && !$uri->path()\n && !$uri->scheme()\n && !$uri->authority()\n && !$uri->query()) {\n // [hash-only]\n $resolved = clone $this;\n $resolved->hydrate(['fragment' => $uri->fragment()]);\n } else {\n // [RFC 2396]\n $resolved = $this->resolveUris($this, $uri);\n }\n //\n return $resolved;\n }",
"public function resolve(\\Nap\\Resource\\Resource $resource);",
"function uri_resolve( $uri ) {\n global $config;\n\n $base_path = $config->router_baseuri;\n\n if(substr($base_path, strlen($base_path) -1) == '/') {\n $base_path = substr($base_path, 0, strlen($base_path) -1);\n } \n\n return $base_path . $uri;\n}",
"protected function doiResolver()\n\t{\n\t\tstatic $resolver;\n\n\t\tif (!$resolver)\n\t\t{\n\t\t\t$resolver = Component::params('com_tools')->get('doi_resolve', 'https://doi.org/');\n\t\t\t$resolver = rtrim($resolver, '/') . '/';\n\t\t\tif ($shoulder = Component::params('com_tools')->get('doi_shoulder'))\n\t\t\t{\n\t\t\t\t$resolver .= $shoulder . '/';\n\t\t\t}\n\t\t}\n\n\t\treturn $resolver;\n\t}",
"public function toRelative(): RelativePathInterface;",
"public static function absolutize($base, $relative)\n\t{\n\t\t$relative = (string) $relative;\n\t\tif ($relative !== '')\n\t\t{\n\t\t\t$relative = new SimplePie_IRI($relative);\n\t\t\tif ($relative->get_scheme() !== null)\n\t\t\t{\n\t\t\t\t$target = $relative;\n\t\t\t}\n\t\t\telseif ($base->get_iri() !== null)\n\t\t\t{\n\t\t\t\tif ($relative->get_authority() !== null)\n\t\t\t\t{\n\t\t\t\t\t$target = $relative;\n\t\t\t\t\t$target->set_scheme($base->get_scheme());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$target = new SimplePie_IRI('');\n\t\t\t\t\t$target->set_scheme($base->get_scheme());\n\t\t\t\t\t$target->set_userinfo($base->get_userinfo());\n\t\t\t\t\t$target->set_host($base->get_host());\n\t\t\t\t\t$target->set_port($base->get_port());\n\t\t\t\t\tif ($relative->get_path() !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (strpos($relative->get_path(), '/') === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$target->set_path($relative->get_path());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($base->get_userinfo() !== null || $base->get_host() !== null || $base->get_port() !== null) && $base->get_path() === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$target->set_path('/' . $relative->get_path());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($last_segment = strrpos($base->get_path(), '/')) !== false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$target->set_path(substr($base->get_path(), 0, $last_segment + 1) . $relative->get_path());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$target->set_path($relative->get_path());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$target->set_query($relative->get_query());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$target->set_path($base->get_path());\n\t\t\t\t\t\tif ($relative->get_query() !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$target->set_query($relative->get_query());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($base->get_query() !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$target->set_query($base->get_query());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$target->set_fragment($relative->get_fragment());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No base URL, just return the relative URL\n\t\t\t\t$target = $relative;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$target = $base;\n\t\t}\n\t\treturn $target;\n\t}",
"public function testGetAbsoluteIri()\n {\n $iri = new IRI('http://example.org/aaa%2fbbb#ccc');\n $this->assertEquals('http://example.org/aaa%2fbbb', (string) $iri->getAbsoluteIri());\n\n $iri = new IRI('http://example.org/iri#with-fragment/looking/like/a/path?and&query');\n $this->assertEquals('http://example.org/iri', (string) $iri->getAbsoluteIri());\n }",
"public function resolve(string $path): string;",
"public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}",
"public function resolveRelativeUri(string $uri): string\n {\n $parts = parse_url($uri);\n // absolute URI, no need to combine with baseURI\n if (isset($parts['scheme'])) {\n if (isset($parts['path'])) {\n $parts['path'] = $this->reduceDots($parts['path']);\n }\n return $this->buildUri($parts);\n }\n\n // convert absolute path on windows to a file:// URI. This is probably incomplete but should work with the majority of paths.\n if (stripos(PHP_OS, 'WIN') === 0 && strncmp(substr($uri, 1), ':\\\\', 2) === 0) {\n // convert absolute path on windows to a file:// URI. This is probably incomplete but should work with the majority of paths.\n $absoluteUri = \"file:///\" . strtr($uri, [' ' => '%20', '\\\\' => '/']);\n return $absoluteUri\n . (isset($parts['fragment']) ? '#' . $parts['fragment'] : '');\n }\n\n $baseUri = $this->getUri();\n $baseParts = parse_url($baseUri);\n if (isset($parts['path'][0]) && $parts['path'][0] === '/') {\n // absolute path\n $baseParts['path'] = $this->reduceDots($parts['path']);\n } elseif (isset($parts['path'])) {\n // relative path\n $baseParts['path'] = $this->reduceDots(rtrim($this->dirname($baseParts['path'] ?? ''), '/') . '/' . $parts['path']);\n } else {\n throw new UnresolvableReferenceException(\"Invalid URI: '$uri'\");\n }\n $baseParts['query'] = $parts['query'] ?? null;\n $baseParts['fragment'] = $parts['fragment'] ?? null;\n return $this->buildUri($baseParts);\n }",
"abstract public function resolve($source);",
"function best_uri($reference)\n{\n\t$uri = '';\t\n\t\n\tforeach ($reference as $k => $v)\n\t{\n\t\tswitch ($k)\n\t\t{\n\t\t\tcase 'identifier':\n\t\t\t\tforeach ($reference->identifier as $identifier)\n\t\t\t\t{\n\t\t\t\t\tswitch ($identifier->type)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'doi':\n\t\t\t\t\t\t\t$uri = 'http://dx.doi.org/' . $identifier->id;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'handle':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://hdl.handle.net/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'biostor':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://biostor.org/reference/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\t\tcase 'jstor':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://www.jstor.org/stable/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\t\tcase 'cinii':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://ci.nii.ac.jp/naid/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'year':\n\t\t\t\t$year = $v;\n\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\t\t\t\t\n\t\t}\n\t}\n\tif ($uri == '')\n\t{\n\t\t$uri = '';\t\t\n\t\tforeach ($reference as $k => $v)\n\t\t{\n\t\t\tswitch ($k)\n\t\t\t{\n\t\t\t\tcase 'link':\n\t\t\t\t\tforeach ($reference->link as $link)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($link->anchor == 'URL')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$uri = $link->url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $uri;\n}",
"public function getURIResolver();",
"public static function absolutize($base, $relative) {\n\t\tif (!($relative instanceof self)) {\n\t\t\t$relative = new self($relative);\n\t\t}\n\t\tif (!$relative->is_valid()) {\n\t\t\treturn false;\n\t\t}\n\t\telseif ($relative->scheme !== null) {\n\t\t\treturn clone $relative;\n\t\t}\n\n\t\tif (!($base instanceof self)) {\n\t\t\t$base = new self($base);\n\t\t}\n\t\tif ($base->scheme === null || !$base->is_valid()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($relative->get_iri() !== '') {\n\t\t\tif ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null) {\n\t\t\t\t$target = clone $relative;\n\t\t\t\t$target->scheme = $base->scheme;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$target = new self;\n\t\t\t\t$target->scheme = $base->scheme;\n\t\t\t\t$target->iuserinfo = $base->iuserinfo;\n\t\t\t\t$target->ihost = $base->ihost;\n\t\t\t\t$target->port = $base->port;\n\t\t\t\tif ($relative->ipath !== '') {\n\t\t\t\t\tif ($relative->ipath[0] === '/') {\n\t\t\t\t\t\t$target->ipath = $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\telseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') {\n\t\t\t\t\t\t$target->ipath = '/' . $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\telseif (($last_segment = strrpos($base->ipath, '/')) !== false) {\n\t\t\t\t\t\t$target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$target->ipath = $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\t$target->ipath = $target->remove_dot_segments($target->ipath);\n\t\t\t\t\t$target->iquery = $relative->iquery;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$target->ipath = $base->ipath;\n\t\t\t\t\tif ($relative->iquery !== null) {\n\t\t\t\t\t\t$target->iquery = $relative->iquery;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($base->iquery !== null) {\n\t\t\t\t\t\t$target->iquery = $base->iquery;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$target->ifragment = $relative->ifragment;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$target = clone $base;\n\t\t\t$target->ifragment = null;\n\t\t}\n\t\t$target->scheme_normalization();\n\t\treturn $target;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Methods for loading classes from libraries, controllers, and models. ============================================================================= / app::getCore(); Return a reference to a library, or create a new one if ! existing. | public static function &getCore($class_name) {
$class = null;
if (is_array($class_name)) {
foreach ($class_name as $cname) {
self::getCore($cname);
}
} else {
try {
$class = self::_load_class($class_name, APPPATH . 'core', self::$core);
} catch (Exception $exc) {
$class = self::_load_class($class_name, BASEPATH . 'core', self::$core);
}
}
return $class;
} | [
"public function getCore() {\n require_once 'Scenario/Core.php';\n return Scenario_Core::getInstance();\n }",
"protected function loadLibs() {\n\t\t\tif (AppConfig::get('DatabaseEnabled')) {\n\t\t\t\tAppLoader::includeClass('php/database/', 'DatabaseFactory');\n\t\t\t\t$objDatabaseFactory = new DatabaseFactory('database');\n\t\t\t\tAppRegistry::register('Database', $objDatabaseFactory->init());\n\t\t\t}\n\t\n\t\t\tif (AppConfig::get('CacheEnabled')) {\n\t\t\t\tAppLoader::includeClass('php/cache/', 'CacheFactory');\n\t\t\t\t$objCacheFactory = new CacheFactory('cache');\n\t\t\t\tAppRegistry::register('Cache', $objCacheFactory->init());\n\t\t\t}\n\t\t}",
"public static function core()\n {\n if (!is_object(self::$core)) {\n self::throwException('Core is not initialized');\n }\n return self::$core;\n }",
"private static function _loadCoreModel()\n {\n $file = ROOT.D.'app'.D.'modules'.D.'core'.D.'Model'.D.'Core.php';\n include (!file_exists($file)) ? die('Core Model is required') : $file;\n }",
"public function getCore() {\n return $this->_core;\n }",
"public function getBundledCore()\n {\n return $this->bundledCore;\n }",
"private static function AddCoreModules()\n\t{\n\t\t$Array=array(\n\t\t\t\t\"Model\"=>\"model/base/model\",\n\t\t\t\t\"Controller\"=>\"model/base/control\",\n\t\t\t\t\"View\"=>\"model/base/view\",\n\t\t\t\t\"Plugin\"=>\"model/base/plugin\",\n\t\t\t\t\"Test\"=>\"model/base/test\",\n\n\t\t\t\t\"ErrorHandler\"=>\"model/core/errorhandler\",\n\t\t\t\t\"DownloadManager\"=>\"model/core/download\",\n\t\t\t\t\"HttpRequest\"=>\"model/core/http\",\n\n\t\t\t\t\"BaseLauncher\"=>\"model/launcher/base\",\n\t\t\t\t\"ApplicationLauncher\"=>\"model/launcher/application\",\n\t\t\t\t\"SystemLauncher\"=>\"model/launcher/system\",\n\t\t\t\t\"FileLauncher\"=>\"model/launcher/file\",\n\t\t\t\t\"TestLauncher\"=>\"model/launcher/test\",\n\n\t\t\t\t\"DatabaseManager\"=>\"model/lib/db\",\n\n\t\t\t\t\"Profiler\"=>\"model/lib/profiler\",\n\t\t\t\t\"LogManager\"=>\"model/lib/log\",\n\t\t\t\t\"UserManager\"=>\"model/lib/user\",\n\t\t\t\t\"ExtendedUserManager\"=>\"model/lib/xuser\",\n\t\t\t\t\"SessionManager\"=>\"model/lib/session\",\n\t\t\t\t\"SecurityManager\"=>\"model/lib/security\",\n\t\t\t\t\"SettingManager\"=>\"model/lib/settings\",\n\t\t\t\t\"RBACManager\"=>\"model/lib/rbac\",\n\t\t\t\t\"ServiceManager\"=>\"model/service/manager\",\n\t\t\t\t\"Password\"=>\"model/lib/security/password\",\n\n\t\t\t\t);\n\n\n\t\t$RuleArray=array();\n\t\tforeach ($Array as $k=>$v)\n\t\t{\n\t\t\t$RuleArray[__NAMESPACE__.\"\\\\{$k}\"]=realpath(jf::root().\"/_japp/{$v}.php\");\n\t\t\t$RuleArray[\"\\\\\".__NAMESPACE__.\"\\\\{$k}\"]=realpath(jf::root().\"/_japp/{$v}.php\");\n\t\t}\n\t\tself::AddRuleArray($RuleArray);\n\t}",
"function elgg_get_class_loader() {\n\treturn _elgg_services()->autoloadManager->getLoader();\n}",
"static public function loadLibrary() {\n $creator_path = libraries_get_path('iCalcreator');\n require_once($creator_path . '/iCalcreator.class.php');\n }",
"protected function loadLibraries(){ \n //Recorro de a una las librerias, las importo\n foreach ($this->context->getLibrariesDefinition() as $libreria) {\n //$libreria['class'] tiene la direccion completa desde LIBRARIE, no solo el nombre\n $dir= $libreria['path'];\n Support\\import_librarie($dir);\n }\n }",
"public function getCore() {\n\t\treturn $this->container->get('sfs.admin.core');\n\t}",
"public function getLibraries();",
"static function coreLoader() {\n\t\t\t// require_once dirname(__FILE__) . '/config.php';\n\t\t\trequire_once dirname(__FILE__) . '/libraries/CMB2/init.php';\n\t\t}",
"public function getLibrary()\n {\n $this->loadManyToOne('library');\n return $this->library;\n }",
"public static function createCoreObjects():void {\n\t\tself::$config = new Config($_ENV);\n\t\tself::$serverInfo = new ServerInfo($_SERVER);\n\t\tself::$input = new Input($_GET, $_POST, $_FILES);\n\t\tself::$cookie = new Cookie($_COOKIE);\n\t\tself::$session = new Session($_SESSION);\n\t}",
"public function load_xl_core_classes() {\n\t\t\trequire_once( 'start.php' );\n\t\t}",
"public static function getFromCore(): array\n {\n return self::getByPackage('core');\n }",
"final protected static function getApploader() : \\codename\\core\\value\\text\\apploader {\n if(is_null(self::$apploader)) {\n self::$apploader = new \\codename\\core\\value\\text\\apploader((new \\ReflectionClass(self::$instance))->getNamespaceName());\n }\n return self::$apploader;\n }",
"public function autoLoadCore($class)\r\n\t{\r\n\t\t$class = explode('\\\\', $class);\r\n\t\t$class = strtolower(end($class));\r\n\r\n\t\tif ( file_exists('system/core/' . $class . '.php') )\r\n\t\t\tinclude 'system/core/' . $class . '.php';\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves namespace used by \Tactics\Bundle\TableBundle\ModelCriteriaFilter\ModelCriteriaSorter | public function getSorterNamespace()
{
return $this->sorterNamespace;
} | [
"public static function getModelNamespace (): string\n {\n return self::$model_namespace;\n }",
"public function getNamespace()\n {\n if (isset($this->parent_model)) {\n return sprintf('%s\\\\%s', $this->getAPI()->getNamespace(), $this->parent_model->getClassName());\n } else {\n return $this->getAPI()->getNamespace();\n }\n }",
"protected function filterNamespace()\n {\n return Str::studly($this->filterVendor()).'\\\\'.$this->filterClass();\n }",
"public function getNamespace()\n {\n return substr(get_called_class(), 0, strrpos(get_called_class(), '\\\\'));\n }",
"public static function getModelNamespace()\r\n {\r\n // return config('list_value.model_namespace');\r\n return self::MODEL_NAMESPACE;\r\n }",
"protected function getNamespace()\r\n {\r\n if(defined('MODPATH'))\r\n $namespace = '\\\\' . LOADEDMOD . '\\\\Controller\\\\';\r\n else\r\n $namespace = '\\\\App\\\\Controller\\\\';\r\n\r\n if(isset($this->params['directory']))\r\n $namespace .= ucfirst($this->params['directory']) . '\\\\';\r\n\r\n if(\\Input::isAjaxRequest())\r\n $namespace .= \\Config::get('core.ajax_namespace', '');\r\n return trim($namespace);\r\n }",
"public function getModelNamespace() {\n $parents = clone $this->model;\n $parents->pop();\n return app()->getNamespace() . trim($this->modelsSubDirectory() . '\\\\' . $parents->implode('\\\\'), '\\\\');\n }",
"public function getModelNamespace()\n {\n // Get the model.\n $model_name = $this->getModelOption();\n\n // Check if the model is set.\n if (!$model_name) return '';\n\n // Check if the model has dir path.\n $modelPath = explode('/', $model_name);\n\n // Give namespace.\n $modelPath = implode(\"\\\\\", $modelPath);\n\n $modelPath = 'App\\\\'.$modelPath;\n\n // Return model namespace.\n return $modelPath;\n }",
"public function getControllerNamespace();",
"protected function getModelsNameSpace(): string\n {\n return $this->getNameSpace('Models').'\\\\'.$this->getModelName();\n }",
"protected function getNamespace(): string\n {\n return $this->config->classNamespace(\n static::ELEMENT,\n (string)$this->argument('name')\n );\n }",
"public function getNamespacedName()\n {\n return get_class();\n }",
"public function getNamespaceName()\n {\n return $this->namespace_name;\n }",
"public function get_namespace() {\n\t\treturn $this->namespace;\n\t}",
"public function getModelNamespace()\n {\n if ($this->_modelNamespace === null) {\n return $this->getModule()->getNamespace();\n }\n\n return $this->_modelNamespace;\n }",
"public function getNamespace()\n {\n $this->_init();\n return unserialize($this->_list_cache->getNamespace());\n }",
"public function getNamespace() {\n return $this->_namespace;\n }",
"public function namespaceModels() : string\n {\n return $this->namespaceModel;\n }",
"protected function getDriversNamespace()\n\t{\n\t\t$reflection = new \\ReflectionClass($this);\n\t\treturn $reflection->getNamespaceName();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the setDisplayCodeLine method with an invalid parameter | public function testSetDisplayCodeLineInvalidParameter()
{
$this->paymentSlip->setDisplayCodeLine('true');
} | [
"public function testSetDisplayAccountInvalidParameter()\n {\n $this->paymentSlip->setDisplayAccount('true');\n }",
"public function testSetDisplayRecipientInvalidParameter()\n {\n $this->paymentSlip->setDisplayRecipient('true');\n }",
"public function testSetDisplayReferenceNrInvalidParameter()\n {\n $this->paymentSlip->setDisplayReferenceNr('true');\n }",
"protected function display ($line)\r\n {\r\n if (!$this->debug) {\r\n return;\r\n }\r\n parent::display($line);\r\n }",
"public function testSetDisplayAmountInvalidParameter()\n {\n $this->paymentSlip->setDisplayAmount('true');\n }",
"public function setLineNumber($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"function print_failed($line_break = true) {\n\tprint \"\\033[1;31mFAILED\\033[0m\";\n\tif ($line_break)\n\t\tprint \"\\n\";\n}",
"public function testSetDisplayPayerInvalidParameter()\n {\n $this->paymentSlip->setDisplayPayer('true');\n }",
"public function testBadLineString()\n {\n $this->expectException(InvalidValueException::class);\n $this->expectExceptionMessage('Invalid LineString Point value of type \"integer\"');\n\n new LineString([1, 2, 3, 4]);\n }",
"public function testErrorLineOfPrecondition()\n {\n $testClass = new ErrorLineTestClass();\n $errorLine = 0;\n try {\n $testClass->iShouldFailAt63(array());\n\n } catch (\\Exception $e) {\n $errorLine = $e->getLine();\n }\n\n $this->assertEquals(63, $errorLine);\n }",
"public function testDisableErrorDisplay()\n\t{\n\t\t$result = $this->error->disable();\n\t\t$this->assertTrue($result);\n\t\t$display = ini_get('display_errors');\n\t\t$this->assertEquals('off', $display);\n\t\t$this->assertEquals($display, $this->error->get());\n\t}",
"public function testMissingLines(): void\n {\n $this->expectException(\"InvalidArgumentException\");\n $this->expectExceptionMessage(\"Lines parameter must be set.\");\n $params = array(\n \"center\" => \"true\",\n \"width\" => \"380\",\n \"height\" => \"50\",\n );\n print_r(new RendererModel(\"src/templates/main.php\", $params, self::$database));\n }",
"function __paintCodeline($class, $num, $line) {\n\t\t$line = h($line);\n\n\t\tif (trim($line) == '') {\n\t\t\t$line = ' '; // Win IE fix\n\t\t}\n\t\treturn '<div class=\"code-line ' . trim($class) . '\"><span class=\"line-num\">' . $num . '</span><span class=\"content\">' . $line . '</span></div>';\n\t}",
"public function checkLine()\n {\n return (__LINE__ == 61);\n }",
"public function fixBreakpoint(): void\n {\n if (optional($this->breakpointLine)->isMacroCall()) {\n $this->previousLineTo($this->breakpointLine)->notFinal();\n }\n }",
"public function testIsInvalidCommandLineReturnsError()\n {\n $property = $this->reflection->getProperty('error');\n $property->setAccessible(TRUE);\n\n $value = $property->getValue($this->class);\n\n $this->assertEquals($value, $this->class->is_invalid_commandline());\n }",
"public function testParseLineExceptionNoMatches()\n {\n $parser = $this->getParser();\n $parser->expects($this->once())->method('getPattern')->willReturn('/\\d+/');\n\n $parser->parseLine('test string');\n }",
"public function setShowlrc($showlrc)\n {\n if (in_array($show, [0, 1, 2])) {\n $this->showlrc = $showlrc;\n } else {\n throw new \\Exception('Invalid value for showlrc.');\n }\n }",
"public function testSetCodeLineAttr()\n {\n $returned = $this->paymentSlip->setCodeLineAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C');\n $this->assertInstanceOf('SwissPaymentSlip\\SwissPaymentSlip\\OrangePaymentSlip', $returned);\n $this->assertEquals($this->setAttributes, $this->paymentSlip->getCodeLineAttr());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a short hash of the current revision. Like "e7ccadcb". | public function getShortHash(); | [
"public function getShortHash()\n {\n if (null !== $this->shortHash) {\n return $this->shortHash;\n }\n\n $result = $this->repository->run('log', array('--abbrev-commit', '--format=%h', '-n', 1, $this->hash));\n\n return $this->shortHash = trim($result);\n }",
"public function getShortHash() {\n return substr($this->hash, 0, 7);\n }",
"public static function get_git_short_hash( $path = null )\n\t{\n\t\t$rev = '';\n\t\t$path = is_null( $path ) ? FILMIO_PATH . '/system' : $path;\n\t\t$ref_file = $path . '/.git/HEAD';\n\t\tif ( file_exists( $ref_file ) ) {\n\t\t\t$info = file_get_contents( $ref_file );\n\t\t\t// If the contents of this file start with \"ref: \", it means we need to look where it tells us for the hash.\n\t\t\t// CAVEAT: This is only really useful if the master branch is checked out\n\t\t\tif ( strpos( $info, 'ref: ' ) === false ) {\n\t\t\t\t$rev = substr( $info, 0, 7 );\n\t\t\t} else {\n\t\t\t\tpreg_match( '/ref: (.*)/', $info, $match );\n\t\t\t\t$rev = substr( file_get_contents( $path . '/.git/' . $match[1] ), 0, 7 );\n\t\t\t}\n\t\t}\n\t\treturn $rev;\n\t}",
"public function getShortHash()\n {\n return $this->getData('shortHash');\n }",
"public function getHash(): string\n {\n return $this->commitData['sha'];\n }",
"function git_hash()\n {\n return exec('git rev-parse HEAD');\n }",
"public function getRevision()\n {\n if ($this['debug'] == false)\n {\n\n if (file_exists(APPLICATION_PATH . '/config/revision.txt'))\n {\n return file_get_contents(APPLICATION_PATH . '/config/revision.txt');\n }\n }\n\n return substr(md5(uniqid()), 0, 8);\n }",
"function get_revision_hash() {\n global $revision_hash;\n $revision_path = get_template_directory() . '/.revision';\n if ( ! is_production() ) return '';\n if ( ! file_exists( $revision_path ) ) return '';\n if ( false === $revision_hash ) $revision_hash = file_get_contents( $revision_path, null, null, 0, 7 );\n return $revision_hash;\n}",
"public function getHash()\n\t\t{\n\t\t\treturn strtoupper( sha1( $this->torrent->encode( $this->info ) ) );\n\t\t}",
"private function getVersionHash() {\n $str = $this->getVersionString();\n if ($str===null) return null;\n return md5($str);\n }",
"public function getHash()\n {\n return substr(\n md5($this->getMenu() . $this->getBreadcrumbs()),\n 0,\n 8\n );\n }",
"public function getFullRevisionId($revision)\n\t{\n\t\t/**\n\t\t * The $revision parameter can be:\n\t\t * a local id\n\t\t * a full hash id (in which case nothing is to be done)\n\t\t * a tag\n\t\t */\n\t\tchdir($this->repoPath);\n\t\t$hash = trim(shell_exec('hg log --debug -r ' . escapeshellcmd($revision) . ' | grep -G \"^changeset\" | sed \"s/^changeset:[[:space:]]*//g\" | sed \"s/.*://g\"'));\n\n\t\tif (empty($hash))\n\t\t\tthrow new RuntimeException(\"Revision '$revision' could not be found in the repository '{$this->repoName}'\");\n\n\t\treturn $hash;\n\t}",
"public function getHash()\n {\n return hash('sha1', $this->id);\n }",
"public function getFixedShortHash($length = 6)\n {\n return substr($this->hash, 0, $length);\n }",
"function get_git_hash()\n {\n $value = Cache::rememberForever('git_hash', function () {\n exec('git rev-parse --verify HEAD 2> /dev/null', $output);\n\n return $output[0];\n });\n\n return $value;\n }",
"public function getCurrentHash() : String\n {\n return $this->currentHash;\n }",
"public function setGitCommitHashShort()\n\t{\n\t\t$this->git_commit_hash_short = exec('git log -n1 --pretty=%h 2> /dev/null');\n\t}",
"public function getSha(): string\n {\n return $this->sha;\n }",
"static public function getLastCommitHash(){\n \n //get the revision log \n $last_commit = self::getLastCommit();\n $commit_hashes = array_keys( $last_commit );\n return reset( $commit_hashes );\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the value of the form element | public function resetValue()
{
$this->setAttribute('value', '');
return $this;
} | [
"public function resetForm()\n {\n $this->fieldName = null;\n $this->fieldNID = null;\n $this->fieldBCN = null;\n $this->fieldPhone = null;\n $this->fieldEmail = null;\n $this->fieldAddress = null;\n }",
"public function reset() {\n\t\t$this->value = $this->defaultValue;\n\t\t$this->changed = false;\n\t}",
"public function resetValue();",
"public function reset() {\n\t\t$this->value = \"\";\n\t\t$this->classes_input = array();\n\t\t$this->classes_outer = array();\n\t\t$this->message = false;\n\t}",
"public function resetFormular() {\r\n\t\tforeach($this->fieldElements as $row) {\r\n\t\t\tforeach($row as $field) {\r\n\t\t\t\t$field->getForm()->resetForm(); \r\n\t\t\t}\r\n\t\t}\r\n\t\tunset($_SESSION['tx_mailform'][$this->getMailformUID()]);\r\n\t}",
"public function resetInput(){\n\n $this->codigo_turno = null;\n $this->name = null;\n }",
"public function reset()\n {\n $this->hidden = new Form\\Field($this);\n $this->hidden->class = 'hidden';\n $this->buttons = new Form\\Field($this);\n $this->buttons->class = 'buttons';\n $this->fields = array();\n }",
"public function reset()\r\n\t{\r\n\t foreach ($this->_scheme as $oField)\r\n\t {\r\n\t $oField->value = '';\r\n\t }\r\n\t}",
"public function reset()\n {\n foreach ($this->_scheme as $oField)\n {\n $oField->value = '';\n }\n }",
"public function resetForm()\n\t{\n\t\tparent::resetForm();\n\t\t$this->setNeedReinitRulesFlag();\n\t}",
"private function clearForm()\n {\n $this->name = \"\";\n $this->email = \"\";\n $this->phone = \"\";\n $this->message = \"\";\n }",
"public function resetForm() {\n\n\t\tparent::resetForm();\n\t\t$this->setNeedReinitRulesFlag();\n\t}",
"public function resetSelectField();",
"public function resetFieldValue(Field $field, $model);",
"public function resetFieldValues()\n {\n $this->setFormField('default_screen', $this->CFG['html']['template']['default'].'__'.$this->CFG['html']['stylesheet']['screen']['default']);\n $this->setFormField('temp_arr', $this->CFG['html']['template']['allowed']);\n $this->setFormField('css_arr', $this->CFG['html']['stylesheet']['allowed']);\n }",
"public function clearValue(): void\n {\n $this->value = null;\n }",
"public function reset(){\n foreach( $this->model as $key => $field ){\n $this->model->{$key}->value = null;\n }\n }",
"public function clearFormValues () {\n // Reset the values\n self::initDefaultFormValues();\n $this->checkAstroFilterIDs = array();\n $this->checkTables = array();\n $this->selectSurvey = '';\n $this->checkAstroFilterIDs = array();\n $this->checkTables = array();\n $this->checkTableColumnsHash = array();\n $this->formTableColumnFilterHash = array();\n }",
"public function resetSearch() {\r\n\t\t$search_form = $this->createForm();\r\n\t\t$search_form->resetFormInputs();\r\n\r\n\t\t$this->showSearch();\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all NddOutputMaster models. | public function actionIndex() {
$dataProvider = new ActiveDataProvider([
'query' => NddOutputMaster::find()->andWhere(['is_active' => 1]),
]);
return $this->render('index', [
'dataProvider' => $dataProvider,
]);
} | [
"public function actionAll()\n {\n $model = new Masters();\n\n $comments = $model->getCommentsAll();\n $services = $model->getServices();\n $foto = $model->getFoto();\n $pagination = $model->getPagination(Yii::$app->params['mastersOnPage']);\n $masters = $model->getMastersPagination();\n\n return $this->render('index', [\n 'model' => $model,\n 'masters' => $masters,\n 'comments' => $comments,\n 'services' => $services,\n 'foto' => $foto,\n 'pagination' => $pagination,\n 'mastersOnPage' => Yii::$app->params['mastersOnPage'],\n 'pathToRoot' => Yii::$app->params->pathToRoot\n ]);\n }",
"public function listModels()\n\t{\n\t\t$classes = \\SeanMorris\\Ids\\Linker::classes('SeanMorris\\Ids\\Model');\n\n\t\t$classes = array_map(\n\t\t\tfunction($class)\n\t\t\t{\n\t\t\t\treturn str_replace('\\\\', '/', $class);\n\t\t\t}\n\t\t\t, $classes\n\t\t);\n\n\t\tprint implode(PHP_EOL, $classes) . PHP_EOL;\n\t}",
"public function fetchAllAvailableMasterDevices ()\n {\n $qdTableName = DeviceMapper::getInstance()->getTableName();\n\n $sql = \"SELECT * FROM {$this->getTableName()} AS md\n LEFT JOIN {$qdTableName} AS qd ON qd.masterDeviceId = md.id\n WHERE qd.masterDeviceId IS NULL\n ORDER BY md.manufacturer_id ASC, md.printer_model ASC\n \";\n\n $resultSet = $this->getDbTable()\n ->getAdapter()\n ->fetchAll($sql);\n\n $entries = [];\n foreach ($resultSet as $row)\n {\n $object = new MasterDeviceModel($row);\n\n // Save the object into the cache\n $this->saveItemToCache($object);\n\n $entries [] = $object;\n }\n\n return $entries;\n }",
"function _listAll()\n {\n $this->_getTables();\n $this->out('');\n $this->out('Possible Models based on your current database:');\n $this->hr();\n $this->_modelNames = array();\n $i=1;\n foreach ($this->__tables as $table) {\n $this->_modelNames[] = $this->_modelName($table);\n $this->out($i++ . \". \" . $this->_modelName($table));\n }\n }",
"public function actionIndex()\n {\n $searchModel = new MasterSearch();\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 DmposmasterrelateSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $searchPosModel = new DmposSearch();\n $allPos = $searchPosModel->searchAllPos();\n $allPosMap = ArrayHelper::map($allPos,'ID','POS_NAME');\n\n $searchCityModel = new DmcitySearch();\n $allCity = $searchCityModel->searchAllCity();\n $allCityMap = ArrayHelper::map($allCity,'ID','CITY_NAME');\n\n $searchPosMasterModel = new DmposmasterSearch();\n $allPosMaster = $searchPosMasterModel->searchAllPosmaster();\n $allPosMasterMap = ArrayHelper::map($allPosMaster,'ID','POS_MASTER_NAME');\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'allPosMap' => $allPosMap,\n 'allPosMasterMap' => $allPosMasterMap,\n 'allCityMap' => $allCityMap,\n ]);\n }",
"public function get_models(){\n\t\techo $this->manufacturer_model->getModelsData();\n\t}",
"public function index()\n\t{\n\t\t$this->masterlist();\n\t}",
"public function getAllModels(){\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n $autoModel = AutoModels::model()->findAll();\n\n $this->sendResponse([\"success\" => 1, \"data\" => $autoModel]);\n exit();\n }",
"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 models()\n {\n $this->_display('models');\n }",
"public function printermodelsAction ()\n {\n $manufacturerId = $this->getParam('manufacturerid', false);\n $jsonResponse = new stdClass();\n $jsonResponse->rows = [];\n $master_devicesTable = new MasterDeviceDbTable();\n $result = $master_devicesTable->fetchAll(['manufacturerId = ?' => $manufacturerId], 'modelName');\n\n if (count($result) > 0)\n {\n foreach ($result as $row)\n {\n $jsonResponse->rows[] = ['id' => $row['id'], 'cell' => [\n $row ['id'],\n ucwords(strtolower($row ['modelName']))\n\n ]];\n }\n }\n $this->sendJson($jsonResponse);\n }",
"public function export_all() { \n \t$this->set('companyMasters', $this->CompanyMaster->find('all',[ \n\t\t'fields' => ['CompanyMaster.name','CompanyMaster.website','CompanyMaster.location','CompanyMaster.category','CompanyMaster.email','CompanyMaster.contactno','CompanyMaster.training','CompanyMaster.job'] \t\n \t]));\n $this->layout = null;\n \t$this->autoLayout = false;\n}",
"public function actionIndex()\n {\n $searchModel = new CompanyMasterSearch();\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 StuMasterSearch();\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 OrderMasterSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function dbGetModels() {\n header('Content-Type: application/json');\n $data = $this->model->getModels();\n $this->load->raw(json_encode($data));\n }",
"public function getModelsList(){\r\n\t\t$this->db->select(\"id, nome\");\r\n\t\t$this->db->from(\"modelos\");\r\n\t\treturn $this->db->get()->result();\r\n\t}",
"public function getModels();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a default http server request value, if any is available | public function getDefaultHttpServerRequest(): ServerRequestInterface|null; | [
"protected function getDefaultHttpRequest()\n {\n return HttpRequest::createFromGlobals();\n }",
"public abstract function getDefaultRequest();",
"public function getDefaultRequest() {\n }",
"public function getDefaultRequest()\n {\n return $this->DefaultRequest;\n }",
"function REQ( $key, $default = \"\" ){\n return getVal( $_REQUEST, $key, $default );\n }",
"function tribe_get_request_var( $var, $default = null ) {\n\t\t$post_var = Tribe__Utils__Array::get( $_POST, $var );\n\n\t\tif ( null !== $post_var ) {\n\t\t\treturn $post_var;\n\t\t}\n\n\t\t$query_var = Tribe__Utils__Array::get( $_GET, $var );\n\n\t\tif ( null !== $query_var ) {\n\t\t\treturn $query_var;\n\t\t}\n\n\t\treturn $default;\n\t}",
"function fetchRequestValue($key, $default = null)\n {\n return (request()->header($key)) ? request()->header($key) : request($key, $default);\n }",
"function get_http_var($name, $default='') {\n global $lang;\n\n if (is_bool($default)) {\n $allow_changes = true;\n $default = '';\n } else {\n $allow_changes = false;\n }\n\n if (array_key_exists($name, $_GET)) {\n $var = $_GET[$name];\n if (!is_array($var)) $var = trim($var);\n } elseif (array_key_exists($name, $_POST)) {\n $var = $_POST[$name];\n if (!is_array($var)) $var = trim($var);\n } else { \n $var = $default;\n }\n if ($allow_changes && $lang == 'eo')\n $var = input_esperanto($var);\n return $var;\n}",
"function get_request_value($value, $default_value = '', $session_key = '')\n{\n\tif($session_key != '')\n\t{\n\t\tif(isset($_SESSION['request_values'][$session_key][$value]))\n\t\t{\n\t\t\t$default_value = $_SESSION['request_values'][$session_key][$value];\n\t\t}\n\t}\n\tif(isset($_REQUEST[$value]))\n\t{\n\t\t$result = get_value_with_default($_REQUEST[$value], $default_value);\n\t}\n\telse\n\t{\n\t\t$result = $default_value;\n\t}\n\n\tif($session_key != '')\n\t{\n\t\t$_SESSION['request_values'][$session_key][$value] = $result;\n\t}\n\n\treturn $result;\n}",
"function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}",
"function get_http_var($name, $default='') {\n global $lang;\n\n if (is_bool($default)) {\n $allow_changes = true;\n $default = '';\n } else {\n $allow_changes = false;\n }\n\n if (array_key_exists($name, $_GET)) {\n $var = $_GET[$name];\n if (!is_array($var)) $var = trim($var);\n } elseif (array_key_exists($name, $_POST)) {\n $var = $_POST[$name];\n if (!is_array($var)) $var = trim($var);\n } else { \n $var = $default;\n }\n if ($allow_changes && $lang == 'eo')\n $var = input_esperanto($var);\n $var = str_replace(\"\\r\", '', $var);\n return $var;\n}",
"function querystring_get($variable,$default=0) {\r\n $querystring = $_SERVER['QUERY_STRING'];\r\n parse_str($querystring,$values);\r\n if(!isset($values[$variable])) return $default;\r\n else return $values[$variable];\r\n}",
"function get_parameter($name, $default=array()) {\n return !empty($this->request[$name]) ? $this->request[$name] : $default;\n }",
"public function setDefaultRequest() {\n }",
"protected function defaultRouteHandler(): string\n {\n if (isset($_SERVER))\n return $_SERVER['QUERY_STRING'];\n }",
"public function getServerParameter(string $name, mixed $default = null): mixed;",
"function get_default_request_params() {\n\n\t$params = [\n\t\t'user_id' => get_current_user_id(),\n\t\t'body' => false,\n\t\t'form' => false,\n\t\t'require_token' => true,\n\t\t'cache_response' => true,\n\n\t\t// Defaults to parsing JSON, pass 'raw' to return the raw response.\n\t\t'return' => '',\n\n\t\t// Lets us fine tune the cache time for requests.\n\t\t'cache_time' => 0,\n\t];\n\n\treturn apply_filters( 'wp_tesla_api_get_default_request_params', $params );\n}",
"function tryGetRequestValue($key) {\n if (isset($_REQUEST[$key])) {\n return $_REQUEST[$key];\n }\n return null;\n}",
"private function getDefaultServer()\n {\n $servers = $this->getConfig()->getOption('servers', []);\n $default = $this->getConfig()->getOption('default', '');\n if(\\array_key_exists($default, $servers))\n {\n return $default;\n }\n // if(\\count($servers) > 0)\n // {\n // return $servers[0];\n // }\n return '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_flagToBit method Convenience method for getting the bit integer for an flag | protected function _flagToBit(Model $Model, $flag = null) {
$bits = $this->settings[$Model->alias]['bits'];
$flag = strtoupper($flag);
return empty($flag) || !array_key_exists($flag, $bits) ? false : $bits[$flag];
} | [
"public function getFlag($flag)\n\t{\n\t\treturn ($this->_field & $flag); \n\t}",
"function set_bitflag($flags){\n\t$val = 0;\n\tforeach($flags as $flag){\n\t\t$val = $val|constant($flag);\n\t}\n\treturn $val;\n}",
"protected function bitflagToArray($bitflag)\n {\n $bitflag = (int) $bitflag; // '1' and 1 will yield different results hence cast to int\n $highestBitSet = 1 << floor(log10($bitflag) / log10(2));\n\n $setBits = [];\n for ($bit = 1; $bit <= $highestBitSet; $bit *= 2) {\n if (($bit & $bitflag) != 0) {\n $setBits[] = $bit;\n }\n }\n\n return $setBits;\n }",
"public function getBitMask()\n {\n $value = $this->get(self::BITMASK);\n return $value === null ? (integer)$value : $value;\n }",
"function str2bit($str) {\n return (int) str2bool($str);\n}",
"public function getBitmask(): int\n {\n return (int) decbin($this->value);\n }",
"protected function flag($flag) {\n\t\tif(is_int($flag) || ctype_digit(\"$flag\")) return (int) $flag;\n\t\tif($flag === 'partial') return self::flagPartial;\n\t\treturn 0;\n\t}",
"public function getFlag($flag)\n {\n $this->checkIfFlagNameIsValid($flag);\n $userId = ullFlaggable::retrieveLoggedInUserId();\n \n return $this->_plugin->getFlag($this->getInvoker(), $userId, $flag);\n }",
"static function bit_get($value, $bit_position) {\n return Utils::bit_test($value, $bit_position) ? 1 : 0;\n }",
"public static function toBit(NotificationServiceEvent $event): int\n {\n return match ($event) {\n NotificationServiceEvent::Ok => self::CASE_OK_AS_BIT,\n NotificationServiceEvent::Warning => self::CASE_WARNING_AS_BIT,\n NotificationServiceEvent::Critical => self::CASE_CRITICAL_AS_BIT,\n NotificationServiceEvent::Unknown => self::CASE_UNKNOWN_AS_BIT,\n };\n }",
"public function getBit(string $permission) : int\n {\n if (isset($this->map[$permission])) {\n return $this->map[$permission];\n }\n\n return 0;\n }",
"public function getFlags();",
"public function set_bv($bv, $flag)\n {\n $bin_flag = (1 << ($flag));\n\n $ret = ($bv | $bin_flag);\n return $ret;\n }",
"public function getFlags () {}",
"public static function bitFlagAddition(int $flags, int $flag): int\n {\n if (self::bitFlagAssert($flags, $flag)) {\n return $flags;\n }\n\n return $flags | $flag;\n }",
"public function bool_to_bit( $value ) {\n\t\treturn ( ! empty( $value ) && 'false' !== $value ) ? '1' : '';\n\t}",
"protected function buildFlag()\n {\n $final = 0;\n if (!empty($this->flags)) {\n foreach ($this->flags as $flag) {\n if ($final == 0) {\n $final = $flag;\n continue;\n }\n\n $final |= $flag;\n }\n }\n\n return $final;\n }",
"public function getGidBit($bitmap, $bit, $flip = false)\n {\n if (!isset($this->gidFlagValues[$bit])) {\n throw new Net_Vpopmaild_Exception(\n \"Error - unknown GID Bit value specified: $bit\");\n }\n $bitValue = $this->gidFlagValues[$bit];\n if ($flip) {\n return ($bitmap&$bitValue) ? false : true;\n }\n return ($bitmap&$bitValue) ? true : false;\n }",
"public function getFlagType()\n\t{\n\t\treturn $this->flag_type;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as eBayCollectAndRemitTax This boolean field is returned as true if one or more line items in the order are subject to a tax (US sales tax or Australian Goods and Services tax) that eBay will collect and remit to the proper taxing authority on the buyer's behalf. This field is also returned if false (not subject to eBay Collect and Remit). A Transaction.eBayCollectAndRemitTaxes container is returned for any order line items subject to such a tax, and the type and amount of this tax is displayed in the Transaction.eBayCollectAndRemitTaxes.TaxDetails container. Australian 'Goods and Services' tax (GST) is automatically charged to buyers outside of Australia when they purchase items on the eBay Australia site. Sellers on the Australia site do not have to take any extra steps to enable the collection of GST, as this tax is collected by eBay and remitted to the Australian government. For more information about Australian GST, see the help topic. As of November 2021, buyers in all US states except for Missouri (and several US territories), will automatically be charged sales tax for purchases, and the seller does not set this rate. eBay will collect and remit this sales tax to the proper taxing authority on the buyer's behalf. For more US statelevel information on sales tax, see the help topic. | public function getEBayCollectAndRemitTax()
{
return $this->eBayCollectAndRemitTax;
} | [
"public function setEBayCollectAndRemitTax($eBayCollectAndRemitTax)\n {\n $this->eBayCollectAndRemitTax = $eBayCollectAndRemitTax;\n return $this;\n }",
"public function getTaxCanceled();",
"public function getTaxRefunded();",
"public static function calculate_tax_filter() {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_private_token'] ) ) {\n $private_key = $edd_options['taxedd_private_token'];\n \n try { \n\n $taxtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n\n $cart_items = edd_get_cart_content_details();\n\n $countrycode = \"\";\n\n $address = edd_get_customer_address();\n\n if ( isset($address['country']) && !empty($address['country']) && \"\" !== $address['country'] ) {\n $countrycode = $address['country'];\n } else {\n $ipcc = taxedd_get_country_code();\n $countrycode = $ipcc->country_code;\n }\n\n $transaction = new Input_transaction();\n $transaction->currency_code = edd_get_currency();\n $transaction->buyer_ip = $_SERVER['REMOTE_ADDR'];\n $transaction->billing_country_code = $countrycode;\n $transactionarray = array();\n $customid = \"\";\n $transaction->force_country_code = $countrycode;\n\n if ( !empty( $cart_items ) ) { \n foreach ( $cart_items as $cart_item ) {\n\n $customid++;\n $transaction_line = new Input_transaction_line();\n $transaction_line->amount = $cart_item['item_price'];\n $transaction_line->custom_id = $cart_item['name'] . $customid;\n array_push( $transactionarray, $transaction_line );\n\n }\n }\n\n $transaction->transaction_lines = $transactionarray;\n\n $resp = $taxtaxamo->calculateTax( array( 'transaction' => $transaction ) );\n\n return $resp->transaction->tax_amount;\n\n } catch ( exception $e ) {\n\n return \"\";\n }\n }\n }",
"public function hasTax()\n {\n return false;\n }",
"function apply_before_tax() {\n\t\tif ($this->apply_before_tax=='yes') return true; else return false;\n\t}",
"public function hasTaxRules();",
"public function getDiscountTaxCompensationRefunded();",
"public function includeTax()\n {\n if ($this->getTotal()->getValue()) {\n return $this->_taxConfig->displayCartTaxWithGrandTotal($this->getStore());\n }\n return false;\n }",
"public function getTaxInvoiced();",
"public function calculate_taxes() {\n\n\t\t$this->calculate_taxes = ( wc_tax_enabled() && 'yes' === get_option( 'wc_avatax_enable_tax_calculation' ) );\n\n\t\t/**\n\t\t * Filter whether AvaTax calculation is enabled.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param bool $calculate_taxes Whether AvaTax calculation is enabled.\n\t\t */\n\t\treturn (bool) apply_filters( 'wc_avatax_calculate_taxes', $this->calculate_taxes );\n\t}",
"public function getIsShippingTaxChanged();",
"public function getBaseTaxCanceled();",
"public function isImmediateReseller(): bool\n {\n return $this->isImmediateReseller;\n }",
"public function getIsTaxIncluded()\n {\n return $this->IsTaxIncluded;\n }",
"public function get_taxes() {\n\t\treturn apply_filters( 'woocommerce_cart_get_taxes', wc_array_merge_recursive_numeric( $this->get_shipping_taxes(), $this->get_cart_contents_taxes(), $this->get_fee_taxes() ), $this );\n\t}",
"public function isSetItemTax()\n {\n return !is_null($this->_fields['ItemTax']['FieldValue']);\n }",
"function isTaxable(){\r\n\t\treturn receiptEntryTypes::$validTypes[$this->type]['taxable'];\r\n\t}",
"protected function amount_include_tax(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ambil data bonus_setail berdasarkan $kode_bonus | public function bonus_detail($kode_bonus){
$dataBonusDetail = $this->admin_model->getBonusDetail($kode_bonus);
$data['databonusdetail'] = $dataBonusDetail;
$this->load->view('admin/header');
$this->load->view('admin/bonusdetail', $data);
$this->load->view('admin/footer');
} | [
"public function descontar_bonus() {\n $usuario = $this->db->where('di_id', $this->compra->co_id_distribuidor)\n ->get('distribuidores')->row();\n\n $this->db->insert('conta_bonus', array(\n 'cb_debito' => $this->compra->co_total_valor,\n 'cb_tipo' => 3,\n 'cb_descricao' => \"VOUCHER empresa, PAGAMENTO DA COMPRA Nº:\" . $this->compra->co_id . \" usuario <b>{$usuario->di_usuario}</b>\",\n 'cb_distribuidor' => ($this->di_id_patrocinador != 0 ? $this->di_id_patrocinador : $this->compra->co_id_distribuidor),\n ));\n }",
"public function api_setBonus(){\n $db = $this->Member->getDataSource();\n $this->_checkVars ( array ('reason','amount'), array ());\n \n $reason=$this->api['reason'];\n $amount=$this->api['amount'];\n \n $query_maxop=\"SELECT MAX(operation) as max FROM tmp_bonus\";\n try {\n $res=$db->fetchAll($query_maxop);\n }\n catch (Exception $e)\n {\n debug($e);\n return false;\n }\n \n $opnum=$res[0][0]['max'] + 1;\n \n \n //Questa query copia gli id membri attivi nella tabella tmp_bonus\n $query_copy=\"INSERT INTO tmp_bonus(member_id,reason,amount,operation) \".\n \"SELECT big,'$reason','$amount','$opnum' \".\n \"FROM members \".\n \"WHERE status<255 AND big IN (45545831,45517058,45710937) \".\n \"ORDER BY big ASC\";\n \n try {\n $db->fetchAll($query_copy);\n }\n catch (Exception $e)\n {\n debug($e);\n return false;\n }\n \n //return($opnum);\n $result['operation_id']=$opnum; \n $this->_apiOK($result); \n \n }",
"public function api_setBonus(){\n $db = $this->Member->getDataSource();\n $this->_checkVars ( array ('reason','amount'), array ());\n \n $reason=$this->api['reason'];\n $amount=$this->api['amount'];\n \n $query_maxop=\"SELECT MAX(operation) as max FROM tmp_bonus\";\n try {\n $res=$db->fetchAll($query_maxop);\n }\n catch (Exception $e)\n {\n debug($e);\n return false;\n }\n \n $opnum=$res[0][0]['max'] + 1;\n \n \n //Questa query copia gli id membri attivi nella tabella tmp_bonus\n $query_copy=\"INSERT INTO tmp_bonus(member_id,reason,amount,operation) \".\n \"SELECT big,'$reason','$amount','$opnum' \".\n \"FROM members \".\n \"WHERE status<255 \". // AND big IN (45545831,45517058,45710937) \".\n \"ORDER BY big ASC\";\n \n try {\n $db->fetchAll($query_copy);\n }\n catch (Exception $e)\n {\n debug($e);\n return false;\n }\n \n //return($opnum);\n $result['operation_id']=$opnum; \n $this->_apiOK($result); \n \n }",
"public function setBonus($bonus) {\n\t\t$this->bonus = $bonus;\n\t}",
"public function setBonus(int $bonus): void\n {\n $this->bonus = $bonus;\n }",
"private function save_bonus()\n { global $wpdb;\n \n $table = $wpdb->base_prefix.mc_ewallet::DB_PRIMARY;\n \n $transaction = array(\n 'bonus_uid',\n 'bonus_title',\n 'bonus_type', \n 'bonus_value',\n 'timestamp' => $_SERVER['REQUEST_TIME']\n );\n \n $transaction = apply_filters('before_points_transaction', $transaction);\n \n $results = $wpdb->insert($table, $transaction, array('%d','%s','%s','%d','%d')); \n \n if ($results){\n $this->insert_id = $wpdb->insert_id;\n do_action('after_save_bonus', $this->insert_id, $transaction);\n }\n \n }",
"public function bonus() {\n\t\tCheckAdminLoginSession();\n\t\t$per_page = 20;\n if($this->uri->segment(4)) {\n \t$page = ($this->uri->segment(4)) ;\n }\n else {\n \t$page = 1;\n }\n\n $company_id \t = $this->input->get('bonus_company_id');\n $branch_id \t = $this->input->get('bonus_branch_id');\n\n $start = ($page-1)*$per_page;\n $limit = $per_page;\n $totalCount = $this->admin_model->totalRecord($this->selected_bonus);\n\t\t$data[\"dataCollection\"] = $this->admin_model->getDataCollection($this->selected_bonus,$limit,$start);\n $totalResult = count($data['dataCollection']);\n\t\t$data[\"pagination\"] = Jpagination($totalCount,$limit,$start);\n\t\t$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\";\n\t\t$explodedURL = parse_url($url);\n\t\t$data[\"current_link\"] = $explodedURL['scheme'].'://'.$explodedURL['host'].$explodedURL['path'];\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/approve/approve_bonus',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}",
"function hitung_saldo_akun($kodeAkunPenerimaan, $tahunSaldo, $bulanSaldo) {\n\tglobal $mysqli;\n\t\n\t//saldo awal\n\t$resultSaldoAwal = mysqli_query(\n\t\t$mysqli,\n\t\t\"SELECT * FROM saldo_awal WHERE id_akun='\".$kodeAkunPenerimaan.\"'\"\n\t);\n\t$rowSaldo = mysqli_fetch_array($resultSaldoAwal);\n\t$saldoAwal = ($rowSaldo==null?0:$rowSaldo['saldo']);\n\t\n\t//penerimaan Bulan Lalu\n\t$queryPenerimaan = sprintf(\n\t\t\"SELECT SUM(jumlah) as jumlah FROM penerimaan WHERE id_akun='%s' AND tanggal < '%04d-%02d-01'\",\n\t\t$kodeAkunPenerimaan, $tahunSaldo, $bulanSaldo\n\t);\n\t$resultPenerimaan = mysqli_query($mysqli, $queryPenerimaan);\n\t$tmp = mysqli_fetch_array($resultPenerimaan);\n\t$penerimaan_bln_lalu = $tmp['jumlah'];\n\t\n\t// Pengeluaran bulan lalu\n\t// => diambil dari pengeluaran yang menggunakan sumber dana $kodeAkunPenerimaan\n\t$queryPengeluaran = sprintf(\n\t\t\"SELECT SUM(jumlah) as jumlah FROM penyaluran WHERE sumber_dana='%s' AND tanggal < '%04d-%02d-01'\",\n\t\t$kodeAkunPenerimaan, $tahunSaldo, $bulanSaldo\n\t);\n\t$resultPenerimaan = mysqli_query($mysqli, \"A\");\n\t$tmp = mysqli_fetch_array($resultPenerimaan);\n\t$penerimaan_bln_lalu = $tmp['jumlah'];\n}",
"function add_surat_tambahan_data_penyalur() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal $_POST, $adodb, $ses;\n\t\t$record = $_POST;\n\n\t\t$rs = $adodb->Execute(\"SELECT * FROM surat_tambahan_data_penyalur WHERE id_surat_tambahan_data_penyalur = '{$record['oldpkvalue']}'\");\n\t\tif ($rs && ! $rs->EOF) {\n\t\t\t$record['date_surat'] = $this->parsedate(trim($_POST['date_surat']));\n\t\t\t$adodb->Execute($adodb->GetUpdateSQL($rs, $record, 1));\n\t\t\t$st = \"Updated\";\n\t\t} else {\n\t\t\t$record['date_surat'] = $this->parsedate(trim($_POST['date_surat']));\n\t\t\t$record['insert_by'] = $ses->loginid;\n\t\t\t$record['date_insert'] = time();\n\t\t\t$rs = $adodb->Execute(\"SELECT * FROM surat_tambahan_data_penyalur WHERE id_surat_tambahan_data_penyalur = NULL\");\n\t\t\t$adodb->Execute($adodb->GetInsertSQL($rs, $record));\n\t\t\t$st = \"Added\";\n\t\t}\n\t\t$status = \"Successfull $st '<b>{$record['id_surat_tambahan_data_penyalur']}</b>'\";\n\t\t$this->log($status);\n\t\t$_block = new block();\n\t\t$_block->set_config('title', 'Status Surat Tambahan Data Izin Penyalur');\n\t\t$_block->set_config('width', \"90%\");\n\t\t$_block->parse(array(\"*\".$status));\n\t\treturn $_block->get_str();\n\t}",
"public function penalty()\n\t{\n\t\t$data['judul']\t= \"Buat Penalty SKI\";\n\n\t\t$nipeg \t\t\t= $this->session->userdata('ses_nipeg');\n\t\t$data['poto'] \t= $this->get_url_photo($nipeg);\n\n\t\t$status = $this->Model_karyawan->get_data_status();\n\t\t\tforeach ($status->result_array() as $st ) {\n\t\t\t\t$data['status'] = $st['status_tw'];\n\t\t\t\t$data['tst'] \t= $st['TST'];\n\t\t\t\t$data['thn']\t= $st['tahun'];\n\t\t\t}\n\n\t\t$data['divisi_belum']\t= $this->Model_master_penalty->get_divisi_blm()->result();\n\t\t$data['divisi_belum_h']\t= $this->Model_master_penalty->get_divisi_blm_h();\n\t\t$data['divisi_sudah']\t= $this->Model_master_penalty->get_divisi_sdh()->result();\n\t\t$data['divisi_sudah_h']\t= $this->Model_master_penalty->get_divisi_sdh_h();\n\n\t\t$this->template->load('template_admin','master/penalty/lihat_data', $data);\n\t}",
"public function setBonusCode($bonusCode)\n {\n $this->bonusCode = $bonusCode;\n return $this;\n }",
"public function cetak_bku($id_saldo)\n {\n // FROM tb_transaksi JOIN tb_saldoawal ON tb_saldoawal.id_saldo = tb_transaksi.id_saldo \n // JOIN tb_jnspengeluaran ON tb_transaksi.kdjnspengeluaran = tb_jnspengeluaran.kdjnspengeluaran\n // JOIN tb_pajak ON tb_transaksi.notransaksi = tb_pajak.notransaksi\n // WHERE tb_saldoawal.id_saldo = $id_saldo \")->result();\n\n // $data['jumtot'] = $this->db->query(\" SELECT SUM(saldomasuk) as tot FROM tb_saldoawal \")->result();\n // $data['jumkel'] = $this->db->query(\" SELECT SUM(tb_transaksi.jumlah) as totkel \n // FROM tb_saldoawal JOIN tb_transaksi ON tb_saldoawal.id_saldo = tb_transaksi.id_saldo \")->result();\n\n // $data['idsaldo'] = $this->db->query(\" SELECT * FROM tb_saldoawal WHERE id_saldo = $id_saldo LIMIT 1\")->result();\n\n $data['laporan'] = $this->db->query(\" SELECT tb_transaksi.kode_rekening, tb_jnspengeluaran.uraian, tb_transaksi.tgltransaksi, tb_transaksi.notransaksi, tb_transaksi.jumlah, tb_transaksi.carapembayaran, tb_transaksi.namatoko, tb_transaksi.alamattoko, tb_pajak.ppn, tb_pajak.pph21, tb_pajak.pph22, tb_pajak.pph23, tb_pajak.pphlain\n FROM tb_transaksi JOIN tb_saldoawal ON tb_saldoawal.id_saldo = tb_transaksi.id_saldo \n JOIN tb_jnspengeluaran ON tb_transaksi.kdjnspengeluaran = tb_jnspengeluaran.kdjnspengeluaran\n JOIN tb_pajak ON tb_transaksi.notransaksi = tb_pajak.notransaksi\n WHERE tb_saldoawal.id_saldo = $id_saldo \")->result();\n\n $data['idsaldo'] = $this->db->query(\" SELECT * FROM tb_saldoawal WHERE id_saldo = $id_saldo LIMIT 1\")->result();\n $data['jumsisa'] = $this->db->query(\" SELECT SUM(jumlahsaldosisa) as jumsis FROM tb_saldoawal WHERE id_saldo = $id_saldo\")->result();\n $data['jumtunai'] = $this->db->query(\" SELECT SUM(tb_transaksi.jumlah) as tunai FROM tb_transaksi JOIN tb_jnspengeluaran ON tb_transaksi.kdjnspengeluaran = tb_jnspengeluaran.kdjnspengeluaran WHERE tb_transaksi.id_saldo = $id_saldo AND tb_transaksi.carapembayaran = 'Tunai' \")->result();\n $data['jumnontunai'] = $this->db->query(\" SELECT SUM(tb_transaksi.jumlah) as nontunai FROM tb_transaksi JOIN tb_jnspengeluaran ON tb_transaksi.kdjnspengeluaran = tb_jnspengeluaran.kdjnspengeluaran WHERE tb_transaksi.id_saldo = $id_saldo AND tb_transaksi.carapembayaran = 'Non-Tunai' \")->result();\n\n $data['jumppn'] = $this->db->query(\" SELECT SUM(ppn) as ppn FROM tb_pajak WHERE id_saldo = $id_saldo \")->result();\n $data['jumpph21'] = $this->db->query(\" SELECT SUM(pph21) as pph21 FROM tb_pajak WHERE id_saldo = $id_saldo \")->result();\n $data['jumpph22'] = $this->db->query(\" SELECT SUM(pph22) as pph22 FROM tb_pajak WHERE id_saldo = $id_saldo \")->result();\n $data['jumpph23'] = $this->db->query(\" SELECT SUM(pph23) as pph23 FROM tb_pajak WHERE id_saldo = $id_saldo \")->result();\n $data['jumpphlain'] = $this->db->query(\" SELECT SUM(pphlain) as pphlain FROM tb_pajak WHERE id_saldo = $id_saldo \")->result();\n\n $data['bendahara'] = $this->db->query(\" SELECT * FROM tb_user WHERE hakakses = 'bendahara' LIMIT 1 \")->result();\n$data['pembantu'] = $this->db->query(\"SELECT * FROM tb_user WHERE hakakses = 'pembantu' LIMIT 1 \")->result();\n $data['kadin'] = $this->db->query(\"SELECT * FROM tb_user WHERE hakakses = 'kadin' LIMIT 1\")->result(); \n\n\n $this->load->view('bendahara/cetak_laporan', $data);\n }",
"function tambah_keranjang($id_produk, $jumlah_pembelian)\n\t{\n\t\tif(isset($_SESSION['keranjang'][$id_produk]))\n\t\t{\n\t\t\t// session keranjang dengan id_produk yang sama jumlah belinya di tambahkan dengan jumlah beli yang diinput\n\t\t\t$_SESSION['keranjang'][$id_produk]+=$jumlah_pembelian;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$_SESSION['keranjang'][$id_produk] = $jumlah_pembelian;\n\t\t}\n\t\t// mengambil data stok lama\n\t\t$produklama = $this->ambil_produk($id_produk);\n\n\t\t// mengambil stok produk\n\t\t$sisa_stok = $produklama['stok_produk']-$jumlah_pembelian;\n\n\t\t$this->koneksi->query(\"UPDATE produk SET stok_produk='$sisa_stok' WHERE id_produk='$id_produk'\");\n\n\n\t}",
"public function hitung_saldo_awal($tgl_mulai,$id_akun)\r\n {\r\n\r\n $this->db->select('*,SUM(IF(akun_biaya='.$id_akun.',biaya,0)) AS tot_biaya,SUM(IF(akun_potongan='.$id_akun.',diskon2,0)) AS potongan,SUM(IF(akun_total='.$id_akun.',tagihan,0)) AS biaya_total');\r\n $this->db->from('transaksi_penjualan');\r\n $this->db->where('transaksi_penjualan.tgl_diterima <',$tgl_mulai);\r\n $query=$this->db->get();\r\n return $query->result();\r\n }",
"public function tambah_depo_stok($kodeBrg,$jumlah,$kodeBagian) {\r\n\t\t\tif (is_numeric($jumlah)) {\r\n\t\t\t\t$jml_sat_kcl=baca_tabel(\"mt_depo_stok\",\"jml_sat_kcl\",\"WHERE kode_brg='\".$kodeBrg.\"' AND kode_bagian='\".$kodeBagian.\"'\");\r\n\t\t\t\t$jml_sat_kcl_sekarang = $jml_sat_kcl + $jumlah;\r\n\r\n\t\t\t\t$fld=array();\r\n\t\t\t\t$fld[\"jml_sat_kcl\"] = $jml_sat_kcl_sekarang;\r\n\t\t\t\tupdate_tabel(\"mt_depo_stok\",$fld,\"WHERE kode_brg='\".$kodeBrg.\"' AND kode_bagian='\".$kodeBagian.\"'\");\r\n\t\t\t}\r\n\t\t}",
"public function daftar_pengadaan_kapitalisasi_berdasarkan_skpd($skpd,$tglPerolehanAwal,$tglPerolehanAkhir){\n //custom kontrak kapitalisasi \n $query=\"select K.Uraian, A.info,A.kodeKelompok,A.kodeSatker, A.noKontrak,A.StatusValidasi, Sum(NilaiPerolehan) as Total,\n Sum(Kuantitas) as Jumlah,NilaiPerolehan as Satuan from aset A \n inner join kelompok K on K.Kode=A.kodeKelompok \n inner join kontrak Ka on Ka.noKontrak = A.noKontrak \n where A.kodeSatker like '$skpd%' and ka.tglKontrak>='$tglPerolehanAwal' and ka.tglKontrak<='$tglPerolehanAkhir' \n and A.noKontrak is not null and A.StatusValidasi is null \n and Ka.n_status = 1 and Ka.tipeAset = 2 \n group by A.kodeSatker,A.kodeKelompok,A.noKontrak\"; \n\n //echo $query;\n $result = $this->query($query) or die($this->error());\n $check = $this->num_rows($result);\n while ($data = $this->fetch_array($result)) {\n \n list($tglKontrak,$keterangan,$nosp2d,$tglsp2d,$status_kontrak)= $this->get_kontrak($data[noKontrak]);\n $data['tglkontrak'] = $tglKontrak;\n $data['Satker']= $this->get_skpd($data['kodeSatker']);\n $data['keterangan'] = $keterangan;\n $data['nosp2d'] = $nosp2d;\n $data['tglsp2d'] = $tglsp2d;\n //if($status_kontrak==1)\n $dataArr[] = $data;\n }\n // pr($dataArr);\n return $dataArr;//array('dataArr' => $dataArr, 'count' => $check);\n }",
"function buatkode($nomor_terakhir, $kunci, $jumlah_karakter = 0)\n{\n $nomor_baru = intval(substr($nomor_terakhir, strlen($kunci))) + 1;\n// menambahkan nol didepan nomor baru sesuai panjang jumlah karakter\n $nomor_baru_plus_nol = str_pad($nomor_baru, $jumlah_karakter, \"0\", STR_PAD_LEFT);\n// menyusun kunci dan nomor baru\n $kode = $kunci . $nomor_baru_plus_nol;\n return $kode;\n}",
"function hapus_data_karyawan()\n\t{\n\t\t$id = $this->input->post('no_induk');\n\t\tif($id == ''){\n\t\t\tredirect('tampil-data-karyawan','refresh');\n\t\t}\n\t\t$data2 = array(\n\t\t\t'tgl_keluar' => date('Y-m-d', strtotime($this->input->post('tgl_keluar'))),\n\t \t\t'status' => 'nonactive'\n\t\t);\n\t \t$cek = $this->mdl_crud->update_data('dt_employees', $id, $data2, 'no_induk');\n\t \t$employee = $this->mdl_crud->view_data_row('dt_employees', 'no_induk', $id);\n\t \tif($cek){\n\t \t\t$ket = \"Berhasil Menonaktifkan Data Karyawan [ $employee->nama ]\";\n\t \t\t$this->log_data($ket);\n\t \t\t$this->session->set_flashdata('nonaktif', \"Berhasil Menonaktifkan karyawan [ $employee->nama ]\");\n\t \t\tredirect('tampil-data-karyawan','refresh');\n\t \t}else{\n\t \t\t$ket = \"Gagal Menonaktifkan Data Karyawan [ $employee->nama ]\";\n\t \t\t$this->log_data($ket);\n \t$this->session->set_flashdata('failed_add', \"Karyawan [ $employee->nama ] Gagal Dinonaktifkan\");\n \tredirect('tampil-data-karyawan','refresh');\n\t \t}\n\n\t}",
"function cekTransaksiAddCreditNoteList($nmTransaksi='',$data,$maxId,$tblName){\n\t\t\tif($nmTransaksi=='ReturCustomer') { \n\t\t\t\t$this->henry->db->select('accountId');\n\t\t\t\t$this->henry->db->select('lokasiId');\n\t\t\t\t$this->henry->db->select('mataUangId');\n\t\t\t\t$this->henry->db->select('debitKredit');\n\t\t\t\t$this->henry->db->from('AssigmentAccounting');\n\t\t\t\t$this->henry->db->where('AssigmentAccounting.barangId',$data['barangId']);\n\t\t\t\t$this->henry->db->where('AssigmentAccounting.tableTransaksi',$nmTransaksi);\n\t\t\t\t$query=$this->henry->db->get(); \n\t\t\t\t\n\t\t\t\tif($query) \n\t\t\t\t{\n\t\t\t\t\t$jurnal = $query->row_array(); \n\t\t\t\t\t// get jumlah harga satuan [ada di poList]\n\t\t\t\t\t$this->henry->db->select('creditNoteHarga');\n\t\t\t\t\t$this->henry->db->select('creditNoteJumlah');\n\t\t\t\t\t\n\t\t\t\t\t$this->henry->db->from('CreditNoteList');\n\t\t\t\t\t//$this->henry->db->where('CreditNoteList.creditNoteListId',$data['creditNoteListId']);\n\t\t\t\t\t$this->henry->db->where('CreditNoteList.barangId',$data['barangId']);\n\t\t\t\t\t$query2=$this->henry->db->get();\n\t\t\t\t\t$resHargaSatuan=$query2->row_array();\n\t\t\t\t\t// get Kurs\n\t\t\t\t\t$this->henry->db->select('kurs');\n\t\t\t\t\t$this->henry->db->from('CreditNote');\n\t\t\t\t\t$this->henry->db->where('CreditNote.creditNoteId',$data['creditNoteId']);\n\t\t\t\t\t$query3=$this->henry->db->get();\n\t\t\t\t\t$resKurs=$query3->row_array();\n\t\t\t\t\t// array utk add data to jurnal\n\t\t\t\t\tif($jurnal['debitKredit']=='Debit') \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dataToJurnal['ayatJurnalDebit']= $resHargaSatuan['creditNoteHarga']*$resHargaSatuan['creditNoteJumlah'];\n\t\t\t\t\t\t}\n\t\t\t\t\telseif($jurnal['debitKredit']=='Kredit') \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dataToJurnal['ayatJurnalKredit']=$resHargaSatuan['creditNoteHarga']*$resHargaSatuan['creditNoteJumlah'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$dataToJurnal['accountId']\t=$jurnal['accountId'];\n\t\t\t\t\t$dataToJurnal['mataUangId']\t=$jurnal['mataUangId'];\n\t\t\t\t\t$dataToJurnal['lokasiId']\t=$jurnal['lokasiId'];\n\t\t\t\t\t$dataToJurnal['tableId']\t= $maxId['maxId']; \n\t\t\t\t\t$dataToJurnal['tableName']\t= $tblName;\n\t\t\t\t\tif ($resKurs['kurs']<=0) {\n\t\t\t\t\t\t$resKurs['kurs']=1;\n\t\t\t\t\t}\n\t\t\t\t\t$dataToJurnal['kurs']\t\t=$resKurs['kurs'];\n\t\t\t\t\t$dataToJurnal['typeJurnalId']\t=1;\n\t\t\t\t\t$dataToJurnal['userId']\t=getUserId();\n\t\t\t\t\t$dataToJurnal['ayatJurnalTanggalTransaksi']\t= date('Y-m-d');\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$dataToJurnal ['ayatJurnalCreateTime'] = date ( 'Y-m-d H:i:s' );\n \t\t\t$dataToJurnal ['ayatJurnalModifiedTime'] = date ( 'Y-m-d H:i:s' );\n\t\t\t\t\n \t\t\t$this->addToJurnal($dataToJurnal);\n\t\t\t\t\n \t\t\t}\n \t\t\telse \n \t\t\t{\t\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
StreamPreparators are passed the tokenStream as only argument. StreamPreparators manipulate the passed tokenStream. They shall not return. | public function registerStreamPreparator($callback) {
if (!is_callable($callback)) {
throw new InvalidArgumentException('Stream Preparator not callable!');
}
$this->streamPreparators[] = $callback;
} | [
"function prepend_stream_filter($stream, callable $xf, $readWrite)\n{\n register_stream_filter();\n return stream_filter_prepend($stream, 'transducer', $readWrite, $xf);\n}",
"function stream_filter_prepend($stream, $filtername, $filterparams) {}",
"function stream_filter_prepend($stream, string $filter_name, int $mode = 0, mixed $params) {}",
"function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL)\n{\n $ret = @stream_filter_prepend($stream, register(), $read_write, $callback);\n\n if ($ret === false) {\n $error = error_get_last() + array('message' => '');\n throw new RuntimeException('Unable to prepend filter: ' . $error['message']);\n }\n\n return $ret;\n}",
"function stream_filter_prepend ($stream, $filtername, $read_write = null, $params = null) {}",
"function stream_filter_prepend ($stream, $filtername, $read_write, $filterparams) {}",
"function forStreamingOnly()\n {\n $this->token->type = 'stream';\n\n return $this;\n }",
"function _preparse()\n\t{\n\t\t// default: assign _text to _preparsed, to be overwritten by filters\n\t\t$this->_preparsed = $this->_text;\n\n\t\t// return if this is a subclass\n\t\tif (is_subclass_of($this, 'HTML_BBCodeParser')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// walk through the filters and execute _preparse\n\t\tforeach ($this->_filters as $filter) {\n\t\t\t$filter->setText($this->_preparsed);\n\t\t\t$this->_preparsed = $filter->getPreparsed();\n\t\t}\n\t}",
"function _preparse()\r\n {\r\n /* default: assign _text to _preparsed, to be overwritten by filters */\r\n $this->_preparsed = $this->_text;\r\n\r\n /* return if this is a subclass */\r\n if (is_subclass_of($this, 'HTML_BBCodeParser')) return;\r\n\r\n /* walk through the filters and execute _preparse */\r\n foreach ($this->_filters as $filter) {\r\n $filter->setText($this->_preparsed);\r\n $filter->_preparse();\r\n $this->_preparsed = $filter->getPreparsed();\r\n }\r\n }",
"public function parse(TokenStream $stream);",
"abstract public function preprocessInputStream(string $input): void;",
"public function pre_process() {\n\t\tfor ($i = 0; $i < count($this->filters); $i++) {\n\t\t\t$this->filters[$i]->pre_process($this->request, $this->response);\n\t\t}\n\t}",
"public function warmFromStream($key, $stream);",
"protected function _preRead($signature)\n {\n if ( !$this->isConnected() ) {\n /**\n * @uses Parsonline_Exception_StreamException\n */\n require_once('Parsonline/Exception/StreamException.php');\n throw new Parsonline_Exception_StreamException(\n 'Failed to read from stream. Stream connection is lost',\n Parsonline_Exception_StreamException::CONNECTION, null,\n $this->_stream\n );\n }\n \n if ( $this->_strictModeChecking && $this->isWriteOnly() ) {\n /**\n * @uses Parsonline_Exception_ContextException\n */\n require_once('Parsonline/Exception/ContextException.php');\n throw new Parsonline_Exception_ContextException(\n 'Failed to read from stream. Stream is write only'\n );\n }\n \n $this->clearReadBuffer();\n }",
"public function preProcess();",
"private function getXmpData($stream)\n {\n while (!feof($stream)) {\n $chunk = fread($stream, $this->chunkSize);\n\n foreach (str_split($chunk) as $char) {\n if (!$this->started) {\n $this->searchForTokenStart($char);\n } else {\n $this->searchForTokenEnd($char);\n }\n\n if ($this->ended) {\n break 2;\n }\n }\n }\n\n if ($this->started && $this->ended) {\n $this->buffer = $this->tokenStart . $this->buffer;\n } else {\n $this->buffer = '';\n }\n }",
"public function preIntercept($preInterceptor);",
"protected function processParent(IReflection $parent, Stream $tokenStream)\n\t{\n\t\tif (!$parent instanceof ReflectionFunctionBase) {\n\t\t\tthrow new Exception\\ParseException($this, $tokenStream, 'The parent object has to be an instance of TokenReflection\\ReflectionFunctionBase.', Exception\\ParseException::INVALID_PARENT);\n\t\t}\n\n\t\t// Declaring function name\n\t\t$this->declaringFunctionName = $parent->getName();\n\n\t\t// Position\n\t\t$this->position = count($parent->getParameters());\n\n\t\t// Declaring class name\n\t\tif ($parent instanceof ReflectionMethod) {\n\t\t\t$this->declaringClassName = $parent->getDeclaringClassName();\n\t\t}\n\n\t\treturn parent::processParent($parent, $tokenStream);\n\t}",
"private function lexOne(Stream $stream)\n {\n if ($stream->current() === false) {\n return false;\n }\n\n if ($stream->isOnGroupOpen()) {\n $token = $this->lexGroupOpen();\n } elseif ($stream->isOnGroupClose()) {\n $token = $this->lexGroupClose();\n } elseif ($stream->isOnLiteral()) {\n $token = ($this->lexText)($stream);\n } elseif ($stream->isOnImplicitParagraph()) {\n $token = $this->lexImplicitParagraph($stream);\n } elseif ($stream->isOnControlWord()) {\n $token = ($this->lexControlWord)($stream);\n } elseif ($stream->isOnControlSymbol()) {\n $token = ($this->lexControlSymbol)($stream);\n } elseif ($stream->isOnTab()) {\n $token = $this->lexTab();\n } elseif ($stream->isOnOther()) {\n $token = $this->lexOther($stream);\n } else {\n $token = ($this->lexText)($stream);\n }\n\n $stream->next();\n\n return $token;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create composer mock to return composer extra config | private function getComposerMock(array $extra = [])
{
$package = $this->getMockBuilder(Package::class)
->disableOriginalConstructor()
->getMock();
$package->expects($this->atLeast(1))->method('getExtra')->willReturn($extra);
$composer = $this->getMockBuilder(Composer::class)
->disableOriginalConstructor()
->getMock();
$composer->expects($this->atLeast(1))->method('getPackage')->willReturn($package);
return $composer;
} | [
"protected function mockConfig()\n {\n $config = $this->getMock('Contao\\\\CoreBundle\\\\Adapter\\\\ConfigAdapter', ['isComplete']);\n\n $config\n ->expects($this->any())\n ->method('isComplete')\n ->willReturn(true)\n ;\n\n $config\n ->expects($this->any())\n ->method('get')\n ->willReturnCallback(function ($key) {\n switch ($key) {\n case 'characterSet':\n return 'UTF-8';\n\n case 'timeZone':\n return 'Europe/Berlin';\n\n default:\n return null;\n }\n })\n ;\n\n return $config;\n }",
"private function createConfigurationMock()\n {\n return $this->getMock('Ivory\\HttpAdapter\\ConfigurationInterface');\n }",
"public function createHookConfigMock()\n {\n return $this->getMockBuilder(Hook::class)\n ->disableOriginalConstructor()\n ->getMock();\n }",
"public function getComposerConfig()\n {\n /*\n * Read the composer.json file.\n * All information we need is store in it.\n */\n $parsed = json_decode(file_get_contents($this->composerJsonPath), true);\n // check if our info is here\n if (!array_key_exists('extra', $parsed)) {\n $parsed['extra'] = array('phar-builder' => array());\n } elseif (!array_key_exists('phar-builder', $parsed['extra'])) {\n $parsed['extra']['phar-builder'] = array();\n }\n return $parsed['extra']['phar-builder'];\n }",
"protected function mockConfig()\n {\n return Mockery::mock(Config::class);\n }",
"private function createContainerBuilderMock()\n {\n return $this->getMockBuilder(ContainerBuilder::class)\n ->setMethods(['getExtensionConfig', 'getParameterBag'])\n ->getMock();\n }",
"protected function getMockConfig()\n {\n if (empty($this->config)) {\n $this->config = $this->getMock(\n 'Phergie_Config', array('offsetExists', 'offsetGet')\n );\n $this->config\n ->expects($this->any())\n ->method('offsetExists')\n ->will($this->returnCallback(array($this, 'configOffsetExists')));\n $this->config\n ->expects($this->any())\n ->method('offsetGet')\n ->will($this->returnCallback(array($this, 'configOffsetGet')));\n }\n return $this->config;\n }",
"public function addComposerExtraConfig($name)\n {\n $composer = json_decode(file_get_contents($this->projectDir . '/composer.json'));\n if (isset($composer->extra)) {\n $extra = get_object_vars($composer->extra);\n if (isset($extra['incenteev-parameters'])) {\n\n if (!is_array($extra['incenteev-parameters'])) {\n $incenteevParameters[] = $extra['incenteev-parameters'];\n } else {\n $incenteevParameters = $extra['incenteev-parameters'];\n }\n\n $newConfig = $this->projectDir . '/app_' . $name . '/config/parameters.yml';\n $item = NULL;\n foreach ($incenteevParameters as $obj) {\n if ($newConfig == $obj->file) {\n $item = $obj;\n break;\n }\n }\n\n if (is_null($item)) {\n $newParameters = new \\stdClass();\n $newParameters->file = $newConfig;\n $incenteevParameters[] = $newParameters;\n $extra['incenteev-parameters'] = $incenteevParameters;\n $composer->extra = $extra;\n FileLib::dumpFile($this->projectDir . '/composer.json', json_encode($composer, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));\n }\n }\n }\n }",
"protected static function _customizeComposerFile()\n {\n $githubUrl = 'https://github.com/' . static::$github;\n $file = new JsonFile(Factory::getComposerFile());\n $json = $file->read();\n\n unset($json['scripts']['pre-install-cmd']);\n unset($json['scripts']['post-install-cmd']);\n\n $json['name'] = static::$package;\n $json['description'] = static::$description;\n $json['type'] = 'cakephp-plugin';\n $json['homepage'] = $githubUrl;\n $json['authors'] = [[\n 'name' => static::$author,\n 'homepage' => 'https://github.com/' . static::_gitConfig('github.user'),\n ]];\n $json['support']['issues'] = $githubUrl . '/issues';\n $json['support']['source'] = $githubUrl;\n $json['autoload']['psr-4'] = [static::$namespace => \"src\"];\n $json['autoload-dev']['psr-4'] = [static::$namespace . \"Test\\\\\" => \"tests\"];\n\n if (static::$migrations === 'Y') {\n $json['require']['cakephp/bake'] = '^1.0';\n }\n\n $file->write($json);\n }",
"public function testGetComposer()\n {\n $controller = $this\n ->getMockBuilder(AbstractController::class)\n ->setMethods(null)\n ->getMockForAbstractClass();\n\n $home = $this->getMock(HomePathDeterminator::class, ['homeDir']);\n $home->method('homeDir')->willReturn($this->getTempDir());\n\n $this->createFixture('composer.json', '{}');\n\n $container = new Container();\n $container->set('tenside.home', $home);\n\n /** @var AbstractController $controller */\n $controller->setContainer($container);\n\n $this->assertInstanceOf(Composer::class, $controller->getComposer());\n }",
"private function initPaymentExtensionAttributesMock()\n {\n $this->paymentExtension = $this->getMockBuilder(OrderPaymentExtensionInterface::class)\n ->setMethods(['setVaultPaymentToken', 'getVaultPaymentToken'])\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->paymentExtensionFactory = $this->getMockBuilder(OrderPaymentExtensionInterfaceFactory::class)\n ->disableOriginalConstructor()\n ->setMethods(['create'])\n ->getMock();\n $this->paymentExtensionFactory->method('create')\n ->willReturn($this->paymentExtension);\n }",
"public function testExtraKey()\n {\n\n $composerExtraStraussJson = <<<'EOD'\n{\n \"name\": \"brianhenryie/strauss-config-test\",\n \"require\": {\n \"league/container\": \"*\"\n },\n \"extra\": {\n \"strauss\": {\n \"target_directory\": \"/target_directory/\",\n \"namespace_prefix\": \"BrianHenryIE\\\\Strauss\\\\\",\n \"classmap_prefix\": \"BrianHenryIE_Strauss_\",\n \"packages\": [\n \"pimple/pimple\"\n ],\n \"exclude_prefix_packages\": [\n \"psr/container\"\n ],\n \"override_autoload\": {\n \"clancats/container\": {\n \"classmap\": [\n \"src/\"\n ]\n }\n },\n \"delete_vendor_files\": false,\n \"unexpected_key\": \"here\"\n }\n }\n}\nEOD;\n\n $tmpfname = tempnam(sys_get_temp_dir(), 'strauss-test-');\n file_put_contents($tmpfname, $composerExtraStraussJson);\n\n $composer = Factory::create(new NullIO(), $tmpfname);\n\n $exception = null;\n\n try {\n $sut = new StraussConfig($composer);\n } catch (\\Exception $e) {\n $exception = $e;\n }\n\n $this->assertNull($exception);\n }",
"final public function manageConfigFromExternalClass(): void\n {\n Config::reset(\n [\n 'adapters' => [\n 'something' => 'this thing',\n ],\n ]\n );\n $mockClass = new GenericClass(\n [\n 'getConfig' => function (string $dotNotation) {\n return Config::get($dotNotation);\n },\n ]\n );\n $this->assertEquals(\n 'this thing',\n $mockClass->getConfig('adapters.something')\n );\n }",
"public function testGetRequiredComposerFailsWithoutFactory()\n {\n $trait = $this->getMockForTrait(WrappedCommandTrait::class);\n\n /** @var WrappedCommandTrait $trait */\n $trait->getComposer();\n }",
"private function createAlgorithmConfigurationMock()\n {\n return $this->getMockBuilder(AlgorithmConfiguration::class)->disableOriginalConstructor()->getMock();\n }",
"private function createContainerBuilderMock()\n {\n return $this->getMockBuilder(ContainerBuilder::class)\n ->setMethods(['addCompilerPass'])\n ->getMock();\n }",
"private function createKeyConfigurationMock()\n {\n return $this->getMockBuilder(\\Picodexter\\ParameterEncryptionBundle\\Configuration\\Key\\KeyConfiguration::class)->getMock();\n }",
"public function testMockBuilderAllowExtraConfigurationBeforeTheMockIsCreated(): void\n {\n /** @var ClassStub $mock */\n $mock = parent::mock(\n ClassStub::class,\n [],\n [],\n function (MockBuilder $mockBuilder) {\n $mockBuilder\n ->enableOriginalConstructor()\n ->enableProxyingToOriginalMethods();\n }\n );\n\n $result = $mock->publicMethod();\n\n parent::assertEquals('publicMethod', $result);\n }",
"public function testJsonSerializeRequirements() {\n $composerJson = new ComposerJson(self::TEST_DIR . '/composer.json');\n\n $requirement = new ComposerJson\\Requirement('package', 'version');\n $composerJson->addRequirement($requirement);\n\n $expectation = [\n $requirement->getPackagename() => $requirement->getVersion()\n ];\n\n $this->assertEquals($expectation, $composerJson->jsonSerialize()['require']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the = reservation payment "deleted" event. | public function deleted(ReservationPayment $ReservationPayment)
{
//
} | [
"public function forceDeleted(ReservationPayment $ReservationPayment)\n {\n //\n }",
"public function deleted(Repayment $repayment)\n {\n //\n }",
"public function deleted(OrderPayment $orderPayment)\n {\n //\n }",
"public function deleted(Payment $payment)\n {\n //\n }",
"public function deleted(Reserva $reserva)\n {\n //\n }",
"public function deleted(PurchaseOrder $purchaseOrder)\n {\n //\n }",
"public function deleted(PurchaseReceipt $purchaseReceipt)\n {\n //\n }",
"public function forceDeleted(Reservation $reservation)\n {\n //\n }",
"public function deleted(BoundVoucherItem $bondVoucher)\n {\n //\n }",
"public function deleted(Purchase $purchase)\n {\n //\n }",
"public function deleted(PurchaseRequest $purchaseRequest)\n {\n //\n }",
"public function deleted(Booking $booking)\n {\n //\n }",
"public function deleted(Purchase $purchase)\n {\n //\n }",
"public function deleted(DinerosVenta $dinero)\n {\n //\n }",
"public function onStriperWebhookCustomerCardDeleted($event) {\n\t\t$stripeEvent = $event->getArgument ( 'event' );\n\t}",
"public function deleted(Customer $customer)\n {\n //\n }",
"function delete_payment() {\n $this->access_only_allowed_members();\n\n $this->validate_submitted_data(array(\n \"id\" => \"required|numeric\"\n ));\n\n $id = $this->request->getPost('id');\n if ($this->request->getPost('undo')) {\n if ($this->Invoice_payments_model->delete($id, true)) {\n $options = array(\"id\" => $id);\n $item_info = $this->Invoice_payments_model->get_details($options)->getRow();\n echo json_encode(array(\"success\" => true, \"invoice_id\" => $item_info->invoice_id, \"data\" => $this->_make_payment_row($item_info), \"invoice_total_view\" => $this->_get_invoice_total_view($item_info->invoice_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->Invoice_payments_model->delete($id)) {\n $item_info = $this->Invoice_payments_model->get_one($id);\n echo json_encode(array(\"success\" => true, \"invoice_id\" => $item_info->invoice_id, \"invoice_total_view\" => $this->_get_invoice_total_view($item_info->invoice_id), '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 deleted(Wallet $wallet)\n {\n //\n }",
"public function deleted(Investor $investor)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns the textual form of an UUID to its equivalent raw bytes. Precondition: $uuid is a valid Uuid. | private static function str2bin(string $uuid): string
{
return \pack('H32', \str_replace('-', '', $uuid));
} | [
"public function encodeBinary(UuidInterface $uuid): string;",
"public function asBytes(): string\n {\n return self::str2bin($this->uuid);\n }",
"public static function asBinary($uuid) {\n\t\tif (!self::isValid($uuid)) {\n\t\t\treturn false;\n\t\t}\n\t\t$hex = static::asHexString($uuid);\n\t\t$bin = '';\n\t\tfor ($i = 0, $max = strlen($hex); $i < $max; $i += 2) {\n\t\t\t$bin .= chr(hexdec($hex[$i].$hex[$i + 1]));\n\t\t}\n\t\treturn $bin;\n\t}",
"function v8(string $bytes): string\n{\n return Uuid::uuid8($bytes)->toString();\n}",
"function uuid_from_bytes(string $bytes): Uuid\n{\n return Uuid::fromBytes($bytes);\n}",
"public final function toBytes()\n {\n return hex2bin(str_replace(\"-\", \"\", $this->uuid));\n }",
"public function testUuidConversion()\n {\n $uuid1 = Uuid::uuid1();\n $str1 = $uuid1->toString();\n\n $uuid2 = Uuid::fromString($str1);\n $str2 = $uuid2->toString();\n\n $this->assertEquals($str1, $str2);\n }",
"private function uuidTextToBin($value)\n\t{\n\t\t// Multiple files\n\t\tif (substr($value, 0, 2) === 'a:') {\n\t\t\treturn serialize(array_map(function($value) {\n\t\t\t\tif (strlen($value) === 36) {\n\t\t\t\t\t$value = StringUtil::uuidToBin($value);\n\t\t\t\t}\n\t\t\t\treturn $value;\n\t\t\t}, StringUtil::deserialize($value)));\n\t\t}\n\t\t// Single file\n\t\tif (strlen($value) === 36) {\n\t\t\treturn StringUtil::uuidToBin($value);\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function getGuidAsBytes() : string;",
"protected static function fromBase64ToUuid(string $data): string {\n $hexString = static::fromBase64ToHexString($data);\n return static::fromHexStringToUuid($hexString);\n }",
"protected function bytesFromUuid($uuid): array\n {\n if (is_array($uuid) || $uuid instanceof Arrayable) {\n array_walk($uuid, function (&$uuid) {\n $uuid = Uuid::fromString($uuid)->getBytes();\n });\n\n return $uuid;\n }\n\n return Arr::wrap(Uuid::fromString($uuid)->getBytes());\n }",
"public static function minifyUuid($uuid);",
"public function testUuidFormat()\n {\n $uuid = Uuid::uuid1();\n $str = $uuid->toString();\n\n $this->assertRegExp('/^\\{?[0-9a-f]{8}\\-?[0-9a-f]{4}\\-?[0-9a-f]{4}\\-?[0-9a-f]{4}\\-?[0-9a-f]{12}\\}?$/i', $str);\n }",
"public function deconvertUUID($uuid)\n {\n return $uuid;\n }",
"public function decodeBytes(string $bytes): UuidInterface;",
"public function decode(string $encodedUuid): UuidInterface;",
"public static function encodeUUID($uuid)\n {\n return '@'.bin2hex($uuid);\n }",
"public function testConversions()\n {\n $uuid = UuidObj::create();\n $str = $uuid->toString();\n\n $this->assertEquals($str, UuidObj::fromString($str)->toString());\n }",
"public function test_encode_uuid() {\n $service = new \\mod_zoom_webservice();\n\n // If uuid includes / or // it needs to be double encoded.\n $uuid = $service->encode_uuid('/u2F0gUNSqqC7DT+08xKrw==');\n $this->assertEquals('%252Fu2F0gUNSqqC7DT%252B08xKrw%253D%253D', $uuid);\n\n $uuid = $service->encode_uuid('Ahqu+zVcQpO//RcAUUWkNA==');\n $this->assertEquals('Ahqu%252BzVcQpO%252F%252FRcAUUWkNA%253D%253D', $uuid);\n\n // If not, then it can be used as is.\n $uuid = $service->encode_uuid('M8TigfzxRTKJmhXnV7bNjw==');\n $this->assertEquals('M8TigfzxRTKJmhXnV7bNjw==', $uuid);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the ageGroup property value. Sets the age group of the user. Allowed values: null, Minor, NotAdult and Adult. Refer to the legal age group property definitions for further information. Supports $filter (eq, ne, not, and in). | public function setAgeGroup(?string $value): void {
$this->getBackingStore()->set('ageGroup', $value);
} | [
"public function setAgeGroup($value)\n {\n $this->setProperty(\"AgeGroup\", $value, true);\n }",
"function setUseAgeGroupAge($useagegroupage = WPST_YES)\n {\n $this->__useagegroupage = $useagegroupage ;\n }",
"public function setAgeGroup($val)\n {\n $this->_propDict[\"ageGroup\"] = $val;\n return $this;\n }",
"public function fix_age_group( $age_group ) {\n return ( 0 == $age_group ) ? 'adult' : 'kids';\n }",
"public function setGroupMaxAge($value) {\n\t\t$this->_group_max_age = $value;\n\t}",
"public function setGroupMinAge($value) {\n\t\t$this->_group_min_age = $value;\n\t}",
"public function getAgeGroup()\n\t{\n\t\treturn $this->age_group;\n\t}",
"public function setAge($age)\n {\n // let's record it in dog years\n $this->age = $age * self::AGE_MULTIPLIER;\n }",
"public function setAge($age)\n {\n if (is_numeric($age) && $age > 0)\n $this->age = $age;\n else\n $this->age =\"\";\n }",
"public function setAge($age)\r\n {\r\n $this->_age = $age;\r\n }",
"public function setAge($age)\n {\n $this->_age = $age;\n }",
"public function setAge($age)\n\t {\n\t\t $this->age = $age;\n \t}",
"function setAge($age)\r\n {\r\n //check if numeric\r\n if (is_numeric($age)) {\r\n $this->age = $age;\r\n }\r\n }",
"function setAge($age)\r\n {\r\n //set the age if is numeric\r\n if (is_numeric($age))\r\n {\r\n $this->age = $age;\r\n }\r\n //if not, set age to 0\r\n $this->age = \"0\";\r\n }",
"function updateAgeGroup()\n {\n $success = null ;\n\n // Make sure the age group doesn't exist yet\n\n if (!$this->ageGroupExist() || !$this->ageGroupPrefixInUse())\n {\n // Construct the insert query\n \n $query = sprintf('UPDATE %s SET\n minage=\"%s\",\n maxage=\"%s\",\n gender=\"%s\",\n swimmerlabelprefix=\"%s\",\n type=\"%s\",\n registrationfee=\"%s\"\n WHERE id=\"%s\"',\n WPST_AGE_GROUP_TABLE,\n $this->getMinAge(),\n $this->getMaxAge(),\n $this->getGender(),\n $this->getSwimmerLabelPrefix(),\n $this->getType(),\n $this->getRegistrationFee(),\n $this->getId()\n ) ;\n\n $this->setQuery($query) ;\n $success = $this->runUpdateQuery() ;\n //$success = $this->getInsertId() ;\n }\n else\n {\n wp_die('Something is wrong, age group not updated.') ;\n $success = false ;\n }\n\n return $success ;\n //return true ;\n }",
"private function setFilterForAge(){\n $selfAge = $this->loggedInProfileObj->getAGE();\n $othersAge = $this->ProfileObj->getAGE();\n if($this->loggedInProfileObj->getGENDER()==self::maleProfile){\n $LAgeToSet = min($selfAge-self::AgeConstantToBeSub,$othersAge);\n $HAgeToSet = max($selfAge,$othersAge);\n }\n else{\n $LAgeToSet = min($selfAge,$othersAge);\n $HAgeToSet = max($selfAge+self::AgeConstantToBeSub,$othersAge);\n }\n $this->setLAGE($LAgeToSet);\n $this->setHAGE($HAgeToSet);\n }",
"public function getAgeGroup() {\r\n\t\tif(!$this->agegroup) {\r\n\t\t\tif(intval($this->record['agegroup']))\r\n\t\t\t\t$this->agegroup = tx_cfcleaguefe_models_group::getInstance($this->record['agegroup']);\r\n\t\t\tif(!$this->agegroup) {\r\n\t\t\t\t$comps = $this->getCompetitions(true);\r\n\t\t\t\tfor($i=0, $cnt = count($comps); $i < $cnt; $i++) {\r\n\t\t\t\t\tif(is_object($comps[$i]->getGroup())) {\r\n\t\t\t\t\t\t$this->agegroup = $comps[$i]->getGroup();\r\n\t\t\t\t\t\tbreak;\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\treturn $this->agegroup;\r\n }",
"private function applyUserAge($age)\n {\n $date = Carbon::now();\n $date->subYears($age);\n $year = $date->format('Y-m-d');\n\n $this->query->where('birth', '<', $date);\n }",
"public function setAge($age);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.