query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Register the custom post type to store the ads.
public function registerAdsPostType() { $post_type = self::POST_TYPE_SLUG; register_post_type($post_type, [ 'label' => __('Ads', 'bam-ads-system'), 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'supports' => ['title', 'autho...
[ "public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}", "public function register_post_type() {\n\t\t\t\n\t\t\tregister_post_type($this->slug, $this->options);\n\t\t}", "public function register_post_type() {\n register_post_type($this->postType, $this->...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Formats order number to be Redsys compliant
protected function formatOrderNumber($orderNumber) { //Falta comprobar que empieza por 4 numericos y que como mucho tiene 12 de longitud $length = strlen($orderNumber); $minLength = 4; if ($length < $minLength) { $orderNumber = str_pad($orderNumber, $minLength, '0', STR_...
[ "function get_order_number() {\r\n\t\treturn apply_filters( 'learn_press_get_order_number', '#' . sprintf( \"%'.010d\", $this->id ), $this );\r\n\t}", "public function getnerate_order_number() {\n\t\t$id = (string) $this->db->select('id')->order_by('id','desc')->limit(1)->get('sale')->row('id') + 1;\n\t\t$num_of_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Appends $res to the resource queue if it is a resource.
private function pushResource($res) { if( is_resource($res) ) { array_push($this->resultQueue, $res); end($this->resultQueue); } }
[ "public function AddResource($res)\n\t\t{\n\t\t\tif (!isset($this->Resources))\n\t\t\t{\n\t\t\t\t$this->Resources = array();\n\t\t\t}\n\n\t\t\tif ($res instanceof DataPushResource && !in_array($res, $this->Resources))\n\t\t\t{\n\t\t\t\tarray_push($this->Resources, $res);\n\t\t\t}\n\t\t}", "public function add($re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation updateBundleItemAsyncWithHttpInfo Update a bundle item
public function updateBundleItemAsyncWithHttpInfo($id, $cascade = 'false', $bundle_item = null) { $returnType = '\KnetikCloud\Model\BundleItem'; $request = $this->updateBundleItemRequest($id, $cascade, $bundle_item); return $this->client->sendAsync($request)->then(function ($response) use (...
[ "public function updateDictionaryItemAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\DictionaryItemResponse';\n $request = $this->updateDictionaryItemRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test default value with blank request
public function testDefaultValueWithBlankRequest() { $field = $this->getField('string_field'); $field->setDefault(1); $_POST = [ $field->name => '', ]; $this->assertTrue($field->isValid()); $this->assertNull($field->value); }
[ "public function testDefaultValueWithBlankRequest()\n {\n $field = $this->getField('int_field');\n $field->setDefault(1);\n\n $_POST = [\n $field->name => '',\n ];\n\n $this->assertTrue($field->isValid());\n $this->assertNull($field->value);\n }", "public...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update PHP URL Link to information on updating a server's PHP version.
public function update_php_url() { $url = esc_url( 'https://github.com/ControlledChaos/dashboard-summary/blob/main/includes/docs/update-php-links.md' ); return apply_filters( 'ds_update_php_url', $url ); }
[ "public function testUpdateLink()\n {\n }", "function main ()\n{\n\tprint(\"<a href=\\\"php/update.php\\\">Update Links</a><br>\\n\");\n\tshow_links();\n}", "public function updateUrl()\n {\n return $this->paddleInfo()['update_url'];\n }", "public function change_details_url() {\n\t\t\tglob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of a privilege. Not all implementations may support this.
public function setPrivilege($privilege, $value);
[ "public function setPermission($value);", "public function setprivilege($v)\n {\n if ($v !== null) {\n if (is_string($v)) {\n $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n } else {\n $v = (boolean) $v;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is used to search for principals matching a set of properties. This search is specifically used by RFC3744's principalpropertysearch REPORT. The actual search should be a unicodenoncasesensitive search. The keys in searchProperties are the WebDAV property names, while the values are the property values to s...
function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { DebuggerUtility::var_dump('searchPrincipals'); // TODO: Implement searchPrincipals() method. }
[ "function searchPrincipals(array $searchProperties, $test = 'allof') {\n\n $result = $this->principalBackend->searchPrincipals($this->principalPrefix, $searchProperties, $test);\n $r = [];\n\n foreach ($result as $row) {\n list(, $r[]) = URLUtil::splitPath($row);\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract options from environment variables.
protected static function extractEnvironmentVariables(array $allowed) { $options = []; $dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); $dotenv->load(); foreach ($allowed as $name) { $value = getenv(strtoupper($name)); if ($value !== FALSE) { $options[$name] = $value; }...
[ "function getOptions($env_path = \".env\")\n{\n if (!empty($envOptions)) {\n return $envOptions;\n }\n\n if ($file = fopen($env_path, \"r\")) {\n while (!feof($file)) {\n list($opt_name, $value) = explode(\"=\", fgets($file));\n $envOptions[$opt_name] = trim($value);\n }\n fclose($file);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Action function \ Changes the permissions of the specified user | needs one user argument
protected function changePermission() { $params = array_merge($this->handleOptionalParameters("user_auth_token", "userId", "username", "mode"), $this->handleParameters("auth_token", "permission", "value")); $user = null; if ($params['user_auth_token'] != null) { $user = $this->model-...
[ "public function perm_change(){\n\t\t//Check if we sent the data via an form\n\t\tif ($this->input->post('submit')) {\n\t\t\t//Formats the data from a form into an array\n\t\t\t$data = $this->user_m->array_from_post(array('privileges'));\n\t\t\t//Saves the data into the database and reidrects us\n\t\t\t$this->user_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete a user. If $action is NULL, a confirmation will be shown. If it is "d", is_active will be set to 0. If it is anything else, the user will be deleted.
public function delete_user($id = NULL, $action = NULL) { $this->load->model('user_model'); if (is_null($action)) { $output = get_object_vars($this->user_model->get($id)); $output["users"] = $this->user_model->get_all(); $this->display_view("admin/users/delete", $output); } els...
[ "public function delete_user($user_id, $action = 0)\n {\n $user = $this->user_model->with_deleted()->get($user_id);\n if (is_null($user)) {\n redirect('user/admin/list_user');\n }\n\n switch($action) {\n case 0: // Display confirmation\n $output = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end here get all realted detail for owner start here
public function ownerdetail() { $ownerId = base64_decode($this->uri->segment(3)); if($this->session->userdata('userid') == ''){redirect(ADMIN_URL.'index');} $userdata = $this->session->userdata(); //$getallownerlist = $this->UserModel->getallownerlist(); $getOwnerById = $this->UserModel->getOwnerById($...
[ "public function getOwnerInfo();", "function getOwnerInfo()\r\n\t{\r\n\t\t$this->_setPropertyData();\r\n\t\t$this->_setOwnerData();\r\n\t\t$this->_setDataToSession();\r\n\r\n if($this->propertyType != 'fsbo' && $this->propertyType != 'expireds' && $this->propertyType != 'nod' && $this->propertyType != 'jlj...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch Single record from DB
public function fetchSingle(){ return $this->stmt->fetch(PDO::FETCH_OBJ); }
[ "public function Single(){\n\t\t$this->executeQuery();\n\n\t\treturn $this->query->fetch(PDO::FETCH_ASSOC);\n\t}", "public function single() {\n\t\t\t$this->execute();\n\t\t\treturn $this->stmt->fetch(PDO::FETCH_OBJ);\n\t\t}", "public function singleRecord () {\n try {\n $result = $this->sth->fetch(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a stacktrace of the calling stack as a string
public function getStackTrace() { $trace = debug_backtrace(); $arr1 = array(); $arr2 = array(); foreach ($trace as $obj) { $file = str_replace(getcwd(), "", $obj['file']); $arr1 []= "{$file}({$obj['line']})"; $arr2 []= "{$obj['function']}()"; } array_shift($arr2); $str = ''; for ($i = 0; $i <...
[ "public function getTraceAsString()\n {\n return implode(PHP_EOL, $this->aStackTrace);\n }", "public function getTraceAsString(): string\n {\n $remove = \"Stack trace:\\n\";\n $len = strpos($this->toString, $remove);\n if ($len === false) {\n return '';\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'spawnDeleteCategoriesJob'
public function spawnDeleteCategoriesJobRequest($catalog_category_delete_job_create_query, $apiKey = null) { // verify the required parameter 'catalog_category_delete_job_create_query' is set if ($catalog_category_delete_job_create_query === null || (is_array($catalog_category_delete_job_create_quer...
[ "public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null)\n {\n\n $resourcePath = '/api/catalog-category-bulk-delete-jobs/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns ShippingDelivery object for provided quote.
public function getDeliveryForQuote($quote) { return $this->getShippingDeliveryForItems( $quote->getAllItems(), $quote->getCityRef(), $quote->getWarehouseRef() ); }
[ "public function getCheckoutQuoteObject($quote)\n {\n $shippingAddress = $quote->getShippingAddress();\n $shipping = null;\n if ($shippingAddress) {\n $shipping = array(\n 'name' => array('full' => $shippingAddress->getName()),\n 'phone_number' => $sh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set default rule of parameterize route.
protected function setDefaultRule() { if (Yii::$app->authManager->getRule(RouteRule::RULE_NAME) === null) { Yii::$app->authManager->add(Yii::createObject([ 'class' => RouteRule::className(), 'name' => RouteRule::RULE_NAME] )); } }
[ "private static function initDefaultParameterPatterns() {\n self::$route->pattern('id','[0-9]+');\n self::$route->pattern('view_name','[A-Za-z_]+');\n }", "public function getDefaultRouteParameterName();", "public function defaultRule();", "function SetDefaultRoute($param)\n{\n\tglobal $route...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if block is registered.
private function check_block_is_registered( WP_Block_Parser_Block $block, $type, $package ) { $block_name = isset( $block->blockName ) ? $block->blockName : ''; $blocks_that_should_be_registered = array( 'normal block', 'columns block', 'inner block' ); $times = 1; if ( $type ) { $times = in_array( $type, ...
[ "public function is_registered( $name ) {\n\t\treturn isset( $this->registered_block_types[ $name ] );\n\t}", "public function hasBlock(string $name): bool;", "public function is_registered( $block_name, $block_style_name ) {\n\t\treturn isset( $this->registered_block_styles[ $block_name ][ $block_style_name ] ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Split controller name into module and controller name
private function split_controller_name( $controller ) { $match = array(); if(!@preg_match("/^([A-Z]{1}[a-z0-9]+)([a-zA-Z0-9]+)/", $controller, $match)) { throw new JapaPageControllerException('Wrong controller call name: ' . $controller); } // we push controller n...
[ "protected function getModuleFromControllerName() \r\n {\r\n $controller_name = get_class($this);\r\n return strtolower(preg_replace('/_(.*?)$/i', '', $controller_name));\r\n }", "public function GetControllerName ();", "public function getControllerName();", "public function getController...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add Sigma Events Administration Help Tabs Add help tabs describing options available during various administrative tasks in WordPress backend.
function add_help_tabs(){ global $post_type; global $action; if('events' == $post_type || 'products' == $post_type && 'edit' == $action ): include SIGMA_PATH . 'admin/help/help-events.php'; $screen = get_current_screen(); $screen->add_help_tab( sigma_ema...
[ "public function add_help_tab()\n {\n }", "function tutsplus_add_help_tab() {\n\t\n\t$screen = get_current_screen();\n\t$screen->add_help_tab( array (\n\t\t'id' => 'tutsplus_admin_help_tab',\n\t\t'title' => 'Help with your site',\n\t\t'callback' => 'tutsplus_admin_help_callback'\n\t\n\t));\n\t\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End the current session and clear local session
public function endSession() { $session = CheckfrontModule::session(); if ($sessionID = $session->getID()) { CheckfrontModule::api()->post( new CheckfrontAPIRequest( 'session/end', array( 'session_id' => $sessio...
[ "private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }", "public function finish() {\n session_destroy();\n Util::redis()->delete(\"session_\" . $this->sessionId);\n Util::noSessionRedirect();\n }", "private function en...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if a file should be created
public function createFileCheck() { if (file_exists($this->path . $this->getClassFilename())) { return $this->overwrite; } return true; }
[ "public function testCreateFile()\n {\n $this->assertTrue( $this->fs->createFile( OUTPUT_DIR . $this->_testFile ) );\n\n $this->assertTrue( file_exists( OUTPUT_DIR . $this->_testFile ) );\n }", "function createFile($filename){\n if(file_exists($filename)){\n return false;\n } else...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the answer "created" event.
public function created(Answer $answer) { $subject = config('settings.sns.subjects.ANSWER_CREATE'); app(SendNotification::class)->handle($subject, $this->getNotificationData($answer)); }
[ "public function created(Answer $answer)\n {\n //\n }", "public function created(AnswerOption $answerOption)\n {\n //\n }", "public function handleOfferCreated(OfferCreated $event)\n { \n $event->tender->user->notify(new OfferWasCreated($event->tender, $event->offer));...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
\brief Retrieves and sends the requested version file for the document \param[in] docId The document ID passed in \param[in] strVersion The string version number passed in \return true if the file was sent successfully false with set message to output to the client
function SendFile($docId, $strVersion) { global $documentUploadPath; $file = $this->GetFile($docId, $strVersion); if(sizeof($file) == 0) { return $this->results->Set('false', "No file record found."); } $file= $documentUploadPath.$file; /* Send it out to the client */ head...
[ "function downloadVersionedPhysicalDocument($iDocumentID, $sVersion) {\n //get the document\n $oDocument = & Document::get($iDocumentID);\n //get the path to the document on the server\n $sDocumentFileSystemPath = $oDocument->getPath() . \"-$sVersion\";\n if (f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets query for [[Apparaat]].
public function getApparaat() { //hier zijn de joins die ik in de database hebt gemmaakt. return $this->hasOne(Apparaten::className(), ['id' => 'apparaatID']); }
[ "public function alipayQuery()\r\n {\r\n $alipayQueryBuilder = new AlipayContentBuilder();\r\n $alipayQueryBuilder->setOutTradeNo(1503545268);\r\n $query = new AlipayService();\r\n $result = $query->queryResult($alipayQueryBuilder);\r\n halt($result);\r\n // retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test load Xlsx file without cell reference.
public function testLoadXlsxWithoutCellReference() { $filename = './data/Reader/XLSX/without_cell_reference.xlsx'; $reader = new Xlsx(); $reader->load($filename); }
[ "public function testLoadXlsxWithEmptyStyles(): void\n {\n $filename = 'tests/data/Reader/XLSX/issue.2246b.xlsx';\n $reader = new Xlsx();\n $spreadsheet = $reader->load($filename);\n\n $tempFilename = File::temporaryFilename();\n $writer = IOFactory::createWriter($spreadsheet, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns array of active dot separated tags
public static function getActiveTags(){ return self::$activeTags; }
[ "public function getTagsarray() {\n\t\t$tags = $this->getTags();\n\t\t$tags = str_replace(array(' ', ';', '.'), ',', $tags);\n\t\treturn t3lib_div::trimExplode(',', $tags, 1);\n\t}", "protected function getTags() : array\n {\n $tags = $this->{static::$tagsField};\n \n\t\treturn Strings::explode($...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation auManagerRosterShiftGetRosterShift Get Roster Shift by ID
public function auManagerRosterShiftGetRosterShift($roster_shift_id, $business_id, $include_costs = false, string $contentType = self::contentTypes['auManagerRosterShiftGetRosterShift'][0]) { list($response) = $this->auManagerRosterShiftGetRosterShiftWithHttpInfo($roster_shift_id, $business_id, $include_cos...
[ "public function get_shift($id) {\n $sql = \"SELECT * FROM {$this->database}.shift where id={$id}\"; // XXX should use prepared statements\n $result = $this->query($sql);\n $nrows = mysql_numrows($result);\n if ($nrows < 1) {\n throw new ShiftMgrException (\n __class__.'::'.__M...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build the default SoapFaultConverter By default, we pool together all existing SoapFaultConverters
public function build() { return new PooledSoapFaultConverter( [ new AuthenticationFailureConverter(), new ConnectionFailureConverter(), ] ); }
[ "public function IterateFaultAndPrepareException($fault)\n {\n if (!$this->verifyFault($fault)) {\n return null;\n }\n // Collect information from XML entity\n $type = (string)$fault->attributes()->type;\n list($message, $code) = $this->arrayToMessageAnd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Edits an existing Sortie entity.
public function updateAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('SFCapBundle:Sortie')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Sortie entity.'); } $deleteForm =...
[ "public function updated(VoceOrdine $voceOrdine)\n {\n //\n }", "private function edit()\n {\n //Load and store parameters\n $article_id = (int)$this->Request->get('article_id');\n $type = (int)$this->Request->get('type');\n $title = $this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show the app dashboard
static function dashboard () { Viewer::view('app_dashboard'); }
[ "public function dashboard()\n {\n return view('OnionEngineDashboard::index');\n }", "private function showDashboard()\n {\n //Si es Admin\n if($this->registry->getObject('authenticate')->getUser()->isAdmin())\n {\n $this->registry->getObject('template')->buildFromTemplates(\n $...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get meta description length
public function getMetaDescriptionLength();
[ "public function getMetaDescriptionLength()\n {\n return parent::getData(self::META_DESCRIPTION_LENGTH);\n }", "protected function length()\n {\n if (!isset($this->meta['length'])) {\n $this->meta['length'] = strlen($this->raw_data);\n }\n\n return $this->meta['leng...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
annoncer le service oembed dans le head des pages publiques
function oembed_insert_head($head) { if(lire_config('oembed/inserer_head')=='non') { return $head; } $service = 'oembed.api/'; $ins = '<link rel="alternate" type="application/json+oembed" href="<?php include_spip(\'inc/filtres_mini\');echo parametre_url(url_absolue("'.parametre_url($service, 'format', 'json')....
[ "function wp_filter_pre_oembed_result($result, $url, $args)\n{\n}", "public function embed_scripts() {}", "function wp_oembed_add_host_js()\n{\n}", "function embed(){\n\t\techo $this->embedjw();\n\t}", "public function embed()\n {\n global $page_output, $registry;\n\n /* First, determine th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates styles for sticky haeder
function moments_qodef_sticky_header_styles() { if(moments_qodef_options()->getOptionValue('sticky_header_in_grid') == 'yes' && moments_qodef_options()->getOptionValue('sticky_header_grid_background_color') !== '') { $sticky_header_grid_background_color = moments_qodef_options()->getOptionVa...
[ "function goodwish_edge_sticky_header_styles() {\n global $goodwish_edge_options;\n\n if($goodwish_edge_options['sticky_header_in_grid'] == 'yes' && $goodwish_edge_options['sticky_header_grid_background_color'] !== '') {\n $sticky_header_grid_background_color = $goodwish_edge_options...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the key parameter keyword for the given controller type.
public static function getKeyParamKeyword($controller) { if ( $controller == self::ACT_CONTROLLER ) { return self::ACT_KEY_PARAM; } else if ( $controller == self::DOC_CONTROLLER ) { return self::DOC_KEY_PARAM; } else if ( self::isASetti...
[ "public function getRouteParamKeyForType($type)\n {\n switch ($type) {\n case 'busReg':\n return 'busRegId';\n case 'irfoOrganisation':\n return 'organisation';\n case 'irhpApplication':\n return 'irhpAppId';\n defaul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display the specified MachineIde.
public function show($id) { $machineIde = $this->machineIdeRepository->findWithoutFail($id); if (empty($machineIde)) { Flash::error('没有找到该机器'); return redirect(route('machineIdes.index')); } return view('admin.machine_ides.show')->with('machineIde', $machin...
[ "static function showForVirtualMachine(Computer $comp) {\n\n $ID = $comp->fields['id'];\n\n if (!$comp->getFromDB($ID) || !$comp->can($ID, READ)) {\n return;\n }\n\n echo \"<div class='center'>\";\n\n if (isset($comp->fields['uuid']) && ($comp->fields['uuid'] != '')) {\n $ho...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform an action on an item.
function itemAction(ItemActionSelector $action);
[ "protected function itemAction($user_id, $item_id, $action) {\n $this->apiCall('actions/u2i.json', 'POST', array('pio_uid' => $user_id, 'pio_iid' => $item_id, 'pio_action' => $action));\n }", "public function process($item);", "public function processItem(): void;", "protected function executeCurre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter method. Duration for which the saved state information is considered valid. After this period has elapsed the state will be returned to the default. This option is also used to indicate to DataTables if localStorage or sessionStorage should be used for storing the table's state. When set to 1 sessionStorage will...
public function getStateDuration(): int { return (int)$this->_getConfig('stateDuration'); }
[ "protected function saveStateTime() {\n $this->_save($this->aConfig['state_time_storage'], array(\n $this->tStateStart, $this->tStateEnd,\n $this->nStateTimeout, $this->tStateRun, $this->tStateStop\n ));\n }", "public function getStoredState();", "protected function loadSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: create Insert a new entry to the database Parameters: attrs (Array) A key value array of the information to be stored Returns: A key value array of the saved item, plus the unique id
public function create(Array $attrs) { foreach ($attrs as $key => $value) { $attrs[$key] = strip_tags($value); } $sql = "INSERT INTO $this->model "; $sql .= '(' . implode(', ', array_keys($attrs)) . ') '; $sql .= 'VALUES (' . implode(',', array_fill(0, count($attrs),...
[ "function insert_set_attrs( $attrs )\n\t{\n\t\t$res = $this->db->insert_batch( 'mb_set_attributes', $attrs );\n\n\t\tif ( $res )\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private static function insert_row($table, $attributes){\n\t\t\t$query = \"INSER...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the JavaScript resource(s) specified by $urls. Resource will be loaded asynchronously by default.
public function loadJavaScriptResource($urls, array $options = array('async' => true)) { return parent::loadJavaScriptResource($urls, $options); }
[ "protected function loadJavascript() {}", "private function loadResources()\n {\n $resources = '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Css/Main.css\" />';\n $resources .= '<link rel=\"stylesheet\" type=\"text/css\" href...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wallet function Inform site about transactions affecting the wallet. URI: /callback/wallet/$txn_id
public function wallet($txn_id = NULL){ // Abort if no transaction ID is supplied. if($txn_id == NULL) return FALSE; $this->load->library('bw_bitcoin'); $this->load->model('bitcoin_model'); $this->bw_bitcoin->walletnotify($txn_id); }
[ "public function walletnotify($txn_id){\n\t\t$this->bw_bitcoin->walletnotify($txn_id);\n\t}", "function wallet_notify($transaction_id)\r\n\t{\r\n\t\t$result['status'] = 0;\r\n\t\t//$transaction_id = '797aa470d4ca6c362ce38de41422d794224e938d860c942ee44776c583229e54';\r\n\t\t//$a = $this->rpc_connection->gettransac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the national levels
public function updateNationLevels() { $constants=Constants::model()->findbyPk(1); $round=Round::model()->findbyPk($constants->roundId); if($round!==null){ // loop calculating nation levels $criteria=new CDbCriteria; $condition="roundId = ".$round->roundId." AND victoryTime > ".(time() - 86400); // 24...
[ "public function setNumLevels($numLevels);", "public function setNationality($value)\n {\n $this->nationality = $value;\n }", "protected function setLevelInfo() {\n\t\tforeach($this->plugin->getSettings()->getNested(\"xp.levels\") as $key => $data) {\n\t\t\t$this->levels[$key] = LevelInfo::fromArra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement getIterator() method.
public function getIterator() { }
[ "public function getIterator()\n {\n }", "public function getIterator();", "public function getIterator(): \\Iterator\n {\n return parent::getIterator();\n }", "public function getInnerIterator () {}", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator( $this->data );\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is object already viewed by user?
protected function isViewed($id){ if(!Auth::check()) { $viewed = \Session::get($this->get_view_key($id)); if(!empty($viewed)) return true; } else { $userAction = UserCounters::where('action', 'view')->where('class_name', snake_case(get_class($this))) ...
[ "public function isViewed()\n {\n if (!\\Auth::user()) {\n $viewed = \\Session::get($this->get_view_key());\n if (!empty($viewed)) {\n return true;\n }\n } else {\n $user_action = $this->user_counters()\n ->where('action', 'v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Slugify a full file name with file extension.
public function slugifyFile(string $fileName) : string { // Retrieve extension $explodedFileName = explode('.', $fileName); $extension = end($explodedFileName); // Remove extension $string = preg_replace('/.[^.]*$/', '', $fileName); return $this->slugify($string).'...
[ "public function slugifyFile($fileName);", "public function slugFileName($file_name, $extension) : string\n {\n return \\Str::slug($file_name) . '.' . $extension;\n // return $this->slugify($file_name) . '.' . $extension;\n }", "private static function slugify($filename) {\n\n if (!is...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of id_source.
public function getIdSource() { return $this->id_source; }
[ "public function getSourceId()\n {\n return $this->getData('source_id');\n }", "public function getSourceId() {\n return $this->_source_id;\n }", "public function getSourceID()\n {\n return $this->sourceID;\n }", "function getSourceID() {\n\t\treturn $this->_SourceID;\n\t}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find the page by the id, give the subject_id , send it to find subject by id.
function subject_name_by_page_id($id){ global $db; $sql="SELECT * FROM pages WHERE id={$id}"; $result_set=mysqli_query($db,$sql); $page=mysqli_fetch_assoc($result_set); $subject= find_subject_by_id($page['subject_id']); return $subject['menu_name']; }
[ "function find_pages_by_subject_id($id, $options=[]){\n\t\tglobal $db;\n\t\t//$visible = $options['visible'] ?? 'false';\n\t\t$visible = isset($options['visible']) ? $options['visible'] : 'false';\n\t\t$sql = \"SELECT * FROM pages \";\n\t\t$sql .= \"WHERE subject_id='\" . db_escape($db, $id) . \"' \";\n\t\tif ($vis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes all classes required for displaying flash messages.
protected function initializeFashMessageClasses() { if (isset($this->flashMessageService)) { return; } $this->flashMessageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService'); $this->languageService = $GLOBALS['LANG']; }
[ "function flashMessengerInit()\n\t{\n\t\t/* Getting instance of FlashMessenger Action Helper */\n\t\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t\n\t\t/* Getting stored messages on FlashMessenger and setting in view */\n\t\t$this->view->flashMessengerAlerts = $this->_flashMessenger->g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add WooCommerce as reviews source.
public function reviews_source( $data ) { $data['options']['woocommerce'] = 'WooCommerce'; foreach ( $this->get_fields() as $field_key => $field_data ) { if ( 'woo_template' == $field_key ) { continue; } $data['toggle']['woocommerce']['fields'][] = $field_key; } $data['toggle']['woocommerce']['f...
[ "private function addReviews()\n {\n $this->_doQuery(\n \"\n INSERT INTO \" . $this->_getTableName(\n 'catalog_product_entity_text'\n ) . \" (\n attribute_id,\n store_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Interpolates context values into the message placeholders.
function interpolate($message, array $context = array()) { $replace = array(); foreach ($context as $key => $val) { $replace['{' . $key . '}'] = $val; } return strtr($message, $replace); }
[ "function interpolate($message, array $context = array()) {\n\t// build a replacement array with braces around the context keys\n\t$replace = array();\n\tforeach ($context as $key => $val) {\n\t\t$replace['{' . $key . '}'] = $val;\n\t}\n\t// interpolate replacement values into the message and return\n\treturn strtr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks a hash against the db to see if we should avoid sending the error report too many times. The system sends at most one report a day.
public static function shouldThrottleReport($hash) { if (!class_exists('Application\\DeskPRO\\App')) { return false; } try { $db = App::getDb(); $exist_date = $db->fetchColumn(" SELECT date_expire FROM tmp_data WHERE name = ? LIMIT 1 ", array('submitreport_' . $hash)); if ($exist...
[ "public function doHashCheck()\n {\n // some sql to select fields from oxarticles,\n // calculate hash and compare it to snapshot item hash.\n }", "static function hashCheck($form, $hash) {\n\t\t\t$form = sqlescape($form);\n\t\t\t$hash = sqlescape($hash);\n\t\t\t$result = sqlfetch(sqlquery(\"S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for getPackingPlanTags Get the tags for a packingPlan..
public function testGetPackingPlanTags() { }
[ "function TestPlan_get_tags($plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.get_tags', array(new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function test_getReplenishmentPlanTags() {\n\n }", "public function testGetFulfillmentPlanT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation executeSepaDirectDebitAsync Execute SEPA Direct Debit
public function executeSepaDirectDebitAsync($body) { return $this->executeSepaDirectDebitAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; } ); }
[ "public function isSepaDirectDebitPossible();", "public function requestSepaDirectDebitAsync($body)\n {\n return $this->requestSepaDirectDebitAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get file content of the record
public function getFileContent(\Models\Record $record, $is_bag, $database_address);
[ "public function getFileContents()\n {\n return $this->get('FileContents');\n }", "public function getFileContent()\n {\n return $this->fileContent;\n }", "public function getRecord()\n {\n return $this->_content;\n }", "public function getFileContent(): string\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether or not the current user can suspend/unsuspend a member.
public function canSuspend($member) { // The user must be an administrator, or they must have the "canSuspend" permission and the member's // account be either "member" or "suspended". A user cannot suspend or unsuspend themselves, and the root // admin cannot be suspended. return ( ET::$session->isAdmin() or ...
[ "public static function is_member()\n {\n static $is_member = NULL;\n if (NULL !== $is_member)\n return ($is_member);\n\n $role = self::_get_role();\n // banned, and registered/verified but not approved users are not full members\n if ('ban' === $role || 'register' =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsyncWithHttpInfo Delete Checkout Consignment
public function checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsyncWithHttpInfo($checkout_id, $accept, $content_type, $consignment_id) { $returnType = '\BigCommerce\Api\V3\Model\Checkout\Checkout1'; $request = $this->checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteRequest($checkout_i...
[ "public function checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsync($checkout_id, $accept, $content_type, $consignment_id)\n {\n return $this->checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsyncWithHttpInfo($checkout_id, $accept, $content_type, $consignment_id)\n ->then(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if the given user can manage the categories.
public function manage_categories(User $user) { return $user->can_manage_categories; }
[ "public function manage(User $user)\n {\n return $user->can('manage-tag');\n }", "public function view(User $user) {\n return $user->can('view-category');\n }", "function canAdd($user) {\n \treturn $user->isAdministrator() || $user->getSystemPermission('can_add_documents') && (boolean)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetAsync Retrieves a list of custom field values for a sales order.
public function salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetAsync($accept, $invoice_id, $jiwa_stateful = null) { return $this->salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetAsyncWithHttpInfo($accept, $invoice_id, $jiwa_stateful) ->then( ...
[ "public function salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGet($accept, $invoice_id, $jiwa_stateful = null)\n {\n list($response) = $this->salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetWithHttpInfo($accept, $invoice_id, $jiwa_stateful);\n return $res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generated from protobuf field .common.Block block = 2;
public function getBlock() { return $this->readOneof(2); }
[ "public function getBlock()\n {\n return $this->block;\n }", "public function getGenericBlock();", "private function getBlock()\n {\n\n return $this->block;\n }", "public function getBlock() {\n\t\treturn $this->block;\n\t}", "public function setBlock($block) : Field {\n // reme...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Purge any styles that do not have corresponding elements.
public function purgeStylesWithoutElements() { $selectors = $this->getSeletors(); $styles = $this->getStyles(); foreach ($styles as $key => $style) { if (!in_array($key, $selectors)) { unset($styles[$key]); } } $this->styles = $styles; ...
[ "public function removeCSS();", "function qed_flush_style_cache() {\r\n\t\tdelete_transient( 'qed_generated_styles_list' );\r\n\t\tdelete_transient( 'qed_generated_styles_list_rtl' );\r\n\t}", "public function clearStylesheets()\n {\n foreach (array_keys($this->getStylesheets()) as $file)\n {\n $thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the AdditionalLocationInfo and returns this instance
public function withAdditionalLocationInfo($value) { $this->setAdditionalLocationInfo($value); return $this; }
[ "public function setAdditionalLocationInfo($value) \n {\n $this->_fields['AdditionalLocationInfo']['FieldValue'] = $value;\n return $this;\n }", "public function setAdditionalInfo(array $additionalInfo) {\n $this->additionalInfo = $additionalInfo;\n return $this;\n }", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
populate columns headers from columns in $this>table
private function fetchColumnHeading() { $headings = array(); foreach ($this->table->getColumns() as $key => $details) { $columnName = $this->getController()->translate($details['label']); /** * NB excel cannot have columns called 'ID' causes a format failure ...
[ "private function prepare_column_headers() {\n\n\t\t$this->_column_headers = [\n\t\t\t$this->get_columns(),\n\t\t\t[],\n\t\t\t[],\n\t\t];\n\t}", "private function setup_columns() {\n\t\t$this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() );\n\t}", "public function getCol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds edit count of both users
private function mergeEditcount() { $dbw = wfGetDB( DB_MASTER ); $dbw->startAtomic( __METHOD__ ); $totalEdits = $dbw->selectField( 'user', 'SUM(user_editcount)', [ 'user_id' => [ $this->newUser->getId(), $this->oldUser->getId() ] ], __METHOD__ ); $totalEdits = (int)$totalEdits; # don't run qu...
[ "private function mergeEditcount( $newuserID, $olduserID ) {\n\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\t\n\t\t# old user edit count\n\t\t$result = $dbw->selectField( 'user',\n\t\t\t\t'user_editcount',\n\t\t\t\tarray( 'user_id' => $olduserID ),\n\t\t\t\t__METHOD__\n\t\t\t );\n\t\t$row = $dbw->fetchRow($result);\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public helper methods Convert a stage id into a stage path
function getPathFromId($stageId) { static $stageMapping = array( WORKFLOW_STAGE_ID_SUBMISSION => WORKFLOW_STAGE_PATH_SUBMISSION, WORKFLOW_STAGE_ID_INTERNAL_REVIEW => WORKFLOW_STAGE_PATH_INTERNAL_REVIEW, WORKFLOW_STAGE_ID_EXTERNAL_REVIEW => WORKFLOW_STAGE_PATH_EXTERNAL_REVIEW, WORKFLOW_STAGE_ID_EDITING => ...
[ "public function getStageName($id) {\n \t$row = $this->find($id)->current();\n \tif (!$row) {\n \t\tthrow new Exception(Zend_Registry::get('Zend_Translate')->_('Stage').\" id $id does not exist\");\n \t}\n \treturn $row['stage'];\n }", "public function idToPath($id);", "public function idToPat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for patchDestination Perform a partial update to a data export destination..
public function testPatchDestination() { }
[ "public function testPatchLocation()\n {\n }", "public function testUpdateExternalShipment()\n {\n }", "public function testUpdateDataSource1(){\n try{\n/* $and = false;\n $filter['file_name']=\"test\";\n $filter['file_url']=\"test40\";\n $filter['a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation bindersBinderComboValuesAsync This call updates the possible values for a combo custom binder field
public function bindersBinderComboValuesAsync($request) { return $this->bindersBinderComboValuesAsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; } ); }
[ "public function bindersBinderComboValuesAsyncWithHttpInfo($request)\n {\n $returnType = '';\n $request = $this->bindersBinderComboValuesRequest($request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolves a user using the given $data and returns it.
public function resolveUser($data) { return call_user_func($this->userResolver, $data); }
[ "protected function resolveUser()\n {\n return call_user_func($this->userResolver);\n }", "public function resolve_user() {\n global $mt;\n\n // The designated company/institution code for CCSA\n $staff_id = $mt->config('imisadminaccountid');\n\n // Active statuses are: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function pageLoads This function Will be called on each page load and will check for any form submission. Database Tables used in this function are : None Use Instruction : $objPage>pageLoad();
public function pageLoad() { $objCore = new Core(); $objWholesaler = new Wholesaler(); //$this->arrShippingList = $objWholesaler->shippingGatewayList(); $this->arrCountryList = $objWholesaler->countryList(); global $objGeneral; $varPortalFilter = $objGeneral->countryPorta...
[ "public function pageLoad()\n {\n global $objGeneral;\n global $oCache;\n $objCore = new Core();\n $objReport = new Reports();\n $objClassCommon = new ClassCommon();\n \n if(isset($_REQUEST['section']) && $_REQUEST['section'] != ''){ /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers a user base don email, passwrod, phone number and phone country code
public function register($email, $password, $phoneNumber, $phn_country) { $password = md5($password); $sqlQuery = "INSERT INTO user_accounts(user_email, user_passwords, user_phone_number, user_phn_country_code, user_admin) VALUES ('$email', '$password', '$phoneNumber', '$phn_country', '0')...
[ "public function classic_register()\n\t\t{\n\t\t\t$user_export = new user_no_id();\n\t\t\t\n\t\t\t$user_export->name = $_POST[\"name\"];\n\t\t\t$user_export->email =$_POST[\"email\"];\n\t\t\t$user_export->password = $_POST[\"password\"];\n\t\t\t$user_export->type = \"CLASSIC\";\n\t\t\t\n\t\t\t$this->add_new_user($u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
compareSub() Binary safe comparison of this string from an offset, up to length characters to a substring provided for comparison.
public function compareSub( String $string, Integer $offset, Integer $length, Boolean $case = NULL ) { if( is_null($case) ) $case = new Boolean(false); switch( $case->bool() ) { case true: $equals = (int) substr_compare($this->string, $string, $offset->int(), $length->int(), false); break; case false:...
[ "function substr_compare ($main_str, $str, $offset, $length = null, $case_insensitivity = null) {}", "final public static function compare($mainStr, $str, $offset = 0, $length = null) {\n\t\treturn substr_compare($mainStr, $str, $offset = 0, $length);\n\t}", "public function testSubstr() {\n\n\t\t$str = new Byt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test if can get the lookahead token if iterator mode is set to FIFO.
public function testGetLookaheadInFifoMode(TokenStream $stream) { // user.name.split(" ").join("-") $stream->setIteratorMode(TokenStream::IT_MODE_FIFO); $stream->rewind(); $this->assertSame($stream->getLookahead()->getCode(), self::T_POINT); $this->assertSame($stream->getLookahead(1)->getCode(), self::T_POI...
[ "function yy_is_expected_token($token)\n {\n if ($token === 0) {\n return true; // 0 is not part of this\n }\n $state = $this->yystack[$this->yyidx]->stateno;\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\n return true;\n }\n $sta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement finTravelLink() method.
function finTravelLink(): ITravelLinkStruct|null { }
[ "public function findNextLink();", "public function completeLink(Link $link): Link;", "function Search_TravelLinks($char_loc,$link_ref) {\r\n\t\tif($char_loc['nlink'] == $link_ref) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif($char_loc['elink'] == $link_ref) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif($char_loc['slink...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the Delivery Term An identifier that determines the vendor or customer jurisdiction in which the title transfer of a supply takes place. This is also known as Shipping Terms. Delivery Terms information could be critical to determine the place of supply, for example, in distance selling. To calculate tax when t...
public function getDeliveryTerm();
[ "public function setDeliveryTerm($deliveryTerm);", "public function getDeliveryTerms() {\n return $this->deliveryTerms;\n }", "public function getDeliveryTerms()\n {\n return $this->deliveryTerms;\n }", "public function getTerm() {\n \treturn $this->getOffering()->getTerm();\n\t}", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will save new customer reviews
public function actionSaveReview() { if (Yii::$app->request->isAjax) { $model_review = new \common\models\CustomerReviews(); if ($model_review->load(Yii::$app->request->post())) { $model_review->user_id = Yii::$app->user->identity->id; $model_review...
[ "private function _saveCustomer() {\n }", "public function actionAddReview() {\n\n\t\tif (Yii::$app->request->isAjax) {\n\t\t\t$model_review = new \\common\\models\\CustomerReviews();\n\t\t\tif ($model_review->load(Yii::$app->request->post())) {\n\t\t\t\t$model_review->user_id = Yii::$app->user->identity->id;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Name: get_tempalte_id Description: Get the ID of the email template used to create the message. This will be assigned as the 'post_parent' ID.
public function get_tempalte_id(){ $template = get_page_by_path( $this->tempalte_slug, OBJECT, 'nnnoticetemplate' ); return ( $template )? $template->ID : 0 ; }
[ "public function get_template_id() \n {\n return $this->template_id;\n }", "public function getTemplateId()\n {\n return $this->template_id;\n }", "function getTemplateRefId()\n\t{\n\t\treturn $this->tref_id;\n\t}", "public function getTemplateId()\n\t{\n\t\treturn $this->templateId;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load a specific locale using a locale code.
public static function loadLocale($locale_code) { $all_locales = self::loadAllLocales(); $locale = idx($all_locales, $locale_code); if (!$locale) { throw new Exception( pht( 'There is no locale with the locale code "%s".', $locale_code)); } return $locale; }
[ "public function load($code = null, $path = null)\n {\n if (!$code) {\n $code = $this->default['code'];\n }\n \n if (!$path) {\n $path = $this->default['path'];\n }\n\n $file = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $code . '.php'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if the incoming entry is a query.
public function isQuery() { return $this->type === EntryType::QUERY; }
[ "public function hasQueryType()\n {\n return $this->query_type !== null;\n }", "private function isIntrospectionQueryRequest()\n {\n return request() && preg_match(\n '/\\s*__(type|schema|typekind|field|directive|directivelocation|inputvalue|enumvalue)\\s*(\\(|\\{)/i',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a thumbnail from the given photo.
public static function createFromPhoto(?Photo $photo): ?Thumb { $thumb = $photo?->size_variants->getThumb(); if ($thumb === null) { return null; } $thumb2x = $photo->size_variants->getThumb2x(); return new self( $photo->id, $photo->type, $thumb->url, $thumb2x?->url ); }
[ "protected function create_thumbnail()\n\t{\n\t\tif ($this->file_data['thumbnail'])\n\t\t{\n\t\t\t$source = $this->file->get('destination_file');\n\t\t\t$destination = $this->file->get('destination_path') . '/thumb_' . $this->file->get('realname');\n\n\t\t\tif (!create_thumbnail($source, $destination, $this->file->...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the equivalent taxonomy in the specified language.
function bbl_get_taxonomy_in_lang( $taxonomy, $lang_code = null ) { global $bbl_taxonomies; return $bbl_taxonomies->get_taxonomy_in_lang( $taxonomy, $lang_code ); }
[ "function custom_taxonomy() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Languages', 'Taxonomy General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Language', 'Taxonomy Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Language', 'text_domain' ),\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the type rs.
public function setTypeRs($typeRs) { $this->typeRs = $typeRs; return $this; }
[ "public function setResType($value)\n {\n return $this->set(self::RES_TYPE, $value);\n }", "function setType($t){\r\n\t\t\t$this->_type=$t;\r\n\t\t}", "protected function setQueryType($type) {\n\t$this->QType=$type;\t\n\t}", "function set_type($val){\n\t\tif(is_object($this->_calendar)){\n\t\t\t$...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Set the Actual Min Price of the search and catalog collection
public function setMinPrice(){ if( (isset($_GET['q']) && !isset($_GET['min'])) || !isset($_GET['q'])){ $this->_minPrice = $this->_productCollection->getMinPrice(); $this->_searchSession->setMinPrice($this->_minPrice); }else{ $this->_minPrice = $this->_searchSession->getMinPrice(); } }
[ "public function setMinPrice()\n {\n if (\n (isset($_GET['q']) && !isset($_GET['min'])) ||\n ! isset($_GET['q'])\n ) {\n if (Mage::getVersion() < '1.7.0.2') {\n $this->_productCollection->getSelect()->reset('order');\n $this->_productCo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to check if the Min is Bigger than the Max
function isBigger($min, $max){ if ($min > $max){ return true; } else{ return false; } }
[ "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function isUpperBoundValidator(): bool {\n return $this->min < 0 && $this->max > 0;\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation managerDocumentDownloadAsyncWithHttpInfo Download Document
public function managerDocumentDownloadAsyncWithHttpInfo($document_id, $business_id, $employee_id, string $contentType = self::contentTypes['managerDocumentDownload'][0]) { $returnType = ''; $request = $this->managerDocumentDownloadRequest($document_id, $business_id, $employee_id, $contentType); ...
[ "public function action_doc_quick_download()\n\t{\n\t\t$document_id = $this->request->param('id');\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t$kt_connection->initSession($knowledgetree_data['username'], $know...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will this box fit in line? (or need to create new one).
public function willFit(Box $box) { $childrenWidth = $this->getChildrenWidth(); $availableSpace = $this->getDimensions()->computeAvailableSpace(); $boxWidth = $box->getDimensions()->getWidth(); if (!$boxWidth) { $boxWidth = $box->getDimensions()->getOuterWidth(); } return Math::comp(Math::sub($availabl...
[ "private function makeBox()\n {\n $wordBox = imageftbbox($this->fontSize, 0, $this->font, $this->text);\n\n $wordBoxWidth = $wordBox[2];\n $wordBoxHeight = $wordBox[1] + abs($wordBox[7]);\n\n // Setting box properties\n $this->containerWidth = $wordBoxWidth + ($this->padding * ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the tenant "creating" event.
public function creating(Model $tenant) { $this->setTenantStatus($tenant); }
[ "public function creating(Tenant $tenant)\n {\n //dd( $tenant );\n }", "public function postCreate(TenantRequest $request)\n {\n $tenant = $this->tenantServices->registerTenant($request->all());\n\n do_action(BASE_ACTION_AFTER_CREATE_CONTENT, TENANT_MODULE_SCREEN_NAME, $request, $tena...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the appliction.encoding without needing to request it from Config::get() each time.
protected static function encoding() { return static::$encoding; }
[ "private function get_encoding()\n {\n return $this->encoding;\n }", "public function getEncoding() {\n\t\tif ( sizeof( $this->json['encoding'] ) > 1 ) {\n\t\t\tthrow new AppConfigException( sprintf( 'More than one encoding defined (%d)', sizeof( $this->json['encoding'] ) ) );\n\t\t}\n\t\treturn $thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
store ipdc products in xml
private function setXml(){ $uri = str_replace('{action}', 'ZoekProducten', $this->getApi()); $response = \Drupal::httpClient()->get($uri, ['headers' => ['Accept' => 'application/xml'], 'query' => ['_format' => 'xml_extended']]); if(!empty($response->getBody()) && $response->getStatusCode() ==...
[ "function createProduct($xml, $s1, $s2, $s3, $s4) {\n\t\n\t/*\n\t * $current_b_tag = $xmlDoc->getElementById ( \"produit\" ); $new_b_tag = $mydoc->createElement ( \"id\" ); $new_b_tag->nodeValue = $s1; $result = $mydoc->getElementById ( \"myBody\" ); $result->replaceChild ( $new_b_tag, $current_b_tag );\n\t */\n\t$...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts an amount from the base unit to the micro unit.
public static function baseToMicro($amount): int { return $amount ? (int)($amount * 1000000) : 0; }
[ "protected function convertMilliToMicro($value)\n {\n return $value * 1000;\n }", "public function setAmountMicrosUnwrapped($var)\n {\n $this->writeWrapperValue(\"amount_micros\", $var);\n return $this;}", "public function setBillableUnitMicrosUnwrapped($var)\n {\n $this-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes a decision about whether to add info about the scope
protected function _addWhetherScopeInfo() { return true; }
[ "protected function _addWhetherScopeInfo()\n {\n return false;\n }", "protected function determine_scope()\n {\n }", "private function determine_scope()\n {\n }", "function hasScope();", "protected function _addWhetherScopeInfo()\n {\n $fieldConfig = $this-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
settings OPTIONS : Import or Export settings from/to file [file=] : The settings file to load EXAMPLES wp rocket load_settings file=settings23042.json
public function settings($args = array() , $assoc_args = array()) { if ( $args[0] == 'import') { if (!empty($assoc_args['file'])) { $settings = file_get_contents($assoc_args['file']); $settings = json_decode($settings, true); if (null ...
[ "private function import_settings()\n {\n }", "function import($args, $assoc_args)\n {\n $settings = C_NextGen_Settings::get_instance();\n $file_content = file_get_contents($args[0]);\n $json = json_decode($file_content);\n\n if ($json === NULL)\n WP_CLI::er...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
index all classes by classname at aids
private function _index_classes() { $ix = array(); $aix = $this->attr_idx; foreach ($this->attribs as $aid => &$a) { if (!empty($a['class'])) { $cl = $a['class']; if (!is_array($cl)) { $cl = preg_split('|\\s+|', trim($cl)); ...
[ "function classnames_for_block_core_search($attributes)\n {\n }", "private function createIndices()\n {\n $filePath = Config::ROOT_PATH.'src/indices/implementations';\n $fileNames = scandir($filePath);\n foreach ($fileNames as $fileName) {\n $fileInfo = new SplFileInfo($fi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Combines given labels into 1 file and returns it. When a starting location on the page is chosen, up to 3 locations will be left blank. This allows for reusing of label paper that has 1 or more labels already used. The following are the order of positions per page size: PAGE_SIZE_A4 LOCATION_TOP_LEFT LOCATION_TOP_RIGHT...
public function combineLabels( array $files, $pageSize = self::PAGE_SIZE_A4, $startLocation = self::LOCATION_TOP_LEFT, $margin = 0 ) { list($labelsPerRow, $labelsPerColumn) = $this->getLabelsPerPage($pageSize); $labelsPerPage = $labelsPerRow * $labelsPerColumn; ...
[ "public function combineLabels(\n array $files,\n string $pageSize = self::PAGE_SIZE_A4,\n int $startLocation = self::LOCATION_TOP_LEFT,\n int $margin = 0\n ): FileInterface;", "function printLocationProductLabelsAvery5167($pos_location_id, $barcodes, $quantities, $row_offset, $colu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find address information using the zip code.
public function findAddressByZipCode($zipCode);
[ "public function getLocationForZip($zipCode);", "public function zipCodeInfo(){\n\t\t$zip = $_POST['zip'];\n\t\t$url=\"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($zip).\"&sensor=false&key=AIzaSyA863uhw0eIufXkjyziP9nZIo9uJAKo2ZU\";\n\t\t$details=file_get_contents($url);\n\t\t$results=js...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of id_ciudad
public function getId_ciudad() { return $this->id_ciudad; }
[ "function getId_ciudad() {\n return $this->id_ciudad;\n }", "public function getId_ciudad()\n {\n return $this->id_ciudad;\n }", "public function getIdCiudad()\n {\n return $this->id_ciudad;\n }", "public function getCiudad(){\r\n\t return($this->ciudad);\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the custom field primary key for faster access via redis.
public function getCustomFieldPrimaryKey() : string { return Slug::generate(get_class($this) . ' ' . $this->getId()); }
[ "public function primary_key() {\n $field = $this->_primary_key;\n return $this->$field;\n }", "public static function get_primary_key();", "public function get_field_key() {\n\t\treturn $this->get_field_attr( 'field_key' );\n\t}", "function primary_key_value()\n\t{\n\t\treturn( $this->data_id );\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns first action that was recorded for target
public function findFirst($action, $target);
[ "public function getInitialAction()\n {\n if ($actions = $this->Actions()) {\n return $actions->First();\n }\n }", "public function getOneAction()\n\t{\n\t\t// do we have any callbacks to pick from?\n\t\tif (count($this->actionsCallbacks) == 0)\n\t\t{\n\t\t\tthrow new E5xx_NoStoryAc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform the check for the database folder. We do this separately, because it can only be done _after_ the other checks, since we need to have the $config, to see if we even _need_ to do this check.
public function doDatabaseCheck() { $validator = new Validation\Database(); $validator->setPathResolver($this->config->app['path_resolver']); $validator->setConfig($this->config->app['config']); $validator->check(); }
[ "public function doDatabaseCheck($config)\n {\n\n $cfg = $config['general']['database'];\n\n if ($cfg['driver'] != 'sqlite') {\n return;\n }\n\n $filename = isset($cfg['databasename']) ? basename($cfg['databasename']) : \"bolt\";\n if (getExtension($filename)!=\"db\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A basic feature test HasItemInBox.
public function testHasItemInBox() { $box = new Box(['cat','toy','torch']); $this -> assertTrue($box ->has('toy')); $this -> assertTrue($box ->has('ball')); }
[ "public function testHasItemInBox()\n {\n $box = new Box(['cat', 'toy', 'torch']);\n //Se espera que para esta entrada se regrese un True como respuesta,\n //puesto que el elemento toy existe.\n $this->assertTrue($box->has('toy'));\n //Se espera que para...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether image type is GIF.
public final function isGif(): bool { return ($this->getMime() == self::MIME_GIF); }
[ "public function isGIF()\n {\n return $this->extension == 'gif';\n }", "public final function isGif() : bool\n {\n\n return $this->mimeType == 'image/gif';\n\n }", "function isGIF()\r\n {\r\n if($this->_graphic_typ == 1) return true;\r\n else ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that "timeout" method accepts a DateInterval object.
public function testTimeoutDateInterval() { $process = (new Builder)->timeout( new DateInterval('PT18S') )->process(); $this->assertEquals(18, $process->getTimeout()); }
[ "public function checkTimeout();", "public function checkTimeout(){ }", "public function isTimeoutValid(DateInterval $timeout): void\n {\n if ($timeout->invert === 1 || $timeout->s === 0) {\n throw new ValidationException(\n 'Timeout must be greater than zero.',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }