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
Print the page title.
function title() { print($this->_title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function printTitle() {\n\t\techo $this->title;\n\t}", "protected function renderPageTitle() {}", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "function printPageTitle($title)\r\n {\r\n return \"<div cla...
[ "0.8685286", "0.8297929", "0.82351977", "0.81676614", "0.79909784", "0.78761894", "0.77594525", "0.7706649", "0.76746875", "0.76746875", "0.7671304", "0.76472837", "0.7639976", "0.762389", "0.7617759", "0.7616746", "0.7610176", "0.75980204", "0.7595578", "0.7583058", "0.75735...
0.8084115
4
Print the remainder of the head contents, after the title is removed.
function head() { print($this->_head); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function printHead()\n\t{\n\t\t$out = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\n\t\t$out .= $this->head . PHP_EOL;;\t\t\t\n\t\techo $out;\n\t}", "public function show_head() {\n \n $output = '<head>';\n \n if( empty( $this->title ) ) {\n $this->title = \"No Ti...
[ "0.702319", "0.69506586", "0.66625535", "0.64830303", "0.6461335", "0.6445953", "0.64183426", "0.63166505", "0.6307648", "0.63072115", "0.6306825", "0.63003266", "0.6283586", "0.6280708", "0.62274814", "0.62072176", "0.61740875", "0.6163192", "0.6140546", "0.6122661", "0.6117...
0.7106884
0
Gets the URL of the page which is being viewed.
function get_url() { return $_SERVER['REQUEST_URI']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}", "public function getCurrentPageURL() {\n\t\t\t$pageURL = 'http';\n\t\t\tif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == \"on\...
[ "0.7789694", "0.7711193", "0.7643896", "0.76110876", "0.7602654", "0.7562293", "0.75571966", "0.7538025", "0.75284165", "0.7528208", "0.74613637", "0.7438967", "0.74220216", "0.7385303", "0.73793983", "0.73296744", "0.7295834", "0.7291566", "0.72776365", "0.7262276", "0.72476...
0.705882
47
Get a single property.
function get_property($property_name, $default = NULL) { $property_value = $this->_properties[$property_name]; if ($property_value == NULL) { $property_value = $default; } return $property_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProperty($property = null);", "public function get($property);", "public function getp($property){\n if(property_exists($this, $property)){\n return $this->$property;\n }\n }", "public function getProperty();", "public function getProperty($property)\n {\n if (prope...
[ "0.81342554", "0.8052716", "0.798323", "0.79283583", "0.7705402", "0.7600875", "0.7570151", "0.7570151", "0.7570151", "0.7570151", "0.7563234", "0.75250655", "0.7520978", "0.7515914", "0.7511822", "0.75090766", "0.7492735", "0.7492254", "0.7487719", "0.74780005", "0.7469257",...
0.0
-1
Print a single property. Properties found in tags are named meta.[propertyName]. Properties found on the tag as attributes are named body.[propertyName].
function property($property_name, $default = NULL, $formatted = false) { $property_value = $this->get_property($property_name, $default); if ($property_value != NULL) { if ($formatted) { if (preg_match("/^(body|meta).(.*)$/", $property_name, $match)) { $property_prefix = $match[1]; $property_name_cut = $match[2]; } else { die("Invalid property name: $property_name.\n"); } if ($property_prefix == "meta") { $meta_type = $this->_meta_property_types[$property_name]; $before = "<meta $meta_type=\"$property_name_cut\" content=\""; $after = "\" />"; } else if ($property_prefix == "body") { $before = " $property_name_cut=\""; $after = "\""; } else { die("Impossible branch: $property_name => $property_prefix $property_name_cut"); } } else { $before = ""; $after = ""; } print "$before$property_value$after"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __get($property) \n {\n echo '<br>';\n echo \"Ban vua truy cap vao thuoc tinh {$property} khong ton tai trong class - AAAAAAA\";\n echo '<br>';\n }", "public function tag( $property, $content ) {\n\t\tif ( empty( $content ) || ! is_scalar( $content ) ) {\n\t\t\treturn ...
[ "0.61537725", "0.6032493", "0.59532857", "0.59488595", "0.5947236", "0.57271165", "0.5694532", "0.5619322", "0.5613906", "0.55825514", "0.55825514", "0.5578231", "0.54482704", "0.54340315", "0.5393423", "0.5389288", "0.5374525", "0.53594244", "0.535807", "0.53430307", "0.5342...
0.654449
0
Print the page body.
function body() { print($this->_body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function printPage()\n {\n $this->printDoctype();\n $this->printOpenHtml();\n $this->printHead(' ');\n $this->printBody(' ');\n $this->printCloseHtml();\n }", "public function printContent() {\r\n $this->content .= $this->doc->endPage();\r\n ech...
[ "0.8182446", "0.7376723", "0.7212335", "0.7184767", "0.71688557", "0.71688557", "0.71688557", "0.71419954", "0.71362054", "0.7063102", "0.6974742", "0.6866685", "0.6770787", "0.66232985", "0.66109693", "0.6604975", "0.6604975", "0.6604975", "0.6604975", "0.6604975", "0.660465...
0.7450329
1
Mod by rsk 8/7/2010
function getBody() { return $this->_body; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "function fix() ;", "public function helper()\n\t{\n\t\n\t}", "final function velcom(){\n }", "private function __() {\n }", "public function extra_voor_verp()\n\t{\n\t}", "abstract function fromexp();", "private function j() {\n }", "public functi...
[ "0.54886115", "0.5247304", "0.5222733", "0.52005756", "0.5145839", "0.5026891", "0.49951398", "0.495083", "0.49484852", "0.49438474", "0.49419427", "0.48833212", "0.48833212", "0.48808685", "0.4879044", "0.4879044", "0.48754293", "0.4875116", "0.48749214", "0.48749214", "0.48...
0.0
-1
Includes the specified page as decorated content.
function apply_decorator($page_location, $decorator_name) { global $decorator_selector; global $_GET; global $_POST; // Store the original GET and POST variables. $OLD_GET = $_GET; $OLD_POST = $_POST; // Does the page location have a query string? If it does, we need to parse it! $_GET = array(); $_POST = array(); $parsed_location = parse_url($page_location); if (isset($parsed_location['query'])) { parse_str($parsed_location['query'], $_GET); } // Capture the output from requiring the page. ob_start(); require($decorator_selector->get_path($parsed_location['path'])); $page_contents = ob_get_clean(); // Restore the original GET and POST variables. $_GET = $OLD_GET; $_POST = $OLD_POST; // Create the page object. This guy does all the parsing work. $page = new Page($page_contents); // Create the decorator. $decorator = $decorator_selector->get_decorator($decorator_name); // Perform the decoration. $decorator->decorate($page); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function render_page_content(): void;", "public function prePageContent();", "function honeycomb_page_content() {\n\t\t?>\n\t\t<div class=\"entry-content\">\n\t\t\t<?php the_content(); ?>\n\t\t\t<?php\n\t\t\t\twp_link_pages( array(\n\t\t\t\t\t'before' => '<div class=\"page-links\">' . __( 'P...
[ "0.644496", "0.6397758", "0.63345134", "0.5957173", "0.57094026", "0.5673658", "0.5673504", "0.56591785", "0.5651059", "0.5646003", "0.5615955", "0.5611832", "0.55842716", "0.55839837", "0.55820394", "0.5547798", "0.5525981", "0.5453372", "0.5436326", "0.5434511", "0.541059",...
0.5800724
4
Import and then analyze a file from maltego
public function import($file) { $this->_findings['websites'] = []; $this->_findings['profiles'] = []; $this->_findings['emails'] = []; $this->_findings['locations'] = []; $fileContent = file_get_contents($file); $fileContent = str_replace( [ 'version="1.1"', // Change Version to 1.0 ' xmlns:mtg="http://maltego.paterva.com/xml/mtgx"', // Remove Schema 'mtg:' // Remove Namespace ], [ 'version="1.0"', '', '' ], $fileContent ); $this->_importedFile = Parser::xml($fileContent); $this->analyze(); return $this->_findings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function import();", "protected function analyze()\n {\n foreach($this->_importedFile['graph']['node'] as $node) {\n $entity = $node['data'][0]['MaltegoEntity'];\n\n switch($entity['@attributes']['type']) {\n case \"maltego.DNSName\":\n $th...
[ "0.6240464", "0.61813474", "0.59099674", "0.5896096", "0.5859274", "0.57322603", "0.55810195", "0.55810195", "0.55186427", "0.5502431", "0.5468458", "0.5463712", "0.54300904", "0.538213", "0.53469044", "0.5222115", "0.5214371", "0.5214371", "0.5214371", "0.51911104", "0.51580...
0.46778297
85
Analyze the files content for relevant information. Adds the findings to the collection
protected function analyze() { foreach($this->_importedFile['graph']['node'] as $node) { $entity = $node['data'][0]['MaltegoEntity']; switch($entity['@attributes']['type']) { case "maltego.DNSName": $this->_findings['websites'][] = $entity['Properties']['Property']['Value']; break; case "maltego.Website": $this->_findings['websites'][] = $entity['Properties']['Property'][0]['Value']; break; case "maltego.Domain": $this->_findings['websites'][] = $entity['Properties']['Property'][0]['Value']; break; case "maltego.EmailAddress": $email = $entity['Properties']['Property'][0]['Value']; if (filter_var($email, FILTER_VALIDATE_EMAIL)) { $this->_findings['emails'][] = $email; } break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function collectInfoFiles()\r\n {\r\n $files_found = $this->findFiles($this->destination_dir, array('md', '1st', 'txt'));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }", "public function parseFiles()\n {\n $this-...
[ "0.6769866", "0.6471379", "0.6001935", "0.5999668", "0.59028625", "0.58156", "0.57391924", "0.5710829", "0.5695798", "0.56572455", "0.5624928", "0.56242263", "0.5584538", "0.55749923", "0.5557572", "0.5513033", "0.54700977", "0.53777933", "0.53340554", "0.53281325", "0.528663...
0.65273297
1
Realiza a consulta pelo tipos de taxa TDE ou TDA
function getFiltroTiposTaxa($get = null,$where = " 1 = 1"){ $Result = ""; if(isset($get['getFiltroTipo'])){ foreach ($get['getFiltroTipo'] as $key => $value ) { switch ($value) { case 1: $where .= " AND TDE <> 0 "; break; case 2: $where .= " AND TDA <> 0 "; break; case 3: $where .= " AND TDE = 0 "; break; case 4: $where .= " AND TDA = 0 "; break; } } return $where; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function calculate_tax_filter() {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_private_token'] ) ) {\n $private_key = $edd_options['taxedd_private_token'];\n \n try { \n\n $taxtaxamo = new Taxamo( new...
[ "0.66550237", "0.6265659", "0.6242223", "0.6144572", "0.6118079", "0.6059821", "0.5950713", "0.5885671", "0.5866491", "0.5849872", "0.58299667", "0.5793177", "0.5777902", "0.57726985", "0.5766309", "0.57435226", "0.5730709", "0.5709373", "0.57048285", "0.5688068", "0.56801844...
0.63616866
1
/ Filtro para verificar quando tempo demorou a entrega para ser realizada
function getFiltroTempoEntrega($get,$where = " 1 = 1"){ if(isset($get['hrini']) && isset($get['hrfim'])){ $hrIni = $get['hrini']; $hrFim = $get['hrfim']; if (!empty($hrIni) && !empty($hrFim)){ return $where .= " AND TO_CHAR(EXTRACT(HOUR from NUMTODSINTERVAL((to_date(DtFim,'YYYYMMDDHH24MISS') - to_date(DtIni,'YYYYMMDDHH24MISS')),'DAY')),'FM00') ||':' || TO_CHAR(EXTRACT(Minute from NUMTODSINTERVAL((to_date(DtFim,'YYYYMMDDHH24MISS') - to_date(DtIni,'YYYYMMDDHH24MISS')),'DAY')),'FM00') BETWEEN '{$hrIni}' AND '{$hrFim}'"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkTimeEnd(): bool;", "public function reiniciarMedio($tiempo) {\n $tiempo2 = $tiempo->time();\n $hora = date('H', $tiempo2);\n $minutos = date('i', $tiempo2);\n $segundos = date('s', $tiempo2);\n\n if ($hora == '00' && $minutos == '00' && $segundos == '00')\n {\n $this->...
[ "0.63694793", "0.63483495", "0.62706685", "0.616596", "0.59991634", "0.59857655", "0.59786695", "0.59433407", "0.5919058", "0.59103733", "0.59041274", "0.587384", "0.58679867", "0.58649194", "0.5863719", "0.5855342", "0.5834939", "0.5824358", "0.5796377", "0.57929236", "0.576...
0.0
-1
Filtro utilizado para as empresa
function getFiltroEmpresa($get,$where = "1 = 1"){ if(isset($get['cdFilial']) ){ $CdFilial = $get['cdFilial']; if(!empty($CdFilial)){ return $where .= " AND CDFILIALENTREGA IN ($CdFilial) "; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filtrarListaAlumnos($tipo_filtro, $valor)\n {\n //`al`.`carrera_especialidad`\n $filtro = \"\";\n switch ($tipo_filtro){\n case \"1\":\n //Filtro por sexo\n $filtro = \" AND p.sexo = \".$valor;\n break;\n cas...
[ "0.6547165", "0.6509606", "0.65028065", "0.64058983", "0.637555", "0.6325661", "0.63012654", "0.6282521", "0.62425196", "0.6237797", "0.6194856", "0.6154795", "0.6150095", "0.6121487", "0.6112989", "0.6094773", "0.60873294", "0.6065891", "0.60560966", "0.6051112", "0.60350245...
0.6578873
0
Lista todas as entregas baixadas via 0800
function infoEntregas0800($page = 1,$order = 'DTINI DESC'){ //Filtros Where's : D - Data , S - String, T - Tipo Ocorrência, Te - Tempo de Entrega, Emp - Código da empresa de Entrega $whereD = (String) null; $whereS = (String) null; $whereT = (String) null; $whereTe = (String) null; $whereEmp = (String) null; $where = (String) null; $sqlPagination = (String) null; $get = $this->input->get(); if(isset($get['sqlPagination'])){ $sqlPagination = $get['sqlPagination'] ; } //Verifica se existe paginação ou se é um novo filtro if(empty(trim($sqlPagination))){ //Where com as String, Filtro like $whereS = $this->getFiltroWhereString($get); //Where com as Datas da ocorrências - (Inicio e Fim) $whereD = $this->getFiltroDate($get,$whereS)? $this->getFiltroDate($get,$whereS) : $whereS; //Where com os Tipo de Ocorrência 1- Inicio de Entrega 3- Entrega Normal 5- Problema na Entrega $whereT = $this->getFiltroTipoOcorrencia($get, $whereD)? $this->getFiltroTipoOcorrencia($get, $whereD) :$whereD ; //Where com o tempo de demora da Entrega $whereTe = $this->getFiltroTempoEntrega($get,$whereT)? $this->getFiltroTempoEntrega($get,$whereT) : $whereT; //Where pelas empresas de entrega $whereEmp = $this->getFiltroEmpresa($get,$whereTe)? $this->getFiltroEmpresa($get,$whereTe) : $whereTe; //Where Pelas Taxas TDE ou TDA $where = $this->getFiltroTiposTaxa($get,$whereEmp)? $this->getFiltroTiposTaxa($get,$whereEmp) : $whereEmp ; if($this->verifica_gatilho('FILTRO_CENTRAL')){ if(!empty($this->input->get()['CDEMPRESA'])){ foreach($this->input->get()['CDEMPRESA'] as $k => $cdEmp){ if($k == 0){ $empresa = $cdEmp; }else{ $empresa .= ",$cdEmp"; } } $where .= " AND CDEMPRESADESTINO in ($empresa) "; } }else{ $where .= " AND CDEMPRESADESTINO = {$this->sessao['filial']} "; } if($where == "1 = 1"){ $this->dados['sqlPagination'] = ""; }else{ $this->dados['sqlPagination'] = base64_encode($where); } }else{ $where = base64_decode($sqlPagination); $this->dados['sqlPagination'] = base64_encode($where); } $this->db->query("ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS'"); $lista = $this->infoentregas0800_model->getAllEntregas() ->setWhere($where) ->paginateOracle($page,10,$order) ->go(); $rowcount = $this->infoentregas0800_model->getAllEntregas() ->setWhere($where) ->count() ->go(); $this->db->query("ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS'"); $this->dados['filtro'] = (!empty($get['filtro'])) ? $get['filtro'] : array(); $this->dados['titulo'] = 'Central de Entregas'; $this->dados['lista'] = $lista; $this->dados['total'] = $rowcount; $this->dados['filiais'] = $this->softran_oracle->empresas(); $this->dados['FILTRO_CENTRAL'] = $this->verifica_gatilho('FILTRO_CENTRAL'); //Metodo Utilizado para relizar a paginação $this->dados['paginacao'] = $this->configurePagination(10, $rowcount, "cce_entregas0800/infoEntregas0800") ; $this->render('infoEntregas0800'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function obtenerViajesplusAbonados();", "function enumerate(){\n $res=array();\n // lista de los macs del laboratorio\n for($i=134;$i<=148;$i++) array_push($res,sprintf(\"l%03d\",$i));\n $this->myLogger->trace(\"mac list: \".json_encode($res));\n return $res;\n }", ...
[ "0.6282678", "0.5924413", "0.5824439", "0.5788062", "0.5613868", "0.55007523", "0.54808223", "0.5459141", "0.5451651", "0.5419016", "0.5411023", "0.5407867", "0.5376258", "0.53749317", "0.536743", "0.53540385", "0.53480756", "0.53298396", "0.53290784", "0.53140175", "0.530911...
0.5310875
20
Insert a new recipe into database. Performs 3 insert operations on 'recipe', 'ingredients', and 'directions' tables.
public function createNewRecipe($data) { // Get id of new recipe $this->db->query('SELECT rid FROM recipes WHERE rid=(SELECT MAX(rid) FROM recipes)'); $this->db->execute(); $row = $this->db->single(); // Increment recipe id $newRecipeID = $row->rid + 1; // Upload image and return path $imgPath = $this->uploadImage($newRecipeID, $data['uid'], $data['img']); // Prepare sql query for new recipe entry $this->db->query('INSERT INTO recipes (rid,title,ownerid,description,prepTime,servingSize,imagePath,link) VALUES(:rid,:title,:uid,:description,:prepTime,:servingSize,:imagePath,:link);'); // Bind values for prepared statement $this->db->bind(':rid', $newRecipeID); $this->db->bind(':uid', $data['uid']); $this->db->bind(':title', $data['title']); $this->db->bind(':description', $data['description']); $this->db->bind(':prepTime', $data['prepTime']); $this->db->bind(':servingSize', $data['servingSize']); $this->db->bind(':imagePath', $imgPath); $this->db->bind(':link', $data['link']); // Execute query try { $this->db->execute(); } catch (PDOException $e) { echo '</br>FAILED recipe: ' . $e->getMessage() . '</br>'; return false; } // Insert ingredients $ingredQueryArray = $this->convertIngredientsFormat($newRecipeID, $data['ingredients']); $ingredQueryString = 'INSERT INTO ingredients (rid,ingredientid,value) VALUES ' . implode(", ", $ingredQueryArray) . ';'; // echo $ingredQueryString; $this->db->query($ingredQueryString); // Bind all values in ingredients query for($i = 0; $i < count($ingredQueryArray); $i++) { $this->db->bind(':value' . ($i + 1), $data['ingredients'][$i]); } // Execute query try { $this->db->execute(); } catch (PDOException $e) { echo '</br>FAILED ingredients: ' . $e->getMessage() . '</br>'; return false; } // Insert directions $direcQueryArray = $this->convertDirectionsFormat($newRecipeID, $data['directions']); $direcQueryString = 'INSERT INTO directions (rid,stepNum,description) VALUES ' . implode(", ", $direcQueryArray) . ';'; // echo $direcQueryString; $this->db->query($direcQueryString); // Bind all values in ingredients query for($i = 0; $i < count($direcQueryArray); $i++) { $this->db->bind(':value' . ($i + 1), $data['directions'][$i]); } // Execute query try { $this->db->execute(); } catch (PDOException $e) { echo '</br>FAILED directions: ' . $e->getMessage() . '</br>'; return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insert() {\n\t\tglobal $db_table_recipes, $DB_LINK, $g_rb_recipe_id_seq, $LangUI;\n\t\t// do the Insert\n\t\t$sql = \"INSERT INTO $db_table_recipes\n\t\t\t\t\t\t(recipe_name,\n\t\t\t\t\t\t recipe_ethnic,\n\t\t\t\t\t\t recipe_base,\n\t\t\t\t\t\t recipe_course,\n\t\t\t\t\t\t recipe_prep_time,\n\t\t\t\t\t\t ...
[ "0.7496522", "0.71235436", "0.709421", "0.66401243", "0.6377544", "0.6308364", "0.6137448", "0.6108412", "0.60540175", "0.6043427", "0.6037427", "0.5942745", "0.583216", "0.57809657", "0.5714664", "0.5703722", "0.5673432", "0.5673381", "0.56698585", "0.56688255", "0.56532764"...
0.6410849
4
Updates recipe specified by rid in parameters Performs 1 update for 'recipe' table, and 1 for each 'ingredients' and 1 for each 'directions'
public function updateRecipe($data) { // Prepare sql query for new recipe entry $this->db->query('UPDATE recipes SET title=:title, description=:description, prepTime=:prepTime, servingSize=:servingSize, link=:link WHERE rid=:rid;'); // Bind values for prepared statement $this->db->bind(':title', $data['title']); $this->db->bind(':description', $data['description']); $this->db->bind(':prepTime', $data['prepTime']); $this->db->bind(':servingSize', $data['servingSize']); $this->db->bind(':link', $data['link']); $this->db->bind(':rid', $data['rid']); // Execute query try { $this->db->execute(); } catch (PDOException $e) { echo '</br>FAILED recipe: ' . $e->getMessage() . '</br>'; return false; } // Update Ingredients table for($i = 0; $i < count($data['ingredients']); $i++) { $this->db->query('UPDATE ingredients SET value=:value WHERE rid=:rid AND ingredientid=:iid;'); $this->db->bind(':value', $data['ingredients'][$i]); $this->db->bind(':rid', $data['rid']); $this->db->bind(':iid', $i+1); $this->db->execute(); } // Update Directions table for($i = 0; $i < count($data['directions']); $i++) { $this->db->query('UPDATE directions SET description=:desc WHERE rid=:rid AND stepNum=:stepNum;'); $this->db->bind(':desc', $data['directions'][$i]); $this->db->bind(':rid', $data['rid']); $this->db->bind(':stepNum', $i+1); $this->db->execute(); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n\t\tglobal $DB_LINK, $db_table_recipes, $LangUI;\n\t\t$sql = \"\n\t\t\tUPDATE $db_table_recipes\n\t\t\tSET recipe_name='\".$DB_LINK->addq($this->name, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_ethnic='\".$DB_LINK->addq($this->ethnic, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_base=\".$DB_...
[ "0.69037193", "0.67274123", "0.6386638", "0.61902964", "0.6058181", "0.57459766", "0.57151175", "0.56524765", "0.5652353", "0.5621309", "0.5475809", "0.54728484", "0.5432611", "0.54289174", "0.54289174", "0.5392331", "0.53768164", "0.5358123", "0.5350924", "0.5293205", "0.527...
0.73330796
0
HELPER FUNCTION Convert ingredients array to sql value template. Each element follows format: '(rid, x, :valuex)' where x increments from 1 to number of ingredients To use in sql query: implode(", ", convertIngredientsFormat($rid, $data['ingredients']))
private function convertIngredientsFormat($rid, $ingredients) { $result = []; for($i = 1; $i < count($ingredients) + 1; $i++) { $result[$i - 1] = '(' . $rid . ', ' . $i . ', :value' . $i . ')'; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function prepareValuesRow(): string\n {\n $values = [];\n foreach ($this->storage as $key => $value) {\n $values[] = \"('{$key}', '{$value}')\";\n }\n\n return implode(', ', $values);\n }", "function convert_array($in_array, $start_pos)\n{\n\t$string1 = \"\";\...
[ "0.61420566", "0.557417", "0.5513314", "0.5507276", "0.55015767", "0.54453224", "0.5405676", "0.53422636", "0.5321844", "0.5292877", "0.52655715", "0.5256081", "0.5246699", "0.5239184", "0.52147526", "0.5180942", "0.515816", "0.5110368", "0.51079303", "0.50987566", "0.5090281...
0.7288106
0
HELPER FUNCTION Convert directions array to sql value template. Each element follows format: '(rid, x, :valuex)' where x increments from 1 to number of directions To use in sql query: implode(", ", convertDirectionsFormat($rid, $data['directions']))
private function convertDirectionsFormat($rid, $directions) { $result = []; for($i = 1; $i < count($directions) + 1; $i++) { $result[$i - 1] = '(' . $rid . ', ' . $i . ', :value' . $i . ')'; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_array($in_array, $start_pos)\n{\n\t$string1 = \"\";\n\t$string2 = \"\";\n\t$total = count($in_array);\n\twhile ($start_pos < $total)\n\t{\n\t\t$string1 = $string1 . \"`\" . $in_array[$start_pos] . \"`\";\n\t\t$start_pos++;\n\t\t$string2 = $string2 . \"\\\"\" . $in_array[$start_pos] . \"\\\"\";\n\t...
[ "0.57742035", "0.5723555", "0.54118776", "0.53859895", "0.53433186", "0.52005756", "0.5181006", "0.51499707", "0.51309294", "0.5080498", "0.5064301", "0.50194925", "0.5017345", "0.49897757", "0.49502593", "0.4927679", "0.49001387", "0.48884308", "0.48809934", "0.48740852", "0...
0.6723766
0
Retrieve recipe information from database. Recipe will return object containing: title description preparation time serving size image path for preview image list of ingredients list of directions
public function getRecipeData($rid) { // Query to select recipe $this->db->query('SELECT * FROM recipes WHERE rid=:rid'); $this->db->bind(':rid', $rid); $this->db->execute(); $recipeResult = $this->db->single(); // If recipe does not exist, return null if($recipeResult == null) { return null; } // Convert from object into array to append owner username, ingredients ,and directions $recipeResult = (array)$recipeResult; // Retrieve owner username and append to result $this->db->query('SELECT user_username FROM users WHERE user_id=:uid'); $this->db->bind(':uid', $recipeResult['ownerid']); $this->db->execute(); $result = $this->db->single(); $recipeResult['owner_username'] = $result->user_username; // Query to select recipe's ingredients list $this->db->query('SELECT ingredientid, value FROM ingredients WHERE rid=:rid'); $this->db->bind(':rid', $rid); $this->db->execute(); $ingredientsResult = $this->db->resultSet(true); $recipeResult['ingredients'] = $ingredientsResult; // Query to select recipe's directions list $this->db->query('SELECT stepNum, description FROM directions WHERE rid=:rid'); $this->db->bind(':rid', $rid); $this->db->execute(); $directionsResult = $this->db->resultSet(true); $recipeResult['directions'] = $directionsResult; return (object)$recipeResult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadRecipe() {\n\t\tglobal $DB_LINK, $db_table_recipes, $LangUI;\n\t\t$sql = \"SELECT * FROM $db_table_recipes WHERE recipe_id=\" . $DB_LINK->addq($this->id, get_magic_quotes_gpc());\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error loading the ingredi...
[ "0.72815096", "0.6678432", "0.6666", "0.6651838", "0.66270787", "0.65889823", "0.6573823", "0.64760685", "0.6463381", "0.6447894", "0.6447776", "0.6377795", "0.63392663", "0.6329324", "0.63073057", "0.62929434", "0.6263412", "0.62192386", "0.62191653", "0.6193134", "0.6167813...
0.6628436
4
Returns recipes title and description containing keywords specified by query string
public function searchRecipes($query) { $query = '%'.$query.'%'; $this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? OR description LIKE ? )'); $this->db->bind(1, $query); $this->db->bind(2, $query); return $this->db->resultSet(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchRecipesTitle($query) {\n $query = '%'.$query.'%';\n $this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? )');\n $this->db->bind(1, $query);\n return $this->db->resultSet();\n }", "public function index() {\n $count = Configure::read('number_of_s...
[ "0.6260258", "0.6142933", "0.59934634", "0.5904319", "0.5824127", "0.5709628", "0.570016", "0.56579196", "0.5611754", "0.5606446", "0.5584824", "0.5473852", "0.54737926", "0.54268765", "0.541755", "0.53800887", "0.53564155", "0.5346712", "0.53352284", "0.5276532", "0.5252896"...
0.67255175
0
Returns recipes title only for keywords specified by query string
public function searchRecipesTitle($query) { $query = '%'.$query.'%'; $this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? )'); $this->db->bind(1, $query); return $this->db->resultSet(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTitle()\n\t{\n\t\t\n\t\t$query = new Bin_Query();\t\n\t\t$title=$_GET['word'];\n\t\tif($title!='')\n\t\t{\n\t\t\t$sql= \"SELECT title FROM products_table WHERE title like '\".$title.\"%'\"; \n\t\t\t$query->executeQuery($sql);\n\t\t\t$arr=$query->records;\n\t\t\treturn Display_DManageProducts::getTitle(...
[ "0.6314272", "0.59863436", "0.59801906", "0.5965524", "0.5944365", "0.5808339", "0.57880396", "0.56803334", "0.5669686", "0.5658574", "0.56492674", "0.5633799", "0.5610529", "0.55742544", "0.5523392", "0.5523169", "0.551889", "0.5511958", "0.5508049", "0.54987174", "0.5490666...
0.67693764
0
Returns average of all comment ratings associated to rid
public function getAverageRating($rid){ $comments = $this->getAllComments($rid); $sum = 0; if(sizeof($comments)!=0){ foreach($comments as $comment){ $sum += $comment->rating; } return $sum/sizeof($comments); } else { return $sum; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAvgRating()\n {\n $sum =0;\n foreach($this->comments as $comment)\n {\n $sum = $sum + $comment->getRating() ;\n }\n\n if(count($this->comments)) return $sum/count($this->comments);\n\n return 0 ;\n }", "public function averageRating()\...
[ "0.7815952", "0.7160213", "0.69731236", "0.69356567", "0.66185904", "0.6595174", "0.64630806", "0.6456797", "0.64519626", "0.64074165", "0.6389168", "0.63694394", "0.6358621", "0.63110065", "0.62753147", "0.6258707", "0.61612374", "0.6128268", "0.6099714", "0.6086556", "0.602...
0.84239227
0
Adds new comment to comments table
public function addNewComment($data){ $this->db->query("INSERT INTO comments (comment_description, rating, recipe_id, ownerid) VALUES (:description, :rating, :recipeid, :ownerid)"); $this->db->bind(':description', $data['comment']); $this->db->bind(':rating', $data['rating']); $this->db->bind(':recipeid', $data['rid']); $this->db->bind(':ownerid',$_SESSION['user_id']); try { $this->db->execute(); } catch (PDOException $e) { return false; } // Return the comment added from the INSERT operation above //$this->db->query('SELECT * FROM comments WHERE comment_id = (SELECT MAX(comment_id) FROM comments)'); $this->db->query('SELECT comments.*, users.user_username FROM comments JOIN users ON ownerid=user_id WHERE comment_id = (SELECT MAX(comment_id) FROM comments)'); return $this->db->single(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add(Comment $comments)\n {\n $query = $this->db->pdo->prepare('INSERT INTO comments(idnews, idparent, niveau, moderate, content, membre, addDate) VALUES (:idnews, :idparent, :niveau, :moderate, :content, :membre, NOW())');\n $query->bindValue(':idnews', $comments->idnews(), PDO::PARAM_INT);\n ...
[ "0.7456319", "0.7214265", "0.7143306", "0.71370316", "0.70467794", "0.7045684", "0.703187", "0.6933686", "0.6918402", "0.6899217", "0.68898636", "0.68635625", "0.6773974", "0.674974", "0.67445016", "0.6737513", "0.6718045", "0.6711438", "0.670239", "0.6693142", "0.6682416", ...
0.6500398
34
Returns all comments on recipe given by recipe id, will also fetch username associated to ownerid
public function getAllComments($rid) { $this->db->query('SELECT comments.*, users.user_username FROM comments JOIN users ON ownerid=user_id WHERE recipe_id = :rid ORDER BY date DESC'); $this->db->bind(':rid', $rid); return $this->db->resultSet(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getComments()\n {\n $id = $this->getId();\n\n $stmt = \" SELECT c.*, c.id as id, u.username, u.profile_picture FROM _xyz_article_comment_pivot acp \" .\n \" LEFT JOIN _xyz_comment c ON c.id = acp.comment_id \" .\n \" LEFT JOIN _xyz_user u ON u.id = c.u...
[ "0.61224645", "0.6109855", "0.60941076", "0.60582006", "0.5990077", "0.5915567", "0.5905671", "0.5865427", "0.58383465", "0.58379555", "0.5833757", "0.58172387", "0.5810213", "0.57930654", "0.57820207", "0.578193", "0.57788545", "0.5764521", "0.57105434", "0.57089597", "0.569...
0.6960151
0
TODO: dont use hard coded value
public function getFeaturedRecipes(){ $this->db->query("SELECT * FROM recipes ORDER BY rid DESC LIMIT :num"); $this->db->bind(':num', 6); return $this->db->resultSet(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function value()\n {\n }", "protected function populate_value()\n {\n }", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "abstract protected function getValue();", "public function value(): string;", "funct...
[ "0.5884279", "0.58762115", "0.57337385", "0.57337385", "0.570794", "0.55773467", "0.5564824", "0.5542075", "0.5542075", "0.5537906", "0.54958075", "0.54958075", "0.54958075", "0.54745114", "0.54103136", "0.54103136", "0.5406263", "0.53803045", "0.53639454", "0.53389066", "0.5...
0.0
-1
Gets the form cells.
public function getCells() { return $this->cells ?: $this->cells = new \Doctrine\Common\Collections\ArrayCollection(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCells()\n {\n return $this->cells;\n }", "public function getCells();", "public function getCellValues()\n {\n return $this->get('CellValues');\n }", "public function getCell()\n {\n return $this->cell;\n }", "private function getFormTableContent(){...
[ "0.73605204", "0.67997134", "0.6504889", "0.64625525", "0.63929254", "0.63905674", "0.6065084", "0.58463144", "0.583741", "0.5826418", "0.57538855", "0.57538855", "0.5712586", "0.5657844", "0.56123054", "0.55994123", "0.5576755", "0.5530039", "0.5513866", "0.54798424", "0.547...
0.67475903
2
Display a listing of the resource.
public function index() { $calls = \App\Calls::paginate(3); return view(); }
{ "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.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
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(Call $call) { // }
{ "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(Call $call) { // }
{ "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.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Call $call) { // }
{ "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.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy(Call $call) { // }
{ "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
Run the database seeds.
public function run() { DB::table('tournaments')->insert([ [ 'title' => 'Felnőtt Országos Bajnokság', 'datefrom' => '20200201', 'dateto' => '20200202', 'venue_id' => 1, 'requested_umpires' => 13 ], [ 'title' => 'Budapest Bajnokság', 'datefrom' => '20200118', 'dateto' => '20200118', 'venue_id' => 2, 'requested_umpires' => 15 ], [ 'title' => '10th Multi Alarm Hungarian Junior Championships', 'datefrom' => '20200206', 'dateto' => '20200209', 'venue_id' => 1, 'requested_umpires' => 0 ], [ 'title' => 'Vízmű Kupa U11 U15 U19', 'datefrom' => '20190921', 'dateto' => '20190921', 'venue_id' => 1, 'requested_umpires' => 15 ], [ 'title' => 'Senior OB', 'datefrom' => '20181124', 'dateto' => '20181124', 'venue_id' => 3, 'requested_umpires' => 0 ], [ 'title' => 'Csapatbajnokság I. 2. forduló', 'datefrom' => '20190126', 'dateto' => '20190127', 'venue_id' => 1, 'requested_umpires' => 6 ] ]); }
{ "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.80130625", "0.79795986", "0.79764974", "0.79524934", "0.7950615", "0.79505694", "0.7944086", "0.7941758", "0.7938509", "0.79364634", "0.79335415", "0.7891555", "0.78802574", "0.78790486", "0.7878107", "0.7875447", "0.78703815", "0.7869534", "0.7851931", "0.7850407", "0.784...
0.0
-1
Run the database seeders.
public function run() { User::truncate(); Category::truncate(); Post::truncate(); $user = User::factory()->create(); $personal=Category::create([ 'name'=>'Personal', 'slug'=>'personal' ]); $family= Category::create([ 'name'=>'Family', 'slug'=>'family' ]); $work= Category::create([ 'name'=>'Work', 'slug'=>'work' ]); Post::create([ 'user_id'=>$user->id, 'category_id'=>$work->id, 'title'=>'My Work Post', 'slug'=>'my-first-post', 'excerpt'=>'Excerpt for my post', 'body'=>'Lorem ipsum amet nzn labas swx karolis kasperiunas inodsfnsdfisdnfisafnipsd' ]); Post::create([ 'user_id'=>$user->id, 'category_id'=>$personal->id, 'title'=>'My Personal Post', 'slug'=>'my-second-post', 'excerpt'=>'Excerpt for my post', 'body'=>'Lorem ipsum amet nzn labas swx karolis kasperiunas inodsfnsdfisdnfisafnipsd' ]); Post::create([ 'user_id'=>$user->id, 'category_id'=>$family->id, 'title'=>'My family Post', 'slug'=>'my-third-post', 'excerpt'=>'Excerpt for my post', 'body'=>'Lorem ipsum amet nzn labas swx karolis kasperiunas inodsfnsdfisdnfisafnipsd' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeed...
[ "0.8647181", "0.8537607", "0.84950906", "0.8493692", "0.8485473", "0.84805495", "0.84482235", "0.8440458", "0.8432637", "0.84251094", "0.842233", "0.8414579", "0.8410823", "0.84093714", "0.8395824", "0.8395099", "0.839497", "0.8393797", "0.83898157", "0.83884156", "0.83864564...
0.0
-1
Seed the application's database.
public function run() { // Ressalto que a ordem aqui importa muito, para não criar problema com as dependencias existentes. $this->call([ // Inserts das configurações do Sistema ConfiguracaoTableSeeder::class, // Insert das informações do usuário CategoriaTableSeeder::class, // Insert das informações do material cientifico ColecaoTableSeeder::class, PapelTableSeeder::class, ArquivoExtensaoTableSeeder::class, SituacaoTableSeeder::class, ]); if(!app()->environment('production')): // Caso esteja no ambiente de teste ou desenvolvimento.. $this->call([ // Insert das informações do usuário InformacaoPessoalTableSeeder::class, UsuarioTableSeeder::class, // Insert das informações do material cientifico CursoTableSeeder::class, DisciplinaTableSeeder::class, // Insert de palavras chaves TagsTableSeeder::class, ]); endif; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=...
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801",...
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "pu...
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315...
0.0
-1
Execute the console command.
public function handle() { // $obj = new ContractChecker(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() meth...
[ "0.6469971", "0.64641356", "0.6427384", "0.6349752", "0.63188183", "0.62750113", "0.6261585", "0.6261214", "0.6235854", "0.6225116", "0.6222161", "0.6214144", "0.6193531", "0.6191337", "0.6183868", "0.61772275", "0.61766857", "0.6172786", "0.6149171", "0.6148903", "0.61484134...
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.83988106", "0.8375419", "0.8375419", "0.83422995", "0.8251736", "0.82455397", "0.82108665", "0.8144899", "0.8109159", "0.8082", "0.7990051", "0.7987851", "0.798199", "0.7958163", "0.7949029", "0.7946942", "0.79250675", "0.7913215", "0.78981346", "0.78917295", "0.78889436",...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { $rules = [ 'name' => 'required', 'slug' => 'required|unique:coupons,slug,' . $this->coupon, 'startDate'=> 'required', 'endingDate'=> 'required', 'active'=> 'required', 'idBrand'=> 'required', ]; if($this->get('imgUrl')){ $rules = array_merge($rules,['imgUrl'=>'mimes:jpg,jpeg,png,gif']); } return $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
Display a listing of the resource.
public function index() { $committees = Committee::all(); return view('committees.index', compact('committees')); }
{ "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() { return view('committees.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.7594622", "0.7594622", "0.7588457", "0.7580005", "0.75723624", "0.7499764", "0.7436887", "0.74322647", "0.7387517", "0.735172", "0.73381543", "0.73117113", "0.72958225", "0.7280436", "0.7273787", "0.72433424", "0.7230227", "0.7225085", "0.71851814", "0.71781176", "0.717402...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // dd(request(['name'])); // Committee::create(request(['name'])); Committee::create([ 'name' => request('name'), 'show' => $request->has('show') ]); return redirect('/277640/committees'); }
{ "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.7285922", "0.714503", "0.71324795", "0.6639801", "0.6620405", "0.6568167", "0.65257645", "0.650948", "0.64484984", "0.6375281", "0.6373189", "0.63650924", "0.63650924", "0.63650924", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731",...
0.0
-1
Show the form for editing the specified resource.
public function edit(Committee $committee) { return view('committees.edit', compact('committee')); }
{ "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, Committee $committee) { $committee->name = request('name'); $committee->show = $request->has('show'); $committee->save(); return redirect('/277640/committees'); }
{ "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.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy(Committee $committee) { $committee->delete(); return redirect('/277640/committees'); }
{ "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.6671365", "0.6660839", "0.66361386", "0.6632988", "0.6624729", "0.6542195", "0.6541645", "0.6466739", "0.6288393", "0.61767083", "0.6129533", "0.608954", "0.6054169", "0.60443425", "0.60073143", "0.59338665", "0.59317696", "0.592145", "0.5920155", "0.59065086", "0.5897853"...
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('guest')->except('logout'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-...
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.687...
0.0
-1
Handle a login request to the application.
public function login(Request $request) { $request->validate([ 'email' => 'required|email', 'password' => 'required|string', 'group' => 'required|in:admin,user' ],[ 'group.in' => 'Please select admin or user.' ]); if(Auth::guard($request->group)->attempt(['email' => $request->email, 'password' => $request->password])) { return redirect()->intended(route('dashboard')); } Session::flash('error', 'Email or Password is incorrect.'); return redirect()->back()->withInput($request->except('password')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleLogin( ){\n\t\t// Filter allowed data\n\t\t$data = Request::only([ 'uid', 'password' ]);\n\n\t\t// Validate user input\n\t\t$validator = Validator::make(\n\t\t\t$data,\n\t\t\t[\n\t\t\t\t'uid' => 'required',\n\t\t\t\t'password' => 'required',\n\t\t\t]\n\t\t);\n\n\t\tforeach ($data as $key => $...
[ "0.7669814", "0.74851155", "0.7442612", "0.72329086", "0.7112905", "0.7103887", "0.70698494", "0.7055757", "0.7029516", "0.6985367", "0.6953118", "0.69134593", "0.6885101", "0.687445", "0.6863917", "0.6856037", "0.6848747", "0.684784", "0.68152297", "0.680864", "0.68045515", ...
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.789145...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { Session::flash('id', (int)$this->request->get('id')); Session::flash('activityType', 'public'); $event = new Event(); $event = $event->findOrFail($this->request->get('id')); return [ 'tickets' => 'required|numeric|in:'.implode(',', array_combine($event->publicTicketSelection(), $event->publicTicketSelection())), 'voorwaarden' => 'accepted', 'id' => 'required|integer', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.83426684", "0.8012867", "0.79357", "0.7925642", "0.7922824", "0.79036003", "0.785905", "0.77895427", "0.77832615", "0.7762324", "0.77367616", "0.7732319", "0.7709478", "0.7691477", "0.76847756", "0.7682022", "0.7682022", "0.7682022", "0.7682022", "0.7682022", "0.7682022", ...
0.0
-1
Check if customer is authorized to enter the checkout If customer is not identified > redirect to cart with notice
public function checkIsVerified(Varien_Event_Observer $observer) { if (!Mage::getModel('postident/config')->isEnabled()) { return; } /* @var $controller Mage_Checkout_CartController */ $controller = $observer->getControllerAction(); if (($controller->getRequest()->getControllerName() == 'onepage' && $controller->getRequest()->getActionName() != 'success') && false === Mage::getModel('postident/verification')->userIsVerified() ) { //Set quote to hasErrors -> this causes a redirect to cart in all cases $controller->getOnepage()->getQuote()->setHasError(true); //Add notice message, that the user has to be verified before he is allowed to enter the checkout Mage::getSingleton("core/session")->addNotice( Mage::helper("postident")->__("An identification by E-POSTIDENT is necessary to enter the checkout.") ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function forceCheckoutOnContribute(){\n\t\tif(!$this->canContribute()){\n\t\t\t$_SESSION['flashMessage'] = \"Sorry, you will need complete this purchase before you can send another gift.\";\n\t\t\tview::Redirect('cart', 'index');\n\t\t}\n\t}", "protected function customerValidate(){\n\t\tif($this->config-...
[ "0.7058747", "0.67745286", "0.6764376", "0.6703454", "0.6653177", "0.65376234", "0.6536304", "0.6477532", "0.64377725", "0.6389578", "0.63479745", "0.6326604", "0.6325176", "0.6321382", "0.6315917", "0.6299186", "0.629414", "0.6260947", "0.6248504", "0.6244631", "0.6244279", ...
0.0
-1
Add a layout handle on "checkout_cart_index"page IF veritifaction doesn't exist for the customer AND verification is required THEN add the layout handle
public function addLayoutHandle(Varien_Event_Observer $observer) { /* @var $update Mage_Core_Model_Layout_Update */ $update = $observer->getEvent()->getLayout()->getUpdate(); $userIsVerified = Mage::getModel("postident/verification")->userIsVerified(); //New handle for all store parts if (true === $this->getConfig()->isEnabled() && false === $userIsVerified) { $update->addHandle('postident_verification_required'); } //New handle for shoppinh_cart if (true === $this->getConfig()->isEnabled() && "checkout-cart-index" == $this->getHelper()->getPageCode() && false === $userIsVerified) { $update->addHandle('postident_checkout_cart_verification_required'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function layoutAction()\n {\n if (!$this->_isActive()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $this->loadLayout();\n $this->getResponse()->setBody(\n $this->getLayout...
[ "0.6442868", "0.63423246", "0.59605473", "0.5849184", "0.5824462", "0.5799398", "0.578177", "0.5749272", "0.5697371", "0.5694159", "0.56639576", "0.564474", "0.5641866", "0.563732", "0.5611357", "0.54907304", "0.5459894", "0.5454881", "0.54532266", "0.5445816", "0.535731", ...
0.6847302
0
Save ident data from quote to customer after placing an order
public function saveIdentDataForNewCustomer(Varien_Event_Observer $observer) { if (!Mage::getModel('postident/config')->isEnabled()) { return; } $quote = $observer->getEvent()->getOrder()->getQuote(); $customer = $observer->getEvent()->getOrder()->getCustomer(); $checkoutMethod = $quote->getCheckoutMethod(); if (!is_null($quote) && !is_null($quote->getPostidentVerificationData()) && $checkoutMethod != Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST ) { $customer = Mage::Helper('postident/data')->saveIdentDataToCustomer($customer, $quote); //This updates the customer object in the session - ensures that it has the postident data Mage::getSingleton('customer/session')->setCustomer($customer); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this-...
[ "0.6548253", "0.6534452", "0.625877", "0.6206583", "0.6163551", "0.6133944", "0.6111372", "0.6100383", "0.60627747", "0.60495", "0.60291576", "0.59329224", "0.5926883", "0.59221417", "0.59219086", "0.59196496", "0.59079766", "0.5906571", "0.5895255", "0.5869619", "0.58536214"...
0.6608938
0
add address template to billing step
public function appendAddressDataToBillingStep($observer) { if( false === Mage::getModel('postident/config')->isEnabled() || false === Mage::getModel('postident/config')->getAddressDataUsage()) { return; } if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Billing && false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Billing ) { $transport = $observer->getTransport(); $block = $observer->getBlock(); $layout = $block->getLayout(); $html = $transport->getHtml(); $addAddressTemplateHtml = $layout->createBlock( 'postident/checkout_onepage_billing', 'postident_onepage_billing') ->renderView(); $html = $html . $addAddressTemplateHtml; $transport->setHtml($html); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de en...
[ "0.68376", "0.6243044", "0.6204326", "0.6124597", "0.5990082", "0.5962371", "0.59493023", "0.5938982", "0.5904406", "0.58969545", "0.58705926", "0.5829504", "0.58080435", "0.5777113", "0.57673466", "0.57512295", "0.57440794", "0.57407075", "0.5728406", "0.57063544", "0.569872...
0.68225914
1
add address template to shipping step
public function appendAddressDataToShippingStep($observer) { if( false === Mage::getModel('postident/config')->isEnabled() || false === Mage::getModel('postident/config')->getAddressDataUsage()) { return; } if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Shipping && false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Shipping ) { $transport = $observer->getTransport(); $block = $observer->getBlock(); $layout = $block->getLayout(); $html = $transport->getHtml(); $addAddressTemplateHtml = $layout->createBlock( 'postident/checkout_onepage_shipping', 'postident_onepage_billing') ->renderView(); $html = $html . $addAddressTemplateHtml; $transport->setHtml($html); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function default_template_shipping ()\r\n{\r\n$template = '\r\n{shipping_content alias=$shipping_alias}\r\n';\r\nreturn $template;\r\n}", "public function appendAddressDataToBillingStep($observer)\n {\n if( false === Mage::getModel('postident/config')->isEnabled()\n || false === Mage::getMod...
[ "0.6982514", "0.65228075", "0.6460018", "0.6321133", "0.63001853", "0.62993824", "0.6196611", "0.6036511", "0.60358757", "0.60184723", "0.59829247", "0.5980058", "0.5934677", "0.58779925", "0.58539397", "0.5826276", "0.5822766", "0.58132094", "0.57802045", "0.5775925", "0.575...
0.7136997
0
Get Postident Config Model
public function getConfig() { return Mage::getModel("postident/config"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\n {\n return Config::class;\n }", "public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }", "private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }", "protected function ge...
[ "0.7315183", "0.719311", "0.7160724", "0.6961395", "0.68676054", "0.66918975", "0.653293", "0.6473519", "0.64597386", "0.64424676", "0.6372694", "0.63283515", "0.63244635", "0.63166165", "0.6305188", "0.6295142", "0.6263295", "0.62404084", "0.6227747", "0.62243545", "0.622355...
0.80496407
0
Gets the new flash keys array
protected function getNewFlashKeys(): array { return $this->get(self::NEW_FLASH_KEYS_KEY, []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getStaleFlashKeys(): array\n {\n return $this->get(self::STALE_FLASH_KEYS_KEY, []);\n }", "protected function getPreloadKeys() {\n\t\t$keys = array(\n\t\t\t'echo-notification-timestamp',\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notificati...
[ "0.7978015", "0.7138449", "0.67302215", "0.6721577", "0.6705986", "0.66578674", "0.66106", "0.6608496", "0.6587365", "0.6587365", "0.6587365", "0.65845835", "0.65845835", "0.65813076", "0.65813076", "0.65813076", "0.65813076", "0.65813076", "0.65813076", "0.65393656", "0.6509...
0.8839694
0
Gets the stale flash keys array
protected function getStaleFlashKeys(): array { return $this->get(self::STALE_FLASH_KEYS_KEY, []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getNewFlashKeys(): array\n {\n return $this->get(self::NEW_FLASH_KEYS_KEY, []);\n }", "protected function getPreloadKeys() {\n\t\t$keys = array(\n\t\t\t'echo-notification-timestamp',\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-t...
[ "0.84772134", "0.71192783", "0.67744887", "0.6449073", "0.6274906", "0.6257662", "0.62471503", "0.6222829", "0.6222128", "0.6212292", "0.62106645", "0.6185599", "0.6184555", "0.61776835", "0.6164328", "0.61579704", "0.6149772", "0.6080845", "0.6075199", "0.606832", "0.606832"...
0.91230685
0
Display a listing of the resource.
public function index() { $products = Product::orderBy('name','ASC')->get(); return view('superadmin.products.index', compact('products')); }
{ "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() { $categories = Category::orderBy('name','ASC')->pluck('name','id'); return view('superadmin.products.create', compact('categories')); }
{ "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.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { //dd($request->all()); $request->validate([ 'name'=>'required', 'category_id' => 'required', 'description'=>'required', 'quantity'=>'required', 'prize'=>'required', 'file' => 'image', //tiene que ser imagen ]); //$key = Helper::getToken(); PRUEBAS //dd($key); PRUEBAS $request['password'] = bcrypt($request->password); //Generar usuario $product = Product::create($request->all()); // Verificar imagen en el request if($request->file){ $name = Helper::saveImage($request->file, 'products', $product->id); $product->picture=$name; $product->save(); } return redirect('products'); }
{ "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($id) { // }
{ "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($id) { $product = Product::find($id); $categories = Category::orderBy('name','ASC')->pluck('name', 'id'); return view('superadmin.products.edit', compact('product', 'categories')); }
{ "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.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $product = Product::find($id); $request->validate([ 'name'=>'required', 'category_id' => 'required', 'description'=>'required', 'quantity'=>'required', 'prize'=>'required', 'file' => 'image', //tiene que ser imagen ]); $foto = $product->picture; if($request->file){ Helper::deleteImage($product->picture,'products'); $foto = Helper::saveImage($request->file, 'products', $product->id); } $request['picture']=$foto; $product->fill($request->all()); $product->save(); return redirect('products'); }
{ "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.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $product = Product::find($id); if($product){ Helper::deleteImage($product->picture,'products'); $product->delete(); } return redirect('products'); //redirigir a ruta users }
{ "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
Count all public calendars of other users.
public function countPublicCalendars(UserInterface $user) { $qb = $this->repository->createQueryBuilder('c'); $qb->select('COUNT(c.id)'); $qb->where('c.visible = :visible'); $qb->andwhere('c.createdBy != :user'); $qb->setParameter('visible', true); $qb->setParameter('user', $user); return $qb->getQuery()->getSingleScalarResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function count_user_events($user_id = NULL) {\r\n global $uid;\r\n if (is_null($user_id)) {\r\n $user_id = $uid;\r\n }\r\n return Database::get()->querySingle(\"SELECT COUNT(*) AS count FROM personal_calendar WHERE user_id = ?d\", $user_id)->count;\r\n }", ...
[ "0.6198609", "0.6029905", "0.5829278", "0.57265466", "0.5712421", "0.564941", "0.5628115", "0.5564134", "0.5560409", "0.5533492", "0.55293584", "0.55071753", "0.5494965", "0.5344268", "0.534248", "0.534248", "0.534248", "0.53321004", "0.53293794", "0.5319155", "0.53061175", ...
0.70849925
0
Find all calendars by given user.
public function findCalendarsByUser(UserInterface $user) { $qb = $this->repository->createQueryBuilder('c'); $qb->where('c.createdBy = :user'); $qb->setParameter('user', $user); return $qb->getQuery()->execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCalendars(User $user = null);", "public function getUserCalendar(User $user): array\n {\n $calendarsURL = $user->getCalendars();\n\n $calendars = [];\n foreach ($calendarsURL as $calendar) {\n array_push($calendars, $this->fetchEvents($calendar->getURL()));\n...
[ "0.8625929", "0.739091", "0.65626097", "0.6485882", "0.6477315", "0.6391695", "0.59377193", "0.5838466", "0.5786328", "0.5778732", "0.57739645", "0.5744249", "0.57347906", "0.572469", "0.5718613", "0.56601167", "0.55454266", "0.55454266", "0.54526913", "0.5445954", "0.5418455...
0.8041804
1
Find all public calendars by given term (name, description or creator of the calendar) of other users.
public function findPublicCalendarsByTerm($term, UserInterface $user) { $qb = $this->repository->createQueryBuilder('c'); $qb->select('c.id, c.name, u.username'); $qb->join('c.createdBy', 'u'); $qb->where('c.name LIKE :term'); $qb->orWhere('c.description LIKE :term'); $qb->orWhere('u.username LIKE :term'); $qb->andWhere('c.visible = :visible'); $qb->andwhere('c.createdBy != :user'); $qb->setMaxResults($this->autocompleteMaxResults); $qb->orderBy('c.name', 'ASC'); $qb->setParameter('term', '%' . $term . '%'); $qb->setParameter('visible', true); $qb->setParameter('user', $user); return $qb->getQuery()->getScalarResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCalendars(User $user = null);", "function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $cale...
[ "0.5598045", "0.5595388", "0.5437381", "0.5436465", "0.5308328", "0.52769184", "0.521769", "0.51238567", "0.4972738", "0.49298882", "0.49289572", "0.49045506", "0.48545828", "0.4790912", "0.4786395", "0.4769992", "0.47561833", "0.47351235", "0.46823883", "0.46598724", "0.4657...
0.74065596
0
show all the invalid properties with reasons.
public function listInvalidProperties() { $invalid_properties = []; return $invalid_properties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listInvalidProperties();", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n $allowed_values = [\"CREDIT_CARD\", \"CASH\", \"THIRD_PARTY_CARD\", \"NO_SALE\", \"SQUARE_WALLET\", \"SQUARE_GIFT_CARD\", \"UNKNOWN\", \"OTHER\"];\n if (!in_array($this->c...
[ "0.7885589", "0.7704446", "0.7691335", "0.76856136", "0.76856136", "0.76856136", "0.7683929", "0.76756734", "0.7666285", "0.7653707", "0.7653707", "0.76334393", "0.7632623", "0.7632623", "0.7632623", "0.7632623", "0.7632623", "0.7632623", "0.76262254", "0.7612341", "0.7578668...
0.75995564
38
validate all the properties in the model return true if all passed
public function valid() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate(){\n\t\t$valid = true;\n\t\t$ref = new ReflectionObject($this);\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\tif(isset($this->_atributosMetadata[$prop->getName()])){\n\t\t\t\t$propMetadata = $this->_atributosMetadata[$prop->getName()];\n\t\t\t\tif($propMetadata->needValidate){\n\t\t...
[ "0.77140415", "0.74920857", "0.7374397", "0.7260932", "0.7256496", "0.7250838", "0.7190354", "0.7176844", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", "0.7157431", ...
0.0
-1
Returns true if offset exists. False otherwise.
#[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function offsetExists($offset): bool\n {\n return false;\n }", "public function hasOffset(){\n return $this->_has(1);\n }", "public function offsetExists($offset): bool;", "public function offsetExists($offset) {\n\t\t$result = false;\n\t\t\n\t\tif($this->_data[$offset]) {\n\t\t\t...
[ "0.85544497", "0.8536287", "0.84871614", "0.83249027", "0.8321316", "0.8298716", "0.8213521", "0.81545013", "0.814174", "0.814174", "0.8133434", "0.81310785", "0.8129841", "0.81279516", "0.81168467", "0.811427", "0.8104857", "0.8101739", "0.80859023", "0.80859023", "0.8080957...
0.0
-1
Sets value based on offset.
#[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($offset, $value);", "public function set($offset, $value = null);", "function setOffset($value) {\n $this->offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $th...
[ "0.8670502", "0.84270954", "0.821386", "0.8191476", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "...
0.0
-1
Gets the string presentation of the object
public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Secuconnect\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); } return json_encode(\Secuconnect\Client\ObjectSerializer::sanitizeForSerialization($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\n\t\treturn $this->getPrint();\n\t}", "public function visualize()\n {\n \n return new StringWrapper('object('.$this->name(...
[ "0.78987753", "0.78987753", "0.78655267", "0.78240114", "0.7798868", "0.77837336", "0.77770287", "0.77690274", "0.77437395", "0.774057", "0.7733258", "0.7733258", "0.7733258", "0.7695146", "0.767794", "0.76635754", "0.76593804", "0.7630339", "0.76228136", "0.7610629", "0.7575...
0.0
-1
Implementation of hook_civicrm_managed Generate a list of entities to create/deactivate/delete when this module is installed, disabled, uninstalled.
function gittest_civicrm_managed(&$entities) { return _gittest_civix_civicrm_managed($entities); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pcptab_civicrm_managed(&$entities) {\n _pcptab_civix_civicrm_managed($entities);\n}", "function mysmsmantra_civicrm_managed(&$entities) {\n return _mysmsmantra_civix_civicrm_managed($entities);\n}", "function ccdev_hosting_list_entities() {\n module_load_include('inc','ccHosting','includes/entity_l...
[ "0.59725857", "0.592425", "0.5914847", "0.57337314", "0.5714875", "0.56585854", "0.5532775", "0.5532775", "0.5524083", "0.5507416", "0.5474976", "0.542899", "0.5421034", "0.5374375", "0.5350142", "0.5331395", "0.5294453", "0.52666855", "0.52545947", "0.5241904", "0.52297163",...
0.57218736
4
Parses a dscan to an array
function parseDscan($dscan) { $objects = array(); //Split into rows $rows = explode("\n", $dscan); //Iterate through our rows foreach($rows as $row) { //Check if it matches a dscan row format if(preg_match("/^([^\t]+)\t([^\t]+)\t([^\t]+)\t(([0-9,.]+) (km|m|AU)|-)/", $row, $matches) == 1) { $ob['type'] = $matches[3]; $ob['name'] = $matches[2]; //Parse distance if(count($matches) == 5) { //Unknown distance $ob['distance'] = -1; } else { //Known distance $ob['distance'] = distanceToMeters($matches[5], $matches[6]); } //Add to list $objects[] = $ob; } } return $objects; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function data2Array($data);", "public function getDataprotArray() {\n\t\t$arr = array();\n\t\t$ds = $this->getDataprotXML();\n\t\tif (strlen($ds) > 1) {\n\t\t\t$arr = GeneralUtility::xml2array($ds);\n\t\t}\n\n\t\treturn $arr;\n\t}", "function ussd_string_to_array($ussd_string){\n return expl...
[ "0.5584773", "0.54677004", "0.5435761", "0.5323445", "0.5300616", "0.5297419", "0.5217488", "0.52032334", "0.5166246", "0.5157352", "0.5154616", "0.51353115", "0.5130848", "0.51080436", "0.50948715", "0.50821775", "0.50821775", "0.5065223", "0.505185", "0.502081", "0.502081",...
0.7394252
0
Parses a dscan down for an ongrid control tower
function parseDscanTower($dscan) { //Parse mods file $csv = explode("\n", file_get_contents("posmods.csv")); foreach($csv as $mod) { $mod = str_getcsv($mod, ",", "\"", "\\"); $m['id'] = $mod[0]; $m['igbName'] = $mod[1]; $m['typeName'] = $mod[2]; $mods[$m['typeName']] = $m; } //Parse control towers file $csv = explode("\n", file_get_contents("controltowers.csv")); foreach($csv as $ct) { $ct = str_getcsv($ct, ",", "\"", "\\"); $m['id'] = $ct[0]; $m['igbName'] = $ct[1]; $m['typeName'] = $ct[2]; $cts[$m['typeName']] = $m; } //Parse the dscan $pos = array(); $ct = null; $rows = explode("\n", $dscan); foreach($rows as $row) { $cols = explode("\t", $row); //Check if it's on grid if(preg_match("/([0-9,]+) (km|m|AU)/", $cols[2], $matches) == 1) { //Check if this module exists in our pos mod db if(array_search($cols[1], array_keys($mods)) != false) { //Add it to our pos $pos[] = $mods[$cols[1]]; } else { //Check if it's a control tower if(array_search($cols[1], array_keys($cts)) != false) { //Check we don't already have one if($ct != null) { die("Error, more than 1 control tower on scan"); } $ct = $cts[$cols[1]]; } } } } //Check if empty if($ct === null) { return null; } //Generate URL $url = "http://eve.1019.net/pos/index.php?ct=%%CT%%&mod=%%MODS%%&off="; $modlist = ""; foreach($pos as $mod) { $modlist .= $mod['id']; } $url = str_replace("%%CT%%", $ct['id'], $url); $url = str_replace("%%MODS%%", $modlist, $url); return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDscan($dscan) {\n\t$objects = array();\n\t\n\t//Split into rows\n\t$rows = explode(\"\\n\", $dscan);\n\t\n\t//Iterate through our rows\n\tforeach($rows as $row) {\n\t\t//Check if it matches a dscan row format\n\t\tif(preg_match(\"/^([^\\t]+)\\t([^\\t]+)\\t([^\\t]+)\\t(([0-9,.]+) (km|m|AU)|-)/\", $row...
[ "0.5899118", "0.56649816", "0.4798595", "0.47244754", "0.46880904", "0.44520092", "0.44377184", "0.4396466", "0.4352825", "0.43178967", "0.4293009", "0.42834938", "0.42795387", "0.42675465", "0.42646158", "0.4247529", "0.42226622", "0.41896406", "0.41839698", "0.41805312", "0...
0.66016585
0
Parse control towers file
function getDscanTower($key) { /*$csv = explode("\n", file_get_contents("controltowers.csv")); foreach($csv as $ct) { $ct = str_getcsv($ct, ",", "\"", "\\"); $m['id'] = $ct[0]; $m['igbName'] = $ct[1]; $m['typeName'] = $ct[2]; $cts[$m['typeName']] = $m; }*/ //Connect MySQL /*include("config.php"); $db = new PDO('mysql:host='.$mysql_host.';dbname='.$mysql_db.';charset=utf8', $mysql_user, $mysql_pass); //Check if scan exists $st = $db->prepare("SELECT * FROM dscanScans WHERE `key`=:key LIMIT 1"); $st->bindValue(":key", $key, PDO::PARAM_STR); $st->execute(); $rows = $st->fetchAll(PDO::FETCH_ASSOC); if(count($rows) < 1) { //No scan found return null; } //Get objects for scan $id = $rows[0]['id']; $st = $db->prepare("SELECT type, distance FROM dscanObjects WHERE scan=:scan AND distance >= 0"); $st->bindValue(":scan", $id, PDO::PARAM_STR); $st->execute(); $rows = $st->fetchAll(PDO::FETCH_ASSOC); //Search objects for tower $found = false; foreach($rows as $row) { if(array_search($row['type'], array_keys($cts)) !== false) { $type = $row['type']; $found = true; } }*/ if(true) { $dscan = file_get_contents("scans/".$key); //echo $dscan; return parseDscanTower($dscan); } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n ...
[ "0.5554736", "0.550059", "0.54831874", "0.54143053", "0.534366", "0.5239043", "0.51407844", "0.5087883", "0.49911216", "0.49535635", "0.48925078", "0.48884395", "0.48884395", "0.48597676", "0.4855945", "0.48250288", "0.4797216", "0.47674128", "0.47535378", "0.47491783", "0.47...
0.0
-1
Run the database seeds.
public function run() { $t1 = Tema::create(['name' =>'Tema 1 : Ingles I M1', 'urlVideo' => 'https://www.youtube.com/embed/dFJvNYdKGrA', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Ingles I M1', 'urlVideo' => 'https://www.youtube.com/embed/dFJvNYdKGrA', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Ingles I M1', 'urlVideo' => 'https://www.youtube.com/embed/dFJvNYdKGrA', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(1); $t2->modules()->sync(1); $t3->modules()->sync(1); $t1 = Tema::create(['name' =>'Tema 1 : Ingles I M2', 'urlVideo' => 'https://www.youtube.com/embed/dFJvNYdKGrA', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Ingles I M2', 'urlVideo' => 'https://www.youtube.com/embed/dFJvNYdKGrA', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Ingles I M2', 'urlVideo' => 'https://www.youtube.com/embed/dFJvNYdKGrA', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(2); $t2->modules()->sync(2); $t3->modules()->sync(2); $t1 = Tema::create(['name' =>'Tema 1 : Ingles II M1', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Ingles II M1', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Ingles II M1', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(3); $t2->modules()->sync(3); $t3->modules()->sync(3); $t1 = Tema::create(['name' =>'Tema 1 : Ingles II M2', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Ingles II M2', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Ingles II M2', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de inglés, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(4); $t2->modules()->sync(4); $t3->modules()->sync(4); $t1 = Tema::create(['name' =>'Tema 1 : Japones I M1', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Japones I M1', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Japones I M1', 'urlVideo' => 'https://www.youtube.com/embed/ozpZ67NKgaI', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(5); $t2->modules()->sync(5); $t3->modules()->sync(5); $t1 = Tema::create(['name' =>'Tema 1 : Japones I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Japones I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Japones I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(6); $t2->modules()->sync(6); $t3->modules()->sync(6); $t1 = Tema::create(['name' =>'Tema 1 : Matematica I M1', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Matematica I M1', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Matematica I M1', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(7); $t2->modules()->sync(7); $t3->modules()->sync(7); $t1 = Tema::create(['name' =>'Tema 1 : Matematica I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Matematica I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Matematica I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(8); $t2->modules()->sync(8); $t3->modules()->sync(8); $t1 = Tema::create(['name' =>'Tema 1 : Bioquimica I M1', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Bioquimica I M1', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Bioquimica I M1', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(9); $t2->modules()->sync(9); $t3->modules()->sync(9); $t1 = Tema::create(['name' =>'Tema 1 : Bioquimica I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t2 = Tema::create(['name' =>'Tema 2 : Bioquimica I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t3 = Tema::create(['name' =>'Tema 3 : Bioquimica I M2', 'urlVideo' => 'https://www.youtube.com/embed/lE2OBs1Njak', 'urlMaterial' => 'https://www.curso-ingles.com/aprender/cursos/nivel-basico', 'texto'=>'El curso básico de Japones, está diseñado para los que están empezando. Al finalizar el curso, el estudiante tendrá una comprensión de los conceptos básicos de inglés y será capaz de formar construcciones y oraciones simples.',]); $t1->modules()->sync(10); $t2->modules()->sync(10); $t3->modules()->sync(10); }
{ "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.80130625", "0.79795986", "0.79764974", "0.79524934", "0.7950615", "0.79505694", "0.7944086", "0.7941758", "0.7938509", "0.79364634", "0.79335415", "0.7891555", "0.78802574", "0.78790486", "0.7878107", "0.7875447", "0.78703815", "0.7869534", "0.7851931", "0.7850407", "0.784...
0.0
-1
Denormalizes data back into an object of the given class.
public function denormalize($data, $class, $format = null, array $context = []) { $object = $this->extractObjectToPopulate($class, $context) ?? new $class(); isset($data['name']) && $object->setName($data['name']); isset($data['description']) && $object->setDescription($data['description']); isset($data['domain']) && $object->setDomain($this->serializer->denormalize($data['domain'], SettingDomain::class, $format, $context)); isset($data['type']) && $object->setType(new Type($data['type'])); isset($data['type_options']) && $object->setTypeOptions($data['type_options']); isset($data['data']) && $object->setDataValue($data['data']); isset($data['tags']) && $object->setTags(new ArrayCollection($this->serializer->denormalize($data['tags'], SettingTag::class . '[]', $format, $context))); isset($data['choices']) && $object->setChoices($data['choices']); return $object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function denormalize($data, $class)\n\t{\n\t\treturn $this->getSerializer()->deserialize(json_encode($data), $class, 'json', $this->applyOptionsToContext(DeserializationContext::create()));\n\t}", "public function denormalize($data, $class, $format = null, array $context = [])\n {\n $reflection ...
[ "0.78027046", "0.7109431", "0.6773258", "0.6768001", "0.65877765", "0.63577896", "0.63288087", "0.61879504", "0.60974884", "0.59490573", "0.59060067", "0.57958007", "0.57668996", "0.5762159", "0.56473464", "0.55819595", "0.55783325", "0.55634385", "0.5514949", "0.5510035", "0...
0.6621054
4
Checks whether the given class is supported for denormalization by this normalizer.
public function supportsDenormalization($data, $type, $format = null) { return is_a($type, Setting::class, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function supports(string $class): bool;", "public function supportsClass($class)\n {\n return $class === 'Surfnet\\StepupMiddlewareClientBundle\\Identity\\Dto\\Identity';\n }", "public function supportsClass($class);", "public function supportsClass($class);", "public function supportsC...
[ "0.7067725", "0.68391454", "0.68352085", "0.68352085", "0.6832485", "0.68100876", "0.6792144", "0.6693328", "0.66887367", "0.6631851", "0.6619835", "0.6601852", "0.6514628", "0.6509171", "0.6471762", "0.6373527", "0.6365476", "0.634649", "0.62963945", "0.6233509", "0.6224172"...
0.54335725
70
Normalizes an object into a set of arrays/scalars.
public function normalize($object, $format = null, array $context = []) { return [ 'name' => $object->getName(), 'description' => $object->getDescription(), 'domain' => $this->serializer->normalize($object->getDomain(), $format, $context), 'type' => $object->getType()->getValue(), 'type_options' => $object->getTypeOptions(), 'data' => $object->getDataValue(), 'tags' => $this->serializer->normalize($object->getTags(), $format, $context), 'choices' => $object->getChoices(), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function normalizeData() : array;", "function object_to_array( $input ) {\n\tif ( is_scalar( $input ) ) {\n\t\treturn $input;\n\t}\n\t\n\treturn array_map( '\\your\\space\\object_to_array', (array) $input );\n}", "public function denormalize(array $data);", "public function objectToArray($object): sta...
[ "0.62830913", "0.5868058", "0.5777879", "0.5758749", "0.57163686", "0.5625029", "0.55953956", "0.55424833", "0.5529402", "0.5496353", "0.5470797", "0.546581", "0.5438795", "0.54367733", "0.5376255", "0.5370162", "0.5361158", "0.52978617", "0.5268635", "0.52582085", "0.5258208...
0.0
-1
Checks whether the given class is supported for normalization by this normalizer.
public function supportsNormalization($data, $format = null) { return $data instanceof Setting; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function supports(string $class): bool;", "public function supportsClass($class);", "public function supportsClass($class);", "public function supportsClass($class)\n {\n // TODO: Implement supportsClass() method.\n }", "public function supportsClass($class)\n {\n }", "public fu...
[ "0.7399976", "0.7162615", "0.7162615", "0.7065001", "0.705774", "0.70563465", "0.6999987", "0.69749", "0.69674444", "0.6914851", "0.6875374", "0.6862838", "0.6839856", "0.6740214", "0.6719258", "0.6713057", "0.670182", "0.66661537", "0.6634156", "0.6628556", "0.66116285", "...
0.5641343
63
This function create an object Database, store it in the variable db and return it.
static function getDatabase() { if (!self::$db) { self::$db = new Database(); } return self::$db; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function get_db_object()\n {\n return new Database(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n }", "public static function obtenerint(){\n if (self::$db === null){\n \tself::$db = new self();\n }\n return self::$db;\n }", "protected function create()\n {\n $datab...
[ "0.7501272", "0.74878854", "0.7277767", "0.72441274", "0.7083806", "0.6998411", "0.6989336", "0.6962153", "0.6916926", "0.69042194", "0.6877892", "0.68155783", "0.6784196", "0.6740734", "0.67010605", "0.6693122", "0.6683982", "0.6660153", "0.6643156", "0.66347504", "0.6608420...
0.6967801
7
This function create and returns an object Auth using an object Session, including an array of restriction messages.
static function getAuth() { return new Auth(Session::getInstance(), ["restriction_msg" => "Vous n'avez pas le droit d'accéder à cette page.", "restriction_msg_assembly" => "Vous n'avez pas le droit d'accéder à cette page si vous n'êtes pas connecté."]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _createSession(){\n return $this->_session = new Session();\n }", "function auth_create($id, $data = null)\n {\n $lc_auth = auth_prerequisite();\n $auth = auth_get();\n\n if (!$auth) {\n $session = is_object($data) ? $data : auth_getUserInfo($id);\n ...
[ "0.62225264", "0.60264546", "0.5920102", "0.5856709", "0.5848983", "0.5824285", "0.5777055", "0.5714125", "0.56747884", "0.5668715", "0.56096697", "0.55935544", "0.55799484", "0.55781305", "0.5537685", "0.54991573", "0.5482576", "0.54744196", "0.5450374", "0.54438305", "0.544...
0.6871365
0
This function redirect the user to the page indicated by the variable file.
static function redirect($file) { header("location: $file"); exit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Redirect($file)\n{\n\techo '<script>';\n\techo 'location.href=\"'.$file.'\"';\n\techo '</script>';\n\texit();\n}", "function redirect($file) {\n $host = $_SERVER['HTTP_HOST'];\n $path = rtrim(dirname($_SERVER[\"PHP_SELF\"]), \"/\\\\\");\n header(\"Location: http://$host$path/$fil...
[ "0.69143265", "0.6794202", "0.6668645", "0.6615202", "0.6575547", "0.6524543", "0.64391494", "0.634676", "0.62784934", "0.62628347", "0.6244644", "0.6232029", "0.62046224", "0.617032", "0.6133014", "0.61052847", "0.610047", "0.6097736", "0.6088323", "0.6081365", "0.60718685",...
0.7128829
0
Returns the string with the given prefix removed, or the string itself if it doesn't start with the prefix.
function strip_prefix(string $string, string $prefix): string { if ('' === $prefix || !starts_with($string, $prefix)) { return $string; } /** @psalm-suppress MissingThrowsDocblock - $offset is within-bounds. */ return slice($string, length($prefix)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function strip_prefix(string $string, string $prefix, Encoding $encoding = Encoding::UTF_8): string\n{\n if ($prefix === $string) {\n return '';\n }\n\n if ('' === $prefix || '' === $string || !starts_with($string, $prefix, $encoding)) {\n return $string;\n }\n\n return slice($string, ...
[ "0.8110948", "0.8102732", "0.80515015", "0.796179", "0.7772836", "0.7643129", "0.70024735", "0.6863972", "0.6680536", "0.6601046", "0.65736556", "0.6561675", "0.65184146", "0.6487255", "0.6484459", "0.64826554", "0.6442965", "0.6424962", "0.63787746", "0.6302032", "0.6215819"...
0.81293166
0
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "pu...
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315...
0.0
-1
Execute the console command.
public function handle() { $test = $this->argument('test'); $dir = config('speed-test.dir'); $className = ucfirst(\Str::camel($test)); $namespace = config('speed-test.namespace'); $class = class_entity($className) ->namespace($namespace); $class->method('speed1') ->line($this->option('line'))->doc(function ($doc) use ($className) { /** @var DocumentorEntity $doc */ $doc->tagCustom('times', $this->option('times')); $doc->description($this->option('description') ?: "{$className} Speed 1"); }); if (! is_dir($dir)) { mkdir($dir, 0777, 1); } file_put_contents( $dir.'/'.$className.'.php', $class->wrap('php') ); $this->info('Speed created!'); return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() meth...
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.614841...
0.5955025
93
Displays a particular model.
public function actionView($id) { $this->render('view',array( 'model'=>$this->loadModel($id), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n...
[ "0.75535107", "0.7553186", "0.7542682", "0.7540008", "0.74330246", "0.74330246", "0.74330246", "0.74330246", "0.74330246", "0.73394006", "0.7160726", "0.71322334", "0.70615447", "0.7022298", "0.6983485", "0.69753826", "0.6958109", "0.6945592", "0.69437367", "0.69437367", "0.6...
0.712746
12
Creates a new model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model=new MenuItems; $menu=Menu::model()->findAllByAttributes(array('deleted'=>0,'is_available'=>1)); if(isset($_POST['MenuItems'])) { $model->attributes=$_POST['MenuItems']; if($model->save()) $this->redirect(array('update','id'=>$model->id)); } $this->render('create',compact('model','menu')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['cre...
[ "0.7960614", "0.789972", "0.7867814", "0.75926656", "0.7531548", "0.7484925", "0.7460855", "0.7460855", "0.7460855", "0.7460855", "0.74484086", "0.7440914", "0.7438662", "0.7430432", "0.74090374", "0.74079895", "0.7384322", "0.7376383", "0.73324466", "0.73323387", "0.7304489"...
0.0
-1
Updates a particular model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model=$this->loadModel($id,array('itemSizes','itemAddOns')); $menu=Menu::model()->findAllByAttributes(array('deleted'=>0,'is_available'=>1)); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if(isset($_POST['MenuItems'])) { $model->attributes=$_POST['MenuItems']; if($model->save()) $this->redirect(array('update','id'=>$model->id)); } $this->render('update',compact('model','menu')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Y...
[ "0.7904043", "0.7712556", "0.76952547", "0.76012313", "0.7600377", "0.74885774", "0.7481266", "0.7476374", "0.7468706", "0.74600095", "0.7458755", "0.74575424", "0.74575424", "0.74572265", "0.7452297", "0.74470776", "0.74453735", "0.74400187", "0.7429605", "0.7417643", "0.741...
0.0
-1
Returns the data model based on the primary key given in the GET variable. If the data model is not found, an HTTP exception will be raised.
public function loadModel($id,$rel=null){ if($rel) $model=MenuItems::model()->with($rel)->findByPk($id); else $model=MenuItems::model()->findByPk($id); if($model===null) throw new CHttpException(404,'The requested page does not exist.'); return $model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Residencebaseinfo::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model...
[ "0.6996477", "0.6963233", "0.6856193", "0.6704138", "0.6648857", "0.6641502", "0.6635867", "0.6626205", "0.6623007", "0.66175824", "0.66135395", "0.6612504", "0.6558181", "0.65574646", "0.6542536", "0.6541095", "0.6534296", "0.65331244", "0.6527437", "0.65267116", "0.6522443"...
0.0
-1
Performs the AJAX validation.
protected function performAjaxValidation($model) { if(isset($_POST['ajax']) && $_POST['ajax']==='menu-items-form') { echo CActiveForm::validate($model); Yii::app()->end(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ajaxValidationAction()\n {\n if($this->_request->getPost('ajax_submit',false, Request::FILTER_INT))\n $result = 'ok_ajax';\n else\n $result = 'ok';\n $messages = array();\n\n if(!$this->validate())\n {\n $this->collectValidateE...
[ "0.79766375", "0.7535804", "0.6860131", "0.6860131", "0.6833871", "0.6784885", "0.6775202", "0.67711323", "0.6764112", "0.6737663", "0.67355454", "0.6724824", "0.67199975", "0.6704958", "0.66932213", "0.6688998", "0.66856104", "0.6685253", "0.6685253", "0.6685253", "0.6684122...
0.0
-1
Returns true if and only if $value meets the validation requirements If $value fails validation, then this method returns false, and getMessages() will return an array of messages that explain why the validation failed.
public function isValid($value, $context = null) { $value = (string)$value; if(is_array($context)) { if(isset($context['password']) && $value == $context['password'] ){ return true; } }elseif(is_string($context) && $value == $context ){ return true; }else{ $this->_error(self::NOT_MATCH); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate($value)\n {\n if ($this->isOptional && is_null($value)) {\n return true;\n }\n\n if ($this->isArray) {\n return $this->validateArray($value);\n }\n\n if ($this->isFixedValues) {\n return $this->validateFixedValues($valu...
[ "0.75638735", "0.75633675", "0.7457137", "0.74505544", "0.74313146", "0.74132544", "0.7389179", "0.7376113", "0.73435354", "0.73382664", "0.7312271", "0.73101336", "0.73035663", "0.72895116", "0.72773695", "0.72668856", "0.7132854", "0.7115612", "0.71117413", "0.70788276", "0...
0.0
-1
Display a listing of the resource.
public function index() { $clients = Client::orderBy('ref', 'asc')->with('family')->get(); $active = 'list'; $i = 1 ; return view('clients.index', compact('active', 'i', 'clients')); }
{ "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() { $active = 'list'; $families = Family::orderBy('family', 'asc')->lists('family', 'id'); $families[0] = ' - '; return view('clients.create', compact('active', 'families')); }
{ "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.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(ClientsRequest $request) { $this->validate($request, ['ref' => 'required|alpha_num|unique:clients,ref']); Client::create($request->all()); return redirect(route('clients.index'))->with('success', 'Le nouveau client a bien été créé'); }
{ "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
Show the form for editing the specified resource.
public function edit($id) { $client = Client::findOrFail($id); $active = 'list'; $forme = ['0' => 'Aucun', '1' => 'S.A.', '2' => 'S.P.R.L.', '3' => 'S.P.R.L.U.', '4' => 'S.C.', '5' => 'S.C.R.L.', '6' => 'Indépendant', '7' => 'Commerce', '8' => 'Cabinet', '9' => 'Administration', '10' => 'A.S.B.L.', '11' => 'Etude', '12' => 'Autre']; $families = Family::orderBy('family', 'asc')->lists('family', 'id'); $families[0] = ' - '; $modes = Mode::orderBy('mode', 'asc')->lists('mode', 'id'); $remises = Discount::orderBy('code', 'asc')->lists('code', 'id'); $remises[0] = ' - '; $deliveries = Client::find($id)->delivery()->get(); $contacts = Client::find($id)->contact()->get(); return view('clients.edit', compact('active', 'client', 'families', 'modes', 'forme', 'remises', 'deliveries', 'contacts')); }
{ "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.7855416", "0.769519", "0.72748375", "0.724256", "0.7173659", "0.7064689", "0.70549816", "0.6985127", "0.6949479", "0.69474626", "0.694228", "0.6929372", "0.6903047", "0.6899655", "0.6899655", "0.688039", "0.68649715", "0.68618995", "0.68586665", "0.68477386", "0.68366665",...
0.0
-1
Update the specified resource in storage.
public function update($id, ClientsRequest $request) { $client = Client::findOrFail($id); $client->update($request->all()); return redirect(route('clients.edit', $id))->with('success', 'Le client a bien été mis à jour'); }
{ "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.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $client = Client::findOrFail($id); $client->delete(); return redirect(route('clients.index'))->with('success', 'Le client a bien été supprimé'); }
{ "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