query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Grid Row JS Callback
public function getRowClickCallback() { $js = " function (grid, event) { var trElement = Event.findElement(event, 'tr'); var isInput = Event.element(event).tagName == 'INPUT'; var input = $('".$this->getInput()."'); if (trElement)...
[ "protected function getRowCallbackFunction(){}", "public function getRowClickCallback()\n {\n $chooserJsObject = $this->getId();\n $js = '\n function (grid, event) {\n var trElement = Event.findElement(event, \"tr\");\n var blockId = trElement.down(\"td\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Gets the 'a2lix_translation_form.default.listener.translationsforms' service. This service is shared. This method always returns the same instance of the service.
protected function getA2lixTranslationForm_Default_Listener_TranslationsformsService() { return $this->services['a2lix_translation_form.default.listener.translationsforms'] = new \A2lix\TranslationFormBundle\Form\EventListener\TranslationsFormsListener(); }
[ "protected function getA2lixTranslationForm_Default_Type_TranslationsService()\n {\n return $this->services['a2lix_translation_form.default.type.translations'] = new \\A2lix\\TranslationFormBundle\\Form\\Type\\TranslationsType($this->get('a2lix_translation_form.default.listener.translations'), array(0 => ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function allow change properties "rule_title" value
public function set_rule_title($p_rule_title){ $this->v_rule_title = $p_rule_title; }
[ "protected function set_title()\n {\n }", "public function set_title($title);", "public function getTitle($rules_reaction_rule) {\n return $this->t('Edit reaction rule \"@label\"', ['@label' => $rules_reaction_rule->label()]);\n }", "function setTitle($newTitle, $editTitle);", "function up...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The test case. Generated from protobuf field .google.cloud.dialogflow.cx.v3beta1.TestCase test_case = 1;
public function getTestCase() { return isset($this->test_case) ? $this->test_case : null; }
[ "public function setTestCases($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Ads\\GoogleAds\\Util\\Testing\\TestCase::class);\n $this->test_cases = $arr;\n\n return $this;\n }", "public function RunTestCase(\\Google\\Cloud\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Fungsi dibawah ini digunakan untuk menampilkan form tambah artikel baru (hanya form). Pada baris 84 terdapat variabel 'categories' yang berfungsi untuk mengambil data kategori untuk ditampilkan pada combobox Sama halnya pada baris 85 untuk mengambil data tag artikel
function tambahartikel() { $data=array( 'categories' => $this->admin_model->datakategori(), 'tagnews' => $this->admin_model->tag() ); $this->template->load('adminweb/media','adminweb/mod_artikel/tambah_artikel',$data); }
[ "public function cat_form()\n {\n global $dsp;\n\n // Check for existing categories\n $cat_array = $this->get_cat_array($this->cat_id, 1);\n if ($cat_array) {\n $dsp->AddDropDownFieldRow(\"cat_id\", t('Produktkategorie'), $cat_array, \"\");\n }\n\n $dsp->AddTe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ver las competencias /=============================================================================================
public static function verCompetencia(){ $rel=Conexion::conectar('localhost','proyecto','root',''); $resultado=$rel->prepare("SELECT * FROM resultados_aprendizaje"); $resultado->execute(); return $resultado; }
[ "public function Verificacion_Condiciones_Establecidas_Compras() {\n //DATOS RELACIONADOS CON EL VALOR MÍNIMO DEL PEDIDO Y CONDICION PARA REALIZAR EL PAGO.\n if ( Session::Get('cumple_condicion_cpras_tron_industial') == TRUE){\n Session::Set('valor_real_pedido', $this->Vr_Total_Pedido_Amigos ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the contentCachingPublicRanges A list of custom IP ranges that Apple's content caching service should use to match clients to content caches. This collection can contain a maximum of 500 elements.
public function setContentCachingPublicRanges($val) { $this->_propDict["contentCachingPublicRanges"] = $val; return $this; }
[ "public function setContentCachingPeerFilterRanges($val)\n {\n $this->_propDict[\"contentCachingPeerFilterRanges\"] = $val;\n return $this;\n }", "public function setIpRanges($val)\n {\n $this->_propDict[\"ipRanges\"] = $val;\n return $this;\n }", "function setIPRanges($i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return number of canceled memberships
public function countCanceledMembers(){ $dbs = $this->getDB()->prepare ('select * from memberstatus where StatusCode = "C"'); $dbs->execute(); $countCanceled = $dbs->rowCount(); return $countCanceled; }
[ "protected function countPendingInvites()\n {\n $searchModel = new MembershipSearch();\n $searchModel->space_id = $this->space->id;\n $searchModel->status = Membership::STATUS_INVITED;\n return $searchModel->search([])->getCount();\n }", "public function numOfWithdrawnActivity()\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send request to facebook.com for authorization user
public function actionFacebook() { if(isset($_SESSION['send_request_to_fb'])){ unset($_SESSION['send_request_to_fb']); $this->route->redirect('social/facebook_callback/'); } $_SESSION['id_object'] = $this->route->getVar('id_object', 0); $social = slSocial::getConf...
[ "public function request_token()\n {\n // http_build_query sanitizes the data and prevents injection attacks\n $query = http_build_query(\n array(\n 'client_id' => $this->config->item('facebook_app_id'),\n 'redirect_uri' => site_url('facebook/access_token...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The number of indexes added to the schema.
public function indexesAdded(): int { return $this->indexesAdded; }
[ "public function countIndexes()\r\n\t{\r\n\t\tif ($this->indexes)\r\n\t\t\treturn count($this->indexes);\r\n\t\telse \r\n\t\t\treturn 0;\r\n\t}", "public function count_nb_documents_to_be_indexed() {\n\n\t\treturn $this->index_data( 0, null );\n\n\t}", "public function getIndexCount() {\n\t\treturn $this->_inde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows to get sortable column's name
public function getSortableName() { if ($this->sortable === false) { return false; } if (!is_bool($this->sortable)) { return $this->sortable; } if (is_scalar($this->value)) { return $this->value; } return false; }
[ "public function getOrderColumnName();", "protected function getSortableIndexName()\n {\n return sprintf('%s_%s_%s', $this->getTable()->getTableName(), $this->_options['name'], $this->_options['indexName']);\n }", "public function getColumnDisplayName()\n {\n return $this->column_display_name;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uploads file and returns the model
public function upload() { $params = $this->getUploadParams(); if ($params) { $class = $this->class; $uri = $class::getUri(); $document = static::post($this->client, $uri, $params); /** @var Model $instance */ $instance = new $this->class...
[ "public function upload(): Media\n {\n $this->verifyFile();\n\n $model = $this->populateModel($this->makeModel());\n\n if (is_callable($this->before_save)) {\n call_user_func($this->before_save, $model, $this->source);\n }\n\n $this->verifyDestination($model);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Amazon Payments authorization metabox
public function meta_box() { global $post, $wpdb; $order_id = absint( $post->ID ); $order = new WC_Order( $order_id ); if ( 'amazon_payments_advanced' == $order->payment_method ) { add_meta_box( 'woocommerce-amazon-payments-advanced', __( 'Amazon Payments Advanced', 'woocommerce-gateway-amazon-payments-...
[ "public function woo_slg_login_amazon() {\n\t\t\n\t\tglobal $woo_slg_options;\n\n\t\t//check amazon is enable or not\n\t\tif( $woo_slg_options['woo_slg_enable_amazon'] == \"yes\") {\n\t\t\t\n\t\t\t$amazonimgurl = isset( $woo_slg_options['woo_slg_amazon_icon_url'] ) && !empty( $woo_slg_options['woo_slg_amazon_icon_u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes a string from a string with a regex identifier
function preg_remove($regex, $string) { return preg_replace($regex, '', $string); }
[ "public function removeByRegex($regex) { }", "public function deleteFromRegex($regexPattern);", "function eliminaUnidores($string) {\n // Devuelve el string sin eso\n if(!empty($string)) {\n return preg_replace(\"/(\\bel)|(\\bla.)|(\\blo.)|(\\by\\b)|(\\bo\\b)/\", $string);\n }\n }", "private fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method returns the current request parameters, can only be called after the dispatch() method is called. Its a wrapper for self::getVariable('PARAMS', self::$ARR_DISPATCH_DATA);
public function getRequestParams() { //return (self::$ARR_DISPATCH_DATA['PARAMS']); return array_merge($_GET, $_POST); }
[ "public static function get_current_request_params() {\n\t\t\t\n\t\t\treturn (isset(self::$current_request['params']) and is_array(self::$current_request['params'])) ? self::$current_request['params'] : array();\n\t\t\t\n\t\t}", "protected function __get_params() {\n\t\t\treturn $this->request->params;\n\t\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call Exchange Rate Api
function exchangeRateApi($from = null, $to = null, $apiKey = null) { // Fetching JSON $req_url = 'https://v6.exchangerate-api.com/v6/' . $apiKey . '/latest/' . $from; $response_json = file_get_contents($req_url); // Continuing if we got a result if(false !== $response_json) { // Decoding ...
[ "public function getExchangeRate();", "function get_exchange_rate(){\n\n $data = array(\n 'token' => $this->session->userdata('token')\n ); \n\n $cek_token = $this->Shoope_model->get_token($data)->row();\n \n if (is_null($cek_token) == FALSE){\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the provided message builder.
protected function callMessageBuilder($callback, $message) { if ($callback instanceof Closure) { return call_user_func($callback, $message); } else if (is_string($callback)) { $instance = $this->container->make($callback); return $instance->mail($message); ...
[ "protected function callMessageBuilder($callback, $message)\n {\n return call_user_func($callback, $message);\n }", "protected function callMessageBuilder($callback, MessageContract $message)\n {\n if ($callback instanceof Closure) {\n return $callback($message);\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test if map identifiers are the same.
public function testMapIdentsMatch() { $aMapIdentsDE = $this->_getMap($this->getThemeName(), 'de'); $aMapIdentsEN = $this->_getMap($this->getThemeName(), 'en'); if (($aMapIdentsDE == array()) || ($aMapIdentsEN == array())) { $this->fail(' Map array is empty'); } ...
[ "public function equals (Map $map) : bool;", "#[@test]\n public function equalsOtherMapWithSameContents() {\n $other= new Hashmap();\n $this->map->put('color', 'green');\n $other->put('color', 'green');\n $this->assertTrue($this->map->equals($other));\n }", "private function compareMappings($a, $b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fills token stream field of the processed string objects Add lexical errors if any exists.
public function scan(&$processedstring) { // Lexer must be a valid JLexPHP class, or implement next_token() and get_errors() // Also it can implement find_errors for seeking of deferred errors $scanerclass = $this->lexername(); $string = $processedstring->string; if (is_a($s...
[ "public function test_scanning_error_in_beginning() {\r\n $lang = new block_formal_langs_language_c_language();\r\n //Unmatched quote or comments tests\r\n $processedstring = $lang->create_from_string('\\'abc asv ');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ load all time sheets view
function all_timesheets() { $this->access_only_team_members(); $members = $this->_get_members_to_manage_timesheet(); $view_data['members_dropdown'] = json_encode($this->_prepare_members_dropdown_for_timesheet_filter($members)); $view_data['projects_dropdown'] = json_encode($this->_get_a...
[ "public function setLoadAllSheets();", "private function load() {\n\t\t\t$sheet = array();\n\t\t\t\n\t\t\t$this->db->where('username',$this->user->getUsername());\n\t\t\t$rows = $this->db->get('sheets');\n\t\t\tforeach($rows as $row) {\n\t\t\t\t$sheet['id'] = $row['id'];\n\t\t\t\t$sheet['name'] = $row['name'];\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This test ensures that all dblists are alphasorted
public function testListsAreSorted() { $lists = DBList::getLists(); foreach ( $lists as $listname => $dbnames ) { $origdbnames = $dbnames; sort( $dbnames ); $this->assertEquals( $origdbnames, $dbnames, "{$listname}.dblist is not alphasorted" ); } }
[ "public function testIsAlpha() {\n $this->assertTrue(Hash::isAlpha(array('foo', 'bar')));\n $this->assertTrue(Hash::isAlpha(array('foo' => 'bar', 'number' => '123'), false));\n $this->assertTrue(Hash::isAlpha(array('bar', '123'), false));\n\n $this->assertFalse(Hash::isAlpha(array('foo' ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getGroupOrder($surveyid,$gid) queries the database for the sortorder of a group.
function getGroupOrder($surveyid, $gid) { $s_lang = Survey::model()->findByPk($surveyid)->language; $grporder_result = QuestionGroup::model()->findByAttributes(array('sid' => $surveyid, 'gid' => $gid, 'language' => $s_lang)); //Checked $grporder_row = $grporder_result->attributes; $group_order = $grpord...
[ "public function getGroupOrder($group_id) {\n return $this->_db->get('groups', array('id', '=', $group_id))->results()[0]->order;\n }", "function sort_groups($group_type='ARO') {\r\n\r\n\t\tswitch(strtolower($group_type)) {\r\n\t\t\tcase 'axo':\r\n\t\t\t\t$table = 'axo_groups';\r\n\t\t\t\tbreak;\r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make new updated resource event.
function updated_resource(Model $resource, Authenticatable $user = null) { return crud_event(\Core\Crud\Events\UpdatedResource::class, $resource, $user); }
[ "public function updated(Resource $resource)\n {\n //\n }", "public function testUpdateResource()\n {\n\n }", "public function dispatchOnPostUpdateResource($resource);", "function updating_resource(Model $resource, Authenticatable $user = null)\n { \n return crud_event(\\Core\\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get total number from the input SQL and parameters
protected function getTotal ($sql, $paramsList=array()) { $return = 0; if (count((array)$paramsList)) { $this->_db->query($sql, $paramsList); } else { $this->_db->query($sql); } if ($row = $this->_db->fetchArray()) { $return = (int)$row['...
[ "function TotalInDatabase()\r\n{\r\n\tglobal $COMMON;\r\n $query = \"SELECT COUNT(`id`) as 'answer' FROM `ProjectDB`\";\r\n $return = $COMMON->executeQuery($query, $this);\r\n $countRows = $return->fetch(PDO::FETCH_ASSOC);\r\n return $countRows['answer'];\r\n}", "function getTotal($where){\r\t\t$strSQ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the given iterable, mapping enumerators (objects or values) to data values.
public function addIterable(iterable $map): void { $innerMap = $this->map; foreach ($map as $enumerator => $value) { $ord = ($this->enumeration)::get($enumerator)->getOrdinal(); $innerMap[$ord] = $value; } $this->map = $innerMap; }
[ "function values(iterable $iterable): \\Iterator {\n foreach ($iterable as $value) {\n yield $value;\n }\n}", "public function extend($iterable)\n {\n parent::append(Conversions::mixedToIterator($iterable));\n }", "private function buildValues(iterable $values): Generator\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a collection of RolePengguna objects related by a onetomany relationship to the current object. It will also schedule objects for deletion based on a diff between old objects (aka persisted) and new objects from the given Propel collection.
public function setRolePenggunas(PropelCollection $rolePenggunas, PropelPDO $con = null) { $rolePenggunasToDelete = $this->getRolePenggunas(new Criteria(), $con)->diff($rolePenggunas); $this->rolePenggunasScheduledForDeletion = unserialize(serialize($rolePenggunasToDelete)); foreach ($role...
[ "public function setRolePenggunas(PropelCollection $rolePenggunas, PropelPDO $con = null)\n {\n $rolePenggunasToDelete = $this->getRolePenggunas(new Criteria(), $con)->diff($rolePenggunas);\n\n $this->rolePenggunasScheduledForDeletion = unserialize(serialize($rolePenggunasToDelete));\n\n for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the content entities of the specified entity type.
public static function deleteContentEntities($entity_type_id, &$context) { $storage = \Drupal::entityTypeManager()->getStorage($entity_type_id); // Set the entity type ID in the results array so we can access it in the // batch finished callback. $context['results']['entity_type_id'] = $entity_type_id;...
[ "function hook_ENTITY_TYPE_delete(\\Drupal\\Core\\Entity\\EntityInterface $entity) {\n // Delete the entity's entry from a fictional table of all entities.\n \\Drupal::database()->delete('example_entity')\n ->condition('type', $entity->getEntityTypeId())\n ->condition('id', $entity->id())\n ->execute();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle get mutator column for grid.
protected function handleGetMutatorColumn($method, $label) { if ($this->model()->eloquent()->hasGetMutator($method)) { return $this->addColumn($method, $label); } return false; }
[ "public static function mapGettersColumns();", "protected abstract function getMutator();", "public function get_column_value()\n {\n if ( isset( $this->properties['admin-column']['callback'] ) )\n {\n $id = \"{$this->namespace}-{$this->properties['slug']}\";\n $value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Operation convertToWordsAsync Returns document with the result of conversion
public function convertToWordsAsync(Requests\ConvertToWordsRequest $request) { return $this->convertToWordsAsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; } ); }
[ "function watsonTranslator($source, $target, $sentences)\n{\n if (!$source || $source === 'auto') {\n header('HTTP/1.1 400 Bad Request');\n exit(1);\n }\n $username = getenv('IBM_CLOUD_USERNAME');\n $password = getenv('IBM_CLOUD_PASSWORD');\n $request = [\n 'text' => $sentences,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Switch these to include the 'webinar' posty type in using this taxonomy
function resource_custom_taxonomies(){ // register_taxonomy('use_case', array( 'case_study','product_info','report','video','webinar' ), array( register_taxonomy('use_case', array( 'case_study','product_info','white_paper','video' ), array( 'labels' => array( 'name' => 'Use Case', 'singu...
[ "function register_webinartopics_tax() {\n $labels = array(\n 'name' => _x( 'Webinar Topics', 'taxonomy general name' ),\n 'singular_name' => _x( 'Webinar Topic', 'taxonomy singular name' ),\n 'add_new' => _x( 'Add New Webinar Topic', 'Institute Center'),\n 'add...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get list of documentary by given options
public function getDocumentaries($options = array()) { $sql = "SELECT * "; $from = " FROM `{$this->_tablename}` "; $where = " WHERE 1 = 1 "; if($options['editor']) { $where .= " AND `editor` = {$this->_db->quote($options['editor'])} "; } if($options['new']) { if($options['new'] == 2) { ...
[ "public function getDocuments();", "function loadDocList() {\n\t\treturn $this->content->loadDocList();\n\t}", "public function getCachedDocuments($options = array()) {\n if ( ! isset($options['query'])) $options['query'] = array();\n $query = $this->buildQuery($options['query']);\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unquote a string and optionally return the quote removed. Meant to work with unique pairs of quotes, so passing in "AAABAC" will break it.
public static function unquote(string $string, string $quotes = '\'\'""', string &$leftQuote = ''): string { if (strlen($string) < 2) { $leftQuote = ''; return $string; } $q = substr($string, 0, 1); $leftOffset = strpos($quotes, $q); if ($leftOffset === false) { $leftQuote = ''; return $string; ...
[ "function _dequote($string)\r\n {\r\n if (($string{0} == \"'\" || $string{0} == '\"') &&\r\n substr($string, -1) == $string{0})\r\n return substr($string, 1, -1);\r\n else\r\n return $string;\r\n }", "public function parseQuoted($string) {\n if (substr($stri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
login method Method for the API User to login
public function login() { if($this->request->query) { $apiUser = $this->ApiUser->login($this->request->query); $this->set(compact('apiUser')); } else { $this->api_response("500", "Unauthorised"); } }
[ "public function login() {\n\n $validator = $this->getValidator();\n $validator->set($this->request->data);\n\n $validator->validate = [\n 'user_id' => [\n 'rule' => 'notBlank',\n 'message' => __('ユーザーIDが必須です。'),\n 'required' => true\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the userLogin property
public function getUserLogin() { return $this->userLogin; }
[ "public function getUserLogin() {\n return $this->userLogin;\n }", "public function getUserLogin()\n {\n return $this->user_login;\n }", "public function getUserLogin()\n {\n return $this->{$this->getUserLoginName()};\n }", "public function getLogin()\r\n {\r\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clean up kernel usage in this test !
protected function tearDown() { // purposefully not calling parent class, which shuts down the kernel }
[ "abstract protected function ensureKernelShutdown();", "abstract protected static function ensureKernelShutdown();", "public function tearDown()\n {\n // kill the kernel\n static::$kernel->shutdown();\n }", "public function resetKernel()\n {\n // Reset the kernel only if it has b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation deleteNetworkWirelessSsidIdentityPskWithHttpInfo Delete an Identity PSK
public function deleteNetworkWirelessSsidIdentityPskWithHttpInfo($network_id, $number, $identity_psk_id) { $returnType = ''; $request = $this->deleteNetworkWirelessSsidIdentityPskRequest($network_id, $number, $identity_psk_id); try { $options = $this->createHttpClientOption(); ...
[ "public function deleteNetworkWirelessSsidIdentityPsk($network_id, $number, $identity_psk_id)\n {\n $this->deleteNetworkWirelessSsidIdentityPskWithHttpInfo($network_id, $number, $identity_psk_id);\n }", "public function testDeleteNetworkWirelessSsidIdentityPsk()\n {\n }", "protected function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetches the type of the secondtolast state in the path
public function getParentStateType();
[ "public function getEndStateType();", "function getLastStation () {\n return $this->pathArray[$this->numSegments - 1]->m1;\n }", "public function getLastNode()\n {\n return $this->secondPath->getLastNode();\n }", "public function lastComponent() {\n\t\t\treturn pathinfo( $this->_path, P...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show grades for the given class
function grades($class_id) { $this->load->model("class_admin/gradebk_model"); $data['class_id'] = $class_id; $data['classinfo'] = $this->admin_model->load_class_info($data['class_id']); $student_id = $this->session->userdata('id'); $data['possible'] = $this->gradebk_model-...
[ "public function printGrades(){\t\r\n\t\t\t\techo \"Grades are ... <br/>\";\r\n\t\t\t\tforeach($this->grades as $gradeKey=>$grade){\r\n\t\t\t\techo \"course {$this->courses[$gradeKey]} and grade {$grade} <br/>\";\r\n\t\t\t\t}\r\n\t\t\t}", "function show_classes( $psid )\n{\n\n\t$info = unserialize ( $_SESSION['in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the name to a rank number.
public static function getRankName($rank) { switch($rank) { case 0: return "Guild Master"; case 1: return "Bank"; case 2: return "minimalist"; case 3: return "trialist"; case 4: return "Koeh der Woche"; case 5: return "Chef de Cuisine"; case 6: return "Kimi"; case 7: return "Community"; cas...
[ "abstract protected function getRankingName();", "public function getRank(): string\n {\n return ($this->face_up ? $this->rank : ' ');\n }", "public function getFormattedRank()\n\t{\n\t\treturn fNumber($this->getRank());\n\t}", "public function getRankstr() {\n return $this->get(self::RANK...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets endpoint remote handler. The handler will be used for readability data computation. Used in tests.
public function set_remote_handler( $request ) { $this->_endpoint_remote_handler = $request; }
[ "public function setHandler($handler);", "protected function setHandler()\n {\n $this->handlerStack->setHandler($this->mocker);\n\n // create client and pass handler\n $this->httpClient = new Client(['handler' => $this->handlerStack]);\n\n $this->exportToExampleService->setClient($t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the position of the previous record.
public function getPrevPosition() { $object = $this->getInvoker(); $q = $object->getTable()->createQuery(); $q->select($this->_options['name']); $q->orderBy($this->_options['name'] . ' desc'); $q->addWhere($this->_options['name'] . ' < ?', $object->get($this->_options['name'])); foreach($th...
[ "public function getPreviousRecordID()\n {\n return $this->getAdjacentRecordID(-1);\n }", "public function getPreviousOffset()\n {\n return $this->_pageOffset( $this->getPreviousPage() );\n }", "public function getPreviousCursor()\n {\n return $this->getCursor('before');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get queued status text.
public function get_queued_status() { return ''; }
[ "public function getQueuedStateText(): string\n {\n return match ((int) $this->getAttribute('queue_state')) {\n Manager::QUEUE_NA => '',\n Manager::QUEUE_DONE => 'done',\n Manager::QUEUE_WAITING => 'waiting',\n Manager::QUEUE_WORKING => 'working',\n d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Form validation handler for city_form().
function city_form_validate($form, &$form_state) { if ($form_state['values']['title'] == '') { form_set_error('title', t('You must set \'City name\'')); } if ($form_state['values']['geoname_id'] == '') { form_set_error('geoname_id', t('You must set \'Geoname ID\'')); } elseif (strcmp((int) $form_state['...
[ "public function validate_city(){\n\t\t\t\n\t\t\t//obtain posted value\n\t\t\t$city = $this->input->post('city');\n\t\t\t\n\t\t\t//check if selected or default\n\t\t\tif ($city == '0')\n\t\t\t{\n\t\t\t\t//no city selected\n\t\t\t\t$this->form_validation->set_message('validate_city', 'Please select a city!');\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the winner or draw if there is one, null if the game is unfinished
protected function getWinnerInternal() { if ($this->checkWinFor(self::PLAYER_A)) { return self::PLAYER_A; } if ($this->checkWinFor(self::PLAYER_B)) { return self::PLAYER_B; } if (strpos($this->asString(), $this->getEmptySymbol())===false) { ...
[ "public function getWinner()\n\t{\n\t\tif ( ! $this->engine->inCheckmate()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->engine->turn() == \"w\" ? \"black\" : \"white\";\n\t}", "public function winner()\n {\n return $this->edit->winner();\n }", "public function winner() {\n Log::debug(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the special date of the current object.
public function getSpecialDate() { return $this->specialDate; }
[ "public function getMetaDate()\n {\n return $this->dbObject('Date');\n }", "public function nowDate()\n {\n return $this->asUserDate($this->getNow());\n }", "public static function GetCurrentDate()\n {\n return date(self::DB_DATE_FORMAT);\n }", "private function current...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation addRequestsProcessSandboxAPIOnlyAsync Add Requests: Process (Sandbox API Only)
public function addRequestsProcessSandboxAPIOnlyAsync($api_key, $v, $content_type, $body) { return $this->addRequestsProcessSandboxAPIOnlyAsyncWithHttpInfo($api_key, $v, $content_type, $body) ->then( function ($response) { return $response[0]; ...
[ "public function addRequestsProcessSandboxAPIOnly($api_key, $v, $content_type, $body)\n {\n $this->addRequestsProcessSandboxAPIOnlyWithHttpInfo($api_key, $v, $content_type, $body);\n }", "private function addMissingConsentRequests()\n {\n $addon = ee('Addon')->get('consent');\n $requ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Building has many wards
public function wards() { return $this->belongsToMany(Ward::class); }
[ "public function wards(){\n return $this->hasMany(Ward::class);\n }", "public function ward()\n {\n return $this->hasMany(Ward::class);\n }", "public function buildings()\n {\n return $this->belongsToMany('App\\Building', 'department', 'faculty_id', 'building_id');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Subscribe to the given topic.
public function subscribe($topic);
[ "public function subscribe(Topic $topic);", "public function subscribe(Topic $topic, Connection $connection);", "function onSubscribe(ConnectionInterface $conn, $topic);", "public function subscribe($topic, $qos) {}", "public function subscribe($topic)\n {\n $normalizedTopic = $this->normalizeTopi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the url for the file depending if is private of public.
protected function getUrl() { if ($this->isPrivate() && config('filemanager.disk') != 'public') { return $this->filesystem->temporaryUrl($this->path, now()->addMinutes(config('filemanager.temporary_url_expired_time'))); } return $this->filesystem->url($this->path); }
[ "public function getPrivateFileUrl(): string\n {\n return $this->privateFileUrl;\n }", "public function getPublicUrl()\n\t{\n\t\treturn $this->publicPath .'/'. $this->file->getName();\n\t}", "public function getURL()\n {\n $url = null;\n $app = Application::getFacadeApplication();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fills the provided config aware struct with config structs, according to the provided value.
public function buildConfigUpdateStructs(ConfigAwareValue $configAwareValue, ConfigAwareStruct $configAwareStruct): void { foreach ($configAwareValue->getConfigs() as $configKey => $config) { $configStruct = new ConfigStruct(); $configStruct->fillParametersFromConfig($config); ...
[ "public function process(Config $value);", "private static function moduleSettings_build(&$settings, $instance, $config, $values = null, $augment = true) {\n foreach ($config as $c) {\n $key = $c[\"key\"];\n $repeats = $c[\"repeatable\"] == true;\n $sub = isset($c[\"sub_set...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the base row total for the order item.
public function getBaseRowTotal();
[ "public function getBaseRowTotal() {\n return $this->item->getBaseRowTotal();\n }", "protected function getOrderItemRowTotal($item = null)\n {\n if ($item === null) {\n $item = $this;\n }\n\n if (is_array($item)) {\n $item = new DataObject($item);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
belongsTo relationship with ChargerConnectorType.
public function charger_connector_type() { return $this -> belongsTo( ChargerConnectorType :: class ); }
[ "public function charger_connector_types()\n {\n return $this -> hasMany(ChargerConnectorType::class);\n }", "public function connector()\n {\n return $this->belongsTo('App\\\\SurveyConnector','connector_id');\n }", "public function device_type () {\n return $this->belongsTo('App\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functie: getAndereVacatures Doel: vind alle vacatures van een specifieke werkgever behalve de meegegeven vacature en ordert ze
public function getAndereVacatures($vacature) { return $this->createQueryBuilder('v') ->andWhere('v.user = :val') ->setParameter('val', $vacature->getUser()) ->andWhere('v.id != :self') ->setParameter('self', $vacature->getId()) ->orderBy('v.datum DESC...
[ "public function getAllVacatures() {\n return $this->createQueryBuilder('v')\n ->orderBy('v.datum DESC, v.id', 'DESC')\n ->getQuery()\n ->getResult();\n }", "public function getAllVacatures(){\n return($this->findAll());\n }", "function datosVac($idVacaciones...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
// Get all products_id in a Category and its SubCategories use as: $my_products_id_list = array(); $my_products_id_list = zen_get_categories_products_list($categories_id)
function zen_get_categories_products_list($categories_id, $include_deactivated = false, $include_child = true, $parent_category = '0', $display_limit = '') { global $db; global $categories_products_id_list; $childCatID = str_replace('_', '', substr($categories_id, strrpos($categories_id, '_'))); $...
[ "function fn_twg_get_category_product_ids($category_id, $get_sub = false)\n{\n if (empty($category_id)) {\n return false;\n }\n\n $_categories[] = $category_id;\n\n if ($get_sub) {\n\n $category_params = array (\n 'id' => !empty($category_id) ? $category_id : 0,\n 't...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test getting checkbox values for all possible configurations.
public function testCheckboxValues() { $self = $this; $values = function ($display, $no_is_optout, $disable_optin) use ($self) { $c = $self->getComponent([ 'display' => $display, 'no_is_optout' => $no_is_optout, 'disable_optin' => $disable_optin, ]); return Values::chec...
[ "public function test_parse_checkbox()\n\t{\n\t\t$id = '';\n\t\t$input = array();\n\t\t$object = LiteSpeed_Cache::config();\n\t\t$options = $object->get_options();\n $bool = LiteSpeed_Cache_Admin::parse_checkbox($id, $input, $options);\n \t$this->assertFalse($bool);\t\n\t}", "public function testMulti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of the TotalOfferCount property.
public function setTotalOfferCount($value) { $this->_fields['TotalOfferCount']['FieldValue'] = $value; return $this; }
[ "public function withTotalOfferCount($value)\n {\n $this->setTotalOfferCount($value);\n return $this;\n }", "public function setOfferCount($value)\n {\n if (!$this->_isNumericArray($value)) {\n $value = array ($value);\n }\n $this->_fields['OfferCount']['Fiel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a single code matching the name, if any exists. Replace periods with hypens (e.g. 'R509' for 'R50.9') 'codes/v1/icd10/:code_name' GET
public function singleCode($code_name, array $options = array()) { $body = (isset($options['query']) ? $options['query'] : array()); $body['code_name'] = $code_name; $response = $this->client->get('codes/v1/icd10/'.rawurlencode($code_name).'', $body, $options); return $response; ...
[ "public function get($code);", "public function getByCode($code);", "public function lookup($code)\n {\n return $this->client->get('discount_codes/lookup.json', null, [\n 'code' => $code,\n ], ['raw', 'headers']);\n }", "public function findOneByCode($code);", "public static f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove an admin user. Remove an admin user from the adminUsers database table by using their ID.
public function removeAdminUser($id) { $stmt = $this->mysqli->prepare("DELETE FROM adminUsers WHERE adminID=?"); $stmt->bind_param("i", $id); $stmt->execute(); var_dump($stmt); if ($this->mysqli->affected_rows == -1) { return false; } else { return...
[ "private function remove_admin()\n\t{\n\t\t$this->login();\n\t\t$user = $this->auth->get_user();\n\t\tModel::factory('user_roles')->remove($user->user_id, 3); // 3 is admin in testing...\n\t\t$this->auth->logout();\n\t\t$this->login();\n\t}", "static function deleteAdmin($idAdmin)\n {\n\n $con=Database:...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets all the members which are in this group as Person instances array
public function getMembers() { $group = $this; return array_column(array_filter($this->parent->person_group_relations, function ($relation) use ($group) { return $relation["group"] == $group; }), "person"); }
[ "public function get_group_persons()\n\t{\n\t\t$persons = new object_list();\n\t\t$user_inst = get_instance(user_obj::CLID);\n\n\t\tforeach(get_instance(self::CLID)->get_group_members($this) as $o)\n\t\t{\n\t\t\t$persons->add($user_inst->get_person_for_user($o));\n\t\t}\n\t\treturn $persons;\n\t}", "public functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function copies a directory containing a valid photo gallery from some directory into a content item for the given trip iin the current whiteacorn system
function importJournalGallery(string $srcDir, string $trip) : void { $info = new \SplFileInfo($srcDir); if (! $info-> isDir()) throw new \Exception("{$srcDir} is not a directory"); if (\Gallery\GalObject::isGallery($srcDir)) { throw new \Exception("{$srcDir} is not a valid gallery"); } $itemName = $info->getBa...
[ "private function copyFiles($path,$passname) {\n \n if($this->logopath){\n copy($this->logopath,$path.$passname.\"/logo.png\");\n }\n if($this->logohdpath){\n copy($this->logohdpath,$path.$passname.\"/logo@2x.png\");\n }\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recibe la id de una orden y cambia su estado a finalizada.
public function EndOrden($id) { $query = "UPDATE trabajo SET estado='finalizada' where idtrabajo=" . $id; $this->db->query($query); }
[ "function nuevoIdInventarioUsuario() {\n\t\t$conUltimo=\"select id_inventario_usuario from inventario_usuario order by id_inventario_usuario desc limit 1\";\n\t\t$cons=new consecutivo(\"IIU\",$conUltimo);\n\t\t$this->idInventarioUsuario=$cons->retornar();\t\t\n\t}", "private function getNewIdContato(){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add_plugin adds a plugin by its slug.
function add_plugin(string $plugin_slug) { // How do I get the plugin? $current = get_option('active_plugins'); $plugin = plugin_basename(trim($plugin_slug)); if ( !in_array($plugin, $current) && replace_plugin($plugin_slug) ) { return true; } return false; }
[ "function add_plugin($plugin)\n {\n }", "public function addPlugin(Plugin $plugin): void;", "public function add_plugin($plugin)\n {\n $this->plugins[] = $plugin;\n }", "function jetpack_register_plugin( $slug ) {\n\t_deprecated_function( __FUNCTION__, '7.1', 'Jetpack_Gutenberg::set_extensi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
makes sure the given DN contains exactly one space after each ,
function normalize_dn($dn){ $dn = preg_replace('/,/',', ',$dn); $dn = preg_replace('/,\s+/',', ',$dn); return $dn; }
[ "protected function escapeDN($dn) {\n\t\tif (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\tif (! trim($dn))\n\t\t\treturn $dn;\n\n\t\t# Check if the RDN has a comma and escape it.\n\t\twhile (preg_match('/([^\\\\\\\\])...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retorna los datos de heladera de todos los pacientes
public function datosHeladera(){ $answer = $this->queryList("SELECT heladera FROM paciente",[]); return $answer; }
[ "public function getPiezas(){\n\n\t\t$em = $this->getEntityManager(); \n\n\t\t$array = array(); \n \n $pieza = 'SELECT p FROM InformaticaBundle:Pieza p WHERE p.id <> 0 ORDER By p.id ASC';\n $pieza = $em->createQuery($pieza); \n $pieza = $pieza->getResult();\n\n return $pieza; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The ProcessChargeAmountNotification function is a shell function for handling a . You will need to modify this function to relay the information in the to your internal systems that process that data.
function ProcessChargeAmountNotification($dom_response_obj) { /* * +++ CHANGE ME +++ * Charge amount notifications inform you that a customer has been * charged for either the full amount or a partial amount of an * order. A <charge-amount-notification> contains the order number * that Goog...
[ "public function handleChargeUpdated()\n {\n return $this->processPayment();\n }", "function ProcessRefundAmountNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Refund amount notifications inform you that a customer has been\n * refunded either the full amount or a part...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
default append filter chain
function appendFilterChain() { // Directed intercepting filter event (auto_append) // see smart/actions/class.system_sys_append.php M( MOD_SYSTEM, 'sys_append' ); }
[ "function appendFilterChain()\n { \n // do nothing\n }", "public function appendFilter($filter)\n {\n return $this->addFilter($filter, self::CHAIN_APPEND);\n }", "function stream_filter_append ($stream, $filtername, $read_write = null, $params = null) {}", "protected function addFilt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the answer_choice field
function getAnswerChoice() { return $this->answer_choice; }
[ "public function getChoice() {\n\t\treturn $this->choice;\n\t}", "public function getAnsweroption()\n {\n return $this->answeroption;\n }", "private function getAnswerField() {\n return $this->answerField;\n }", "function getChoice()\n {\n\t if (count($_POST) == 0)\n\t\t return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of [tas_timeunit] column.
public function setTasTimeunit ($v) { // Since the native PHP type for this column is string, // we will cast the input to a string (if it is not). if ( $v !== null && !is_string ($v) ) { $v = (string) $v; } if ( $this->tas_timeunit !== $v || $v === 'DAY...
[ "function api_setTimeUnit($time_unit){\r\n\t\tglobal $ORIGINS,$DESTINATIONS,$TIMEUNIT,$TRAVELMODE,$KEY,$API_LINK;\r\n\t\t$TIMEUNIT = $time_unit;\r\n\t}", "public function setTasSelfserviceTimeUnit ($v)\n {\n\n // Since the native PHP type for this column is string,\n // we will cast the input to ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for gETReturnIdAttachments Retrieve the attachments associated to the return.
public function testGETReturnIdAttachments() { // TODO: implement $this->markTestIncomplete('Not implemented'); }
[ "public function gETReturnIdAttachments($return_id)\n {\n $this->gETReturnIdAttachmentsWithHttpInfo($return_id);\n }", "public function testGETGiftCardRecipientIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testGET...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loader constructor. Register autoloader in the stack SPL.
private function __construct() { spl_autoload_register(array(__CLASS__, '_load')); }
[ "public function __construct() {\n spl_autoload_register(array($this, 'loader'));\n }", "public function setupSplAutoloader()\n {\n spl_autoload_register([$this, 'load'], true, true);\n }", "private function initLoader() {\n $this->_loader = new Loader();\n\t}", "public function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get localization_code column for database table
protected static function localization_code(): mixed { return self::$query->localization_code; }
[ "public function getLanguageIdColumnName() {}", "public function getTranslationLocaleColumn()\n {\n return 'locale';\n }", "protected static function localized_code(): mixed\n\t{\n\t\treturn self::$query->localized_code;\n\t}", "public function getLanguageColumn()\n\t{\n\t\treturn $this->strLangC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new Newsletter
public function create(Mailjet\Model\Newsletter &$Newsletter) { return parent::_create($Newsletter); }
[ "public function createNewsletter();", "public function createNewsletterAction()\n {\n $data = $this->Request()->getParams();\n if (empty($data)) {\n $this->View()->assign([\n 'success' => false,\n 'message' => $this->translateMessage('error_msg/no_data_pa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SRI for public file
public function getPublicFileSri(string $file): string { # Clean $file = $this->clean($file); # Handle real path $path = realpath($this->Config->getPublicDirectory() . "/$file"); $content = (string) @file_get_contents($path); # Subresource integrity hash return $this->sri($content); }
[ "public function RiceviFile($fileSdIAccoglienza);", "public function isPublic($path = '');", "function serve ()\n {\n // Get full file path\n $filepath = DIR_PUB . DS . $this->url_full;\n\n // Make sure it exists and is readable\n if (!is_file($filepath) or !is_readable($filepath)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the testimonial table in the database
function create_table() { $sql = "CREATE TABLE {$this->table_testimonial} ( {$this->col_id} INT(2) PRIMARY KEY AUTO_INCREMENT, {$this->col_source} VARCHAR(100) NOT NULL, {$this->col_message} TEXT NOT NULL )"; $query = $this->db->query($sql); return $query; ...
[ "function ssTestiCheckCreateTestiTable() {\r\n global $wpdb;\r\n\r\n //-- check testimonial table exist or not, if not then create new table\r\n if( $wpdb->get_var(\"SHOW TABLES LIKE '$wpdb->base_prefix.$this->ss_testi_table_name'\") != $wpdb->base_prefix.$this->ss_testi_table_name ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the private 'parameter_bag' shared service.
protected function getParameterBagService() { return $this->privates['parameter_bag'] = new \Symfony\Component\DependencyInjection\ParameterBag\ContainerBag($this); }
[ "public function getParameterBag()\n {\n return $this->parameterBag;\n }", "public function createParameterBag()\n {\n return new ParameterBag();\n }", "protected function getSylius_ProcessStorage_Session_BagService()\n {\n return $this->services['sylius.process_storage.sessi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test updating a ticket
public function testUpdate() { // Create $ph_ticket = $this->phactory->create('tickets'); // Update test $this->ticket->id = $ph_ticket->ticket_id; $this->ticket->summary = 'Mumkins Go Jumping At Night'; $this->ticket->save(); // Get $ph_ticket = $this->...
[ "public function testUpdateOneTicket()\n {\n $crawler = $this->client->request('PATCH', '/api/tickets/1');\n\n $this->assertTrue($this->client->getResponse()->isOk());\n }", "public function testCollectionTicketsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('No...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if changing the sheet works as expected and also if it handles faulty inputs correctly.
public function testChangeSheetFunction(): void { foreach ($this->reader->getSheets() as $index => $worksheet) { $sheet_name_in_sheet_data = $worksheet->getName(); self::assertTrue( $this->reader->changeSheet($index), 'Unable to switch to sheet [' . $i...
[ "static function isValidSpreadSheet ($data) {\n\t\tJLog::add('entry validateSpreadSheet()', JLog::DEBUG, 'com_mfn');\n\t\n\t\t$valid = true;\n\t\n\t\t$size = count($data);\n\t\t\n\t\t// Dump the data array to find errors\n\t\tJLog::add('$data = '.print_r($data, true), JLog::DEBUG, 'com_mfn');\n\t\t\n\t\n\t\t// Igno...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the super admin status.
public function setSuperAdmin($boolean);
[ "public function getSuperAdminStatus()\r\n\r\n\t{\r\n\r\n\t\treturn $this->superAdmin;\r\n\r\n \t}", "public static function setAdminMode () {\r\n self::$adminMode = true;\r\n }", "private function setAdmin()\n {\n $_SESSION['admin'] = TRUE;\n }", "public function setAdmin($val): void {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete the access rights for user on a folder.
public function deleteAcl($folder, $user) { $this->_failOnMissingAcl(); return $this->_driver->deleteAcl($folder, $user); }
[ "public function deleteAcl($folder, $user)\n {\n $folder = $this->_convertToInternal($folder);\n $this->_failOnMissingFolder($folder);\n $this->_failOnNoAdmin($folder);\n if ($this->_data->hasUserPermissions($folder, $user)) {\n $this->_data->deleteUserPermissions($folder, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the CbacInformeSemanalCac model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = CbacInformeSemanalCac::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException('The requested page does not exist.'); }
[ "protected function findModel($idColeta)\n {\n if (($model = Coleta::findOne($idColeta)) !== null)\n {\n return $model;\n } else\n {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($ID_CAR,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make a multiple select widget, if options < 5 it will be expanded into radios by default Required parameters: 'id', 'options' (in array) Optional parameters: 'name', 'class', 'value' (selected value) or other html attributes 'expand' (true or false, by default 'auto') 'useEmpty', 'emptyText' (used in select mode) 'pref...
protected static function builtInMultipleChoose(array $parameters) { static::checkRequiredParameters($parameters, ['id', 'options']); $options = (array)$parameters['options']; $parameters[0] = $id = $parameters['id']; $expand = isset($parameters['expand']) ? $parameters['expand'] : '...
[ "function add_multiselect($name, $label, $values, $strings, $selected = null, $size = 5, $params = null) \n {\n if (count((array)$values) != count((array)$strings)) {\n return;\n }\n $selected = explode(',', $selected);\n $options = null;\n for ($i = 1; $i <= count((...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all users that are not agents.
public static function getAllNonAgents() { return User::select(DB::raw('users.*, user_types.user_type')) ->leftJoin('user_types','user_types.id','=','users.user_type_id') ->whereRaw('users.agent_id = 0') ->get(); }
[ "public function get_all_user_not_regis()\n\t{\n\t\t$sql = \"SELECT * FROM $this->hr_db.`hr_person` WHERE ps_id not in (SELECT su_ps_id FROM $this->swm_db.`swm_user`)\";\n\t\t$query = $this->swm->query($sql);\n\n\t\treturn $query;\n\t}", "public function findAllUsersWithoutProfiles();", "public function getNonR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set a callablecondition When set, debug output will be restricted to if the supplied condition evaluates to TRUE
public function setCondition($condition) { if( is_callable($condition) || is_null($condition) ): $this->condition = $condition; return $this; endif; throw new DebugException("Attempt to set a debug-condition failed: Supplied condition is not a a valid callback."); }
[ "public function setCondition(callable $condition);", "public function testGetCondition()\r\n {\r\n Debug::instance()->setCondition( function() {return TRUE;} );\r\n $this->assertTrue( Debug::instance()->getCondition() );\r\n Debug::instance()->setCondition( function() {return FALSE;} );\r\n $this->a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to send html for column dropdown list
function PMA_sendHtmlForColumnDropdownList() { $response = PMA_Response::getInstance(); $foreignTable = $_REQUEST['foreignTable']; $table_obj = new PMA_Table($foreignTable, $_REQUEST['foreignDb']); // Since views do not have keys defined on them provide the full list of columns if (PMA_Table::isVie...
[ "function display_select($table, $idx = NULL) {\n if ($table == NULL) {\n return false;\n }\n $table['data'] = $table;\n $table['column'] = current($table);\n $out = ''; // the return value\n $actual_id = 0; // actual index\n $fields_name[] = $table['column']; // contains the schema's columns\n // cros...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset session. Sets _SESSION to empty array.
public function resetSession() { $_SESSION = []; $_SESSION['active'] = false; }
[ "public function reset() {\n if ($this->_active) {\n $_SESSION = array();\n }\n }", "public function clearAll()\n {\n $_SESSION = [];\n }", "public function reset() {\n $this->papaya()->session->setValue($this->_sessionIdentifier, NULL);\n }", "public function destrySessions()\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get data current score from getCurrentScore function with condition user_id session from user login
public function getCurrentScore() { return DB::table('scores') ->select('score','current_page') ->where('user_id', Auth::user()->id) ->first(); }
[ "function get_user_score(){\r\n $cat_id = $this->input->post('cat_id');\r\n if(!isset($_SESSION['user_id']) || !isset($cat_id) || $cat_id > 4 || $cat_id < -1){ echo -1; return;}\r\n $_SESSION['current_category_id'] = $cat_id = ($cat_id != -1)? $cat_id : $_SESSION['current_category_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getVariableInstanceAsync Get Variable Instance
public function getVariableInstanceAsync($id, $deserialize_value = null) { return $this->getVariableInstanceAsyncWithHttpInfo($id, $deserialize_value) ->then( function ($response) { return $response[0]; } ); }
[ "public function get($id)\n {\n return $this->getApi()\n ->execute(\"variable-instance/{$id}\");\n }", "final public function GetVar() {\n\n return $this->\n connection->\n GetVar($this->\n Generate());\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the IDs of this object's children
public function getChildIds() { return $this->childIds; }
[ "public function getChildrenIds()\n {\n return array_map(\n function ($value) {\n return $value->getId();\n }, $this->children\n );\n }", "public function getChildrenIds()\n {\n $this->children = array();\n $this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new room with the provided name and password, contained within the request body as JSON.
public function createRoom(Request $request) { $body = $request->json()->all(); $name = isset($body['name']) ? $body['name'] : ''; $error = ''; if (empty($name)) { $error = 'A name must be provided to create a room.'; } else if (!RoomHelper::isRoomNameUnique($name)) ...
[ "public function testRoomCreate()\n\t{\n\t\t$client = static::createClient([], [\n\t\t\t'PHP_AUTH_USER' => $this->username,\n\t\t\t'PHP_AUTH_PW' => $this->password,\n\t\t]);\n\n\t\t$client->request('POST', '/api/room/create', [\n\t\t\t'name' => 'name',\n\t\t\t'description' => 'description'\n\t\t]);\n\n\t\t$this->as...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Form submit function. Update the role weights.
function mobiiapp_security_role_order_submit($form, &$form_state) { foreach ($form_state['values']['roles'] as $rid => $role_values) { $role = $form['roles'][$rid]['#role']; $role->weight = $role_values['weight']; user_role_save($role); } drupal_set_message(t('The role settings have been updated.')); }
[ "function recsys_wb_book_rating_form_submit($form, &$form_state) {\n // Get the rating from the form\n $rating = $form_state['values']['rating'];\n \n // Get the node\n $node = menu_get_object();\n \n // Get the books id\n $book_id = field_get_items(\"node\", $node, \"field_book_id\");\n $book_id = $book_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines whether the query is for an existing category archive page. If the $category parameter is specified, this function will additionally check if the query is for one of the categories specified.
public function is_category($category = '') { }
[ "protected function isCategoryPage()\n {\n return ($this->request->layout == 'category' || $this->request->task == 'category' || $this->request->view == 'latest');\n }", "protected function isCategoryPage()\n {\n return ($this->request->view == $this->viewCategory);\n }", "function exi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Create 1 or more users. $users is an array of 1 or more arrays, each with these fields as a minimum: username, password, firstname, lastname, email. E.g. to create a user, pass this in: array( array('username' => 'mine', 'password' => 'Password08!', 'firstname' => 'Michael', 'lastname' => 'Neidhardt',
function createuser($users) { $functionname = 'core_user_create_users'; return $this->restcall($functionname, array('users' => $users)); }
[ "protected function create_users(array $users) {\n $session = $this->getSession();\n\n foreach ($users as $username) {\n if (is_array($username)) {\n $name = $username['username'];\n $password = array_key_exists('password', $username) ? $username['password'] : 'pass';\n $email = arra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an HTML image tag for a Collection object
function image_tag_collection($collection, $which = '150x150', $options = array()) { if (is_null($collection) || !($collection instanceof Collection)) { return image_tag('legacy/multimedia/'. get_class($collection) .'/'. $which .'.png'); } $options = array_merge( array('alt_title' => $collection->getNa...
[ "function image_tag_collection($collection, $which = '150x150', $options = array())\n{\n if (is_null($collection) || !($collection instanceof Collection))\n {\n $class = is_object($collection) ? get_class($collection) : 'Collection';\n return cq_image_tag(sfConfig::get('sf_app') .'/multimedia/'. $class .'/'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the progress of the scanning (or initial ingest of scanned pages) AJAX: Gets the list of files for this book and their status as to being scanned and processed. The data comes from the database, which is in turn populated by the cron job. This also includes information about how many pages were found and how many a...
function progress() { if (!$this->common->check_session(true)) { return; } $this->common->ajax_headers(); $bc = $this->session->userdata('barcode'); $this->book->load($bc); // Strip out anything that's Processed. We want them to disappear from // the list when they are done. $raw_pages = $this->boo...
[ "public function get_scan_progress() {\n\t\t// We're not scanning or processing, return 0\n\t\tif ( ! $this->is_scanning() && ! $this->is_processing() ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$files = $this->count_files();\n\n\t\t// Only count unique file copy actions as remove's are generally paired with copy actions an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the windowsKioskForceUpdateSchedule force update schedule for Kiosk devices.
public function getWindowsKioskForceUpdateSchedule() { if (array_key_exists("windowsKioskForceUpdateSchedule", $this->_propDict)) { if (is_a($this->_propDict["windowsKioskForceUpdateSchedule"], "\Beta\Microsoft\Graph\Model\WindowsKioskForceUpdateSchedule") || is_null($this->_propDict["windowsKio...
[ "public function getWindows10AppsForceUpdateSchedule(): ?Windows10AppsForceUpdateSchedule {\n $val = $this->getBackingStore()->get('windows10AppsForceUpdateSchedule');\n if (is_null($val) || $val instanceof Windows10AppsForceUpdateSchedule) {\n return $val;\n }\n throw new \\U...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the resource has a link set
public function hasLink() { return $this->ResourceLink !== null; }
[ "public function hasLink() {\n return $this->link!=null;\n }", "public function hasHref();", "public function hasLinks()\n {\n return ! empty($this->links);\n }", "public function hasLink()\n {\n return !starts_with($this->attributes['link'], LARACRUMB_NOLINK_PREFIX);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new array containing all elements from source except any that are also present in exclude. Both input arrays must be sorted. This function will reset the pointer for both arrays.
public static function exclude_sorted(&$source, &$exclude) { $output = array(); $countSrc = count($source); $countExl = count($exclude); $valSrc = reset($source); $valExl = reset($exclude); while (($countSrc > 0) || ($countExl > 0)) { $cmp = ($countSrc > 0 && $countExl > 0) ? strcmp($valS...
[ "function array_except(array $array, array $exclude)\n {\n return collect($array)->except($exclude)->toArray();\n }", "public function testArrayExcept()\n {\n // Remove the following lines when you implement this test.\n $this->markTestIncomplete(\n 'This test has not been...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the maximum review rating.
public function get_max_rating() { return 5; }
[ "public function getMaxRating()\n {\n return $this->sMaxRating;\n }", "public function getRatingMax();", "static function get_max_rating()\n\t\t{\n\t\t\t}", "public function getMaxStarRating()\n {\n return $this->maxRating;\n }", "function maximum_rating() {\n $options = get_o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display a listing of the OrganizationGroup. GET|HEAD /organizationGroups
public function index(Request $request) { $organizationGroups = $this->organizationGroupRepository->all( $request->except(['skip', 'limit']), $request->get('skip'), $request->get('limit') ); return response()->success($organizationGroups->toArray(), 'Orga...
[ "public function listAction()\n {\n $this->action = 'list';\n\n /** @var ObjectManager $objectManager */\n $objectManager = $this->get('twomartens.core.db_manager');\n $repository = $objectManager->getRepository('TwoMartensCoreBundle:Group');\n $groups = $repository->findAll();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process the previous contents of the file from the current position through the callback.
public function readPreviousCallback(callable $func): void;
[ "protected function readPreviousIndex()\n\t{\n\t\t$position = ftell($this->indexHandle) - 1;\n\n\t\tif ($position <= 0) return;\n\n\t\t$line = '';\n\n\t\t// reads 1024B chunks of the file backwards from the current position, until a newline is found or we reach the top\n\t\twhile ($position > 0) {\n\t\t\t// find ne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }