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
Takes uploaded file, stores it in the local storage and saves image in the database
public function storeForProjectFeatured(UploadedFile $file, Project $project){ //TODO write image to the local storage }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n ...
[ "0.72086495", "0.7145394", "0.7100422", "0.7038655", "0.7014189", "0.7011132", "0.6907209", "0.6880561", "0.6874778", "0.68504906", "0.6828092", "0.6810487", "0.6793921", "0.6754874", "0.6753324", "0.674023", "0.6738595", "0.6737032", "0.67244184", "0.6704676", "0.67007524", ...
0.6481675
50
Takes uploaded file, stores it in the local storage and saves image in the database
public function storeForProjectGallery(UploadedFile $file, Project $project){ //TODO write image to the local storage }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n ...
[ "0.7209419", "0.71458685", "0.71009463", "0.7038677", "0.7014978", "0.7011861", "0.6907889", "0.68815935", "0.687421", "0.6851589", "0.6828855", "0.68120307", "0.67946845", "0.67556983", "0.67533976", "0.6738893", "0.6737136", "0.6736024", "0.6725347", "0.67041004", "0.669953...
0.6515271
45
Takes uploaded file, stores it in the local storage and saves image in the database
public function storeForArticleFeatured(UploadedFile $file, Article $project){ //TODO write image to the local storage }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n ...
[ "0.7209419", "0.71458685", "0.71009463", "0.7038677", "0.7014978", "0.7011861", "0.6907889", "0.68815935", "0.687421", "0.6851589", "0.6828855", "0.68120307", "0.67946845", "0.67556983", "0.67533976", "0.6738893", "0.6737136", "0.6736024", "0.6725347", "0.67041004", "0.669953...
0.65134645
46
Takes uploaded file, stores it in the local storage and saves image in the database
public function storeForArticleGallery(UploadedFile $file, Article $project){ //TODO write image to the local storage }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n ...
[ "0.7209419", "0.71458685", "0.71009463", "0.7038677", "0.7014978", "0.7011861", "0.6907889", "0.68815935", "0.687421", "0.6851589", "0.6828855", "0.68120307", "0.67946845", "0.67556983", "0.67533976", "0.6738893", "0.6737136", "0.6736024", "0.6725347", "0.67041004", "0.669953...
0.6681011
23
This function prevents changing url(..) in javascript code when needed only style
function style_fixing( $match ) { $match[0] = preg_replace_callback('/url\s*\(\s*[\'\"]?(.*?)\s*[\'\"]?\s*\)/is', "style_url_replace", $match[0]); //echo "<pre>".htmlspecialchars($match[0])."</pre>"; return $match[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function protectUrls($str)\n\t{\n\t\tif (preg_match('/^javascript:/',$str)) {\n\t\t\t$str = '#';\n\t\t}\n\t\t\n\t\treturn $str;\n\t}", "public function testUrlError() {\n\t\t$this->Helper->url('nope.js');\n\t}", "public static function use_inline_scripts(){\n return false;\n }", "protected function...
[ "0.63387126", "0.60532975", "0.6023497", "0.59995914", "0.5997442", "0.5997442", "0.5928279", "0.58211726", "0.5800948", "0.5787096", "0.56954926", "0.56805325", "0.5630431", "0.56211627", "0.560884", "0.5606221", "0.5603448", "0.55924416", "0.558454", "0.55580866", "0.555736...
0.0
-1
Download images and replaces urls in the styles
function style_url_replace( $match ) { global $snoopy, $download_path, $downloaded_files; $relative = $match[1]; $image = convertLink( $match[1] ); if ( in_array( $image, array_keys( $downloaded_files ) ) ) { $filename = $downloaded_files[$image]; } else { $ext = end( explode( '.', $image ) ); $name = time(); $snoopy->fetch( $image ); $filename = $download_path.$name.'.'.$ext; $downloaded_files[$image] = $filename; // can we handle fwrite/fopen failures in a better way? $fp = @fopen( $filename, 'wb' ); @fwrite( $fp, $snoopy->results, strlen( $snoopy->results ) ); @fclose( $fp ); } return 'url('.$filename.')'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getImageIntoCss(): void\n {\n preg_match_all(self::REGEX_IMAGE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $sImgPath = PH7_PATH_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n ...
[ "0.688141", "0.6373753", "0.6367579", "0.6001647", "0.5999664", "0.58871716", "0.5839635", "0.5802336", "0.57954395", "0.5688069", "0.5661476", "0.56460226", "0.56087995", "0.5605742", "0.5588823", "0.5578539", "0.556012", "0.5555235", "0.5543404", "0.5517085", "0.5490574", ...
0.71879554
0
Replaces to .. for proper image displaying in styles with url(..) entries
function file_replace( $match ) { global $snoopy; // Href was already converted to the proper server path preg_match( '/href\s*=\s*[\'\"]?(.*?)[\'\" >]/', $match[0], $m ); $href = $m[1]; $snoopy->fetch( $href ); return "<style>\r\n".$snoopy->results."</style>\r\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cdn_html_alter_image_urls(&$html) {\n $url_prefix_regex = _cdn_generate_url_prefix_regex();\n $pattern = \"#((<img\\s+|<img\\s+[^>]*\\s+)src\\s*=\\s*[\\\"|\\'])($url_prefix_regex)([^\\\"|^\\']*)([\\\"|\\'])#i\";\n _cdn_html_alter_file_url($html, $pattern, 0, 4, 5, 1, '');\n}", "function style_url_rep...
[ "0.70660114", "0.67237526", "0.633239", "0.62120533", "0.620795", "0.6184678", "0.6155846", "0.61554873", "0.61501056", "0.60122395", "0.59984547", "0.5979588", "0.59424806", "0.59373003", "0.5912624", "0.5900233", "0.58965355", "0.5874314", "0.5853209", "0.581737", "0.577931...
0.551455
49
/ Cuando tenemos que escribir un archivo ".json" tenemos que ver si hay algo previamente guardado
public function Escribir($filePath, $personaRecibida) { // -> primero lo tenemos que leer try { if (!(isset($filePath))) { throw new Exception('No se recibió path al archivo'); echo "entro"; } else if (!(file_exists($filePath))) { throw new Exception('El directorio no existe'); } else { $this->filePath = $filePath; } // Leo el archivo $this->filePointer = fopen($this->filePath, 'r'); if (filesize($this->filePath) < 1){ $this->fileSize = 5; } else{ $this->fileSize = filesize($this->filePath); } $this->fileJson = fread($this->filePointer, $this->fileSize); $this->fileArrayPersonas = json_decode($this->fileJson) ?? array(); fclose($this->filePointer); //Modifico el array array_push($this->fileArrayPersonas,$personaRecibida); // //Escribo el archivo $this->filePointer = fopen($this->filePath, 'w'); $this->fileCaracteresEscritos = fwrite($this->filePointer, json_encode($this->fileArrayPersonas)); fclose($this->filePointer); return $this->fileCaracteresEscritos; } catch (Exception $e) { return $e->getMessage() . "<br>"; } /* * -> segundo decodificar ese .json para convertirlo * a un array de objetos * * -> tercero cerramos el archivo * * -> cuarto hacemos llamamos a la funcion * array_push($array que leimos, $personas que nos mandaron lo pisamos) */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsonSave()\n {\n try {\n file_put_contents($this->fname, json_encode($this->content));\n } catch (Exception $e) {\n echo $e;\n }\n }", "private function saveFileJson()\n {\n return file_put_contents($this->arquivoJson, json_encode($this->registr...
[ "0.6900428", "0.6645642", "0.6520189", "0.64793134", "0.6461871", "0.6404238", "0.6366969", "0.6334944", "0.62915474", "0.61543465", "0.61538404", "0.60653615", "0.60614556", "0.6043547", "0.6038293", "0.60351855", "0.60111743", "0.6003071", "0.599178", "0.59420764", "0.59314...
0.0
-1
Send request to Adaptive, return the response
public static function send($xmlRequest) { $headers = array( "Content-type: application/xml", "Content-length: " . strlen($xmlRequest), "Connection: close", ); try { // INITIATE CURL $curl = curl_init(); $curlOptions = array( CURLOPT_URL => self::URL, CURLOPT_HEADER => false, CURLOPT_HTTPHEADER => $headers, CURLINFO_HEADER_OUT => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, //Seconds until timeout CURLOPT_TIMEOUT => 300, // set to POST CURLOPT_POST => true, //handle SSL cert CURLOPT_SSL_VERIFYPEER => false, // BUILD THE POST BODY CURLOPT_POSTFIELDS => $xmlRequest, // set to verbose (or not) CURLOPT_VERBOSE => true ); curl_setopt_array($curl, $curlOptions); $response = curl_exec($curl); if ($response == false) { throw new Exception(curl_error($curl), curl_errno($curl)); } curl_close($curl); } catch (Exception $e){ trigger_error( sprintf( 'Curl failed with error #%d: %s', $e->getCode(), $e->getMessage() ), E_USER_ERROR ); } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendResponse();", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactor...
[ "0.6639466", "0.65109116", "0.64634997", "0.6449978", "0.6418398", "0.6411755", "0.62883925", "0.625833", "0.6252432", "0.6222598", "0.6220256", "0.6189197", "0.61398774", "0.61340976", "0.6132704", "0.6104922", "0.610356", "0.6037429", "0.6028826", "0.6021623", "0.60145676",...
0.0
-1
parse a potentially nested array
private static function parseVersions($arr) { $return = false; if (count($arr) > 0) { if (array_key_exists('version', $arr)) { if (is_object($arr['version'])) { $version = $arr['version']; $attr = $version->attributes(); switch ($attr['type']) { case 'VERSION_FOLDER': $return = array_merge( $return, (array)self::parseVersions((array)$version) ); break; case 'ACTUALS': continue; case 'PLANNING': $return[] = array( 'name' => (string)$attr['name'], 'type' => (string)$attr['type'], 'default' => (string)$attr['isDefaultVersion'] ); break; } } else { $return = array(); $versions = $arr['version']; foreach ($versions as $version) { $attr = $version->attributes(); switch ($attr['type']) { case 'VERSION_FOLDER': $return = array_merge( $return, (array)self::parseVersions((array)$version) ); break; case 'ACTUALS': continue; case 'PLANNING': $return[] = array( 'name' => (string)$attr['name'], 'type' => (string)$attr['type'], 'default' => (string)$attr['isDefaultVersion'] ); break; } } } } } if (is_array($return)) { sort($return); } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }", "public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }", "function pg_array_parse($array, $asText = true) {\n $s = $array;\n if ($asText) {\n ...
[ "0.66442025", "0.63293284", "0.62897044", "0.61981785", "0.61588895", "0.59986705", "0.5984716", "0.58424723", "0.57783055", "0.576507", "0.566837", "0.56248873", "0.56247383", "0.5606372", "0.55716664", "0.55678403", "0.555264", "0.55389094", "0.55162144", "0.5487364", "0.54...
0.4916934
96
parse a potentially nested array
private static function parseLevels($arr) { $return = array(); if (count($arr) > 0) { if (array_key_exists('level', $arr)) { $levels = $arr['level']; foreach ($levels as $level) { $attr = $level->attributes(); // echo print_r($attr,true).'<br />'; // continue; if (array_key_exists('level', $level)) { $return = array_merge( $return, self::parseLevels((array)$level) ); continue; } if ( ! empty((string)$attr['name'])) { $return[] = array('name' => (string)$attr['name']); } } } } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }", "public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }", "function pg_array_parse($array, $asText = true) {\n $s = $array;\n if ($asText) {\n ...
[ "0.66442025", "0.63293284", "0.62897044", "0.61981785", "0.61588895", "0.59986705", "0.5984716", "0.58424723", "0.57783055", "0.576507", "0.566837", "0.56248873", "0.56247383", "0.5606372", "0.55716664", "0.55678403", "0.555264", "0.55389094", "0.55162144", "0.5487364", "0.54...
0.0
-1
parse a potentially nested array
private static function parseAccounts($arr) { $results = array(); if (count($arr) > 0) { if (array_key_exists('account', $arr)) { $accounts = $arr['account']; foreach ($accounts as $account) { $attr = $account->attributes(); if (array_key_exists('account', $account)) { $results = array_merge( $results, self::parseAccounts((array)$account) ); continue; } $code = (string)$attr['code']; $name = (string)$attr['name']; // if ($code >= '4000') { $results[] = $code; // } } $results = array_unique($results); sort($results); } } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }", "public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }", "function pg_array_parse($array, $asText = true) {\n $s = $array;\n if ($asText) {\n ...
[ "0.66442025", "0.63293284", "0.62897044", "0.61981785", "0.61588895", "0.59986705", "0.5984716", "0.58424723", "0.57783055", "0.576507", "0.566837", "0.56248873", "0.56247383", "0.5606372", "0.55716664", "0.55678403", "0.555264", "0.55389094", "0.55162144", "0.5487364", "0.54...
0.0
-1
Lists all Follow models.
public function actionIndex() { $searchModel = new FollowSearch (); $dataProvider = $searchModel->search ( Yii::$app->request->queryParams ); return $this->render ( 'index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOwnerFollows()\n {\n return $this->http->get('/users/%s/follows', 'self');\n }", "public function followers()\n {\n return $this->hasMany(Models\\AccountFollower::class, 'account_id');\n }", "public function followables()\n\t{\n\t\treturn $this->morphMany(Followable...
[ "0.6755336", "0.6454766", "0.6379214", "0.6374921", "0.6249094", "0.6215436", "0.6192749", "0.6173704", "0.61356986", "0.6090827", "0.6070063", "0.60652643", "0.60426235", "0.60274696", "0.5995998", "0.5931489", "0.5927734", "0.5917338", "0.5889872", "0.5874335", "0.581647", ...
0.6554968
1
Displays a single Follow model.
public function actionView($id) { return $this->render ( 'view', [ 'model' => $this->findModel ( $id ) ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderFollow() {\n $this->checkAccess('user',true,true);\n\n $template = new Template;\n echo $template->render('header.html');\n echo $template->render('user/follow.html');\n echo $template->render('footer.html');\n\n //clear error status\n $this->f3->set(...
[ "0.6646272", "0.6589411", "0.64122516", "0.626218", "0.6257534", "0.60874385", "0.6042892", "0.5999705", "0.5973949", "0.5967226", "0.59414417", "0.58539456", "0.5846942", "0.58446413", "0.583881", "0.5823194", "0.581715", "0.57742155", "0.577225", "0.57584095", "0.57555795",...
0.0
-1
Creates a new Follow model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Follow (); if ($model->load ( Yii::$app->request->post () ) && $model->save ()) { return $this->redirect ( [ 'view', 'id' => $model->followID ] ); } else { return $this->render ( 'create', [ 'model' => $model ] ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n...
[ "0.6710494", "0.6690616", "0.66585654", "0.66585654", "0.66585654", "0.66585654", "0.65761834", "0.6552931", "0.65009594", "0.6480906", "0.64251155", "0.64168197", "0.63638544", "0.6357716", "0.6357716", "0.62716305", "0.6268399", "0.6243951", "0.62140715", "0.6200901", "0.61...
0.8833359
0
Updates an existing Follow model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel ( $id ); if ($model->load ( Yii::$app->request->post () ) && $model->save ()) { return $this->redirect ( [ 'view', 'id' => $model->followID ] ); } else { return $this->render ( 'update', [ 'model' => $model ] ); } }
{ "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.6590642", "0.64405555", "0.643507", "0.633781", "0.6060133", "0.6056863", "0.60505575", "0.5966403", "0.5953536", "0.5914776", "0.5910345", "0.58988976", "0.58863664", "0.58778346", "0.58663815", "0.5860015", "0.5860015", "0.5850847", "0.5842669", "0.5830864", "0.58302057"...
0.7714606
0
Deletes an existing Follow model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $this->findModel ( $id )->delete (); return $this->redirect ( [ 'index' ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redire...
[ "0.6680721", "0.64890987", "0.6458703", "0.6439593", "0.6423458", "0.62801945", "0.625463", "0.6239073", "0.62099296", "0.62034047", "0.6178395", "0.6176088", "0.61753917", "0.61588204", "0.61492676", "0.61119884", "0.6074332", "0.6071773", "0.6064571", "0.6056524", "0.605405...
0.57973015
70
Finds the Follow model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Follow::findOne ( $id )) !== null) { return $model; } else { throw new NotFoundHttpException ( 'The requested page does not exist.' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($id)\n {\n return $this->model->with(['followers','following'])->find($id);\n }", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $mo...
[ "0.615055", "0.6102527", "0.6024297", "0.59946686", "0.5903707", "0.5823651", "0.5813569", "0.5784466", "0.5740782", "0.5696516", "0.56860465", "0.5678777", "0.5674011", "0.565186", "0.56242853", "0.56193435", "0.56193435", "0.55957085", "0.55911", "0.55882806", "0.5578549", ...
0.7197453
0
We declare the content of our items container
public function __construct() { // The blockGroup must match the first half of how we call the block $this->_blockGroup = 'yourmindourwork_storesquare'; // The controller must match the second half of how we call the block $this->_controller = 'adminhtml_manage_categories'; $this->_headerText = Mage::helper('yourmindourwork_storesquare')->__('Manage Categories'); parent::__construct(); $this->_removeButton('add'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render_content_items() {\n\t\tforeach ( (array) $this->get_content_items() as $content_item ) {\n\t\t\t$content_item->render();\n\t\t}\n\t}", "function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}", "public function items()\n {\n \n }", "public function items (...
[ "0.6861671", "0.6670791", "0.66198754", "0.6604895", "0.63540345", "0.63540345", "0.63540345", "0.63534623", "0.635337", "0.6330871", "0.6297411", "0.62823355", "0.62793195", "0.62624556", "0.61727804", "0.61476004", "0.6141902", "0.61406016", "0.61300355", "0.6097433", "0.60...
0.0
-1
Processes a set of files.
public function countFiles(array $files, $countTests) { if ($countTests) { if ($this->output !== NULL) { $bar = new ezcConsoleProgressbar($this->output, count($files)); print "Preprocessing files\n"; } foreach ($files as $file) { $this->preProcessFile($file); if ($this->output !== NULL) { $bar->advance(); } } if ($this->output !== NULL) { print "\n\n"; } } $directories = array(); if ($this->output !== NULL) { $bar = new ezcConsoleProgressbar($this->output, count($files)); print "Processing files\n"; } foreach ($files as $file) { $directory = dirname($file); if (!isset($directories[$directory])) { $directories[$directory] = TRUE; } $this->countFile($file, $countTests); if ($this->output !== NULL) { $bar->advance(); } } if ($this->output !== NULL) { print "\n\n"; } $count = $this->count; if (!function_exists('bytekit_disassemble_file')) { unset($count['eloc']); } if (!$countTests) { unset($count['testClasses']); unset($count['testMethods']); } $count['directories'] = count($directories) - 1; $count['namespaces'] = count($this->namespaces); $count['classes'] = $count['abstractClasses'] + $count['concreteClasses']; $count['methods'] = $count['staticMethods'] + $count['nonStaticMethods']; $count['publicMethods'] = $count['methods'] - $count['nonPublicMethods']; $count['constants'] = $count['classConstants'] + $count['globalConstants']; if (isset($count['eloc']) && $count['eloc'] > 0) { $count['ccnByLoc'] = $count['ccn'] / $count['eloc']; } else if ($count['ncloc'] > 0) { $count['ccnByLoc'] = $count['ccn'] / $count['ncloc']; } if ($count['methods'] > 0) { if(isset($count['testMethods'])) { $countTestMethods = $count['testMethods']; } else { $countTestMethods = 0; } $count['ccnByNom'] = 1 + ($count['ccnMethods'] / ($count['methods'] - $countTestMethods)); } if ($count['classes'] > 0) { $count['nclocByNoc'] = $count['nclocClasses'] / $count['classes']; } if ($count['methods'] > 0) { $count['nclocByNom'] = $count['nclocClasses'] / $count['methods']; } return $count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function process(array $files);", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->sto...
[ "0.77582103", "0.70163983", "0.6596464", "0.61006147", "0.60283935", "0.59699124", "0.5954716", "0.59486204", "0.5942486", "0.5822106", "0.579859", "0.57939965", "0.57690424", "0.5746909", "0.5735797", "0.570958", "0.5706699", "0.5652778", "0.5652521", "0.56487125", "0.564547...
0.51431054
59
Preprocesses a single file.
public function preProcessFile($filename) { $tokens = token_get_all(file_get_contents($filename)); $numTokens = count($tokens); $namespace = FALSE; for ($i = 0; $i < $numTokens; $i++) { if (is_string($tokens[$i])) { continue; } list ($token, $value) = $tokens[$i]; switch ($token) { case T_NAMESPACE: { $namespace = $this->getNamespaceName($tokens, $i); } break; case T_CLASS: { $className = $this->getClassName($namespace, $tokens, $i); if (isset($tokens[$i+4]) && is_array($tokens[$i+4]) && $tokens[$i+4][0] == T_EXTENDS) { $parent = $this->getClassName( $namespace, $tokens, $i + 4 ); } else { $parent = NULL; } $this->classes[$className] = $parent; } break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function pre_process() {}", "public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }", "public function preProcess();", "public function preProcess();", "protected function preProcess() {}", "abstract protected function _preProcess();", "function file...
[ "0.67868865", "0.656404", "0.6375926", "0.6375926", "0.6336333", "0.59913945", "0.5682006", "0.5598894", "0.5500019", "0.5481329", "0.5469868", "0.5438111", "0.54293764", "0.54011875", "0.5364747", "0.53627974", "0.53394", "0.53046113", "0.53012323", "0.52606666", "0.5254927"...
0.54709435
10
Processes a single file.
public function countFile($filename, $countTests) { $buffer = file_get_contents($filename); $tokens = token_get_all($buffer); $numTokens = count($tokens); $loc = substr_count($buffer, "\n"); unset($buffer); $nclocClasses = 0; $cloc = 0; $blocks = array(); $currentBlock = FALSE; $namespace = FALSE; $className = NULL; $functionName = NULL; $testClass = FALSE; for ($i = 0; $i < $numTokens; $i++) { if (is_string($tokens[$i])) { if (trim($tokens[$i]) == '?') { if (!$testClass) { if ($className !== NULL) { $this->count['ccnMethods']++; } $this->count['ccn']++; } } if ($tokens[$i] == '{') { if ($currentBlock == T_CLASS) { $block = $className; } else if ($currentBlock == T_FUNCTION) { $block = $functionName; } else { $block = FALSE; } array_push($blocks, $block); $currentBlock = FALSE; } else if ($tokens[$i] == '}') { $block = array_pop($blocks); if ($block !== FALSE && $block !== NULL) { if ($block == $functionName) { $functionName = NULL; } else if ($block == $className) { $className = NULL; $testClass = FALSE; } } } continue; } list ($token, $value) = $tokens[$i]; if ($className !== NULL) { if ($token != T_COMMENT && $token != T_DOC_COMMENT) { $nclocClasses += substr_count($value, "\n"); } } switch ($token) { case T_NAMESPACE: { $namespace = $this->getNamespaceName($tokens, $i); if (!isset($this->namespaces[$namespace])) { $this->namespaces[$namespace] = TRUE; } } break; case T_CLASS: case T_INTERFACE: case T_TRAIT: { $className = $this->getClassName( $namespace, $tokens, $i ); $currentBlock = T_CLASS; if ($token == T_TRAIT) { $this->count['traits']++; } else if ($token == T_INTERFACE) { $this->count['interfaces']++; } else { if ($countTests && $this->isTestClass($className)) { $testClass = TRUE; $this->count['testClasses']++; } else { if (isset($tokens[$i-2]) && is_array($tokens[$i-2]) && $tokens[$i-2][0] == T_ABSTRACT) { $this->count['abstractClasses']++; } else { $this->count['concreteClasses']++; } } } } break; case T_FUNCTION: { $currentBlock = T_FUNCTION; if (is_array($tokens[$i+2]) && $tokens[$i+2][0] == T_STRING) { $functionName = $tokens[$i+2][1]; } else if ($tokens[$i+2] == '&' && is_array($tokens[$i+3]) && $tokens[$i+3][0] == T_STRING) { $functionName = $tokens[$i+3][1]; } else { $currentBlock = 'anonymous function'; $functionName = 'anonymous function'; $this->count['anonymousFunctions']++; } if ($currentBlock == T_FUNCTION) { if ($className === NULL) { $this->count['functions']++; } else { $static = FALSE; $visibility = T_PUBLIC; for ($j = $i; $j > 0; $j--) { if (is_string($tokens[$j])) { if ($tokens[$j] == '{' || $tokens[$j] == '}') { break; } continue; } if (isset($tokens[$j][0])) { switch ($tokens[$j][0]) { case T_PRIVATE: { $visibility = T_PRIVATE; } break; case T_PROTECTED: { $visibility = T_PROTECTED; } break; case T_STATIC: { $static = TRUE; } break; } } } if ($testClass && strpos($functionName, 'test') === 0 && $visibility == T_PUBLIC && !$static) { $this->count['testMethods']++; } else if (!$testClass) { if ($static) { $this->count['staticMethods']++; } else { $this->count['nonStaticMethods']++; } if ($visibility != T_PUBLIC) { $this->count['nonPublicMethods']++; } } } } } break; case T_CURLY_OPEN: { $currentBlock = T_CURLY_OPEN; array_push($blocks, $currentBlock); } break; case T_DOLLAR_OPEN_CURLY_BRACES: { $currentBlock = T_DOLLAR_OPEN_CURLY_BRACES; array_push($blocks, $currentBlock); } break; case T_IF: case T_ELSEIF: case T_FOR: case T_FOREACH: case T_WHILE: case T_CASE: case T_CATCH: case T_BOOLEAN_AND: case T_LOGICAL_AND: case T_BOOLEAN_OR: case T_LOGICAL_OR: { if (!$testClass) { if ($className !== NULL) { $this->count['ccnMethods']++; } $this->count['ccn']++; } } break; case T_COMMENT: case T_DOC_COMMENT: { $cloc += substr_count($value, "\n") + 1; } break; case T_CONST: { $this->count['classConstants']++; } break; case T_STRING: { if ($value == 'define') { $this->count['globalConstants']++; } } break; } } $this->count['loc'] += $loc; $this->count['nclocClasses'] += $nclocClasses; $this->count['cloc'] += $cloc; $this->count['ncloc'] += $loc - $cloc; $this->count['files']++; if (function_exists('bytekit_disassemble_file')) { $this->count['eloc'] += $this->countEloc($filename, $loc); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function processFile($fileName);", "private function processFile() {\n if ($this->isFileAllowed()) {\n $path_parts = pathinfo($this->filepath);\n $extention = $path_parts['extension'];\n\n $classes = get_declared_classes();\n\n foreach($classes a...
[ "0.76176465", "0.6176209", "0.60963434", "0.6084515", "0.5917527", "0.5866858", "0.57628286", "0.5755351", "0.57450217", "0.574126", "0.57246053", "0.5718934", "0.5716071", "0.5714241", "0.5708811", "0.5708811", "0.57027876", "0.5702447", "0.5702447", "0.5702447", "0.5621347"...
0.0
-1
Counts the Executable Lines of Code (ELOC) using Bytekit.
protected function countEloc($filename, $loc) { $bytecode = @bytekit_disassemble_file($filename); if (!is_array($bytecode)) { return 0; } $lines = array(); foreach ($bytecode['functions'] as $function) { foreach ($function['raw']['opcodes'] as $opline) { if ($opline['lineno'] <= $loc && !isset($this->opcodeBlacklist[$opline['opcode']]) && !isset($lines[$opline['lineno']])) { $lines[$opline['lineno']] = TRUE; } } } return count($lines); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getNumExecutableLines();", "abstract public function getLinesOfCode();", "function lines(){\n\t$string = shell_exec(\"find . -name '*.php' -not -path './securimage/*' -not -path './phpmyadmin/*' -not -path './jpgraph/*' | xargs wc -l\");\n\tpreg_match_all('/[0-9]+/',$string,$matches);\...
[ "0.6819805", "0.64122343", "0.6325718", "0.60390526", "0.5917712", "0.5889832", "0.5578459", "0.55134743", "0.5501132", "0.5403971", "0.53762025", "0.52682596", "0.52467686", "0.52174526", "0.51249135", "0.5114899", "0.5085061", "0.50835973", "0.50371027", "0.5030325", "0.499...
0.601023
4
Create a new controller instance.
public function __construct(\Illuminate\Http\Request $request) { $this->middleware('auth'); $this->permit=$request->attributes->get('permit'); $this->configs=$request->attributes->get('configs'); $this->attachment = new FileManager; }
{ "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
Display a listing of the resource.
public function index() { // $productSpecs = CepSpecificationProducts::all(); return view("product_specifications.index",compact('productSpecs')); }
{ "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.7446377", "0.7361922", "0.72984487", "0.7248631", "0.7162871", "0.7148215", "0.7131838", "0.71028054", "0.7102395", "0.70988023", "0.7048243", "0.6993516", "0.6989079", "0.69341344", "0.69001913", "0.6899167", "0.68920904", "0.6887188", "0.68661547", "0.6849159", "0.683002...
0.0
-1
Show the form for creating a new resource.
public function create() { // $ps_products = CepProducts::where("prod_status",1)->select('prod_id','prod_name')->get(); $all_ps_products = array(); $all_ps_products[""] = "Select"; foreach($ps_products as $prod) $all_ps_products[$prod->prod_id] = $prod->prod_name; $alphaRange=array_combine(range('1','26'),range('A','Z')); $languages = CepLanguages::where('lang_status',1)->get(); $languages_array = array(); $languages_array[""] = "Select"; foreach ($languages as $language){ $languages_array[$language->lang_code]=$language->lang_name; } return view("product_specifications.create",compact('all_ps_products','alphaRange','languages_array')); }
{ "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() { // $productSpecs = Request::all(); $validate = Validator::make($productSpecs,[ 'specprod_product_id' => 'required', 'specprod_item_id' => 'required', 'specprod_usage' => 'required', 'specprod_language_code' => 'required', 'specprod_technical_info' => 'required', 'specprod_reference_id' => 'required', 'specprod_description' => 'required', 'specprod_url' => 'required|unique:cep_specification_products', ]); if($validate->fails()){ return redirect()->back()->withErrors($validate->errors()); } if(Input::hasFile('files')){ $files=Input::file('files'); $productSpecs['specprod_attachment_id'] = $this->attachment->createAttachment(array('att_type'=>'product-specifications')); foreach($files as $key=>$fl){ //echo "<pre>"; print_r ($appointments['files'][$key]); //exit; $this->attachment->uploadAttachmentFiles($fl,$productSpecs['specprod_attachment_id']); } } if(isset($productSpecs['universal_id'])) $productSpecs['specprod_url'] = preg_replace('/\d+/','DD',$productSpecs['specprod_url']); $masterSpecs = array( 'spec_type' => 'product', 'spec_created_date' => Carbon::now(), 'spec_created_by' => Auth::id() ); $master = CepSpecificationMasters::create($masterSpecs); $productSpecs['specprod_spec_id'] = $master->spec_id; CepSpecificationProducts::create($productSpecs); return redirect('product-specifications'); }
{ "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) { // $ps_products = CepProducts::where("prod_status",1)->select('prod_id','prod_name')->get(); $all_ps_products = array(); $all_ps_products[""] = "Select"; foreach($ps_products as $prod) $all_ps_products[$prod->prod_id] = $prod->prod_name; $alphaRange=array_combine(range('1','26'),range('A','Z')); $productSpecs = CepSpecificationProducts::where("specprod_id",$id)->first(); $languages = CepLanguages::all(); $languages_array = array(); $languages_array[""] = "Select"; foreach ($languages as $language){ $languages_array[$language->lang_code]=$language->lang_name; } $prd_attachment = CepAttachmentFiles::where('attfiles_attachment_id',$productSpecs['specprod_attachment_id'])->get(); return count($productSpecs) ? view("product_specifications.show",compact('all_ps_products','alphaRange','productSpecs','languages_array','prd_attachment')) : abort(404); }
{ "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) { // $ps_products = CepProducts::where("prod_status",1)->select('prod_id','prod_name')->get(); $all_ps_products = array(); $all_ps_products[""] = "Select"; foreach($ps_products as $prod) $all_ps_products[$prod->prod_id] = $prod->prod_name; $alphaRange=array_combine(range('1','26'),range('A','Z')); $productSpecs = CepSpecificationProducts::where("specprod_id",$id)->first(); $languages = CepLanguages::all(); $languages_array = array(); $languages_array[""] = "Select"; foreach ($languages as $language){ $languages_array[$language->lang_code]=$language->lang_name; } $prd_attachment = CepAttachmentFiles::where('attfiles_attachment_id',$productSpecs['specprod_attachment_id'])->get(); return count($productSpecs) ? view("product_specifications.edit",compact('all_ps_products','alphaRange','productSpecs','languages_array','prd_attachment')) : abort(404); }
{ "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) { // $productSpecs = Request::only('specprod_product_id','specprod_item_id','specprod_usage','specprod_technical_info','specprod_reference_id','specprod_description','specprod_url','specprod_status','specprod_spec_id','specprod_language_code','specprod_attachment_id'); $validate = Validator::make($productSpecs,[ 'specprod_product_id' => 'required', 'specprod_item_id' => 'required', 'specprod_usage' => 'required', 'specprod_language_code' => 'required', 'specprod_technical_info' => 'required', 'specprod_reference_id' => 'required', 'specprod_description' => 'required', 'specprod_url' => 'required|unique:cep_specification_products,specprod_url,'.$id.',specprod_id', ]); if($validate->fails()){ return redirect()->back()->withErrors($validate->errors()); } if(Input::hasFile('files')){ $files=Input::file('files'); if($productSpecs['specprod_attachment_id'] == 0) $productSpecs['specprod_attachment_id'] = $this->attachment->createAttachment(array('att_type'=>'product-specifications')); foreach($files as $key=>$fl){ //echo "<pre>"; print_r ($appointments['files'][$key]); //exit; $this->attachment->uploadAttachmentFiles($fl,$productSpecs['specprod_attachment_id']); } } $masterSpecs = array( 'spec_updated_by' => Auth::id() ); CepSpecificationMasters::where('spec_id', $productSpecs['specprod_spec_id'])->update($masterSpecs); CepSpecificationProducts::where('specprod_id', $id)->update($productSpecs); return redirect('product-specifications'); }
{ "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) { // if(!$this->permit->crud_general_specifications_delete) return redirect('accessDenied'); $ids = explode("-",$id); CepSpecificationProducts::where('specprod_id', $ids[0])->delete(); CepSpecificationMasters::where('spec_id', $ids[1])->delete(); return redirect('product-specifications'); }
{ "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
20060602 Renamed function from st_add_st_link() to st_add_feed_link()
function st_add_feed_link($content) { if (is_feed()) { $content .= st_link(); } return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function the_feed_link($anchor, $feed = '')\n {\n }", "function automatic_feed_links($add = \\true)\n {\n }", "function addFeed($feed,$url,$return=true);", "function comments_link_feed()\n {\n }", "public function feed_link() {\n\t\t$post_title = self::feed_title();\n\t\t$feed_link = Liv...
[ "0.6778361", "0.67182124", "0.64651215", "0.6393721", "0.6378318", "0.6240546", "0.62273055", "0.6194639", "0.61402667", "0.61052424", "0.608226", "0.6079509", "0.59695506", "0.5967263", "0.59559053", "0.5943738", "0.594368", "0.5939042", "0.5911689", "0.5880697", "0.5873591"...
0.7680712
0
Run the database seeds.
public function run() { $data = [ ['short_title' => 'android','title'=>'安卓端'], ['short_title' => 'web','title'=>'web端'], ['short_title' => 'ios','title'=>'ios端'], ['short_title' => 'wx','title'=>'微信端'], ['short_title' => 'pc','title'=>'电脑端'], ]; Platform::insert($data); }
{ "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
Checking if user has submitted report
public function isReported($user,$component,$component_id) { if(!is_object($user)) return 0; $reports = $this->getQueryBuilder() ->where("r.user_reporting = :user") ->andWhere("r.component = :component") ->andWhere("r.componentId = :component_id") ->setParameter("user",$user->getId()) ->setParameter("component",$component) ->setParameter("component_id",$component_id) ->getQuery(); $rep = $reports->getResult(); if($rep) return 1; return 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isReported()\n\t{\n\t\tif ($this->get('reports', -1) > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t// Reports hasn't been set\n\t\tif ($this->get('reports', -1) == -1)\n\t\t{\n\t\t\tif (is_file(Component::path('com_support') . DS . 'models' . DS . 'report.php'))\n\t\t\t{\n\t\t\t\tinclude_once Compone...
[ "0.7004151", "0.6772562", "0.67612225", "0.6617957", "0.6584873", "0.65281534", "0.6394429", "0.6389003", "0.63589954", "0.634948", "0.63420606", "0.63420606", "0.6301841", "0.6281017", "0.6269977", "0.62672937", "0.6250982", "0.6241081", "0.613254", "0.61283076", "0.60971415...
0.0
-1
Use safeUp/safeDown to do migration with transaction
public function safeUp() { $this->createTable('site', array( 'client_id' => self::MYSQL_TYPE_UINT, 'domain' => 'string NOT NULL' )); $this->addForeignKey('site_client_id', 'site', 'client_id', 'client', 'id', 'CASCADE', 'RESTRICT'); $this->createTable('site_contract', array( 'site_id' => self::MYSQL_TYPE_UINT, 'contract_id' => self::MYSQL_TYPE_UINT, )); $this->addForeignKey('site_contract_site_id', 'site_contract', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT'); $this->addForeignKey('site_contract_contract_id', 'site_contract', 'contract_id', 'contract', 'id', 'CASCADE', 'RESTRICT'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r...
[ "0.7831747", "0.7831747", "0.77974", "0.77492934", "0.7730412", "0.76126146", "0.7103458", "0.7056744", "0.7019433", "0.686808", "0.68653876", "0.67907315", "0.67833483", "0.6779402", "0.677009", "0.6753907", "0.672025", "0.6714505", "0.66979295", "0.6674457", "0.66629297", ...
0.6657859
22
add by minas 20140503
public function getFOrders() { // 花店管理员身份验证 if (session("admin_level") == 3){ $toFlower = M('weixin_order'); $data = $toFlower->where('type = 0')->select(); $this->assign('data',$data); } $toTrade = M('pub_trade_logs'); $con['uid'] = session('uid'); //$this->ajaxReturn(0 , $con['uid'] , 1); $TradeLogs = $toTrade->query("SELECT `xt_pub_trade_logs`.* ,`xt_pub`.`title` FROM `xt_pub_trade_logs` left join `xt_pub` on `xt_pub_trade_logs`.`pub_id` = `xt_pub`.`pub_id` WHERE 1"); // $this->ajaxReturn(0 , $TradeLogs , 1); $this->assign('tradelogs',$TradeLogs); $this->display(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function mass_add()\n {\n }", "public function plus();", "public function add();", "public function add();", "public function plus_abonados();", "function add() {\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "function add()\n\t{\n\t\t$a = 120;\n\t\...
[ "0.7171696", "0.7106002", "0.7020637", "0.7020637", "0.70088506", "0.6989221", "0.6895944", "0.6895944", "0.6849266", "0.6759913", "0.66450715", "0.66450715", "0.66450715", "0.6584001", "0.6565468", "0.64222574", "0.64180136", "0.6411249", "0.6329956", "0.62820035", "0.623427...
0.0
-1
Get the tickets for the user.
public function tickets() { return $this->hasMany(Ticket::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_tickets ($user_id)\r\n\t{\r\n\t\t$db_manager = new database_manager ();\r\n\t\t$tickets \t= $db_manager -> select (\r\n\t\t\t'tickets',\r\n\t\t\tnull,\r\n\t\t\t\"user_id='$user_id'\"\r\n\t\t);\r\n\r\n\t\treturn ($tickets);\r\n\t}", "public function userTickets() {\r\n return $th...
[ "0.7822738", "0.75688815", "0.7543042", "0.74866563", "0.7249491", "0.7233538", "0.70889676", "0.70712817", "0.7044554", "0.7016593", "0.6866737", "0.67694527", "0.66842353", "0.6614182", "0.65816617", "0.65543854", "0.650449", "0.6467773", "0.6370188", "0.635437", "0.63448",...
0.6587757
15
Show dashboard of customer
public function editInvoice($order_id) { $submitted = Request::get('submitted'); if ($submitted) { } else { $order = Invoice::where('id', '=', $order_id)->get(); $order_details =[]; return view('common.edit_invoice') ->with('order', $order[0]) ->with('order_details', $order_details); // return view('common.edit_invoice')->with('order', $order)->with('order_details', $order_details)->with('before_image',$before_image); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function customer() {\n $this->access_lib->_is(\"adm,mgr\");\n\n $data['header'] = $this->header;\n\n $this->load->view('report_customer_v', $data);\n }", "public function listCustomers()\n {\n return $this->view( 'pages.dashboard.customers' );\n }", "public function...
[ "0.7743648", "0.77122045", "0.7582847", "0.75818187", "0.74903864", "0.74875647", "0.7450015", "0.74047416", "0.7397758", "0.7369586", "0.73574007", "0.7297543", "0.72182643", "0.7218159", "0.72107905", "0.71872187", "0.71839637", "0.7179397", "0.7170521", "0.7157259", "0.715...
0.0
-1
/ 1. Strip unnecessary characters 2. Remove backslashes (\) 3. ensure security by preventing user malicious code entry
function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_unwanted_characters($oneStr){\n\t$cleaned_str = $oneStr;\r\n// \t$cleaned_str = str_ireplace(\"\\\"\", \"/\", $oneStr);\r\n// \t$cleaned_str = str_ireplace(\"\\\\\", \"/\", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\b\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\f...
[ "0.74068093", "0.73126304", "0.72646415", "0.72569776", "0.72124624", "0.72124624", "0.7207709", "0.71911836", "0.7154672", "0.7154672", "0.7114482", "0.71103495", "0.7102492", "0.70576155", "0.70553267", "0.7030534", "0.70291024", "0.6989625", "0.69856757", "0.6981518", "0.6...
0.0
-1
Display a listing of the resource.
public function index() { $siswa = Siswa::all(); return response()->json($siswa); }
{ "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.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(SiswaRequest $request) { $data = new Siswa; $data->name = $request->name; $data->department = $request->department; $data->age = $request->age; $data->bio = $request->bio; $data->isdone = 0; $data->save(); return response()->json('Successfully added'); }
{ "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) { $siswa = Siswa::find($id); return response()->json($siswa); }
{ "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) { }
{ "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(SiswaRequest $request, $id) { $data = Siswa::find($id); $data->name = $request->name; $data->department = $request->department; $data->age = $request->age; $data->save(); return response()->json('Successfully Update'); }
{ "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.7424578", "0.7062392", "0.7056844", "0.6897447", "0.65815884", "0.6451359", "0.634689", "0.62107086", "0.6145251", "0.6121901", "0.6115076", "0.61009926", "0.60885817", "0.6053816", "0.6018965", "0.6007763", "0.5973282", "0.59455335", "0.593951", "0.59388787", "0.5892445",...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $data = Siswa::find($id); $data->delete(); return response()->json('Successfully Delete'); }
{ "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
get array image size
public function get_thumbnail_size_array( $size ) { global $_wp_additional_image_sizes; $size_array = array(); if( array_key_exists ( $size, $_wp_additional_image_sizes ) ){ $size_array = $_wp_additional_image_sizes[ $size ]; }else { $size_array = $_wp_additional_image_sizes[ 'post-thumbnail' ]; } return $size_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "public function getArraySampleSize(): UnsignedInteger;", "function getimagesize($filename){\n\t\t$arr = @getimagesize($filename);\n\n\t\tif(isset($arr) && is_array($arr) && (count($arr) >= 4) && $arr[0] && $arr[1])...
[ "0.74550134", "0.7333092", "0.7119386", "0.7076211", "0.706649", "0.6996733", "0.69935316", "0.69560367", "0.69290364", "0.6836457", "0.68109304", "0.68109304", "0.68109304", "0.68109304", "0.68109304", "0.68109304", "0.68109304", "0.68109304", "0.68109304", "0.67841214", "0....
0.0
-1
A Dusk test example.
public function a_user_looking_for_data_refund() { /** * first todo * todo auth|login|middleware * alternative use ->loginAs(Model::find(id)) */ $this->user_login(); $this->browse(function (Browser $browser) { $assertSee = 'Data Refund Modal'; $tanggal = '2019-05-31'; $uraian = 'Salah Top Up Saldo'; // value='keterangan' $jumlah = '8400000'; $jumlahSee = 'Rp. 8.400.000,00,-'; $browser /** * #path_url-02 cabang_path() * don't forget to put path link after execute link/move/change address.url * in this case we have move from user_login */ ->assertPathIs($this->cabang_path()) /** * ?clickLink('param') * the function for this * <a href='x'> param </a> */ ->clickLink('Data Permodalan') ->clickLink('List Data Refund Saldo') // measure against , the bot seen a page , // for capture laters -> finalize js loading screen ->assertSee($assertSee) // capture the task ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](1)') /** * select('name', 'value-option') * looking for view */ ->select('perpage', '10') ->press('Oke') ->assertSee($assertSee) ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](2)') ->select('perpage', '25') ->press('Oke') ->assertSee($assertSee) ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](3)') ->select('perpage', '50') ->press('Oke') ->assertSee($assertSee) ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](4)') ->select('perpage', '100') ->press('Oke') ->assertSee($assertSee) ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](5)') // end of select /** * searching */ // [tanggal] ->select('by', 'tanggal') // some case value more prefered use ID not CLASS , sometime make anError ->value('#q', $tanggal) //search ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](6)') // press ('value-of-button') ->press('Oke') ->assertSee($tanggal) //text from data by search ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](6.1)') // [uraian|keterangan] ->select('by', 'uraian') // some case value more prefered use ID not CLASS , sometime make anError ->value('#q', $uraian) //search ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](7.1)') // press ('value-of-button') ->press('Oke') ->assertSee($uraian) //text from data by search ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](7.2)') // [jumlah] ->select('by', 'jumlah') // some case value more prefered use ID not CLASS , sometime make anError ->value('#q', $jumlah) //search ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](8.1)') // press ('value-of-button') ->press('Oke') ->assertSee($jumlahSee) //text from data by search ->screenshot('UserViewDataPermodalan[LIST-REFUND-SALDO](8.2)') // end ; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "public function testExample()\n {\n $this->browse(function ($browser , $se...
[ "0.8513539", "0.7812407", "0.7805981", "0.77781904", "0.76881546", "0.7686562", "0.7684846", "0.7639411", "0.7620482", "0.76054966", "0.7585921", "0.7527397", "0.7514917", "0.7506789", "0.7485635", "0.74846524", "0.745873", "0.74418616", "0.74364763", "0.74219656", "0.7409195...
0.0
-1
$to is relative to the base location
public function copy($from, $to) { if(is_dir($from)) $this->recurse_copy($from, $this->base_location . "/" . $to); else copy($from, $this->base_location . "/" . $to); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTo();", "public function getTo();", "function getTo(){\n\t\t\treturn $this->to;\n\t\t}", "function redirect($to, $base=true){\n if($base==true){\n $to = getProp('base_url').$to;\n }\n header('location: '.$to);\n }", "protected function setTo() {}", "function...
[ "0.6383918", "0.5983753", "0.59542376", "0.59167176", "0.5847961", "0.5834583", "0.5779702", "0.5743164", "0.5729355", "0.56886727", "0.56617177", "0.56617177", "0.56594086", "0.56079924", "0.559791", "0.5593712", "0.5538026", "0.55208427", "0.54888356", "0.5480434", "0.54804...
0.0
-1
$to is relative to the base location
public function move($from, $to) { rename($from, $this->base_location . "/" . $to); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTo();", "public function getTo();", "function getTo(){\n\t\t\treturn $this->to;\n\t\t}", "function redirect($to, $base=true){\n if($base==true){\n $to = getProp('base_url').$to;\n }\n header('location: '.$to);\n }", "protected function setTo() {}", "function...
[ "0.63841194", "0.5983376", "0.59537977", "0.59162766", "0.58472085", "0.583404", "0.57795066", "0.5743012", "0.57292", "0.5688821", "0.5662056", "0.5662056", "0.5658825", "0.56070906", "0.5596752", "0.5592143", "0.5537419", "0.5520575", "0.5488127", "0.5479738", "0.5479738", ...
0.0
-1
first check that $hook_suffix is appropriate for your admin page
function mw_enqueue_color_picker( $hook_suffix ) { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'my-script-handle', plugins_url('admin.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleAdminScripts ( $hook_suffix )\n\t{\n\n\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';\n\t\t$admin_pages = array ('post.php', 'page.php' );\n\t\tif ( in_array( $hook_suffix, $admin_pages ) ) {\n\t\t\twp_enqueue_script( 'avhamazonmetabox', $this->core->info['plugin_url'] . '/inc...
[ "0.76223385", "0.73841524", "0.6958206", "0.68662363", "0.66337633", "0.64245725", "0.6328074", "0.6080796", "0.6050916", "0.60506064", "0.60356873", "0.60320854", "0.6026929", "0.59873134", "0.59858865", "0.59683275", "0.59680253", "0.5951908", "0.59442556", "0.59200114", "0...
0.0
-1
ultima numero do sequencial dado pelo gerador
public function __construct($quantidadeRegistros, $valorTotal, $numeroSequencialRegistro) { $this->setQuantidadeRegistros($quantidadeRegistros); $this->setValorTotal($valorTotal); $this->setNumeroSequencialRegistro($numeroSequencialRegistro); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cria_seq()\n{\n global $db;\n $sql=\"SELECT max(seq_restauro) as valor from restauro where tombo = '$_REQUEST[pNum_registro]' and controle='$_REQUEST[controle]' and tipo=4 and interna='I'\";\n $db->query($sql);\n $res=$db->dados(); \n if($res['valor']==null){\n echo 1;}\n else{\n echo $res[...
[ "0.6940952", "0.6673216", "0.66372126", "0.6632207", "0.63819563", "0.63551855", "0.62746453", "0.62433803", "0.6225916", "0.6216209", "0.617406", "0.617406", "0.61703527", "0.6128667", "0.6123499", "0.61205256", "0.61196345", "0.61048275", "0.61042786", "0.6097579", "0.60798...
0.0
-1
Ajax Logged only : add a new solution
public function newsolution() { // collect round and floor from POST data $round = Input::get('round'); $floor = Input::get('floor'); $ajaxResponse = ['msg' => '']; // dont save if 10 minutes left if($this->timeSinceRound(null, true) > -600) { $ajaxResponse['msg'] = 'newRoundSoon'; } elseif ($round != $this->currentRound()) { $ajaxResponse['msg'] = 'cannotSaveSolutionForOtherRound'; } elseif ($floor > $this->maxFloor()) { $ajaxResponse['msg'] = 'floorNotAvailable'; } else { // collect the rest of POST data $solution = Input::get('solution'); $solutionparams = Input::get('solutionparams'); // calculate team karma $karma = $this->teamkarma($floor, $solution); //prepare data save to db $data = array( 'tot_round' => $round, 'floor' => $floor, 'user_id' => Auth::user()->id, 'karma' => $solutionparams['luck'] ? 50 : 100, 'maxrank' => $karma['maxrank'], 'maxevol' => $karma['maxevol'], 'gamespeed' => $solutionparams['gamespeed'], 'luck' => $solutionparams['luck'], 'karma_multiplier' => $karma['karmaMultiplier'], 'note' => $solutionparams['note'], 'unit_id_1' => $solution[0]['unitId'], 'unit_rank_1' => $solution[0]['rank'], 'unit_trans_1' => $solution[0]['trans'] ); for ($i=1; $i < 12; $i++) { if (!isset($solution[$i])) { break; } $data['unit_id_'.($i+1)] = $solution[$i]['unitId']; $data['unit_rank_'.($i+1)] = $solution[$i]['rank']; $data['unit_trans_'.($i+1)] = $solution[$i]['trans']; } $sid = DB::table('tot_solutions')->insertGetId($data); // vote for my solution $solution = $this->getSolutions(null, false, $sid)[0]; $voteType = $solutionparams['luck'] == 1 ? 1 : 2; $calculatedKarma = $this->karmaPoint($voteType, $solution->karmamultiplier, $solution->luck); //prepare data save to db $data = array( 'round' => $solution->round, 'floor' => $solution->floor, 'tot_solution_id' => $solution->sid, 'user_id' => Auth::user()->id, 'vote_type' => $voteType, 'karma_vote' => $calculatedKarma, 'old_karma' => $solution->karma ); DB::table('tot_solution_votes')->insert($data); //update solution karma DB::table('tot_solutions')->where('id', $sid)->update(['karma' => $solution-> karma + $calculatedKarma]); $ajaxResponse['msg'] = 'ok'; } $ajaxResponse['solutions'] = $this->formattedSolutions(); $ajaxResponse['myroundvotes'] = $this->getMyVotes($round); $ajaxResponse['roundvotes'] = $this->getRoundVotes($this->currentRound()); echo json_encode($ajaxResponse, JSON_NUMERIC_CHECK); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajax_login() {\n\n\t\t\tcheck_ajax_referer( 'ajax-login-nonce', 'security' );\n\t\t\n\t\t\tself::auth_user_login($_POST['username'], $_POST['password'], __( 'Acceso', 'project045' ) );\n\t\t\n\t\t\tdie();\n\t\t}", "function wp_ajax_update_welcome_panel()\n {\n }", "function add() {\n RR_S...
[ "0.6258183", "0.5857296", "0.5833823", "0.58235115", "0.5759462", "0.57187945", "0.568235", "0.5625368", "0.5606087", "0.5598101", "0.5593937", "0.5585285", "0.5581127", "0.55751014", "0.5534277", "0.54987556", "0.54968804", "0.548993", "0.54877645", "0.54829353", "0.5472302"...
0.0
-1
/ return array of solutions by floor
public function formattedSolutions($round = null) { if ($round == null) { $round = $this->currentRound(); } $solutionData = $this->getSolutions($round); $roundSolutions = []; for ($i=0; $i < $this->maxFloor(); $i++) { $tmpFloor = [ 'floorn' => $i + 1, 'isCollapsed' => false, 'solutions' => [] ]; foreach ($solutionData as $sk => $sv) { if ($sv->floor == ($i+1)){ $tmpSolution = [ 'sid' => intval($sv->sid), 'karma' => $sv->karma, 'karmaMulti' => $sv->karmamultiplier, 'maxrank' => $sv->maxrank, 'maxevol' => $sv->maxevol, 'gamespeed' => $sv->gamespeed, 'note' => $sv->note, 'luck' => $sv->luck, 'units' => [] ]; for ($u=0; $u < 12; $u++) { if(!$sv->{'unit_id_'.($u+1)}){ break; } $tmpSolution['units'][] = [ 'unitId' => $sv->{'unit_id_'.($u+1)}, 'rank' => $sv->{'unit_rank_'.($u+1)}, 'trans' => $sv->{'unit_trans_'.($u+1)} ]; } $tmpFloor['solutions'][] = $tmpSolution; } } $roundSolutions[$i] = $tmpFloor; } return $roundSolutions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cases_floor()\n\t{\n\t\treturn array(\n\t\t\tarray(2, 7, true, false, 0, null, true),\n\t\t\tarray(2, 7, true, false, 6, 6, false),\n\t\t\tarray(2, 7, true, false, 7, 6, false),\n\t\t\tarray(2, 7, true, false, 8, 6, false),\n\t\t\tarray(2, 7, true, true, 0, null, true),\n\t\t\tarray(2, 7, true, tru...
[ "0.6527874", "0.57884675", "0.5297491", "0.52588737", "0.51875824", "0.51292473", "0.51099557", "0.50796175", "0.5009998", "0.50052375", "0.49418202", "0.48861367", "0.48688072", "0.48623535", "0.4830384", "0.47951046", "0.4793156", "0.47784773", "0.4776958", "0.47628313", "0...
0.49630052
10
DB functions / return table object
public function getSolutions($totRound = null, $multiple = true, $solutionID = null) { if ($multiple) { return DB::table('tot_solutions') ->where('tot_solutions.tot_round', '=', $totRound) ->select( 'tot_solutions.id as sid', 'tot_solutions.tot_round as round', 'tot_solutions.floor as floor', 'tot_solutions.karma as karma', 'tot_solutions.maxrank as maxrank', 'tot_solutions.maxevol as maxevol', 'tot_solutions.gamespeed as gamespeed', 'tot_solutions.karma_multiplier as karmamultiplier', 'tot_solutions.note as note', 'tot_solutions.luck as luck', 'tot_solutions.unit_id_1 as unit_id_1', 'tot_solutions.unit_rank_1 as unit_rank_1', 'tot_solutions.unit_trans_1 as unit_trans_1', 'tot_solutions.unit_id_2 as unit_id_2', 'tot_solutions.unit_rank_2 as unit_rank_2', 'tot_solutions.unit_trans_2 as unit_trans_2', 'tot_solutions.unit_id_3 as unit_id_3', 'tot_solutions.unit_rank_3 as unit_rank_3', 'tot_solutions.unit_trans_3 as unit_trans_3', 'tot_solutions.unit_id_4 as unit_id_4', 'tot_solutions.unit_rank_4 as unit_rank_4', 'tot_solutions.unit_trans_4 as unit_trans_4', 'tot_solutions.unit_id_5 as unit_id_5', 'tot_solutions.unit_rank_5 as unit_rank_5', 'tot_solutions.unit_trans_5 as unit_trans_5', 'tot_solutions.unit_id_6 as unit_id_6', 'tot_solutions.unit_rank_6 as unit_rank_6', 'tot_solutions.unit_trans_6 as unit_trans_6', 'tot_solutions.unit_id_7 as unit_id_7', 'tot_solutions.unit_rank_7 as unit_rank_7', 'tot_solutions.unit_trans_7 as unit_trans_7', 'tot_solutions.unit_id_8 as unit_id_8', 'tot_solutions.unit_rank_8 as unit_rank_8', 'tot_solutions.unit_trans_8 as unit_trans_8', 'tot_solutions.unit_id_9 as unit_id_9', 'tot_solutions.unit_rank_9 as unit_rank_9', 'tot_solutions.unit_trans_9 as unit_trans_9', 'tot_solutions.unit_id_10 as unit_id_10', 'tot_solutions.unit_rank_10 as unit_rank_10', 'tot_solutions.unit_trans_10 as unit_trans_10', 'tot_solutions.unit_id_11 as unit_id_11', 'tot_solutions.unit_rank_11 as unit_rank_11', 'tot_solutions.unit_trans_11 as unit_trans_11', 'tot_solutions.unit_id_12 as unit_id_12', 'tot_solutions.unit_rank_12 as unit_rank_12', 'tot_solutions.unit_trans_12 as unit_trans_12') ->get(); } else { return DB::table('tot_solutions') ->where('tot_solutions.id', '=', $solutionID) ->select( 'tot_solutions.id as sid', 'tot_solutions.tot_round as round', 'tot_solutions.floor as floor', 'tot_solutions.karma as karma', 'tot_solutions.maxrank as maxrank', 'tot_solutions.maxevol as maxevol', 'tot_solutions.gamespeed as gamespeed', 'tot_solutions.karma_multiplier as karmamultiplier', 'tot_solutions.note as note', 'tot_solutions.luck as luck', 'tot_solutions.unit_id_1 as unit_id_1', 'tot_solutions.unit_rank_1 as unit_rank_1', 'tot_solutions.unit_trans_1 as unit_trans_1', 'tot_solutions.unit_id_2 as unit_id_2', 'tot_solutions.unit_rank_2 as unit_rank_2', 'tot_solutions.unit_trans_2 as unit_trans_2', 'tot_solutions.unit_id_3 as unit_id_3', 'tot_solutions.unit_rank_3 as unit_rank_3', 'tot_solutions.unit_trans_3 as unit_trans_3', 'tot_solutions.unit_id_4 as unit_id_4', 'tot_solutions.unit_rank_4 as unit_rank_4', 'tot_solutions.unit_trans_4 as unit_trans_4', 'tot_solutions.unit_id_5 as unit_id_5', 'tot_solutions.unit_rank_5 as unit_rank_5', 'tot_solutions.unit_trans_5 as unit_trans_5', 'tot_solutions.unit_id_6 as unit_id_6', 'tot_solutions.unit_rank_6 as unit_rank_6', 'tot_solutions.unit_trans_6 as unit_trans_6', 'tot_solutions.unit_id_7 as unit_id_7', 'tot_solutions.unit_rank_7 as unit_rank_7', 'tot_solutions.unit_trans_7 as unit_trans_7', 'tot_solutions.unit_id_8 as unit_id_8', 'tot_solutions.unit_rank_8 as unit_rank_8', 'tot_solutions.unit_trans_8 as unit_trans_8', 'tot_solutions.unit_id_9 as unit_id_9', 'tot_solutions.unit_rank_9 as unit_rank_9', 'tot_solutions.unit_trans_9 as unit_trans_9', 'tot_solutions.unit_id_10 as unit_id_10', 'tot_solutions.unit_rank_10 as unit_rank_10', 'tot_solutions.unit_trans_10 as unit_trans_10', 'tot_solutions.unit_id_11 as unit_id_11', 'tot_solutions.unit_rank_11 as unit_rank_11', 'tot_solutions.unit_trans_11 as unit_trans_11', 'tot_solutions.unit_id_12 as unit_id_12', 'tot_solutions.unit_rank_12 as unit_rank_12', 'tot_solutions.unit_trans_12 as unit_trans_12') ->get(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public static function getTable();", "public function getTable();", "abstract p...
[ "0.7656943", "0.7656943", "0.7656943", "0.7656943", "0.7656943", "0.7656943", "0.7656943", "0.76175916", "0.7588525", "0.7576536", "0.7576536", "0.75048167", "0.7482423", "0.745733", "0.72283065", "0.72283065", "0.72283065", "0.72283065", "0.72283065", "0.72283065", "0.722581...
0.0
-1
Gets the directory of the cached language files.
public function getCachePath() { return $this->config->get('system.paths.root') . '/cache/' . $this->application . '/'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCacheDir();", "public function getCacheDir(){\r\n return $this->_cache->getDir();\r\n }", "public static function getCacheDir()\n {\n return self::getRoot() . DIRECTORY_SEPARATOR . 'cache';\n }", "public function get_cache_directory() {\n\t\treturn $this->cache_direc...
[ "0.7584097", "0.7578814", "0.75418574", "0.75357175", "0.74441427", "0.7383058", "0.736162", "0.7339005", "0.7337674", "0.7337674", "0.72196597", "0.71986824", "0.71529955", "0.71529955", "0.71529955", "0.71529955", "0.71404564", "0.7109667", "0.7105962", "0.7099625", "0.7099...
0.64789724
47
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, idcompte_id INT DEFAULT NULL, idpartenaire_id INT DEFAULT NULL, username VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, nomcomplet VARCHAR(255) DEFAULT NULL, mail VARCHAR(255) DEFAULT NULL, tel INT DEFAULT NULL, adresse VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649F85E0677 (username), INDEX IDX_8D93D6498CDECFD5 (idcompte_id), INDEX IDX_8D93D649E1440477 (idpartenaire_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6498CDECFD5 FOREIGN KEY (idcompte_id) REFERENCES compte (id)'); $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649E1440477 FOREIGN KEY (idpartenaire_id) REFERENCES partenaire (id)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNE...
[ "0.80068773", "0.7915595", "0.7915595", "0.7915595", "0.7571971", "0.75615484", "0.75282776", "0.7498739", "0.7494303", "0.7453733", "0.7446836", "0.7435016", "0.7432123", "0.7427742", "0.7418007", "0.7378834", "0.73757184", "0.7369987", "0.7364234", "0.7352615", "0.732967", ...
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('DROP TABLE user'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo'...
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.705336...
0.0
-1
Storage::put('resp' . time() . ".json", json_encode($request>all()));
public function comerce_alignet(Request $request){ if($request->has('authorizationResult')){ //Obteniendo la autorización de payme $authorizationResult = $request->input('authorizationResult'); $purchaseOperationNumber = $request->input('purchaseOperationNumber'); //Obteniendo la orden de acuerdo a la respuesta de payme $order = Order::where('order_code', $purchaseOperationNumber)->first(); // Validacion de respuesta de payme // solo si el pago es autorizado se descuenta del inventario y se envía a urbaner if($authorizationResult === "00"){ // Se actualiza la orden de compra de acuerdo de acuerdo a si ha elegido // delivery o no: if($order->delivery){ //P: Pending, A: Atended, R: Rejected payment, D: Delivery pendiente $order->update([ 'status' => 'D' ]); //Ademas se genera la orden en urbaner $this->storeUrbaner($order); }else{ $order->update(['status' => 'A']); } //Actualizando el inventario de acuerdo a la compra $this->inventory($order); }else{ // Se actualiza la orden de compra de acuerdo como rechazado: //P: Pending, A: Atended, R: Rejected payment, D: Delivary pendiente $order->update(['status' => 'R']); } }; return redirect()->away('https://regalalo.pe/mi-cuenta'); //return redirect()->away('http://localhost:4200/#/mis-pedidos'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function store2(Request $request) {\n try {\n// $contactInfo = Storage::disk('local')->exists('worker3.json') ? json_decode(Storage::disk('local')->get('worker2.json')) : [];\n\n $inputData = $request->only(['Surname','Name','middle_name', 'Date_of_Birth', 'Date_of_employment', 'Depart...
[ "0.6544804", "0.64019334", "0.6350454", "0.62621284", "0.6202401", "0.61408293", "0.61088866", "0.60955644", "0.6031211", "0.6006816", "0.5990465", "0.5956704", "0.5949043", "0.593869", "0.59053564", "0.5893386", "0.5874495", "0.585347", "0.58423173", "0.58249867", "0.580529"...
0.0
-1
Se obtiene la orden
public function inventory($order){ $order = Order::find($order->id); // Se obtiene el detalle de la orden $order_details = OrderDetail::where('order_id', $order->id)->get(); foreach ($order_details as $od){ $store_branche_id = $od['store_branche_id']; //Inventario $inventory = Inventory::where('product_id', $od['product_id'])->where('store_branche_id', $store_branche_id)->first(); if(isset($inventory)){ // Se realiza el movimiento del inventario de tipo E: Egreso $inventory->update([ 'quantity' => $inventory->quantity - $od['quantity'] ]); InventoryMovement::create([ 'inventory_id' => $inventory->id, 'quantity' => $od['quantity'], 'order_id'=>$order->id, 'movement_type' => 'E' ]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLly() {}", "public function luas()\n {\n return $this->panjang * $this->lebar;\n }", "public function getLlx() {}", "public function getLr() {}", "public function getLargura() \r\n\t{\r\n\t\treturn $this->iLargura;\r\n\t}", "public function getLoueur()\n {\n return $this->lou...
[ "0.70584977", "0.6799759", "0.66674876", "0.65859014", "0.6303838", "0.6224364", "0.6123918", "0.6108865", "0.6108251", "0.6076893", "0.60157454", "0.59949976", "0.5954993", "0.5917703", "0.587068", "0.58685327", "0.5843283", "0.58107716", "0.5809636", "0.57901084", "0.578486...
0.0
-1
return the next set of contacts by $itemsPerPage, for future use,
public function next() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function next()\n\t{\n\t\t$pageSize = count($this->_items);\n\t\t$this->_currentIndex++;\n\t\tif ($this->_currentIndex >= $pageSize) {\n\t\t\t$this->_currentPage++;\n\t\t\t$this->_currentIndex = 0;\n\t\t\t$this->loadPage();\n\t\t}\n\t}", "public function next() { \n\t\t$page = &$this->touchPage();\n\t\t\n...
[ "0.6447019", "0.6165999", "0.6069213", "0.5972772", "0.5972772", "0.5942072", "0.5941028", "0.58595896", "0.58533543", "0.58404076", "0.5720718", "0.5639684", "0.5639684", "0.563794", "0.56269395", "0.5618918", "0.55945945", "0.55749404", "0.5572973", "0.556496", "0.5564537",...
0.0
-1
rewind contacts list for future use,
public function rewind() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rewind() \n {\n $this->pointer = 0;\n if (isset($this->list[$this->pointer])) {\n $this->list[$this->pointer]->rewind();\n }\n }", "public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }", "public function rewind(...
[ "0.6595111", "0.6321478", "0.62825406", "0.62531686", "0.62267566", "0.62111324", "0.61774343", "0.61423457", "0.61423457", "0.61423457", "0.61423457", "0.61423457", "0.6131504", "0.6125211", "0.60776234", "0.606666", "0.6064103", "0.60563153", "0.6055142", "0.6054624", "0.60...
0.5757162
92
find a contact entry by value, or type for future use,
public function seek() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($value);", "protected function getBy($value, $type) {\n $where = \"\";\n if ($type == \"id\") {\n $where = \"id=\".mysql_real_escape_string($value);\n } else if ($type == \"name\") {\n $where = \"name='\".mysql_real_escape_string($value).\"'\";\n } else {\n throw n...
[ "0.6344577", "0.6271604", "0.61662763", "0.6123416", "0.6027116", "0.6005967", "0.59505665", "0.584844", "0.58307195", "0.57981235", "0.57743216", "0.5691926", "0.56903946", "0.5676146", "0.5648724", "0.5599962", "0.5534691", "0.5529129", "0.545164", "0.5445219", "0.54136765"...
0.0
-1
Run the database seeds.
public function run() { if(DB::table('agents')->count() == 0) { DB::table('agents')->insert([ 'nom' =>'Lekhal', 'prenom' => 'Maha', 'sexe'=>'Femme', 'user_id' => 1, 'poste_id' =>1, 'updated_at'=>now(), 'created_at' => now() ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { /* AQUI PODRIA REALIZAR ALGÚN TIPO DE VALIDACIÓN INDICANDO SI EL USUARIO TIENE PERMISOS PARA CREAR EL RECURSO, EN ESTE CASO SOLO DEVUELVO EL true PARA INDICAR QUE CUALQUIER USUARIO PUEDE CREAR EL RECURSO */ 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.8399528", "0.83755803", "0.83755803", "0.8342532", "0.8252005", "0.8246491", "0.82114965", "0.81451535", "0.81095713", "0.80819905", "0.799094", "0.79885143", "0.79823685", "0.7959513", "0.7950321", "0.7947592", "0.7925319", "0.7914417", "0.7899287", "0.7892423", "0.788904...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'nombre' => [ 'required', 'min:3', Rule::unique('projects')->ignore( $this->route('project') ), /* OBTENEMOS EL PARAMETRO QUE VENGA POR LA RUTA => $this->route('project') AHORA CON Rule::unique('projects')->ignore( $this->route('project') ), LE INDICAMOS QUE EL CAMPO nombre SEA UNICO EN LA TABLA projects E IGNORE EL PARAMETRO project QUE VIENE EN LA RUTA, DE ESTA MANERA PODREMOS EDITAR LOS PROYECTOS, SINO CUANDO INTENTAMOS EDITARLO PRIMERO VA A BUSCAR EL nombre DEL PROYECTO EN LA BD Y AL ENCONTRARLO FALLA LA VALIDACIÓN */ ], 'descripcion' => 'required | min:3', 'imagen' => [ $this->route('project') ? 'nullable' : 'required', 'image', 'max: 3072', ], 'category_id' => [ 'required', 'exists:categories,id' ] ]; }
{ "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
Sets up the fixture.
protected function setUp() { $this->optionnalfunctions = array( // requires GeoIP C library 1.4.1 or higher (LIBGEOIP_VERSION >= 1004001) 'geoip_region_name_by_code', 'geoip_time_zone_by_country_and_region', ); $this->obj = new PHP_CompatInfo_Reference_Geoip(); parent::setUp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "protected function setUp()\n {\n $...
[ "0.8140308", "0.8006241", "0.79976183", "0.7914992", "0.7901477", "0.77689713", "0.77392364", "0.77336216", "0.7709618", "0.76846695", "0.7647927", "0.7634279", "0.76297987", "0.7579202", "0.75754756", "0.7495979", "0.7492454", "0.74913603", "0.74681956", "0.7462114", "0.7426...
0.0
-1
Get list of available customer statuses.
public static function get_statuses() { return array( self::GUEST, self::REGISTERED ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function olc_get_customers_statuses() {\n\n\t$customers_statuses_array = array(array());\n\t$customers_statuses_query = olc_db_query(SELECT.\"customers_status_id, customers_status_name, customers_status_image, customers_status_discount, customers_status_ot_discount_flag, customers_status_ot_discount\".SQL_FROM . T...
[ "0.7253332", "0.7113479", "0.695418", "0.68196774", "0.6815233", "0.68058485", "0.67916125", "0.6786866", "0.6745262", "0.6676654", "0.6613647", "0.6585561", "0.6584525", "0.65843743", "0.6572991", "0.6527908", "0.6501117", "0.65009654", "0.6418798", "0.6392413", "0.6391962",...
0.6517766
16
Run the database seeds.
public function run() { \Illuminate\Support\Facades\DB::table('step_customs')->insert([ [ 'id' => 1, 'step' => 'Pilih Model Product', 'description' => 'Memilih barang sesuai dan sesuai kebutuhan, klien dapat memilih model pada halaman product' ], [ 'id' => 2, 'step' => 'Menetukan Bahan', 'description' => 'Klien dapat memilih bahan yang sudah kami sediakan' ], [ 'id' => 3, 'step' => 'Menentukan Warna dan Ukuran', 'description' => 'Klien dapat memilih warna yang disukai dan menentukan ukuran (panjang, lebar dan tinggi) yang sesuai dengan kebutuhan' ], [ 'id' => 4, 'step' => 'Melakukan Pembayaran', 'description' => 'Setelah rancangan product sudah fix dan akan dibuat klien diharapkan dapat melakukan pembayaran tanda jadi minimal 10% dari total pembelian atau melakukan pembayaran secara lunas' ], [ 'id' => 5, 'step' => 'Proses Pembuatan', 'description' => 'Lama pembuatan tergantung dengan kesulitan product, kami akan berusaha menyelesaikan secara tepat waktu' ], ]); }
{ "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
///////// Accessors ///////// Service title.
public function title() { if ($this->contributor_service && $this->contributor_service->title) { return $this->contributor_service->title; } return $this->service->title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServiceTitle() {}", "public function get_title()\n {\n }", "public function get_title()\n {\n }", "public function get_title() {\n return __( 'APR Heading', 'apr-core' );\n }", "function title() {\n ?>\n <h2><?php _e(SCLNG_PUBLIC_PRODUC...
[ "0.89144415", "0.70879215", "0.7087731", "0.70124865", "0.699948", "0.6954333", "0.6936192", "0.69320995", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.6925719", "0.692495", ...
0.7713792
1
Service value. Normally, you want to access the generates url via `profileUrl()`. But in case you need the raw user value, use this method.
public function rawValue() { return $this->contributor_service->value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserProfile();", "public function getProfile()\n {\n return $this->request('me');\n }", "public function getRaw()\n {\n return $this->user;\n }", "public function getProfileUrl()\n {\n return $this->ProfileUrl;\n }", "public function getUserInfo() {...
[ "0.6902523", "0.67335105", "0.67124563", "0.66355187", "0.6563103", "0.65522206", "0.65254587", "0.6507147", "0.6505256", "0.64854777", "0.64544195", "0.64541334", "0.6440334", "0.6440334", "0.64151603", "0.64151603", "0.64151603", "0.6413908", "0.64014894", "0.63982624", "0....
0.6148427
100
/ set the current block to work with and later display $block = name $file = template file to use
public function block($block, $file = NULL) { if ($file == NULL) { $file = $this->last_file; } else if (!isset($this->files[$file])) { $this->load($file); } // assign this block a number // block number is used rather than the block name as we could be looping through the same block multiple times (and don't want each block to have the same content) $this->block++; $pattern = '#\[block:\s*(' . $block . ')\](.*)\[/block:\s*(' . $block . ')\]#is'; // find the content of the wanted block from the selected template file if(preg_match($pattern, $this->files[$file], $matches)) { // put the blocks info into the merged array with the block number $this->merged[$this->block] = $matches[2]; } else { $this->core->message("Error cannot find block named ($block).", 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function page_render_block($block) {\n static $xtpl_block;\n \n if (!$xtpl_block) $xtpl_block = new XTemplate('html/block.xtpl');\n \n $xtpl_block->reset('block');\n $xtpl_block->assign('id', $block['id']);\n $xtpl_block->assign('title', $block['title']);\n $xtpl_block->assign('content', $b...
[ "0.66600776", "0.6646311", "0.6606878", "0.6513419", "0.6511392", "0.648636", "0.6381592", "0.63603836", "0.6325136", "0.62895364", "0.62880576", "0.62793726", "0.622952", "0.619124", "0.6180748", "0.61159074", "0.6114453", "0.61027765", "0.60709274", "0.6066687", "0.6059808"...
0.68324
0
for just grabbing the html from the block, if you want to do something with it manually
public function block_store($block, $file = NULL) { if ($file == NULL) { $file = $this->last_file; } $pattern = '#\[block:\s*(' . $block . ')\](.*)\[/block:\s*(' . $block . ')\]#is'; // find the content of the wanted block from the selected template file if(preg_match($pattern, $this->files[$file], $matches)) { // put the blocks info into the merged array with the block number return $matches[2]; } else { $this->core->message("Error cannot find block named ($block).", 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_the_block_template_html()\n {\n }", "public abstract function get_html();", "function html($block = null)\n{\n\tob_start();\n\t$this->out($block);\n\t$html_code = ob_get_contents();\n\tob_end_clean();\n\treturn $html_code;\n}", "abstract function get_html();", "function &getHTML()\n\t{\n...
[ "0.7350545", "0.700995", "0.69705546", "0.67781454", "0.6686921", "0.6643718", "0.6629122", "0.65319055", "0.65060735", "0.64481056", "0.64399266", "0.64157", "0.6395986", "0.6367833", "0.63388354", "0.6268542", "0.6224061", "0.6219723", "0.6189276", "0.6181615", "0.6144927",...
0.0
-1
replacing tags inside a previously stored block_store
public function store_replace($text, $replace) { foreach ($replace as $name => $replace) { $find = "{:$name}"; $text = str_replace($find, $replace, $text); } return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function do_tags()\n\t{\n\t\tforeach ($this->values as $id => $block)\n\t\t{\n\t\t\tforeach ($block as $name => $replace)\n\t\t\t{\n\t\t\t\t$find = \"{:$name}\";\n\t\t\t\t$this->merged[$id] = str_replace($find, $replace, $this->merged[$id]);\n\t\t\t}\n\t\t}\n\n\t}", "public function replaceBlockDocumentEl...
[ "0.6830857", "0.58027816", "0.5635936", "0.55946606", "0.5524076", "0.55216116", "0.5509295", "0.5498454", "0.5497168", "0.5466859", "0.54468375", "0.53790313", "0.532858", "0.5231076", "0.51707333", "0.5168664", "0.5119124", "0.51177675", "0.5094164", "0.50585663", "0.504500...
0.0
-1
set a value for a tag to be replaced in the current block
public function set($key, $value) { $this->values[$this->block][$key] = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function set($tag, $content) {\n $this->template = str_replace(\"{\".$tag.\"}\", $content, $this->template);\n }", "public function do_tags()\n\t{\n\t\tforeach ($this->values as $id => $block)\n\t\t{\n\t\t\tforeach ($block as $name => $replace)\n\t\t\t{\n\t\t\t\t$find = \"{:$name}\";\n\t\t...
[ "0.68924546", "0.6356426", "0.6339238", "0.62259376", "0.6071217", "0.58956695", "0.5879631", "0.58601874", "0.5844479", "0.5828853", "0.58074003", "0.5807256", "0.5806264", "0.5806264", "0.5806264", "0.58049244", "0.5741832", "0.57028514", "0.56681925", "0.56602544", "0.5638...
0.5221963
71
set multiple values to be replaced
public function set_many($replaces) { foreach ($replaces as $key => $value) { $this->values[$this->block][$key] = $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setValues($values = []);", "public function setValues($values);", "public function replace(array $values = []): void\n {\n\t\t$this->values = $values;\n\t}", "public function assignValues($values=[]) {\n }", "public function setValues($values)\n {\n foreach ($this->entities ...
[ "0.67728907", "0.6759351", "0.6603161", "0.64762175", "0.64360225", "0.63805115", "0.6378056", "0.6340752", "0.63164806", "0.62891155", "0.62593466", "0.6239974", "0.6231123", "0.62022156", "0.6181872", "0.6173142", "0.61052203", "0.6094056", "0.60896146", "0.6050574", "0.602...
0.7323282
0
set a value for a tag to be replaced in a previous block
public function set_previous($key, $value, $block) { $this->values[$block][$key] = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function do_tags()\n\t{\n\t\tforeach ($this->values as $id => $block)\n\t\t{\n\t\t\tforeach ($block as $name => $replace)\n\t\t\t{\n\t\t\t\t$find = \"{:$name}\";\n\t\t\t\t$this->merged[$id] = str_replace($find, $replace, $this->merged[$id]);\n\t\t\t}\n\t\t}\n\n\t}", "final public function set($tag, $conte...
[ "0.61412036", "0.5996937", "0.5676182", "0.56265295", "0.5549422", "0.5512288", "0.5409513", "0.5337536", "0.5284421", "0.5208788", "0.52064407", "0.5153565", "0.51341105", "0.51091635", "0.5107955", "0.5096476", "0.50904113", "0.50887656", "0.50887656", "0.50887656", "0.5088...
0.55401796
5
this will replace the tags in the current block
public function do_tags() { foreach ($this->values as $id => $block) { foreach ($block as $name => $replace) { $find = "{:$name}"; $this->merged[$id] = str_replace($find, $replace, $this->merged[$id]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function replaceBlockDocumentElements($content){\n\t\t//regular expression indiicating what a document block looks like\n\t\t$document_block_string = \"/\\{arch:document\\}(.*?)\\{\\/arch:document\\}/s\";\n\t\t\n\t\t//array to hold blocks that need to be replaced\n\t\t$document_array = array();\n\t\t\n\t\t/...
[ "0.645628", "0.6428538", "0.62610906", "0.6064476", "0.5979072", "0.5914047", "0.5882833", "0.5852715", "0.57815", "0.57423013", "0.57420915", "0.5726671", "0.5646644", "0.5646053", "0.56335765", "0.56334096", "0.5617191", "0.56067884", "0.559265", "0.5555665", "0.5551675", ...
0.7523821
0
everything else is done, so show us the page
public function output() { $this->do_tags(); $this->final_output = ''; foreach ($this->merged as $block) { $this->final_output .= $block; } $this->last_file = ''; $this->values = array(); $this->files = array(); $this->merged = array(); // the final template all put together return $this->final_output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ee_breakouts_page_load() {}", "function main()\n {\n $this->page_id = 113;\n $this->get_text();\n $this->body .= \"<table cellpadding=5 cellspacing=1 border=0 width=\\\"100%\\\">\\n\";\n if (strlen(trim($this->messages[500021])) > 0) {\n $this->body .= \"...
[ "0.71206367", "0.6839401", "0.68206185", "0.68094", "0.67677134", "0.66736937", "0.6665796", "0.6625356", "0.661213", "0.661207", "0.65895486", "0.6574805", "0.6567629", "0.656572", "0.65394986", "0.6520486", "0.6504462", "0.6469387", "0.6449979", "0.6443561", "0.64235324", ...
0.0
-1
/ Get inscripcion_materia by id
function get_inscripcion_materia($id) { return $this->db->get_where('inscripcion_materia',array('id'=>$id))->row_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_materia($materia_id)\n {\n $materia = $this->db->query(\"\n SELECT\n *\n\n FROM\n `materia`\n\n WHERE\n `materia_id` = ?\n \",array($materia_id))->row_array();\n\n return $materia;\n }", "public ...
[ "0.7759912", "0.70723164", "0.6887433", "0.6764801", "0.67504174", "0.66065264", "0.6471261", "0.64213836", "0.6419327", "0.64173734", "0.640201", "0.63936853", "0.6374128", "0.63737464", "0.63533664", "0.6288632", "0.62690294", "0.626051", "0.6246982", "0.6238707", "0.618833...
0.85556287
0
/ Get all inscripcion_materia
function get_all_inscripcion_materia($where = array()) { $this->db->order_by('id', 'desc'); if(isset($where) && !empty($where)) { $this->db->where($where['row'], $where['value']); } return $this->db->get('inscripcion_materia')->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_all_materia()\n {\n $materia = $this->db->query(\"\n SELECT\n m.*, a.*, n.*, e.*, t.materia_nombre as 'requisito', pa.carrera_id, ca.carrera_nombre\n\n FROM\n materia m\n LEFT JOIN area_materia a ON m.area_id=a.area_id\n ...
[ "0.7839121", "0.76870126", "0.7656564", "0.73006904", "0.72118795", "0.7060298", "0.69762385", "0.6856569", "0.6846783", "0.6801343", "0.6721525", "0.66849434", "0.667229", "0.6524922", "0.65207636", "0.6433648", "0.6423848", "0.638597", "0.6350774", "0.63171893", "0.6277354"...
0.6987783
6
funcion comprobar si una persona ya esta registrada en un curso
public function check_inscripcion($id_persona,$id_curso){ return $this->db->get_where('inscripcion_materia',array('id_persona'=>$id_persona,'id_curso'=>$id_curso))->row_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n ...
[ "0.67057556", "0.66372776", "0.64720047", "0.6411881", "0.63014436", "0.6282712", "0.624605", "0.6223444", "0.62157756", "0.61793464", "0.6137691", "0.61083454", "0.6105603", "0.61025655", "0.6067474", "0.6047072", "0.6042757", "0.59967166", "0.59879535", "0.5975312", "0.5973...
0.0
-1
comprobar estado de aprobacion de una materia equivalente sea distinto de 1(desaprobado) o 4(libre)
public function check_estado($id_persona,$id_materia){ $this->db->where(array('id_persona'=>$id_persona,'id_materia'=>$id_materia)); $this->db->where_not_in('inscripcion_materia.id_estado_final',array(1,4)); return $this->db->get('inscripcion_materia')->row_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promedio_general($vector){ \n $promedio=0;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n $promedio=$promedio+$n;\n }\n }\n return ($promedio/10);\n ...
[ "0.64066863", "0.6341018", "0.6146967", "0.6099634", "0.6065809", "0.6024595", "0.5991373", "0.590928", "0.5864849", "0.5855896", "0.57625264", "0.5716372", "0.5714763", "0.56612647", "0.56468326", "0.563365", "0.56256473", "0.5603025", "0.55947447", "0.5593635", "0.5575605",...
0.0
-1
/ function to add new inscripcion_materia
function add_inscripcion_materia($params) { $this->db->insert('inscripcion_materia',$params); return $this->db->insert_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addmateria(materia $object)\n {\n $this->materias[] = $object;\n }", "function add_materia($params)\n {\n $this->db->insert('materia',$params);\n return $this->db->insert_id();\n }", "function delete_inscripcion_materia($id)\r\n {\r\n return $this->db->delet...
[ "0.6804768", "0.6535714", "0.61981285", "0.61285955", "0.6113647", "0.6075961", "0.59873056", "0.59225047", "0.5922358", "0.5894869", "0.58535343", "0.5846425", "0.58097756", "0.57601804", "0.57496643", "0.5739368", "0.5729696", "0.57204163", "0.56664705", "0.5662113", "0.565...
0.72243047
0
/ function to update inscripcion_materia
function update_inscripcion_materia($id,$params) { $this->db->where('id',$id); return $this->db->update('inscripcion_materia',$params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_materia($materia_id,$params)\n {\n $this->db->where('materia_id',$materia_id);\n return $this->db->update('materia',$params);\n }", "function modificar_material($id_material,$titulo,$descripcion,$objetivos,$estado,$autores,$ac,$dirigido,$edad,$nivel,$saa,$tipo,$archivos,$id_li...
[ "0.64743924", "0.63942826", "0.62906104", "0.61918455", "0.6173816", "0.61702365", "0.61407834", "0.6055277", "0.60484153", "0.589866", "0.5897071", "0.5888249", "0.5888249", "0.58809376", "0.5860471", "0.5855349", "0.5839724", "0.5834041", "0.5831495", "0.58230895", "0.58229...
0.7046177
0
/ function to delete inscripcion_materia
function delete_inscripcion_materia($id) { return $this->db->delete('inscripcion_materia',array('id'=>$id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($id_materi);", "function delete_materia($materia_id)\n {\n return $this->db->delete('materia',array('materia_id'=>$materia_id));\n }", "public function delete()\n {\n //recuperation des informations pour la suppression d'une matière\n $data = $this->request-...
[ "0.79497266", "0.7891689", "0.6674915", "0.662337", "0.660278", "0.6595085", "0.65855104", "0.65684426", "0.6567179", "0.6505929", "0.6486011", "0.64351887", "0.6427628", "0.6361658", "0.63563305", "0.63341814", "0.6287984", "0.6270539", "0.62647367", "0.62555665", "0.6245771...
0.84023994
0
Create a new notification instance.
public function __construct(User $user) { $this->user = $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function create($notification){\n }", "public static function createNotification($type, $eventid){\n\t\t$notification = new Notification; \n\t\t$notification->type = $type;\n\t\t$notification->eventid = $eventid;\n\t\t$notification->time = date('Y-m-d H:i:s');\n\t\t$notification->save();\n\t\tretu...
[ "0.8276063", "0.72309536", "0.7192113", "0.71250874", "0.7123231", "0.70414555", "0.6982398", "0.6982398", "0.6982398", "0.69165224", "0.6844303", "0.68205667", "0.6801263", "0.6776018", "0.6589725", "0.6531073", "0.6507233", "0.65047646", "0.6503655", "0.64437956", "0.641349...
0.0
-1
GET youtube connextion token
public function authAction() { $this->initialize(); $data = []; $auth = 'false'; $session = $this->getRequest()->getSession(); if ($this->getRequest()->query->get('code')) { if (strval($session->get('stateYoutube')) !== strval($this->getRequest()->query->get('state'))) { die('The session state did not match.'); } $this->client->authenticate(); $session->set('token', $this->client->getAccessToken()); $auth = 'true'; } if ($session->get('token')) { $this->client->setAccessToken($session->get('token')); } $data['auth'] = $auth; return $this->render('AppBundle:Auth:auth.html.twig', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function request_youtube()\n\t{\n\t\t$params['key'] = '966266008065-i8lk0ufp96bm2igtj6jkqe2572t70tqk.apps.googleusercontent.com';\n\t\t$params['secret'] = 'n9qwHyjmj60FzaQpa684M27J';\n\t\t$params['algorithm'] = 'HMAC-SHA1';\n\n\t\t$this->load->library('google_oauth', $params);\n\n\t\t$data = $this->google_o...
[ "0.73276144", "0.72123617", "0.7125275", "0.6708698", "0.62931", "0.6187048", "0.6154468", "0.6154468", "0.6154468", "0.6154468", "0.6154468", "0.6112395", "0.60963297", "0.6087875", "0.6071108", "0.6071108", "0.6071108", "0.6071108", "0.60686994", "0.60534143", "0.6045341", ...
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { // Check if the user doesn't have permission to manage users if(!Auth::user()->mainRole || !Auth::user()->mainRole->hasPermission('MANAGE_USERS')) { // Check if it's edit/update rote if(in_array($request->route()->getName(), ['users.edit', 'users.update'])) { // Check if the user is not himself if($request->route('user')->id != Auth::user()->id && !Auth::user()->hasEditUserPermission($request->route('user'))) { return redirect('403'); } } else if($request->route()->getName() == 'users.index') { return redirect('/'); } else { return redirect('403'); } } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $...
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", ...
0.0
-1
========================================================================= CONVENIENCE METHODS =========================================================================
public function fetchOneForEmail($email) { return $this->fetchOneWhere([$this->columnPrefix.'email = ?'=>$email]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConsonants()\n {\n return $this->consonants;\n }", "public function getCadence(){\n return $this->cadence;\n }", "public function ccm();", "public function __construct()\n {\n //$this->contrats = new ArrayCollection();\n }", "function getConsiglio() {\...
[ "0.5212313", "0.51538074", "0.5140774", "0.5092781", "0.49757892", "0.49642593", "0.49073163", "0.48837242", "0.48649162", "0.4851331", "0.48455772", "0.4830343", "0.48066553", "0.47854424", "0.4778706", "0.47590163", "0.47468963", "0.4746035", "0.47437486", "0.46978176", "0....
0.0
-1
========================================================================= OVERRIDES ========================================================================= Fetch all members in alphabetical order by email
public function fetchAll(SelectOptions $selectOptions=null) { if (!$selectOptions) $selectOptions = new SelectOptions; if (!$selectOptions->order) $selectOptions->order = ["{$this->columnPrefix}email"]; return parent::fetchAll($selectOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function sortByEmail(){\n \n $db = Db::getConnection();\n \n $result = $db->query('SELECT * FROM task ORDER BY user_email ASC');\n\n return $result->fetchAll();\n }", "function getMembers()\r\n {\r\n // define the query\r\n $sql = \"SELECT * FR...
[ "0.6982297", "0.6784908", "0.6771729", "0.67627305", "0.66539663", "0.66304535", "0.6611295", "0.6608954", "0.6534582", "0.6517538", "0.64622706", "0.64320946", "0.6405431", "0.635035", "0.62861454", "0.62181765", "0.6167801", "0.6157976", "0.6145509", "0.6107058", "0.6099372...
0.0
-1
Test case for making sure that XML_RSS extends from XML_Parser
function testIsXML_Parser() { $rss = new XML_RSS(); $this->assertTrue(is_a($rss, "XML_Parser")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function html_type_rss()\n {\n }", "function testBug2310() {\n $rss = new XML_RSS(\"\", null, \"utf-8\");\n $this->assertEquals($rss->tgtenc, \"utf-8\");\n\n $rss = new XML_RSS(\"\", \"utf-8\", \"iso-8859-1\");\n $this->assertEquals($rss->srcenc, \"utf-8\");\n $this->asse...
[ "0.6420601", "0.6220844", "0.61872935", "0.61256105", "0.6060497", "0.6049352", "0.6001759", "0.5883809", "0.5866639", "0.58597237", "0.5825549", "0.5824453", "0.581698", "0.5805962", "0.57808346", "0.5771245", "0.5729607", "0.5678873", "0.5668966", "0.56379014", "0.56379014"...
0.79881847
0
Test case for bug report 2310
function testBug2310() { $rss = new XML_RSS("", null, "utf-8"); $this->assertEquals($rss->tgtenc, "utf-8"); $rss = new XML_RSS("", "utf-8", "iso-8859-1"); $this->assertEquals($rss->srcenc, "utf-8"); $this->assertEquals($rss->tgtenc, "iso-8859-1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetChangeIssue()\n {\n }", "protected function test9() {\n\n }", "protected function checkLibXmlBug() {}", "public function test_getDuplicateLegacyLowstockContactById() {\n\n }", "public function testGetDuplicateLowStockById()\n {\n }", "function testBugChtchevaev_2004...
[ "0.6320209", "0.6147688", "0.6138536", "0.5983101", "0.59670955", "0.59246254", "0.5922855", "0.5902898", "0.5865248", "0.5864416", "0.5864416", "0.5822002", "0.5811491", "0.5806199", "0.57453465", "0.57328105", "0.57249814", "0.5711694", "0.5689587", "0.56759876", "0.5659309...
0.0
-1
return parent::getPontecia(); // Utilizar Alt + Insert (ATALHO)
public function getPotencia() { return 2.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AggiornaPrezzi(){\n\t}", "public function inserir()\n {\n }", "public function savePoblacion(){\n \n $data_insert = [\n 'poblacion' =>$this->_poblacion,\n'provincia' =>$this->_provincia,\n'ccaa' =>$this->_ccaa,\n'cod_provincia' =>$this->_cod_provincia,\n'cod_ccaa...
[ "0.697765", "0.6804488", "0.6451328", "0.63967353", "0.63967353", "0.63643265", "0.63486356", "0.6347742", "0.63268846", "0.6320466", "0.63088053", "0.63052624", "0.62994665", "0.62679034", "0.62594575", "0.6250404", "0.62358075", "0.62358075", "0.6205501", "0.61983085", "0.6...
0.0
-1
$ret["active_product_num"] = $this>product_service>get_num_rows(array("hscode_cat_id"=>$hs_cat_id, "status >0"=>null));
public function get_product_num($hs_cat_id) { // $ret["inactive_product_num"] = $this->product_service->get_num_rows(array("hscode_cat_id"=>$hs_cat_id, "status"=>0)); $ret["all_product_num"] = $this->product_service->get_num_rows(array("hscode_cat_id"=>$hs_cat_id)); echo json_encode($ret); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count_active_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 1');\n\t}", "function count_new_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 3');\n\t}", "function getProductCount($cat_id) {\n $ci = & get_instance();\n $query = $ci->db->...
[ "0.76401514", "0.73647857", "0.72429425", "0.70866895", "0.692201", "0.6771638", "0.66964895", "0.66814744", "0.6656777", "0.6651174", "0.65957224", "0.6460973", "0.64398265", "0.63841265", "0.63289696", "0.63180566", "0.6300397", "0.62822735", "0.6268286", "0.62536085", "0.6...
0.72548336
2
Default component settings. Supported types: subscribe, newsletter Supported themes: light, medium, dark
public function default_settings() : array { return [ 'layout' => 'block', 'newsletter' => '', 'theme' => 'light', 'type' => 'subscribe', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setChannelTemplates(){\n if ($this->channel == self::$WTSORDER_SOURCE_SITE_MOBILE){\n $this->defaultStepTemplates = $this->mobileDefaultStepTemplates;\n } elseif($this->customerIsPro()){\n $this->defaultStepTemplates = $this->proDefaultStepTemplates;\n } \n }", "function simpl...
[ "0.6433837", "0.60070544", "0.6003427", "0.5977585", "0.5955388", "0.5907726", "0.5903883", "0.58484674", "0.5843911", "0.58338296", "0.58061206", "0.57994074", "0.57885665", "0.5757142", "0.5728515", "0.57258457", "0.5705115", "0.5659023", "0.5658147", "0.5649024", "0.564381...
0.7264607
0
Render this component using the correct layout option.
public function render() { if ( false === (bool) $this->data( 'customize' ) ) { $type = $this->setting( 'type' ); $defaults = (array) $this->get_option( 'newsroom-settings', 'component_defaults', "{$type}_call_to_action", 'data' ); $this->set_data( $defaults ); } if ( 'sticky' === $this->setting( 'layout' ) ) { \ai_get_template_part( $this->get_component_path( 'sticky' ), [ 'component' => $this, 'stylesheet' => 'sticky-cta', ] ); } else { \ai_get_template_part( $this->get_component_path( $this->setting( 'type' ) ), [ 'component' => $this, 'stylesheet' => $this->slug, ] ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderLayout();", "public function renderLayout() {\n \t// See if we need to autoload the layout\n \tif (!is_null($this->getLayout())) {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t\t // Set the layout file\n \t\t ...
[ "0.7498908", "0.6944566", "0.64646375", "0.641364", "0.6401269", "0.62587255", "0.62550926", "0.6248393", "0.624445", "0.62413514", "0.6225673", "0.6212743", "0.62110597", "0.62056243", "0.61987007", "0.61987007", "0.61942035", "0.61909676", "0.61909676", "0.61871785", "0.618...
0.0
-1
Return an array of Call to Action type options.
public function get_type_options() : array { /** * Filters Call to Action type options. * * @param array Type options to be filtered. */ return apply_filters( 'cta_type_options', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound [ 'subscribe' => __( 'Subscribe', 'civil-first-fleet' ), 'newsletter' => __( 'Newsletter Sign up', 'civil-first-fleet' ), ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_action_options() {\n return array(\n 'c' => get_string('create', 'logstore_database'),\n 'r' => get_string('read', 'logstore_database'),\n 'u' => get_string('update', 'logstore_database'),\n 'd' => get_string('delete')\n );\n }...
[ "0.67643094", "0.6639785", "0.6434818", "0.62135303", "0.6212376", "0.6212376", "0.6212376", "0.6212376", "0.6212376", "0.6212376", "0.6212376", "0.618919", "0.61701673", "0.61453754", "0.61074096", "0.6103989", "0.6098876", "0.6053197", "0.6031527", "0.6031157", "0.60117716"...
0.7321445
0
Return an array of Mailchimp newsletter options.
public function get_newsletter_options() : array { $newsletters = []; $newsletter_lists = (array) $this->get_option( 'newsroom-settings', 'newsletter', 'mailchimp_lists', 'lists' ); // Loop through lists and build array. foreach ( $newsletter_lists as $list ) { $list = wp_parse_args( $list, [ 'id' => '', 'name' => '', ] ); // Validate both properties. if ( ! empty( $list['name'] ) && ! empty( $list['id'] ) ) { $newsletters[ sanitize_title( $list['name'] ) ] = $list['name']; } } return $newsletters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function mailchimpOptions()\n {\n if (!$this->mailchimpOptions) {\n return $this->defaultOptions();\n }\n\n return $this->mailchimpOptions;\n }", "public function get_newsletter_options_for_gutenberg() {\n\n\t\t// Format newsletters for Gutenberg.\n\t\t$newsletters...
[ "0.7125456", "0.70712036", "0.6891936", "0.6391974", "0.6320785", "0.6318037", "0.62442356", "0.6193153", "0.6085702", "0.6072265", "0.6070981", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.6006714", "0.6006714", "0.6006...
0.7950536
0
Output the newsletter options in a format that Gutenberg can use.
public function get_newsletter_options_for_gutenberg() { // Format newsletters for Gutenberg. $newsletters = []; foreach ( (array) $this->get_newsletter_options() as $value => $label ) { $newsletters[] = [ 'value' => $value, 'label' => $label, ]; } return $newsletters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function provide_newsletter_options() {\n\t\twp_add_inline_script(\n\t\t\t'civil-first-fleet-admin-js',\n\t\t\tsprintf(\n\t\t\t\t'var civilNewsletterOptions = %1$s;',\n\t\t\t\twp_json_encode( $this->get_newsletter_options_for_gutenberg() )\n\t\t\t)\n\t\t);\n\t}", "function printOptions()\n {\n $...
[ "0.71474123", "0.6460489", "0.6338348", "0.6305787", "0.6297103", "0.62280315", "0.62206423", "0.6188461", "0.61835426", "0.614262", "0.60508436", "0.6036295", "0.5974808", "0.595958", "0.5950906", "0.59402174", "0.59213674", "0.59019834", "0.58978254", "0.5890761", "0.582540...
0.63359267
3