query stringlengths 9 43.3k | document stringlengths 17 1.17M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2 values |
|---|---|---|---|---|---|---|
Function to save chat messages and relay to recepient | public function action_chat() {
$recepient = $this->request->param('id');
$sender = $this->_current_user;
$avatar = ($sender->personnel_info->personnel_avatar) ? $sender->personnel_info->personnel_avatar : 'default.png';
//STEP1: Save the chat message;
$message = ORM::factory('Message');
$message->values($this->request->post());
$message->sender = $sender;
$message->recepient = $recepient;
$message->time = time();
try {
$message->save();
//STEP2: Send Chat Notification to Recepient
$date = gmdate('m/d/Y H:i:s', $message->time) . " UTC";
$payload = array(
'msg_id' => $message->message_id,
'msg' => $message->message,
'time' => $date,
'id' => $sender->id,
'username' => $sender->username,
'avatar' => 'assets/avatars/' . $avatar,
"local_time" => Date::local_time("now", "m/d/Y H:i:s", "UTC")
);
$this->_push('appchat', $payload, array(
'id' => $recepient,
'pushUid'=> Kohana::$config->load("pusher.pushUid")
));
$this->_set_msg('Successful sent message', 'success', $payload);
} catch(ORM_Validation_Exception $e) {
$this->_set_msg('Someone slept on the job', 'error', TRUE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $res... | [
"0.6664889",
"0.6569174",
"0.65105015",
"0.64977884",
"0.6429702",
"0.6415614",
"0.6414149",
"0.62557876",
"0.6244839",
"0.62010616",
"0.6194378",
"0.6177268",
"0.61681765",
"0.6135774",
"0.6078879",
"0.60549617",
"0.6047958",
"0.6035952",
"0.60296375",
"0.60248077",
"0.60204... | 0.7232398 | 0 |
Function to retrieve offline messages from a particular user | public function action_offline_messages() {
$sender = $this->request->param('id');
$offline_messages = ORM::factory('Message')->get_offline_messages($this->_current_user->id, $sender);
$this->_set_msg('Offline Messages Retrieved', 'success', $offline_messages);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function messages_by_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByUserID($uid, $skip, $limit);\n\t\t\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages... | [
"0.6780795",
"0.674822",
"0.6740253",
"0.67117596",
"0.65558434",
"0.65558434",
"0.651822",
"0.6502502",
"0.6500644",
"0.6482182",
"0.6426987",
"0.6404993",
"0.63747907",
"0.6374496",
"0.63287437",
"0.63178515",
"0.62996584",
"0.6279364",
"0.62371874",
"0.62257695",
"0.621837... | 0.77622706 | 0 |
Function to mark many messages as read | public function action_mark_all_as_read() {
if($this->request->param('id')) {
$sender = ORM::factory("User", $this->request->param('id'));
$messages = ORM::factory('Message')->where("sender", '=', $sender->id)->find_all();
foreach ($messages as $message) {
$model = ORM::factory('Message', $message->message_id);
try {
$model->read = 1;
$model->save();
} catch(Exception $e) {
$this->_set_msg('Failed to mark as read', 'error');
}
}
$this->_set_msg("All conversations with " . $sender->personnel_info->personnel_name . ' were marked as Read',
'success');
$this->redirect($this->request->referrer());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mark_read()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_start');\n\n $read=$this->get_input_vals();\n\n $this->message_model->save_read($read['uid'],$read['mid'],1);\n\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_end');\n\n // success\n ... | [
"0.69979167",
"0.6703918",
"0.6636249",
"0.66179955",
"0.6535095",
"0.6467994",
"0.6435783",
"0.6430143",
"0.6366421",
"0.6266",
"0.6167882",
"0.61663806",
"0.61540115",
"0.6142393",
"0.61039495",
"0.6077569",
"0.5994711",
"0.591745",
"0.5885967",
"0.5872747",
"0.5862917",
... | 0.67116755 | 1 |
Function to retrieve the entire conversation with a single user | public function action_get_conversation() {
$sender = ORM::factory('User', $this->request->param("id"));
$conversations =array();// ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);
$post = $this->request->post();
$to = "";
$from = "";
if($post) {
$from = date('Y-m-d',strtotime($post['from']));
$to = date('Y-m-d',strtotime($post['to']));
if($to == '1969-12-31') {
$to = date('Y-m-d',strtotime('2030-01-01'));
}
if($from == '1969-12-31') {
$from = date('Y-m-d',strtotime('2030-01-01'));
}
$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender, $from, $to);
}else {
$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);
}
$this->_template->set("conversation_info", $sender);
$this->_template->set("filters", array("from"=>$from,"to"=>$to,"results"=>$this->_count_all_messages_in_conversation($conversations)));
$this->_template->set("conversations", $conversations);
$this->_set_content('conversation');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getConversation($id, $fromUser=false){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM msg_conversation WHERE conv_id=:id ORDER BY date');\n\t\t$statement->execute(array(':id'=>$id));\n\t\treturn $statement->fetchAll(PDO::FETCH_ASSOC);\n\t}",
"public function getConversationWith (int $use... | [
"0.7440169",
"0.69513035",
"0.681697",
"0.65520465",
"0.6527377",
"0.65152216",
"0.6510654",
"0.6480371",
"0.64448404",
"0.642741",
"0.6410428",
"0.6403281",
"0.6367946",
"0.63518864",
"0.62390363",
"0.6126855",
"0.6103688",
"0.6100901",
"0.6088312",
"0.60726404",
"0.60698473... | 0.71423113 | 1 |
Gets the content types searched in a typespecific search. | public function getSearchContentTypes()
{
return array('quote');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSearchContentTypes()\n {\n return array('conversation_message', 'conversation');\n }",
"function &ListContentTypes()\n\t{\n\t\tglobal $gCms;\n\t\t$contenttypes =& $gCms->contenttypes;\n\t\t\n\t\tif (isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\t$variables =& $gCms->variab... | [
"0.73325866",
"0.69764763",
"0.66080374",
"0.65561604",
"0.65206754",
"0.64649403",
"0.639141",
"0.639141",
"0.639141",
"0.639141",
"0.6279278",
"0.6266108",
"0.6264383",
"0.625179",
"0.6250367",
"0.62446696",
"0.62359303",
"0.61834264",
"0.61506534",
"0.61179155",
"0.6115676... | 0.72188073 | 1 |
Get typespecific constraints from input. | public function getTypeConstraintsFromInput(XenForo_Input $input)
{
return array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConstraintTypes() {}",
"public function getTypeConstraintsFromInput(XenForo_Input $input)\n {\n if (!($this->enabled)) return array();\n $constraints = array();\n\n $replyCount = $input->filterSingle('reply_count', XenForo_Input::UINT);\n if ($replyCount)\n ... | [
"0.67598665",
"0.6378992",
"0.61512977",
"0.61164725",
"0.5882489",
"0.577702",
"0.57595295",
"0.5725472",
"0.5725472",
"0.5702714",
"0.5702714",
"0.5693041",
"0.5693041",
"0.5656768",
"0.5656637",
"0.5656637",
"0.56557584",
"0.5632766",
"0.5628496",
"0.562461",
"0.56117433",... | 0.7038645 | 0 |
install ready to use badge icons | function installBadgeIcons($root_dir) {
$cert_default_dir = $root_dir . "/template/default/img/game";
foreach (glob("$cert_default_dir/*.png") as $icon) {
$iconname = preg_replace('|.*/(.*)\.png|', '$1', $icon);
$filename = $iconname . '.png';
if (!copy($icon, $root_dir . BADGE_TEMPLATE_PATH . $filename)) {
die("Error copying badge icon!");
}
Database::get()->query("INSERT INTO badge_icon
(name, description, filename) VALUES (?s, '', ?s)",
$iconname, $filename);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function buildCssAndRegisterIcons() {}",
"function load_icons() {\n themify_get_icon( 'ti-import' );\n themify_get_icon( 'ti-export' );\n Themify_Enqueue_Assets::loadIcons();\n }",
"public function get_icon() {\n return 'eicon-heading apr-badge';\n }"... | [
"0.59537673",
"0.5934781",
"0.5850528",
"0.5798251",
"0.5620138",
"0.55884886",
"0.55464894",
"0.55138355",
"0.54676574",
"0.5447577",
"0.54452413",
"0.54320395",
"0.5414563",
"0.53973204",
"0.53926295",
"0.5387264",
"0.53872377",
"0.53843254",
"0.53718793",
"0.536857",
"0.53... | 0.659823 | 0 |
Returns true if the value resolves to true. | public function isTrue()
{
return !!$this->value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isTrue()\n {\n return $this->value === true;\n }",
"public function isTrue();",
"function isTrue($value) {\r\n\treturn is_bool($value) ? $value : (bool)preg_match('/^(1|y|yes|true|on)$/i',(string)$value);\r\n}",
"function bool ($value)\r\n{\r\n\tif ($value === true || $value === ... | [
"0.83746284",
"0.7327865",
"0.7255598",
"0.7237692",
"0.7135793",
"0.7099107",
"0.7009759",
"0.69991183",
"0.6963154",
"0.69327813",
"0.689397",
"0.68891025",
"0.6885377",
"0.6842323",
"0.68270355",
"0.6826442",
"0.68248254",
"0.68046576",
"0.67733765",
"0.67328924",
"0.67099... | 0.76715714 | 1 |
Returns true if the value resolves to false. | public function isFalse()
{
return !$this->value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_false(mixed $value): bool\n\t{\n\t\treturn $value === false;\n\t}",
"public function isFalse();",
"public static function false(): self\n {\n return self::fromValue(Value::false());\n }",
"public function isFalse() {\n return $this->is(new Identical(false));\n }",
"protected fu... | [
"0.7759415",
"0.7726061",
"0.74473184",
"0.7393785",
"0.73572373",
"0.7334865",
"0.7206088",
"0.7168344",
"0.67863894",
"0.67777485",
"0.67279816",
"0.6600152",
"0.64929044",
"0.64041144",
"0.6379429",
"0.636509",
"0.6354426",
"0.6321541",
"0.6304143",
"0.6290906",
"0.6277464... | 0.80876946 | 0 |
Extract filepaths from finder results | private function getFinderResult()
{
$results = array();
foreach ($this->finder as $result) {
$results[] = $result->getRealPath();
}
return $results;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findFiles();",
"public function find () {\n\t\t$results = array();\n\n\t\t// Iterate all paths in target\n\t\tforeach ($this->target->get_resolved_paths() as $path) {\n\t\t\t\n\t\t\t// Iterate all files in paths\n\t\t\t$files = directory_contents($path);\n\t\t\tforeach ($files as $file) {\n\t\t\t... | [
"0.6785689",
"0.6522868",
"0.63721865",
"0.61564285",
"0.61357844",
"0.6121081",
"0.6059127",
"0.5994545",
"0.5969169",
"0.5963418",
"0.595956",
"0.59460074",
"0.59460074",
"0.59460074",
"0.5936259",
"0.5908881",
"0.5865822",
"0.5853286",
"0.5838035",
"0.5817389",
"0.581305",... | 0.7564424 | 0 |
Filter temporary data based on the given prefix | private function _extractFromTempData(string $prefix, array $tempData): array {
$result = [];
foreach ($tempData as $key => $value) {
if ((new StringOperation)->str_starts_with($key, $prefix)) {
$result[str_replace($prefix. "_", "", $key)] = $value;
}
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function _getFilter() {}",
"public function testPrefixedExtraction()\n {\n $queryData = ['prefix_a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'prefix_b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'prefix_c' => 6, 'prefix_d' => 9];\n $request = $this->createReque... | [
"0.562868",
"0.55831087",
"0.55544144",
"0.54626733",
"0.54585207",
"0.5452465",
"0.5451222",
"0.5437347",
"0.54345614",
"0.5415852",
"0.541133",
"0.53958464",
"0.53715426",
"0.53271586",
"0.53140235",
"0.5302295",
"0.5270148",
"0.52336365",
"0.52330345",
"0.52197593",
"0.521... | 0.60562235 | 0 |
Plugin Name: OMDB Plugin URI: localhost/omdb Description: Searches OMDB by title Version: 1.0 Author: Adam Singh Author URI: localhost Function that retrieve search results from the API [movie title="Good Will Hunting"] | function omdb_search($atts)
{
//Setting attributes from the short code
$a = shortcode_atts(array('title' => "Good Will Hunting"), $atts);
$your_key = "a61b2946"; //Key from OMDB
$url = "http://www.omdbapi.com/?apikey=".$your_key."&t=".$a['title'];
$response = wp_remote_get($url); //Calling OMDB for data
//Catching an error if it occurs
if(is_wp_error($response))
{
die("Error occred when retrieving data.");
}
//Decoding the json
$data = json_decode($response['body'], true);
//Creating the begining of the table
$table = "<table style=\"width:100%\">";
//for loop that traverses through the data
foreach($data as $key => $value)
{
if($key == "Ratings") //Rating found
{
//for loop for traversing through the ratings
foreach($value as $rating)
{
$table .= "<tr>";
$table .= "<td>Source</td>";
$table .= "<td>".$rating['Source']."</td>";
$table .= "</tr>";
}//End of foreach($value as $rating)
}//End of if($key == "Ratings")
else //Ratings not found
{
$table .= "<tr>";
$table .= "<td>".$key."</td>";
$table .= "<td>".$value."</td>";
$table .= "</tr>";
}//End of else
}//End of foreach($data as $key => $value)
//End of the table
$table .= "</table>";
echo $table; //Printing table
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMovieInformation($movie)\n{\n if($movie != \"\") {\n $OMDB_API_KEY = '99842c57';\n $omdbUrl = \"http://www.omdbapi.com?s=$movie&apikey=$OMDB_API_KEY&type=movie\";\n $movie = file_get_contents($omdbUrl);\n\n $movieDetails =json_decode($movie, true);\n\n \n if(count($movie... | [
"0.55437243",
"0.55127805",
"0.53031915",
"0.52433",
"0.5176246",
"0.5174078",
"0.51416534",
"0.5122727",
"0.5116539",
"0.51081324",
"0.5076951",
"0.5042895",
"0.500784",
"0.50071234",
"0.50063574",
"0.49717832",
"0.49602446",
"0.49433488",
"0.49287233",
"0.49139565",
"0.4913... | 0.5869707 | 0 |
Return whether we're testing Varien_Object, where bug in unsetOldData() is fixed | protected static function _isFixedBugWithOldDataNullKey()
{
if (!defined('TESTS_MAGENTO_PATH')) {
return true; // php_mage extension has non-buggy functionality
}
$reflectionMethod = new ReflectionMethod('Varien_Object', 'unsetOldData');
$sourceClass = file($reflectionMethod->getFileName());
$sourceMethod = array_slice($sourceClass, $reflectionMethod->getStartLine(),
$reflectionMethod->getEndLine() - $reflectionMethod->getStartLine());
$source = implode("\n", $sourceMethod);
return strpos($source, '$this->_oldFieldsMap') !== false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}",
"protected function isUnchanged() {}",... | [
"0.6035578",
"0.595178",
"0.59030485",
"0.5902927",
"0.5800507",
"0.5791812",
"0.57532674",
"0.57275575",
"0.5698497",
"0.5694829",
"0.56756383",
"0.56614673",
"0.5654564",
"0.56535953",
"0.5642814",
"0.5601161",
"0.55899113",
"0.55794257",
"0.55789065",
"0.55774814",
"0.5559... | 0.72413844 | 0 |
DOES NOT SANITIZE: esc_attr for tests without loading WordPress | function esc_attr($value) {
return $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function esc_attr( $text ) {\r\n\t$safe_text = wp_check_invalid_utf8( $text );\r\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\r\n\t/**\r\n\t * Filters a string cleaned and escaped for output in an HTML attribute.\r\n\t *\r\n\t * Text passed to esc_attr() is stripped of invalid or special characters\... | [
"0.7714346",
"0.7655529",
"0.7497903",
"0.7321529",
"0.7312101",
"0.69006974",
"0.6862679",
"0.6846908",
"0.6838206",
"0.67843723",
"0.67037374",
"0.66565704",
"0.6595387",
"0.6562398",
"0.6528609",
"0.6511456",
"0.6489237",
"0.64501077",
"0.64376867",
"0.6415322",
"0.6405743... | 0.77115417 | 1 |
Provides data for testTemplatePreprocessUpdateReport(). | public function providerTemplatePreprocessUpdateReport() {
return [
'$variables with data not set' => [
[],
],
'$variables with data as an interger' => [
['data' => 4],
],
'$variables with data as a string' => [
['data' => 'I am a string'],
],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function templateData()\n {\n return $this->templateData;\n }",
"public function templateData() {\n return array();\n }",
"protected function getTemplateData() {\r\n return $this->templateData;\r\n }",
"protected function preprocessData() {}",
"function prepareTemplateVars... | [
"0.5940317",
"0.5926782",
"0.5818001",
"0.57136965",
"0.56867206",
"0.5643051",
"0.56323236",
"0.56283516",
"0.55528146",
"0.55338997",
"0.54815525",
"0.5401672",
"0.54012936",
"0.5378693",
"0.537162",
"0.53187644",
"0.53041244",
"0.5270606",
"0.52558017",
"0.52430856",
"0.52... | 0.77148503 | 0 |
Practice from notes on Models: Find any books by the author Bell Hooks and update the author name to be bell hooks (lowercase). | public function getEx13() {
# Approach # 1
# Get all the books that match the criteria
$books = \App\Book::where('author','=','Bell Hooks')->get();
# Loop through each book and update them
foreach($books as $book) {
$book->author = 'bell hooks';
$book->save();
}
# Resulting SQL:
# Always:
# 1) select * from `books` where `author` = 'Bell Hooks'
# Only if there's something to update:
# 2) update `books` set `updated_at` = '2016-04-12 18:46:04', `author` = 'bell hooks' where `id` = '8'
# Approach #2
\App\Book::where('author', '=', 'Bell Hooks')->update(['author' => 'bell hooks']);
# Resulting SQL:
# Always:
# 1) update `books` set `author` = 'bell hooks', `updated_at` = '2016-04-12 18:44:46' where `author` = 'Bell Hooks'
return '"Bell Hooks" => "bell hooks"';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEx6() {\n # First get a book to update\n $book = \\App\\Book::where('author', 'LIKE', '%Scott%')->first();\n # If we found the book, update it\n if($book) {\n # Give it a different title\n $book->title = 'The Really Great Gatsby';\n # ... | [
"0.6002671",
"0.587632",
"0.5845784",
"0.57047755",
"0.56890315",
"0.561786",
"0.56017345",
"0.55889004",
"0.55870485",
"0.5581467",
"0.5558776",
"0.55468273",
"0.5543281",
"0.5519324",
"0.55115426",
"0.55115426",
"0.55115426",
"0.5510896",
"0.5483642",
"0.5472748",
"0.544256... | 0.6625447 | 0 |
Practice from notes on Models: Retrieve all the books in descending order according to published date | public function getEx12() {
$books = \App\Book::orderBy('published','desc')->get();
$this->printBooks($books);
# Underlying SQL: select * from `books` order by `published` desc
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function latest_books()\n {\n //thiet lap rieng\n $this->paginate = array(\n 'fields' => array('id', 'title', 'slug', 'image', 'sale_price'),\n 'order' => array('created' => 'desc'),\n 'limit' => 8,\n 'contain'=> arra... | [
"0.664487",
"0.66268075",
"0.63996667",
"0.6333038",
"0.63007253",
"0.62964976",
"0.6257233",
"0.6132179",
"0.6080486",
"0.5959239",
"0.5945087",
"0.5939681",
"0.59193873",
"0.58530307",
"0.5847881",
"0.5840894",
"0.57964605",
"0.5785783",
"0.5782388",
"0.57759106",
"0.577208... | 0.72998583 | 0 |
Practice from notes on Models: Retrieve all the books in alphabetical order by title | public function getEx11() {
$books = \App\Book::orderBy('title','asc')->get();
$this->printBooks($books);
# Underlying SQL: select * from `books` order by `title` asc
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allRecordsByTitle(){\n\t $news = collect(DB::table('news')->get());\n\t return $news->sortBy('title');\n }",
"public function getAllBooks(){\n $query = \"SELECT * FROM Book;\";\n return $this->getBookDetail($query);\n }",
"public static function get_all_books() {\n\t\t... | [
"0.69672763",
"0.67620957",
"0.66572577",
"0.6633597",
"0.66289234",
"0.65558666",
"0.6538621",
"0.65146446",
"0.65015584",
"0.6445272",
"0.64435744",
"0.6397994",
"0.6377456",
"0.6371801",
"0.6368506",
"0.63493663",
"0.6328112",
"0.6325117",
"0.63138676",
"0.6281114",
"0.624... | 0.6956423 | 1 |
Practice from notes on Models: Retrieve all the books published after 1950 | public function getEx10() {
$books = \App\Book::where('published','>',1950)->get();
$this->printBooks($books);
# Underlying SQL: select * from `books` where `published` > '1950'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEx12() {\n $books = \\App\\Book::orderBy('published','desc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `published` desc\n\t}",
"function bm_get_books($all=false) {\n\n $now = time();\n $books = array();\n $data = @getXML(BMB... | [
"0.72562957",
"0.69154596",
"0.65214384",
"0.6507692",
"0.6353704",
"0.63432425",
"0.6179446",
"0.61784595",
"0.61729115",
"0.6163359",
"0.61611396",
"0.6026118",
"0.5979315",
"0.5978755",
"0.5978443",
"0.59604555",
"0.5953469",
"0.5950752",
"0.5942591",
"0.59336406",
"0.5920... | 0.79408365 | 0 |
Practice from notes on Models: Show the last 5 books that were added to the books table | public function getEx9() {
# Ref: https://laravel.com/docs/5.2/queries#ordering-grouping-limit-and-offset
$books = \App\Book::orderBy('id', 'desc')->get()->take(5);
$this->printBooks($books);
# Underlying SQL: select * from `books` order by `id` desc
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get5book(){\n $db =new DbConnect();\n $con =$db->connect();\n $books5 = array();\n $result_book = mysqli_query($con,\"SELECT * from book order by book_id DESC LIMIT 5\");\n while($book5 = mysqli_fetch_array($result_book,MYSQLI_ASSOC)){\n array_push($boo... | [
"0.66409665",
"0.66152143",
"0.6365157",
"0.62084067",
"0.6182886",
"0.61390436",
"0.6080838",
"0.5995565",
"0.5781299",
"0.5759295",
"0.5732717",
"0.57060367",
"0.57048255",
"0.5679602",
"0.5646191",
"0.56201226",
"0.561438",
"0.5591857",
"0.5582936",
"0.5569142",
"0.5557235... | 0.6980189 | 0 |
A node is displayable through __toString() Displays all its children | final public function __toString()
{
$ret = $this->getContent();
foreach ($this as $node) {
$ret .= PHP_EOL . (string)$node;
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ToString()\n {\n if ( $this->Level == 0 )\n {\n // This is the root node, only walk through children\n $out = \"\";\n foreach($this->ChildNodes as $node)\n $out .= $node->ToString();\n }\n else\n {\n // Print node depending of it's type\n $indent = str_repea... | [
"0.70736414",
"0.6942445",
"0.68213433",
"0.677516",
"0.67311156",
"0.6724975",
"0.6720872",
"0.67094123",
"0.6638178",
"0.6607054",
"0.65930605",
"0.65775317",
"0.65398896",
"0.65095794",
"0.64452183",
"0.6443773",
"0.6377824",
"0.63743883",
"0.62876564",
"0.62808686",
"0.62... | 0.7287501 | 0 |
Creates a query builder which get the term neighbors in hierarchy for this term (same parent). | public function neighbors()
{
$parent = $this->parent;
$exclude = $this->term_id;
$query = static::where('term_id', '!=', $exclude);
return $parent ? $query->where('parent', $parent) : $query->whereNull('parent');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNodeTreeQueryBuilder()\n {\n $qb = $this->repository\n ->createQueryBuilder('c')\n ->select('c, p')\n ->leftJoin('c.parent', 'p')\n ->orderBy('c.lft');\n\n return $qb;\n }",
"public function get_neighbors()\n\t{\n\t\t// get parent... | [
"0.5459179",
"0.5322152",
"0.5216854",
"0.520977",
"0.5110506",
"0.510095",
"0.50065535",
"0.49941385",
"0.49413258",
"0.49358067",
"0.48979303",
"0.48816496",
"0.4859124",
"0.48404846",
"0.4839154",
"0.48387024",
"0.48383516",
"0.48220128",
"0.4820134",
"0.48043463",
"0.4797... | 0.7360482 | 0 |
/ / WP methods / Get the taxonomy labels. | public function getLabelsAttribute()
{
return (get_taxonomy($this->name))->labels;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function acf_get_taxonomy_labels($taxonomies = array())\n{\n}",
"public function getTaxonomyTerms();",
"public function getTaxonomy()\n {\n return ucwords(\\Present::unslug($this->taxonomy));\n }",
"public function taxonomy();",
"function kulam_get_custom_taxonomy_labels( $name, $singular ) {\... | [
"0.82675576",
"0.7565901",
"0.6956691",
"0.68305755",
"0.67615193",
"0.6740723",
"0.67178845",
"0.67178845",
"0.67178845",
"0.6679489",
"0.6631996",
"0.6617115",
"0.65822595",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.655493... | 0.7698398 | 1 |
Boilerplate function for getting an API Mock class | protected function getAPIMock($apiClass='OCA\AppFramework\Core\API',
array $constructor=array('appname')){
$methods = get_class_methods($apiClass);
return $this->getMock($apiClass, $methods, $constructor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function getApiObjectClass();",
"function fn_soneritics_kiyoh_get_api(): KiyohApi\n{\n $settings = new SoneriticsKiyohSettings;\n $api = new KiyohApi($settings->getHash());\n\n return $api;\n}",
"abstract public function getMockBuilder($className): MockBuilder;",
"public function get... | [
"0.69169813",
"0.6352451",
"0.629434",
"0.6292968",
"0.6276758",
"0.6268383",
"0.61782783",
"0.6117507",
"0.60899544",
"0.5970323",
"0.59428",
"0.5913198",
"0.5907986",
"0.5898631",
"0.5873744",
"0.5871157",
"0.5850308",
"0.58207786",
"0.5793158",
"0.5776803",
"0.57331014",
... | 0.6642857 | 1 |
Install quote custom data | public function installQuoteData()
{
$quoteInstaller = $this->quoteSetupFactory->create(
[
'resourceName' => 'quote_setup',
'setup' => $this->setup
]
);
$quoteInstaller
->addAttribute(
'quote',
CustomFieldsInterface::CHECKOUT_PURPOSE,
['type' => Table::TYPE_TEXT, 'length' => '255', 'nullable' => true]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fastQuote_install() {\n require_once('fastQuote.settings.php');\n fastQuoteInstaller::install();\n\n rebuild_settings();\n}",
"function install($data = '')\n {\n parent::install();\n }",
"function install($data = '')\n {\n parent::install();\n }",
"function install... | [
"0.69736654",
"0.6714206",
"0.6714206",
"0.66782314",
"0.66782314",
"0.6571282",
"0.6571282",
"0.6571282",
"0.6571282",
"0.6571282",
"0.65510887",
"0.6327981",
"0.6169283",
"0.61365294",
"0.6135494",
"0.61118186",
"0.6104212",
"0.59939843",
"0.5989338",
"0.5975755",
"0.593293... | 0.84290344 | 0 |
Install sales custom data | public function installSalesData()
{
$salesInstaller = $this->salesSetupFactory->create(
[
'resourceName' => 'sales_setup',
'setup' => $this->setup
]
);
$salesInstaller
->addAttribute(
'order',
CustomFieldsInterface::CHECKOUT_PURPOSE,
['type' => Table::TYPE_TEXT, 'length' => '255', 'nullable' => true, 'grid' => false]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function install($data='') {\r\n parent::install();\r\n }",
"function install($data='') {\r\n parent::install();\r\n }",
"function install($data = '')\n {\n parent::install();\n }",
"function install($data = '')\n {\n parent::install();\n }",
"function install($data='') {\n par... | [
"0.728193",
"0.728193",
"0.7153113",
"0.7153113",
"0.7073944",
"0.7017336",
"0.7017336",
"0.7017336",
"0.7017336",
"0.7017336",
"0.6849865",
"0.6809988",
"0.67987514",
"0.67848814",
"0.6744894",
"0.6724681",
"0.66995364",
"0.66390264",
"0.66146016",
"0.65689033",
"0.65605325"... | 0.8170202 | 0 |
Get the enum as an collection formatted for a select. | public static function toSelectCollection(): Collection
{
return collect(self::toArray())->mapWithKeys(function ($value, $text) {
return [
$value => [
'text' => self::getDescription($value),
'value' => $value,
],
];
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCustomEnumFormatterCollection(): EnumFormatterCollection;",
"public function getForSelect()\n {\n $options = [];\n\n foreach ($this->find() as $record) {\n $key = (string)$record->getId();\n $val = (string)$this->getRecordLabel($record);\n $opt... | [
"0.6633402",
"0.6339101",
"0.6264784",
"0.61202663",
"0.60775465",
"0.58590674",
"0.58587205",
"0.58376265",
"0.579897",
"0.57632387",
"0.5704434",
"0.5704434",
"0.5702993",
"0.5681474",
"0.56445247",
"0.5626697",
"0.5613102",
"0.56119615",
"0.5572823",
"0.5530161",
"0.551788... | 0.6558187 | 1 |
Get the description for an enum value. | public static function getDescription($value): string
{
return
static::getLocalizedDescription($value) ??
static::getKey($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStatusDescription($value)\n {\n $status = $this->getEveryStatus();\n\n if (isset($status[$value])) {\n return $status[$value];\n }\n\n return $status['D'];\n }",
"public static function getDescription($value): string\n {\n switch ($value) ... | [
"0.729808",
"0.6696256",
"0.6622626",
"0.66111773",
"0.6537815",
"0.6507612",
"0.6460673",
"0.643342",
"0.63763815",
"0.636937",
"0.6343878",
"0.62796587",
"0.6253956",
"0.6248732",
"0.6213775",
"0.61919093",
"0.6179035",
"0.6177627",
"0.6158251",
"0.6118068",
"0.6096676",
... | 0.70144653 | 1 |
Tests Transform_Unserialize_Serial>process() with a chain | public function testProcess_Chain()
{
$mock = $this->getMock('Q\Transform', array('process'));
$mock->expects($this->once())->method('process')->with($this->equalTo('test'))->will($this->returnValue('a:2:{s:1:"a";a:1:{s:1:"c";s:3:"abc";}s:1:"d";s:1:"e";}'));
$transform = new Transform_Unserialize_Serial();
$transform->chainInput($mock);
$contents = $transform->process('test');
$this->assertType('Q\Transform_Unserialize_Serial', $transform);
$this->assertEquals(array('a'=>array('c'=>'abc'), 'd'=>'e'), $contents);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetReverse_Chain() \n {\n $mock = $this->getMock('Q\\Transform', array('getReverse', 'process'));\n $mock->expects($this->once())->method('getReverse')->with($this->isInstanceOf('Q\\Transform_Serialize_Serial'))->will($this->returnValue('reverse of mock transformer'));\n ... | [
"0.6494883",
"0.6243429",
"0.5968294",
"0.5685148",
"0.55904967",
"0.543727",
"0.5375368",
"0.5365713",
"0.52476954",
"0.5242949",
"0.51979697",
"0.5149354",
"0.5097645",
"0.5097645",
"0.5096598",
"0.50465333",
"0.5031752",
"0.49766967",
"0.49701434",
"0.4945104",
"0.49326783... | 0.820725 | 0 |
Tests Transform_Unserialize_Serial>getReverse() with a chain | public function testGetReverse_Chain()
{
$mock = $this->getMock('Q\Transform', array('getReverse', 'process'));
$mock->expects($this->once())->method('getReverse')->with($this->isInstanceOf('Q\Transform_Serialize_Serial'))->will($this->returnValue('reverse of mock transformer'));
$transform = new Transform_Unserialize_Serial();
$transform->chainInput($mock);
$this->assertEquals('reverse of mock transformer', $transform->getReverse());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetReverse_ChainDouble() \n {\n $mock = $this->getMock('Q\\Transform', array('getReverse', 'process'));\n $mock->expects($this->once())->method('getReverse')->with($this->isInstanceOf('Q\\Transform_Serialize_Serial'))->will($this->returnValue('reverse of mock transformer'));\n ... | [
"0.75660837",
"0.66889006",
"0.6677965",
"0.6240784",
"0.61688167",
"0.61540484",
"0.61508316",
"0.61504894",
"0.6074951",
"0.59442",
"0.59442",
"0.59442",
"0.59442",
"0.591658",
"0.59154224",
"0.5853217",
"0.58103627",
"0.5676281",
"0.5646193",
"0.5595553",
"0.5431423",
"0... | 0.7750612 | 0 |
Tests Transform_Unserialize_Serial>getReverse() with a chain | public function testGetReverse_ChainDouble()
{
$mock = $this->getMock('Q\Transform', array('getReverse', 'process'));
$mock->expects($this->once())->method('getReverse')->with($this->isInstanceOf('Q\Transform_Serialize_Serial'))->will($this->returnValue('reverse of mock transformer'));
$transform1 = new Transform_Unserialize_Serial();
$transform2 = new Transform_Unserialize_Serial();
$transform2->chainInput($mock);
$transform1->chainInput($transform2);
$this->assertEquals('reverse of mock transformer', $transform1->getReverse());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetReverse_Chain() \n {\n $mock = $this->getMock('Q\\Transform', array('getReverse', 'process'));\n $mock->expects($this->once())->method('getReverse')->with($this->isInstanceOf('Q\\Transform_Serialize_Serial'))->will($this->returnValue('reverse of mock transformer'));\n ... | [
"0.77503055",
"0.66885215",
"0.6677177",
"0.6240599",
"0.6170473",
"0.61553895",
"0.61520016",
"0.61476904",
"0.607417",
"0.5945706",
"0.5945706",
"0.5945706",
"0.5945706",
"0.59170383",
"0.591687",
"0.5853025",
"0.5810367",
"0.56759506",
"0.56476384",
"0.55959487",
"0.543253... | 0.75659686 | 1 |
/ Function: get factor from database Parameter: Atom1, Atom2, bond order, primary/secondary table Return: Factor | function get_factor($Atom1, $Atom2, $BondOrder, $tb_name) {
global $conn;
global $PRIMARY_TB;
// Check if all the parameters are valid
if (!$Atom1) {
die("Atom 1 is not specified.");
} elseif (!$Atom2) {
die("Atom 2 is not specified.");
} elseif (!$BondOrder) {
die("Bond order is not specified.");
}
$query_str = "SELECT Factor FROM $tb_name ".
"WHERE (Atom1='$Atom1' AND Atom2='$Atom2')".
"AND BondOrder=$BondOrder";
$result = $conn->query($query_str);
// Everything is ok
if ($result->num_rows == 1) {
$row = $result->fetch_assoc();
return $row['Factor'];
}
// There is something wrong
if ($BondOrder == 1) {
$boName = "single";
} elseif ($BondOrder == 2) {
$boName = "double";
} elseif ($BondOrder == 3) {
$boName = "tripple";
} else {
$boName = $BondOrder;
}
// If such bond DNE, print error
if($result->num_rows == 0) {
if ($tb_name == $PRIMARY_TB) {
die("The $Atom1-$Atom2 $boName bond does not exist in the database.");
} else {
return 0;
}
}
// If there are multiple entries
if ($result->num_rows > 1) {
die("There are multiple entries in the database of the $Atom1-$Atom2 $boName bond.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function process_factor_query($is_aromatic_ring) {\n\t\n\tglobal $PRIMARY_TB, $SECONDARY_TB, $l_0;\n\t\n\t$bonds = json_decode($_GET['json_query'], true);\n\t$sum = 0;\n\tforeach ($bonds as $bond) {\n\t\t// $bond has keys: Atom1, Atom2, BondOrder, Proximity\n\t\tif ($bond[\"Proximity\"] == 1) {\n\t\t\t$f = get_fac... | [
"0.58923936",
"0.5406703",
"0.52434677",
"0.48543575",
"0.4839819",
"0.469212",
"0.467898",
"0.4612812",
"0.45833796",
"0.4533701",
"0.4524233",
"0.45230362",
"0.4512122",
"0.45047995",
"0.44994777",
"0.44635758",
"0.4456885",
"0.43951088",
"0.43903002",
"0.43697584",
"0.4350... | 0.80697685 | 0 |
/ For all of the associative arrays passed through $_GET if (Proximity == 1) get_factor($Atom1, $Atom2, $BondOrder, $primary_tb); get_factor($Atom1, $Atom2, $BondOrder, $secondary_tb); primary secondary is the number. else get_factor($Atom1, $Atom2, $BondOrder, $secondary_tb); Add everything together, and that is the answer. | function process_factor_query($is_aromatic_ring) {
global $PRIMARY_TB, $SECONDARY_TB, $l_0;
$bonds = json_decode($_GET['json_query'], true);
$sum = 0;
foreach ($bonds as $bond) {
// $bond has keys: Atom1, Atom2, BondOrder, Proximity
if ($bond["Proximity"] == 1) {
$f = get_factor($bond["Atom1"], $bond["Atom2"], $bond["BondOrder"], $PRIMARY_TB);
$l_char = "<i>L</i>";
} elseif ($bond["Proximity"] == 2) {
$f = get_factor($bond["Atom1"], $bond["Atom2"], $bond["BondOrder"], $SECONDARY_TB);
$l_char = "<i>l</i>";
}
$sum += $f;
if ($bond["BondOrder"] == 1) {
$bond_char = "-";
} elseif ($bond["BondOrder"] == 2) {
$bond_char = "=";
} elseif ($bond["BondOrder"] == 3) {
$bond_char = "≡";
}
echo "<p>".$l_char."<sub>".$bond["Atom1"].$bond_char.$bond["Atom2"]."</sub> = ".$f."</p>";
}
if ($is_aromatic_ring == "true") {
$sum += $l_0;
echo "<p>l<sub>0</sub> = ".$l_0."</p>";
}
echo "<h4>β = ".($sum+1)."</h4>";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_factor($Atom1, $Atom2, $BondOrder, $tb_name) {\n\t\n\tglobal $conn;\n\tglobal $PRIMARY_TB;\n\t\n\t// Check if all the parameters are valid\n\tif (!$Atom1) {\n\t\tdie(\"Atom 1 is not specified.\");\n\t} elseif (!$Atom2) {\n\t\tdie(\"Atom 2 is not specified.\");\n\t} elseif (!$BondOrder) {\n\t\tdie(\"Bo... | [
"0.61645085",
"0.51042414",
"0.51036465",
"0.50581944",
"0.49472237",
"0.4887124",
"0.48491582",
"0.4835526",
"0.48137143",
"0.48050368",
"0.47986183",
"0.4618553",
"0.46162587",
"0.45589066",
"0.45555937",
"0.45544058",
"0.4539949",
"0.4525036",
"0.4499143",
"0.44935155",
"0... | 0.71615887 | 0 |
Parse the given SimpleXmlElement to a Store entity. | public function parse(SimpleXMLElement $payload)
{
$store = (new Entities\Store())
->setIdentifiers(new Collection([
'ap21_id' => (integer) $payload->StoreId,
'ap21_code' => (string) $payload->Code,
'store_number' => (integer) $payload->StoreNo
]))
->setName((string) $payload->Name)
->setLine1((string) $payload->Address1)
->setLine2((string) $payload->Address2)
->setCity((string) $payload->City)
->setState((string) $payload->State)
->setPostcode((string) $payload->Postcode)
->setCountry((string) $payload->Country)
->setEmail((string) $payload->Email);
return $store;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setStoreId($store);",
"public function parseEntity(XTemplate $xtpl, $oProduct) {\n\n }",
"public function parse($model)\n\t{\n\t\t$parser = Mage::getModel($this->getParserModel(), $model);\n\t\tif ($this->getStoreId()) {\n\t\t\t$parser->setMageStoreId($this->getStoreId());\n\t\t}\n\t\t$parse... | [
"0.46587682",
"0.46546042",
"0.46254456",
"0.46002588",
"0.45970342",
"0.4570146",
"0.4570146",
"0.45219913",
"0.45195553",
"0.4502184",
"0.44990957",
"0.44990957",
"0.4487101",
"0.44703007",
"0.4409867",
"0.43909898",
"0.4382788",
"0.43656608",
"0.43631285",
"0.43587038",
"0... | 0.72746474 | 0 |
The modal CTA HTML which gets injected into the footer and launched after the grimage share dialog has been closed. Note:: Doesn't display if the cookie is set... see JS | public function grimage_modal()
{
?>
<!-- Modal -->
<div class="grimage_modal" id="grimage_modal-one" aria-hidden="true">
<div class="grimage_modal-dialog">
<div class="grimage_modal-header">
<a href="#" class="btn-close grimage_modalclose" aria-hidden="true">×</a> <!--CHANGED TO "#close"-->
</div>
<div class="grimage_modal-body">
<?php echo stripslashes(get_option('grimage_modalcontent')); ?>
</div>
<div class="grimage_modal-footer">
</div>
</div>
</div>
<!-- /Modal -->
<?php } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NewModalFooter($settings) {\n $tabs = (isset($settings['tabs']) ? intval($settings['tabs']) : 6);\n $formID = (isset($settings['formid']) ? IdentifierStr($settings['formid']) : (isset($settings['form']) ? (is_array($settings['form']) ? IdentifierStr($settings['form']['id']) : IdentifierStr($settings... | [
"0.5999225",
"0.5993367",
"0.57731926",
"0.57665884",
"0.5684943",
"0.56751865",
"0.5595678",
"0.5577895",
"0.55568224",
"0.5532182",
"0.54983115",
"0.5472154",
"0.54664725",
"0.54579914",
"0.5448874",
"0.5443759",
"0.5439526",
"0.5438382",
"0.5437344",
"0.54279864",
"0.54087... | 0.6117207 | 0 |
Returns the wordpress database. | public function getWordpressDatabase(): wpdb
{
return $this->wpDatabase;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getWPDB()\n\t{\n\t\tglobal $wpdb;\n\t\treturn $wpdb;\n\t}",
"function getDatabase();",
"private function getStagingDb()\n {\n return new \\wpdb($this->clone->databaseUser, $this->clone->databasePassword, $this->clone->databaseDatabase, $this->clone->databaseServer);\n }",
"pub... | [
"0.7859304",
"0.70852995",
"0.7077932",
"0.6968717",
"0.6891741",
"0.68723726",
"0.68605936",
"0.68446153",
"0.68446153",
"0.68446153",
"0.68446153",
"0.68446153",
"0.68446153",
"0.68446153",
"0.68446153",
"0.68001145",
"0.67180413",
"0.6708635",
"0.6708635",
"0.6686446",
"0.... | 0.8324789 | 0 |
Returns the user group table name. | public function getUserGroupTable(): string
{
return $this->wpDatabase->prefix . self::USER_GROUP_TABLE_NAME;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getUsergroupsTable() : string\n\t{\n\t\treturn static::$usergroups_table;\n\t}",
"protected function getRuleGroupTableName()\n {\n return $this->getGatewayCollection()\n ->getGateway('pt_rule_group')\n ->getMetaData()\n ... | [
"0.8697231",
"0.7652109",
"0.76379627",
"0.752937",
"0.74989116",
"0.73160106",
"0.7293503",
"0.7084742",
"0.70235115",
"0.6982417",
"0.6980866",
"0.691531",
"0.66813916",
"0.66658306",
"0.66650236",
"0.6625764",
"0.6617906",
"0.6614103",
"0.6558976",
"0.65094286",
"0.6504236... | 0.8728481 | 0 |
Returns the current blog id. | public function getCurrentBlogId()
{
return $this->wpDatabase->blogid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_current_blog_id()\n {\n }",
"function config_get_curr_blog_id () {\n\n\t\t global $current_blog;\n\n\t\t if ( isset( $current_blog ) ) {\n\n\t\t\t return $current_blog->blog_id;\n\t\t }\n\t\t else {\n\n\t\t\t return 1;\n\t\t }\n\t}",
"public static function getSiteId()\n {\n return... | [
"0.8948581",
"0.8301314",
"0.8203324",
"0.79924566",
"0.7289102",
"0.7280569",
"0.7257452",
"0.7106511",
"0.7058306",
"0.6932647",
"0.68679166",
"0.6647498",
"0.66309077",
"0.6602271",
"0.659435",
"0.6576548",
"0.65586424",
"0.6540486",
"0.6509589",
"0.64931023",
"0.64872694"... | 0.9044852 | 0 |
Returns the blogs table name. | public function getBlogsTable(): string
{
return $this->wpDatabase->blogs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function table_name(): string {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->prefix . 'sb_' . static::TABLE;\n\t}",
"function get_table_name()\n {\n global $table_prefix;\n return $table_prefix . 'posts';\n }",
"function get_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->pr... | [
"0.77284396",
"0.75868684",
"0.7393831",
"0.73450106",
"0.732149",
"0.73079574",
"0.73074603",
"0.72429895",
"0.7208636",
"0.7201507",
"0.72009945",
"0.71834207",
"0.71639514",
"0.7162835",
"0.71408516",
"0.7114206",
"0.71066123",
"0.70922893",
"0.70774376",
"0.7065394",
"0.7... | 0.8447861 | 0 |
Returns the posts table name. | public function getPostsTable(): string
{
return $this->wpDatabase->posts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_table_name()\n {\n global $table_prefix;\n return $table_prefix . 'posts';\n }",
"function get_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->prefix . $this->table_name;\n\t}",
"function get_table_name () {\r\n\t\treturn $this->wpdb->prefix . $this->_table_name;\r\n\t... | [
"0.8391971",
"0.76689917",
"0.75244534",
"0.7472105",
"0.73997366",
"0.73837143",
"0.73707664",
"0.736646",
"0.7357786",
"0.73309463",
"0.72773397",
"0.7262333",
"0.7258643",
"0.7247659",
"0.72397393",
"0.72073734",
"0.7192338",
"0.71497434",
"0.71406394",
"0.7041003",
"0.701... | 0.8467165 | 0 |
Returns the term_relationships table name. | public function getTermRelationshipsTable(): string
{
return $this->wpDatabase->term_relationships;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTermTaxonomyTable(): string\n {\n return $this->wpDatabase->term_taxonomy;\n }",
"public function getRelatedTableName()\n\t{\n\t\tif ($this->related) {\n\t\t\tif (\\App\\Config::performance('SEARCH_REFERENCE_BY_AJAX')) {\n\t\t\t\treturn [$this->fieldModel->getTableName() . $this->... | [
"0.77853",
"0.70976126",
"0.7044314",
"0.69772583",
"0.6680528",
"0.6655438",
"0.6631901",
"0.6583348",
"0.6569672",
"0.6517246",
"0.6428351",
"0.6422322",
"0.6401839",
"0.6369125",
"0.6318498",
"0.6302701",
"0.63002574",
"0.6297165",
"0.62906045",
"0.6226295",
"0.62039226",
... | 0.8608707 | 0 |
Returns the term_taxonomy table name. | public function getTermTaxonomyTable(): string
{
return $this->wpDatabase->term_taxonomy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTermRelationshipsTable(): string\n {\n return $this->wpDatabase->term_relationships;\n }",
"function get_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->prefix . $this->table_name;\n\t}",
"function get_table_name () {\r\n\t\treturn $this->wpdb->prefix . $this->_table_na... | [
"0.7485152",
"0.73360676",
"0.72402406",
"0.7171547",
"0.70886636",
"0.70872533",
"0.70712566",
"0.7019449",
"0.69105506",
"0.69039214",
"0.68900436",
"0.6882208",
"0.6785168",
"0.67687535",
"0.6744322",
"0.671576",
"0.6705866",
"0.66886663",
"0.6676103",
"0.66744536",
"0.665... | 0.8746074 | 0 |
Returns the capabilities table name. | public function getCapabilitiesTable(): string
{
return $this->wpDatabase->prefix . 'capabilities';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function table () : string {\n return $this->guessName();\n }",
"public function get_table_name(){\n return $this->table_name();\n }",
"public function table_name ()\n {\n return $this->app->table_names->entries;\n }",
"public static function get_table_name()\n {\n ... | [
"0.6169111",
"0.6114315",
"0.60538644",
"0.60117435",
"0.60007954",
"0.5954046",
"0.59467447",
"0.588956",
"0.5870642",
"0.58676094",
"0.58490413",
"0.58490413",
"0.5840889",
"0.58398116",
"0.5820934",
"0.5809534",
"0.5802723",
"0.57901794",
"0.57836616",
"0.5760849",
"0.5745... | 0.8647794 | 0 |
Registers student in database and returns it's cookie in &$cookie variable. | public function register_student(Student $student): string {
$cookie = SecurityUtil::generate_token();
$stmt = $this->db->prepare('INSERT INTO students(forename, surname, email, group_id, exam_results, birth_year, is_foreign, gender, cookie) VALUES (?,?,?,?,?,?,?,?,?)');
$stmt->execute(array(strval($student->forename),
strval($student->surname),
strval($student->email),
strval($student->group_id),
intval($student->exam_results),
intval($student->birth_year),
intval($student->is_foreign),
intval($student->gender),
$cookie));
$stmt->closeCursor();
return $cookie;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_student_with_cookie(string $cookie) {\n $query = $this->db->prepare('SELECT * FROM students WHERE cookie=?');\n $query->execute(array($cookie));\n if (($row = $query->fetch(\\PDO::FETCH_NUM))) {\n $query->closeCursor();\n return StudentsTableGateway::c... | [
"0.6709638",
"0.6058455",
"0.57694584",
"0.5768314",
"0.56677556",
"0.5641499",
"0.56099653",
"0.5607244",
"0.5606758",
"0.55897784",
"0.55764514",
"0.55637705",
"0.5539231",
"0.552666",
"0.5525856",
"0.54604083",
"0.54546404",
"0.5445741",
"0.54391295",
"0.5424575",
"0.53910... | 0.73264164 | 0 |
Updates student with cookie $cookie with data from $student. | public function update_student(string $cookie, Student $student) {
$stmt = $this->db->prepare('UPDATE students SET forename=?, surname=?, email=?, group_id=?, exam_results=?, birth_year=?, is_foreign=?, gender=? WHERE cookie=?');
$stmt->execute(array(strval($student->forename),
strval($student->surname),
strval($student->email),
strval($student->group_id),
intval($student->exam_results),
intval($student->birth_year),
intval($student->is_foreign),
intval($student->gender),
$cookie));
$stmt->closeCursor();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update(Request $request, Student $student)\n {\n $student->frist_name=$request->frist_name;\n $student->last_name=$request->last_name;\n $student->date=$request->date;\n $student->mobile=$request->mobile;\n $student->status=$request->status;\n $student... | [
"0.5966551",
"0.57385606",
"0.570764",
"0.5673814",
"0.5631362",
"0.55689603",
"0.555878",
"0.55534416",
"0.55418015",
"0.55287653",
"0.5524608",
"0.55244565",
"0.5510976",
"0.55019224",
"0.5476816",
"0.5471941",
"0.5435862",
"0.54301465",
"0.54301465",
"0.54301465",
"0.54301... | 0.76887363 | 0 |
Returns true if student with such email is registered. | public function is_student_with_email_registered(string $email): bool {
$query = $this->db->prepare("SELECT COUNT(email) FROM students WHERE email=? LIMIT 1");
$query->execute(array($email));
$result = $query->fetch(\PDO::FETCH_NUM);
$is_registered = intval($result[0]) != 0;
$query->closeCursor();
return $is_registered;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _emailIsRegistered($email_address) {\r\n\t\t$model = Mage::getModel('customer/customer');\r\n $model->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($email_address);\r\n\t\tif ($model->getId()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\... | [
"0.76334846",
"0.7613865",
"0.75923437",
"0.7552959",
"0.7488753",
"0.737985",
"0.73501045",
"0.7347746",
"0.7314342",
"0.72081333",
"0.72076625",
"0.72055066",
"0.7196411",
"0.7185854",
"0.7172241",
"0.7167042",
"0.71586055",
"0.7145895",
"0.71443695",
"0.7119543",
"0.711170... | 0.8252167 | 0 |
Returns student that has specified cookie associated with it or null if student with such cookie does not exist. | public function get_student_with_cookie(string $cookie) {
$query = $this->db->prepare('SELECT * FROM students WHERE cookie=?');
$query->execute(array($cookie));
if (($row = $query->fetch(\PDO::FETCH_NUM))) {
$query->closeCursor();
return StudentsTableGateway::create_student_from_row($row);
} else {
$query->closeCursor();
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($cookieName);",
"public function getStudentById($id) {\n return CaStudent::find($id);\n }",
"protected function getCookie($cookieName): ?\\Symfony\\Component\\HttpFoundation\\Cookie\n {\n foreach ($this->response->headers->getCookies() as $cookie) {\n if ($coo... | [
"0.547046",
"0.5353633",
"0.5267596",
"0.5195249",
"0.5139253",
"0.51037514",
"0.5069651",
"0.5068924",
"0.50631714",
"0.50557184",
"0.50419325",
"0.5025451",
"0.5008431",
"0.500584",
"0.5004192",
"0.5001277",
"0.4968902",
"0.4951131",
"0.49074987",
"0.49074197",
"0.49029255"... | 0.832616 | 0 |
Queries database to get students ordered by field $order_field, sorted in ascending or descending order, with page and entries limit. | public function get_all_students(string $order_field = 'forename', int $order_dir = self::ORDER_ASC, int $page = 0, int $limit = 50): array {
$order_field = htmlentities($order_field);
$order_dir = $order_dir == self::ORDER_ASC ? 'ASC' : 'DESC';
$query_string = "SELECT forename, surname, group_id, exam_results
FROM students
ORDER BY $order_field $order_dir
LIMIT :limit_start, :limit_end";
$query = $this->db->prepare($query_string);
$query->bindValue(':limit_start', $page * $limit, \PDO::PARAM_INT);
$query->bindValue(':limit_end', $limit, \PDO::PARAM_INT);
$query->execute();
$students = array();
while (($row = $query->fetch(\PDO::FETCH_NUM))) {
$student = new Student;
$student->forename = $row[0];
$student->surname = $row[1];
$student->group_id = $row[2];
$student->exam_results = $row[3];
array_push($students, $student);
}
$query->closeCursor();
return $students;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function find_students(\n string $keyword,\n string $order_by = 'forename',\n $order_dir = self::ORDER_ASC,\n $page = 0,\n $limit = 50,\n &$total_students_count = null\n ) {\n $order_by = htmlentities($order_by);\n $order_dir = $order_dir == self::O... | [
"0.616",
"0.60952854",
"0.5740891",
"0.55644876",
"0.5533499",
"0.54793864",
"0.5469629",
"0.54504913",
"0.5431375",
"0.5425937",
"0.5385806",
"0.53659475",
"0.5357207",
"0.5322595",
"0.5277525",
"0.52250534",
"0.5207958",
"0.52028984",
"0.5193226",
"0.5177072",
"0.51706195",... | 0.6418716 | 0 |
Searches all students by keyword, ordered by field and has page and limit. Optional $total_students_count reference can be set to rethieve number of found students. | public function find_students(
string $keyword,
string $order_by = 'forename',
$order_dir = self::ORDER_ASC,
$page = 0,
$limit = 50,
&$total_students_count = null
) {
$order_by = htmlentities($order_by);
$order_dir = $order_dir == self::ORDER_ASC ? 'ASC' : 'DESC';
$query_string =
"SELECT forename, surname, group_id, exam_results
FROM students
WHERE CONCAT(forename, ' ', surname, ' ', group_id, ' ', exam_results)
LIKE :keyword
ORDER BY $order_by $order_dir
LIMIT :limit_start, :limit_end";
$query = $this->db->prepare($query_string);
$query->bindValue(':keyword', "%{$keyword}%", \PDO::PARAM_STR);
$query->bindValue(':limit_start', $page * $limit, \PDO::PARAM_INT);
$query->bindValue(':limit_end', $limit, \PDO::PARAM_INT);
$query->execute();
$students = array();
while ($row = $query->fetch(\PDO::FETCH_NUM)) {
$student = new Student;
$student->forename = $row[0];
$student->surname = $row[1];
$student->group_id = $row[2];
$student->exam_results = $row[3];
array_push($students, $student);
}
$query->closeCursor();
if (isset($total_students_count)) {
if ($page == 0 && count($students) < $limit) {
$total_students_count = count($students);
} else {
$query_string =
"SELECT COUNT(*)
FROM students
WHERE CONCAT(forename, ' ', surname, ' ', group_id, ' ', exam_results)
LIKE :keyword
ORDER BY $order_by $order_dir";
$query = $this->db->prepare($query_string);
$query->bindValue(':keyword', "%{$keyword}%", \PDO::PARAM_STR);
$query->execute();
$total_students_count = intval($query->fetch(\PDO::FETCH_NUM)[0]);
$query->closeCursor();
}
}
return $students;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function searchStudent($search_text)\n {\n $studentModel = new StudentModel();\n return $studentModel->searchStudent($search_text);\n }",
"public function getStudents(SearchData $data)\n\t{\n\t\t$text = $data->getSearchText(); $field = $data->getSearchField();\n\t\t$sortBy = $dat... | [
"0.6035083",
"0.58750355",
"0.57831717",
"0.5546936",
"0.5355939",
"0.53487027",
"0.5302857",
"0.5272335",
"0.5251378",
"0.5246081",
"0.5229187",
"0.52196443",
"0.5211386",
"0.51994693",
"0.51252383",
"0.51155794",
"0.5108214",
"0.50786155",
"0.505331",
"0.50347716",
"0.49977... | 0.7679351 | 0 |
Get the list of players hidden from the given application. This method is only available to user accounts for your developer console. (applications.listHidden) | public function listHidden($applicationId, $optParams = array())
{
$params = array('applicationId' => $applicationId);
$params = array_merge($params, $optParams);
return $this->call('listHidden', array($params), 'Google\Service\GamesManagement\HiddenPlayerList');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function listHiddenExhibit(){\n\t\t$res = requete_sql(\"SELECT id FROM exhibit WHERE visible = FALSE ORDER BY creation_date ASC\");\n\t\t$res = $res->fetchAll(PDO::FETCH_ASSOC);\n\t\t$list = array();\n\t\tforeach ($res as $exhibit) {\n\t\t\t$exhibit = new Exhibit($exhibit['id']);\n\t\t\tarray_push($list, $e... | [
"0.6301318",
"0.622639",
"0.5670769",
"0.5609927",
"0.53892356",
"0.5331992",
"0.5331992",
"0.5303199",
"0.5295577",
"0.5260307",
"0.52600515",
"0.5214672",
"0.5212481",
"0.52022666",
"0.51759416",
"0.51689917",
"0.5164226",
"0.5107169",
"0.5101624",
"0.5082389",
"0.5082389",... | 0.85996217 | 0 |
Add new user registrstion data into sp_system_account table in database | public function SystemRegistration()
{
$type = $this->input->post('type', TRUE);
$data = array(
'SP_USER_ID' => $this->input->post('userid', TRUE),
'SP_USERNAME' => $this->input->post('username', TRUE),
'SP_PASSWORD' => $this->input->post('password', TRUE),
'SP_CREATED_DATETIME' => date("Y-m-d h:i:sa")
);
if($type == 'RES'){
$query = $this->db->insert("sp_system_account", $data);
}
else if($type == 'EMP'){
$query = $this->db->insert("sp_emp_system_account", $data);
}
echo '<script>alert("Data added to the database")</script>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 =... | [
"0.6878499",
"0.6557917",
"0.6556032",
"0.65061903",
"0.64495754",
"0.6430277",
"0.6421327",
"0.6413087",
"0.6339189",
"0.63242",
"0.6319407",
"0.63005817",
"0.62986434",
"0.629851",
"0.6280509",
"0.6278733",
"0.62737674",
"0.6250473",
"0.6229247",
"0.6220118",
"0.621235",
... | 0.65982103 | 1 |
Gets query for [[Requests]]. | public function getRequests()
{
return $this->hasMany(Request::className(), ['users_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listRequests()\r\n {\r\n return $this->BunqClient->getHttpService()->get(\r\n $this->getResourceEndpoint()\r\n );\r\n }",
"public function getRequests()\n {\n return $this->requests;\n }",
"public function getRequests() {\n\n $requests = isset(... | [
"0.6555001",
"0.6524387",
"0.6518647",
"0.6465791",
"0.6450774",
"0.64392257",
"0.6371482",
"0.636667",
"0.636667",
"0.636667",
"0.636667",
"0.636667",
"0.636667",
"0.636667",
"0.636667",
"0.636667",
"0.63283074",
"0.6276411",
"0.6256098",
"0.62537354",
"0.62537354",
"0.622... | 0.6586359 | 0 |
Get the value of lname | public function getLname()
{
return $this->lname;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_lName() {\n return $this->lName;\n }",
"function getLname() {\n return $this->lname;\n }",
"public function getUser_lname()\n {\n return $this->user_lname;\n }",
"function getRHUL_LastName() {\n return getRHUL_LDAP_FieldValue(\"last_name\");\n}",
"public... | [
"0.7913818",
"0.7850836",
"0.7211258",
"0.6657328",
"0.65321",
"0.65043265",
"0.6403536",
"0.6360928",
"0.6269534",
"0.6268541",
"0.62588906",
"0.62476116",
"0.6121237",
"0.6091806",
"0.6089751",
"0.60895306",
"0.60679746",
"0.60576785",
"0.60477626",
"0.6040168",
"0.6040168"... | 0.80444074 | 0 |
Get the value of doi | public function getDoi()
{
return $this->doi;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _getBookDOI()\n {\n return $this->mBook['doi'];\n }",
"public function getDod();",
"public function getDateI(){\n return $this->dateI;\n }",
"public function getD() {}",
"public function getDni() {\r\n return $this->dni;\r\n }",
"public functi... | [
"0.67642194",
"0.66320604",
"0.6440463",
"0.6343033",
"0.63270223",
"0.6298013",
"0.6297631",
"0.62934816",
"0.62696093",
"0.6246562",
"0.62402904",
"0.62035906",
"0.6183823",
"0.61810625",
"0.617435",
"0.60745245",
"0.60634387",
"0.604051",
"0.6009992",
"0.599249",
"0.595574... | 0.7826824 | 0 |
Set the value of doi | public function setDoi($doi)
{
$this->doi = $doi;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setOrden($iorden = '')\n {\n $this->iorden = $iorden;\n }",
"public function getDoi()\n {\n return $this->doi;\n }",
"private function setCodigoOrdem($iCodigoOrdem){\n $this->iCodigoOrdem = $iCodigoOrdem;\n }",
"public function setDDI(string $ddi)\n {\n $this-... | [
"0.6353836",
"0.6238903",
"0.61709654",
"0.6119155",
"0.6070443",
"0.6070443",
"0.6070443",
"0.6070443",
"0.6005381",
"0.5983266",
"0.5829005",
"0.5772334",
"0.5743229",
"0.5728895",
"0.5716428",
"0.5706191",
"0.5603965",
"0.5603965",
"0.5603164",
"0.5603164",
"0.5583135",
... | 0.63389164 | 1 |
Get the value of facility | public function getFacility()
{
return $this->facility;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFacility();",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
... | [
"0.7492259",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.630601",
"0.6304625",
"0.6304625",
"0.6304625",
"0.6304625",
"0.6304625",
"0.62992364",
"0.62992364",
... | 0.77125245 | 1 |
Get the value of mname | public function getMname()
{
return $this->mname;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function get_name()\n\t{\n\t\treturn $this->m_name;\n\t}",
"private function get_name()\n\t{\n\t\treturn $this->m_name;\n\t}",
"public function getName(){\n return $this->m_name;\n }",
"public function getname(){\n \t//return $this->msg;\n \treturn $this->phone;\n }",
... | [
"0.7597905",
"0.7597905",
"0.72722447",
"0.71127045",
"0.6980993",
"0.6882744",
"0.6882744",
"0.6879845",
"0.6814856",
"0.67908955",
"0.6788789",
"0.67657447",
"0.67657447",
"0.67657447",
"0.6754371",
"0.674864",
"0.67078817",
"0.6699472",
"0.66981417",
"0.66917473",
"0.66784... | 0.79557544 | 0 |
Get the value of registration_no | public function getRegistration_no()
{
return $this->registration_no;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRegistrationNo() :string\n {\n return $this->registrationNo;\n }",
"public function getRegistrationNumber() {\n\t\treturn self::$_registrationNumber;\n\t}",
"function getRegistrationID()\n { \n return $this->getValueByFieldName('registration_id');\n }",
"public ... | [
"0.8395688",
"0.784082",
"0.7824128",
"0.7662472",
"0.7537308",
"0.65893686",
"0.6525186",
"0.6495188",
"0.63346237",
"0.63072807",
"0.6274422",
"0.62463826",
"0.6242624",
"0.6202847",
"0.62003464",
"0.61889696",
"0.61779964",
"0.60931057",
"0.6083957",
"0.6040344",
"0.602573... | 0.87550956 | 0 |
Return the network that the address sits in | function network(){
return (long2ip((ip2long($this->address))
& (ip2long($this->netmask()))));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNetwork() {\n return $this->getValue('network');\n }",
"public function getNetwork()\n {\n return $this->network;\n }",
"public function getNetwork()\n {\n return $this->network;\n }",
"public function getNetworkAddress()\n {\n return $this->_n... | [
"0.7977561",
"0.7733832",
"0.7733832",
"0.765445",
"0.7567131",
"0.74935967",
"0.717745",
"0.717745",
"0.6902588",
"0.6861764",
"0.68512464",
"0.6730181",
"0.6660419",
"0.66421014",
"0.659016",
"0.6568117",
"0.6542858",
"0.653752",
"0.65373695",
"0.6483959",
"0.64754814",
"... | 0.8100448 | 0 |
Return the broadcast that the address sits in | function broadcast(){
return (long2ip(ip2long($this->network())
| (~(ip2long($this->netmask())))));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getBroadcast()\n {\n return new Address(self::LONG_BROADCAST);\n }",
"public function getBroadcastAddress()\n\t{\n\t\treturn $this->last_ip;\n\t}",
"public function getBroadcast( $full = false )\n\t{\n\t\tif( !$this->valid ) { return null; }\n\t\tif( !$full ) \n\t\t{\n\t\t\t... | [
"0.8530555",
"0.7783517",
"0.73421144",
"0.6952528",
"0.6876339",
"0.67278516",
"0.6628287",
"0.63725954",
"0.6313243",
"0.631144",
"0.6306961",
"0.6157539",
"0.61327916",
"0.6109643",
"0.61061317",
"0.6049008",
"0.60018235",
"0.60018235",
"0.5975159",
"0.5895933",
"0.5850361... | 0.806475 | 1 |
Return the inverse mask of the netmask | function inverse(){
return (long2ip(~(ip2long("255.255.255.255")
<< (32-$this->netbits))));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNetworkMask()\n {\n return $this->_networkMask;\n }",
"public static function getInverse()\n {\n return static::$inverse;\n }",
"public function invert();",
"public function getMask()\n {\n return $this->mask;\n }",
"public function getMask()\n {... | [
"0.6481294",
"0.6447863",
"0.63235265",
"0.6158406",
"0.6158406",
"0.6158406",
"0.609541",
"0.5848408",
"0.57776564",
"0.5749856",
"0.5649876",
"0.56173724",
"0.55995834",
"0.5596441",
"0.55600125",
"0.5549641",
"0.5507285",
"0.5492938",
"0.54663867",
"0.5409502",
"0.53976536... | 0.79440266 | 0 |
/ ocPortal Copyright (c) ocProducts, 20042012 See text/EN/licence.txt for full licencing information. NOTE TO PROGRAMMERS: Do not edit this file. If you need to make changes, save your changed file to the appropriate _custom folder If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes /EXTRA FUNCTIONS: levenshtein Calculate Levenshtein distance between two strings, but work past the PHP function's character limit. | function fake_levenshtein($a,$b)
{
// Some stripping, for performance, and because white space doesn't matter so much in HTML anyway
$a=preg_replace('#\s#','',$a);
$b=preg_replace('#\s#','',$b);
$a_len=strlen($a);
$b_len=strlen($b);
if (($a_len<255) && ($b_len<255))
{
return levenshtein($a,$b);
}
$percent=0.0;
return max($a_len,$b_len)-similar_text($a,$b,$percent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function levenshtein(\n string $str1,\n string $str2,\n int $insertionCost = 1,\n int $replacementCost = 1,\n int $deletionCost = 1\n ): int {\n $result = ASCII::to_ascii_remap($str1, $str2);\n\n return \\levenshtein($result[0], $result[1], $inserti... | [
"0.6785128",
"0.6781519",
"0.65867275",
"0.65479004",
"0.62977195",
"0.6205906",
"0.61821884",
"0.6146887",
"0.6087803",
"0.599907",
"0.59939563",
"0.59591377",
"0.5924997",
"0.5919254",
"0.5912637",
"0.5811615",
"0.58082855",
"0.576025",
"0.5753487",
"0.57044023",
"0.5699912... | 0.7875869 | 0 |
Probe a file path for DB access details. | function probe_db_access($file_base)
{
return array(NULL,NULL,NULL,NULL); // No DB connection needed
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function probe_db_access($file_base)\n\t{\n\t\t$dbname='';\n\t\t$dbuser='';\n\t\t$dbpasswd='';\n\t\t$table_prefix='';\n\t\tif (!file_exists($file_base.'/config.php'))\n\t\t\twarn_exit(do_lang_tempcode('BAD_IMPORT_PATH',escape_html('config.php')));\n\t\trequire($file_base.'/config.php');\n\t\t$INFO=array();\n\t\t$I... | [
"0.6443201",
"0.6162542",
"0.6098885",
"0.54332876",
"0.5347867",
"0.5033905",
"0.50252146",
"0.50097924",
"0.50057846",
"0.4993126",
"0.49599037",
"0.4949606",
"0.49376366",
"0.4861799",
"0.48533604",
"0.4835742",
"0.4825499",
"0.48177904",
"0.48081613",
"0.48027727",
"0.479... | 0.68069917 | 0 |
Check if the token for the given platform should be updated. | public function tokenShouldBeUpdated($platform)
{
$column = "{$platform}_token_expires_at";
if (is_null($this->{$column})) return false;
return abs($this->{$column}->diffInDays(Carbon::now())) < 5;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _checkToken(KCommandContext $context)\n {\n //Check the token\n if($context->caller->isDispatched())\n { \n $method = KRequest::method();\n \n //Only check the token for PUT, DELETE and POST requests (AND if the view is not 'ipn')\n ... | [
"0.6649083",
"0.6447405",
"0.64136004",
"0.6374985",
"0.6330699",
"0.6250541",
"0.6232401",
"0.62169236",
"0.60993737",
"0.60864365",
"0.60815614",
"0.6073139",
"0.60583574",
"0.60432965",
"0.6028193",
"0.6021344",
"0.6001476",
"0.59973156",
"0.5965654",
"0.59267867",
"0.5912... | 0.777244 | 0 |
Update the token for the given platform. | public function updateToken($platform, $token, $expiresAt)
{
$this->update([
"{$platform}_token" => $token,
"{$platform}_token_expires_at" => $expiresAt,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update(Token $token): void;",
"private function token_update(string $token)\n {\n $this->token_created = time();\n $this->token_expires = $this->token_created + 86399;\n $this->token = $token;\n $this->headers['Authorization'] = \" Bearer {$token}\";\n\n if (... | [
"0.695692",
"0.6497835",
"0.6494313",
"0.6305641",
"0.59625626",
"0.58398116",
"0.5798282",
"0.577874",
"0.5765891",
"0.5718073",
"0.55874026",
"0.554934",
"0.5528818",
"0.55178976",
"0.5502151",
"0.5467011",
"0.5462225",
"0.5452806",
"0.5438698",
"0.5436424",
"0.5375439",
... | 0.75539255 | 0 |
Returns the content type based on the format. The format must exists on the map. | public function getContentTypeByFormat(string $format): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getContentType(string $format = Header::FORMAT_RAW)\n {\n $value = $this->header_fields['Content-Type'] ?? null;\n if ($format === Header::FORMAT_RAW || empty($value))\n return $value;\n\n $type = $value['type'];\n $keywords = $value['parameters'];\n\n ... | [
"0.7052816",
"0.6576673",
"0.65522236",
"0.6496637",
"0.6467648",
"0.64384794",
"0.6351507",
"0.62789536",
"0.62630117",
"0.62327254",
"0.62106085",
"0.61709976",
"0.61629397",
"0.61046547",
"0.6102573",
"0.60904175",
"0.60904175",
"0.60904175",
"0.60904175",
"0.60904175",
"0... | 0.8024541 | 0 |
Get state property name in database | public function getStatePropertyName(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStatePropertyName()\n {\n // TODO: Implement getStatePropertyName() method.\n }",
"function getName() \n {\n return $this->getValueByFieldName( 'statevar_name' );\n }",
"public function getStateName() {\n return $this->getValueOrDefault('StateName');\n }",
... | [
"0.74585956",
"0.7376751",
"0.73566014",
"0.70646137",
"0.7060109",
"0.70086235",
"0.69524527",
"0.68009424",
"0.6537173",
"0.64801645",
"0.635834",
"0.6296718",
"0.62672263",
"0.62672263",
"0.624579",
"0.6240301",
"0.62165886",
"0.61909497",
"0.618941",
"0.6187186",
"0.61827... | 0.8029509 | 0 |
Method to set the value of field nome_original | public function setNomeOriginal($nome_original)
{
$this->nome_original = $nome_original;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNomeOriginal()\n {\n return $this->nome_original;\n }",
"public function setNome($valor){\n\t\t\t$this->nome = $valor;\n\t\t}",
"public function setOriginal($original) {\n $this->original = $original;\n }",
"public function setNome(string $nome)\n {\n $this->nome = ... | [
"0.70677775",
"0.682121",
"0.6700084",
"0.66432124",
"0.6596507",
"0.6540798",
"0.64683306",
"0.64674664",
"0.6414192",
"0.6398249",
"0.63628215",
"0.6355459",
"0.6327835",
"0.62343425",
"0.62245715",
"0.6217916",
"0.62158847",
"0.6193311",
"0.61726695",
"0.61005515",
"0.6063... | 0.7242172 | 0 |
Returns the value of field cd_upload | public function getCdUpload()
{
return $this->cd_upload;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUploadField()\n {\n return $this->component->getUploadField($this->gridField);\n }",
"public function getUploadField()\n {\n return $this->component->getUploadField($this->gridField);\n }",
"public function getUpload()\n {\n return $this->upload;\n }",
... | [
"0.68408227",
"0.68408227",
"0.66643214",
"0.66268486",
"0.6564458",
"0.6535333",
"0.6522831",
"0.63106287",
"0.6280272",
"0.6131156",
"0.60866815",
"0.60702777",
"0.6067642",
"0.60273373",
"0.5986972",
"0.5936652",
"0.5916832",
"0.5899086",
"0.58965564",
"0.5895438",
"0.5858... | 0.8222352 | 0 |
Returns the value of field nome_original | public function getNomeOriginal()
{
return $this->nome_original;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOriginalName();",
"public function getOriginalName(): string\n {\n\t\treturn $this->originalName;\n\t}",
"public function getOriginalName(): string\n {\n return $this->originalName;\n }",
"public function getOrigName()\n\t{\n\t\treturn $this->orig_name;\n\t}",
"public fun... | [
"0.73793334",
"0.7119979",
"0.7117137",
"0.6848476",
"0.6753146",
"0.6499393",
"0.6499393",
"0.6499393",
"0.6494902",
"0.64807713",
"0.64557254",
"0.6444984",
"0.64137906",
"0.6411266",
"0.6394351",
"0.6394351",
"0.63934386",
"0.6386252",
"0.6360294",
"0.63450533",
"0.6331429... | 0.8355088 | 0 |
Returns the value of field nome_servidor | public function getNomeServidor()
{
return $this->nome_servidor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCodServico()\n {\n return $this->cod_servico;\n }",
"public function getNomeCliente(){/*Retorna o nome_cliente*/\n\t\t\treturn $this-> nome_cliente;\n\t\t}",
"public function getNomeCliente()\n {\n return $this->nomeCliente;\n }",
"public function ... | [
"0.69079536",
"0.6736135",
"0.64302427",
"0.6347406",
"0.6347406",
"0.6347406",
"0.6346834",
"0.63139397",
"0.630358",
"0.6301365",
"0.62405103",
"0.62099123",
"0.62091714",
"0.62060136",
"0.61876327",
"0.61823",
"0.6175906",
"0.6166591",
"0.61536473",
"0.6127688",
"0.6127506... | 0.7344503 | 0 |
Returns the value of field criacao | public function getCriacao()
{
return $this->criacao;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCriado()\n {\n return $this->criado;\n }",
"public function getCriado()\n {\n return $this->criado;\n }",
"public function getDataCriacao()\n {\n return $this->data_criacao;\n }",
"public function getCriadoEm()\n {\n return $this->criadoEm;\... | [
"0.71624106",
"0.71624106",
"0.71553564",
"0.67221636",
"0.6653139",
"0.66279083",
"0.65327036",
"0.63310283",
"0.62943107",
"0.62517685",
"0.62043154",
"0.61702466",
"0.6147272",
"0.6122027",
"0.61099327",
"0.6057166",
"0.6003059",
"0.5984513",
"0.5976216",
"0.5925433",
"0.5... | 0.7461751 | 0 |
Hent detaljer om filen | public function getFil(): Fil
{
return $this->fil;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function filtes()\n {\n /*\n * The filters fetches are transported\n * to router Bus calls\n **/\n }",
"public function show(Filme $filmes)\n {\n //\n }",
"public function getIdFil()\n {\n return $this->idFil;\n }",
"protected funct... | [
"0.60942745",
"0.6044171",
"0.5981389",
"0.5974022",
"0.59601825",
"0.59399796",
"0.5896837",
"0.5877442",
"0.5840485",
"0.5824281",
"0.5818902",
"0.5784837",
"0.5784837",
"0.5784837",
"0.57695365",
"0.5677723",
"0.5673326",
"0.5663925",
"0.56503814",
"0.5644413",
"0.5638005"... | 0.6072827 | 1 |
insert others leave type | public function save_leave_type($data = array()){
return $this->db->insert('leave_type', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allottedLeave(){\n if(empty($this->data)){\n //$alloted_leavesdata = $this->\n }\n else{\n \n }\n \n }",
"function makeType($rType, $blocktype){\n sqlQuery(\"INSERT INTO types (type_... | [
"0.5142426",
"0.5082389",
"0.5064751",
"0.49068695",
"0.4893627",
"0.48630047",
"0.4795121",
"0.47806665",
"0.47775748",
"0.47399652",
"0.4737057",
"0.47297826",
"0.47103852",
"0.47041103",
"0.46873248",
"0.46870318",
"0.4686359",
"0.468107",
"0.46623477",
"0.46175316",
"0.46... | 0.60432804 | 0 |
get all leave type | public function get_all_leave_type(){
$this->db->select('*');
$this->db->from('leave_type');
$query=$this->db->get();
return $query->result();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLeaveTypes()\n {\n $leaveTypes = [];\n $leaves = DB::table('dbo.LEAVE_TYPE')->lists('leave_type');\n $userGender = Employee::find(Auth::user()->Emp_id)->Emp_Gender;\n \n foreach ($leaves as $leaveType )\n {\n array_push($leaveType... | [
"0.75516534",
"0.71069634",
"0.66632444",
"0.6558683",
"0.62703604",
"0.6269362",
"0.6228708",
"0.61700433",
"0.5946417",
"0.590239",
"0.58780676",
"0.57982624",
"0.5764007",
"0.57404125",
"0.570456",
"0.566397",
"0.5626214",
"0.55968493",
"0.556556",
"0.55309695",
"0.5529872... | 0.801312 | 0 |
get leave type by leave type id | public function get_leave_type_by_id($id){
$this->db->where('leave_type_id',$id);
$query = $this->db->get('leave_type');
return $query->row();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function leaveType()\n {\n return $this->belongsTo(LeaveType::class, 'leave_type_id');\n }",
"public function get_leave_type(){\n \t$this->db->select('*');\n \t$this->db->from('leave_type');\n \t$query=$this->db->get();\n \t$data=$query->result();\n $list = array('' => 'Sel... | [
"0.6812724",
"0.62546927",
"0.6137966",
"0.6058944",
"0.60555565",
"0.60231405",
"0.5924666",
"0.5854124",
"0.58376056",
"0.5781426",
"0.57241917",
"0.56991005",
"0.5622433",
"0.55524373",
"0.5545866",
"0.5536764",
"0.55139154",
"0.549001",
"0.54735565",
"0.54720604",
"0.5447... | 0.8029744 | 0 |
delete leave type by id | public function delete_leave_type($id = null)
{
$this->db->where('leave_type_id',$id)
->delete('leave_type');
if ($this->db->affected_rows()) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete_type($id)\n\t\t{\n\t\t\n\t\t$this->db->where('revenue_id',$id);\n\t\t\n\t\t$this->db->delete($this->table_name);\n\t\t\n\t\t}",
"public function deleteByIdType($id, $type);",
"public function delete($id) {\n // Delete the type\n $this->getDb()->delete('eventtype', array('num_E... | [
"0.74041224",
"0.72852546",
"0.72507405",
"0.70398813",
"0.6975743",
"0.66140383",
"0.65837365",
"0.6570395",
"0.6519953",
"0.64907527",
"0.6439085",
"0.64206415",
"0.64180046",
"0.63894266",
"0.6370687",
"0.6369166",
"0.629657",
"0.6261063",
"0.6260483",
"0.62580913",
"0.625... | 0.7647829 | 0 |
Map an associative array DB record into a ItemPart Entity. | protected function _toEntity($dbRecord)
{
if (empty($dbRecord)) {
return null;
}
return new ItemPart(
$dbRecord['id'],
$dbRecord['item_id'],
$dbRecord['name'],
$dbRecord['type_item_part_id'],
$dbRecord['is_need_mod'] == 1,
$dbRecord['image']
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function createEntity(array $row);",
"public function toEntity($array);",
"public function toEntity($array);",
"protected function _rowToEntity($row) {\r\n \t$id = $row->{$this->_getPrimary()};\r\n \t\r\n \tif($this->_hasIdentity($id)) {\r\n \t\t$entity = $this->_getIdentity($i... | [
"0.5647026",
"0.5434827",
"0.5434827",
"0.5239059",
"0.5164255",
"0.5164255",
"0.5086436",
"0.50439537",
"0.5034887",
"0.5000173",
"0.4992006",
"0.4948551",
"0.49406523",
"0.49344933",
"0.4924414",
"0.49004805",
"0.4889416",
"0.48704693",
"0.48445737",
"0.4818561",
"0.4813407... | 0.63341534 | 0 |
getPalette method returns a value between 15 depending on which paletter the user wants to plot the chart with. Here, we just read from Session variable and show it In your application, you could read this configuration from your User Configuration Manager, database, or global application settings | function getPalette() {
//Return
return (((!isset($_SESSION['palette'])) || ($_SESSION['palette']=="")) ? "2" : $_SESSION['palette']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getColorPalette() {\n\t\treturn 'XLSConfig::$systemPalette';\n\t}",
"public function tcb_get_palettes_from_config() {\n\t\treturn ! empty( $this->skin_palettes_config['palette'] ) ? $this->skin_palettes_config['palette'] : [];\n\t}",
"public function getPaletteColours() {\n\t\treturn array(\n\t... | [
"0.6487676",
"0.5982131",
"0.5815626",
"0.5804494",
"0.5717699",
"0.5594531",
"0.54597574",
"0.53283125",
"0.5303035",
"0.5261232",
"0.5253047",
"0.5227681",
"0.5208537",
"0.5196157",
"0.51812506",
"0.5174102",
"0.5156563",
"0.51425695",
"0.50963384",
"0.5065445",
"0.506498",... | 0.7155442 | 0 |
getAnimationState returns 0 or 1, depending on whether we've to animate chart. Here, we just read from Session variable and show it In your application, you could read this configuration from your User Configuration Manager, database, or global application settings | function getAnimationState() {
//Return
return (($_SESSION['animation']<>"0") ? "1" : "0");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }",
"public function isSequencedAnimation()\n {\n return $this->sequencedAnimation;\n }",
"public function getAnimated()\r\n {\r\n return $this->animated;\r\n }",
"function Ge... | [
"0.59224045",
"0.5508384",
"0.5494885",
"0.5485116",
"0.54485595",
"0.54107696",
"0.51833314",
"0.50292295",
"0.4976681",
"0.49281514",
"0.49083036",
"0.49083036",
"0.49083036",
"0.48390016",
"0.48361978",
"0.47406563",
"0.46791282",
"0.46033108",
"0.45613772",
"0.44695055",
... | 0.6935687 | 0 |
getCaptionFontColor function returns a color code for caption. Basic idea to use this is to demonstrate how to centralize your cosmetic attributes for the chart | function getCaptionFontColor() {
//Return a hex color code without #
//FFC30C - Yellow Color
return "666666";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pl_text_color(){\n\t\t\n\t$color = ( pl_check_color_hash( ploption( 'text_primary' ) ) ) ? pl_hash_strip( ploption( 'text_primary' ) ) : '000000';\n\n\treturn $color;\n}",
"public function getTextColor() {}",
"public function getTextColor() {}",
"public function getFontColor()\n {\n if (ar... | [
"0.6232591",
"0.5990622",
"0.59901017",
"0.59293044",
"0.5877246",
"0.58543503",
"0.5795254",
"0.57243913",
"0.5675407",
"0.56454533",
"0.56267",
"0.5616569",
"0.55259067",
"0.5494671",
"0.54927963",
"0.54718196",
"0.54341197",
"0.5401345",
"0.5379341",
"0.5346611",
"0.532326... | 0.8533714 | 0 |
MonthName function converts a numeric integer into a month name Param: $intMonth a numver between 112, otherwise defaults to 1 Param: $flag if true, short name; if true, long name; | function MonthName($intMonth,$flag) {
$arShortMonth = array (1=>"Jan", 2=>"Feb", 3=>"Mar", 4=>"Apr", 5=>"May", 6=>"Jun", 7=>"Jul", 8=>"Aug", 9=>"Sep", 10=>"Oct", 11=>"Nov", 12=>"Dec");
$arLongMonth = array (1=>"January", 2=>"February", 3=>"March", 4=>"April", 5=>"May", 6=>"June", 7=>"July", 8=>"August", 9=>"September", 10=>"October", 11=>"November", 12=>"December");
if ($intMonth<1 || $intMonth>12)
$intMonth=1;
if ($flag)
return $arShortMonth[$intMonth];
else
return $arLongMonth[$intMonth];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMonthName($var=false){\n\tif (!$var) $var=@$this->actmonth;\n\tif ($this->monthNames) return $this->monthNames[$var-1];\n\tswitch($var){\n\t\tcase 1: return $this->jan;\n\t\tcase 2: return $this->feb;\n\t\tcase 3: return $this->mar;\n\t\tcase 4: return $this->apr;\n\t\tcase 5: return $this->may;\n\t\tc... | [
"0.75161004",
"0.74652904",
"0.7144807",
"0.7098847",
"0.7093419",
"0.7051912",
"0.7020693",
"0.6910796",
"0.68853194",
"0.68797356",
"0.6863898",
"0.6691211",
"0.6668919",
"0.6650689",
"0.66392004",
"0.6626972",
"0.65991753",
"0.65896904",
"0.65835977",
"0.65091485",
"0.6477... | 0.80633587 | 0 |
public function listapac($estado = '', $organigrama_id = '',$fecha_ini='',$fecha_fin='') | public function listapac($estado = '', $where = '')
{
//$where = '';
if ($estado == 1) {
$where .= " and estado is NULL ";
}
$sql = "select * from f_listado_pacs() where baja_logica=1 " . $where . " order by fecha_ini asc";
$this->_db = new Cargos();
return new Resultset(null, $this->_db, $this->_db->getReadConnection()->query($sql));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function citas_aplicarFiltrosCitas($fechaInicial, $fechaFinal, $usuarios, $tipoCita, $idPropietario, $paciente){\n \t\n\t\t\t$resultado = array();\n\t\t\t//$adicionQuery = \"WHERE 1 \";\n\t\t\t\n\t\t\tif(sizeof($usuarios) > 0){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(sizeof($usuarios) > 1){\n\t\t\t\t\t$andOr... | [
"0.6901112",
"0.67792714",
"0.6762469",
"0.66537935",
"0.66196746",
"0.6592385",
"0.65196514",
"0.64192045",
"0.63940555",
"0.63709646",
"0.6342002",
"0.6335485",
"0.63296986",
"0.63169634",
"0.628279",
"0.6238928",
"0.6208654",
"0.62078506",
"0.6202557",
"0.62000996",
"0.619... | 0.73345286 | 0 |
/ Get Filtros Organigrama | public function getFiltroOrganigrama()
{
$resultado = array();
$sql = "
SELECT STRING_AGG(v.unidad_administrativa,',') AS o_resultado FROM (
SELECT CAST(o.unidad_administrativa AS CHARACTER VARYING)
FROM cargos c
INNER JOIN organigramas o ON c.organigrama_id = o.id
WHERE c.baja_logica = 1
GROUP BY o.unidad_administrativa
ORDER BY o.unidad_administrativa
) AS v
";
$this->_db = new Cargos();
$arr = new Resultset(null, $this->_db, $this->_db->getReadConnection()->query($sql));
if (count($arr) > 0) {
/**
* Para agregar un valor nulo al inicio se añade una coma
*/
$res = $arr[0]->o_resultado;
$resultado = explode(",", $res);
}
return $resultado;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getOrganismsList();",
"function cc_get_agency($rif){\n\t\n\t$rif = (string) trim($rif);\n\t$id = (int) substr($rif, 0, 2);\n\t\n\t// MAP\n\t$agenzie_agenti_user = array();\n\t$agenzie_agenti_user[1] = array( \"fave_property_agency\" => 2788, \"fave_agents\" => 72 , \"post_author\" => 3 );\n\t$agenzie_a... | [
"0.6026584",
"0.5952716",
"0.59357095",
"0.59337276",
"0.5872608",
"0.58144784",
"0.57564837",
"0.573382",
"0.5731017",
"0.57223165",
"0.5711162",
"0.56917065",
"0.56406826",
"0.5638387",
"0.5636814",
"0.5597572",
"0.55887747",
"0.55887544",
"0.5586273",
"0.55570966",
"0.5541... | 0.7230269 | 0 |
Removing rows from main and child tables | function remove_rows($table_id, $data) {
$cmsEditDel = new cmsEditDel($table_id, $data);
$delete_id = $cmsEditDel->dbChange();
unset($cmsEditDel);
if (empty($delete_id)) return;
$child = getChildTables($table_id);
reset($child);
while (list($table_id, $field_name) = each($child)) {
remove_rows($table_id, array($field_name => $delete_id));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach(... | [
"0.6095954",
"0.59917754",
"0.5934367",
"0.5908167",
"0.5868326",
"0.5856703",
"0.58388597",
"0.5837527",
"0.58169955",
"0.58147717",
"0.57563835",
"0.572309",
"0.56729496",
"0.5660669",
"0.5636311",
"0.561395",
"0.5613614",
"0.56091005",
"0.5607987",
"0.55925155",
"0.5534732... | 0.6799626 | 0 |
Return a new Printable with the given string limit. | public function withStringLimit(int $strlim): Printable
{
return new Printable($this->value, $this->callable, $strlim, $this->arrlim);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function str_limit($string, $limit = 100, $end = '...')\n {\n return str::limit($string, $limit, $end);\n }",
"abstract public function _limit($str, $limit, $offset = false);",
"static function limit(string $s, int $limit = 100, string $end = '...'): string {\n if (mb_strlen($s) <= $limit) ... | [
"0.5799131",
"0.579068",
"0.5733761",
"0.5699269",
"0.5647924",
"0.55872667",
"0.5587126",
"0.5572459",
"0.5565704",
"0.55547523",
"0.55515724",
"0.5452892",
"0.5441698",
"0.5441663",
"0.54207546",
"0.5406397",
"0.5391213",
"0.53860396",
"0.53741574",
"0.5363558",
"0.5341977"... | 0.7650457 | 0 |
Return a new Printable with the given array limit. | public function withArrayLimit(int $arrlim): Printable
{
return new Printable($this->value, $this->callable, $this->strlim, $arrlim);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function limit($limit)\n {\n return self::from(Iterables::limit($this, $limit));\n }",
"public static function limit($limit);",
"public function withStringLimit(int $strlim): Printable\n {\n return new Printable($this->value, $this->callable, $strlim, $this->arrlim);\n }",
"p... | [
"0.55312455",
"0.52996206",
"0.5266579",
"0.5221374",
"0.5221374",
"0.517468",
"0.5163341",
"0.51078963",
"0.50517434",
"0.50471324",
"0.50427085",
"0.502774",
"0.5012319",
"0.50084686",
"0.49883428",
"0.49859542",
"0.49719012",
"0.4968724",
"0.49675462",
"0.4964598",
"0.4963... | 0.77780515 | 0 |
Return a quoted string. | private function quoted(string $value): string
{
return sprintf('\'%s\'', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function intoQuote($string){ return \"'\".$string.\"'\"; }",
"public function quote($string)\n {\n return $string;\n }",
"function Quote( $text ) {\n\t\treturn '\\'' . getEscaped( $text ) . '\\'';\n\t}",
"protected function quote(?string $value): string {\n\n\t\t\t$quote = $this->q... | [
"0.76372737",
"0.7116245",
"0.68340015",
"0.6698825",
"0.66868883",
"0.6665269",
"0.6660876",
"0.66060334",
"0.6601523",
"0.65798753",
"0.6541228",
"0.6525636",
"0.6521907",
"0.6472696",
"0.645455",
"0.6454229",
"0.6442873",
"0.64425737",
"0.64340484",
"0.6418185",
"0.6410671... | 0.7508239 | 1 |
The config array already contains our servers configuration data parsed into an array for us to work on, now we need to process and build a new array of categorised data that we can use to produce a consistent view file for the world login pages to use. Categories we want: 1. General Settings CountUpgrades = If Upgrades are counted as building slots. NoSubsidies=1 ElectionsOn=1 SendingMoney=0 AlliesPageOn=1 TranscendingOn=1 RandomSeasons=1 RelayEconomy=0 MagnaAtApprentice=1 MaxInvestors=100 NoTradeCenter=1 2. Tycoon Upgrade Levels Apprentice.facLimit=50 Entrepreneur.facLimit=100 Tycoon.facLimit=200 Master.facLimit=350 Paradigm.facLimit=500 Legend.facLimit=501 3. Boosts ResInhabBoost=5 ConstBoost=3 CommerceBoost=1 4. Upgrade Levels CountUpgrades = If Upgrades are counted as building slots. MaxServiceUpgrades MaxOfficeUpgrades ResMaxUpgrade MaxRCenterUpgrade=50 5. Misc Settings Tutorial=0 RemoveVisitors=1 RepairRoads=0 VoteLevel=1 FightFacColonies=yes LifeAfterLegend = ? ServiceBuysBatched=1 RemoveVisitors=1 RoadZone=11 MinTaxesPer=20 MinCivicsWage=150 MaxSubPop=500 MixedPlanet=1 MixedDesire=1000 ServiceBuysBatched=1 6. Building Separation MinCommerceSep=2 MinOfficeSep=1 7. Thread Speeds / Priorities SimSpeed=3 DASpeed=4 CacheSpeed=4 IntSpeed=0 Trans=0 | public static function processConfig($configArray)
{
$baseCategories = [
'general_settings' => [
'display_name' => 'General Settings',
'display' => 'block',
'settings' => [
'CountUpgrades' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Count Upgrades',
'tool_tip' => 'Count upgrades as building slots',
'description' => 'Count upgrades as building slots',
],
'NoSubsidies' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Town Subsidies',
'tool_tip' => 'Town subsidies at low population',
'description' => 'Town subsidies at low population',
],
'ElectionsOn' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Elections',
'tool_tip' => 'Elections enabled or not',
'description' => 'Election of Mayor and Presidents enabled',
],
'SendingMoney' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Money Transfers',
'tool_tip' => 'Allow money transfers between players',
'description' => 'Allow money transfers between players',
],
'AlliesPageOn' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Allies',
'tool_tip' => 'Allow player alliances',
'description' => 'Allow player alliances',
],
'TranscendingOn' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Transcendence',
'tool_tip' => 'Allow nobility gain through transcendence',
'description' => 'Allow nobility gain through transcendence',
],
'RandomSeasons' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Random Seasons',
'tool_tip' => 'Random game seasons in suppose to spring, summer, autumn, winter cycle',
'description' => 'Random game seasons in suppose to spring, summer, autumn, winter cycle',
],
'RelayEconomy' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Recession Code',
'tool_tip' => 'Whether recession code is active in simulation',
'description' => 'Whether recession code is active in simulation',
],
'MagnaAtApprentice' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Apprentice Magna',
'tool_tip' => 'If apprentices with enough nobility can create magna companies',
'description' => 'If apprentices with enough nobility can create magna companies',
],
'MaxInvestors' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Max World Players',
'tool_tip' => 'Maximum player allowed to join this world',
'description' => 'Maximum player allowed to join this world',
],
'NoTradeCenter' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'No Trade Centre',
'tool_tip' => 'Prevent trade centre sales',
'description' => 'Prevent trade centre sales',
],
],
],
'tycoon_upgrade_levels' => [
'display_name' => 'Tycoon Building Slots',
'display' => 'block',
'settings' => [
'Apprentice.facLimit' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Apprentice',
'tool_tip' => 'Maximum building slots for this level',
'description' => 'Maximum building slots for this level',
],
'Entrepreneur.facLimit' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Entrepreneur',
'tool_tip' => 'Maximum building slots for this level',
'description' => 'Maximum building slots for this level',
],
'Tycoon.facLimit' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Tycoon',
'tool_tip' => 'Maximum building slots for this level',
'description' => 'Maximum building slots for this level',
],
'Master.facLimit' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Master',
'tool_tip' => 'Maximum building slots for this level',
'description' => 'Maximum building slots for this level',
],
'Paradigm.facLimit' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Paradigm',
'tool_tip' => 'Maximum building slots for this level',
'description' => 'Maximum building slots for this level',
],
'Legend.facLimit' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Legend',
'tool_tip' => 'Maximum building slots for this level',
'description' => 'Maximum building slots for this level',
],
],
],
'building_upgrade_levels' => [
'display_name' => 'Building Max Upgrades',
'display' => 'block',
'settings' => [
'CountUpgrades' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Count Upgrades',
'tool_tip' => 'Count building upgrades as a building slot',
'description' => 'Count building upgrades as a building slot',
],
'MaxServiceUpgrades' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Service Maximum',
'tool_tip' => 'Maximum upgrade level for services',
'description' => 'Maximum upgrade level for services',
],
'MaxOfficeUpgrades' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Office Maximum',
'tool_tip' => 'Maximum upgrade level for offices',
'description' => 'Maximum upgrade level for offices',
],
'ResMaxUpgrade' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Residential Maximum',
'tool_tip' => 'Maximum upgrade level for residencies',
'description' => 'Maximum upgrade level for residencies',
],
'MaxRCenterUpgrade' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Research Centre Maximum',
'tool_tip' => 'Maximum upgrade level for research centres',
'description' => 'Maximum upgrade level for research centres',
],
],
],
'misc_settings' => [
'display_name' => 'Misc Settings',
'display' => 'block',
'settings' => [
'Tutorial' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Tutorial Mode',
'tool_tip' => 'If enabled players are guided by a tutorial',
'description' => 'If enabled players are guided by a tutorial',
],
'RemoveVisitors' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Remove Visitors',
'tool_tip' => 'Prevent visitor access to the world',
'description' => 'Prevent visitor access to the world',
],
'RepairRoads' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Repair Roads',
'tool_tip' => 'Automatically repair roads',
'description' => 'Automatically repair roads',
],
'VoteLevel' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Vote Level',
'tool_tip' => 'Votes required for office',
'description' => 'Votes required for office',
],
'FightFacColonies' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Fighting faction colonies',
'tool_tip' => 'Fighting faction colonies',
'description' => 'Fighting faction colonies',
],
'LifeAfterLegend' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Life after Legend',
'tool_tip' => 'Whether Tycoon can continue level after legend',
'description' => 'Whether Tycoon can continue level after legend',
],
'ServiceBuysBatched' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Services Buy Batched',
'tool_tip' => 'Services buy supplies in batches',
'description' => 'Services buy supplies in batches',
],
'RoadZone' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Road Zone',
'tool_tip' => 'The zone that roads belong to',
'description' => 'The zone that roads belong to',
],
'MinTaxesPer' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Minimum Taxes',
'tool_tip' => 'Minimum tax level',
'description' => 'Minimum tax level',
],
'MinCivicsWage' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Minimum Civic Wages',
'tool_tip' => 'This is the minimum wage level a Tycoon can set for civic wages',
'description' => 'This is the minimum wage level a Tycoon can set for civic wages',
],
'MaxSubPop' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Maximum Subsidy Population',
'tool_tip' => 'The level of population after which subsidies will no longer be paid',
'description' => 'The level of population after which subsidies will no longer be paid',
],
'MixedPlanet' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Mixed Planet',
'tool_tip' => 'An as yet unknown setting',
'description' => 'An as yet unknown setting',
],
'MixedDesire' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Mixed Desire',
'tool_tip' => 'An as yet unknown setting',
'description' => 'An as yet unknown setting',
],
],
],
'boosts' => [
'display_name' => 'Simulation Boosts',
'display' => 'block',
'settings' => [
'ResInhabBoost' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Residential Boost',
'tool_tip' => 'Residential Boost',
'description' => 'Residential Boost',
],
'ConstBoost' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Construction Boost',
'tool_tip' => 'Construction Boost',
'description' => 'Construction Boost',
],
'CommerceBoost' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Commerce Boost',
'tool_tip' => 'Commerce Boost',
'description' => 'Commerce Boost',
],
],
],
'building_separation' => [
'display_name' => 'Building Separation',
'display' => 'block',
'settings' => [
'MinCommerceSep' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Commerce',
'tool_tip' => 'How far apart commerce buildings of the same class must be',
'description' => 'How far apart commerce buildings of the same class must be',
],
'MinOfficeSep' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Office',
'tool_tip' => 'How far apart office buildings of the same class must be',
'description' => 'How far apart office buildings of the same class must be',
],
],
],
'thread_speeds' => [
'display_name' => 'Thread Speeds',
'display' => 'none',
'settings' => [
'SimSpeed' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Model Server',
'tool_tip' => 'Simulation Speed',
'description' => 'Simulation Speed',
],
'DASpeed' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Direct Access',
'tool_tip' => 'Speed of something',
'description' => 'Speed of something',
],
'CacheSpeed' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Cache Server',
'tool_tip' => 'Cache server speed',
'description' => 'Cache server speed',
],
'IntSpeed' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Interface Server',
'tool_tip' => 'Interface Server speed',
'description' => 'Interface Server speed',
],
'Trans' => [
'setting' => '',
'default' => '',
'display' => 'block',
'input_type' => 'text',
'display_name' => 'Transcendence',
'tool_tip' => 'Speed of transcendence',
'description' => 'Speed of transcendence',
],
],
],
];
foreach ($baseCategories as $categoryKey => &$category) {
foreach ($category['settings'] as $settingName => &$setting) {
$setting['setting'] = $configArray[$settingName] ?? $setting['default'];
}
}
return self::makeTables($baseCategories);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function config_choose()\n {\n // Find all categories\n $hooks = find_all_hooks('systems', 'config');\n $categories = array();\n foreach (array_keys($hooks) as $hook) {\n require_code('hooks/systems/config/' . filter_naughty_harsh($hook));\n $ob = object_... | [
"0.5982476",
"0.58706844",
"0.5782111",
"0.570049",
"0.55908024",
"0.552025",
"0.53857785",
"0.53610164",
"0.52334493",
"0.51933086",
"0.51803577",
"0.5179615",
"0.51159894",
"0.5115016",
"0.50811833",
"0.5073223",
"0.5065959",
"0.50629276",
"0.5054828",
"0.50415343",
"0.5036... | 0.68413734 | 0 |
Some custom styles for slides in Revolution Slider admin | function aitRevSliderAdminStyles(){ wp_enqueue_style('ait-revolution-slider-admin-css', THEME_URL . '/design/admin-plugins/revslider.css'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sb_slideshow_edit_admin_style() {\n\tif (!sb_verify_post_type('slideshow')) return; // verify post type\n?>\n\t<style type=\"text/css\">\n\t\tth.column-id { width:50px; }\n\t\tth.column-shortcode { width:180px; }\n\t\tinput.urlfield { width:155px; }\n\t</style>\n<?php\n}",
"function create_slider() {\n ... | [
"0.7163396",
"0.6579227",
"0.6411208",
"0.6399297",
"0.6370105",
"0.63146704",
"0.6293575",
"0.6271795",
"0.6225943",
"0.62078696",
"0.62013036",
"0.61960953",
"0.6153122",
"0.61516774",
"0.614801",
"0.6116234",
"0.6109848",
"0.607009",
"0.6043716",
"0.6013781",
"0.6012693",
... | 0.7036279 | 1 |
This is a sample file URL, define your own! Duplicate below line as needed to exclude multiple files | function wp_rocket_exclude_from_cache_busting( $excluded_files = array() ) {
$excluded_files[] = 'https://www.freerangecamping.com.au/directory/wp-json/api/v1/user';
$excluded_files[] = '/wp-json/api/v1/user';
$excluded_files[] = 'https://www.freerangecamping.com.au/directory/wp-json/api/v1/user/frc_login';
$excluded_files[] = '/wp-json/api/v1/user/frc_login';
return $excluded_files;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function addExcludeFile($vpath)\n\t{\n\t\t$files\t= config::get(\":siteFSexclude\", array());\n\t\t$files[$vpath]\t= $vpath;\n\t\tconfig::set(\":siteFSexclude\", $files);\n\t}",
"public function disableConcatenateFiles() {}",
"public function getSourceExcludes();",
"function ignore($excl){\n $excl[... | [
"0.6092679",
"0.60269",
"0.59948575",
"0.59231466",
"0.5810132",
"0.57174313",
"0.5646342",
"0.5641473",
"0.56074303",
"0.55814236",
"0.55526775",
"0.54456675",
"0.54260945",
"0.538938",
"0.53664976",
"0.53628534",
"0.5352751",
"0.5352365",
"0.5324134",
"0.53231615",
"0.53138... | 0.66079074 | 0 |
Load Goa party from goabase api | public function actionLoadgoaparty($id){
$goaBaseApi = new GoaBaseApi();
$goaParty = $goaBaseApi->getParty($id);
return $this->render('goaparty', ['party' => $goaParty]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function partyByName($party_name)\n {\n // ASCII = english name\n // UTF-8 = greek name\n if (mb_detect_encoding($party_name) == 'ASCII') {\n $party = Party::where('fullname_en', '=', $party_name)->first();\n } else if (mb_detect_encoding($party_name) == 'UTF-8') {\... | [
"0.5505238",
"0.5182065",
"0.5158959",
"0.51213515",
"0.5101965",
"0.4982141",
"0.49760327",
"0.49708676",
"0.49707845",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"0.49644774",
"... | 0.5724518 | 0 |
Is called by the cron job, checks if a cronjob is running and reloads all social media content. | public function actionCron() {
if (!Yii::$app->cache->get('cron')) {
Yii::$app->cache->set('cron', true);
try {
$eventModels = Event::find()->all();
foreach ($eventModels as $eventModel) {
$socialMediaModels = SocialMedia::find()->where(['event_id' => $eventModel->id])->orderBy('id')->all();
Yii::$app->cache->delete('socialmedia' . $eventModel->id);
$this->findSocialMedia($eventModel->id, $socialMediaModels);
}
} catch (Exception $e) {
Yii::$app->cache->delete('cron');
return $e;
}
Yii::$app->cache->delete('cron');
return 'Cron-job successful.';
} else {
return 'Cron-job already running.';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cron()\n\t{\n\t\tglobal $wpdb,\n\t\t\t\t\t $wgobd_importer_helper,\n\t\t\t\t\t $wgobd_events_helper,\n\t\t\t\t\t $wgobd_settings_controller;\n\n\t\t// ====================\n\t\t// = Select all feeds =\n\t\t// ====================\n\t\t$table_name = $wpdb->prefix . 'wgobd_event_feeds';\n\t\t$sql = \"SELECT... | [
"0.62960064",
"0.6002295",
"0.59985125",
"0.59789884",
"0.5807026",
"0.57494456",
"0.5748267",
"0.5744877",
"0.5737135",
"0.57294106",
"0.5722282",
"0.5692741",
"0.5669009",
"0.5638065",
"0.559893",
"0.5586244",
"0.55589575",
"0.54940087",
"0.54729044",
"0.5446612",
"0.543938... | 0.6509287 | 0 |
Sort date from eventList | private function sortEventList($eventList){
$anz = count($eventList);
$temp="";
for ($a = 0; $a < $anz; $a++) {
for ($b = 0; $b < $anz -2; $b++) {
if ($eventList[$b +1]->start_date < $eventList[$b]->start_date) {
$temp = $eventList[$b];
$eventList[$b] = $eventList[$b +1];
$eventList[$b +1] = $temp;
}
}
}
return $eventList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_sort_event_list()\n\t{\n\t$temp = $this->get_event_list();\n\tif (!empty($temp))\n\t{\n\t\tusort($temp, [&$this, \"ical_dtstart_compare\"]);\n\t\treturn $temp;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t}",
"public function sort_projects_by_date ()\n {\n\n }",
"public function getSo... | [
"0.74938416",
"0.65839666",
"0.6485",
"0.6463082",
"0.63868636",
"0.6334563",
"0.6244892",
"0.6176524",
"0.6129585",
"0.60245866",
"0.60062766",
"0.6005522",
"0.5977371",
"0.5972849",
"0.5971844",
"0.59616023",
"0.5933118",
"0.59314245",
"0.59272987",
"0.5795483",
"0.5784241"... | 0.81565565 | 0 |
function to ignore the role Access for common apis for both Expert and Customers | private function _ignoreRoleAccess($prefix){
if($prefix){
$commonApis = [
'api' => [
'Users' => ['addPhone'],
'UserDeviceTokens' => ['add','edit'],
'SpecializationServices' => ['index'],
'ExpertSpecializationServices' => ['view']
],
'api/user' => [
'AppointmentBookings' => ['index','view'],
'AppointmentReviews' => ['add'],
'Users' => ['addCard','deleteCard','listCards','viewCard']
]
];
return !$this->_checkUnAuthorized($commonApis[$prefix]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rol_conductor_not_access()\n {\n if ($this->rol != 1 && $this->rol != 2) {\n exit($this->httpResponse(\"error\", \"forbbiden\", \"Your role do not have permission\", 403)->json());\n }\n }",
"public function rol_conductor_only_access()\n {\n if ($this->rol... | [
"0.6486725",
"0.63079035",
"0.62683296",
"0.6145359",
"0.6128574",
"0.60971445",
"0.6065098",
"0.6021666",
"0.6021666",
"0.59413856",
"0.59299886",
"0.59209114",
"0.58816683",
"0.58645564",
"0.5860146",
"0.58368206",
"0.58193684",
"0.5787158",
"0.5736261",
"0.57143116",
"0.56... | 0.66071016 | 0 |
Calculates an association route between source and target model | private function _getAssociationRoute($source, $target, $route, $exclude){
if($source == $target) {
return $target;
}
$tableObject = TableRegistry::get($source);
$entityClass = $tableObject->entityClass();
$entityClass = (new \ReflectionClass($entityClass))->getShortName();
//Check if Model Exists or not ($entityClass will equal to 'Entity if no model exists')
if($entityClass == 'Entity'){
return false;
}
$associations = $tableObject->associations();
unset($tableObject);
$array = $associations->keys();
$source = strtolower($source);
$target = strtolower($target);
if(!$array){
return false;
}
if(in_array($target, $array)){
$route[] = $associations->get($target)->name();
return $route;
}else{
$exclude[] = $source;
foreach ($array as $key => $value) {
if(!in_array($value, $exclude)){
$value = $associations->get($value)->name();
$check = $this->_getAssociationRoute($value, $target, $route, $exclude);
if($check != false){
$check[] = $value;
return $check;
}
}
}
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function destinations(){\n $this->belongsToMany(Destination::class);\n }",
"public function route(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = route_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Route::class);\n\t}",
"public function link($from,$to)\n {\n //\n ... | [
"0.54888225",
"0.54252654",
"0.53722924",
"0.53400636",
"0.52018255",
"0.5178212",
"0.51626736",
"0.51306427",
"0.5101064",
"0.49980292",
"0.49609435",
"0.49051705",
"0.48482326",
"0.4824491",
"0.48200256",
"0.47924343",
"0.47924343",
"0.47924343",
"0.47924343",
"0.47924343",
... | 0.6623788 | 0 |
For methods that require Auth Adding Middle Layer to authenticate every request Checking if the request has valid api key as part of the parameters | function authenticate(\Slim\Route $route) {
// Getting request headers
//$headers = apache_request_headers();
$response = array();
$app = \Slim\Slim::getInstance();
$apiKey = $app->request->params('apikey');
// Verifying Authorization Header
if (isset($apiKey)) {
$db = new DbHandler();
if (!$db->isValidApiKey($apiKey)) {
// api key is not present in users table
$response["error"] = TRUE;
$response["message"] = "Access Denied. Invalid Api key";
echoRespnse(401, $response);
$app->stop();
} else {
global $user_id;
// get user primary key id
$user_id = $db->getUserId($apiKey);
}
} else {
// api key is missing in header
$response["error"] = TRUE;
$response["message"] = "Api key is missing";
echoRespnse(400, $response);
$app->stop();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function authenticate(\\Slim\\Route $route) {\r\n // getting request header\r\n $headers = apache_request_headers();\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n // verifying authorization header\r\n \r\n if (isset($headers['Authorization'])) {\r\n // $db = new DbHandler();\r\n /... | [
"0.7394396",
"0.7387564",
"0.7354594",
"0.73307085",
"0.732884",
"0.732884",
"0.732862",
"0.72336626",
"0.7229021",
"0.71814793",
"0.70410246",
"0.6886968",
"0.6789589",
"0.6789589",
"0.66653436",
"0.65309656",
"0.6482107",
"0.64532775",
"0.6401184",
"0.63812876",
"0.6373667"... | 0.7400555 | 0 |
Register new FULL JOIN with set of on conditions (linking one table to another, no parametric on conditions allowed here). | public function fullJoin($table, $on = null)
{
$this->joinTokens[$this->activeJoin = $table] = ['type' => 'FULL', 'on' => []];
return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fullOuterJoin($table);",
"public function leftJoin($table, $conditions = []);",
"public function join($table, $on, $field = null, $comparitor = null);",
"public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);",
"public function set_join($table_or_alias, $on = null, $type='LEF... | [
"0.5942434",
"0.5643703",
"0.55640864",
"0.55603325",
"0.5541785",
"0.53078884",
"0.5291819",
"0.5225621",
"0.5197811",
"0.51808584",
"0.51302886",
"0.51093346",
"0.5107836",
"0.5074838",
"0.50630224",
"0.50248724",
"0.49944013",
"0.49753523",
"0.49329835",
"0.49230638",
"0.4... | 0.64135015 | 0 |
Find a region by ID. | public static function find($id) {
$regionDb = Yadda_Db_Table::getInstance('region');
$select = $regionDb
->select()
->from('region')
->where('status = ?', 'active')
->where('id = ?', $id);
$region = $regionDb->fetchRow($select);
if ($region === null) {
throw new Yadda_Model_Exception('There is no region with the supplied ID.');
}
return self::toArray($region);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function find($id) {\n\t\treturn Doctrine::getTable ( 'Regions' )->findOneBy ( 'region_id', $id );\n\t}",
"public function getRegionById($id)\n\t{\n\t\tif($id === null)\n\t\t\treturn null;\n\t\t$this->ensureRegionsLoaded(array($id));\n\t\tif(!isset($this->_regions[$id]))\n\t\t\treturn null;\n\t\tre... | [
"0.8358393",
"0.66860247",
"0.66278726",
"0.64072245",
"0.6303355",
"0.62986165",
"0.6257389",
"0.62041575",
"0.61952657",
"0.6162741",
"0.6153608",
"0.61195225",
"0.6116599",
"0.6092943",
"0.6081218",
"0.6079749",
"0.6052687",
"0.60417145",
"0.60000944",
"0.60000944",
"0.600... | 0.7944306 | 1 |
Returns a paginated list of regions matching the given parameters. | public static function search(array $params) {
// build query
$regionDb = Yadda_Db_Table::getInstance('region');
$select = $regionDb
->select()
->from('region')
->where('status = ?', 'active')
->order('name');
// fetch
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select));
$paginator->setCurrentPageNumber(isset($params['page']) ? (int) $params['page'] : 1);
$paginator->setItemCountPerPage(isset($params['count']) ? (int) $params['count'] : 10);
$return = array(
'params' => $params,
'total' => $paginator->getTotalItemCount(),
'page' => $paginator->getCurrentPageNumber(),
'pages' => $paginator->count(),
'results' => array()
);
$regions = new Zend_Db_Table_Rowset(array(
'table' => $regionDb,
'data' => (array) $paginator->getCurrentItems()
));
foreach ($regions as $region) {
$return['results'][] = self::toArray($region);
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function regions(Request $request): RegionCollection\n {\n return RegionCollection::make(Region::query()->with('translates')->paginate($request->get('perPage') ?? 50));\n }",
"public static function all(array $params = array()) {\n\t\t// build query\n\t\t$regionDb = Yadda_Db_Table::getInstanc... | [
"0.6666061",
"0.65811896",
"0.6450932",
"0.64392364",
"0.629342",
"0.6120395",
"0.61152184",
"0.6073787",
"0.59615517",
"0.5918425",
"0.5908692",
"0.5877012",
"0.5875595",
"0.58669007",
"0.5859056",
"0.5857596",
"0.5811992",
"0.5809966",
"0.5809694",
"0.5756056",
"0.5728041",... | 0.6704238 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.