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
A Dusk test .
public function test() { $data = [ 'name' => 'Test user', 'email' => 'user@example.com', 'password' => 'test123', ]; $this->browse(function (Browser $browser) use ($data) { $browser->visit('/') ->assertSee('ZAREJESTRUJ SIĘ') ->clickLink('Zarejestruj się') ->screenshot('1.Register_form') ->type('name', $data['name']) ->type('email', $data['email']) ->type('password', $data['password']) ->type('password_confirmation', $data['password']) ->screenshot('2.Register_form_filled') ->press('Zarejestruj się') ->screenshot('3.Registred') ->assertSee('Witaj, Test user!') ->clickLink($data['name']) ->clickLink('Wyloguj') ->screenshot('4.Logout') ->clickLink('Logowanie') ->type('email', $data['email']) ->type('password', $data['password']) ->press('Logowanie') ->screenshot('5.Logged') ->assertSee('Witaj, Test user!') ; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('SIGN IN')\n ->type('email', 'user@gmail.com')\n ->type('password', '123456')\n ->press('LOGIN')...
[ "0.73618716", "0.73263144", "0.7261532", "0.72321284", "0.7225523", "0.7146328", "0.71345335", "0.7109863", "0.70167536", "0.69687253", "0.6957556", "0.69375235", "0.6932138", "0.6921155", "0.69135004", "0.68969166", "0.68956774", "0.68483615", "0.6846954", "0.68465", "0.6786...
0.72459424
3
public $redis_db = 0;
public function __construct() { return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redis()\n {\n return $this->redis;\n }", "public function redis_instance()\n {\n return $this->redis;\n }", "function __construct()\n {\n try \n { \n \n $this->database = new Predis\\Client( [ \n \"scheme\" =>...
[ "0.7402313", "0.7281365", "0.70879704", "0.69890183", "0.69725066", "0.696806", "0.69229996", "0.6856602", "0.67668974", "0.676214", "0.670282", "0.66634077", "0.6647488", "0.66313815", "0.6568603", "0.6470686", "0.6443546", "0.643003", "0.6408555", "0.6382263", "0.6330571", ...
0.0
-1
Stop the underlying server / worker.
public function stop(): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function stop(): void\n {\n $server = $this->createServer();\n\n // Check if it has started\n if (!$server->isRunning()) {\n output()->writeln('<error>The server is not running! cannot stop.</error>');\n return;\n }\n\n // Do stopping.\n $se...
[ "0.7606969", "0.7564158", "0.7301298", "0.7047882", "0.70174444", "0.6992386", "0.69501686", "0.6883482", "0.6883482", "0.6883482", "0.6883482", "0.6883482", "0.6883482", "0.6883482", "0.6883482", "0.67921", "0.67897993", "0.670616", "0.66915035", "0.6666815", "0.6659839", ...
0.67671365
21
Ensures that the buyer's cart contains the contents of the given deal.
protected function prepareCart(PriceWaiter_NYPWidget_Model_Deal $deal) { $cart = Mage::getSingleton('checkout/cart'); $quote = $cart->getQuote(); $deal->ensurePresentInQuote($quote); $cart->save(); // Track the current PW buyer ID so we can automatically discover // other deals the buyer has made. Mage::getSingleton('nypwidget/session') ->setBuyerId($deal->getPricewaiterBuyerId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_cart_items() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$result = $this->check_cart_item_stock();\n\t\t\tif (is_wp_error($result)) $cmdeals->add_error( $result->get_error_message() );\n\t\t}", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as...
[ "0.5724019", "0.56867766", "0.5617687", "0.5592178", "0.55857885", "0.53485966", "0.5319544", "0.53194904", "0.5308252", "0.5212544", "0.51938987", "0.5121895", "0.5091952", "0.5048193", "0.5046037", "0.5021176", "0.5005272", "0.4992454", "0.49872866", "0.49625215", "0.495541...
0.5968807
0
Redirects the buyer back to the cart page.
protected function redirectToCart($errorCode = null, $errorMessage = null) { $url = Mage::getUrl('checkout/cart'); $this->_doRedirectWithError($url, $errorCode, $errorMessage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _redirectToCart()\n {\n $this->_redirect(\"checkout/cart\");\n }", "public function redirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setAlipayPaymentQuoteId($session->getQuoteId());\n\n $order = $this->getOrder();\n\n ...
[ "0.786399", "0.72627443", "0.72194785", "0.7183043", "0.7173328", "0.715228", "0.710139", "0.6942087", "0.6885453", "0.6869131", "0.68352914", "0.68084586", "0.65970856", "0.65542907", "0.6494677", "0.64663947", "0.6435239", "0.6415688", "0.6398064", "0.6381716", "0.6350806",...
0.0
-1
Redirects the buyer back to the store's homepage. Used when deal is invalid in some way.
protected function redirectToHomepage($errorCode = null) { $url = Mage::getUrl('/'); $this->_doRedirectWithError($url, $errorCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirectAction()\n\t\t{\n\t\t\t// Load /app/code/community/Mage/Idealcheckoutdirectebanking/Model/Idealcheckoutdirectebanking.php\n\t\t\t$oIdealcheckoutdirectebankingModel = Mage::getSingleton('idealcheckoutdirectebanking/idealcheckoutdirectebanking');\n\n\n\t\t\t// Create transaction record and ge...
[ "0.6674668", "0.66317105", "0.65197057", "0.6497746", "0.64622456", "0.64601785", "0.6372557", "0.6351224", "0.624934", "0.6188762", "0.617264", "0.61654377", "0.6144631", "0.6093412", "0.60881823", "0.60873616", "0.60767", "0.60673857", "0.60175395", "0.59963155", "0.5986520...
0.0
-1
Sends the user to the product page, optionally setting an error code header and displaying an error message. If something goes wrong, the user is redirected to the homepage.
protected function redirectToProductPage( PriceWaiter_NYPWidget_Model_Deal $deal, $errorCode = null, $errorMessage = null ) { $offerItems = $deal->getOfferItems(); if (count($offerItems) > 0) { try { $url = $offerItems[0]->getMagentoProductUrl(); return $this->_doRedirectWithError($url, $errorCode, $errorMessage); } catch (Exception $ex) { // A malformed deal could result in getMagentoProductUrl() throwing Mage::logException($ex); } } // Fall back to homepage when something horrible happens return $this->redirectToHomepage($errorCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function renderErrorPage(): void\n {\n\t\tob_start();\n\t\theader('Location: /page/error');\n\t\tob_end_flush();\n }", "public function err_page()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n $site->printNav();\n echo \"An Error has oc...
[ "0.6825298", "0.658131", "0.6461355", "0.6452078", "0.63881326", "0.6373711", "0.6307944", "0.6288244", "0.62805986", "0.62028325", "0.61670184", "0.61231375", "0.6107828", "0.6098752", "0.60912126", "0.60840523", "0.6056212", "0.60510856", "0.6049926", "0.59803665", "0.59573...
0.5906997
23
get array number day by month current
function getDay($month, $year) { if ( empty($year) ) { $year = date('Y'); } $day_arr = array(); if ( $month != 0 ) { $number = date('t', mktime(0, 0, 0, $month, 1, $year)); for ( $i = 1; $i <= $number; $i++ ) { $i = sprintf('%02d', $i); $day_arr[$i] = $i; } } return $day_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_month_days_cm ($fecha) {\n $labels = array();\n $month = month_converter($fecha->month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $fecha->month, $fecha->year);\n $i = 0;\n while ($i < $monthdays) {\n $i++;\n $labels[] = $i;\n }\n return $labels;\n}", "functi...
[ "0.6923537", "0.6776679", "0.6755445", "0.66507155", "0.66411805", "0.6601844", "0.65470237", "0.65130025", "0.6460665", "0.64301217", "0.6428734", "0.637385", "0.6306657", "0.6304316", "0.62353903", "0.61570704", "0.61460215", "0.6082594", "0.6061218", "0.6047434", "0.601705...
0.70013785
0
ex: 20160711, 1 return array( '20160710' => 20160710, '20160711' => 20160711, '20160712' => 20160712, )
function getSomeDayFromDay($currentDay, $number) { if ( $number == 0 ) { return $tmpDates[$currentDay] = $currentDay; } $tmpDates = array(); $newdate = ''; for ( $i = $number; $i >= 1; $i-- ) { $newdate = strtotime ( '-' . $i . ' day' , strtotime ( $currentDay ) ) ; $newdate = date ( 'Y-m-j' , $newdate ); $tmpDates[$newdate] = $newdate; } $tmpDates[$currentDay] = $currentDay; for ( $i = 1; $i <= $number; $i++ ) { $newdate = strtotime ( '+' . $i . ' day' , strtotime ( $currentDay ) ) ; $newdate = date ( 'Y-m-j' , $newdate ); $tmpDates[$newdate] = $newdate; } return $tmpDates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNextMonthArray() { \n\t\t$date = date(\"Ymd\");\n\t\t$result = array($date);\n\n\n\t\tfor ($i=0; $i < 5; $i++) { \n\t\t\t$timestamp = strtotime($date);\n\t\t\t$date =date(\"Ymd\", strtotime('+1 day', $timestamp));\n\t\t\tarray_push($result,$date);\n\t\t}\n\t\treturn $result;\n\t}", "public static ...
[ "0.61138034", "0.6065718", "0.60334146", "0.5942667", "0.5919838", "0.58815956", "0.5710571", "0.56908935", "0.5687792", "0.5660913", "0.5648701", "0.5618342", "0.5579745", "0.55626565", "0.5562131", "0.55431247", "0.5519851", "0.55157673", "0.55064815", "0.549766", "0.548991...
0.0
-1
convert date to YYYYMM
function date2YearMonth($date=null){ if(!empty($date)){ return date('Ym', strtotime($date)); }else{ return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_date_to_mmdd($date) {\n\t$date = date('m/d', strtotime($date));\n\n\treturn $date;\n}", "public function transform($date)\n {\n if ($date === null) {\n return '';\n }\n return $date->format('d') . '/' . $date->format('m') . '/' . $date->format('Y');\n }", ...
[ "0.6681563", "0.6523007", "0.6498544", "0.6492454", "0.6471678", "0.64606804", "0.6431762", "0.6411973", "0.6279234", "0.6236314", "0.6206356", "0.61481196", "0.61475796", "0.6126886", "0.6065553", "0.6064248", "0.6042289", "0.6038749", "0.603303", "0.602878", "0.6013536", ...
0.7367376
0
ex: 00,02 > 00,03 ==> 60s
function totalSecond($hh1, $mm1, $ss1 = '0', $hh2, $mm2, $ss3 = '0') { $seconds = mktime($hh1, $mm1, $ss1) - mktime($hh2, $mm2, $ss3); return $seconds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function time_to_secs($time)\n{\n$timeArr = array_reverse(split(\":\", $time));\n$seconds = 0;\n$vals = Array(1, 60, 3600, 86400);\nforeach($timeArr as $key => $value)\n{\nif(!isset($vals[$key]))\nbreak;\n$seconds += $value * $vals[$key];\n}\nreturn $seconds;\n}", "function get_60_seconds() {\n\t$array = array()...
[ "0.64060503", "0.62583244", "0.624695", "0.6213211", "0.6212911", "0.61362195", "0.60882473", "0.6057313", "0.60476893", "0.6039389", "0.6035256", "0.602655", "0.6025913", "0.6000323", "0.5989791", "0.59797883", "0.596151", "0.5953394", "0.5952983", "0.5948764", "0.5936608", ...
0.59032047
22
ex: 70 => 01:10 ex: 70, 'H:i:s' => 01:10:00
function convertSecond2Time($seconds, $formatTime = 'H:i:s') { $result = date($formatTime, mktime(0, 0, $seconds)); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeConversion($s) {\n return DATE(\"H:i:s\", STRTOTIME($s));\n\n}", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $tim = \"\";\n $arr = preg_split(\"/[:]/\",$s);\n\n if( preg_match( '/AM$/', $arr[2]) ) {\n $replace = str_replace('AM', '', $arr[2]);\n ...
[ "0.7713241", "0.71539074", "0.70058256", "0.69766915", "0.68982416", "0.6871347", "0.681657", "0.6809225", "0.6800612", "0.67737705", "0.6752846", "0.6741955", "0.6716263", "0.66980886", "0.6673749", "0.66317064", "0.66280556", "0.6607994", "0.6574564", "0.65567416", "0.65483...
0.0
-1
ex: 20160722 => 20160723
function addOneDay($currentDay) { if ( empty($currentDay) ) { $currentDay = date('Y-m-d'); } $nextDate = strtotime ( '+ 1 day' , strtotime ( $currentDay ) ) ; $nextDate = date ( 'Y-m-d' , $nextDate ); return $nextDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_timestamp($timestamp){ \n $limit=date(\"U\"); \n $limiting=$timestamp-$limit; \n return date (\"Ymd\", mktime (0,0,$limiting)); \n}", "function swapdate($temp){\n\t$d\t\t\t= explode(\"-\",$temp);\n\t$ndate \t= ($d[0] - 543).\"-\".$d[1].\"-\".$d[2];\n\treturn $ndate;\n}", "function con...
[ "0.6040183", "0.5963474", "0.5873314", "0.5821957", "0.5812504", "0.5763699", "0.56561613", "0.5630863", "0.56225145", "0.56008685", "0.5504813", "0.5488977", "0.54772466", "0.5444491", "0.5403296", "0.5385395", "0.537084", "0.5363716", "0.5360833", "0.53448737", "0.53293353"...
0.0
-1
convert time 3 digit to 4 digit
function time2D4($time){ if ( strlen($time) <= 3 ) $time = sprintf('%04d', $time); $result = array( 'hh' => '00', 'mm' => '00' ); if ( strlen($time) == 4 ) { $result['hh'] = substr($time, 0, 2); $result['mm'] = substr($time, 2, 2); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_time ($time = '') {\n $str_time = '';\n\n $time_in_second = $time / 1000;\n\n $nb_minutes = $time_in_second / 60;\n $nb_seconds = $time_in_second % 60;\n\n $str_time = $nb_seconds.'s';\n\n if ($nb_minutes >= 60) {\n $nb_heures = $nb_minutes ...
[ "0.71102345", "0.6962839", "0.6711381", "0.6686256", "0.6601823", "0.65190905", "0.65145236", "0.65109605", "0.649926", "0.64447546", "0.639491", "0.637864", "0.6365775", "0.6347314", "0.6306025", "0.6298372", "0.62940764", "0.628181", "0.6281184", "0.62802505", "0.6277497", ...
0.801905
0
/ Add discovery process.
protected function _addDiscoveryProcess() { if (empty($this->_server)) { throw new Exception('init failed'); } $process = new SwooleProcess([ $this, 'onDiscoveryProcessAdd' ]); $this->setProcess($process); $this->_server->addProcess($process); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildDiscovery();", "public function discover () {\n\t\techo \"They can only discover\";\n\t}", "public function addCachedDiscovery(CachedDiscoveryInterface $cached_discovery);", "function wp_oembed_add_discovery_links()\n {\n }", "protected function listen()\n {\n // Set time lim...
[ "0.648646", "0.57982194", "0.5671558", "0.53643703", "0.5324215", "0.5293005", "0.52735525", "0.5151731", "0.51439315", "0.51206493", "0.51106125", "0.5098104", "0.507639", "0.49984893", "0.49599975", "0.49526846", "0.49359635", "0.4885875", "0.4883293", "0.4833266", "0.48331...
0.780687
0
Whether the storage backend contains a specific user. Having a user is defined as HAVING the USERSETTINGSportion of the data. The usercookies may be stored separately (such as in a cookiefile) and are NOT essential since they can be regenerated. So the data storage implementation MUST ONLY check for the existence of the USERSETTINGS.
public function hasUser ($username) { // Check whether the user's settings exist (empty string allowed). return $this->_getUserKey($username, self::SETTINGS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasUserCookies ()\n\t{\n\t\t// Simply check if the storage key for cookies exists and is non-empty.\n\t\treturn ! empty($this->loadUserCookies()) ? true : false;\n\t}", "private function checkCurrentUser(){\n return isset($_SESSION['user']);\n }", "public function hasUser();", "func...
[ "0.7035816", "0.67715937", "0.6540043", "0.6504999", "0.64896387", "0.6460639", "0.64487886", "0.6431249", "0.642298", "0.64196783", "0.6394352", "0.6341454", "0.6297206", "0.629277", "0.627108", "0.626311", "0.6261317", "0.6226791", "0.6226791", "0.6226791", "0.6226791", "...
0.6734622
2
Move the internal data for a username to a new username. Is NEVER called for the currently loaded user, so Storage backend writers can safely assume that you'll never be asked to rename the loaded user. Before performing the move, this function MUST validate that the OLD user EXISTS and that the NEW user DOESN'T EXIST, and MUST throw an exception if either of those checks fail. This is to ensure that users don't lose data by accidentally overwriting something.
public function moveUser ($oldUsername, $newUsername) { // Verify that the old username exists and fetch the old data. $oldSettings = $this->_getUserKey($oldUsername, self::SETTINGS); $oldCookies = $this->_getUserKey($oldUsername, self::COOKIES); if ($oldSettings === null) { // Only settings are vital. throw new SettingsException(sprintf( 'Cannot move non-existent user "%s".', $oldUsername )); } // Verify that the new username does not exist. if ($this->hasUser($newUsername)) { throw new SettingsException(sprintf( 'Refusing to overwrite existing user "%s".', $newUsername )); } // Now attempt to write all data to the new name. $this->_setUserKey($newUsername, self::SETTINGS, $oldSettings); if ($oldCookies !== null) { // Only if cookies existed. $this->_setUserKey($newUsername, self::COOKIES, $oldCookies); } // Delete the previous user keys. $this->deleteUser($oldUsername); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function change_username($new_username) {\n $this->user->username = $new_username;\n $this->user->update();\n\n $this->impersonate($this->id);\n }", "function user_set_name($user_id, $new_username)\n{\n\tif(strcmp($new_username,user_get_name($user_id)))\n\t{\n\t\t//check that no ot...
[ "0.64323926", "0.63914484", "0.6341779", "0.62913924", "0.60810673", "0.60505277", "0.6014536", "0.59819937", "0.5809437", "0.5794171", "0.57554567", "0.57224655", "0.5705922", "0.56143767", "0.55717576", "0.5559833", "0.5557186", "0.55230534", "0.5513415", "0.55081934", "0.5...
0.70961016
0
Delete all internal data for a given username. Is NEVER called for the currently loaded user, so Storage backend writers can safely assume that you'll never be asked to delete the loaded user. This function MUST treat a nonexistent or already deleted user as "success". ONLY throw an exception if ACTUAL deletion fails.
public function deleteUser ($username) { $this->_delUserKey($username, self::SETTINGS); $this->_delUserKey($username, self::COOKIES); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $m...
[ "0.6725239", "0.66722304", "0.6621715", "0.6576141", "0.6549368", "0.64631426", "0.6409221", "0.640288", "0.63376594", "0.63102615", "0.630034", "0.6261187", "0.6214425", "0.6210117", "0.6203356", "0.6203356", "0.617481", "0.6133425", "0.61160725", "0.61039466", "0.60968286",...
0.63200593
9
Open the data storage for a specific user. If the user does not exist, THIS call MUST create their user storage, or at least do any necessary preparations so that the other functions can read/write to the user's storage (and behave as specified). Is called every time we're switching to a user, and happens before we call any userspecific data retrieval functions. This function must cache the user reference and perform necessary backend operations, such as opening file/database handles and finding the row ID for the given user, so that all further queries know what user to use. All further calls relating to that user will assume that your storage class has cached the user reference we gave you in this call.
public function openUser ($username) { $this->_username = $username; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function openUser()\n {\n $this->isUser = true;\n }", "function d4os_io_db_070_os_user_load($data = array()) {\n\n if (is_numeric($data)) {\n\n // get the user by uid\n $UUID = db_result(db_query(\"SELECT UUID FROM {d4os_ui_users} WHERE uid = %d\", array($data)));\n\n if (!$UUID) {\...
[ "0.5788557", "0.5474228", "0.5471119", "0.543494", "0.5422425", "0.5401421", "0.5387428", "0.52846587", "0.52310467", "0.5225515", "0.5223881", "0.5216988", "0.52132887", "0.52106684", "0.5204202", "0.5203848", "0.51933724", "0.5188568", "0.5163132", "0.51616025", "0.51615125...
0.0
-1
Load all settings for the currently active user.
public function loadUserSettings () { $userSettings = []; $encodedData = $this->_getUserKey($this->_username, self::SETTINGS); if ( ! empty($encodedData)) { $userSettings = @json_decode($encodedData, true, 512, JSON_BIGINT_AS_STRING); if ( ! is_array($userSettings)) { throw new SettingsException(sprintf( 'Failed to decode corrupt settings for account "%s".', $this->_username )); } } return $userSettings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Load() {\n\t\t\n\t\tglobal $sql;\n\t\t$query = array(\n\t\t\t\"*\" => \"SELECT DISTINCT * FROM user_options WHERE user=?;\",\n\t\t\t\"pgsql\" => 'SELECT DISTINCT * FROM user_options WHERE \"user\"=?;',\n\t\t);\n\t\t$bind_variables = array(\n\t\t\t$this->username\n\t\t);\n\t\t\n\t\t$options = $sql->...
[ "0.74938136", "0.74524033", "0.7412404", "0.7350385", "0.7350385", "0.73496497", "0.7174167", "0.71131295", "0.7061629", "0.697353", "0.691621", "0.6778691", "0.6764884", "0.67509246", "0.65682435", "0.65356743", "0.6527539", "0.65065765", "0.64947325", "0.6486868", "0.647969...
0.6553745
15
Save the settings for the currently active user. Is called every time any setting changes. The triggerkey can be used for selectively saving only the modified setting. But most backends should simply JSONencode the whole $userSettings array and store that string.
public function saveUserSettings (array $userSettings, $triggerKey) { // Store the settings as a JSON blob. $encodedData = json_encode($userSettings); $this->_setUserKey($this->_username, self::SETTINGS, $encodedData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SaveSettings()\n\t{\n\t\t$this->GetDb();\n\n\t\t$tempSettings = $this->Db->Quote(serialize($this->settings));\n\t\t$tempUserID = intval($this->userid);\n\n\t\t$query = \"\n\t\t\tUPDATE [|PREFIX|]users\n\t\t\tSET settings='{$tempSettings}'\n\t\t\tWHERE userid={$tempUserID}\n\t\t\";\n\n\t\t$result = $this->...
[ "0.7115756", "0.68787223", "0.6819958", "0.6615483", "0.64693767", "0.6369531", "0.6365924", "0.63436824", "0.63341576", "0.63057685", "0.6304582", "0.6268117", "0.62590814", "0.6219204", "0.6161533", "0.6159846", "0.6023926", "0.6004178", "0.5995158", "0.5974717", "0.5957768...
0.83645856
0
Whether the storage backend has cookies for the currently active user. Even cookiefile (filebased jars) MUST answer this question, for example by checking if their desired cookiefile exists and is nonempty. And all other storage backends (such as databases) MUST also verify that their existing cookie data is nonempty. Don't validate the actual cookie contents, just look for nonzero size!
public function hasUserCookies () { // Simply check if the storage key for cookies exists and is non-empty. return ! empty($this->loadUserCookies()) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cookieExists(): bool\n {\n $result = true;\n if (empty($_COOKIE)) {\n $result = false;\n }\n return $result;\n }", "public function hasCookies() {\n\t\treturn $this->hasFirstPartyCookies() || $this->hasThirdPartyCookies();\n\t}", "public function coo...
[ "0.73646384", "0.72484255", "0.7026608", "0.69638735", "0.6844069", "0.6802924", "0.6802924", "0.67953223", "0.6784761", "0.67574275", "0.67271584", "0.66777676", "0.66728944", "0.664498", "0.65714896", "0.65262324", "0.649147", "0.64878434", "0.6419699", "0.6406596", "0.6399...
0.8070163
0
Get the cookiefile disk path (only if a filebased cookie jar is wanted). The file does not have to exist yet. It will be created by the caller ondemand when necessary.
public function getUserCookiesFilePath () { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function configCookiePath()\n\t{\n\t\treturn dirname(__FILE__) . '\\cookiefile';\n\t}", "function get_cookie_path()\n{\n global $SITE_INFO;\n $ret = array_key_exists('cookie_path', $SITE_INFO) ? $SITE_INFO['cookie_path'] : '/';\n return ($ret == '') ? null : $ret;\n}", "function getCookiePath(...
[ "0.7095272", "0.6541507", "0.65231365", "0.60637665", "0.57342523", "0.569794", "0.56609076", "0.5528602", "0.55081236", "0.5483616", "0.5446217", "0.5440193", "0.5433883", "0.5433056", "0.5375775", "0.5375775", "0.53735507", "0.53735507", "0.5372021", "0.5351479", "0.5328312...
0.73801416
0
(Noncookiefile) Load all cookies for the currently active user. Note that this function is ONLY called if a nonstring answer was returned by the getUserCookiesFilePath() call. If your Storage backend class uses a cookiefile, make this a noop.
public function loadUserCookies () { return $this->_getUserKey($this->_username, self::COOKIES); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadCookies($username = '');", "public function getUserCookiesFilePath ()\n\t{\n\t\treturn null;\n\t}", "function load_cookie($file) {\n if (!is_file($file)) {\n return [];\n }\n return json_decode(file_get_contents($file), true);\n}", "public function getCookiesUser(): ?array...
[ "0.6486365", "0.61643726", "0.59896064", "0.5717968", "0.57139874", "0.5662884", "0.56552374", "0.56539065", "0.5605654", "0.55328864", "0.5508583", "0.5483877", "0.54750156", "0.5471019", "0.54589176", "0.53041375", "0.52894527", "0.52894413", "0.526278", "0.52358335", "0.52...
0.66864043
0
(Noncookiefile) Save all cookies for the currently active user. Note that this function is called frequently! But it is ONLY called if a nonstring answer was returned by the getUserCookiesFilePath() call. If your Storage backend class uses a cookiefile, make this a noop.
public function saveUserCookies ($rawData) { $this->_setUserKey($this->_username, self::COOKIES, $rawData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function saveCookie(){\n\t\t$expire = time() + Configuration::get(Configuration::APP_COOKIE_TIME) ;\n\t\tforeach( self::$cookiesToSave as $n => $v ){\n\t\t\tsetcookie($n,$v,$expire) ;\n\t\t}\n\t}", "private function writeCookieFileCache()\n {\n $timeLive = Carbon::now()->addMinutes(480);\...
[ "0.6589307", "0.62283117", "0.6061447", "0.59656036", "0.5960204", "0.57877743", "0.57456857", "0.56925523", "0.5662862", "0.56384635", "0.56050086", "0.5593898", "0.55532295", "0.5547641", "0.554029", "0.5535725", "0.548314", "0.5480192", "0.5402688", "0.5396596", "0.5372096...
0.5415325
18
Close the settings storage for the currently active user. Is called every time we're switching away from a user, BEFORE the new user's loadUserSettings() call. Should be used for doing things like closing previous peruser file handles in the backend, and unsetting the cached user information that was set in the openUser() call. After this call, there will not be any other userrelated calls until the next openUser() call.
public function closeUser () { $this->_username = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function closeUser()\n {\n $this->isUser = false;\n }", "protected function closed ($user) {\n }", "protected function closed($user)\n\t{\n\t}", "public static function loadSettingsAfterLogin() {\r\n\t\t//try to load from DB\r\n\t\t$settings=UserSettings::model()->findByAttributes(array(...
[ "0.64519835", "0.5937539", "0.5919718", "0.57041454", "0.55767655", "0.55767655", "0.5532869", "0.5532494", "0.5427404", "0.54094124", "0.5364938", "0.5349593", "0.5319141", "0.5299789", "0.5289071", "0.5276134", "0.5228051", "0.5217518", "0.51942533", "0.5174687", "0.5117386...
0.6198137
1
Disconnect from a storage location and perform necessary shutdown steps. This function is called ONCE, when we no longer need to access the currently open storage. But we may still open another storage afterwards, so do NOT treat this as a "class destructor"! Implementing this is optional, but the function must exist.
public function closeLocation () { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shutdown() {\n $this->saveStorage();\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $...
[ "0.6964641", "0.66301185", "0.65672", "0.6563482", "0.64772725", "0.6460958", "0.6436846", "0.6406668", "0.63995814", "0.63995814", "0.63719463", "0.6366932", "0.6321927", "0.6321927", "0.63209975", "0.63070345", "0.6294602", "0.6266812", "0.62356657", "0.62189436", "0.621675...
0.0
-1
Retrieve a redis key for a particular user.
private function _getUserKey ($username, $key) { $realKey = $username . '_' . $key; return $this->cache->get($realKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pmpromrss_getMemberKey($user_id = NULL)\r\n{\r\n\t//default to current user\r\n\tif(empty($user_id))\r\n\t{\r\n\t\tglobal $current_user;\r\n\t\t$user_id = $current_user->ID;\r\n\t}\r\n\t\r\n\t//make sure we have a user\r\n\tif(empty($user_id))\r\n\t\treturn false;\r\n\t\t\r\n\t$user = get_userdata($user_i...
[ "0.68722844", "0.68278205", "0.65183866", "0.6509063", "0.6476094", "0.6476094", "0.635055", "0.62263197", "0.6162484", "0.613968", "0.61144423", "0.61144423", "0.61144423", "0.61144423", "0.61144423", "0.61144423", "0.61144423", "0.61144423", "0.61144423", "0.61144423", "0.6...
0.65531415
2
Set a redis key for a particular user.
private function _setUserKey (string $username, string $key, $value) { $realKey = $username . '_' . $key; $this->cache->put($realKey, (string) $value, self::CACHE_TIME); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SetKey($key = ''){\n \tself::$userKey = $key;\n }", "function set_user_setting( $user, $key, $value )\n {\n //Unimplemented\n }", "private function setRedis_set($gid, $object){\n $client = new Predis\\Client([\n 'scheme' => 'tcp',\n 'host' => '127.0.0.1',\n 'port'...
[ "0.7010619", "0.63163507", "0.6311698", "0.629011", "0.62325096", "0.6226584", "0.61845386", "0.6122072", "0.6028243", "0.6006594", "0.5960473", "0.59544694", "0.58589417", "0.5847366", "0.5818005", "0.5818005", "0.581017", "0.579398", "0.5788379", "0.57704365", "0.57704365",...
0.6628035
1
Delete a memcached key for a particular user.
private function _delUserKey ($username, $key) { $realKey = $username . '_' . $key; $result = $this->cache->forget($realKey); if ( ! $result) throw new SettingsException('Redis Error: can not delete key - ' . $realKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function del($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delInCache($key);", "public function delete( $key );", "abstract public function delete_cached( $key );", "public function delete($userKey)\n {\n ...
[ "0.6957491", "0.6752543", "0.6752543", "0.6752543", "0.67215824", "0.67214817", "0.6693249", "0.65895", "0.6560337", "0.65207994", "0.6466811", "0.6465134", "0.6460812", "0.6386242", "0.6374395", "0.63148254", "0.6284899", "0.6283343", "0.6278164", "0.6278081", "0.62776124", ...
0.6926232
1
Realizamos la consulta para ver los modulos instalados y su estatus
public function loadViewPanel() { $query = $this->db->query("SELECT * FROM db_modulos"); //Creamos variable para contener resultado $modulos = array(); //Cargamos los valores en la variable para mandarlos a la vista foreach ($query->result() as $row) { $modulos["modulo"][] = $row->modulo; $modulos["estatus"][] = $row->activo; } //Mandamos el nombre del usuario para mostrarlo $modulos["nombreUsuario"] = strtoupper($this->session->userdata('nombreUsuario')); $modulos["correoUsuario"] = $this->session->userdata('correo'); //Cargamos las vistas para implementarlas $coleccion = array( "header" => $this->load->view("layout/header", '', TRUE), "menu" => $this->load->view("layout/panel", $modulos, TRUE), "header_navegation" => $this->load->view("layout/header_navegation", array("nombreUsuario"=>$modulos["nombreUsuario"],"correoUsuario"=>$modulos["correoUsuario"]), TRUE), "contenido" => $this->load->view("welcome_message", '', TRUE), "footer" => $this->load->view("layout/footer", '', TRUE), "titulo" => "Tienda" ); //Cargamos la estructura principal para cargar el Panel $this->load->view("layout/main",$coleccion); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listar_so_software() {\n\t\t$query = \"SELECT software_so.*\n\t\tFROM software_so\n\t\tORDER BY so asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows...
[ "0.6170189", "0.5949224", "0.5833679", "0.5832849", "0.5796465", "0.57706505", "0.5766823", "0.5765556", "0.5758209", "0.56835", "0.558471", "0.5571547", "0.5513512", "0.5475244", "0.54690003", "0.5465753", "0.5436823", "0.5435033", "0.5427798", "0.5415151", "0.54082984", "...
0.0
-1
Display a listing of the resource.
public function index(Request $request) { $parametros = self::filtroEstatico($request, 'imagem.index', ['ativo' => 1]); $model = Imagem::search($parametros)->orderBy('codimagem', 'DESC')->paginate(30); return view('imagem.index', compact('model')); }
{ "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
Carrega Model do Produto
public function produtoStore(Request $request, $id) { $model = Produto::find($id); // Carrega Imagens do SLIM $images = Slim::getImages(); if (!isset($images[0])) { abort(500, 'Nenhuma imagem informada!'); } $image = $images[0]; // Se tipo for diferente de JPEG if ($image['input']['type'] != 'image/jpeg') { abort(500, 'Imagem deve ser um JPEG!'); } // Salva para ganhar o ID $imagem = new Imagem(); $imagem->save(); // Grava nome do arquivo nas observacoes $arquivo = "{$imagem->codimagem}.jpg"; $imagem->observacoes = $arquivo; $imagem->arquivo = $arquivo; $imagem->save(); // Anexa imagem ao produto $ret = $model->ImagemS()->attach($imagem->codimagem); // Anexa imagem as variacoes sem imagem $sql = ' update tblprodutovariacao set codprodutoimagem = ( select i.codprodutoimagem from tblprodutoimagem i where i.codimagem = :codimagem and i.codproduto = tblprodutovariacao.codproduto ) where codprodutoimagem is null and codproduto = :codproduto '; DB::update($sql, [ 'codimagem' => $imagem->codimagem, 'codproduto' => $model->codproduto ]); // Salva o arquivo Slim::saveFile($image['output']['data'], $arquivo, './public/imagens', false); // Se havia alguma imagem para inativar if($request->get('imagem')) { $imagem_inativa = Imagem::find($request->get('imagem')); $imagem_inativa->inativo = Carbon::now(); $imagem_inativa->save(); $model->ImagemS()->detach($request->get('imagem')); } // Redireciona Session::flash('flash_update', 'Imagem inserida.'); return redirect("produto/$id"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct(){\n $this->toko = new M_Toko();\n $this->produk = new M_Produk(); //variabel model merupakan objek baru yang dibuat dari class model\n }", "public function model()\n {\n return ParametroEmpresa::class;\n }", "function contador_proyectoI(){\r\n $contado...
[ "0.7181921", "0.7110956", "0.7100433", "0.7085738", "0.7025644", "0.6976664", "0.69443333", "0.6942189", "0.68680537", "0.68593895", "0.6838697", "0.6827481", "0.6793342", "0.6770842", "0.6756266", "0.67437255", "0.6727502", "0.67119986", "0.6707109", "0.66899735", "0.6682452...
0.0
-1
Show the form for creating a new resource.
public function create(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show($id) { $model = Imagem::find($id); return view('imagem.show', compact('model')); }
{ "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(Request $request) { $Model = '\MGLara\Models\\' . $request->get('model'); $model = $Model::find($request->get('id')); return view('imagem.edit', compact('model', 'request')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $Model = '\MGLara\Models\\' . $request->get('model'); $model = $Model::findOrFail($id); $codimagem = Input::file('codimagem'); $extensao = $codimagem->getClientOriginalExtension(); $imagem = new Imagem(); $imagem->save(); if(!is_null($model->codimagem)) { $imagem_inativa = Imagem::find($model->codimagem); $imagem_inativa->inativo = Carbon::now(); $imagem_inativa->save(); } $imagem_update = Imagem::findOrFail($imagem->codimagem); $imagem_update->observacoes = $imagem->codimagem.'.'.$extensao; $imagem_update->save(); $diretorio = './public/imagens'; $arquivo = $imagem->codimagem.'.'.$extensao; try { $codimagem->move($diretorio, $arquivo); $model->codimagem = $imagem->codimagem; $model->save(); Session::flash('flash_update', 'Registro atualizado.'); return redirect(modelUrl($request->get('model')).'/'.$id); } catch (\Symfony\Component\HttpFoundation\File\Exception\FileException $e) { Session::flash('flash_danger', "Não foi possível cadastrar essa imagem!"); Session::flash('flash_danger_detail', $e->getMessage()); return redirect(modelUrl($request->get('model')).'/'.$id); } }
{ "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) { try{ $model = Imagem::find($id); $model->delete(); unlink('./public/imagens/'.$model->observacoes); $ret = ['resultado' => true, 'mensagem' => 'Imagem excluída com sucesso!']; } catch(\Exception $e){ $ret = ['resultado' => false, 'mensagem' => 'Erro ao excluir imagem!', 'exception' => $e]; } return json_encode($ret); }
{ "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
recibe idplan , anio
public function buscarMaterias($datos){ try { $parametros = array("id_plan" => $datos["id_plan"] , "anio" => $datos["anio"]); $resultado = $this->refControladorPersistencia->ejecutarSentencia(DbSentencias::BUSCAR_MATERIAS_EC, $parametros); $fila = $resultado->fetchAll(PDO::FETCH_ASSOC); return $fila; } catch(Exception $e){ echo "Error :" . $e->getMessage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostrar_plan(){\n\t\tif (isset($_GET['temp']) && $_GET['temp']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$temp=$_GET['temp'];\n\t\t\t$sql=\"SELECT * FROM habitaciones2 WHERE id='$temp'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$this-...
[ "0.68574417", "0.64684856", "0.6467074", "0.6298044", "0.6258166", "0.61663127", "0.61555743", "0.6007302", "0.60039926", "0.5991225", "0.596222", "0.59620845", "0.59478194", "0.594757", "0.59277296", "0.5894378", "0.5885193", "0.5874222", "0.5856647", "0.5841292", "0.5837590...
0.0
-1
TODO: Implement first() method.
public function first() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first() {}", "public static function first();", "public...
[ "0.91696584", "0.91696584", "0.91696584", "0.91696584", "0.91696584", "0.91696584", "0.91696584", "0.91696584", "0.89991844", "0.8694712", "0.83998865", "0.83673", "0.834337", "0.834337", "0.8284112", "0.82821184", "0.8229505", "0.8175767", "0.8174162", "0.8156844", "0.814679...
0.8246237
16
TODO: Implement fetch() method.
public function fetch(): array { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function fetch();", "abstract public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", ...
[ "0.8722348", "0.8722348", "0.8570398", "0.8570398", "0.8570398", "0.8570398", "0.8570398", "0.8570398", "0.8570398", "0.8570398", "0.8570398", "0.84123003", "0.7664436", "0.7566381", "0.7510386", "0.7510386", "0.74389964", "0.7435424", "0.7378753", "0.73154825", "0.7285948", ...
0.679323
34
TODO: Implement rowCount() method.
public function rowCount(): int { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rowCount() {}", "public function rowCount();", "public function rowCount();", "public function rowCount()\n {\n }", "public function getRowCount()\n {\n return $this->rowCount;\n }", "public function getRowCount();", "public function rowCount()\n {\n return $th...
[ "0.8909583", "0.8780282", "0.8780282", "0.8598367", "0.7927319", "0.7839986", "0.7731738", "0.773095", "0.76068586", "0.75856614", "0.75518376", "0.7503742", "0.74809974", "0.7425162", "0.73811835", "0.736698", "0.7332763", "0.73013526", "0.7297756", "0.72881234", "0.7287593"...
0.8368667
4
TODO: Implement getAffectedRowsCount() method.
public function getAffectedRowsCount(): int { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getAffectedRows();", "public function getAffectedRows();", "public function getAffectedRows();", "public function getAffectedRows()\n\t{\n\t\treturn 0;\n\t}", "public function getAffectedRows() {\n\t\treturn $this->last_sth->rowCount();\n\t}", "public function affectedRows();", ...
[ "0.90783185", "0.88833", "0.88833", "0.85172284", "0.8286501", "0.8266638", "0.8266638", "0.8266638", "0.8266638", "0.8258826", "0.8258826", "0.82306176", "0.82055706", "0.81668186", "0.816464", "0.8154431", "0.81372356", "0.81257904", "0.8097121", "0.808465", "0.80766577", ...
0.8565536
3
Run the database seeds.
public function run() { ProviderReportsController::generateReports(); // //monthly report // // $time = Carbon::now('Europe/London'); // $end = Carbon::parse($time)->endOfDay(); // $start = Carbon::parse(Carbon::parse($end)->subMonth()->addSecond()); // // $providers = Provider::get(); // for ($i = 0; $i < count($providers); $i++) { // // $report = new ProviderMonthlyReport(); // $r = new Report(); // $provider = Provider::where('user_id', $providers[$i]->user_id)->first(); // // $r->user_id = $provider->user_id; // $r->type = 'month'; // $report->provider_id = $provider->provider_id; // // $messages = Messages::where('provider_id', $provider->provider_id)->get(); // //$conversations =; // // if (Carbon::parse($provider->created_at) > $start) { // $report->start_date = Carbon::parse($provider->created_at); // $first = true; // $report->report_index = 0; // } else { // $report->start_date = $start; // if (ProviderMonthlyReport::where('provider_id', $provider->provider_id)->first()) { // $first = false; // } else { // //if all goes well, this should never be called // $report->start_date = Carbon::parse($provider->created_at); // $first = true; // $report->report_index = 0; // } // } // // $report->end_date = $end; // $conversation_ids = DB::table('conversations')->where('provider_id', $provider->provider_id)->select('conversation_id')->get(); // // if ($first) { // //first report of this type // $report->page_visits = $provider->visits;//checked // // //provider stats // // //message stats // $report->messages_unread = Messages::where('provider_id', $provider->provider_id)->where('read', 'no')->count(); // $report->new_conversations = Conversations::where('provider_id', $provider->provider_id)->count(); // //// // $offered_searches_ids = DB::table('offered_searches')->whereIn('conversation_id', $conversation_ids)->select('offered_search_id')->get(); // // //$report->searches_offered =; // } else { // $report->report_index = (ProviderMonthlyReport::where('provider_id', $provider->provider_id)->max('report_index') + 1); // $lastMonth = ProviderMonthlyReport::where('report_index', ($report->report_index - 1))->first(); // // $report->page_visits = ($provider->visits - $lastMonth->total_page_visits);//change to total // $report->messages_unread = Messages::where('provider_id', $provider->provider_id)->where('created_at', '>', Carbon::parse($lastMonth->end_date))->where('read', 'no')->count(); // $report->new_conversations = Conversations::where('provider_id', $provider->provider_id)->where('date_started', '>', Carbon::parse($lastMonth->end_date))->count(); // // // $offered_searches_ids = DB::table('offered_searches')->whereIn('conversation_id', $conversation_ids)->where('updated_at', '>', Carbon::parse($lastMonth->end_date))->select('offered_search_id')->get(); // // // } // //searches // $report->searches_offered = OfferedSearches::whereIn('offered_search_id', $offered_searches_ids)->where('status', 'pending')->count(); // $report->searches_accepted = OfferedSearches::whereIn('offered_search_id', $offered_searches_ids)->where('status', 'accepted')->count(); // $report->searches_completed = OfferedSearches::whereIn('offered_search_id', $offered_searches_ids)->where('status', 'completed')->count(); // //totals // // // $report->total_page_visits = $provider->visits; // $report->total_messages = Messages::where('provider_id', $provider->provider_id)->count(); // $report->total_messages_unread = Messages::where('provider_id', $provider->provider_id)->where('read', 'no')->count(); // $report->total_conversations = Conversations::where('provider_id', $provider->provider_id)->count(); // $report->total_searches_completed = OfferedSearches::whereIn('conversation_id', $conversation_ids)->count(); // // // $r->title = "My Ancestral Scotland Progress Report (" . Carbon::parse($report->start_date)->format('j M') . " - " . // Carbon::parse($report->end_date)->format('j M Y') . ")"; // $r->save(); // $report->report_id = $r->report_id; // $report->save(); // } }
{ "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
adds `force` option to ansiblegalaxy
public function force() { $this->option('--force'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sync_jetpack_options() {\n\t\tif ( class_exists( 'Jetpack_Sync' ) && method_exists( 'Jetpack_Sync', 'sync_options' ) && defined( 'JETPACK__VERSION' ) && version_compare( JETPACK__VERSION, '4.1', '<' ) ) {\n\t\t\tJetpack_Sync::sync_options( __FILE__, $this->auto_register_option, $this->option_name );\n\t\t...
[ "0.5077676", "0.5073283", "0.4888273", "0.48436752", "0.48332578", "0.4750321", "0.47296804", "0.4685539", "0.4679689", "0.46297672", "0.46288747", "0.46217906", "0.46066833", "0.45968798", "0.45592", "0.4553175", "0.45353228", "0.45331442", "0.4527218", "0.45191434", "0.4470...
0.44562528
25
adds `ignoreerrors` option to ansiblegalaxy
public function ignoreErrors() { $this->option('--ignore-errors'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ignoreSSLErrors()\r\n {\r\n $this->commandLineOptions[] = '--ignore-ssl-errors=true';\r\n $this->commandLineOptions[] = '--ssl-protocol=tlsv1';\r\n }", "function ignore($excl){\n $excl[] = 'themes/myown/node_modules';\n return $excl;\n}", "protected function deactivate...
[ "0.5165538", "0.46428004", "0.46071783", "0.458099", "0.45791018", "0.4528251", "0.45200476", "0.45089853", "0.4496293", "0.44938752", "0.44867972", "0.44719437", "0.4444553", "0.4444389", "0.44227597", "0.44220954", "0.44164512", "0.44037446", "0.43869385", "0.4357889", "0.4...
0.46455365
1
adds `nodeps` option to ansiblegalaxy
public function noDeps() { $this->option('--no-deps'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addProductPackParameterNode()\n {\n $builder = new TreeBuilder();\n $node = $builder->root('product_pack');\n\n $node\n ->treatTrueLike(array('entity' => null))\n ->treatFalseLike(array('entity' => null))\n ->addDefaultsIfNotSet()\n ...
[ "0.45420805", "0.44728625", "0.44429407", "0.442064", "0.44185257", "0.43906406", "0.43572032", "0.43454704", "0.43400532", "0.4306807", "0.4299204", "0.4230346", "0.42277664", "0.42231315", "0.42179388", "0.42136452", "0.4193354", "0.4176647", "0.41674528", "0.41483107", "0....
0.0
-1
adds `rolefile` option to ansible
public function roleFile($role_file = '') { $this->option('--role-file=' . $role_file); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_role($role, $display_name, $capabilities = array())\n {\n }", "public function add_role($role)\n {\n }", "public function attachRole($role);", "public function attachRole($role);", "public function setRole($var)\n {\n GPBUtil::checkString($var, True);\n $th...
[ "0.53365266", "0.5078995", "0.49909854", "0.49909854", "0.48811686", "0.48124954", "0.4807254", "0.47733837", "0.471409", "0.47004554", "0.46609274", "0.46253684", "0.45722702", "0.4559672", "0.45521155", "0.45278615", "0.4527051", "0.45222965", "0.45082125", "0.4493077", "0....
0.6522479
0
Array of types or string with types delimited by pipe (|) e.g. array('int', 'null') or "int|null"
public function setTypes($types) { if (is_string($types)) { $types = explode('|', $types); } $this->types = $types; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#[Pure] private static function get_types(string|null $type): array\n {\n if ($type === null) {\n return [Type::VOID];\n }\n\n return explode('|', $type);\n }", "public function getTypes()\n {\n $return = $this->dsn->types;\n\n if ($return === null) {\n ...
[ "0.7060679", "0.6297256", "0.58177537", "0.58061486", "0.57735026", "0.5656581", "0.549302", "0.549302", "0.5467446", "0.5464964", "0.5417649", "0.54007345", "0.5396815", "0.5386867", "0.53702384", "0.5366038", "0.53569436", "0.5317701", "0.5309507", "0.5298755", "0.52770895"...
0.0
-1
Generate random string and encrypt it.
public static function generatePassword() { return bcrypt(str_random(35)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gen_random_string(){\n\t\t$chars =\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n\t\t$final_rand='';\t\t\n\t\tfor($i=0;$i<4; $i++) {\t\t \n\t\t$final_rand .= $chars[ rand(0,strlen($chars)-1)];\n\t\t}\t\t\n\t\treturn $final_rand;\t\n\t}", "function RandomString($num) {\r\r\n ...
[ "0.7239724", "0.7219201", "0.72162765", "0.72002566", "0.7161891", "0.71079123", "0.709659", "0.709659", "0.7080384", "0.70438147", "0.70275384", "0.69833064", "0.695776", "0.69483566", "0.69478565", "0.6947674", "0.6938084", "0.693168", "0.6915596", "0.69081753", "0.69063777...
0.0
-1
The bcrypt and argon2i algorithms don't require a separate salt.
public function getSalt() { // You *may* need a real salt if you choose a different encoder. return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function needSalt();", "public function getSalt()\n {\n //i might implement salt\n }", "public function getSalt()\n {\n // Not Used (The project uses bcrypt algorithm\n }", "abstract protected function getGeneratedSalt() ;", "private function getSalt() \n {\n /**\...
[ "0.7713707", "0.74152833", "0.73655415", "0.73398477", "0.7223767", "0.7155799", "0.71371675", "0.7116331", "0.71138614", "0.71138614", "0.70737004", "0.70737004", "0.70678276", "0.70678276", "0.70678276", "0.70678276", "0.70678276", "0.70678276", "0.70678276", "0.70678276", ...
0.0
-1
Your tear down methods here.
public function tearDown(): void { // Then... parent::tearDown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public fun...
[ "0.8681912", "0.8681912", "0.8681912", "0.8681912", "0.8681912", "0.86081624", "0.86081624", "0.86081624", "0.79417676", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "0.79365194", "...
0.0
-1
Show the application dashboard.
public function index() { $services = $this->services(); $images = $this->images(); $dishes = $this->dishes(); return view('home', ['services' => $services, 'images' => $images, 'dishes' => $dishes]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n ...
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", ...
0.0
-1
Get all images from gallery folder
private function images() { return File::allFiles(public_path('img/gallery')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_gallery_images() {\n\n\t\tcheck_ajax_referer( 'daylife-gallery-add-nonce', 'nonce' );\n\t\trequire_once( dirname( __FILE__ ) . '/class-wp-daylife-api.php' );\n\t\t$daylife = new WP_Daylife_API( get_option( 'daylife' ) );\n\n\t\t// Should be int but santize value as id can be bigger than max...
[ "0.7814598", "0.7772644", "0.7670666", "0.7548918", "0.73371917", "0.7319401", "0.72812206", "0.71849316", "0.71804935", "0.71597433", "0.71211255", "0.7070795", "0.7044805", "0.7040692", "0.6957863", "0.69230336", "0.6921784", "0.6920976", "0.6919768", "0.6905779", "0.689871...
0.8162983
0
Get all categories and products
private function dishes() { $dishes = Category::withDepth()->get(); return $dishes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function index()\n {\n return ProductResource::collection(Product::with('categories')->get())...
[ "0.7847916", "0.7562015", "0.7544103", "0.7483316", "0.747296", "0.74395406", "0.74307346", "0.74288106", "0.7422752", "0.7419979", "0.7396467", "0.7379222", "0.7321731", "0.73175377", "0.73138493", "0.7280005", "0.7275137", "0.7257476", "0.72326714", "0.72205764", "0.721629"...
0.0
-1
Get the identifier that will be stored in the subject claim of the JWT.
public function getJWTIdentifier() { return $this->getKey(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJWTIdentifier() {\n\t\treturn $this->getKey();\n\t}", "public function getJWTIdentifier ()\n {\n return $this->getKey ();\n }", "public function getJWTIdentifier()\r\n {\r\n return $this->getKey();\r\n }", "public function getJWTIdentifier() {\n return $thi...
[ "0.8022506", "0.79442763", "0.793383", "0.7919336", "0.7919336", "0.790567", "0.7897255", "0.7881609", "0.7853495", "0.7852179", "0.7811985", "0.7795977", "0.7616199", "0.75508195", "0.7400087", "0.7308747", "0.7249977", "0.71332055", "0.7071034", "0.70693094", "0.7062757", ...
0.7937569
50
Return a key value array, containing any custom claims to be added to the JWT.
public function getJWTCustomClaims() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJWTCustomClaims() {\n\t\treturn [];\n\t}", "public function getJWTCustomClaims()\r\n {\r\n return [];\r\n }", "public function getJWTCustomClaims()\n {\n return [];\n }", "public function getJWTCustomClaims()\n {\n return [\n 'user...
[ "0.8764855", "0.8671257", "0.86540663", "0.8640748", "0.8637487", "0.8637487", "0.8612947", "0.8612947", "0.8612947", "0.8587336", "0.85843474", "0.8537444", "0.850183", "0.83522093", "0.8341401", "0.8284469", "0.802165", "0.802165", "0.7902688", "0.7604384", "0.7384419", "...
0.8652406
58
uuid for key operation Setup model event hooks
public static function boot() { parent::boot(); self::creating(function ($model) { $model->uuid = (string) Uuid::generate(4); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function bootUuidKey()\n {\n static::creating(function ($model) {\n $model->incrementing = false;\n $model->{$model->getKeyName()} = (string) Uuid::uuid4();\n });\n }", "protected static function bootUsesUuid()\n {\n static::creating(function ($mo...
[ "0.7491565", "0.68932897", "0.6515827", "0.6421836", "0.63342947", "0.63242066", "0.6292294", "0.6284426", "0.62035334", "0.62035334", "0.62031454", "0.62031454", "0.62031454", "0.62031454", "0.62031454", "0.62031454", "0.6115737", "0.61111605", "0.61111605", "0.61111605", "0...
0.5833155
43
Get the route key for the model.
public function getRouteKeyName() { return 'uuid'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteKey();", "public function getRouteKey();", "public function getRouteKey()\n {\n return $this->getAttribute($this->getRouteKeyName());\n }", "public function getRouteKey()\n {\n $slug = $this->slugField();\n\n return $this->$slug;\n }", "public functi...
[ "0.8337987", "0.8337987", "0.83334595", "0.8222846", "0.81179494", "0.8051136", "0.8051136", "0.78780574", "0.7855956", "0.7827925", "0.7806142", "0.7806142", "0.776334", "0.7720968", "0.7720968", "0.76632315", "0.76015264", "0.7569464", "0.7546984", "0.75191367", "0.75191367...
0.6931887
43
Send the password reset notification.
public function sendPasswordResetNotification($token) { $this->notify(new ResetPasswordNotification($token)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendResetPasswordEmail()\n {\n $passwordReset = $this->generateResetPasswordToken();\n\n SendEmailJob::dispatch($this, 'forgot-password', 'Reset Your Password', ['props' => $passwordReset])->onQueue('account-notifications');\n }", "public function sendResetEmail()\n {\n ...
[ "0.8414636", "0.79653764", "0.79469335", "0.78665715", "0.786064", "0.7854703", "0.785211", "0.7841399", "0.7839549", "0.7831625", "0.7826701", "0.7817392", "0.78084904", "0.7804854", "0.7804854", "0.779783", "0.779783", "0.77977175", "0.778931", "0.778931", "0.778931", "0....
0.7748881
58
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "pu...
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315...
0.0
-1
Execute the console command.
public function handle() { /*Global settings*/ $global_settings = Settings::getSettings(); $data = array( 'token' => $global_settings->api_token, 'params' => json_encode(array( 'key' => 'reminder', )) ); $query = http_build_query($data); $job_url = $global_settings->app_url.$this->api_uri.'?'.$query; dispatch(new SendEmail($job_url)); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() meth...
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.614841...
0.0
-1
Translate the given entity, or fall back to the default string if no matching entity exists in the database
public function translate($entity, $string = '', $injectionArray = array()) { $string = $this->findOrCreateString($entity, $string); if ($injectionArray) { $this->inject($string, $injectionArray); } return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function translate($entity, $default, $injection)\n {\n $locale = i18n::get_locale();\n $this->load($locale);\n\n // Prepare arguments\n $arguments = $this->templateInjection($injection);\n\n // Pass to symfony translator\n $result = $this->getTranslator()->trans...
[ "0.636742", "0.62443817", "0.60166895", "0.5987743", "0.5836392", "0.57967097", "0.5741413", "0.5727281", "0.5689897", "0.56705207", "0.5670498", "0.5574586", "0.54856706", "0.5462692", "0.5450244", "0.5393119", "0.53491044", "0.53196996", "0.52994543", "0.52700454", "0.52630...
0.5327924
17
Find a string matching the given entity in the cache, or create one and add it.
protected function findOrCreateString($entity, $string) { $cache = static::get_cache(); $key = md5($entity); // It's not in the cache, which means it might have expired or might be a new entity if (!$result = $cache->load($key)) { $translation = DynamicTranslation::get()->filter(array('Entity' => $entity))->first(); // If no translation exists for this entity, create it if (!$translation) { $translation = DynamicTranslation::create(array('Entity' => $entity, 'String' => $string)); $translation->write(); } $cache->save($translation->String, $key); $result = $translation->String; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function addCache($key, $data)\n {\n \t$class = get_called_class();\n \tBaseEntityAbstract::$_entityCache[$class][$key] = $data;\n \treturn BaseEntityAbstract::$_entityCache[$class][$key];\n }", "public function lookup($key)\r\n {\r\n\t\t// create the unique cache key of the en...
[ "0.5409238", "0.5355655", "0.5323046", "0.5268693", "0.5076938", "0.50654864", "0.5052053", "0.49734613", "0.4970405", "0.49582818", "0.49579415", "0.49021587", "0.48987982", "0.48794687", "0.48473954", "0.48415858", "0.483729", "0.483095", "0.4814251", "0.47787786", "0.47620...
0.6792213
0
$con_obj = new DbConnection\Connection\ConnectionClass();
function __construct() { $con_obj = new ConnectionClass(); $this->con = $con_obj->getConnection(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct() {\n $connector = new DbConnection();\n $conn = $connector->connect(); \n }", "function __construct(){\n $this->con = new db_connect('', '', '', '');\n }", "public function __construct(){\n $this->dbConnection = new database_connection();\n }", "pub...
[ "0.77710795", "0.77560544", "0.77087253", "0.77045643", "0.76372916", "0.75938994", "0.7547636", "0.7504854", "0.7504854", "0.7473856", "0.7472259", "0.74553835", "0.741988", "0.7375569", "0.7364077", "0.7346728", "0.7346728", "0.73274857", "0.73113567", "0.72998565", "0.7296...
0.7664956
4
Create a new command instance.
public function __construct(Client $client) { parent::__construct(); $this->client = $client; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "pu...
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315...
0.0
-1
used to search for content
function contentSearch(&$searchObj, &$searchResObj) { try { $pdo = new PDO(DBCONNSTRING, DBUSER,DBPASS); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT Title, Message, PostID FROM travelpost WHERE Message LIKE '%$searchObj->searchField%'"; $result = $pdo->query($sql); $count = 0; while ($row = $result->fetch()) { $searchResObj[$count] = new searchResult(); $searchResObj[$count]->searchTitle = $row['Title']; $searchResObj[$count]->searchMessage = $row['Message']; $searchResObj[$count]->searchPostID = $row['PostID']; $count++; } } catch (PDOexception $e) { ERROR_PAGE(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchSubContent()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set branch to search to a variable.\n $branch = $this->getSearchBranch();\n ...
[ "0.74671775", "0.71551275", "0.68631434", "0.67409915", "0.6718302", "0.66995513", "0.6674076", "0.6674076", "0.66134167", "0.6576541", "0.64848924", "0.64848924", "0.6457869", "0.631924", "0.62817067", "0.6259428", "0.6253272", "0.6231644", "0.6219697", "0.6219697", "0.62189...
0.6296356
14
used to search for title
function titleSearch(&$searchObj, &$searchResObj) { try { $pdo = new PDO(DBCONNSTRING, DBUSER,DBPASS); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT Title, Message, PostID FROM travelpost WHERE Title LIKE '%$searchObj->searchField%'"; $result = $pdo->query($sql); $count = 0; while ($row = $result->fetch()) { $searchResObj[$count] = new searchResult(); $searchResObj[$count]->searchTitle = $row['Title']; $searchResObj[$count]->searchMessage = $row['Message']; $searchResObj[$count]->searchPostID = $row['PostID']; $count++; } } catch (PDOexception $e) { ERROR_PAGE(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchByTitle($title){\n $name = $title['search'];\n return db()->QUERY(\"SELECT * FROM posts WHERE title LIKE '%$name%' ORDER BY title\");\n }", "function edan_search_set_title( $title )\n {\n $options = new esw_options_handler();\n $cache = new esw_cache_handler();\n\n /**...
[ "0.76616776", "0.76014113", "0.75062275", "0.7358372", "0.73009014", "0.72854674", "0.72344375", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113", "0.7219113...
0.0
-1
Exibe o destaque de conteudo
function smarty_function_PUBLICA_Blog_printTags($params, &$smarty) { global $conexao; // Defines SECTION ID if(!isset($params['blogSectionID']) || !is_numeric($params['blogSectionID'])) { $params['blogSectionID'] = $smarty->_tpl_vars['SECAO']; } if(is_null($params['blogSectionID']) || !is_numeric($params['blogSectionID']) || $params['blogSectionID'] <= 0) return; // Defines LANGUAGE ID if(!isset($params['languageId']) || !is_numeric($params['languageId'])) { $params['languageId'] = $smarty->_tpl_vars['IDIOMA']; } if(is_null($params['languageId']) || !is_numeric($params['languageId']) || $params['languageId'] <= 0) return; // Defines DB Entity's TAG field if(!isset($params['blogTagField']) || empty($params['blogTagField'])) return; // Defines LINK SEPARATOR if(!isset($params['linkSeparator']) || empty($params['linkSeparator'])) { $params['linkSeparator'] = '<br /><br />'; } // Defines QUERY LIMIT if(!isset($params['tableLimit']) || empty($params['tableLimit'])) { $params['tableLimit'] = 50; } // Gets BLOG TAGS data $objSection = fnConfigSecao($params['blogSectionID']); $strWhere = str_replace('bb_delete' ,$objSection->bt_tabela.'.bb_delete' ,REFINAMENTO); $strWhere = str_replace('bb_ativo' ,$objSection->bt_tabela.'.bb_ativo' ,$strWhere); $strWhere = str_replace('bd_publicacao' ,$objSection->bt_tabela.'.bd_publicacao',$strWhere); $strWhere = str_replace('bd_expiracao' ,$objSection->bt_tabela.'.bd_expiracao' ,$strWhere); $strWhere .= ' AND ' . $objSection->bt_tabela . '.tb_idioma_bn_id = ' . $params['languageId']; $strWhere .= ' AND ' . $objSection->bt_tabela . '.' . $params['blogTagField'] .' != ""'; $strWhere .= ' AND ' . $objSection->bt_tabela . '.' . $params['blogTagField'] .' IS NOT NULL'; $strQuery = 'SELECT '.$params['blogTagField'].' FROM '.$objSection->bt_tabela.' WHERE '.$strWhere.' LIMIT '.$params['tableLimit'].';'; $arrQuery = $conexao->getCol($strQuery); $strTags = implode(',',$arrQuery); // Configures TAG link $arrTags = explode(',',$strTags); $arrTags = array_unique($arrTags); // Sets HREF link for each tag foreach($arrTags AS &$strTag) { $strTag = '<a href="'.HTTP_DINAMICO.'/index.php?'.IN_SECAO.'='.$smarty->_tpl_vars['SECAO'].'&'.IB_BUSCA.'=1&'.$params['field'].'='.trim(strtolower($strTag)).'">'.trim(strtolower($strTag)).'</a>'; } return implode($params['linkSeparator'],$arrTags); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function copiardespesasAction () {\n // exercicio a ser copiado\n $ano = $this->_getParam('cod');\n\n // sem ano\n if (!$ano) {\n $this->erroOperacao(Orcamento_Business_Dados::MSG_COPIARDESPESA_ERRO . ' Ano Exercicio não informado!');\n $this->voltarIndexAct...
[ "0.6134156", "0.5899654", "0.581045", "0.57769907", "0.57192165", "0.57019126", "0.5690056", "0.56530267", "0.5617676", "0.55407274", "0.54955906", "0.548153", "0.5451629", "0.54102397", "0.5401806", "0.5391241", "0.5373531", "0.5367606", "0.5363818", "0.53325856", "0.5320039...
0.0
-1
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'."); $this->addSql("ALTER TABLE opportunity CHANGE policy_number policy_number VARCHAR(255) DEFAULT NULL, CHANGE effective_dt effective_dt VARCHAR(255) DEFAULT NULL, CHANGE line_code line_code VARCHAR(255) DEFAULT NULL, CHANGE lsp_code lsp_code VARCHAR(255) DEFAULT NULL, CHANGE renewal_count renewal_count VARCHAR(255) DEFAULT NULL, CHANGE premium premium VARCHAR(255) DEFAULT NULL, CHANGE vehicle_count vehicle_count VARCHAR(255) DEFAULT NULL, CHANGE homeowners_count homeowners_count VARCHAR(255) DEFAULT NULL"); }
{ "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.80062366", "0.79145443", "0.79145443", "0.79145443", "0.7572342", "0.756089", "0.75283176", "0.7498379", "0.7493237", "0.7453656", "0.74463314", "0.7433381", "0.74307704", "0.7427088", "0.741794", "0.73779047", "0.7374933", "0.7370453", "0.73637444", "0.73505706", "0.73290...
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'."); $this->addSql("ALTER TABLE opportunity CHANGE policy_number policy_number VARCHAR(255) NOT NULL, CHANGE effective_dt effective_dt VARCHAR(255) NOT NULL, CHANGE line_code line_code VARCHAR(255) NOT NULL, CHANGE lsp_code lsp_code VARCHAR(255) NOT NULL, CHANGE renewal_count renewal_count VARCHAR(255) NOT NULL, CHANGE premium premium VARCHAR(255) NOT NULL, CHANGE vehicle_count vehicle_count VARCHAR(255) NOT NULL, CHANGE homeowners_count homeowners_count VARCHAR(255) NOT NULL"); }
{ "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.7949478", "0.78628796", "0.76056504", "0.7492771", "0.73195237", "0.72439474", "0.7186118", "0.71521056", "0.71513444", "0.7140365", "0.71351665", "0.7120544", "0.7113998", "0.7105184", "0.7096303", "0.7077934", "0.7076472", "0.70710033", "0.7067188", "0.7064501", "0.70511...
0.0
-1
Gets the namesapce of this class
public function getNamespace() { return self::WSDL_NAMESPACE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_namespace() : string\n {\n return $this->namespace;\n }", "public function getNamespace()\n {\n return $this->_namespace;\n }", "public function getNamespacedName()\n {\n return get_class();\n }", "public function getNamespace(): string\n {\n ...
[ "0.81921434", "0.8160702", "0.81592107", "0.814244", "0.814244", "0.8110334", "0.80789226", "0.80626845", "0.80529875", "0.80317134", "0.80287707", "0.80287707", "0.80287707", "0.80287707", "0.80287707", "0.80287707", "0.80287707", "0.80287707", "0.80287707", "0.80287707", "0...
0.0
-1
Gets the xsi:type name of this class
public function getXsiTypeName() { return self::XSI_TYPE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeName()\n {\n return $this->type->getName();\n }", "public function getTypeName()\n {\n return $this->type_name;\n }", "public function getTypeNameAttribute();", "public function getTypeName()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typename'] ) ) {...
[ "0.7552115", "0.7496433", "0.73505104", "0.7287253", "0.72282636", "0.72205293", "0.71895033", "0.7164006", "0.7039154", "0.7031914", "0.702775", "0.7020926", "0.69858915", "0.69579107", "0.6893087", "0.6886493", "0.68722534", "0.6866441", "0.6864917", "0.68632096", "0.686061...
0.0
-1
Seed the application's database.
public function run() { $this->call([ //DepartmentTableSeeder::class, //IndicatorTypeTableSeeder::class, EmployeeIndicatorTableSeeder::class, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=...
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801",...
0.0
-1
Generated from protobuf field float score = 1;
public function getScore() { return $this->score; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setScore($var)\n {\n GPBUtil::checkFloat($var);\n $this->score = $var;\n\n return $this;\n }", "public function setScore($var)\n {\n GPBUtil::checkFloat($var);\n $this->score = $var;\n\n return $this;\n }", "public function getScore() : int{...
[ "0.7095722", "0.7095722", "0.67662615", "0.67303276", "0.6714648", "0.6710551", "0.67060196", "0.65232396", "0.6488983", "0.6413199", "0.64010215", "0.6375659", "0.6287169", "0.6229824", "0.6150764", "0.61242944", "0.609062", "0.6087809", "0.6084411", "0.60800546", "0.6019348...
0.6787265
5
Generated from protobuf field float score = 1;
public function setScore($var) { GPBUtil::checkFloat($var); $this->score = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public func...
[ "0.6787265", "0.6787265", "0.6787265", "0.6787265", "0.67662615", "0.67303276", "0.6714648", "0.6710551", "0.67060196", "0.65232396", "0.6488983", "0.6413199", "0.64010215", "0.6375659", "0.6287169", "0.6229824", "0.6150764", "0.61242944", "0.609062", "0.6087809", "0.6084411"...
0.7095722
1
Generated from protobuf field .Rect location = 2;
public function getLocation() { return $this->location; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLocation($var)\n {\n GPBUtil::checkMessage($var, \\Rect::class);\n $this->location = $var;\n\n return $this;\n }", "public function getRect() {}", "public function rect($x, $y, $width, $height) {}", "public function getRectangle() {}", "public function setRect(...
[ "0.69350255", "0.688255", "0.61259276", "0.6108282", "0.59763074", "0.5968003", "0.5953375", "0.59226847", "0.56285876", "0.5618909", "0.55072004", "0.53764987", "0.5330377", "0.5321184", "0.5273294", "0.51717216", "0.5141965", "0.50781566", "0.5065568", "0.5065568", "0.50655...
0.0
-1
Generated from protobuf field .Rect location = 2;
public function setLocation($var) { GPBUtil::checkMessage($var, \Rect::class); $this->location = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRect() {}", "public function rect($x, $y, $width, $height) {}", "public function getRectangle() {}", "public function setRect(\\SetaPDF_Core_DataStructure_Rectangle $rect) {}", "public abstract function getBoundingBox(): Rectangle;", "public function rect($x1, $y1, $width, $height, $st...
[ "0.688255", "0.61259276", "0.6108282", "0.59763074", "0.5968003", "0.5953375", "0.59226847", "0.56285876", "0.5618909", "0.55072004", "0.53764987", "0.5330377", "0.5321184", "0.5273294", "0.51717216", "0.5141965", "0.50781566", "0.5065568", "0.5065568", "0.5065568", "0.506556...
0.69350255
0
Generated from protobuf field int32 detection_id = 3;
public function getDetectionId() { return $this->detection_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDetectionId($var)\n {\n GPBUtil::checkInt32($var);\n $this->detection_id = $var;\n\n return $this;\n }", "public function getDetectionClass()\n {\n return $this->detection_class;\n }", "public function getId() {\n\t\treturn (string) $this->photo['id'];...
[ "0.7037807", "0.5350284", "0.5243273", "0.5230687", "0.5138672", "0.5099635", "0.50109506", "0.49675262", "0.494784", "0.49134162", "0.48817244", "0.48485684", "0.48055425", "0.4771033", "0.47501564", "0.47292325", "0.47213992", "0.47014728", "0.4695155", "0.4649501", "0.4636...
0.7689458
0
Generated from protobuf field int32 detection_id = 3;
public function setDetectionId($var) { GPBUtil::checkInt32($var); $this->detection_id = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDetectionId()\n {\n return $this->detection_id;\n }", "public function getDetectionClass()\n {\n return $this->detection_class;\n }", "public function getId() {\n\t\treturn (string) $this->photo['id'];\n\t}", "public function getGamerId()\n {\n $value = ...
[ "0.7689458", "0.5350284", "0.5243273", "0.5230687", "0.5138672", "0.5099635", "0.50109506", "0.49675262", "0.494784", "0.49134162", "0.48817244", "0.48485684", "0.48055425", "0.4771033", "0.47501564", "0.47292325", "0.47213992", "0.47014728", "0.4695155", "0.4649501", "0.4636...
0.7037807
1
Generated from protobuf field string detection_class = 4;
public function getDetectionClass() { return $this->detection_class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDetectionClass($var)\n {\n GPBUtil::checkString($var, True);\n $this->detection_class = $var;\n\n return $this;\n }", "abstract public static function detect();", "public function getDetectionId()\n {\n return $this->detection_id;\n }", "public funct...
[ "0.76851404", "0.5568269", "0.5485261", "0.5476471", "0.5427775", "0.52677506", "0.5258469", "0.5161848", "0.49667016", "0.4836566", "0.48180425", "0.4815602", "0.47887242", "0.47630548", "0.475217", "0.46893963", "0.4687226", "0.46643898", "0.4662026", "0.46571922", "0.46397...
0.7694972
0
Generated from protobuf field string detection_class = 4;
public function setDetectionClass($var) { GPBUtil::checkString($var, True); $this->detection_class = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDetectionClass()\n {\n return $this->detection_class;\n }", "abstract public static function detect();", "public function getDetectionId()\n {\n return $this->detection_id;\n }", "public function detector(): Detect;", "public function getClassification()\n {\...
[ "0.7694972", "0.5568269", "0.5485261", "0.5476471", "0.5427775", "0.52677506", "0.5258469", "0.5161848", "0.49667016", "0.4836566", "0.48180425", "0.4815602", "0.47887242", "0.47630548", "0.475217", "0.46893963", "0.4687226", "0.46643898", "0.4662026", "0.46571922", "0.463972...
0.76851404
1
Generated from protobuf field repeated .Attribute attributes = 5;
public function getAttributes() { return $this->attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAttributes($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Attribute::class);\n $this->attributes = $arr;\n\n return $this;\n }", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "public fun...
[ "0.6291132", "0.61131626", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.6035549", "0.6022645", "0.60178375", "0.60088575", "0.5990631", "0.597444", "0.5972229", "0.59627765", "0.59532726", "0....
0.0
-1
Generated from protobuf field repeated .Attribute attributes = 5;
public function setAttributes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Attribute::class); $this->attributes = $arr; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n ...
[ "0.61131626", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.60453475", "0.6035549", "0.6022645", "0.60178375", "0.60088575", "0.5990631", "0.597444", "0.5972229", "0.59627765", "0.59532726", "0.59532726", "0...
0.6291132
0
get achievement main category
function achieve_get_main_category() { global $sql; $main_cat = array(); $result = $sql["dbc"]->query("SELECT ID, Name FROM achievement_category WHERE ParentID=-1 and ID<>1 ORDER BY `GroupID` ASC"); while ($main_cat[] = $sql["dbc"]->fetch_assoc($result)); return $main_cat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function getAchievementCategories() { return $this->Achieve...
[ "0.6870378", "0.6870378", "0.6870378", "0.6811938", "0.6756315", "0.66453063", "0.6571418", "0.650833", "0.64865017", "0.64717835", "0.64717835", "0.644416", "0.6429914", "0.64065254", "0.6350811", "0.6332416", "0.63123274", "0.62535274", "0.62401485", "0.61982644", "0.619507...
0.7274885
0
get achievement sub category
function achieve_get_sub_category() { global $sql; $sub_cat = array(); $result = $sql["dbc"]->query("SELECT ID, ParentID, Name FROM achievement_category WHERE ParentID<>-1 ORDER BY `GroupID` ASC"); $temp = $sql["dbc"]->fetch_assoc($result); while ($sub_cat[$temp["ParentID"]][$temp["ID"]] = $temp["Name"]) { $temp = $sql["dbc"]->fetch_assoc($result); } return $sub_cat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function achieve_get_main_category()\r\n{\r\n global $sql;\r\n\r\n $main_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, Name FROM achievement_category WHERE ParentID=-1 and ID<>1 ORDER BY `GroupID` ASC\");\r\n while ($main_cat[] = $sql[\"dbc\"]->fetch_assoc($result));\r\n return $main_cat;\r\n...
[ "0.72061515", "0.6711597", "0.6661108", "0.6615862", "0.65241337", "0.63100463", "0.63100463", "0.627684", "0.6225231", "0.6208588", "0.61809105", "0.6161485", "0.6149699", "0.6127967", "0.6127967", "0.6127967", "0.611247", "0.6107959", "0.60363334", "0.60246027", "0.60006267...
0.7583286
0
get achievement details by its id
function achieve_get_details($id) { global $sql; $result = ($sql["dbc"]->query("SELECT id, name, description, reward, points FROM achievement WHERE id='".$id."' LIMIT 1")); $details = $sql["dbc"]->fetch_assoc($result); return $details; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAchievementById($achievementId)\n {\n $data = $this->db->query(\n 'SELECT id, charactergroupsgroup_id, pos, title, url, hash, description, achievementsmedia_id '.\n 'FROM charactergroupsachievements '.\n 'WHERE id = ?',\n ...
[ "0.69263995", "0.67529386", "0.64793265", "0.64174473", "0.6417173", "0.6373577", "0.630916", "0.62361795", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923", "0.620923"...
0.74833083
0
get achievement icon if icon not exists in item_icons folder D/L it from web.
function achieve_get_icon($achieveid) { global $proxy_cfg, $get_icons_from_web, $item_icons, $sql; $result = $sql["dbc"]->query("SELECT spellIcon FROM achievement WHERE id='".$achieveid."' LIMIT 1"); if ($result) $displayid = $sql["dbc"]->result($result, 0); else $displayid = 0; if ($displayid) { $result = $sql["dbc"]->query("SELECT Name FROM spellicon WHERE ID='".$displayid."' LIMIT 1"); if($result) { $achieve = $sql["dbc"]->result($result, 0); // this_is_junk: we now extract data unaltered from the DBCs, so the spell icons have paths, // we remove them. // The parser reads \ as starting an escape sequence, so we have to // escape to make \ $temp = explode("\\", $achieve); // get the last field $achieve = $temp[count($temp) - 1]; if ($achieve) { //if (file_exists(''.$item_icons.'/'.$achieve.'.png')) //{ //if (filesize(''.$item_icons.'/'.$achieve.'.png') > 349) //{ return ''.$item_icons.'/'.$achieve.'.png'; //} //else //{ // this_is_junk: disabled deletion from DBC data //$sql["mgr"]->query('DELETE FROM spellicon WHERE id = '.$displayid.''); //if (file_exists(''.$item_icons.'/'.$achieve.'.png')) // unlink(''.$item_icons.'/'.$achieve.'.png'); //$achieve = ''; //} //} //else //$achieve = ''; } else $achieve = ''; } else $achieve = ''; } else $achieve = ''; // this_is_junk: yeah, this doesn't work, live with it. :) /*if($get_icons_from_web) { $xmlfilepath='http://www.wowhead.com/?achievement='; $proxy = $proxy_cfg["addr"]; $port = $proxy_cfg["port"]; if (empty($proxy_cfg["addr"])) { $proxy = 'www.wowhead.com'; $xmlfilepath = '?achievement='; $port = 80; } if ($achieve == '') { //get the icon name $fp = @fsockopen($proxy, $port, $errno, $errstr, 0.5); if ($fp); else return 'img/INV/INV_blank_32.gif'; $out = "GET /$xmlfilepath$achieveid HTTP/1.0\r\nHost: www.wowhead.com\r\n"; if (isset($proxy_cfg["user"])) $out .= "Proxy-Authorization: Basic ". base64_encode ("{$proxy_cfg["user"]}:{$proxy_cfg["pass"]}")."\r\n"; $out .="Connection: Close\r\n\r\n"; $temp = ''; fwrite($fp, $out); while ($fp && !feof($fp)) $temp .= fgets($fp, 4096); fclose($fp); $wowhead_string = $temp; $temp_string1 = strstr($wowhead_string, 'Icon.create('); $temp_string2 = substr($temp_string1, 12, 50); $temp_string3 = strtok($temp_string2, ','); $temp_string4 = substr($temp_string3, 1, strlen($temp_string3) - 2); $achieve_icon_name = $temp_string4; $achieve = $achieve_icon_name; } if (file_exists(''.$item_icons.'/'.$achieve.'.jpg')) { if (filesize(''.$item_icons.'/'.$achieve.'.jpg') > 349) { $sql["mgr"]->query('REPLACE INTO dbc_spellicon (id, name) VALUES (\''.$displayid.'\', \''.$achieve.'\')'); return ''.$item_icons.'/'.$achieve.'.jpg'; } else { $sql["mgr"]->query('DELETE FROM dbc_spellicon WHERE id = '.$displayid.''); if (file_exists(''.$item_icons.'/'.$achieve.'.jpg')) unlink(''.$item_icons.'/'.$achieve.'.jpg'); } } //get the icon itself if (empty($proxy_cfg["addr"])) { $proxy = 'static.wowhead.com'; $port = 80; } $fp = @fsockopen($proxy, $port, $errno, $errstr, 0.5); if ($fp); else return 'img/INV/INV_blank_32.gif'; $iconfilename = strtolower($achieve); $file = 'http://static.wowhead.com/images/icons/medium/'.$iconfilename.'.jpg'; $out = "GET $file HTTP/1.0\r\nHost: static.wowhead.com\r\n"; if (isset($proxy_cfg["user"])) $out .= "Proxy-Authorization: Basic ". base64_encode ("{$proxy_cfg["user"]}:{$proxy_cfg["pass"]}")."\r\n"; $out .="Connection: Close\r\n\r\n"; fwrite($fp, $out); //remove header while ($fp && !feof($fp)) { $headerbuffer = fgets($fp, 4096); if (urlencode($headerbuffer) == '%0D%0A') break; } if (file_exists(''.$item_icons.'/'.$achieve.'.jpg')) { if (filesize(''.$item_icons.'/'.$achieve.'.jpg') > 349) { $sql["mgr"]->query('REPLACE INTO dbc_spellicon (id, name) VALUES (\''.$displayid.'\', \''.$achieve.'\')'); return ''.$item_icons.'/'.$achieve.'.jpg'; } else { $sql["mgr"]->query('DELETE FROM dbc_spellicon WHERE id = '.$displayid.''); if (file_exists(''.$item_icons.'/'.$achieve.'.jpg')) unlink(''.$item_icons.'/'.$achieve.'.jpg'); } } $img_file = fopen(''.$item_icons.'/'.$achieve.'.jpg', 'wb'); while (!feof($fp)) fwrite($img_file,fgets($fp, 4096)); fclose($fp); fclose($img_file); if (file_exists(''.$item_icons.'/'.$achieve.'.jpg')) { if (filesize(''.$item_icons.'/'.$achieve.'.jpg') > 349) { $sql["mgr"]->query('REPLACE INTO dbc_spellicon (id, name) VALUES (\''.$displayid.'\', \''.$achieve.'\')'); return ''.$item_icons.'/'.$achieve.'.jpg'; } else { $sql["mgr"]->query('DELETE FROM dbc_spellicon WHERE id = '.$displayid.''); if (file_exists(''.$item_icons.'/'.$achieve.'.jpg')) unlink(''.$item_icons.'/'.$achieve.'.jpg'); } } else return 'img/INV/INV_blank_32.gif'; } else return 'img/INV/INV_blank_32.gif';*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAchievementIcon($id)\n{\n\tglobal $wowhead_url;\n\t\n\t$data = getXML($wowhead_url . '?achievement=' . $id . '&power');\n\t\n\tif (preg_match('#icon: \\'(.+?)\\'#', $data, $match))\n\t{\n\t\t// icon found\n\t\treturn 'http://static.wowhead.com/images/icons/small/' . strtolower($match[1]) . '.jpg';\t\n\...
[ "0.7616838", "0.6804254", "0.6631242", "0.66083825", "0.66083825", "0.65563077", "0.6525396", "0.6508459", "0.64941746", "0.64858323", "0.64612895", "0.64612895", "0.64140487", "0.6406971", "0.64009464", "0.64009464", "0.63777065", "0.6350124", "0.6323305", "0.6322778", "0.63...
0.7307229
1
/ Get all registers
public function index(){ return response('', 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAll () {\n\t\treturn self::$registered;\n\t}", "public function get_all_registered()\n {\n }", "public function get_all_registered()\n {\n }", "public static function getRegister(): array\n {\n return self::$smartObjectRegistry;\n }", "publ...
[ "0.73411006", "0.7172164", "0.71718735", "0.6765037", "0.66621834", "0.65668947", "0.6514394", "0.6473284", "0.6411786", "0.63999546", "0.63980967", "0.63779503", "0.6104313", "0.6034639", "0.6034099", "0.6002423", "0.5978554", "0.59603757", "0.5959748", "0.59521896", "0.5950...
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "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
Show the application dashboard.
public function index() { return view('post-ad'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n ...
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", ...
0.0
-1
the message what Cellphone owner sent
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSender();", "function send($mobile, $message);", "private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyNam...
[ "0.6384896", "0.6372798", "0.62950754", "0.6246455", "0.61813164", "0.6170519", "0.6138022", "0.6094455", "0.6093675", "0.609027", "0.60554165", "0.6049883", "0.6039088", "0.60387176", "0.6021386", "0.5996868", "0.5995525", "0.59379286", "0.5917536", "0.5892812", "0.58845145"...
0.0
-1
This mutator automatically hashes the password.
public function setPasswordAttribute($value) { $this->attributes['password'] = \Hash::make($value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password...
[ "0.8286334", "0.7739545", "0.74000955", "0.7222097", "0.7111218", "0.70557946", "0.70557946", "0.70360094", "0.6991346", "0.69707537", "0.69224626", "0.69224626", "0.69224626", "0.69224626", "0.69224626", "0.69224626", "0.69224626", "0.69224626", "0.69224626", "0.6910729", "0...
0.67481446
28
Set data for view
public function setData($data): void { $this->data = $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setViewData($data)\n {\n $this->__viewData = $data;\n }", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data) { \n ...
[ "0.7992062", "0.74339914", "0.74339914", "0.74339914", "0.74339914", "0.74339914", "0.74065036", "0.7346793", "0.72548413", "0.7232557", "0.7224466", "0.71499527", "0.7145622", "0.7138475", "0.7138475", "0.7138475", "0.71380305", "0.71154964", "0.71154964", "0.71154964", "0.7...
0.63650095
62
Generic listener to automatically handle Rich Media tags based on their name in Config rich_media_types list. Calls the class' shortCode static method so that everything relating to a Rich Media type can be self contained and automatically wired up.
public static function onShortCode(ShortcodeInterface $s): ?string { if ($class = Config::get('rich_media_types.' . $s->getName())) { if (($media = RichMedia::get($s->getBbCode())) instanceof $class) { return $media->shortCode($s); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init()\n\t{\n\t\t$this->setType(\"media\");\n\t}", "protected function get_media_types()\n {\n }", "function _media(string $name, array $types = [], string $unsupportedMessage = '', string $attributes = '', array $tracks = []): string\n {\n $media = '<' . $name;\n\n if (...
[ "0.541624", "0.53461957", "0.52716696", "0.5211195", "0.5143661", "0.5046985", "0.49558833", "0.49090797", "0.4901786", "0.4894322", "0.48824316", "0.48716798", "0.48538268", "0.48229924", "0.4812761", "0.4812294", "0.4791092", "0.47881782", "0.47847483", "0.47798", "0.477367...
0.45900938
35
URL shortcodes for making links to arbitrary URLs
public static function onShortCode_url(ShortcodeInterface $s): ?string { $url = $s->getBbCode(); if (filter_var($url, FILTER_VALIDATE_URL)) { // set up URL $link = (new A) ->setAttribute('href', $url) ->addClassString($s->getParameter('class', '')) ->addChild($s->getContent() ? $s->getContent() : preg_replace('/^(https?:)?\/\//', '', $url)); // return built link return $link; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shorten($link, $customUrl = false);", "function _shortenURL(&$ret){\n\t $links = explode('<a', $ret);\n\t $countlinks = count($links);\n\t for ($i = 0; $i < $countlinks; $i++){\n\t\t\t$link = $links[$i];\t\t\t\n\t\t\t$link = (preg_match('#(.*)(href=\")#is', $link)) ? '<a' . $link : $link;\n...
[ "0.74473923", "0.7066896", "0.6849408", "0.66976875", "0.66334164", "0.6516825", "0.64846766", "0.64423096", "0.64423096", "0.6397598", "0.6391207", "0.6385083", "0.6372463", "0.63485956", "0.6347299", "0.63143855", "0.6309495", "0.6280028", "0.6266572", "0.6250881", "0.62463...
0.62820965
17
Obfuscate a link to an email address
public static function onShortCode_email(ShortcodeInterface $s): ?string { $email = $s->getBbCode() ?? $s->getContent(); $content = $s->getContent() ? $s->getContent() : $email; return Format::base64obfuscate(sprintf('<a href="mailto:%s">%s</a>', $email, $content)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emc_obfuscate_mailto_url( $email ) {\r\n\r\n\tif ( ! is_email( $email ) ) return false;\r\n\r\n\t$email = 'mailto:' . antispambot( $email );\r\n\r\n\treturn esc_url( $email );\r\n\r\n}", "function obfuscate_email($email) {\n\t$out = \"\";\n\t$len = strlen($email);\n\n\tfor($i = 0; $i < $len; $i++)\n\t\t...
[ "0.7854981", "0.74659467", "0.7437037", "0.69336855", "0.684619", "0.6666597", "0.6636516", "0.6564037", "0.6503394", "0.64611846", "0.63658756", "0.634576", "0.6335928", "0.63144755", "0.6280349", "0.6246685", "0.6207493", "0.61526746", "0.6149468", "0.611965", "0.6087068", ...
0.62260145
16
Handle link shortcodes, which can be to either pages or static routes
public static function onShortCode_link(ShortcodeInterface $s): ?string { if (!$s->getBbCode()) { // nothing is specified, just use context URL route and optional index $url = Context::url(); $route = Context::url()->route(); $action = $s->getParameter('action', 'index'); } else { // otherwise we have to take a closer look at what was specified // check if bbcode value looks like it has a filename at the end $query = trim($s->getBbCode(), '/'); if (preg_match('@\.[a-z0-9]+$@', $query)) { // route is bbcode value with filename stripped $route = preg_replace('@[^\\]\.([a-z0-9]+$@', '', $query); $action = substr($query, strlen($route) + 1); // still allow action parameter to override URL $action = $s->getParameter('action', $action); $url = new URL("/$route/$action"); } else { // route looks like a clean route with no filename $route = $query; $action = $s->getParameter('action', 'index'); $url = new URL("/$route/"); } } // keep running list of everything this could refer to /** array<int,array{url:URL,title:string}> */ $options = []; // check if there's a static route if (Router::staticRouteExists($route, $action)) { $static_url = new URL("/~$route/"); $static_url->setAction($action); $options[] = [ 'url' => $static_url, 'title' => $static_url->name(), ]; } // search for pages this URL might refer to foreach (Pages::getAll($route) as $page) { $page_url = $page->url($action); $options[] = [ 'url' => $page_url, 'title' => $page_url->name(), ]; } // prepare link title if (count($options) == 0) { $title = 'unknown link'; } elseif (count($options) == 1) { $title = $options[0]['title']; $url = $options[0]['url']; } else { $title = sprintf( 'ambiguous link: %s', implode( ', ', array_map( fn($e) => '"' . $e['title'] . '"', $options ) ) ); } // build link $link = (new A) ->setAttribute('href', $url) ->setAttribute('title', $title) ->addClassString($s->getParameter('class', '')) ->addChild(new Text($s->getContent() ? $s->getContent() : $title)); if (count($options) > 1) $link->addClass('link--multiple-options'); return $link; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shorten($link, $customUrl = false);", "function cd_post_slug_remove_short( $post_link, $post, $leavename ) { \r\n if ( 'cd-short' != $post->post_type || 'publish' != $post->post_status ) {\r\n return $post_link;\r\n }\r\n \r\n $post_link = str_replace( '/' . $post->post_type . '/'...
[ "0.63869464", "0.616263", "0.59983164", "0.5941541", "0.58979756", "0.5891951", "0.5857824", "0.5832499", "0.5766316", "0.57296956", "0.56240636", "0.5621851", "0.5607566", "0.55779934", "0.55398136", "0.5509105", "0.55075", "0.55037385", "0.5498538", "0.5463773", "0.54482055...
0.6629646
0
Generate an App key for this integration (alternatively, use our UI here:
public static function pt_generate_app_key($apiKey, $name, $description = '', $contactEmail = '', $siteUrl = '') : array { $data = array( 'name' => $name, 'description' => $description, 'contactEmail' => $contactEmail, 'siteUrl' => $siteUrl ); $ch = curl_init('https://api.perfecttense.com/generateAppKey'); curl_setopt_array($ch, array( CURLOPT_POST => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HTTPHEADER => array( "Content-type: application/json", "Authorization: " . $apiKey ), CURLOPT_POSTFIELDS => json_encode($data) )); $response = curl_exec($ch); if ($response === FALSE) { die(curl_error($ch)); } $responseData = json_decode($response, TRUE); return $responseData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAppKey();", "public function getAppKey(): string;", "public function generateKey(Application $app)\n {\n $bytes = random_bytes(16);\n $api_key = bin2hex($bytes);\n $this->addExampleRecords($app, $api_key);\n return ['key' => $api_key];\n }", "public functi...
[ "0.7830329", "0.77915543", "0.75585383", "0.7445607", "0.7222233", "0.7200456", "0.7125401", "0.7037864", "0.7037864", "0.7027989", "0.7027989", "0.6983278", "0.6980573", "0.69767153", "0.69737273", "0.694151", "0.6902508", "0.68873215", "0.6885941", "0.68362415", "0.68250746...
0.0
-1