query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
this function gets the listings of services in table format
function makeServiceList() { $dbMain = $this->dbconnect(); $stmt = $dbMain ->prepare("SELECT service_key, service_type, club_id FROM service_info WHERE service_key ='$this->serviceKey' AND group_type ='$this->groupType'"); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($service_key, $service_type, $club_id); while ($stmt->fetch()) { // echo"$service_key $service_type <br>"; $result = $dbMain -> query("SELECT club_name FROM club_info WHERE club_id = '$club_id'"); $row = mysqli_fetch_array($result, MYSQLI_NUM); $service_location = $row[0]; if($club_id == "0") { $service_location = 'All Locations'; } $this->serviceType = $service_type; /* //create color rows static $cell_count = 1; if($cell_count == 2) { $color = "#D8D8D8"; $color2 = "D8D8D8"; $cell_count = ""; }else{ $color = "#FFFFFF"; $color2 = "FFFFFF"; } $cell_count = $cell_count + 1; //$this->cellCount++; */ $comp_type_a="comp_type$this->groupType$this->cellCount"; $comp_type_b ='[]'; $comp_type ="$comp_type_a$comp_type_b"; $comp_a ="comp$this->groupType$this->cellCount"; $comp_b ='[]'; $comp = "$comp_a$comp_b"; $this->getTerms($service_key, $comp_type, $comp_a); //f the service month exiss in the available upgrades it allows it to print if($this->termsArray != null) { $terms = explode("|", $this->termsArray); $term1 = $terms[0]; $term2 = $terms[1]; $term3 = $terms[2]; $term4 = $terms[3]; $this->termsArray = null; //this sets up the renewal rate if it is a class or a date string $checkString = "$term1 $term2 $term3 $term4"; if(preg_match("/Class\(s\)/", $checkString)) { $disabled = 'disabled="disabled"'; $rate_value = 'NA'; }else{ $disabled = null; $rate_value = null; } //create color rows static $cell_count = 1; if($cell_count == 2) { $color = "#D8D8D8"; $color2 = "D8D8D8"; $cell_count = ""; }else{ $color = "#FFFFFF"; $color2 = "FFFFFF"; } $cell_count = $cell_count + 1; $records ="<tr id=\"a$i\" style=\"background-color: $color\"> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$this->cellCount.</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$service_type<br><span class=\"locationColor\">$service_location</span></b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term1</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term2</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term3</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term4</b></font></td> <td align=\"left\" valign =\"top\"><input type=\"text\" name=\"$comp\" id=\"$comp_a\" value=\"\" size=\"8\" maxlength=\"8\" disabled=\"disabled\" onClick=\"return fieldChange(this.value, '$this->cellCount$this->groupType', this.name);\"/ > </td> <td align=\"left\" valign =\"top\"><input type=\"text\" name=\"$comp\" id=\"$comp_a\" value=\"$rate_value\" size=\"8\" maxlength=\"8\" $disabled onClick=\"return fieldChange2(this.value, this.name)\"/ > </td> <td align=\"left\" valign =\"top\"><input type=\"text\" name=\"$comp\" id=\"$comp_a\" value=\"$rate_value\" size=\"8\" maxlength=\"8\" disabled=\"disabled\"/ > </td> <td align=\"left\" valign =\"top\"><input type=\"button\" name=\"save1\" value=\"Clear\" onClick=\"clearRowGroup('$comp_type','$comp','$this->cellCount$this->groupType')\"/> </td> </tr> "; $this->cellCount++; $this->cellRows++; } $checkString = null; } //this sets up the number of rows of a grouptype and creates the summary divs to delete in javascript switch($this->groupType) { case"S": $this->singleRows = $this->cellCount-1; $this->singleSummaryDivs= $this->createSummaryDivs($this->singleRows, $this->groupType); break; case"F": $this->familyRows = $this->cellRows-1; $this->familySummaryDivs= $this->createSummaryDivs($this->familyRows, $this->groupType); break; case"B": $this->businessRows = $this->cellRows-1; $this->businessSummaryDivs= $this->createSummaryDivs($this->businessRows, $this->groupType); break; case"O": $this->organizationRows = $this->cellRows-1; $this->organizationSummaryDivs= $this->createSummaryDivs($this->organizationRows, $this->groupType); break; } return "$records"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function renderServicesList() {}", "function getServices() {\n\t\t$results = \"\";\n\t\t$sql = 'SELECT * FROM Service';\n\n\t\t$results = queryDB($sql);\n\n\t\treturn $results;\n\t}", "function service_list_json(){\r\n\t\t\t$aColumns = array( 'sl','branch','invoice','date','type','customer','net_amou...
[ "0.6771203", "0.6750676", "0.6702811", "0.66192305", "0.65752494", "0.6499887", "0.6482141", "0.64577", "0.64431477", "0.6420516", "0.64082", "0.63718307", "0.6335283", "0.63264334", "0.62627995", "0.6259936", "0.6259899", "0.6259461", "0.6232256", "0.6204745", "0.6200456", ...
0.59606135
42
Instantiate the envrionment object.
public function __construct( $production_site_url ) { $this->production_site_url = $production_site_url; if($this->is_test_environment()) error_reporting(E_ALL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct () {\n $this->loadEnvironment();\n }", "public function env()\n {\n // TODO: Implement env() method.\n }", "public static function environment() {\n\t\tif (!isset(self::$_environment)) {\n\t\t\tself::$_environment=new \\GO\\Base\\Environment();\n\t\t}\n\t\tret...
[ "0.6989323", "0.69728076", "0.69287914", "0.6877201", "0.6787946", "0.66661406", "0.6609642", "0.64328426", "0.6422504", "0.6346367", "0.6345911", "0.6341614", "0.625561", "0.6244985", "0.6229618", "0.62230146", "0.620282", "0.6199146", "0.6196702", "0.61785835", "0.61785835"...
0.0
-1
Returns whether this plugin is running on a test system or the production system.
public function is_test_environment() { if(empty($this->production_site_url)) return true; else return get_site_url() === $this->production_site_url ? false : true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isTest() : bool\n\t{\n\t\treturn $this->productionTest;\n\t}", "public function isProd() {\n\t\tif ($this->checkEnv(array('prod', 'product', 'production'))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function isDev() {\n // Acquia.\n if (defined('AH_SITE_ENVIRON...
[ "0.77510166", "0.76399803", "0.7498758", "0.7489189", "0.73803633", "0.7375103", "0.7369261", "0.73560923", "0.73511416", "0.728489", "0.7228609", "0.71942675", "0.7176972", "0.7143329", "0.71116257", "0.7090879", "0.70895076", "0.7072677", "0.7005752", "0.70015776", "0.69697...
0.76479644
1
Modify the css if we are in a test environment to make the website look ugly to avoid confusion. To be added to the 'wp_head' and 'admin_head' action.
public function modify_css_if_in_test_environment() { if($this->is_test_environment()) echo '<style>div#wpadminbar {background-color: #49cf44;}</style>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attach_custom_css_filter() {\n\tif ( ! is_admin() && ! is_feed() && ! is_robots() && ! is_trackback() ) {\n\t\tglobal $publishthis;\n\n\t\tif( is_singular() ) echo $publishthis->utils->display_css();\n\t}\n}", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n...
[ "0.64123803", "0.6364427", "0.634668", "0.6344194", "0.6244267", "0.62112933", "0.6184165", "0.617153", "0.6154084", "0.61347914", "0.6115918", "0.61113024", "0.6109064", "0.6083221", "0.6071445", "0.60558105", "0.6034255", "0.60268146", "0.6019083", "0.6017077", "0.5979238",...
0.826032
0
Returns a filename that is unique in the given directory. This fuction is based on wp_unique_filename() from but it treats .tar.gz as a single extension.
public function unique_filename_callback( $dir, $filename, $ext ) { $ext = mb_strtolower($ext); if($ext === '.gz' && mb_substr($filename, -7) === '.tar.gz' ) $ext = '.tar.gz'; $number = ''; while ( file_exists( $dir . "/$filename" ) ) { $new_number = (int) $number + 1; if ( '' === "$number$ext" ) { $filename = "$filename-" . $new_number; } else { $filename = str_replace( array( "-$number$ext", "$number$ext" ), "-" . $new_number . $ext, $filename ); } $number = $new_number; } return $filename; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generate_unique_file_name($dir, $filename)\n{\n if (!$filename)\n return;\n \n $extension = pathinfo($filename, PATHINFO_EXTENSION);\n\n $new_filename = '';\n for (;;)\n {\n $new_filename = get_random_string(8, 8) . '.' . $extension;\n if (!file_exists($dir . '/' . ...
[ "0.77655303", "0.767303", "0.7602459", "0.75815725", "0.74350446", "0.74350446", "0.74350446", "0.74350446", "0.74350446", "0.74350446", "0.73986477", "0.7397706", "0.7242553", "0.72255135", "0.71434987", "0.70677674", "0.7001081", "0.6945939", "0.6924418", "0.6850468", "0.68...
0.7734731
1
Adds additional mime types to the given array. Enables the upload of such file types to the media library.
public function custom_upload_mimes( $mime_types=array() ) { if(!array_key_exists('pdf', $mime_types)) $mime_types['pdf'] = 'application/pdf'; if(!array_key_exists('tex', $mime_types)) $mime_types['tex'] = 'text/x-tex'; if(!array_key_exists('gz', $mime_types)) $mime_types['gz'] = 'application/gzip'; if(!array_key_exists('tar.gz', $mime_types)) $mime_types['tar.gz'] = 'application/gzip'; #just to be sure we also add this return $mime_types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function net_liggitt_add_mime_types($mimes) {\n $mimes = array_merge($mimes, array(\n 'epub|mobi' => 'application/octet-stream'\n ));\n return $mimes;\n}", "function add_mime_types( $mime_types ) {\n\n\t\t$mime_types['json'] = 'application/json';\n\n\t\treturn $mime_types;\n\n\t}", "function ex...
[ "0.7620388", "0.75872487", "0.7376024", "0.7366959", "0.7314314", "0.72676235", "0.72510463", "0.7247649", "0.7186652", "0.71384186", "0.709408", "0.7072178", "0.68753594", "0.68578106", "0.6849705", "0.6815624", "0.6741629", "0.6707991", "0.66988546", "0.665497", "0.6630249"...
0.7112968
10
Works around a bug in WP that disallows upload of files to the media library even if they are marked as allowed via the 'upload_mimes' filter. To be added to the 'wp_check_filetype_and_ext' filter.
public function disable_real_mime_check_for_selected_extensions( $data, $file, $filename, $mimes ) { $wp_filetype = wp_check_filetype($filename, $mimes); $ext = $wp_filetype['ext']; $type = $wp_filetype['type']; $proper_filename = $data['proper_filename']; # If the filename is gz (or tar.gz, although WP 5.0.1 treats tar.gz as gz) # we return the original file data, thereby reversing the change of $ext # and $type to false, that is done by WP during wp_check_filetype_and_ext() # for file types that WP "doesn't like" even though we explicitly allowed # them via custom_upload_mimes(). if($ext === "gz" or $ext === "tar.gz") return compact( 'ext', 'type', 'proper_filename' ); else return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_check_filetype($filename, $mimes = null) {\n\t$mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array(\n\t\t'jpg|jpeg|jpe' => 'image/jpeg',\n\t\t'gif' => 'image/gif',\n\t\t'png' => 'image/png',\n\t\t'bmp' => 'image/bmp',\n\t\t'tif|tiff' => 'image/tiff',\n\t\t'ico' => 'image/x-icon',\n\...
[ "0.7577301", "0.74262846", "0.73595816", "0.7156631", "0.7107665", "0.7098097", "0.7095395", "0.7056228", "0.7011466", "0.6888636", "0.6875221", "0.6810395", "0.674863", "0.671076", "0.67067516", "0.6702787", "0.66957545", "0.6681378", "0.6671993", "0.66663975", "0.6665773", ...
0.0
-1
Download a file to the WordPress media library. $mime_type and $extension are optional, if set to something empty() they are guessed form the download file, where the extension is guessed based on the mime type. If the mime type is provided and the downloaded file does not actually have that mime type, an error is returned.
public function download_to_media_library( $url, $filename, $extension, $mime_type, $parent_post_id ) { $extension = ltrim($extension, '.'); // Gives us access to the download_url() and wp_handle_sideload() functions require_once( ABSPATH . 'wp-admin/includes/file.php' ); require_once( ABSPATH . 'wp-admin/includes/image.php' ); $timeout_seconds = 20; // Download file to temp dir $temp_file = download_url( $url, $timeout_seconds ); if ( !is_wp_error( $temp_file ) ) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $actual_mime_type = finfo_file($finfo, $temp_file); finfo_close($finfo); if( empty($mime_type) ) { $mime_type = $actual_mime_type; } elseif($mime_type !== $actual_mime_type) return array( 'error' => "Instead of the mime type " . $mime_type . " we were expecting, the remote server provided a file of mime type " . $actual_mime_type ); if (empty($extension)) { if( preg_match('#text/.*tex#u', $mime_type) ) $extension = 'tex'; else if( preg_match('#application/.*(tar|gz|gzip)#u', $mime_type) ) $extension = 'tar.gz'; else if( preg_match('#application/.*pdf#u', $mime_type) ) $extension = 'pdf'; else $extension = 'unknown'; } $filename = $filename . '.' . $extension; // Array based on $_FILE as seen in PHP file uploads $file = array( 'name' => $filename, 'type' => $mime_type, 'tmp_name' => $temp_file, 'error' => 0, 'size' => filesize($temp_file), ); $overrides = array( // Tells WordPress to not look for the POST form // fields that would normally be present as // we downloaded the file from a remote server, so there // will be no form fields // Default is true 'test_form' => false, // Setting this to false lets WordPress allow empty files, not recommended // Default is true 'test_size' => true, // for .tar.gz files normally only .gz is treated as the extension, so that // when file.tar.gz already exists the file is uploaded as file.tar-1.gz but // we want the propper file-1.tar.gz 'unique_filename_callback' => array($this, 'unique_filename_callback'), ); // Move the temporary file into the uploads directory $results = wp_handle_sideload( $file, $overrides ); if ( !empty( $results['error'] ) ) { return array( 'error' => "Failed to put file " . $file['name'] . " of mime type " . $file['type'] . " into uploads directory because Wordpress said: " . $results['error'] ); } else { $filepath = $results['file']; // Full path to the file // Prepare an array of post data for the attachment. $attachment = array( 'guid' => $filepath, 'post_mime_type' => $mime_type, 'post_title' => $filename, 'post_content' => '', 'post_status' => 'inherit' ); // Insert the attachment. $attach_id = wp_insert_attachment( $attachment, $filepath, $parent_post_id ); // Generate the metadata for the attachment, and update the database record. $attach_data = wp_generate_attachment_metadata( $attach_id, $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); $results['mime_type'] = $mime_type; $results['attach_id'] = $attach_id; return $results; } } else return array( 'error' => "Failed to download file of mime type " . $mime_type . ": " . $temp_file->get_error_message()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function download($type)\n {\n $model = Student::whereUser_id(auth()->user()->id)->first();\n if (!is_null($model)) {\n if ($model->user_id == auth()->user()->id) {\n $document = $model->getFirstMedia($type);\n if (!is_null($document))\n ...
[ "0.5585438", "0.5543451", "0.5510361", "0.5502444", "0.54925233", "0.5442962", "0.5389697", "0.53632355", "0.5334549", "0.5286034", "0.5261409", "0.5223991", "0.5199559", "0.51602364", "0.514058", "0.51262844", "0.5090899", "0.50513715", "0.50513715", "0.5029837", "0.50279915...
0.68361455
0
Recursively remove a directory. PHP itself does not offer a reasonable way to recursively remove directories. This is a subtle issue as links and nasty file names can be inlolved. We don't want to be hackble by uploading a malicious manuscript source to the arXiv, don't we? This is the best I could come up with after looking at many different implementations that can be found on the internet.
public static function save_recursive_remove_dir( $path, $root ) { $path = rtrim($path, '/').'/'; $root = rtrim($root, '/').'/'; if ($root === '/' || $path === '/' || $root !== mb_substr($path, 0, mb_strlen($root)) ) return false; foreach(new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $entry ) { if($entry->isDir() && !$entry->isLink()) rmdir($entry->getPathname()); else unlink($entry->getPathname()); } rmdir($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rm_recursive($dir) {\n\t$dir = rtrim($dir, '\\\\/');\n\tif (is_dir($dir)) { \n\t\t$objects = scandir($dir); \n\t\tforeach ($objects as $object) { \n\t\t\tif ($object != \".\" && $object != \"..\") { \n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") rm_recursive($dir.\"/\".$object); else unlink($dir.\...
[ "0.7608796", "0.7591758", "0.75141746", "0.74944925", "0.7427784", "0.7362288", "0.7359423", "0.73390704", "0.72920024", "0.72878957", "0.72793853", "0.72610784", "0.7256907", "0.72455513", "0.72195005", "0.72153896", "0.7211862", "0.72017395", "0.7198957", "0.71957517", "0.7...
0.6849894
53
PHP seems to have problems correctly detecting utf8 encoding of some .tex files when they are read with the standard file_get_contents() functinon (is this expected?). The following has turned out to work in all cases I have tested.
public function file_get_contents_utf8( $path ) { $content = file_get_contents($path); $encoding = mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true); $content = mb_convert_encoding($content, 'UTF-8', $encoding); return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function file_get_contents_utf8($fn) {\r\n\t$content = @file_get_contents($fn);\r\n\tif ( $content === false ) {return false;}\r\n\treturn mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n}", "function file_get_contents_utf8($fn) {\r\n $content = file_get_contents($fn);\r\n return mb_convert...
[ "0.7669075", "0.7617049", "0.70760435", "0.6336016", "0.59828264", "0.5867906", "0.5867257", "0.58244425", "0.5763002", "0.5702432", "0.5655835", "0.56395525", "0.559904", "0.55647117", "0.55632174", "0.5544988", "0.5533936", "0.55271745", "0.55246353", "0.5457571", "0.542736...
0.6790162
3
Get the path of a feature image of a post Returns the path of the feature image, insired by
public function get_feature_image_path( $post_id ) { $thumb_id = get_post_thumbnail_id($post_id); if(empty($thumb_id)) return ''; $image= wp_get_attachment_image_src($thumb_id, 'full'); if(empty($image)) return ''; $upload_dir = wp_upload_dir(); $base_dir = $upload_dir['basedir']; $base_url = $upload_dir['baseurl']; $imagepath= str_replace($base_url, $base_dir, $image[0]); if (file_exists( $imagepath)) return $imagepath; else return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnail($post_id))\n\t{\n\t\t$image5 = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' );\n\t\treturn $image5[0];\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnai...
[ "0.6573878", "0.6573878", "0.6296172", "0.6168056", "0.6103291", "0.60804135", "0.6034792", "0.6013491", "0.58720905", "0.5870317", "0.58182037", "0.5749974", "0.5736883", "0.5706038", "0.5667666", "0.56430054", "0.5625451", "0.5622882", "0.56065935", "0.56058884", "0.5603174...
0.75880456
0
The function remove old subscribe product
public static function _ClearProductSubscribe($LID) { global $DB; $subProp = COption::GetOptionString("sale", "subscribe_prod", ""); $arSubProp = unserialize($subProp); $dayDelete = IntVal($arSubProp[$LID]["del_after"]); $strSql = "DELETE ". "FROM b_sale_basket ". "WHERE ((ORDER_ID IS NULL) OR (ORDER_ID = 0)) AND CAN_BUY = 'N' AND SUBSCRIBE = 'Y' AND TO_DAYS(DATE_INSERT) < (TO_DAYS(NOW()) - ".$dayDelete.") LIMIT 500"; $db_res = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uc_order_edit_products_remove($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n\n $order_product_id = intval($form_state['triggering_element']['#return_value']);\n\n if (module_exists('uc_stock')) {\n // Replace stock immediately.\n $product = uc_order_product_load($order_product...
[ "0.66609293", "0.66593325", "0.66515213", "0.6575372", "0.65537834", "0.63727605", "0.6341068", "0.63332826", "0.63106346", "0.6256273", "0.62538195", "0.61330545", "0.60929066", "0.6088803", "0.6074131", "0.60539997", "0.6033648", "0.6009281", "0.60074764", "0.5976804", "0.5...
0.60723555
15
override some default cURL opts with the $curlOpts provided.
public function parallelGet($urls, $callback, &$opts, $curlOpts=[]) { $defaultOpts = [ CURLOPT_COOKIE => $this->cookie, CURLOPT_USERAGENT => "LLAnim.us", CURLOPT_ENCODING => "gzip,deflate", CURLOPT_REFERER => "", CURLOPT_RETURNTRANSFER => 1, CURLOPT_FOLLOWLOCATION => 1, CURLOPT_MAXREDIRS => 2 ]; foreach ($curlOpts as $opt=>$value) { $defaultOpts[$opt] = $value; } // now get all of the given URLs in parallel. $parallelCurl = new ParallelCurl(20, $defaultOpts); foreach ($urls as $url) { $parallelCurl->startRequest($url, $callback, $opts); } $parallelCurl->finishAllRequests(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _setCurlOpts() {\n $this->_setCurlOptArray($this->_getCurlOpts());\n }", "public function set_curl_options(array $curl_options = array())\n {\n }", "protected function defaultCurlOptions()\n\t{\n\t\treturn [\n\t\t\tCURLOPT_USERAGENT => Yii::$app->name . ' OAuth ' . $t...
[ "0.8059837", "0.7268135", "0.70406604", "0.6825349", "0.67725044", "0.6638282", "0.66277146", "0.66016704", "0.6539561", "0.64865464", "0.6422378", "0.6394634", "0.63555735", "0.6339529", "0.6330404", "0.6277467", "0.6232209", "0.6175173", "0.6166607", "0.61644864", "0.611549...
0.0
-1
get all from smlouva where id_user
function prepareResponseForProfi($data){ $sql_smlouva = 'SELECT * FROM public."smlouva" WHERE id_user = '.$data->id_user; try{ $db = new db(); $db = $db->connect(); $stmt_smlouva = $db->query($sql_smlouva); $data_smlouva = $stmt_smlouva->fetchAll(PDO::FETCH_OBJ); $data->smlouva = $data_smlouva; $db = null; } catch(PDOException $e){ throw new Exception('Exception; function: prepareResponseForProfi; PDOException: '.$e.getMessage()); } // get all from faktura where id_user $sql_faktura = 'SELECT castka::numeric::float8 as castka_float, * FROM public."faktura" WHERE id_user = '.$data->id_user; try{ $db = new db(); $db = $db->connect(); $stmt_faktura = $db->query($sql_faktura); $data_faktura = $stmt_faktura->fetchAll(PDO::FETCH_OBJ); $data->faktura = $data_faktura; $db = null; } catch(PDOException $e){ throw new Exception('Exception; function: prepareResponseForProfi; PDOException: '.$e.getMessage()); } // get count limit from profissionalUser $sql_professionalUser = 'SELECT count_limit FROM public."professionalUser" WHERE id_user = '.$data->id_user; try{ $db = new db(); $db = $db->connect(); $stmt_professionalUser = $db->query($sql_professionalUser); $data_professionalUser = $stmt_professionalUser->fetch(PDO::FETCH_OBJ); $data = (object)array_merge((array)$data, (array)$data_professionalUser); $db = null; } catch(PDOException $e){ throw new Exception('Exception; function: prepareResponseForProfi; PDOException: '.$e.getMessage()); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function selectMoestuinenByUser($user_id){\n $sql =\"SELECT *,mst_moestuinen.id as moestuinen_id FROM mst_moestuinen LEFT JOIN mst_moestuinen_users on mst_moestuinen.id = mst_moestuinen_users.moestuin_id WHERE mst_moestuinen_users.user_id = :eigenaar2 OR mst_moestuinen.eigenaar = :eigenaar GROUP BY mst_m...
[ "0.71866804", "0.6999283", "0.6942316", "0.6852727", "0.68445456", "0.6826503", "0.6794524", "0.6761087", "0.6719461", "0.6700037", "0.6650355", "0.6623769", "0.6623769", "0.65577817", "0.6546658", "0.652822", "0.64781266", "0.6469987", "0.646746", "0.6457264", "0.6450308", ...
0.0
-1
Run the database seeds.
public function run() { User::create([ 'name' => 'admin', 'email' => 'admin@admin.com', 'password' => bcrypt('admin_admin'), 'role' => 0 ]); User::create([ 'name' => 'tec', 'email' => 'tec@tec.com', 'password' => bcrypt('tec_tec'), 'role' => 1 ]); User::create([ 'name' => 'user', 'email' => 'user@user.com', 'password' => bcrypt('user_user'), 'role' => 2 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.784195...
0.0
-1
/ This script can be run at the command line via cron to search for all available jobs in US craigslist cities, input them into a database and email you the results. DB export is inside the folder for import.
function grab_feed($url){ //open our db connection $database="clscrape"; $con = mysql_connect('***.***.***.***','****','****'); //our associateive array of magical parsed xml jobs $arrFeeds = array(); //list of sites we want to search for jobs $sites = array("web/index.rss","eng/index.rss","sof/index.rss","search/crg?query=%20&format=rss","search/cpg?query=%20&format=rss"); foreach ($sites as $site){ //lets create a new document $doc = new DOMDocument(); //load our rss url $doc->load($url.$site); //crete an empty array to feed our items into //loop through the RSS XML document grabbing the title, description and link tags as those are the only ones we care about foreach ($doc->getElementsByTagName('item') as $node) { $itemRSS = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue ); //push each item onto the feed array array_push($arrFeeds, $itemRSS); } } foreach($arrFeeds as $link) { $search_terms = array( 'PHP','sysadmin','php'); foreach ($search_terms as $keyword) { $pos = strpos($link['desc'],$keyword); if($pos) { mysql_select_db('clscrape',$con) or die( 'Unable to select database' . mysql_error()); $hash = md5($link['title'].$link['desc'].$link['link']); $title = mysql_real_escape_string($link['title']); $desc = mysql_real_escape_string($link['desc']); $url = mysql_real_escape_string($link['link']); $query="INSERT INTO clscrape.data (data.hash,data.title,data.desc,data.link) VALUES('$hash','$title','$desc','$url')"; mysql_query($query,$con); } } } //close our db connection mysql_close($con); //return our associative array return $arrFeeds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asu_isearch_cron() {\n\n // Cache data from configuration\n _asu_isearch_cache_dept_feed();\n\n // Cache dept tree and employee types data\n _asu_isearch_cache_dept_tree_data();\n\n // Begin profile migrations\n _asu_isearch_begin_migrate(FALSE);\n\n // Cleanup the profiles which are no longer asso...
[ "0.5537103", "0.54606855", "0.5449546", "0.54228944", "0.5410553", "0.5278324", "0.5236165", "0.52066", "0.5195223", "0.5177203", "0.5169428", "0.5155695", "0.50330484", "0.5013517", "0.50096905", "0.49978343", "0.49911544", "0.4990376", "0.49754736", "0.4973946", "0.4946123"...
0.5626864
0
Return connection with Connection ID
public function getByCid($cid, $mask = false) { $connection = array_filter((array)$this->getAll($mask), function ($c) use ($cid) { return isset($c['cid']) && $c['cid'] == $cid; }); return $connection ? reset($connection) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConnectionId();", "public function getConnectionId()\n\t{\n\t\tif ( $this->pdo === null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\treturn $this->pdo->query('SELECT CONNECTION_ID()')->fetch(PDO::FETCH_COLUMN);\n\t\t} catch ( \\PDOException $e ) {\n\t\t\treturn null;\n\t\t}\n\t}", "pub...
[ "0.8229193", "0.7544831", "0.73328567", "0.71325916", "0.71325916", "0.71137863", "0.7074627", "0.70449257", "0.70188385", "0.70017236", "0.69603896", "0.6952511", "0.6927714", "0.6926359", "0.6924797", "0.6924797", "0.6910889", "0.6902436", "0.6902436", "0.6902436", "0.68941...
0.0
-1
Saves the current model TODO allow resource creation as well as updates, by checking if Id is set
public function save() { // If this object hasn't had its values changed, then abort. if(!$this->isModified()) { return false; } // Discard cached objects $this->invalidateCache(); foreach($this->modifiedAttributes as $a) { $this->payload[$a] = $this->values[$a]; } // Set request method to POST $this->method = "POST"; // Run the request // TODO This should return the modified object - use it $this->get(); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save(){\n if( !$this->validate() ){\n return false;\n }\n \n if($this->id){\n return $this->update();\n } else {\n return $this->create();\n }\n }", "public function save() {\r\n if ($this->model->getId()) {\r\n return $this->model-...
[ "0.6700567", "0.66842246", "0.6660837", "0.6660718", "0.6633421", "0.66014105", "0.65970343", "0.65846545", "0.6536471", "0.65291256", "0.6492164", "0.649023", "0.649023", "0.64850175", "0.64183915", "0.6400639", "0.6377372", "0.6369281", "0.62925893", "0.6266008", "0.625315"...
0.0
-1
Checks if the value for an attribute is acceptable
public function validate($name, $value) { if(in_array($name, $this->strings)) { if(is_string($value)) { return true; } } else if(in_array($name, $this->booleans)) { if(is_bool($value)) { return true; } } else if(in_array($name, $this->integers)) { if(is_numeric($value)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final function __validateValue($name, $value) {\n\t\tif(array_key_exists($name, $this->attributes)) {\n\t\t\t$datatype = $this->__getAttributeByName($name)->getType();\n\t\t}\n\t\t\n\t\t// check if the attribute is required\n\t\t$required = $this->__getAttributeByName($name)->isRequired();\n\n\t\t// if ...
[ "0.7249126", "0.68950045", "0.67212325", "0.6633378", "0.6531454", "0.6496891", "0.64922136", "0.6477317", "0.64626116", "0.6415653", "0.6382719", "0.6369392", "0.634994", "0.63326794", "0.63220567", "0.6311655", "0.63056344", "0.62773365", "0.626233", "0.62565786", "0.625132...
0.0
-1
Mark the given attribute as modified Returns 'true' when marked as modified Returns 'false' if already marked as modified
public function setModified($name) { if(!in_array($name, $this->modifiedAttributes)) { $this->modifiedAttributes[] = $name; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _flagAttributeAsModified($attribute) {\n\t\tif (!in_array($attribute, $this->_modifiedAttributes)) {\n\t\t\t$this->_modifiedAttributes[] = $attribute;\n\t\t}\n\t}", "public function isModified();", "public function isModified(): bool;", "function isModified() { return $this->_mod...
[ "0.77045465", "0.7398629", "0.72811955", "0.7070728", "0.7070728", "0.69159573", "0.6888714", "0.68156314", "0.677239", "0.674449", "0.67337763", "0.67033875", "0.6593784", "0.6583811", "0.6583811", "0.6583811", "0.6583811", "0.6526646", "0.64984745", "0.64984745", "0.6424665...
0.71217453
3
Whether or not this model has been 'filled' with data from the API
public function hasData() { return $this->hasData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function has_data()\n {\n }", "private function isPopulated() {\n return $this->is_populated;\n }", "public function isFilled()\n {\n return ! empty($this->data);\n }", "public function hasData(){\n return $this->_has(1);\n }", "public function isValidResponse(...
[ "0.6614833", "0.65900844", "0.651978", "0.6503891", "0.6474328", "0.6453933", "0.6337027", "0.6311637", "0.6255252", "0.6255252", "0.62256306", "0.6199904", "0.6199026", "0.61497474", "0.6132087", "0.60428345", "0.6019625", "0.59935266", "0.598046", "0.596523", "0.59613657", ...
0.64965266
4
Whether or not this model has been changed locally since last downloaded from the API
public function isModified() { return count($this->modifiedAttributes) > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasChanged() { return $this->changed; }", "public function hasChanged(): bool\n {\n return $this->changed;\n }", "public function isChanged() {\n\t\treturn $this->_changed > 0;\n\t}", "public function isChanged() : bool\n {\n\n return $this->_changed;\n\n }", "publ...
[ "0.7683406", "0.74490404", "0.742985", "0.7396284", "0.7310335", "0.7293663", "0.72294325", "0.7219321", "0.7142031", "0.7100573", "0.7053169", "0.70170265", "0.6988353", "0.6915788", "0.6914904", "0.6914904", "0.69112337", "0.6880721", "0.68744403", "0.68695694", "0.6838519"...
0.656862
43
Finds a model with the specified ID
public function find(int $id = null) { $this->method = "GET"; if(null == $id) { $this->path = $this->objectName; } else { $this->path = $this->objectName . '/' . $id; $this->currentId = $id; } $output = $this->get(); return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function find($model, $id);", "public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}", "public function find($id)\n\t{\n\t\treturn Model::where('id', $id)->first();\n...
[ "0.8542804", "0.8434013", "0.8372012", "0.8233802", "0.81540895", "0.8127544", "0.8127544", "0.8091566", "0.80726546", "0.8072079", "0.80689347", "0.8023892", "0.8016556", "0.8016556", "0.8016556", "0.7974566", "0.79600173", "0.7949078", "0.7937866", "0.7937866", "0.7937866",...
0.0
-1
get path to root directory script
public static function getPathToScript() { return realpath(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function root()\n {\n if ($this['environment']->has('SCRIPT_FILENAME') === false) {\n throw new \\RuntimeException(\n 'The \"`\"SCRIPT_FILENAME\" server variable could not be found.\n It is required by \"Workbench::root()\".'\n );\n }\n\n...
[ "0.78241074", "0.7785946", "0.75854987", "0.7581386", "0.7557679", "0.743944", "0.74073315", "0.73658645", "0.73620665", "0.7355432", "0.73510975", "0.7327718", "0.7326801", "0.7315026", "0.73040026", "0.7288391", "0.7264281", "0.72614485", "0.725067", "0.72393894", "0.721524...
0.7667388
2
/ Gather all information related to a given year for a person training status & location (if any) radio eligibility meals & shower privileges
public static function findForPersonYear($personId, $year) { $info = new PersonEventInfo(); $info->person_id = $personId; $info->year = $year; $requireTraining = PersonPosition::findTrainingPositions($personId); $info->trainings = []; if ($requireTraining->isEmpty()) { $requireTraining = [Position::find(Position::TRAINING)]; } foreach ($requireTraining as $position) { $info->trainings[] = Training::retrieveEducation($personId, $position, $year); } usort($info->trainings, function ($a, $b) { return strcmp($a->position_title, $b->position_title); }); $radio = RadioEligible::findForPersonYear($personId, $year); $info->radio_info_available = setting('RadioInfoAvailable'); $info->radio_max = $radio ? $radio->max_radios : 0; $info->radio_eligible = $info->radio_max > 0 ? true : false; $bmid = Bmid::findForPersonYear($personId, $year); if ($bmid) { $info->meals = $bmid->meals; $info->showers = $bmid->showers; } else { $info->meals = ''; $info->showers = false; } if (current_year() == $year && !setting('MealInfoAvailable')) { $info->meals = 'no-info'; } $ot = PersonOnlineTraining::findForPersonYear($personId, $year); if ($ot) { $info->online_training_passed = true; $info->online_training_date = (string)$ot->completed_at; } else { $info->online_training_passed = false; } $info->vehicles = Vehicle::findForPersonYear($personId, $year); $event = PersonEvent::findForPersonYear($personId, $year); if ($event) { $info->may_request_stickers = $event->may_request_stickers; $info->org_vehicle_insurance = $event->org_vehicle_insurance; $info->signed_motorpool_agreement = $event->signed_motorpool_agreement; } else { $info->may_request_stickers = false; $info->org_vehicle_insurance = false; $info->signed_motorpool_agreement = false; } return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function horoscopeInformation(){\n $horoscope_years = [\n 'Rat' => [\n \"years\" => [2008, 1996, 1984, 1972, 1960, 1948, 1936, 1924],\n \"info\" =>\n 'The Rat is known as a friend for life. You find it difficult to give yourself completely, ...
[ "0.6223644", "0.53187007", "0.53092265", "0.52474815", "0.52237827", "0.5216263", "0.5115766", "0.50811625", "0.5071113", "0.4988595", "0.49541777", "0.49491763", "0.49457964", "0.49439424", "0.49324158", "0.4928264", "0.4917653", "0.48897353", "0.48842284", "0.48779628", "0....
0.5841433
1
Register any authentication / authorization services.
public function boot() { $this->registerPolicies(); // 注册CasUserProvider \Auth::provider('cas', function($app, array $config) { return new \Xjtuana\Cas\Auth\CasUserProvider($config['model']); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }", "private function registerServices(...
[ "0.7238336", "0.71634316", "0.70841175", "0.6916285", "0.6882426", "0.68549484", "0.6853438", "0.6812384", "0.6786827", "0.6771727", "0.6648215", "0.66145295", "0.6606313", "0.6571872", "0.65712136", "0.65602577", "0.65544224", "0.65215147", "0.65081686", "0.64967656", "0.647...
0.0
-1
'/' or '.' works but '.' makes it look more object oriented
public function getHome() { $posts = Post::all(); return view('pages.home')->withPosts($posts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slashify($str)\n{\n return unslashify($str).'/';\n}", "function wd_convert_slash($string){\n return str_replace(\"\\\\\", \"/\", $string);\n}", "function dots_to_path($dots)\n{\n return '/' . str_replace('.', '/', $dots);\n}", "public function testLiteralSlash()\n {\n $grammar1 = $t...
[ "0.6055817", "0.6031303", "0.5940822", "0.5903254", "0.58931917", "0.58736074", "0.5868559", "0.5854755", "0.5682011", "0.56171644", "0.5561824", "0.5546333", "0.5532732", "0.55253744", "0.5436991", "0.54176116", "0.5412539", "0.5393956", "0.5344364", "0.53403556", "0.5335918...
0.0
-1
Loads the name of an user given its email
public function findNameByEmail($email){ $stmt = $this->db->prepare("SELECT * FROM users WHERE email=?"); $stmt->execute(array($email)); $user = $stmt->fetch(PDO::FETCH_ASSOC); if($user != null) { return new User( $user["email"], $user["completeName"]); } else { return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadUserByEmail($email)\n { \n $user = $this->_em->getRepository('Entity\\User\\User')->findOneBy(array('email' => $email));\n\n if($user != null)\n return $user;\n\n throw new UsernameNotFoundException(\"Compte introuvable\");\n }", "function getUserNam...
[ "0.7470118", "0.7409108", "0.7289771", "0.70845586", "0.6977614", "0.69411457", "0.6923764", "0.689882", "0.6886406", "0.68858427", "0.68018734", "0.67706674", "0.6748977", "0.6733427", "0.6714101", "0.6670983", "0.66457134", "0.66178656", "0.65951985", "0.65804493", "0.65501...
0.7462196
1
Saves a User into the database
public function save($user) { $stmt = $this->db->prepare("INSERT INTO users values (?,?,?)"); $stmt->execute(array($user->getEmail(), $user->getCompleteName(), $user->getPasswd())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->C...
[ "0.79587907", "0.77736866", "0.7708109", "0.7707836", "0.7703543", "0.76558113", "0.76016927", "0.7571912", "0.75581414", "0.7402825", "0.7399722", "0.739042", "0.73269767", "0.7292358", "0.7276313", "0.7225437", "0.721875", "0.7218055", "0.7195012", "0.71814644", "0.71694463...
0.7893134
1
Checks if a given email is already in the database
public function usernameExists($email) { $stmt = $this->db->prepare("SELECT count(email) FROM users where email=?"); $stmt->execute(array($username)); if ($stmt->fetchColumn() > 0) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function emailExists($email)\n {\n $e = \"'\".$email.\"'\";\n $qb = new QB;\n $qb->conn = static::getDB();\n $results = $qb->select('users', 'email')\n ->where('email', '=', $e)\n ->all();\n if(count($results) > 0){\n $this->errors[] = \"S...
[ "0.8202079", "0.7969514", "0.7944797", "0.78966063", "0.7866526", "0.7865067", "0.7858271", "0.7813238", "0.78005385", "0.77982724", "0.77777886", "0.7774719", "0.7771386", "0.7756169", "0.7745175", "0.7740838", "0.77061975", "0.7704356", "0.7703569", "0.76663727", "0.7652945...
0.0
-1
Deletes an User into the database
public function delete($currentUser){ $stmt = $this->db->prepare("DELETE FROM users WHERE email=?"); $stmt->execute(array($currentUser->getEmail())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUser()\n {\n $this->delete();\n }", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function delete()\n { if (i...
[ "0.88151145", "0.8533186", "0.84308434", "0.81461143", "0.8137568", "0.80815923", "0.80253214", "0.78665024", "0.7844636", "0.7815263", "0.7811698", "0.7811698", "0.7811698", "0.78048235", "0.7757751", "0.77310455", "0.76691645", "0.7664442", "0.76448727", "0.76446456", "0.76...
0.0
-1
Saves an Anonymous User into the database
public function saveAnonymousUser($completeName) { $stmt = $this->db->prepare("INSERT INTO anonymous_users(completeName) values (?)"); $stmt->execute(array($completeName)); return $this->db->lastInsertId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAnonymous()\n {\n // if we already have an anonymous user, exit\n $anonUser = $this->_userDao->getUser(1);\n if ($anonUser !== false) {\n if ($anonUser['username'] != 'anonymous') {\n throw new Exception('Anonymous user is not anonymous anymor...
[ "0.67389923", "0.6651957", "0.6368132", "0.6297084", "0.6276602", "0.6267826", "0.6215301", "0.62045", "0.61606944", "0.6147802", "0.60747766", "0.6034158", "0.6007421", "0.599423", "0.5985208", "0.59788287", "0.5965607", "0.59478635", "0.59432596", "0.59344226", "0.592449", ...
0.62937003
4
Checks if a given pair of email/password exists in the database
public function isValidUser($email, $passwd) { $stmt = $this->db->prepare("SELECT count(email) FROM users where email=? and passwd=?"); $stmt->execute(array($email, $passwd)); if ($stmt->fetchColumn() > 0) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function email_and_password_exists($db, $email, $password)\n{\n\t$password = md5($password);\n\t$sql = \"SELECT * FROM users where email=:email and password=:password\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email, ':password'=>$password));\n\t$us = $st->fetchAll();\n\treturn (count($us) >=...
[ "0.8153009", "0.73193043", "0.7214219", "0.7147674", "0.7136603", "0.707552", "0.7045792", "0.70453393", "0.7044942", "0.70435375", "0.7006923", "0.69233257", "0.691535", "0.68759084", "0.6843585", "0.6841256", "0.68296635", "0.6825138", "0.6804891", "0.6799548", "0.676124", ...
0.6404352
72
mail validation function function to put data to csv
function savefile($fname, $val){ $fp = fopen($fname, 'a'); fputcsv($fp, $val); fclose($fp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_csv_data() {\n $imap_from = IMAP_FROM;\n $imap_subject = IMAP_SUBJECT;\n $search_string = \"UNSEEN FROM \\\"{$imap_from}\\\" SUBJECT \\\"{$imap_subject}\\\"\";\n $email_id = imap_search(self::$imap_conn, $search_string);\n\n //Should only be one message to pr...
[ "0.65734947", "0.64186656", "0.64186656", "0.638806", "0.6291466", "0.6214176", "0.61309475", "0.60481906", "0.6023297", "0.59110874", "0.5873534", "0.5873211", "0.58305365", "0.57869405", "0.5731531", "0.5700321", "0.5699381", "0.56718177", "0.5670822", "0.564732", "0.564588...
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { $response = $next($request); $operands = $response->original['data']['operands']; if($request->segment(1) != 'divide'){ sort($operands, SORT_NUMERIC); } $key = $response->original['data']['operation'].'_'.implode(array_flatten($operands),''); $data = ['operands'=>$response->original['data']['operands'], 'result'=> $response->original['data']['result'] ]; Cache::set($key, $data, $this->setTime); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $...
[ "0.83001333", "0.81485367", "0.81485367", "0.81485367", "0.8128516", "0.79942316", "0.7927549", "0.791423", "0.79006535", "0.7633586", "0.7510298", "0.74876535", "0.74091655", "0.7377972", "0.7368652", "0.7294605", "0.7238382", "0.72307026", "0.7212001", "0.718095", "0.717224...
0.0
-1
Asks the database what games are currently running.
public static function current_games( $db = 0 ) { if( !$db ) { $db = REGISTRY::get( "db" ); } $sth = $db->prepare( " SELECT id FROM games WHERE start_date < CURRENT_TIMESTAMP() AND end_date > CURRENT_TIMESTAMP() " ); $sth->execute(); if( $sth->rowCount() > 0 ) { return $sth->fetchAll( PDO::FETCH_COLUMN, 0 ); } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAvailableGames() {\n\t$sql = \"select id, name, admin_id from games where has_started = 0\";\n\n\treturn parcoursRs(SQLSelect($sql));\n}", "public function processGames()\n\t{\n\t\tif ($this->site->lookupgames !== '0') {\n\t\t\t$console = new Console($this->echooutput);\n\t\t\t$console->processConso...
[ "0.63181704", "0.5849128", "0.56395024", "0.55175513", "0.550297", "0.5479659", "0.5446325", "0.53626204", "0.5309082", "0.5246008", "0.5228512", "0.5202838", "0.5187248", "0.51846135", "0.51785505", "0.5178185", "0.5170967", "0.5170245", "0.51696986", "0.51438165", "0.513948...
0.5993147
1
look up the details
function setSuccessMessage($appointmentData) { $stylistName = $appointmentData[0]['stylistName']; $serviceName = $appointmentData[0]['serviceName']; $appointmentDate = date('l F j',strtotime($appointmentData[0]['appointmentDate'])); $startTime = date('g:i a', strtotime($appointmentData[0]['startTime'])); $this->email = $appointmentData[0]['email']; $this->message = JText::sprintf('COM_SALONBOOK_EMAIL_BODY_SUCCESS', $serviceName, $stylistName, $appointmentDate, $startTime); $this->mailer->setBody($this->message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getDetails();", "public function getDetail();", "public function getInformation();", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t...
[ "0.7443607", "0.69970787", "0.6909756", "0.64773667", "0.6369049", "0.6357228", "0.6215434", "0.61938334", "0.6173934", "0.6131351", "0.61127067", "0.61127067", "0.6099434", "0.6086556", "0.6030992", "0.60074526", "0.6003254", "0.5993721", "0.5988407", "0.59492934", "0.594116...
0.0
-1
look up the details
function setDetailsUpdatedMessage($appointmentData) { $stylistName = $appointmentData[0]['stylistName']; $serviceName = $appointmentData[0]['serviceName']; $appointmentDate = $appointmentData[0]['appointmentDate']; $startTime = $appointmentData[0]['startTime']; $this->email = $appointmentData[0]['email']; $this->message = JText::sprintf('COM_SALONBOOK_EMAIL_BODY_DETAILS_UPDATED', $serviceName, $stylistName, $appointmentDate, date('g:i a', $startTime)); $this->mailer->setBody($this->message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getDetails();", "public function getDetail();", "public function getInformation();", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t...
[ "0.7443607", "0.69970787", "0.6909756", "0.64773667", "0.6369049", "0.6357228", "0.6215434", "0.61938334", "0.6173934", "0.6131351", "0.61127067", "0.61127067", "0.6099434", "0.6086556", "0.6030992", "0.60074526", "0.6003254", "0.5993721", "0.5988407", "0.59492934", "0.594116...
0.0
-1
Send reminder messages to the list of appointments that have been passed to us
function sendReminders($appointmentList) { // get appointment details and email address JLoader::register('SalonBookModelAppointments', JPATH_COMPONENT_SITE.DS.'models'.DS.'appointments.php'); $appointmentModel = new SalonBookModelAppointments(); foreach ($appointmentList as $appointment) { $mailingInfo = $appointmentModel->detailsForMail($appointment['id']); // clear any old recipients $this->email = NULL; $this->setSuccessMessage($mailingInfo); // $this->mailer->addBCC("cronwatch@pelau.com"); $this->sendMail(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$a...
[ "0.8026194", "0.7020604", "0.67048925", "0.66590756", "0.6545574", "0.64621097", "0.6336447", "0.6316557", "0.6287346", "0.6232709", "0.620149", "0.6109475", "0.60863554", "0.60080373", "0.5963936", "0.59571224", "0.5953585", "0.5945126", "0.5907907", "0.59026027", "0.5885300...
0.7875032
1
Make a grid builder.
protected function grid($id) { $grid = new Grid(new Attendee); $grid->model() ->orderBy('id', 'desc') ->where('event_id', $id) ->whereNotNull('canceled_at'); $grid->disableActions(); $grid->disableCreateButton(); $grid->disableRowSelector(); $grid->filter(function ($filter) use ($id) { $filter->equal('ticket_type')->select(\App\Models\EventMultiplePrice::where('event_id', $id)->get(['name_en', 'id'])->pluck('name_en', 'id')); $filter->equal('seat_no'); $filter->equal('email'); $filter->equal('mobile'); $filter->equal('qr'); $filter->equal('seat_id'); }); $grid->id('ID'); $grid->ticketType()->name_en('Ticket Type'); $grid->qr('QR'); $grid->seat_no('Seat No#'); $grid->email('Email'); $grid->name('Name'); $grid->mobile('Mobile'); $grid->created_at('Created Date'); $grid->canceled_at('Canceled Date'); $grid->column('Booking')->display(function () { $link = route('admin.booking', $this->booking_id); return "<a class=\"btn btn-xs btn-default grid-open-map\" href='{$link}'> <i class=\"fa fa-user\"> View</i> </a>"; }); return $grid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function grid()\n {\n $grid = new Grid(new Formulario());\n\n $grid->disableExport();\n\n $grid->column('name', __('Nombre'));\n $grid->column('description', __('Descripción'));\n $grid->column('go_to_formulario', 'Continuar a formulario')->display(function ($formId)...
[ "0.72541326", "0.7218252", "0.7064843", "0.70040804", "0.6995721", "0.69847125", "0.695367", "0.6928443", "0.6927314", "0.69256824", "0.6923453", "0.69233567", "0.6922796", "0.6907988", "0.6889554", "0.6888196", "0.6878719", "0.6845261", "0.68254143", "0.6818076", "0.6810526"...
0.0
-1
Make a grid builder.
protected function gridBooking($id) { $grid = new Grid(new BookingDetail()); $grid->model() ->orderBy('id', 'desc') ->where('booking_id', $id); $grid->disableActions(); $grid->disableCreateButton(); $grid->disableRowSelector(); $grid->id('ID'); $grid->groupPrice()->name_en('Group Price'); $grid->quantity('Quantity'); $grid->total_price('Total Price'); $grid->created_at('Created At'); return $grid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function grid()\n {\n $grid = new Grid(new Formulario());\n\n $grid->disableExport();\n\n $grid->column('name', __('Nombre'));\n $grid->column('description', __('Descripción'));\n $grid->column('go_to_formulario', 'Continuar a formulario')->display(function ($formId)...
[ "0.72541326", "0.7218252", "0.7064843", "0.70040804", "0.6995721", "0.69847125", "0.695367", "0.6928443", "0.6927314", "0.69256824", "0.6923453", "0.69233567", "0.6922796", "0.6907988", "0.6889554", "0.6888196", "0.6878719", "0.6845261", "0.68254143", "0.6818076", "0.6810526"...
0.0
-1
Creates data provider instance with search query applied
public function search($params) { $query = IndicadorPlan::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'ID_EVENTO' => $this->ID_EVENTO, 'ID_PLAN' => $this->ID_PLAN, 'CATEGORIA' => $this->CATEGORIA, 'ID_ALERTA' => $this->ID_ALERTA, 'FECHA_CREACION' => $this->FECHA_CREACION, 'FECHA_INICIO_VIGENCIA' => $this->FECHA_INICIO_VIGENCIA, 'FECHA_FIN_VIGENCIA' => $this->FECHA_FIN_VIGENCIA, 'ESTATUS' => $this->ESTATUS, 'ACTIVO' => $this->ACTIVO, 'ID_USUARIO' => $this->ID_USUARIO, ]); $query->andFilterWhere(['like', 'TITULO', $this->TITULO]) ->andFilterWhere(['like', 'DATA', $this->DATA]); return $dataProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchQueryDataProvider() {}", "public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }", "public function getQueryDataProvider() {}", "public function s...
[ "0.7773856", "0.674291", "0.65721744", "0.6503215", "0.6472826", "0.6389071", "0.63745373", "0.6287255", "0.62671757", "0.62457365", "0.62425256", "0.62123144", "0.61969537", "0.6172912", "0.61250603", "0.6123412", "0.6116283", "0.61031115", "0.6101092", "0.608637", "0.608177...
0.0
-1
Creates data provider instance with search query applied
public function searchByCompany($params, $id) { $query = IndicadorPlan::findBySql('select * from tbl_indicador_plan where id_plan in (select id_plan from tbl_plan where id_comision in (select id_comision_mixta from tbl_comision_mixta_cap where id_empresa = '.$id.' AND activo=1) AND activo=1) AND activo=1'); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'ID_EVENTO' => $this->ID_EVENTO, 'ID_PLAN' => $this->ID_PLAN, 'CATEGORIA' => $this->CATEGORIA, 'ID_ALERTA' => $this->ID_ALERTA, 'FECHA_CREACION' => $this->FECHA_CREACION, 'FECHA_INICIO_VIGENCIA' => $this->FECHA_INICIO_VIGENCIA, 'FECHA_FIN_VIGENCIA' => $this->FECHA_FIN_VIGENCIA, 'ESTATUS' => $this->ESTATUS, 'ACTIVO' => $this->ACTIVO, 'ID_USUARIO' => $this->ID_USUARIO, ]); $query->andFilterWhere(['like', 'TITULO', $this->TITULO]) ->andFilterWhere(['like', 'DATA', $this->DATA]); return $dataProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchQueryDataProvider() {}", "public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }", "public function getQueryDataProvider() {}", "public function s...
[ "0.7776391", "0.674156", "0.65730786", "0.6503003", "0.6469594", "0.6389097", "0.6374101", "0.6287539", "0.6266928", "0.6247957", "0.6242205", "0.62108004", "0.61968905", "0.61715287", "0.61234176", "0.6122084", "0.6115937", "0.6102408", "0.60996807", "0.6086734", "0.6081817"...
0.0
-1
/ Check the sum of the products is the same as in total
public function testFindSum() { $json = Scraper::start(); $array = json_decode($json, true); //print_r($array['total']); $input = $array['results']; $total = $array['total']; $sumFinder = new SumFinderClass($input); $this->assertEquals($total, $sumFinder->findSum()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($ord...
[ "0.6976303", "0.65637577", "0.65637577", "0.65637577", "0.65637577", "0.65637577", "0.6474571", "0.6466519", "0.63088095", "0.63087326", "0.6271597", "0.6254605", "0.6237829", "0.6214045", "0.6179753", "0.613032", "0.61138004", "0.60990864", "0.60984457", "0.6091491", "0.6088...
0.0
-1
Call the Model constructor
function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }", "function __construc()...
[ "0.8196736", "0.8080118", "0.8054001", "0.7839992", "0.78184336", "0.78158236", "0.7770901", "0.773286", "0.7704549", "0.7701882", "0.7701882", "0.7701882", "0.7701882", "0.76811564", "0.76426494", "0.75779855", "0.75710344", "0.75621206", "0.7518676", "0.75171185", "0.751711...
0.0
-1
Returns the list of all versions of the specified agent.
public function ListVersions(\Google\Cloud\Dialogflow\V2\ListVersionsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/ListVersions', $argument, ['\Google\Cloud\Dialogflow\V2\ListVersionsResponse', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVersions();", "public function getVersions();", "public function getVersions();", "public function getVersions()\n {\n return $this->getData()->get('versions', array());\n }", "public function getVersions(): array\n {\n return $this->client->getGameVersionsByType($...
[ "0.64000916", "0.64000916", "0.64000916", "0.61150116", "0.59911734", "0.5981857", "0.5939583", "0.59027815", "0.5799637", "0.57953405", "0.5757459", "0.55908674", "0.5565991", "0.55166775", "0.5504368", "0.5487049", "0.54512596", "0.5415199", "0.5410186", "0.5383744", "0.537...
0.5046688
41
Retrieves the specified agent version.
public function GetVersion(\Google\Cloud\Dialogflow\V2\GetVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/GetVersion', $argument, ['\Google\Cloud\Dialogflow\V2\Version', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAgentVersion()\n {\n if (array_key_exists('ai.internal.agentVersion', $this->_data)) { return $this->_data['ai.internal.agentVersion']; }\n return NULL;\n }", "public function retrieveVersion()\n {\n return $this->start()->uri(\"/api/system/version\")\n ->get()\n...
[ "0.7479249", "0.68799955", "0.66829276", "0.6626546", "0.65743554", "0.65036577", "0.62579453", "0.62511075", "0.61790526", "0.61566794", "0.61554545", "0.61417115", "0.613188", "0.606005", "0.59780693", "0.595682", "0.5954178", "0.5929921", "0.59250396", "0.5923857", "0.5923...
0.5902098
42
Creates an agent version. The new version points to the agent instance in the "default" environment.
public function CreateVersion(\Google\Cloud\Dialogflow\V2\CreateVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/CreateVersion', $argument, ['\Google\Cloud\Dialogflow\V2\Version', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeNewVersion(): Versionable;", "public static function getDefaultAgentVersion()\n {\n return 'google.com/gcp-php/' . self::VERSION;\n }", "public function setNewVersion()\n {\n $difference = '9223372036854775806';\n $rand_percent = bcdiv(mt_rand(), mt_getrandmax(...
[ "0.6062278", "0.5824177", "0.55727667", "0.5546499", "0.53755563", "0.51298493", "0.5073875", "0.5063272", "0.5002378", "0.49918213", "0.4927859", "0.4927859", "0.4927859", "0.4927859", "0.4927859", "0.48472664", "0.4831095", "0.48309276", "0.4825261", "0.48146376", "0.481119...
0.5107025
6
Updates the specified agent version. Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.
public function UpdateVersion(\Google\Cloud\Dialogflow\V2\UpdateVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/UpdateVersion', $argument, ['\Google\Cloud\Dialogflow\V2\Version', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUpdateVersion($val)\n {\n $this->_propDict[\"updateVersion\"] = $val;\n return $this;\n }", "public function setAgentVersion($agentVersion)\n {\n $this->_data['ai.internal.agentVersion'] = $agentVersion;\n }", "public function updateVersion($version)\n {\n...
[ "0.58730173", "0.58695847", "0.58048266", "0.5606574", "0.55426466", "0.54943204", "0.54700434", "0.54400736", "0.54400736", "0.54400736", "0.54358196", "0.5432168", "0.5421149", "0.5421149", "0.54122525", "0.5388079", "0.53782827", "0.53386074", "0.5330476", "0.5304612", "0....
0.7078659
0
Delete the specified agent version.
public function DeleteVersion(\Google\Cloud\Dialogflow\V2\DeleteVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/DeleteVersion', $argument, ['\Google\Protobuf\GPBEmpty', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function delete(Request $request)\n {\n \t$version = AppVersion::where('id',$request->id);\n $version->delete();\n ...
[ "0.6164806", "0.6152087", "0.60773957", "0.6000222", "0.5940691", "0.5830846", "0.57951206", "0.5758511", "0.55752754", "0.55115676", "0.54422754", "0.52564156", "0.52361554", "0.5226956", "0.5223968", "0.518456", "0.5177373", "0.5164622", "0.5164622", "0.5164622", "0.5164622...
0.59284556
5
Calculate colors for smooth fading (green > red)
function calculate_hsl ( $percent_ath ) { $hue = (1 - $percent_ath) * 120; $saturation = 70; $lightness = 50; $color = 'hsl(' . $hue . ', ' . $saturation . '%, ' . $lightness . '% )'; return $color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function percent2Color($value, $brightness = 255, $max = 100, $min = 0, $thirdColorHex = '00') {\n\t$first = (1-($value/$max))*$brightness;\n\t$second = ($value/$max)*$brightness;\n\n\t// Find the influence of the middle color (yellow if 1st and 2nd are red and green)\n\t$diff = abs($first-$second);\n\t$influence ...
[ "0.61964923", "0.6168567", "0.60873264", "0.60849106", "0.60849106", "0.60849106", "0.60849106", "0.6029798", "0.6028076", "0.60247785", "0.60153407", "0.5970682", "0.5952811", "0.5952765", "0.5952765", "0.5952765", "0.5952765", "0.5952765", "0.5952765", "0.5903743", "0.59010...
0.5690365
35
Check if the called method is allowed
final public function actionIsAllowed($action) { $allowed = $this->checkAction($action); if (!$allowed) throw new ActionNotAllowedException($action, get_called_class()); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function allowsCallOfMethod($methodName) {\n\t\treturn TRUE;\n\t}", "public function allowsCallOfMethod($methodName) {\n\t\treturn TRUE;\n\t}", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function allowsCallOfMethod($methodName)\n {\n return...
[ "0.74373156", "0.74373156", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.67696136", "0.6743958", "0.672748", "0.6721432", "0.6686392", "0.66826594", "0.6645087", "0.6582676", "0.6566043", "0.6523777", "0.6512685", "0.64938784",...
0.0
-1
Redirect to another URL
public function redirect($url) { header("Location: $url"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function redirect();", "public function redirect();", "public function redirect();", "public function redirect();", "abstract protected function redirectTo();", "public function redirectTo();", "public function redirect(string $url, $status_code = 302);", "public function redirect(...
[ "0.8113676", "0.8060218", "0.8060218", "0.8060218", "0.804037", "0.77344865", "0.76604307", "0.76601577", "0.76575154", "0.7584802", "0.7563687", "0.7501449", "0.74307597", "0.7413396", "0.740733", "0.7400592", "0.739393", "0.7362747", "0.7343829", "0.7339327", "0.7293042", ...
0.7205183
33
Check if the controller ist a global controller
public function isGlobal() { return $this->global; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasControllerNamespace()\r\n\t{\r\n\t\treturn !empty($this->controllerNamespace);\r\n\t}", "public function loadBaseController()\n\t{\n\t\t$baseControllerClass = $this->getOption('defaultClassBaseController', null, 'eccBaseController');\n\t\tif (!$this->isBaseController OR !class_exists($baseCont...
[ "0.68273836", "0.68220353", "0.66859335", "0.65938514", "0.6492434", "0.6358076", "0.6356683", "0.63273275", "0.63043517", "0.6268229", "0.6194274", "0.61804473", "0.6147304", "0.61400306", "0.611624", "0.6014839", "0.6014778", "0.59945893", "0.5975065", "0.5960246", "0.59574...
0.60110235
17
Add sql query to this objects properties
public function addSql(string $query) { $this->query = $query; $this->runScript(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function query() {\n // Leave empty to avoid a query on this field.\n }", "function addQuery() {}", "public function sql($sql)\n {\n $this->query['sql'] = $sql;\n return $this;\n }", "public function query() {\n $this->field_alias = $this->real_field;\n }", "function quer...
[ "0.6363866", "0.6274358", "0.6263191", "0.6240247", "0.62226695", "0.62226695", "0.6220067", "0.6139802", "0.61305684", "0.6108348", "0.60872155", "0.59692746", "0.5914071", "0.5891316", "0.587089", "0.587089", "0.587089", "0.58699334", "0.58664596", "0.58664167", "0.58497494...
0.0
-1
const MODEL = "App\AuthController"; use RESTActions;
public function __construct() { $this->middleware('auth:api', ['except' => ['login']]); $this->middleware('role', ['except' => ['login','me']]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetController ();", "public function model(){\n return 'App\\ObjLibrary';\n }", "public function GetControllerAction ();", "function model()\n {\n return \"App\\\\Daira\";\n }", "public function & GetController ();", "public function model()\n {\n return '...
[ "0.6264083", "0.5893159", "0.5828662", "0.5781059", "0.57033443", "0.5676315", "0.56633", "0.5655111", "0.55993986", "0.55960315", "0.55570537", "0.55570537", "0.55570537", "0.55540633", "0.5526499", "0.55241394", "0.5522767", "0.54810494", "0.54810494", "0.5470913", "0.54699...
0.0
-1
Get the token array structure.
protected function respondWithToken($token) { JWTAuth::setToken($token); $user = JWTAuth::toUser($token); $userData = UsersController::getUserByEmail($user['email']); if($userData->validation == 0) { return response()->json([ "msg"=>"account not activated" ]); } $userData->token=$token; if($userData->role_id !=3) { $userData->save(); } return response()->json([ 'access_token' => $token, 'token_type' => 'bearer', 'user' => $userData, 'expires_in' => Auth::guard('api')->factory()->getTTL() * 60 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToken()\n {\n return array($this->_token, $this->_token_secret);\n }", "public function getTokens(): array\n {\n return $this->tokens;\n }", "function &get_xoops_token()\n{\n\tif ( class_exists('XoopsMultiTokenHandler') )\n\t{\n\t\t$token =& XoopsMultiTokenHandler::...
[ "0.71393645", "0.71245617", "0.71064186", "0.7023479", "0.69822", "0.65953726", "0.6563174", "0.654563", "0.64619535", "0.64316744", "0.63753426", "0.6335638", "0.6307287", "0.6257231", "0.6188339", "0.6175191", "0.6066591", "0.60613745", "0.604052", "0.6028691", "0.60033476"...
0.0
-1
Display a listing of the resource.
public function index() { // $data= DB::table('users')->join('req_maintenances','req_maintenances.user_id','users.id')->where('req_maintenances.user_id')->get(); return view('handlerequest.index')->with('handlereq', ReqMaintenance::all())->with('handlereq1', User::all()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show(Handelrequest $handelrequest) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit(Handelrequest $handelrequest) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Handelrequest $handelrequest) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893...
0.0
-1
Remove the specified resource from storage.
public function destroy(Handelrequest $handelrequest) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Invalidates the cache key on edit_comment and wp_insert_comment. If a list of post IDs is provided, the invalidation will only happen if the edited/created comments belongs to one of the given posts.
public function expires_on_comment_save( $post_ids = array() ) { $invalidation = new \Cache\Invalidation\Hook( $this ); $callback = null; if ( ! empty( $post_ids ) ) { $callback = new SerializableClosure( function ( $id ) use ( $post_ids ) { $comment = get_comment( $id ); return in_array( $comment->comment_post_ID, $post_ids ); } ); } $invalidation->on_hook_with_callable( 'edit_comment', $callback ); $invalidation->on_hook_with_callable( 'wp_insert_comment', $callback ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_comment_cache($ids)\n {\n }", "function _prime_comment_caches($comment_ids, $update_meta_cache = \\true)\n {\n }", "function update_postmeta_cache($post_ids)\n {\n }", "function _prime_post_caches($ids, $update_term_cache = \\true, $update_meta_cache = \\true)\n {\n }",...
[ "0.66274947", "0.63293374", "0.6029599", "0.5792569", "0.5717498", "0.55613804", "0.55031", "0.54733425", "0.54707885", "0.52404207", "0.52330625", "0.5191158", "0.50896", "0.50280756", "0.49876598", "0.49760443", "0.49303183", "0.4894563", "0.48845637", "0.48414186", "0.4832...
0.69485825
0
Run the database seeds.
public function run() { \Illuminate\Support\Facades\DB::table('genders')->delete(); $genders = [ ['en'=> 'Male', 'ar'=> 'ذكر'], ['en'=> 'Female', 'ar'=> 'انثي'], ]; foreach ($genders as $ge) { \App\Models\Gender::create(['Name' => $ge]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Original static call DataTableWidget::setIni( DataTableWidget::INI_QUERY_EXECUTOR, YiiQueryExecutorPlugin::class );
public function setIni($initItem, $value) { $this->ini[$initItem] = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useQueryCLI() {\n parent::useQueryCLI();\n }", "abstract protected function initQuery(): void;", "public function getQueryDataProvider() {}", "private function set_query_components() {\n\t\n\t\t$start = (($this->page-1) * $this->rp);\n\t\t\n\t\tif($this->query) {\n\t\t\t$this->query...
[ "0.5540766", "0.54948103", "0.5123556", "0.5087313", "0.50859964", "0.5069802", "0.50218034", "0.49462068", "0.49112695", "0.48888272", "0.48802665", "0.4871102", "0.4845782", "0.48343918", "0.48231456", "0.48170742", "0.48170742", "0.48138908", "0.4807427", "0.480096", "0.47...
0.0
-1
Builds LibriProducts from ONIX file.
public static function makeFromFile(string $file): array { // get catalog update identifier list($catalogUpdateIdentifier,$suffix) = explode('.',basename($file)); // get date of catalog update (don't use simplexml, the file might be very large) $dateOfCatalogUpdate = new Carbon(self::getDateOfCatalogUpdate($file)); // get number of items in file to make a progress bar $numberOfItems = substr_count(file_get_contents($file),'<product>'); $progress = ConsoleOutput::progress($numberOfItems); // holds all products $products = []; $productHandler = function($product) use ($progress,&$products,$dateOfCatalogUpdate, $catalogUpdateIdentifier) { ConsoleOutput::advance($progress); try { // create Object from ONIX message $libriProduct = self::create($product); if(!is_null($libriProduct)) { $libriProduct->DateOfData = $dateOfCatalogUpdate; $libriProduct->LibriUpdate = $catalogUpdateIdentifier; $products[] = $libriProduct; } } catch (MissingDataException $e) { ConsoleOutput::error($e->getMessage()); Log::warning($e->getMessage()); } }; try { $parser = new Parser(); // create instance of PINOpar Parser $parser->setProductHandler($productHandler); // define a product handler which will be called for each <product> tag $parser->useFile($file); $parser->parse(); ConsoleOutput::finish($progress); } catch(PONIpar\XMLException $e) { // error in ONIXMessage, e.g. missing <ProductIdentifier> // todo: find a way to continue parsing the onixmessage ConsoleOutput::error($e->getMessage()); Log::warning($e->getMessage()); } catch(Exception $e) { ConsoleOutput::error($e->getMessage()); Log::error($e->getMessage()); // todo: find a way to continue parsing after caught exception } // clear $products from null values $products = array_filter($products, function($item) { return !is_null($item); }); return $products; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function create(PONIpar\\Product $onix){\n $libriProduct = new LibriProduct;\n $controller = new LibriProductFactory();\n $controller->product = $onix;\n\n $recordReference = $controller->getRecordReference();\n\n /* ---------------- required data -------------- */\n ...
[ "0.6253491", "0.5181114", "0.5112983", "0.5110384", "0.50576365", "0.503746", "0.49284264", "0.48707747", "0.48707747", "0.4832499", "0.4815969", "0.4815969", "0.4783766", "0.47737586", "0.4726791", "0.4719312", "0.467551", "0.46643233", "0.46590096", "0.4658956", "0.46509764...
0.6799675
0
Returns the catalogue update date.
private static function getDateOfCatalogUpdate($file) { $file = fopen($file, "r"); if ($file) { while (($line = fgets($file)) !== false) { $match = Null; preg_match('/\<m182\>([0-9]{8})\<\/m182\>/',$line,$match); if(isset($match[1])) return $match[1]; } } else { throw new Exception("Unable to open the file $file."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $t...
[ "0.74124306", "0.74124306", "0.74124306", "0.74124306", "0.7404963", "0.72613376", "0.7217745", "0.7217745", "0.7152229", "0.6920275", "0.68992794", "0.6789645", "0.674563", "0.674563", "0.66533566", "0.6562129", "0.6562129", "0.65447944", "0.65199184", "0.6445013", "0.644501...
0.5893999
47
Generate a fake Product for testing purposes.
public static function makeFakeProduct($attributes = []) { list($product) = self::makeFromFile(storage_path('/testing/VALID_TESTFILE.XML')); foreach ($attributes as $attribute => $value) { $product->$attribute = $value; } return $product; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mockCreateInitialProducts() {\n $listaProdutos = &obterListaProdutos();\n\n $produto = createProduct(\"Caneca de Vidro\", \"Caneca\", \"Suporta 350 ml\", 100, 50.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n\n $produto = createProduct(\"Caneca de Plastico\", \"Caneca\", \"S...
[ "0.72306854", "0.7151779", "0.6959459", "0.6777078", "0.6727734", "0.6713494", "0.66957635", "0.6599329", "0.6547196", "0.648236", "0.64207035", "0.6392028", "0.6365746", "0.6347231", "0.62924725", "0.6171232", "0.61645776", "0.6159639", "0.61459064", "0.6077128", "0.6076915"...
0.66215503
7
Copy existing Annotation Urls from old to new product, since they are usually not included in the catalog update.
private static function copyAnnotationUrls($existing_product, $new_product) { foreach(["AntCbildUrl","AntAbildUrl","AntRueckUrl"] as $ant) { if(isset($existing_product->$ant) && !property_exists($new_product,$ant)) { $new_product->$ant = $existing_product->$ant; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function mapMagentoAttributes(ProductInterface $newProduct)\n {\n try {\n $originalProduct = $this->baseMagentoProductRepository->get($newProduct->getSku());\n $newProduct->setMediaGalleryEntries($originalProduct->getMediaGalleryEntries());\n } catch (NoSuchEntityExce...
[ "0.5510585", "0.5038295", "0.497977", "0.49260625", "0.49137515", "0.48702252", "0.48362923", "0.48355854", "0.48096398", "0.4760752", "0.47297874", "0.4719762", "0.4659986", "0.46197754", "0.45372865", "0.45190895", "0.45028773", "0.44517055", "0.44405726", "0.4438688", "0.4...
0.76536757
0
Store products to database.
public static function store(array $products): bool { $progress = ConsoleOutput::progress(count($products)); foreach ($products as $product) { $existingProduct = LibriProduct::find($product->RecordReference); // if this product doesn't exists, save it if(!$existingProduct) $product->save(); // if this product already exists and comes from an older CatalogUpdate // delete existing product and save the new one elseif( is_null($existingProduct->DateOfData) || is_null($product->DateOfData) || $existingProduct->DateOfData < $product->DateOfData) { self::copyAnnotationUrls($existingProduct,$product); $existingProduct->delete(); $product->save(); } ConsoleOutput::advance($progress); } // complete the progress bar ConsoleOutput::finish($progress); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeProduct();", "public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/pr...
[ "0.7943561", "0.7219085", "0.71159554", "0.71088636", "0.6981453", "0.69717765", "0.69511795", "0.6907708", "0.6906198", "0.68788123", "0.68465865", "0.6840182", "0.68113804", "0.67545354", "0.6735662", "0.66833144", "0.66826963", "0.66770035", "0.6676164", "0.6666605", "0.66...
0.0
-1
todo: implement memory friendly version of this Builds LibriProduct from ONIX object.
static function create(PONIpar\Product $onix){ $libriProduct = new LibriProduct; $controller = new LibriProductFactory(); $controller->product = $onix; $recordReference = $controller->getRecordReference(); /* ---------------- required data -------------- */ $libriProduct->RecordReference = $recordReference; $libriProduct->ProductForm = $controller->getProductForm(); $libriProduct->DistinctiveTitle = $controller->getDistinctiveTitle(); $tmpReference = $controller->getProductReference(); if(!$tmpReference) return null; // if no valid reference was found, this product is invalid $libriProduct->ProductReference = (String) $tmpReference[0]; $libriProduct->ProductReferenceType = (String) $tmpReference[1]; // test required fields $requiredFields = [ 'RecordReference', 'ProductReference', 'DistinctiveTitle', 'ProductForm' ]; foreach ($requiredFields as $field) { if ($libriProduct->$field === false) throw new MissingDataException("Content of `$field` not found or empty.", $recordReference); } /* ---------------- optional data -------------- */ $libriProduct->OrderTime = (Integer) $controller->getOrderTime(); $libriProduct->QuantityOnHand = (Integer) $controller->getQuantityOnHand(); $libriProduct->AvailabilityStatus = (Integer) $controller->getAvailabilityStatus(); $libriProduct->NumberOfPages = (Integer) $controller->getNumberOfPages(); $libriProduct->VLBSchemeOld = (Integer) $controller->getVLBSchemeOld(); $libriProduct->ProductWeight = (Integer) $controller->getProductWeight(); $libriProduct->ProductWidth = (Integer) $controller->getProductWidth(); $libriProduct->ProductThickness = (Integer) $controller->getProductThickness(); $libriProduct->AudienceCodeValue = (Integer) $controller->getAudienceCodeValue(); $libriProduct->Author = (String) $controller->getAuthor(); $libriProduct->CoverLink = (String) $controller->getCoverLink(); $libriProduct->ProductLanguage = (String) $controller->getProductLanguage(); $libriProduct->PublisherName = (String) $controller->getPublisherName(); $libriProduct->PublicationDate = (String) $controller->getPublicationDate(); $libriProduct->Blurb = (String) $controller->getBlurb(); $controller->CurrentPrice = $controller->getPriceDeCurrent(); $libriProduct->PriceAmount = (float) $controller->getPriceAmount(); $libriProduct->PriceTypeCode = (Integer) $controller->getPriceTypeCode(); $libriProduct->DiscountPercent = (Integer) $controller->getDiscountPercent(); $libriProduct->TaxRateCode1 = (String) $controller->getTaxRateCode1(); $libriProduct->NotificationType = $controller->getNotificationType(); $libriProduct->Lib_MSNo = $controller->getLibriNotificationKey(); $libriProduct->AvailabilityCode = $controller->getAvailabilityCode(); $libriProduct->PublishingStatus = $controller->getPublishingStatus(); return $libriProduct; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function build();", "abstract public function build();", "abstract function build();", "public abstract function build();", "public abstract function build();", "abstract public function factoryMethod(): Product;", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib...
[ "0.567433", "0.567433", "0.5630675", "0.5624379", "0.5624379", "0.55156046", "0.5475541", "0.5378524", "0.53736424", "0.53120536", "0.5254839", "0.5251328", "0.5201675", "0.51764864", "0.51479137", "0.5127448", "0.51158357", "0.5112923", "0.5112923", "0.5112923", "0.5112923",...
0.6952602
0
Converts ISBN10 to ISBN13 string. Taken from
private function isbn10to13($isbn10){ $isbnclean = preg_replace("/([^d])/", "",substr($isbn10,0,-1)); if (strlen($isbnclean) != 9) { return $isbn10; } $isbn="978".$isbnclean; $check=0; for ($i=0;$i<12;$i++) { $check+=(($i%2)*2+1)*$isbn[$i]; } $check=(10-($check%10))%10; return "978".substr($isbn10,0,-1).$check; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function convert10to13($isbn10)\n {\n $isbn13 = '978' . substr($isbn10, 0, 9);\n $sum = 0;\n for ($i = 0; $i < 12; $i ++) {\n if ($i % 2 == 0) {\n $sum += $isbn13{$i};\n } else {\n $sum += 3 * $isbn13{$i};\n }\n }\...
[ "0.7752301", "0.69664115", "0.683384", "0.65942186", "0.63080627", "0.6307712", "0.61868817", "0.61771363", "0.61431986", "0.5945208", "0.5832819", "0.5708205", "0.5654722", "0.5618333", "0.5520768", "0.5519655", "0.5519655", "0.55044407", "0.531368", "0.5266902", "0.5264451"...
0.8058322
0
Returns nodeValue of first match if query is successful.
private function _getFirstElement($query, $debug=false) { $result = $this->product->get($query); if($debug && env('APP_DEBUG')) var_dump($result); if($result) { return $result[0]->nodeValue; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function Search_Node($goal_value){\t\t\t\t\t\t\t\t\n\t\t\tforeach ($this->nodes as $key => $obj) {\n\t\t\t\tif ($obj->element==$goal_value) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "public function first() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\tforeach ($this->_value...
[ "0.63461655", "0.6221492", "0.6208125", "0.6108111", "0.61000395", "0.60435003", "0.6043364", "0.5942205", "0.5915367", "0.59103525", "0.59056735", "0.5860143", "0.5813632", "0.5689215", "0.5682624", "0.5644293", "0.5638928", "0.56200725", "0.55767846", "0.5561278", "0.554824...
0.53108853
38
Returns an array of childNodes of DOMElement with nodeName as key and nodeValue as value.
private function _childNodes2Array(\DOMElement $DOMElement) { $childNodes = array(); foreach ($DOMElement->childNodes as $node) { $childNodes[$node->nodeName] = $node->nodeValue; } return $childNodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChildNodes() : array {\n return $this->childNodes;\n }", "protected function getChildrenByName(DOMNode $node, $name)\n {\n $nodes = array();\n foreach ($node->childNodes as $node) {\n if ($node->nodeName == $name) {\n array_push($nodes, $nod...
[ "0.72198147", "0.6994653", "0.6620756", "0.6509508", "0.64640766", "0.64517397", "0.6415531", "0.6414451", "0.6401125", "0.63678783", "0.6261343", "0.6119103", "0.6115836", "0.6098306", "0.6059664", "0.60548955", "0.5993962", "0.59810936", "0.5962862", "0.5934852", "0.5879924...
0.6694247
2
choose first ISBN13, then EAN then ISBN10 as reference
public function getProductReference() { $allowedIdentifierTypes = [ PONIpar\ProductSubitem\ProductIdentifier::TYPE_ISBN13, // 15 PONIpar\ProductSubitem\ProductIdentifier::TYPE_GTIN13, // 03 PONIpar\ProductSubitem\ProductIdentifier::TYPE_ISBN10 // 02 ]; $productReference = null; // loop through the allowed identifier types and pick the first successful match foreach ($allowedIdentifierTypes as $identifierType) { if($productReference = $this->getProductIdentifier($identifierType)) { if($identifierType == PONIpar\ProductSubitem\ProductIdentifier::TYPE_ISBN10) { $productReference = self::isbn10to13($productReference); } return array((String) $productReference,$identifierType); } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isbn13Selector($isbn_id)\r\n\t{\r\n\t\tforeach($isbn_id as $iid) \r\n\t\t{\r\n\t\t\tif($iid->type=='ISBN_13')\r\n\t\t\t{\r\n\t\t\t\treturn $iid->identifier;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function isbn10to13($isbn10){\n $isbnclean = preg_replace(\"/([^d])/\", \"\",substr($isbn10,0,-1));\n\...
[ "0.719691", "0.6323025", "0.62641466", "0.62335235", "0.60724264", "0.6056607", "0.60492444", "0.6034663", "0.60135716", "0.6009205", "0.6002468", "0.6002468", "0.5989756", "0.59177315", "0.5808929", "0.58025724", "0.5789007", "0.5761969", "0.5754082", "0.5673303", "0.5647303...
0.5300224
32
Returns author of the title if available or null.
public function getAuthor() { $contributors = $this->product->getContributors(); foreach ($contributors as $contributor) { if($contributor->getRole() == PONIpar\ProductSubitem\Contributor::ROLE_AUTHOR) { $value = $contributor->getValue(); if(key_exists('PersonName',$value)) { return $value['PersonName']; } elseif(key_exists('PersonNameInverted',$value)) { $inverted = $value['PersonNameInverted']; $author = implode(' ',array_reverse(explode(', ',$inverted))); } // if the first author string is too long (might be a collections of authors), skip to the next if(strlen($author) < 100) return $author; else continue; } } // if we reach this that means we haven't found an author return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function author()\n {\n return optional($this->author);\n }", "public function author(): ?string\n {\n return $this->author;\n }", "public function getAuthor(): ?Author\n {\n return $this->author;\n }", "public function getAuthor();", "public function getAuthor...
[ "0.7772653", "0.770168", "0.73291695", "0.73001057", "0.73001057", "0.73001057", "0.7234893", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.7199938", "0.71987224", "0.71546304", "0.71546304", "0.71546304", "0.7143735", "0...
0.73661774
2
/Get URL to highest resolution.
public function getCoverLink() { $link = $this->_getFirstElement('MediaFile[MediaFileTypeCode=06 or MediaFileTypeCode=04]/MediaFileLink'); if($link) { return $link; } else return null; /* From the docs: Codelists f114: MediaFileTypeCode 04, Image, front cover 06, Image, front cover, high quality 10, wenn der Annotationtyp = ‚BPROB‘ 29, wenn der Annotationtyp = ‚VPROB‘ 30, wenn der Annotationtyp = ‚HPROB‘ f115: MediaFileFormatCode 02 GIF 03 JPEG 04 PDF 05 TIF 06 REALAudio 28.8 07 MP3 08 MPEG-4 */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function best()\n {\n return Urls::best();\n }", "private function getLatestPlace(){\n $last = -100000000;\n foreach($this->URLs as $url){\n if($url['url_place'] > $last) $last = $url['url_place'];\n }\n if($last == -100000000) $last = 0;\n return...
[ "0.6634133", "0.64844525", "0.6127786", "0.56992096", "0.566053", "0.55811864", "0.55535346", "0.5485904", "0.5485899", "0.54836226", "0.5462551", "0.545741", "0.5450273", "0.5450273", "0.54310304", "0.54287696", "0.542643", "0.5406381", "0.5405204", "0.5393089", "0.53632325"...
0.0
-1
Returns the code for the outdated category scheme.
public function getVLBSchemeOld() { $result = $this->product->get("mainsubject[b191=26]/SubjectCode") or $this->product->get("Subject[b191=26]/SubjectCode"); if($result) { $vlbSchemeOld = $result[0]->nodeValue; // remove last "0" if there are 5 characters and last character is "0" if(strlen($vlbSchemeOld) == 5 && substr($vlbSchemeOld,-1) === "0") { $vlbSchemeOld = substr($vlbSchemeOld,0,4); } return $vlbSchemeOld; } else return false; /* From the docs: Verarbeitungsregel für Feld "pr.VLBSchemeOld" 1. SubjectCode aus MainSubject Composite wenn SchemeIdentifier=26 und SchemeVersion=0 oder leer 2. SubjectCode aus Subject Composite wenn SchemeIdentifier=26 und SchemeVersion=0 oder leer wenn 5-stellig und letzte Stelle "0" wird die letzte 0 entfernt */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnUpdateCat() {\n return $this->category_id;\n }", "public function getCategoryCode(): ?string\n {\n return isset($this->CategoryCode) ? $this->CategoryCode : null;\n }", "public function getUpdateCategory()\n {\n if (array_key_exists(\"updateCategor...
[ "0.5700827", "0.55734944", "0.55350786", "0.55233705", "0.5476821", "0.5313977", "0.5273527", "0.527035", "0.52588046", "0.52390206", "0.5205613", "0.5191795", "0.5177493", "0.5176649", "0.51656675", "0.51538837", "0.51146203", "0.5114448", "0.50808173", "0.5073058", "0.50696...
0.5277092
6
Retrieve Price information from ONIX data
public function getPrices() { // get available price information $pricesAsDom = $this->product->get("SupplyDetail/Price"); // get child nodes as array $pricesAsArray = array_map(array($this,'_childNodes2Array'), $pricesAsDom); return $pricesAsArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPriceInformation() {\n $fields = array('priceInformation' => array(\n 'priceHeader' => 'header',\n 'price',\n 'acquisitionTerms',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "abstract public ...
[ "0.70512897", "0.67254406", "0.67109066", "0.67043626", "0.6688906", "0.661633", "0.661633", "0.661633", "0.661633", "0.6608259", "0.63641334", "0.63224113", "0.63052315", "0.62630504", "0.62630504", "0.6252231", "0.62331706", "0.6229603", "0.620279", "0.6115813", "0.6114906"...
0.56774575
78
Retrieve Blurb Text from ONIX data
public function getBlurb() { // check if there is text available in the onix message // and return as Blurb if it exists $records = $this->product->get('OtherText'); foreach ($records as $record) { if($record->getType() == 18) { return $record->getValue(); } } return false; /* Original SQL statement from spMacSelectProductsFairnopoly.sql: > update macSelectProducts > set Blurb = > cast(( > select top 1 OtherText from refProductOtherText > where macSelectProducts.ProductReference = refProductOtherText.ProductReference > and refProductOtherText.TextTypeCode = '18') > as varchar(4000)) */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_featureblurb() {\n\t\tglobal $product;\n\t\tif ( is_front_page() ) {\n\t\t\t$content = get_post_meta( $product->id, 'featureblurb', true );\n\t\t\tif ( $content ) {\n\t\t\t\techo( '<div class=\"featureblurb\">' . html_entity_decode( $content ) . '</div>' );\n\t\t\t}\n\t\t}\n\t}", "public function ge...
[ "0.6004652", "0.59671986", "0.5666079", "0.5549008", "0.5529162", "0.54114276", "0.54049116", "0.53617334", "0.53467906", "0.5331171", "0.5294811", "0.5259774", "0.5241196", "0.520316", "0.5161109", "0.5139849", "0.5134706", "0.51287276", "0.5109651", "0.5109651", "0.5109651"...
0.7552279
0
get the code list
public function getLibriNotificationKey() { $codeList = $this->_getFirstElement('lieferantintern/ms/ms01'); // only return key if it's from the default code list return ($codeList == "01") ? $this->_getFirstElement('lieferantintern/ms/ms02') : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllCode(){\n return parent::getAll('code_ade');\n }", "public static function getAutoCodeList()\n {\n $autocodes = array();\n\n $scopes = JFolder::folders(ECRPATH_AUTOCODES);\n\n foreach($scopes as $scope)\n {\n if($scope != 'admin' && $scope...
[ "0.7399222", "0.72470206", "0.69297373", "0.6919468", "0.6807274", "0.6806866", "0.6806866", "0.6806866", "0.6806866", "0.6806866", "0.6806866", "0.6765369", "0.66771406", "0.66729605", "0.6575543", "0.65106094", "0.65098315", "0.64870447", "0.64714026", "0.6358635", "0.63563...
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n ...
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", ...
0.0
-1
Handle an incoming request.
public function handle(Request $request, Closure $next) { if (! $this->digestAuthService->getDigest()) { $dg = new DigestAuthCreate(); return $dg->make($request); } $config = config('digest-auth'); if ($config['driver'] == 'env' && ! $this->digestAuthService->isValidEnv()) { return $this->digestAuthService->unauthorized($request); } if ($config['driver'] == 'db' && ! $this->digestAuthService->isValidDb()) { return $this->digestAuthService->unauthorized($request); } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $...
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", ...
0.0
-1
Renders the index view for the module
public function actionIndex() { return $this->render('index', [ 'dashboardData' => [ [ Yii::t('app', 'WEBME_EMAIL'), Yii::t('app', 'WEBME_EMAIL_INFO'), Email::findIdentityCount('id_user',User::getUserId()), 'email', 'info' ], [ Yii::t('app', 'WEBME_LETTER'), Yii::t('app', 'WEBME_LETTER_INFO'), Letter::findIdentityCount('id_user',User::getUserId()), 'letter', 'secondary' ], [ Yii::t('app', 'WEBME_MAILING'), Yii::t('app', 'WEBME_MAILING_INFO'), Mailing::findIdentityCount('id_user',User::getUserId()), 'mailing', 'success' ] ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex()\n {\n $this->layout = \"main_module\";\n return $this->render('index');\n }", "public function actionIndex()\r\n\t{\r\n\t\t$modules = ModuleModel::instance()->find();\r\n\t\t$this->render('index', array('modules' => $modules));\r\n\t}", "function index() {\n ...
[ "0.8542062", "0.83196074", "0.8300524", "0.82760626", "0.8169512", "0.8125656", "0.81207645", "0.8093793", "0.80549777", "0.8050916", "0.80312014", "0.80235296", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0...
0.0
-1
end _construct() Get the information of tier price
public function getInfo(){ $info = $this->getData(); $price = $this->getData('price'); $info['formatted_price'] = $this->priceHelper->currency($price, true, false); $info['website'] = $this->websiteHelper->getWebsites(); $info['customergroup'] = $this->customerGroupHelper->getCustomerGroups(); return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getTierPriceStructure()\n {\n return [\n 'children' => [\n 'record' => [\n 'children' => [\n 'website_id' => [\n 'arguments' => [\n 'data' => [\n ...
[ "0.68826574", "0.64331955", "0.6345974", "0.6339499", "0.62771", "0.6111145", "0.61040646", "0.60992914", "0.60992914", "0.60507244", "0.6031805", "0.60252446", "0.5965318", "0.5944057", "0.5944057", "0.5944057", "0.5944057", "0.5925326", "0.5925326", "0.58978975", "0.5829166...
0.5310136
83
need to check that following on doesn't break this code!!!
function IsOK() { return ($this->status == 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function broken() { return TRUE; }", "function broken() { }", "protected function fixSelf() {}", "protected function fixSelf() {}", "public function benchThisWillBeSkipped()\n {\n }", "protected function _refine() {\n\n\t}", "public function qualifyToStart(): bool;", "public function afmelden()...
[ "0.6182695", "0.6130271", "0.60010654", "0.60010654", "0.599624", "0.5970275", "0.589821", "0.5882317", "0.57822347", "0.57153153", "0.5701259", "0.56878024", "0.56466585", "0.5640242", "0.5640025", "0.56266403", "0.5623793", "0.56098425", "0.55810934", "0.55798614", "0.55753...
0.0
-1
echo $queryTerm, ' ', $queryType, "\n";
function search($institution, $queryType, $queryTerm, $start=0, $limit=10) { if (strcasecmp($institution,'CASENT') == 0) { $institution = 'CASENT'; } if (strcasecmp($institution,'inbiocri') == 0) { $institution = 'CASENT'; } if (strcasecmp($institution,'lacment') == 0) { $institution = 'CASENT'; } if (strcasecmp($institution,'jtlc') == 0) { $institution = 'CASENT'; } $server = $this->serverURL[$institution]; $resource = $this->resourceCode[$institution] ; // Build request message $tree = new XML_Tree(); $root = & $tree->addRoot( "request", '', array( "xmlns" => 'http://digir.net/schema/protocol/2003/1.0', "xmlns:xsd" => 'http://www.w3.org/2001/XMLSchema', "xmlns:xsi" => 'http://www.w3.org/2001/XMLSchema-instance', "xmlns:digir" => 'http://digir.net/schema/protocol/2003/1.0', "xmlns:dwc" => 'http://digir.net/schema/conceptual/darwin/2003/1.0', "xmlns:darwin" => 'http://digir.net/schema/conceptual/darwin/2003/1.0', "xsi:schemaLocation" => 'http://digir.net/schema/protocol/2003/1.0', "xsi:schemaLocation" => 'http://digir.net/schema/protocol/2003/1.0 http://digir.sourceforge.net/schema/protocol/2003/1.0/digir.xsd http://digir.net/schema/conceptual/darwin/2003/1.0 http://digir.sourceforge.net/schema/conceptual/darwin/2003/1.0/darwin2.xsd', ) ); $header = & $root->addChild("header"); $header->addChild("version", "1.0.0"); $header->addChild("sendTime", date("Ymd \TG:i:s") ); $header->addChild("source", $_SERVER['SERVER_ADDR']); $header->addChild("destination", $server, array( "resource" => $resource ) ); $header->addChild("type", "search"); $search = & $root->addChild("search"); $filter = & $search->addChild("filter"); $equals = & $filter->addChild("equals"); switch($queryType) { case 'genus': $equals->addChild("darwin:Genus", $queryTerm); break; case 'family': $equals->addChild("darwin:Family", $queryTerm); break; case 'class': $equals->addChild("darwin:Class", $queryTerm); break; case 'country': $equals->addChild("darwin:Country", $queryTerm); break; case 'specimen': switch ($this->schema[$institution]) { case "1.14": $equals->addChild("darwin:CatalogNumber", $queryTerm); break; default: $equals->addChild("darwin:CatalogNumberText", $queryTerm); break; } break; default: break; } $records = & $search->addChild("records", "", array( "limit" => $limit, "start" => $start ) ); if ($this->schema[$institution] == '1.12') { $records->addChild("structure", "", array( // "schemaLocation" => "http://bnhm.berkeley.museum/manis/DwC/darwin2resultfull.xsd", "schemaLocation" => "http://digir.sourceforge.net/schema/conceptual/darwin/result/full/2003/darwin2resultfull.xsd", ) ); } else { $structure = & $records->addChild("structure", ""); $element = & $structure->addChild("xsd:element", "", array( "name" => "record" )); $complexType = & $element->addChild("xsd:complexType", ""); $sequence = & $complexType->addChild("xsd:sequence", ""); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:InstitutionCode" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:CollectionCode" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:CatalogNumber" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:ScientificName" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:VerbatimCollectingDate" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:DateLastModified" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:YearCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:MonthCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:DayCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:TimeCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Kingdom" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Phylum" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Class" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Order" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Family" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Genus" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Species" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Subspecies" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Country" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:StateProvince" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:County" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Island" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:IslandGroup" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:ContinentOcean" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Locality" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:HorizontalDatum" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Collector" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Remarks" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:TypeStatus" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:OtherCatalogNumbers" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:CollectorNumber" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:FieldNumber" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:GenBankNum" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Latitude" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Longitude" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Sex" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Notes" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:IdentifiedBy" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:YearIdentified" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:MonthIdentified" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:DayIdentified" )); } $xml = $tree->get(); //echo $xml; // Strip XML header $xml = str_replace ( '<?xml version="1.0"?>', '', $xml); // Remove line breaks $xml = str_replace ( "\n", '', $xml); // Replace spaces with HEX code $xml = str_replace ( " ", '%20', $xml); //echo $xml; $url = "http://$server?doc="; $url .= $xml; //echo $url; return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function printquery(){\n\t\techo $this->query.\";\";\n\t}", "function testQueryTerms()\n\t{\n\t\t// system is functional\n\t\treturn \"<filter>\\n\".\n\t\t\t\"\t<or>\\n\".\n\t\t\t\"\t\t<equals>\\n\".\n\t\t\t\"\t\t\t<darwin:Genus>Helix</darwin:Genus>\\n\".\n\t\t\t\"\t\t</equals>\\n\".\n\t\t\t\"\t\t<equals...
[ "0.6567252", "0.5907134", "0.58895934", "0.5691077", "0.56161386", "0.5581429", "0.5440151", "0.53114104", "0.5260784", "0.52588737", "0.5256253", "0.52561885", "0.5254958", "0.52311647", "0.5229302", "0.5160042", "0.5155938", "0.514605", "0.5132944", "0.5120667", "0.5114413"...
0.48347777
74
ENQUEUE SCRIPTS AND STYLES
function gwself_scripts() { global $post; //default script - needed everywhere wp_enqueue_script( 'theme-jquery', get_template_directory_uri() . '/dist/js/theme.js', array('jquery'), 20190529, true); wp_localize_script('theme-jquery', 'WPURLS', array('siteurl' => get_option('siteurl'))); //header, footer, global css wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/dist/css/theme.css', array(), date("H:i:s")); //section specific styles and scripts if(is_front_page()) { //FRONT PAGE SCRIPTS wp_enqueue_script( 'fp-script', get_template_directory_uri() . '/dist/js/frontpage.js', array('jquery'), 20190529, true); wp_enqueue_style( 'frontpage-style', get_template_directory_uri() . '/dist/css/frontpage.css', array(), date("H:i:s")); } elseif(is_singular()) { $type = $post->post_type; wp_enqueue_style( $type.'-style', get_template_directory_uri() . '/dist/css/type_'.$type.'.css', array(), date("H:i:s")); } else { wp_enqueue_style( 'page-style', get_template_directory_uri() . '/dist/css/type_page.css', array(), date("H:i:s")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onEnqueueScripts()\n {\n $this->enqueue('front');\n }", "function prosody_plugin_queue_scripts ()\n{\n\n wp_enqueue_style(\n 'poem-css',\n plugin_dir_url( __FILE__ ) . 'css/poem.css',\n array(),\n null,\n false\n );\n\n wp_register_scri...
[ "0.7308369", "0.7296776", "0.7290201", "0.72651154", "0.725023", "0.71685654", "0.68457824", "0.6728443", "0.6724165", "0.6702352", "0.6670294", "0.6660659", "0.6616481", "0.66061217", "0.6606054", "0.6598092", "0.6583154", "0.6527727", "0.6513601", "0.64897674", "0.64626294"...
0.0
-1
Return the sluggable configuration array for this model.
public function sluggable() { return [ 'slug' => [ 'source' => 'title' ] ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sluggable()\n {\n return [\n 'slug_subway' => [\n 'source' => 'slugsubways',\n 'unique' => false\n ],\n 'slug_district' => [\n 'source' => 'slugdistricts',\n 'unique' => false\n ],\n ...
[ "0.75755036", "0.75192726", "0.747598", "0.747598", "0.74293983", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", ...
0.7332454
44
Thread slugs are unique to which Channel it belongs to.
public function scopeWithUniqueSlugConstraints(Builder $query, Model $model) { return $query->where('channel_id', $model->channel_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function path()\n {\n return \"threads/{$this->channel->slug}/{$this->id}\";\n }", "public function Thread($slug)\n {\n $allThreads = Thread::whereFlag(1)->whereSlug($slug)->first();\n return $allThreads;\n }", "public function store($channel, Thread $thread)\n {\n ...
[ "0.58216554", "0.5651364", "0.5403345", "0.53189677", "0.5234935", "0.5172869", "0.5170937", "0.5170937", "0.5163275", "0.5125259", "0.5081936", "0.508134", "0.4974361", "0.497251", "0.49600846", "0.49469784", "0.4941638", "0.4941106", "0.4912048", "0.49013048", "0.48814017",...
0.0
-1
Scope Thread slug route binding to the Channel it belongs to.
public function resolveRouteBinding($value) { return $this->where('channel_id', request()->route('channel')->id) ->where('slug', $value) ->first() ?? abort(404); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChannelsRoute(): string;", "public function path()\n {\n return \"threads/{$this->channel->slug}/{$this->id}\";\n }", "public function getPermalinkAttribute(){\n return route('thread.show', [$this->thread, 'page' => $this->getPage()]).'#'.$this->id;\n }", "public fun...
[ "0.5667909", "0.56253904", "0.54964876", "0.51647586", "0.5149664", "0.5129022", "0.5082128", "0.505672", "0.50302786", "0.49586543", "0.48727617", "0.48667118", "0.48667118", "0.48596823", "0.4845395", "0.4841944", "0.4841944", "0.48282135", "0.48280743", "0.48255768", "0.48...
0.51003885
6
Threads have many Replies.
public function replies() { return $this->hasMany('App\Models\Reply'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n $threads = factory('App\\Thread', 20)->create();\n\n $threads->each(function($thread) {\n factory('App\\Reply', 6)->create(['thread_id' => $thread->id]);\n });\n }", "public function test_a_channel_consists_of_threads()\n {\n $channel=cr...
[ "0.64374167", "0.6035146", "0.5808367", "0.5688937", "0.56665915", "0.56487554", "0.5621256", "0.5589422", "0.5586703", "0.55833626", "0.5571694", "0.5558367", "0.55336", "0.55266285", "0.55135196", "0.5494771", "0.54862475", "0.5481228", "0.54628724", "0.5453215", "0.5447811...
0.52611244
37
Threads optionally have a latest reply.
public function latestReply() { return $this->hasOne('App\Models\Reply', 'id', 'latest_reply_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastReply()\n {\n }", "public function last_reply()\n\t{\n\t\treturn isset($this->last_reply) ? $this->last_reply : FALSE;\n\t}", "function thereply() {\n\tglobal $replies_index, $reply, $replies;\n\n\t$reply = $replies[$replies_index - 1];\n\treturn $reply;\n}", "public func...
[ "0.6105781", "0.6047081", "0.5842913", "0.5809284", "0.5688852", "0.56353676", "0.55768025", "0.5522922", "0.5454064", "0.5357753", "0.53565353", "0.534966", "0.5336588", "0.531952", "0.5312552", "0.5273388", "0.524096", "0.52298135", "0.5207563", "0.5159425", "0.5134863", ...
0.5097145
21
Threads belong to one Owner.
public function owner() { return $this->belongsTo('App\Models\User', 'user_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function owner()\n {\n return $this->conn->get('lock:' . $this->name);\n }", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function run(): void\n {\n Thread::with('participants.owner')->get()->each(function (Thread $thread) {\n ...
[ "0.60078794", "0.5714955", "0.56118613", "0.55595845", "0.5543205", "0.54146844", "0.5394795", "0.53756744", "0.5357539", "0.53335136", "0.5323346", "0.53053147", "0.5304372", "0.5304111", "0.5304111", "0.5302205", "0.52927977", "0.52740467", "0.52740467", "0.52740467", "0.52...
0.509742
56
Threads optionally belong to one Editor.
public function editor() { return $this->belongsTo('App\Models\User', 'edited_by'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignEditor($args) {\n\t\t$this->validate();\n\t\tLocale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER)); // manager.people.noneEnrolled\n\t\t$press =& Request::getPress();\n\t\t$monographId = Request::getUserVar('monographId');\n\t\t$editorId = Request::getUserVar('editorId');\n\t\t$roleDao =& D...
[ "0.55856884", "0.5445312", "0.5362104", "0.53467846", "0.5246736", "0.5176492", "0.5142798", "0.51255614", "0.5101547", "0.5091959", "0.50733703", "0.50306034", "0.5006213", "0.499223", "0.49452737", "0.4905289", "0.4885319", "0.48680624", "0.4853541", "0.48505396", "0.481657...
0.0
-1
Threads belong to one Channel.
public function channel() { return $this->belongsTo('App\Models\Channel'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App...
[ "0.6600829", "0.56396717", "0.56288403", "0.55976164", "0.5578812", "0.55316776", "0.5499916", "0.5485731", "0.5464067", "0.5458197", "0.544674", "0.544674", "0.5433949", "0.5433949", "0.5430978", "0.54198354", "0.54198354", "0.54183", "0.5417679", "0.539075", "0.539075", "...
0.5495553
7
Threads have many views.
public function views() { return $this->hasMany('App\Models\ViewedThread'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function threads()\n\t{\n\n\t\t// get sort type\n\n\n\t\t$query = Thread::where('parent_id', null)->with('user')->with('topic')->limit(20);\n\n\t\t$sort = get_string('sort', 'newest');\n\n\t\t$topic = get_int('topic', false);\n\n\t\tif($topic)\n\t\t\t$query->where('topic_id', $topic);\n\n\t\tThread::setOrde...
[ "0.6227774", "0.6065797", "0.58746225", "0.5841943", "0.58096045", "0.57834", "0.57736015", "0.5746879", "0.5743991", "0.57399094", "0.564211", "0.56412166", "0.55708474", "0.5564394", "0.55544937", "0.5502142", "0.549396", "0.549396", "0.549396", "0.549396", "0.54552364", ...
0.62835604
0
Threads belong to many viewers (Users) through ViewedThread.
public function viewedBy() { return $this->belongsToMany( 'App\Models\User', 'viewed_threads', 'thread_id', 'user_id' ) ->using('App\Models\ViewedThread') ->withPivot('timestamp'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function views()\n {\n return $this->hasMany('App\\Models\\ViewedThread');\n }", "public function favoriteThreads($userid, $threads);", "public function threads()\n {\n return $this->hasMany(thread::class);\n }", "public function threads()\n {\n return $this->hasMan...
[ "0.64863783", "0.6115233", "0.58442837", "0.5840202", "0.5840202", "0.5837736", "0.58362126", "0.573146", "0.57066077", "0.57065344", "0.56756526", "0.56379545", "0.5579365", "0.55518365", "0.54680085", "0.5441456", "0.5403752", "0.53617686", "0.53530246", "0.5348783", "0.527...
0.7057228
0